@realsee/five 5.0.0-alpha.100

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 (173) hide show
  1. package/README.md +362 -0
  2. package/TERMS.txt +56 -0
  3. package/docs/.nojekyll +1 -0
  4. package/docs/assets/highlight.css +134 -0
  5. package/docs/assets/icons.css +1043 -0
  6. package/docs/assets/icons.png +0 -0
  7. package/docs/assets/icons@2x.png +0 -0
  8. package/docs/assets/main.js +52 -0
  9. package/docs/assets/search.js +1 -0
  10. package/docs/assets/style.css +1388 -0
  11. package/docs/assets/widgets.png +0 -0
  12. package/docs/assets/widgets@2x.png +0 -0
  13. package/docs/classes/five.AnimationFrameLoop.html +15 -0
  14. package/docs/classes/five.BVH.html +10 -0
  15. package/docs/classes/five.BVHIntersect.html +1 -0
  16. package/docs/classes/five.BVHNode.html +7 -0
  17. package/docs/classes/five.BVHVector3.html +1 -0
  18. package/docs/classes/five.Camera.html +11 -0
  19. package/docs/classes/five.Five.html +303 -0
  20. package/docs/classes/five.InternalWebGLRenderer.html +1 -0
  21. package/docs/classes/five.IntersectMesh.html +1 -0
  22. package/docs/classes/five.LegacyPanoCircleMesh.html +5 -0
  23. package/docs/classes/five.Model.html +77 -0
  24. package/docs/classes/five.NetworkSubscribe.html +50 -0
  25. package/docs/classes/five.PBMContainer.html +17 -0
  26. package/docs/classes/five.PBMGroup.html +19 -0
  27. package/docs/classes/five.PBMMaterial.html +15 -0
  28. package/docs/classes/five.PBMMesh.html +7 -0
  29. package/docs/classes/five.PanoCircleMesh.html +7 -0
  30. package/docs/classes/five.Scene.html +3 -0
  31. package/docs/classes/five.Subscribe.html +56 -0
  32. package/docs/classes/five.Work.html +30 -0
  33. package/docs/classes/gltf_loader.GLTFLoader.html +17 -0
  34. package/docs/classes/gltf_loader.GLTFObject.html +7 -0
  35. package/docs/classes/line.Line.html +1 -0
  36. package/docs/classes/line.LineGeometry.html +1 -0
  37. package/docs/classes/line.LineMaterial.html +1 -0
  38. package/docs/classes/line.LineSegmentsGeometry.html +1 -0
  39. package/docs/classes/line.THREE_Line2.html +1 -0
  40. package/docs/classes/line.THREE_LineSegments2.html +1 -0
  41. package/docs/classes/react.Store.html +29 -0
  42. package/docs/classes/server.BVH.html +10 -0
  43. package/docs/classes/server.BVHIntersect.html +1 -0
  44. package/docs/classes/server.BVHNode.html +7 -0
  45. package/docs/classes/server.BVHVector3.html +1 -0
  46. package/docs/classes/server.Model.html +63 -0
  47. package/docs/classes/server.PBMGroup.html +9 -0
  48. package/docs/classes/server.PBMMesh.html +7 -0
  49. package/docs/classes/sticker.Sticker.html +32 -0
  50. package/docs/index.html +182 -0
  51. package/docs/interfaces/five.AddableObject.html +1 -0
  52. package/docs/interfaces/five.AnimationFrame.html +1 -0
  53. package/docs/interfaces/five.CameraPose.html +1 -0
  54. package/docs/interfaces/five.DepthPanoramaControllerCustomInitArgs.html +28 -0
  55. package/docs/interfaces/five.EventCallback.html +391 -0
  56. package/docs/interfaces/five.FiveInitArgs.html +96 -0
  57. package/docs/interfaces/five.FloorplanControllerCustomInitArgs.html +15 -0
  58. package/docs/interfaces/five.ImageOptions.html +16 -0
  59. package/docs/interfaces/five.ImageURLOptions.html +1 -0
  60. package/docs/interfaces/five.IntersectMeshInterface.html +3 -0
  61. package/docs/interfaces/five.Intersection.html +7 -0
  62. package/docs/interfaces/five.ModelControllerCustomInitArgs.html +20 -0
  63. package/docs/interfaces/five.ModelEventCallback.html +22 -0
  64. package/docs/interfaces/five.MovePanoOptions.html +39 -0
  65. package/docs/interfaces/five.PBMPanoPicture.html +7 -0
  66. package/docs/interfaces/five.PBMParameters.html +15 -0
  67. package/docs/interfaces/five.PanoCircleMeshInterface.html +19 -0
  68. package/docs/interfaces/five.PanoramaControllerCustomInitArgs.html +28 -0
  69. package/docs/interfaces/five.PanoramaLikeControllerCustomInitArgs.html +20 -0
  70. package/docs/interfaces/five.Pose.html +35 -0
  71. package/docs/interfaces/five.Scissor.html +14 -0
  72. package/docs/interfaces/five.State.html +19 -0
  73. package/docs/interfaces/five.SubscribeMixinType.emit.html +1 -0
  74. package/docs/interfaces/five.SubscribeMixinType.hasListener.html +1 -0
  75. package/docs/interfaces/five.SubscribeMixinType.off.html +1 -0
  76. package/docs/interfaces/five.SubscribeMixinType.on.html +1 -0
  77. package/docs/interfaces/five.SubscribeMixinType.once.html +1 -0
  78. package/docs/interfaces/five.TextureOptions.html +18 -0
  79. package/docs/interfaces/five.TopviewControllerCustomInitArgs.html +7 -0
  80. package/docs/interfaces/five.VRPanoramaControllerCustomInitArgs.html +24 -0
  81. package/docs/interfaces/five.WorkCubeImage.html +13 -0
  82. package/docs/interfaces/five.WorkImage.html +21 -0
  83. package/docs/interfaces/five.WorkInitial.html +13 -0
  84. package/docs/interfaces/five.WorkModel.html +11 -0
  85. package/docs/interfaces/five.WorkObserver.html +25 -0
  86. package/docs/interfaces/five.WorkTile.html +1 -0
  87. package/docs/interfaces/five.WorkVideo.html +9 -0
  88. package/docs/interfaces/gltf_loader.GLTF.html +7 -0
  89. package/docs/interfaces/react.FiveActionReactCallbacks.html +62 -0
  90. package/docs/interfaces/react.FiveInjectionTypes.html +191 -0
  91. package/docs/interfaces/react.PropTypeOfFiveFeatures.html +1 -0
  92. package/docs/interfaces/server.Intersection.html +7 -0
  93. package/docs/interfaces/server.ModelEventCallback.html +18 -0
  94. package/docs/interfaces/sticker.IntersectionLike.html +8 -0
  95. package/docs/media/coordinate.jpg +0 -0
  96. package/docs/media/topview.jpg +0 -0
  97. package/docs/media/typescript.jpg +0 -0
  98. package/docs/modules/five.SubscribeMixinType.html +1 -0
  99. package/docs/modules/five.html +481 -0
  100. package/docs/modules/gltf_loader.html +1 -0
  101. package/docs/modules/line.html +1 -0
  102. package/docs/modules/react.html +130 -0
  103. package/docs/modules/server.html +18 -0
  104. package/docs/modules/sticker.html +1 -0
  105. package/docs/modules.html +1 -0
  106. package/exporters/staticify.js +203 -0
  107. package/five/index.d.ts +2061 -0
  108. package/five/index.js +372 -0
  109. package/gltf-loader/index.d.ts +75 -0
  110. package/gltf-loader/index.js +260 -0
  111. package/line/index.d.ts +68 -0
  112. package/line/index.js +260 -0
  113. package/package.json +36 -0
  114. package/react/index.d.ts +812 -0
  115. package/react/index.js +260 -0
  116. package/resource/basis/basis_transcoder.js +22 -0
  117. package/resource/basis/basis_transcoder.wasm +0 -0
  118. package/resource/gltf/draco_decoder.js +31 -0
  119. package/resource/gltf/draco_decoder.wasm +0 -0
  120. package/resource/gltf/draco_wasm_wrapper.js +119 -0
  121. package/scripts/five-plugin-init.js +83 -0
  122. package/scripts/five-quick-start-init.js +80 -0
  123. package/scripts/five-react-component-init.js +83 -0
  124. package/scripts/five-staticify.js +21 -0
  125. package/server/index.d.ts +568 -0
  126. package/server/index.js +367 -0
  127. package/sticker/index.d.ts +70 -0
  128. package/sticker/index.js +260 -0
  129. package/templates/plugin/README.md +38 -0
  130. package/templates/plugin/devtools/external-five.js +5 -0
  131. package/templates/plugin/devtools/external-three.js +5 -0
  132. package/templates/plugin/devtools/tsconfig.build.json +18 -0
  133. package/templates/plugin/devtools/webpack.bundle.js +44 -0
  134. package/templates/plugin/devtools/webpack.example.js +39 -0
  135. package/templates/plugin/docs/.gitkeep +0 -0
  136. package/templates/plugin/examples/data.json +507 -0
  137. package/templates/plugin/examples/index.html +28 -0
  138. package/templates/plugin/examples/index.ts +12 -0
  139. package/templates/plugin/lib/index.ts +30 -0
  140. package/templates/plugin/package.json +32 -0
  141. package/templates/plugin/tsconfig.json +26 -0
  142. package/templates/quick-start/README.md +47 -0
  143. package/templates/quick-start/assets/work.json +507 -0
  144. package/templates/quick-start/index.html +54 -0
  145. package/templates/quick-start/index.tsx +123 -0
  146. package/templates/quick-start/package.json +25 -0
  147. package/templates/quick-start/tsconfig.json +27 -0
  148. package/templates/quick-start/webpack.config.js +45 -0
  149. package/templates/quick-start/webpack.production.js +42 -0
  150. package/templates/react-component/README.md +32 -0
  151. package/templates/react-component/devtools/external-five.js +5 -0
  152. package/templates/react-component/devtools/external-react.js +5 -0
  153. package/templates/react-component/devtools/external-three.js +5 -0
  154. package/templates/react-component/devtools/tsconfig.build.json +19 -0
  155. package/templates/react-component/devtools/webpack.bundle.js +44 -0
  156. package/templates/react-component/devtools/webpack.example.js +39 -0
  157. package/templates/react-component/docs/.gitkeep +0 -0
  158. package/templates/react-component/examples/data.json +507 -0
  159. package/templates/react-component/examples/index.html +17 -0
  160. package/templates/react-component/examples/index.tsx +62 -0
  161. package/templates/react-component/lib/index.tsx +157 -0
  162. package/templates/react-component/package.json +38 -0
  163. package/templates/react-component/tsconfig.json +27 -0
  164. package/umd/five-gltf-loader.js +2 -0
  165. package/umd/five-gltf-loader.js.LICENSE.txt +14 -0
  166. package/umd/five-line.js +2 -0
  167. package/umd/five-line.js.LICENSE.txt +14 -0
  168. package/umd/five-react.js +2 -0
  169. package/umd/five-react.js.LICENSE.txt +14 -0
  170. package/umd/five-sticker.js +2 -0
  171. package/umd/five-sticker.js.LICENSE.txt +14 -0
  172. package/umd/five.js +2 -0
  173. package/umd/five.js.LICENSE.txt +116 -0
package/umd/five.js ADDED
@@ -0,0 +1,2 @@
1
+ /*! For license information please see five.js.LICENSE.txt */
2
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.FiveSDK=e():t.FiveSDK=e()}(self,(function(){return(()=>{var __webpack_modules__={438:t=>{if(!("THREE"in window))throw new Error('"THREE" is not available. Please include "three.js" in your HTML.');const e=Number(THREE.REVISION);if(e<115||e>117)throw new Error('"Five" needs "THREE.js" version between 125 - 117.');t.exports=window.THREE},383:t=>{"use strict";t.exports=function(t,e){for(var i=new Array(arguments.length-1),n=0,r=2,o=!0;r<arguments.length;)i[n++]=arguments[r++];return new Promise((function(r,s){i[n]=function(t){if(o)if(o=!1,t)s(t);else{for(var e=new Array(arguments.length-1),i=0;i<e.length;)e[i++]=arguments[i];r.apply(null,e)}};try{t.apply(e||null,i)}catch(t){o&&(o=!1,s(t))}}))}},417:(t,e)=>{"use strict";var i=e;i.length=function(t){var e=t.length;if(!e)return 0;for(var i=0;--e%4>1&&"="===t.charAt(e);)++i;return Math.ceil(3*t.length)/4-i};for(var n=new Array(64),r=new Array(123),o=0;o<64;)r[n[o]=o<26?o+65:o<52?o+71:o<62?o-4:o-59|43]=o++;i.encode=function(t,e,i){for(var r,o=null,s=[],a=0,u=0;e<i;){var h=t[e++];switch(u){case 0:s[a++]=n[h>>2],r=(3&h)<<4,u=1;break;case 1:s[a++]=n[r|h>>4],r=(15&h)<<2,u=2;break;case 2:s[a++]=n[r|h>>6],s[a++]=n[63&h],u=0}a>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,s)),a=0)}return u&&(s[a++]=n[r],s[a++]=61,1===u&&(s[a++]=61)),o?(a&&o.push(String.fromCharCode.apply(String,s.slice(0,a))),o.join("")):String.fromCharCode.apply(String,s.slice(0,a))};var s="invalid encoding";i.decode=function(t,e,i){for(var n,o=i,a=0,u=0;u<t.length;){var h=t.charCodeAt(u++);if(61===h&&a>1)break;if(void 0===(h=r[h]))throw Error(s);switch(a){case 0:n=h,a=1;break;case 1:e[i++]=n<<2|(48&h)>>4,n=h,a=2;break;case 2:e[i++]=(15&n)<<4|(60&h)>>2,n=h,a=3;break;case 3:e[i++]=(3&n)<<6|h,a=0}}if(1===a)throw Error(s);return i-o},i.test=function(t){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(t)}},516:t=>{"use strict";function e(){this._listeners={}}t.exports=e,e.prototype.on=function(t,e,i){return(this._listeners[t]||(this._listeners[t]=[])).push({fn:e,ctx:i||this}),this},e.prototype.off=function(t,e){if(void 0===t)this._listeners={};else if(void 0===e)this._listeners[t]=[];else for(var i=this._listeners[t],n=0;n<i.length;)i[n].fn===e?i.splice(n,1):++n;return this},e.prototype.emit=function(t){var e=this._listeners[t];if(e){for(var i=[],n=1;n<arguments.length;)i.push(arguments[n++]);for(n=0;n<e.length;)e[n].fn.apply(e[n++].ctx,i)}return this}},787:t=>{"use strict";function e(t){return"undefined"!=typeof Float32Array?function(){var e=new Float32Array([-0]),i=new Uint8Array(e.buffer),n=128===i[3];function r(t,n,r){e[0]=t,n[r]=i[0],n[r+1]=i[1],n[r+2]=i[2],n[r+3]=i[3]}function o(t,n,r){e[0]=t,n[r]=i[3],n[r+1]=i[2],n[r+2]=i[1],n[r+3]=i[0]}function s(t,n){return i[0]=t[n],i[1]=t[n+1],i[2]=t[n+2],i[3]=t[n+3],e[0]}function a(t,n){return i[3]=t[n],i[2]=t[n+1],i[1]=t[n+2],i[0]=t[n+3],e[0]}t.writeFloatLE=n?r:o,t.writeFloatBE=n?o:r,t.readFloatLE=n?s:a,t.readFloatBE=n?a:s}():function(){function e(t,e,i,n){var r=e<0?1:0;if(r&&(e=-e),0===e)t(1/e>0?0:2147483648,i,n);else if(isNaN(e))t(2143289344,i,n);else if(e>34028234663852886e22)t((r<<31|2139095040)>>>0,i,n);else if(e<11754943508222875e-54)t((r<<31|Math.round(e/1401298464324817e-60))>>>0,i,n);else{var o=Math.floor(Math.log(e)/Math.LN2);t((r<<31|o+127<<23|8388607&Math.round(e*Math.pow(2,-o)*8388608))>>>0,i,n)}}function s(t,e,i){var n=t(e,i),r=2*(n>>31)+1,o=n>>>23&255,s=8388607&n;return 255===o?s?NaN:r*(1/0):0===o?1401298464324817e-60*r*s:r*Math.pow(2,o-150)*(s+8388608)}t.writeFloatLE=e.bind(null,i),t.writeFloatBE=e.bind(null,n),t.readFloatLE=s.bind(null,r),t.readFloatBE=s.bind(null,o)}(),"undefined"!=typeof Float64Array?function(){var e=new Float64Array([-0]),i=new Uint8Array(e.buffer),n=128===i[7];function r(t,n,r){e[0]=t,n[r]=i[0],n[r+1]=i[1],n[r+2]=i[2],n[r+3]=i[3],n[r+4]=i[4],n[r+5]=i[5],n[r+6]=i[6],n[r+7]=i[7]}function o(t,n,r){e[0]=t,n[r]=i[7],n[r+1]=i[6],n[r+2]=i[5],n[r+3]=i[4],n[r+4]=i[3],n[r+5]=i[2],n[r+6]=i[1],n[r+7]=i[0]}function s(t,n){return i[0]=t[n],i[1]=t[n+1],i[2]=t[n+2],i[3]=t[n+3],i[4]=t[n+4],i[5]=t[n+5],i[6]=t[n+6],i[7]=t[n+7],e[0]}function a(t,n){return i[7]=t[n],i[6]=t[n+1],i[5]=t[n+2],i[4]=t[n+3],i[3]=t[n+4],i[2]=t[n+5],i[1]=t[n+6],i[0]=t[n+7],e[0]}t.writeDoubleLE=n?r:o,t.writeDoubleBE=n?o:r,t.readDoubleLE=n?s:a,t.readDoubleBE=n?a:s}():function(){function e(t,e,i,n,r,o){var s=n<0?1:0;if(s&&(n=-n),0===n)t(0,r,o+e),t(1/n>0?0:2147483648,r,o+i);else if(isNaN(n))t(0,r,o+e),t(2146959360,r,o+i);else if(n>17976931348623157e292)t(0,r,o+e),t((s<<31|2146435072)>>>0,r,o+i);else{var a;if(n<22250738585072014e-324)t((a=n/5e-324)>>>0,r,o+e),t((s<<31|a/4294967296)>>>0,r,o+i);else{var u=Math.floor(Math.log(n)/Math.LN2);1024===u&&(u=1023),t(4503599627370496*(a=n*Math.pow(2,-u))>>>0,r,o+e),t((s<<31|u+1023<<20|1048576*a&1048575)>>>0,r,o+i)}}}function s(t,e,i,n,r){var o=t(n,r+e),s=t(n,r+i),a=2*(s>>31)+1,u=s>>>20&2047,h=4294967296*(1048575&s)+o;return 2047===u?h?NaN:a*(1/0):0===u?5e-324*a*h:a*Math.pow(2,u-1075)*(h+4503599627370496)}t.writeDoubleLE=e.bind(null,i,0,4),t.writeDoubleBE=e.bind(null,n,4,0),t.readDoubleLE=s.bind(null,r,0,4),t.readDoubleBE=s.bind(null,o,4,0)}(),t}function i(t,e,i){e[i]=255&t,e[i+1]=t>>>8&255,e[i+2]=t>>>16&255,e[i+3]=t>>>24}function n(t,e,i){e[i]=t>>>24,e[i+1]=t>>>16&255,e[i+2]=t>>>8&255,e[i+3]=255&t}function r(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24)>>>0}function o(t,e){return(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}t.exports=e(e)},795:module=>{"use strict";function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(t){}return null}module.exports=inquire},476:t=>{"use strict";t.exports=function(t,e,i){var n=i||8192,r=n>>>1,o=null,s=n;return function(i){if(i<1||i>r)return t(i);s+i>n&&(o=t(n),s=0);var a=e.call(o,s,s+=i);return 7&s&&(s=1+(7|s)),a}}},893:(t,e)=>{"use strict";var i=e;i.length=function(t){for(var e=0,i=0,n=0;n<t.length;++n)(i=t.charCodeAt(n))<128?e+=1:i<2048?e+=2:55296==(64512&i)&&56320==(64512&t.charCodeAt(n+1))?(++n,e+=4):e+=3;return e},i.read=function(t,e,i){if(i-e<1)return"";for(var n,r=null,o=[],s=0;e<i;)(n=t[e++])<128?o[s++]=n:n>191&&n<224?o[s++]=(31&n)<<6|63&t[e++]:n>239&&n<365?(n=((7&n)<<18|(63&t[e++])<<12|(63&t[e++])<<6|63&t[e++])-65536,o[s++]=55296+(n>>10),o[s++]=56320+(1023&n)):o[s++]=(15&n)<<12|(63&t[e++])<<6|63&t[e++],s>8191&&((r||(r=[])).push(String.fromCharCode.apply(String,o)),s=0);return r?(s&&r.push(String.fromCharCode.apply(String,o.slice(0,s))),r.join("")):String.fromCharCode.apply(String,o.slice(0,s))},i.write=function(t,e,i){for(var n,r,o=i,s=0;s<t.length;++s)(n=t.charCodeAt(s))<128?e[i++]=n:n<2048?(e[i++]=n>>6|192,e[i++]=63&n|128):55296==(64512&n)&&56320==(64512&(r=t.charCodeAt(s+1)))?(n=65536+((1023&n)<<10)+(1023&r),++s,e[i++]=n>>18|240,e[i++]=n>>12&63|128,e[i++]=n>>6&63|128,e[i++]=63&n|128):(e[i++]=n>>12|224,e[i++]=n>>6&63|128,e[i++]=63&n|128);return i-o}},967:(t,e,i)=>{"use strict";t.exports=i(365)},365:(t,e,i)=>{"use strict";var n=e;function r(){n.util._configure(),n.Writer._configure(n.BufferWriter),n.Reader._configure(n.BufferReader)}n.build="minimal",n.Writer=i(147),n.BufferWriter=i(55),n.Reader=i(74),n.BufferReader=i(69),n.util=i(835),n.rpc=i(876),n.roots=i(7),n.configure=r,r()},74:(t,e,i)=>{"use strict";t.exports=u;var n,r=i(835),o=r.LongBits,s=r.utf8;function a(t,e){return RangeError("index out of range: "+t.pos+" + "+(e||1)+" > "+t.len)}function u(t){this.buf=t,this.pos=0,this.len=t.length}var h,l="undefined"!=typeof Uint8Array?function(t){if(t instanceof Uint8Array||Array.isArray(t))return new u(t);throw Error("illegal buffer")}:function(t){if(Array.isArray(t))return new u(t);throw Error("illegal buffer")},c=function(){return r.Buffer?function(t){return(u.create=function(t){return r.Buffer.isBuffer(t)?new n(t):l(t)})(t)}:l};function d(){var t=new o(0,0),e=0;if(!(this.len-this.pos>4)){for(;e<3;++e){if(this.pos>=this.len)throw a(this);if(t.lo=(t.lo|(127&this.buf[this.pos])<<7*e)>>>0,this.buf[this.pos++]<128)return t}return t.lo=(t.lo|(127&this.buf[this.pos++])<<7*e)>>>0,t}for(;e<4;++e)if(t.lo=(t.lo|(127&this.buf[this.pos])<<7*e)>>>0,this.buf[this.pos++]<128)return t;if(t.lo=(t.lo|(127&this.buf[this.pos])<<28)>>>0,t.hi=(t.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return t;if(e=0,this.len-this.pos>4){for(;e<5;++e)if(t.hi=(t.hi|(127&this.buf[this.pos])<<7*e+3)>>>0,this.buf[this.pos++]<128)return t}else for(;e<5;++e){if(this.pos>=this.len)throw a(this);if(t.hi=(t.hi|(127&this.buf[this.pos])<<7*e+3)>>>0,this.buf[this.pos++]<128)return t}throw Error("invalid varint encoding")}function p(t,e){return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0}function A(){if(this.pos+8>this.len)throw a(this,8);return new o(p(this.buf,this.pos+=4),p(this.buf,this.pos+=4))}u.create=c(),u.prototype._slice=r.Array.prototype.subarray||r.Array.prototype.slice,u.prototype.uint32=(h=4294967295,function(){if(h=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return h;if(h=(h|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return h;if(h=(h|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return h;if(h=(h|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return h;if(h=(h|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return h;if((this.pos+=5)>this.len)throw this.pos=this.len,a(this,10);return h}),u.prototype.int32=function(){return 0|this.uint32()},u.prototype.sint32=function(){var t=this.uint32();return t>>>1^-(1&t)|0},u.prototype.bool=function(){return 0!==this.uint32()},u.prototype.fixed32=function(){if(this.pos+4>this.len)throw a(this,4);return p(this.buf,this.pos+=4)},u.prototype.sfixed32=function(){if(this.pos+4>this.len)throw a(this,4);return 0|p(this.buf,this.pos+=4)},u.prototype.float=function(){if(this.pos+4>this.len)throw a(this,4);var t=r.float.readFloatLE(this.buf,this.pos);return this.pos+=4,t},u.prototype.double=function(){if(this.pos+8>this.len)throw a(this,4);var t=r.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,t},u.prototype.bytes=function(){var t=this.uint32(),e=this.pos,i=this.pos+t;if(i>this.len)throw a(this,t);return this.pos+=t,Array.isArray(this.buf)?this.buf.slice(e,i):e===i?new this.buf.constructor(0):this._slice.call(this.buf,e,i)},u.prototype.string=function(){var t=this.bytes();return s.read(t,0,t.length)},u.prototype.skip=function(t){if("number"==typeof t){if(this.pos+t>this.len)throw a(this,t);this.pos+=t}else do{if(this.pos>=this.len)throw a(this)}while(128&this.buf[this.pos++]);return this},u.prototype.skipType=function(t){switch(t){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(t=7&this.uint32());)this.skipType(t);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+t+" at offset "+this.pos)}return this},u._configure=function(t){n=t,u.create=c(),n._configure();var e=r.Long?"toLong":"toNumber";r.merge(u.prototype,{int64:function(){return d.call(this)[e](!1)},uint64:function(){return d.call(this)[e](!0)},sint64:function(){return d.call(this).zzDecode()[e](!1)},fixed64:function(){return A.call(this)[e](!0)},sfixed64:function(){return A.call(this)[e](!1)}})}},69:(t,e,i)=>{"use strict";t.exports=o;var n=i(74);(o.prototype=Object.create(n.prototype)).constructor=o;var r=i(835);function o(t){n.call(this,t)}o._configure=function(){r.Buffer&&(o.prototype._slice=r.Buffer.prototype.slice)},o.prototype.string=function(){var t=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+t,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+t,this.len))},o._configure()},7:t=>{"use strict";t.exports={}},876:(t,e,i)=>{"use strict";e.Service=i(380)},380:(t,e,i)=>{"use strict";t.exports=r;var n=i(835);function r(t,e,i){if("function"!=typeof t)throw TypeError("rpcImpl must be a function");n.EventEmitter.call(this),this.rpcImpl=t,this.requestDelimited=Boolean(e),this.responseDelimited=Boolean(i)}(r.prototype=Object.create(n.EventEmitter.prototype)).constructor=r,r.prototype.rpcCall=function t(e,i,r,o,s){if(!o)throw TypeError("request must be specified");var a=this;if(!s)return n.asPromise(t,a,e,i,r,o);if(a.rpcImpl)try{return a.rpcImpl(e,i[a.requestDelimited?"encodeDelimited":"encode"](o).finish(),(function(t,i){if(t)return a.emit("error",t,e),s(t);if(null!==i){if(!(i instanceof r))try{i=r[a.responseDelimited?"decodeDelimited":"decode"](i)}catch(t){return a.emit("error",t,e),s(t)}return a.emit("data",i,e),s(null,i)}a.end(!0)}))}catch(t){return a.emit("error",t,e),void setTimeout((function(){s(t)}),0)}else setTimeout((function(){s(Error("already ended"))}),0)},r.prototype.end=function(t){return this.rpcImpl&&(t||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},600:(t,e,i)=>{"use strict";t.exports=r;var n=i(835);function r(t,e){this.lo=t>>>0,this.hi=e>>>0}var o=r.zero=new r(0,0);o.toNumber=function(){return 0},o.zzEncode=o.zzDecode=function(){return this},o.length=function(){return 1};var s=r.zeroHash="\0\0\0\0\0\0\0\0";r.fromNumber=function(t){if(0===t)return o;var e=t<0;e&&(t=-t);var i=t>>>0,n=(t-i)/4294967296>>>0;return e&&(n=~n>>>0,i=~i>>>0,++i>4294967295&&(i=0,++n>4294967295&&(n=0))),new r(i,n)},r.from=function(t){if("number"==typeof t)return r.fromNumber(t);if(n.isString(t)){if(!n.Long)return r.fromNumber(parseInt(t,10));t=n.Long.fromString(t)}return t.low||t.high?new r(t.low>>>0,t.high>>>0):o},r.prototype.toNumber=function(t){if(!t&&this.hi>>>31){var e=1+~this.lo>>>0,i=~this.hi>>>0;return e||(i=i+1>>>0),-(e+4294967296*i)}return this.lo+4294967296*this.hi},r.prototype.toLong=function(t){return n.Long?new n.Long(0|this.lo,0|this.hi,Boolean(t)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(t)}};var a=String.prototype.charCodeAt;r.fromHash=function(t){return t===s?o:new r((a.call(t,0)|a.call(t,1)<<8|a.call(t,2)<<16|a.call(t,3)<<24)>>>0,(a.call(t,4)|a.call(t,5)<<8|a.call(t,6)<<16|a.call(t,7)<<24)>>>0)},r.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},r.prototype.zzEncode=function(){var t=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^t)>>>0,this.lo=(this.lo<<1^t)>>>0,this},r.prototype.zzDecode=function(){var t=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^t)>>>0,this.hi=(this.hi>>>1^t)>>>0,this},r.prototype.length=function(){var t=this.lo,e=(this.lo>>>28|this.hi<<4)>>>0,i=this.hi>>>24;return 0===i?0===e?t<16384?t<128?1:2:t<2097152?3:4:e<16384?e<128?5:6:e<2097152?7:8:i<128?9:10}},835:function(t,e,i){"use strict";var n=e;function r(t,e,i){for(var n=Object.keys(e),r=0;r<n.length;++r)void 0!==t[n[r]]&&i||(t[n[r]]=e[n[r]]);return t}function o(t){function e(t,i){if(!(this instanceof e))return new e(t,i);Object.defineProperty(this,"message",{get:function(){return t}}),Error.captureStackTrace?Error.captureStackTrace(this,e):Object.defineProperty(this,"stack",{value:(new Error).stack||""}),i&&r(this,i)}return(e.prototype=Object.create(Error.prototype)).constructor=e,Object.defineProperty(e.prototype,"name",{get:function(){return t}}),e.prototype.toString=function(){return this.name+": "+this.message},e}n.asPromise=i(383),n.base64=i(417),n.EventEmitter=i(516),n.float=i(787),n.inquire=i(795),n.utf8=i(893),n.pool=i(476),n.LongBits=i(600),n.isNode=Boolean(void 0!==i.g&&i.g&&i.g.process&&i.g.process.versions&&i.g.process.versions.node),n.global=n.isNode&&i.g||"undefined"!=typeof window&&window||"undefined"!=typeof self&&self||this,n.emptyArray=Object.freeze?Object.freeze([]):[],n.emptyObject=Object.freeze?Object.freeze({}):{},n.isInteger=Number.isInteger||function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t},n.isString=function(t){return"string"==typeof t||t instanceof String},n.isObject=function(t){return t&&"object"==typeof t},n.isset=n.isSet=function(t,e){var i=t[e];return!(null==i||!t.hasOwnProperty(e))&&("object"!=typeof i||(Array.isArray(i)?i.length:Object.keys(i).length)>0)},n.Buffer=function(){try{var t=n.inquire("buffer").Buffer;return t.prototype.utf8Write?t:null}catch(t){return null}}(),n._Buffer_from=null,n._Buffer_allocUnsafe=null,n.newBuffer=function(t){return"number"==typeof t?n.Buffer?n._Buffer_allocUnsafe(t):new n.Array(t):n.Buffer?n._Buffer_from(t):"undefined"==typeof Uint8Array?t:new Uint8Array(t)},n.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,n.Long=n.global.dcodeIO&&n.global.dcodeIO.Long||n.global.Long||n.inquire("long"),n.key2Re=/^true|false|0|1$/,n.key32Re=/^-?(?:0|[1-9][0-9]*)$/,n.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,n.longToHash=function(t){return t?n.LongBits.from(t).toHash():n.LongBits.zeroHash},n.longFromHash=function(t,e){var i=n.LongBits.fromHash(t);return n.Long?n.Long.fromBits(i.lo,i.hi,e):i.toNumber(Boolean(e))},n.merge=r,n.lcFirst=function(t){return t.charAt(0).toLowerCase()+t.substring(1)},n.newError=o,n.ProtocolError=o("ProtocolError"),n.oneOfGetter=function(t){for(var e={},i=0;i<t.length;++i)e[t[i]]=1;return function(){for(var t=Object.keys(this),i=t.length-1;i>-1;--i)if(1===e[t[i]]&&void 0!==this[t[i]]&&null!==this[t[i]])return t[i]}},n.oneOfSetter=function(t){return function(e){for(var i=0;i<t.length;++i)t[i]!==e&&delete this[t[i]]}},n.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},n._configure=function(){var t=n.Buffer;t?(n._Buffer_from=t.from!==Uint8Array.from&&t.from||function(e,i){return new t(e,i)},n._Buffer_allocUnsafe=t.allocUnsafe||function(e){return new t(e)}):n._Buffer_from=n._Buffer_allocUnsafe=null}},147:(t,e,i)=>{"use strict";t.exports=c;var n,r=i(835),o=r.LongBits,s=r.base64,a=r.utf8;function u(t,e,i){this.fn=t,this.len=e,this.next=void 0,this.val=i}function h(){}function l(t){this.head=t.head,this.tail=t.tail,this.len=t.len,this.next=t.states}function c(){this.len=0,this.head=new u(h,0,0),this.tail=this.head,this.states=null}var d=function(){return r.Buffer?function(){return(c.create=function(){return new n})()}:function(){return new c}};function p(t,e,i){e[i]=255&t}function A(t,e){this.len=t,this.next=void 0,this.val=e}function f(t,e,i){for(;t.hi;)e[i++]=127&t.lo|128,t.lo=(t.lo>>>7|t.hi<<25)>>>0,t.hi>>>=7;for(;t.lo>127;)e[i++]=127&t.lo|128,t.lo=t.lo>>>7;e[i++]=t.lo}function g(t,e,i){e[i]=255&t,e[i+1]=t>>>8&255,e[i+2]=t>>>16&255,e[i+3]=t>>>24}c.create=d(),c.alloc=function(t){return new r.Array(t)},r.Array!==Array&&(c.alloc=r.pool(c.alloc,r.Array.prototype.subarray)),c.prototype._push=function(t,e,i){return this.tail=this.tail.next=new u(t,e,i),this.len+=e,this},A.prototype=Object.create(u.prototype),A.prototype.fn=function(t,e,i){for(;t>127;)e[i++]=127&t|128,t>>>=7;e[i]=t},c.prototype.uint32=function(t){return this.len+=(this.tail=this.tail.next=new A((t>>>=0)<128?1:t<16384?2:t<2097152?3:t<268435456?4:5,t)).len,this},c.prototype.int32=function(t){return t<0?this._push(f,10,o.fromNumber(t)):this.uint32(t)},c.prototype.sint32=function(t){return this.uint32((t<<1^t>>31)>>>0)},c.prototype.uint64=function(t){var e=o.from(t);return this._push(f,e.length(),e)},c.prototype.int64=c.prototype.uint64,c.prototype.sint64=function(t){var e=o.from(t).zzEncode();return this._push(f,e.length(),e)},c.prototype.bool=function(t){return this._push(p,1,t?1:0)},c.prototype.fixed32=function(t){return this._push(g,4,t>>>0)},c.prototype.sfixed32=c.prototype.fixed32,c.prototype.fixed64=function(t){var e=o.from(t);return this._push(g,4,e.lo)._push(g,4,e.hi)},c.prototype.sfixed64=c.prototype.fixed64,c.prototype.float=function(t){return this._push(r.float.writeFloatLE,4,t)},c.prototype.double=function(t){return this._push(r.float.writeDoubleLE,8,t)};var v=r.Array.prototype.set?function(t,e,i){e.set(t,i)}:function(t,e,i){for(var n=0;n<t.length;++n)e[i+n]=t[n]};c.prototype.bytes=function(t){var e=t.length>>>0;if(!e)return this._push(p,1,0);if(r.isString(t)){var i=c.alloc(e=s.length(t));s.decode(t,i,0),t=i}return this.uint32(e)._push(v,e,t)},c.prototype.string=function(t){var e=a.length(t);return e?this.uint32(e)._push(a.write,e,t):this._push(p,1,0)},c.prototype.fork=function(){return this.states=new l(this),this.head=this.tail=new u(h,0,0),this.len=0,this},c.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new u(h,0,0),this.len=0),this},c.prototype.ldelim=function(){var t=this.head,e=this.tail,i=this.len;return this.reset().uint32(i),i&&(this.tail.next=t.next,this.tail=e,this.len+=i),this},c.prototype.finish=function(){for(var t=this.head.next,e=this.constructor.alloc(this.len),i=0;t;)t.fn(t.val,e,i),i+=t.len,t=t.next;return e},c._configure=function(t){n=t,c.create=d(),n._configure()}},55:(t,e,i)=>{"use strict";t.exports=o;var n=i(147);(o.prototype=Object.create(n.prototype)).constructor=o;var r=i(835);function o(){n.call(this)}function s(t,e,i){t.length<40?r.utf8.write(t,e,i):e.utf8Write?e.utf8Write(t,i):e.write(t,i)}o._configure=function(){o.alloc=r._Buffer_allocUnsafe,o.writeBytesBuffer=r.Buffer&&r.Buffer.prototype instanceof Uint8Array&&"set"===r.Buffer.prototype.set.name?function(t,e,i){e.set(t,i)}:function(t,e,i){if(t.copy)t.copy(e,i,0,t.length);else for(var n=0;n<t.length;)e[i++]=t[n++]}},o.prototype.bytes=function(t){r.isString(t)&&(t=r._Buffer_from(t,"base64"));var e=t.length>>>0;return this.uint32(e),e&&this._push(o.writeBytesBuffer,e,t),this},o.prototype.string=function(t){var e=r.Buffer.byteLength(t);return this.uint32(e),e&&this._push(s,e,t),this},o._configure()}},__webpack_module_cache__={};function __webpack_require__(t){var e=__webpack_module_cache__[t];if(void 0!==e)return e.exports;var i=__webpack_module_cache__[t]={exports:{}};return __webpack_modules__[t].call(i.exports,i,i.exports,__webpack_require__),i.exports}__webpack_require__.d=(t,e)=>{for(var i in e)__webpack_require__.o(e,i)&&!__webpack_require__.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),__webpack_require__.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),__webpack_require__.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var __webpack_exports__={};return(()=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{AnimationFrameLoop:()=>ce,BVH:()=>We,BVHIntersect:()=>Ke,BVHNode:()=>ze,BVHVector3:()=>He,Camera:()=>Ve,Five:()=>Ts,InternalWebGLRenderer:()=>Te,IntersectMesh:()=>ir,LegacyPanoCircleMesh:()=>On,Model:()=>nn,NetworkSubscribe:()=>oe,PBMContainer:()=>be,PBMGroup:()=>we,PBMMaterial:()=>Pe,PBMMesh:()=>ye,PROXY_CONTROLLER_EVENT_NAMES:()=>us,PanoCircleMesh:()=>Jn,Scene:()=>Re,Subscribe:()=>zt,Work:()=>fn,defaultImageURLTransform:()=>me,getViewportScale:()=>ls,parseWork:()=>yn});var t=__webpack_require__(438),e=Number(t.REVISION);if(e<115||e>117)throw new Error('"Five" needs "THREE.js" version between 125 - 117.');var i,n,r,o,s,a,u,h,l,c,d,p,A={},f={},g=g||(i=Math,r=(n={}).lib={},o=r.Base=function(){function t(){}return{extend:function(e){t.prototype=this;var i=new t;return e&&i.mixIn(e),i.hasOwnProperty("init")||(i.init=function(){i.$super.init.apply(this,arguments)}),i.init.prototype=i,i.$super=this,i},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),s=r.WordArray=o.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=null!=e?e:4*t.length},toString:function(t){return(t||u).stringify(this)},concat:function(t){var e=this.words,i=t.words,n=this.sigBytes,r=t.sigBytes;if(this.clamp(),n%4)for(var o=0;o<r;o++){var s=i[o>>>2]>>>24-o%4*8&255;e[n+o>>>2]|=s<<24-(n+o)%4*8}else for(o=0;o<r;o+=4)e[n+o>>>2]=i[o>>>2];return this.sigBytes+=r,this},clamp:function(){var t=this.words,e=this.sigBytes;t[e>>>2]&=4294967295<<32-e%4*8,t.length=i.ceil(e/4)},clone:function(){var t=o.clone.call(this);return t.words=this.words.slice(0),t},random:function(t){for(var e=[],n=0;n<t;n+=4)e.push(4294967296*i.random()|0);return new s.init(e,t)}}),a=n.enc={},u=a.Hex={stringify:function(t){for(var e=t.words,i=t.sigBytes,n=[],r=0;r<i;r++){var o=e[r>>>2]>>>24-r%4*8&255;n.push((o>>>4).toString(16)),n.push((15&o).toString(16))}return n.join("")},parse:function(t){for(var e=t.length,i=[],n=0;n<e;n+=2)i[n>>>3]|=parseInt(t.substr(n,2),16)<<24-n%8*4;return new s.init(i,e/2)}},h=a.Latin1={stringify:function(t){for(var e=t.words,i=t.sigBytes,n=[],r=0;r<i;r++){var o=e[r>>>2]>>>24-r%4*8&255;n.push(String.fromCharCode(o))}return n.join("")},parse:function(t){for(var e=t.length,i=[],n=0;n<e;n++)i[n>>>2]|=(255&t.charCodeAt(n))<<24-n%4*8;return new s.init(i,e)}},l=a.Utf8={stringify:function(t){try{return decodeURIComponent(escape(h.stringify(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(t){return h.parse(unescape(encodeURIComponent(t)))}},c=r.BufferedBlockAlgorithm=o.extend({reset:function(){this._data=new s.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=l.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(t){var e=this._data,n=e.words,r=e.sigBytes,o=this.blockSize,a=r/(4*o),u=(a=t?i.ceil(a):i.max((0|a)-this._minBufferSize,0))*o,h=i.min(4*u,r);if(u){for(var l=0;l<u;l+=o)this._doProcessBlock(n,l);var c=n.splice(0,u);e.sigBytes-=h}return new s.init(c,h)},clone:function(){var t=o.clone.call(this);return t._data=this._data.clone(),t},_minBufferSize:0}),r.Hasher=c.extend({cfg:o.extend(),init:function(t){this.cfg=this.cfg.extend(t),this.reset()},reset:function(){c.reset.call(this),this._doReset()},update:function(t){return this._append(t),this._process(),this},finalize:function(t){return t&&this._append(t),this._doFinalize()},blockSize:16,_createHelper:function(t){return function(e,i){return new t.init(i).finalize(e)}},_createHmacHelper:function(t){return function(e,i){return new d.HMAC.init(t,i).finalize(e)}}}),d=n.algo={},n);function v(t,e,i){null!=t&&("number"==typeof t?this.fromNumber(t,e,i):null==e&&"string"!=typeof t?this.fromString(t,256):this.fromString(t,e))}function m(){return new v(null)}!function(t){for(var e=g,i=(r=e.lib).WordArray,n=r.Hasher,r=e.algo,o=[],s=[],a=function(t){return 4294967296*(t-(0|t))|0},u=2,h=0;64>h;){var l;t:{l=u;for(var c=t.sqrt(l),d=2;d<=c;d++)if(!(l%d)){l=!1;break t}l=!0}l&&(8>h&&(o[h]=a(t.pow(u,.5))),s[h]=a(t.pow(u,1/3)),h++),u++}var p=[];r=r.SHA256=n.extend({_doReset:function(){this._hash=new i.init(o.slice(0))},_doProcessBlock:function(t,e){for(var i=this._hash.words,n=i[0],r=i[1],o=i[2],a=i[3],u=i[4],h=i[5],l=i[6],c=i[7],d=0;64>d;d++){if(16>d)p[d]=0|t[e+d];else{var A=p[d-15],f=p[d-2];p[d]=((A<<25|A>>>7)^(A<<14|A>>>18)^A>>>3)+p[d-7]+((f<<15|f>>>17)^(f<<13|f>>>19)^f>>>10)+p[d-16]}A=c+((u<<26|u>>>6)^(u<<21|u>>>11)^(u<<7|u>>>25))+(u&h^~u&l)+s[d]+p[d],f=((n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22))+(n&r^n&o^r&o),c=l,l=h,h=u,u=a+A|0,a=o,o=r,r=n,n=A+f|0}i[0]=i[0]+n|0,i[1]=i[1]+r|0,i[2]=i[2]+o|0,i[3]=i[3]+a|0,i[4]=i[4]+u|0,i[5]=i[5]+h|0,i[6]=i[6]+l|0,i[7]=i[7]+c|0},_doFinalize:function(){var e=this._data,i=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;return i[r>>>5]|=128<<24-r%32,i[14+(r+64>>>9<<4)]=t.floor(n/4294967296),i[15+(r+64>>>9<<4)]=n,e.sigBytes=4*i.length,this._process(),this._hash},clone:function(){var t=n.clone.call(this);return t._hash=this._hash.clone(),t}}),e.SHA256=n._createHelper(r),e.HmacSHA256=n._createHmacHelper(r)}(Math),g.lib.Cipher||function(t){var e=(p=g).lib,i=e.Base,n=e.WordArray,r=e.BufferedBlockAlgorithm,o=p.enc.Base64,s=p.algo.EvpKDF,a=e.Cipher=r.extend({cfg:i.extend(),createEncryptor:function(t,e){return this.create(this._ENC_XFORM_MODE,t,e)},createDecryptor:function(t,e){return this.create(this._DEC_XFORM_MODE,t,e)},init:function(t,e,i){this.cfg=this.cfg.extend(i),this._xformMode=t,this._key=e,this.reset()},reset:function(){r.reset.call(this),this._doReset()},process:function(t){return this._append(t),this._process()},finalize:function(t){return t&&this._append(t),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(t){return{encrypt:function(e,i,n){return("string"==typeof i?A:d).encrypt(t,e,i,n)},decrypt:function(e,i,n){return("string"==typeof i?A:d).decrypt(t,e,i,n)}}}});e.StreamCipher=a.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var u=p.mode={},h=function(t,e,i){var n=this._iv;n?this._iv=void 0:n=this._prevBlock;for(var r=0;r<i;r++)t[e+r]^=n[r]},l=(e.BlockCipherMode=i.extend({createEncryptor:function(t,e){return this.Encryptor.create(t,e)},createDecryptor:function(t,e){return this.Decryptor.create(t,e)},init:function(t,e){this._cipher=t,this._iv=e}})).extend();l.Encryptor=l.extend({processBlock:function(t,e){var i=this._cipher,n=i.blockSize;h.call(this,t,e,n),i.encryptBlock(t,e),this._prevBlock=t.slice(e,e+n)}}),l.Decryptor=l.extend({processBlock:function(t,e){var i=this._cipher,n=i.blockSize,r=t.slice(e,e+n);i.decryptBlock(t,e),h.call(this,t,e,n),this._prevBlock=r}}),u=u.CBC=l,l=(p.pad={}).Pkcs7={pad:function(t,e){for(var i,r=(i=(i=4*e)-t.sigBytes%i)<<24|i<<16|i<<8|i,o=[],s=0;s<i;s+=4)o.push(r);i=n.create(o,i),t.concat(i)},unpad:function(t){t.sigBytes-=255&t.words[t.sigBytes-1>>>2]}},e.BlockCipher=a.extend({cfg:a.cfg.extend({mode:u,padding:l}),reset:function(){a.reset.call(this);var t=(e=this.cfg).iv,e=e.mode;if(this._xformMode==this._ENC_XFORM_MODE)var i=e.createEncryptor;else i=e.createDecryptor,this._minBufferSize=1;this._mode=i.call(e,this,t&&t.words)},_doProcessBlock:function(t,e){this._mode.processBlock(t,e)},_doFinalize:function(){var t=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){t.pad(this._data,this.blockSize);var e=this._process(!0)}else e=this._process(!0),t.unpad(e);return e},blockSize:4});var c=e.CipherParams=i.extend({init:function(t){this.mixIn(t)},toString:function(t){return(t||this.formatter).stringify(this)}}),d=(u=(p.format={}).OpenSSL={stringify:function(t){var e=t.ciphertext;return((t=t.salt)?n.create([1398893684,1701076831]).concat(t).concat(e):e).toString(o)},parse:function(t){var e=(t=o.parse(t)).words;if(1398893684==e[0]&&1701076831==e[1]){var i=n.create(e.slice(2,4));e.splice(0,4),t.sigBytes-=16}return c.create({ciphertext:t,salt:i})}},e.SerializableCipher=i.extend({cfg:i.extend({format:u}),encrypt:function(t,e,i,n){n=this.cfg.extend(n);var r=t.createEncryptor(i,n);return e=r.finalize(e),r=r.cfg,c.create({ciphertext:e,key:i,iv:r.iv,algorithm:t,mode:r.mode,padding:r.padding,blockSize:t.blockSize,formatter:n.format})},decrypt:function(t,e,i,n){return n=this.cfg.extend(n),e=this._parse(e,n.format),t.createDecryptor(i,n).finalize(e.ciphertext)},_parse:function(t,e){return"string"==typeof t?e.parse(t,this):t}})),p=(p.kdf={}).OpenSSL={execute:function(t,e,i,r){return r||(r=n.random(8)),t=s.create({keySize:e+i}).compute(t,r),i=n.create(t.words.slice(e),4*i),t.sigBytes=4*e,c.create({key:t,iv:i,salt:r})}},A=e.PasswordBasedCipher=d.extend({cfg:d.cfg.extend({kdf:p}),encrypt:function(t,e,i,n){return i=(n=this.cfg.extend(n)).kdf.execute(i,t.keySize,t.ivSize),n.iv=i.iv,(t=d.encrypt.call(this,t,e,i.key,n)).mixIn(i),t},decrypt:function(t,e,i,n){return n=this.cfg.extend(n),e=this._parse(e,n.format),i=n.kdf.execute(i,t.keySize,t.ivSize,e.salt),n.iv=i.iv,d.decrypt.call(this,t,e,i.key,n)}})}(),function(){for(var t=g,e=t.lib.BlockCipher,i=t.algo,n=[],r=[],o=[],s=[],a=[],u=[],h=[],l=[],c=[],d=[],p=[],A=0;256>A;A++)p[A]=128>A?A<<1:A<<1^283;var f=0,v=0;for(A=0;256>A;A++){var m=(m=v^v<<1^v<<2^v<<3^v<<4)>>>8^255&m^99;n[f]=m,r[m]=f;var y=p[f],b=p[y],w=p[b],E=257*p[m]^16843008*m;o[f]=E<<24|E>>>8,s[f]=E<<16|E>>>16,a[f]=E<<8|E>>>24,u[f]=E,E=16843009*w^65537*b^257*y^16843008*f,h[m]=E<<24|E>>>8,l[m]=E<<16|E>>>16,c[m]=E<<8|E>>>24,d[m]=E,f?(f=y^p[p[p[w^y]]],v^=p[p[v]]):f=v=1}var x=[0,1,2,4,8,16,32,64,128,27,54];i=i.AES=e.extend({_doReset:function(){for(var t=(i=this._key).words,e=i.sigBytes/4,i=4*((this._nRounds=e+6)+1),r=this._keySchedule=[],o=0;o<i;o++)if(o<e)r[o]=t[o];else{var s=r[o-1];o%e?6<e&&4==o%e&&(s=n[s>>>24]<<24|n[s>>>16&255]<<16|n[s>>>8&255]<<8|n[255&s]):(s=n[(s=s<<8|s>>>24)>>>24]<<24|n[s>>>16&255]<<16|n[s>>>8&255]<<8|n[255&s],s^=x[o/e|0]<<24),r[o]=r[o-e]^s}for(t=this._invKeySchedule=[],e=0;e<i;e++)o=i-e,s=e%4?r[o]:r[o-4],t[e]=4>e||4>=o?s:h[n[s>>>24]]^l[n[s>>>16&255]]^c[n[s>>>8&255]]^d[n[255&s]]},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._keySchedule,o,s,a,u,n)},decryptBlock:function(t,e){var i=t[e+1];t[e+1]=t[e+3],t[e+3]=i,this._doCryptBlock(t,e,this._invKeySchedule,h,l,c,d,r),i=t[e+1],t[e+1]=t[e+3],t[e+3]=i},_doCryptBlock:function(t,e,i,n,r,o,s,a){for(var u=this._nRounds,h=t[e]^i[0],l=t[e+1]^i[1],c=t[e+2]^i[2],d=t[e+3]^i[3],p=4,A=1;A<u;A++){var f=n[h>>>24]^r[l>>>16&255]^o[c>>>8&255]^s[255&d]^i[p++],g=n[l>>>24]^r[c>>>16&255]^o[d>>>8&255]^s[255&h]^i[p++],v=n[c>>>24]^r[d>>>16&255]^o[h>>>8&255]^s[255&l]^i[p++];d=n[d>>>24]^r[h>>>16&255]^o[l>>>8&255]^s[255&c]^i[p++],h=f,l=g,c=v}f=(a[h>>>24]<<24|a[l>>>16&255]<<16|a[c>>>8&255]<<8|a[255&d])^i[p++],g=(a[l>>>24]<<24|a[c>>>16&255]<<16|a[d>>>8&255]<<8|a[255&h])^i[p++],v=(a[c>>>24]<<24|a[d>>>16&255]<<16|a[h>>>8&255]<<8|a[255&l])^i[p++],d=(a[d>>>24]<<24|a[h>>>16&255]<<16|a[l>>>8&255]<<8|a[255&c])^i[p++],t[e]=f,t[e+1]=g,t[e+2]=v,t[e+3]=d},keySize:8}),t.AES=e._createHelper(i)}(),f.lang={extend:function(t,e,i){if(!e||!t)throw new Error("YAHOO.lang.extend failed, please check that all dependencies are included.");var n=function(){};if(n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t,t.superclass=e.prototype,e.prototype.constructor==Object.prototype.constructor&&(e.prototype.constructor=e),i){var r;for(r in i)t.prototype[r]=i[r];var o=function(){},s=["toString","valueOf"];try{/MSIE/.test("undefined"!=typeof navigator?navigator.userAgent:"node")&&(o=function(t,e){for(r=0;r<s.length;r+=1){var i=s[r],n=e[i];"function"==typeof n&&n!=Object.prototype[i]&&(t[i]=n)}})}catch(t){}o(t.prototype,i)}}},"undefined"!=typeof navigator&&"Microsoft Internet Explorer"==navigator.appName?(v.prototype.am=function(t,e,i,n,r,o){for(var s=32767&e,a=e>>15;--o>=0;){var u=32767&this[t],h=this[t++]>>15,l=a*u+h*s;r=((u=s*u+((32767&l)<<15)+i[n]+(1073741823&r))>>>30)+(l>>>15)+a*h+(r>>>30),i[n++]=1073741823&u}return r},p=30):"undefined"!=typeof navigator&&"Netscape"!=navigator.appName?(v.prototype.am=function(t,e,i,n,r,o){for(;--o>=0;){var s=e*this[t++]+i[n]+r;r=Math.floor(s/67108864),i[n++]=67108863&s}return r},p=26):(v.prototype.am=function(t,e,i,n,r,o){for(var s=16383&e,a=e>>14;--o>=0;){var u=16383&this[t],h=this[t++]>>14,l=a*u+h*s;r=((u=s*u+((16383&l)<<14)+i[n]+r)>>28)+(l>>14)+a*h,i[n++]=268435455&u}return r},p=28),v.prototype.DB=p,v.prototype.DM=(1<<p)-1,v.prototype.DV=1<<p,v.prototype.FV=Math.pow(2,52),v.prototype.F1=52-p,v.prototype.F2=2*p-52;var y,b,w=new Array;for(y="0".charCodeAt(0),b=0;b<=9;++b)w[y++]=b;for(y="a".charCodeAt(0),b=10;b<36;++b)w[y++]=b;for(y="A".charCodeAt(0),b=10;b<36;++b)w[y++]=b;function E(t){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(t)}function x(t,e){var i=w[t.charCodeAt(e)];return null==i?-1:i}function I(t){var e=m();return e.fromInt(t),e}function C(t){var e,i=1;return 0!=(e=t>>>16)&&(t=e,i+=16),0!=(e=t>>8)&&(t=e,i+=8),0!=(e=t>>4)&&(t=e,i+=4),0!=(e=t>>2)&&(t=e,i+=2),0!=(e=t>>1)&&(t=e,i+=1),i}function S(t){this.m=t}function B(t){this.m=t,this.mp=t.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<t.DB-15)-1,this.mt2=2*t.t}function M(t,e){return t&e}function P(t,e){return t|e}function T(t,e){return t^e}function R(t,e){return t&~e}function k(t){if(0==t)return-1;var e=0;return 0==(65535&t)&&(t>>=16,e+=16),0==(255&t)&&(t>>=8,e+=8),0==(15&t)&&(t>>=4,e+=4),0==(3&t)&&(t>>=2,e+=2),0==(1&t)&&++e,e}function Q(t){for(var e=0;0!=t;)t&=t-1,++e;return e}function D(){}function N(t){return t}function F(t){this.r2=m(),this.q3=m(),v.ONE.dlShiftTo(2*t.t,this.r2),this.mu=this.r2.divide(t),this.m=t}S.prototype.convert=function(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t},S.prototype.revert=function(t){return t},S.prototype.reduce=function(t){t.divRemTo(this.m,null,t)},S.prototype.mulTo=function(t,e,i){t.multiplyTo(e,i),this.reduce(i)},S.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},B.prototype.convert=function(t){var e=m();return t.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),t.s<0&&e.compareTo(v.ZERO)>0&&this.m.subTo(e,e),e},B.prototype.revert=function(t){var e=m();return t.copyTo(e),this.reduce(e),e},B.prototype.reduce=function(t){for(;t.t<=this.mt2;)t[t.t++]=0;for(var e=0;e<this.m.t;++e){var i=32767&t[e],n=i*this.mpl+((i*this.mph+(t[e]>>15)*this.mpl&this.um)<<15)&t.DM;for(t[i=e+this.m.t]+=this.m.am(0,n,t,e,0,this.m.t);t[i]>=t.DV;)t[i]-=t.DV,t[++i]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)},B.prototype.mulTo=function(t,e,i){t.multiplyTo(e,i),this.reduce(i)},B.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},v.prototype.copyTo=function(t){for(var e=this.t-1;e>=0;--e)t[e]=this[e];t.t=this.t,t.s=this.s},v.prototype.fromInt=function(t){this.t=1,this.s=t<0?-1:0,t>0?this[0]=t:t<-1?this[0]=t+this.DV:this.t=0},v.prototype.fromString=function(t,e){var i;if(16==e)i=4;else if(8==e)i=3;else if(256==e)i=8;else if(2==e)i=1;else if(32==e)i=5;else{if(4!=e)return void this.fromRadix(t,e);i=2}this.t=0,this.s=0;for(var n=t.length,r=!1,o=0;--n>=0;){var s=8==i?255&t[n]:x(t,n);s<0?"-"==t.charAt(n)&&(r=!0):(r=!1,0==o?this[this.t++]=s:o+i>this.DB?(this[this.t-1]|=(s&(1<<this.DB-o)-1)<<o,this[this.t++]=s>>this.DB-o):this[this.t-1]|=s<<o,(o+=i)>=this.DB&&(o-=this.DB))}8==i&&0!=(128&t[0])&&(this.s=-1,o>0&&(this[this.t-1]|=(1<<this.DB-o)-1<<o)),this.clamp(),r&&v.ZERO.subTo(this,this)},v.prototype.clamp=function(){for(var t=this.s&this.DM;this.t>0&&this[this.t-1]==t;)--this.t},v.prototype.dlShiftTo=function(t,e){var i;for(i=this.t-1;i>=0;--i)e[i+t]=this[i];for(i=t-1;i>=0;--i)e[i]=0;e.t=this.t+t,e.s=this.s},v.prototype.drShiftTo=function(t,e){for(var i=t;i<this.t;++i)e[i-t]=this[i];e.t=Math.max(this.t-t,0),e.s=this.s},v.prototype.lShiftTo=function(t,e){var i,n=t%this.DB,r=this.DB-n,o=(1<<r)-1,s=Math.floor(t/this.DB),a=this.s<<n&this.DM;for(i=this.t-1;i>=0;--i)e[i+s+1]=this[i]>>r|a,a=(this[i]&o)<<n;for(i=s-1;i>=0;--i)e[i]=0;e[s]=a,e.t=this.t+s+1,e.s=this.s,e.clamp()},v.prototype.rShiftTo=function(t,e){e.s=this.s;var i=Math.floor(t/this.DB);if(i>=this.t)e.t=0;else{var n=t%this.DB,r=this.DB-n,o=(1<<n)-1;e[0]=this[i]>>n;for(var s=i+1;s<this.t;++s)e[s-i-1]|=(this[s]&o)<<r,e[s-i]=this[s]>>n;n>0&&(e[this.t-i-1]|=(this.s&o)<<r),e.t=this.t-i,e.clamp()}},v.prototype.subTo=function(t,e){for(var i=0,n=0,r=Math.min(t.t,this.t);i<r;)n+=this[i]-t[i],e[i++]=n&this.DM,n>>=this.DB;if(t.t<this.t){for(n-=t.s;i<this.t;)n+=this[i],e[i++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;i<t.t;)n-=t[i],e[i++]=n&this.DM,n>>=this.DB;n-=t.s}e.s=n<0?-1:0,n<-1?e[i++]=this.DV+n:n>0&&(e[i++]=n),e.t=i,e.clamp()},v.prototype.multiplyTo=function(t,e){var i=this.abs(),n=t.abs(),r=i.t;for(e.t=r+n.t;--r>=0;)e[r]=0;for(r=0;r<n.t;++r)e[r+i.t]=i.am(0,n[r],e,r,0,i.t);e.s=0,e.clamp(),this.s!=t.s&&v.ZERO.subTo(e,e)},v.prototype.squareTo=function(t){for(var e=this.abs(),i=t.t=2*e.t;--i>=0;)t[i]=0;for(i=0;i<e.t-1;++i){var n=e.am(i,e[i],t,2*i,0,1);(t[i+e.t]+=e.am(i+1,2*e[i],t,2*i+1,n,e.t-i-1))>=e.DV&&(t[i+e.t]-=e.DV,t[i+e.t+1]=1)}t.t>0&&(t[t.t-1]+=e.am(i,e[i],t,2*i,0,1)),t.s=0,t.clamp()},v.prototype.divRemTo=function(t,e,i){var n=t.abs();if(!(n.t<=0)){var r=this.abs();if(r.t<n.t)return null!=e&&e.fromInt(0),void(null!=i&&this.copyTo(i));null==i&&(i=m());var o=m(),s=this.s,a=t.s,u=this.DB-C(n[n.t-1]);u>0?(n.lShiftTo(u,o),r.lShiftTo(u,i)):(n.copyTo(o),r.copyTo(i));var h=o.t,l=o[h-1];if(0!=l){var c=l*(1<<this.F1)+(h>1?o[h-2]>>this.F2:0),d=this.FV/c,p=(1<<this.F1)/c,A=1<<this.F2,f=i.t,g=f-h,y=null==e?m():e;for(o.dlShiftTo(g,y),i.compareTo(y)>=0&&(i[i.t++]=1,i.subTo(y,i)),v.ONE.dlShiftTo(h,y),y.subTo(o,o);o.t<h;)o[o.t++]=0;for(;--g>=0;){var b=i[--f]==l?this.DM:Math.floor(i[f]*d+(i[f-1]+A)*p);if((i[f]+=o.am(0,b,i,g,0,h))<b)for(o.dlShiftTo(g,y),i.subTo(y,i);i[f]<--b;)i.subTo(y,i)}null!=e&&(i.drShiftTo(h,e),s!=a&&v.ZERO.subTo(e,e)),i.t=h,i.clamp(),u>0&&i.rShiftTo(u,i),s<0&&v.ZERO.subTo(i,i)}}},v.prototype.invDigit=function(){if(this.t<1)return 0;var t=this[0];if(0==(1&t))return 0;var e=3&t;return(e=(e=(e=(e=e*(2-(15&t)*e)&15)*(2-(255&t)*e)&255)*(2-((65535&t)*e&65535))&65535)*(2-t*e%this.DV)%this.DV)>0?this.DV-e:-e},v.prototype.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)},v.prototype.exp=function(t,e){if(t>4294967295||t<1)return v.ONE;var i=m(),n=m(),r=e.convert(this),o=C(t)-1;for(r.copyTo(i);--o>=0;)if(e.sqrTo(i,n),(t&1<<o)>0)e.mulTo(n,r,i);else{var s=i;i=n,n=s}return e.revert(i)},v.prototype.toString=function(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(16==t)e=4;else if(8==t)e=3;else if(2==t)e=1;else if(32==t)e=5;else{if(4!=t)return this.toRadix(t);e=2}var i,n=(1<<e)-1,r=!1,o="",s=this.t,a=this.DB-s*this.DB%e;if(s-- >0)for(a<this.DB&&(i=this[s]>>a)>0&&(r=!0,o=E(i));s>=0;)a<e?(i=(this[s]&(1<<a)-1)<<e-a,i|=this[--s]>>(a+=this.DB-e)):(i=this[s]>>(a-=e)&n,a<=0&&(a+=this.DB,--s)),i>0&&(r=!0),r&&(o+=E(i));return r?o:"0"},v.prototype.negate=function(){var t=m();return v.ZERO.subTo(this,t),t},v.prototype.abs=function(){return this.s<0?this.negate():this},v.prototype.compareTo=function(t){var e=this.s-t.s;if(0!=e)return e;var i=this.t;if(0!=(e=i-t.t))return this.s<0?-e:e;for(;--i>=0;)if(0!=(e=this[i]-t[i]))return e;return 0},v.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+C(this[this.t-1]^this.s&this.DM)},v.prototype.mod=function(t){var e=m();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(v.ZERO)>0&&t.subTo(e,e),e},v.prototype.modPowInt=function(t,e){var i;return i=t<256||e.isEven()?new S(e):new B(e),this.exp(t,i)},v.ZERO=I(0),v.ONE=I(1),D.prototype.convert=N,D.prototype.revert=N,D.prototype.mulTo=function(t,e,i){t.multiplyTo(e,i)},D.prototype.sqrTo=function(t,e){t.squareTo(e)},F.prototype.convert=function(t){if(t.s<0||t.t>2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=m();return t.copyTo(e),this.reduce(e),e},F.prototype.revert=function(t){return t},F.prototype.reduce=function(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)},F.prototype.mulTo=function(t,e,i){t.multiplyTo(e,i),this.reduce(i)},F.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)};var O=[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],L=(1<<26)/O[O.length-1];v.prototype.chunkSize=function(t){return Math.floor(Math.LN2*this.DB/Math.log(t))},v.prototype.toRadix=function(t){if(null==t&&(t=10),0==this.signum()||t<2||t>36)return"0";var e=this.chunkSize(t),i=Math.pow(t,e),n=I(i),r=m(),o=m(),s="";for(this.divRemTo(n,r,o);r.signum()>0;)s=(i+o.intValue()).toString(t).substr(1)+s,r.divRemTo(n,r,o);return o.intValue().toString(t)+s},v.prototype.fromRadix=function(t,e){this.fromInt(0),null==e&&(e=10);for(var i=this.chunkSize(e),n=Math.pow(e,i),r=!1,o=0,s=0,a=0;a<t.length;++a){var u=x(t,a);u<0?"-"==t.charAt(a)&&0==this.signum()&&(r=!0):(s=e*s+u,++o>=i&&(this.dMultiply(n),this.dAddOffset(s,0),o=0,s=0))}o>0&&(this.dMultiply(Math.pow(e,o)),this.dAddOffset(s,0)),r&&v.ZERO.subTo(this,this)},v.prototype.fromNumber=function(t,e,i){if("number"==typeof e)if(t<2)this.fromInt(1);else for(this.fromNumber(t,i),this.testBit(t-1)||this.bitwiseTo(v.ONE.shiftLeft(t-1),P,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(v.ONE.shiftLeft(t-1),this);else{var n=new Array,r=7&t;n.length=1+(t>>3),e.nextBytes(n),r>0?n[0]&=(1<<r)-1:n[0]=0,this.fromString(n,256)}},v.prototype.bitwiseTo=function(t,e,i){var n,r,o=Math.min(t.t,this.t);for(n=0;n<o;++n)i[n]=e(this[n],t[n]);if(t.t<this.t){for(r=t.s&this.DM,n=o;n<this.t;++n)i[n]=e(this[n],r);i.t=this.t}else{for(r=this.s&this.DM,n=o;n<t.t;++n)i[n]=e(r,t[n]);i.t=t.t}i.s=e(this.s,t.s),i.clamp()},v.prototype.changeBit=function(t,e){var i=v.ONE.shiftLeft(t);return this.bitwiseTo(i,e,i),i},v.prototype.addTo=function(t,e){for(var i=0,n=0,r=Math.min(t.t,this.t);i<r;)n+=this[i]+t[i],e[i++]=n&this.DM,n>>=this.DB;if(t.t<this.t){for(n+=t.s;i<this.t;)n+=this[i],e[i++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;i<t.t;)n+=t[i],e[i++]=n&this.DM,n>>=this.DB;n+=t.s}e.s=n<0?-1:0,n>0?e[i++]=n:n<-1&&(e[i++]=this.DV+n),e.t=i,e.clamp()},v.prototype.dMultiply=function(t){this[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()},v.prototype.dAddOffset=function(t,e){if(0!=t){for(;this.t<=e;)this[this.t++]=0;for(this[e]+=t;this[e]>=this.DV;)this[e]-=this.DV,++e>=this.t&&(this[this.t++]=0),++this[e]}},v.prototype.multiplyLowerTo=function(t,e,i){var n,r=Math.min(this.t+t.t,e);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,t[r],i,r,0,this.t);for(n=Math.min(t.t,e);r<n;++r)this.am(0,t[r],i,r,0,e-r);i.clamp()},v.prototype.multiplyUpperTo=function(t,e,i){--e;var n=i.t=this.t+t.t-e;for(i.s=0;--n>=0;)i[n]=0;for(n=Math.max(e-this.t,0);n<t.t;++n)i[this.t+n-e]=this.am(e-n,t[n],i,0,0,this.t+n-e);i.clamp(),i.drShiftTo(1,i)},v.prototype.modInt=function(t){if(t<=0)return 0;var e=this.DV%t,i=this.s<0?t-1:0;if(this.t>0)if(0==e)i=this[0]%t;else for(var n=this.t-1;n>=0;--n)i=(e*i+this[n])%t;return i},v.prototype.millerRabin=function(t){var e=this.subtract(v.ONE),i=e.getLowestSetBit();if(i<=0)return!1;var n=e.shiftRight(i);(t=t+1>>1)>O.length&&(t=O.length);for(var r=m(),o=0;o<t;++o){r.fromInt(O[Math.floor(Math.random()*O.length)]);var s=r.modPow(n,this);if(0!=s.compareTo(v.ONE)&&0!=s.compareTo(e)){for(var a=1;a++<i&&0!=s.compareTo(e);)if(0==(s=s.modPowInt(2,this)).compareTo(v.ONE))return!1;if(0!=s.compareTo(e))return!1}}return!0},v.prototype.clone=function(){var t=m();return this.copyTo(t),t},v.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]},v.prototype.byteValue=function(){return 0==this.t?this.s:this[0]<<24>>24},v.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},v.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},v.prototype.toByteArray=function(){var t=this.t,e=new Array;e[0]=this.s;var i,n=this.DB-t*this.DB%8,r=0;if(t-- >0)for(n<this.DB&&(i=this[t]>>n)!=(this.s&this.DM)>>n&&(e[r++]=i|this.s<<this.DB-n);t>=0;)n<8?(i=(this[t]&(1<<n)-1)<<8-n,i|=this[--t]>>(n+=this.DB-8)):(i=this[t]>>(n-=8)&255,n<=0&&(n+=this.DB,--t)),0!=(128&i)&&(i|=-256),0==r&&(128&this.s)!=(128&i)&&++r,(r>0||i!=this.s)&&(e[r++]=i);return e},v.prototype.equals=function(t){return 0==this.compareTo(t)},v.prototype.min=function(t){return this.compareTo(t)<0?this:t},v.prototype.max=function(t){return this.compareTo(t)>0?this:t},v.prototype.and=function(t){var e=m();return this.bitwiseTo(t,M,e),e},v.prototype.or=function(t){var e=m();return this.bitwiseTo(t,P,e),e},v.prototype.xor=function(t){var e=m();return this.bitwiseTo(t,T,e),e},v.prototype.andNot=function(t){var e=m();return this.bitwiseTo(t,R,e),e},v.prototype.not=function(){for(var t=m(),e=0;e<this.t;++e)t[e]=this.DM&~this[e];return t.t=this.t,t.s=~this.s,t},v.prototype.shiftLeft=function(t){var e=m();return t<0?this.rShiftTo(-t,e):this.lShiftTo(t,e),e},v.prototype.shiftRight=function(t){var e=m();return t<0?this.lShiftTo(-t,e):this.rShiftTo(t,e),e},v.prototype.getLowestSetBit=function(){for(var t=0;t<this.t;++t)if(0!=this[t])return t*this.DB+k(this[t]);return this.s<0?this.t*this.DB:-1},v.prototype.bitCount=function(){for(var t=0,e=this.s&this.DM,i=0;i<this.t;++i)t+=Q(this[i]^e);return t},v.prototype.testBit=function(t){var e=Math.floor(t/this.DB);return e>=this.t?0!=this.s:0!=(this[e]&1<<t%this.DB)},v.prototype.setBit=function(t){return this.changeBit(t,P)},v.prototype.clearBit=function(t){return this.changeBit(t,R)},v.prototype.flipBit=function(t){return this.changeBit(t,T)},v.prototype.add=function(t){var e=m();return this.addTo(t,e),e},v.prototype.subtract=function(t){var e=m();return this.subTo(t,e),e},v.prototype.multiply=function(t){var e=m();return this.multiplyTo(t,e),e},v.prototype.divide=function(t){var e=m();return this.divRemTo(t,e,null),e},v.prototype.remainder=function(t){var e=m();return this.divRemTo(t,null,e),e},v.prototype.divideAndRemainder=function(t){var e=m(),i=m();return this.divRemTo(t,e,i),new Array(e,i)},v.prototype.modPow=function(t,e){var i,n,r=t.bitLength(),o=I(1);if(r<=0)return o;i=r<18?1:r<48?3:r<144?4:r<768?5:6,n=r<8?new S(e):e.isEven()?new F(e):new B(e);var s=new Array,a=3,u=i-1,h=(1<<i)-1;if(s[1]=n.convert(this),i>1){var l=m();for(n.sqrTo(s[1],l);a<=h;)s[a]=m(),n.mulTo(l,s[a-2],s[a]),a+=2}var c,d,p=t.t-1,A=!0,f=m();for(r=C(t[p])-1;p>=0;){for(r>=u?c=t[p]>>r-u&h:(c=(t[p]&(1<<r+1)-1)<<u-r,p>0&&(c|=t[p-1]>>this.DB+r-u)),a=i;0==(1&c);)c>>=1,--a;if((r-=a)<0&&(r+=this.DB,--p),A)s[c].copyTo(o),A=!1;else{for(;a>1;)n.sqrTo(o,f),n.sqrTo(f,o),a-=2;a>0?n.sqrTo(o,f):(d=o,o=f,f=d),n.mulTo(f,s[c],o)}for(;p>=0&&0==(t[p]&1<<r);)n.sqrTo(o,f),d=o,o=f,f=d,--r<0&&(r=this.DB-1,--p)}return n.revert(o)},v.prototype.modInverse=function(t){var e=t.isEven();if(this.isEven()&&e||0==t.signum())return v.ZERO;for(var i=t.clone(),n=this.clone(),r=I(1),o=I(0),s=I(0),a=I(1);0!=i.signum();){for(;i.isEven();)i.rShiftTo(1,i),e?(r.isEven()&&o.isEven()||(r.addTo(this,r),o.subTo(t,o)),r.rShiftTo(1,r)):o.isEven()||o.subTo(t,o),o.rShiftTo(1,o);for(;n.isEven();)n.rShiftTo(1,n),e?(s.isEven()&&a.isEven()||(s.addTo(this,s),a.subTo(t,a)),s.rShiftTo(1,s)):a.isEven()||a.subTo(t,a),a.rShiftTo(1,a);i.compareTo(n)>=0?(i.subTo(n,i),e&&r.subTo(s,r),o.subTo(a,o)):(n.subTo(i,n),e&&s.subTo(r,s),a.subTo(o,a))}return 0!=n.compareTo(v.ONE)?v.ZERO:a.compareTo(t)>=0?a.subtract(t):a.signum()<0?(a.addTo(t,a),a.signum()<0?a.add(t):a):a},v.prototype.pow=function(t){return this.exp(t,new D)},v.prototype.gcd=function(t){var e=this.s<0?this.negate():this.clone(),i=t.s<0?t.negate():t.clone();if(e.compareTo(i)<0){var n=e;e=i,i=n}var r=e.getLowestSetBit(),o=i.getLowestSetBit();if(o<0)return e;for(r<o&&(o=r),o>0&&(e.rShiftTo(o,e),i.rShiftTo(o,i));e.signum()>0;)(r=e.getLowestSetBit())>0&&e.rShiftTo(r,e),(r=i.getLowestSetBit())>0&&i.rShiftTo(r,i),e.compareTo(i)>=0?(e.subTo(i,e),e.rShiftTo(1,e)):(i.subTo(e,i),i.rShiftTo(1,i));return o>0&&i.lShiftTo(o,i),i},v.prototype.isProbablePrime=function(t){var e,i=this.abs();if(1==i.t&&i[0]<=O[O.length-1]){for(e=0;e<O.length;++e)if(i[0]==O[e])return!0;return!1}if(i.isEven())return!1;for(e=1;e<O.length;){for(var n=O[e],r=e+1;r<O.length&&n<L;)n*=O[r++];for(n=i.modInt(n);e<r;)if(n%O[e++]==0)return!1}return i.millerRabin(t)},v.prototype.square=function(){var t=m();return this.squareTo(t),t};var V,H,z,K="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function q(t){var e,i,n="";for(e=0;e+3<=t.length;e+=3)i=parseInt(t.substring(e,e+3),16),n+=K.charAt(i>>6)+K.charAt(63&i);for(e+1==t.length?(i=parseInt(t.substring(e,e+1),16),n+=K.charAt(i<<2)):e+2==t.length&&(i=parseInt(t.substring(e,e+2),16),n+=K.charAt(i>>2)+K.charAt((3&i)<<4));(3&n.length)>0;)n+="=";return n}function j(t){var e,i,n,r="",o=0;for(e=0;e<t.length&&"="!=t.charAt(e);++e)(n=K.indexOf(t.charAt(e)))<0||(0==o?(r+=E(n>>2),i=3&n,o=1):1==o?(r+=E(i<<2|n>>4),i=15&n,o=2):2==o?(r+=E(i),r+=E(n>>2),i=3&n,o=3):(r+=E(i<<2|n>>4),r+=E(15&n),o=0));return 1==o&&(r+=E(i<<2)),r}function U(){this.i=0,this.j=0,this.S=new Array}function G(){!function(t){H[z++]^=255&t,H[z++]^=t>>8&255,H[z++]^=t>>16&255,H[z++]^=t>>24&255,z>=256&&(z-=256)}((new Date).getTime())}if(U.prototype.init=function(t){var e,i,n;for(e=0;e<256;++e)this.S[e]=e;for(i=0,e=0;e<256;++e)i=i+this.S[e]+t[e%t.length]&255,n=this.S[e],this.S[e]=this.S[i],this.S[i]=n;this.i=0,this.j=0},U.prototype.next=function(){var t;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,t=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=t,this.S[t+this.S[this.i]&255]},null==H){var _;if(H=new Array,z=0,"undefined"!=typeof window&&(void 0!==window.crypto||void 0!==window.msCrypto)){var W=window.crypto||window.msCrypto;if(W.getRandomValues){var X=new Uint8Array(32);for(W.getRandomValues(X),_=0;_<32;++_)H[z++]=X[_]}else if("undefined"!=typeof navigator&&"Netscape"==navigator.appName&&navigator.appVersion<"5"){var Y=window.crypto.random(32);for(_=0;_<Y.length;++_)H[z++]=255&Y.charCodeAt(_)}}for(;z<256;)_=Math.floor(65536*Math.random()),H[z++]=_>>>8,H[z++]=255&_;z=0,G()}function Z(){if(null==V){for(G(),(V=new U).init(H),z=0;z<H.length;++z)H[z]=0;z=0}return V.next()}function J(){}function $(t,e){return new v(t,e)}function tt(t,e,i){for(var n="",r=0;n.length<e;)n+=i(String.fromCharCode.apply(String,t.concat([(4278190080&r)>>24,(16711680&r)>>16,(65280&r)>>8,255&r]))),r+=1;return n}function et(){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 it(t,e,i){for(var n="",r=0;n.length<e;)n+=i(t+String.fromCharCode.apply(String,[(4278190080&r)>>24,(16711680&r)>>16,(65280&r)>>8,255&r])),r+=1;return n}function nt(t){for(var e="",i=0;i<t.length;i++){var n=t[i].toString(16);1==n.length&&(n="0"+n),e+=n}return e}function rt(t){return nt(function(t){for(var e=new Array,i=0;i<t.length;i++)e[i]=t.charCodeAt(i);return e}(t))}function ot(t){return(t=(t=t.replace(/\=/g,"")).replace(/\+/g,"-")).replace(/\//g,"_")}function st(t){return t.length%4==2?t+="==":t.length%4==3&&(t+="="),(t=t.replace(/-/g,"+")).replace(/_/g,"/")}function at(t){return t.length%2==1&&(t="0"+t),ot(q(t))}function ut(t){return j(st(t))}function ht(t){return ft(mt(t))}function lt(t){return decodeURIComponent(function(t){return t.replace(/(..)/g,"%$1")}(t))}function ct(t){for(var e="",i=0;i<t.length-1;i+=2)e+=String.fromCharCode(parseInt(t.substr(i,2),16));return e}function dt(t){for(var e="",i=0;i<t.length;i++)e+=("0"+t.charCodeAt(i).toString(16)).slice(-2);return e}function pt(t,e){return"-----BEGIN "+e+"-----\r\n"+function(t){return function(t){return q(t)}(t).replace(/(.{64})/g,"$1\r\n").replace(/\r\n$/,"")}(t)+"\r\n-----END "+e+"-----\r\n"}function At(t,e){if(-1==t.indexOf("-----BEGIN "))throw"can't find PEM header: "+e;return function(t){return j(t.replace(/[^0-9A-Za-z\/+=]*/g,""))}(t=void 0!==e?(t=t.replace(new RegExp("^[^]*-----BEGIN "+e+"-----"),"")).replace(new RegExp("-----END "+e+"-----[^]*$"),""):(t=t.replace(/^[^]*-----BEGIN [^-]+-----/,"")).replace(/-----END [^-]+-----[^]*$/,""))}function ft(t){return t.replace(/%/g,"")}function gt(t){var e="malformed hex value";if(!t.match(/^([0-9A-Fa-f][0-9A-Fa-f]){1,}$/))throw e;if(8!=t.length)return 32==t.length?function(t){if(!t.match(/^[0-9A-Fa-f]{32}$/))throw"malformed IPv6 address octet";for(var e=(t=t.toLowerCase()).match(/.{1,4}/g),i=0;i<8;i++)e[i]=e[i].replace(/^0+/,""),""==e[i]&&(e[i]="0");var n=(t=":"+e.join(":")+":").match(/:(0:){2,}/g);if(null===n)return t.slice(1,-1);var r="";for(i=0;i<n.length;i++)n[i].length>r.length&&(r=n[i]);return(t=t.replace(r,"::")).slice(1,-1)}(t):t;try{return parseInt(t.substr(0,2),16)+"."+parseInt(t.substr(2,2),16)+"."+parseInt(t.substr(4,2),16)+"."+parseInt(t.substr(6,2),16)}catch(t){throw e}}function vt(t){return t.match(/.{4}/g).map((function(t){var e=parseInt(t.substr(0,2),16),i=parseInt(t.substr(2),16);if(0==e&i<128)return String.fromCharCode(i);if(e<8){var n=128|63&i;return lt((192|(7&e)<<3|(192&i)>>6).toString(16)+n.toString(16))}n=128|(15&e)<<2|(192&i)>>6;var r=128|63&i;return lt((224|(240&e)>>4).toString(16)+n.toString(16)+r.toString(16))})).join("")}function mt(t){for(var e=encodeURIComponent(t),i="",n=0;n<e.length;n++)"%"==e[n]?(i+=e.substr(n,3),n+=2):i=i+"%"+rt(e[n]);return i}function yt(t){return!(t.length%2!=0||!t.match(/^[0-9a-f]+$/)&&!t.match(/^[0-9A-F]+$/))}function bt(t){return t.length%2==1?"0"+t:t.substr(0,1)>"7"?"00"+t:t}J.prototype.nextBytes=function(t){var e;for(e=0;e<t.length;++e)t[e]=Z()},et.prototype.doPublic=function(t){return t.modPowInt(this.e,this.n)},et.prototype.setPublic=function(t,e){if(this.isPublic=!0,this.isPrivate=!1,"string"!=typeof t)this.n=t,this.e=e;else{if(!(null!=t&&null!=e&&t.length>0&&e.length>0))throw"Invalid RSA public key";this.n=$(t,16),this.e=parseInt(e,16)}},et.prototype.encrypt=function(t){var e=function(t,e){if(e<t.length+11)throw"Message too long for RSA";for(var i=new Array,n=t.length-1;n>=0&&e>0;){var r=t.charCodeAt(n--);r<128?i[--e]=r:r>127&&r<2048?(i[--e]=63&r|128,i[--e]=r>>6|192):(i[--e]=63&r|128,i[--e]=r>>6&63|128,i[--e]=r>>12|224)}i[--e]=0;for(var o=new J,s=new Array;e>2;){for(s[0]=0;0==s[0];)o.nextBytes(s);i[--e]=s[0]}return i[--e]=2,i[--e]=0,new v(i)}(t,this.n.bitLength()+7>>3);if(null==e)return null;var i=this.doPublic(e);if(null==i)return null;var n=i.toString(16);return 0==(1&n.length)?n:"0"+n},et.prototype.encryptOAEP=function(t,e,i){var n=function(t,e,i,n){var r=A.crypto.MessageDigest,o=A.crypto.Util,s=null;if(i||(i="sha1"),"string"==typeof i&&(s=r.getCanonicalAlgName(i),n=r.getHashLength(s),i=function(t){return ct(o.hashHex(dt(t),s))}),t.length+2*n+2>e)throw"Message too long for RSA";var a,u="";for(a=0;a<e-t.length-2*n-2;a+=1)u+="\0";var h=i("")+u+""+t,l=new Array(n);(new J).nextBytes(l);var c=tt(l,h.length,i),d=[];for(a=0;a<h.length;a+=1)d[a]=h.charCodeAt(a)^c.charCodeAt(a);var p=tt(d,l.length,i),f=[0];for(a=0;a<l.length;a+=1)f[a+1]=l[a]^p.charCodeAt(a);return new v(f.concat(d))}(t,this.n.bitLength()+7>>3,e,i);if(null==n)return null;var r=this.doPublic(n);if(null==r)return null;var o=r.toString(16);return 0==(1&o.length)?o:"0"+o},et.prototype.type="RSA",et.prototype.doPrivate=function(t){if(null==this.p||null==this.q)return t.modPow(this.d,this.n);for(var e=t.mod(this.p).modPow(this.dmp1,this.p),i=t.mod(this.q).modPow(this.dmq1,this.q);e.compareTo(i)<0;)e=e.add(this.p);return e.subtract(i).multiply(this.coeff).mod(this.p).multiply(this.q).add(i)},et.prototype.setPrivate=function(t,e,i){if(this.isPrivate=!0,"string"!=typeof t)this.n=t,this.e=e,this.d=i;else{if(!(null!=t&&null!=e&&t.length>0&&e.length>0))throw"Invalid RSA private key";this.n=$(t,16),this.e=parseInt(e,16),this.d=$(i,16)}},et.prototype.setPrivateEx=function(t,e,i,n,r,o,s,a){if(this.isPrivate=!0,this.isPublic=!1,null==t)throw"RSASetPrivateEx N == null";if(null==e)throw"RSASetPrivateEx E == null";if(0==t.length)throw"RSASetPrivateEx N.length == 0";if(0==e.length)throw"RSASetPrivateEx E.length == 0";if(!(null!=t&&null!=e&&t.length>0&&e.length>0))throw"Invalid RSA private key in RSASetPrivateEx";this.n=$(t,16),this.e=parseInt(e,16),this.d=$(i,16),this.p=$(n,16),this.q=$(r,16),this.dmp1=$(o,16),this.dmq1=$(s,16),this.coeff=$(a,16)},et.prototype.generate=function(t,e){var i=new J,n=t>>1;this.e=parseInt(e,16);for(var r=new v(e,16);;){for(;this.p=new v(t-n,1,i),0!=this.p.subtract(v.ONE).gcd(r).compareTo(v.ONE)||!this.p.isProbablePrime(10););for(;this.q=new v(n,1,i),0!=this.q.subtract(v.ONE).gcd(r).compareTo(v.ONE)||!this.q.isProbablePrime(10););if(this.p.compareTo(this.q)<=0){var o=this.p;this.p=this.q,this.q=o}var s=this.p.subtract(v.ONE),a=this.q.subtract(v.ONE),u=s.multiply(a);if(0==u.gcd(r).compareTo(v.ONE)&&(this.n=this.p.multiply(this.q),this.n.bitLength()==t)){this.d=r.modInverse(u),this.dmp1=this.d.mod(s),this.dmq1=this.d.mod(a),this.coeff=this.q.modInverse(this.p);break}}this.isPrivate=!0},et.prototype.decrypt=function(t){if(t.length!=Math.ceil(this.n.bitLength()/4))throw new Error("wrong ctext length");var e=$(t,16),i=this.doPrivate(e);return null==i?null:function(t,e){for(var i=t.toByteArray(),n=0;n<i.length&&0==i[n];)++n;if(i.length-n!=e-1||2!=i[n])return null;for(++n;0!=i[n];)if(++n>=i.length)return null;for(var r="";++n<i.length;){var o=255&i[n];o<128?r+=String.fromCharCode(o):o>191&&o<224?(r+=String.fromCharCode((31&o)<<6|63&i[n+1]),++n):(r+=String.fromCharCode((15&o)<<12|(63&i[n+1])<<6|63&i[n+2]),n+=2)}return r}(i,this.n.bitLength()+7>>3)},et.prototype.decryptOAEP=function(t,e,i){if(t.length!=Math.ceil(this.n.bitLength()/4))throw new Error("wrong ctext length");var n=$(t,16),r=this.doPrivate(n);return null==r?null:function(t,e,i,n){var r=A.crypto.MessageDigest,o=A.crypto.Util,s=null;for(i||(i="sha1"),"string"==typeof i&&(s=r.getCanonicalAlgName(i),n=r.getHashLength(s),i=function(t){return ct(o.hashHex(dt(t),s))}),t=t.toByteArray(),a=0;a<t.length;a+=1)t[a]&=255;for(;t.length<e;)t.unshift(0);if((t=String.fromCharCode.apply(String,t)).length<2*n+2)throw"Cipher too short";var a,u=t.substr(1,n),h=t.substr(n+1),l=it(h,n,i),c=[];for(a=0;a<u.length;a+=1)c[a]=u.charCodeAt(a)^l.charCodeAt(a);var d=it(String.fromCharCode.apply(String,c),t.length-n,i),p=[];for(a=0;a<h.length;a+=1)p[a]=h.charCodeAt(a)^d.charCodeAt(a);if((p=String.fromCharCode.apply(String,p)).substr(0,n)!==i(""))throw"Hash mismatch";var f=(p=p.substr(n)).indexOf("");if((-1!=f?p.substr(0,f).lastIndexOf("\0"):-1)+1!=f)throw"Malformed data";return p.substr(f+1)}(r,this.n.bitLength()+7>>3,e,i)},void 0!==A.lang&&A.lang||(A.lang={}),A.lang.String=function(){},A.lang.String.isInteger=function(t){return!!t.match(/^[0-9]+$/)||!!t.match(/^-[0-9]+$/)},A.lang.String.isHex=function(t){return yt(t)},A.lang.String.isBase64=function(t){return!(!(t=t.replace(/\s+/g,"")).match(/^[0-9A-Za-z+\/]+={0,3}$/)||t.length%4!=0)},A.lang.String.isBase64URL=function(t){return!t.match(/[+/=]/)&&(t=st(t),A.lang.String.isBase64(t))},A.lang.String.isIntegerArray=function(t){return!!(t=t.replace(/\s+/g,"")).match(/^\[[0-9,]+\]$/)},A.lang.String.isPrintable=function(t){return null!==t.match(/^[0-9A-Za-z '()+,-./:=?]*$/)},A.lang.String.isIA5=function(t){return null!==t.match(/^[\x20-\x21\x23-\x7f]*$/)},A.lang.String.isMail=function(t){return null!==t.match(/^[A-Za-z0-9]{1}[A-Za-z0-9_.-]*@{1}[A-Za-z0-9_.-]{1,}\.[A-Za-z0-9]{1,}$/)};var wt=function(t,e,i){return null==i&&(i="0"),t.length>=e?t:new Array(e-t.length+1).join(i)+t};function Et(t,e){var i=function(){};i.prototype=e.prototype,t.prototype=new i,t.prototype.constructor=t,t.superclass=e.prototype,e.prototype.constructor==Object.prototype.constructor&&(e.prototype.constructor=e)}void 0!==A.crypto&&A.crypto||(A.crypto={}),A.crypto.Util=new function(){this.DIGESTINFOHEAD={sha1:"3021300906052b0e03021a05000414",sha224:"302d300d06096086480165030402040500041c",sha256:"3031300d060960864801650304020105000420",sha384:"3041300d060960864801650304020205000430",sha512:"3051300d060960864801650304020305000440",md2:"3020300c06082a864886f70d020205000410",md5:"3020300c06082a864886f70d020505000410",ripemd160:"3021300906052b2403020105000414"},this.DEFAULTPROVIDER={md5:"cryptojs",sha1:"cryptojs",sha224:"cryptojs",sha256:"cryptojs",sha384:"cryptojs",sha512:"cryptojs",ripemd160:"cryptojs",hmacmd5:"cryptojs",hmacsha1:"cryptojs",hmacsha224:"cryptojs",hmacsha256:"cryptojs",hmacsha384:"cryptojs",hmacsha512:"cryptojs",hmacripemd160:"cryptojs",MD5withRSA:"cryptojs/jsrsa",SHA1withRSA:"cryptojs/jsrsa",SHA224withRSA:"cryptojs/jsrsa",SHA256withRSA:"cryptojs/jsrsa",SHA384withRSA:"cryptojs/jsrsa",SHA512withRSA:"cryptojs/jsrsa",RIPEMD160withRSA:"cryptojs/jsrsa",MD5withECDSA:"cryptojs/jsrsa",SHA1withECDSA:"cryptojs/jsrsa",SHA224withECDSA:"cryptojs/jsrsa",SHA256withECDSA:"cryptojs/jsrsa",SHA384withECDSA:"cryptojs/jsrsa",SHA512withECDSA:"cryptojs/jsrsa",RIPEMD160withECDSA:"cryptojs/jsrsa",SHA1withDSA:"cryptojs/jsrsa",SHA224withDSA:"cryptojs/jsrsa",SHA256withDSA:"cryptojs/jsrsa",MD5withRSAandMGF1:"cryptojs/jsrsa",SHAwithRSAandMGF1:"cryptojs/jsrsa",SHA1withRSAandMGF1:"cryptojs/jsrsa",SHA224withRSAandMGF1:"cryptojs/jsrsa",SHA256withRSAandMGF1:"cryptojs/jsrsa",SHA384withRSAandMGF1:"cryptojs/jsrsa",SHA512withRSAandMGF1:"cryptojs/jsrsa",RIPEMD160withRSAandMGF1:"cryptojs/jsrsa"},this.CRYPTOJSMESSAGEDIGESTNAME={md5:g.algo.MD5,sha1:g.algo.SHA1,sha224:g.algo.SHA224,sha256:g.algo.SHA256,sha384:g.algo.SHA384,sha512:g.algo.SHA512,ripemd160:g.algo.RIPEMD160},this.getDigestInfoHex=function(t,e){if(void 0===this.DIGESTINFOHEAD[e])throw"alg not supported in Util.DIGESTINFOHEAD: "+e;return this.DIGESTINFOHEAD[e]+t},this.getPaddedDigestInfoHex=function(t,e,i){var n=this.getDigestInfoHex(t,e),r=i/4;if(n.length+22>r)throw"key is too short for SigAlg: keylen="+i+","+e;for(var o="0001",s="00"+n,a="",u=r-o.length-s.length,h=0;h<u;h+=2)a+="ff";return o+a+s},this.hashString=function(t,e){return new A.crypto.MessageDigest({alg:e}).digestString(t)},this.hashHex=function(t,e){return new A.crypto.MessageDigest({alg:e}).digestHex(t)},this.sha1=function(t){return this.hashString(t,"sha1")},this.sha256=function(t){return this.hashString(t,"sha256")},this.sha256Hex=function(t){return this.hashHex(t,"sha256")},this.sha512=function(t){return this.hashString(t,"sha512")},this.sha512Hex=function(t){return this.hashHex(t,"sha512")},this.isKey=function(t){return t instanceof et||t instanceof A.crypto.DSA||t instanceof A.crypto.ECDSA}},A.crypto.Util.md5=function(t){return new A.crypto.MessageDigest({alg:"md5",prov:"cryptojs"}).digestString(t)},A.crypto.Util.ripemd160=function(t){return new A.crypto.MessageDigest({alg:"ripemd160",prov:"cryptojs"}).digestString(t)},A.crypto.Util.SECURERANDOMGEN=new J,A.crypto.Util.getRandomHexOfNbytes=function(t){var e=new Array(t);return A.crypto.Util.SECURERANDOMGEN.nextBytes(e),nt(e)},A.crypto.Util.getRandomBigIntegerOfNbytes=function(t){return new v(A.crypto.Util.getRandomHexOfNbytes(t),16)},A.crypto.Util.getRandomHexOfNbits=function(t){var e=t%8,i=new Array((t-e)/8+1);return A.crypto.Util.SECURERANDOMGEN.nextBytes(i),i[0]=(255<<e&255^255)&i[0],nt(i)},A.crypto.Util.getRandomBigIntegerOfNbits=function(t){return new v(A.crypto.Util.getRandomHexOfNbits(t),16)},A.crypto.Util.getRandomBigIntegerZeroToMax=function(t){for(var e=t.bitLength();;){var i=A.crypto.Util.getRandomBigIntegerOfNbits(e);if(-1!=t.compareTo(i))return i}},A.crypto.Util.getRandomBigIntegerMinToMax=function(t,e){var i=t.compareTo(e);if(1==i)throw"biMin is greater than biMax";if(0==i)return t;var n=e.subtract(t);return A.crypto.Util.getRandomBigIntegerZeroToMax(n).add(t)},A.crypto.MessageDigest=function(t){this.setAlgAndProvider=function(t,e){if(null!==(t=A.crypto.MessageDigest.getCanonicalAlgName(t))&&void 0===e&&(e=A.crypto.Util.DEFAULTPROVIDER[t]),-1!=":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(t)&&"cryptojs"==e){try{this.md=A.crypto.Util.CRYPTOJSMESSAGEDIGESTNAME[t].create()}catch(e){throw"setAlgAndProvider hash alg set fail alg="+t+"/"+e}this.updateString=function(t){this.md.update(t)},this.updateHex=function(t){var e=g.enc.Hex.parse(t);this.md.update(e)},this.digest=function(){return this.md.finalize().toString(g.enc.Hex)},this.digestString=function(t){return this.updateString(t),this.digest()},this.digestHex=function(t){return this.updateHex(t),this.digest()}}if(-1!=":sha256:".indexOf(t)&&"sjcl"==e){try{this.md=new sjcl.hash.sha256}catch(e){throw"setAlgAndProvider hash alg set fail alg="+t+"/"+e}this.updateString=function(t){this.md.update(t)},this.updateHex=function(t){var e=sjcl.codec.hex.toBits(t);this.md.update(e)},this.digest=function(){var t=this.md.finalize();return sjcl.codec.hex.fromBits(t)},this.digestString=function(t){return this.updateString(t),this.digest()},this.digestHex=function(t){return this.updateHex(t),this.digest()}}},this.updateString=function(t){throw"updateString(str) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.updateHex=function(t){throw"updateHex(hex) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.digest=function(){throw"digest() not supported for this alg/prov: "+this.algName+"/"+this.provName},this.digestString=function(t){throw"digestString(str) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.digestHex=function(t){throw"digestHex(hex) not supported for this alg/prov: "+this.algName+"/"+this.provName},void 0!==t&&void 0!==t.alg&&(this.algName=t.alg,void 0===t.prov&&(this.provName=A.crypto.Util.DEFAULTPROVIDER[this.algName]),this.setAlgAndProvider(this.algName,this.provName))},A.crypto.MessageDigest.getCanonicalAlgName=function(t){return"string"==typeof t&&(t=(t=t.toLowerCase()).replace(/-/,"")),t},A.crypto.MessageDigest.getHashLength=function(t){var e=A.crypto.MessageDigest,i=e.getCanonicalAlgName(t);if(void 0===e.HASHLENGTH[i])throw"not supported algorithm: "+t;return e.HASHLENGTH[i]},A.crypto.MessageDigest.HASHLENGTH={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,ripemd160:20},A.crypto.Mac=function(t){this.setAlgAndProvider=function(t,e){if(null==(t=t.toLowerCase())&&(t="hmacsha1"),"hmac"!=(t=t.toLowerCase()).substr(0,4))throw"setAlgAndProvider unsupported HMAC alg: "+t;void 0===e&&(e=A.crypto.Util.DEFAULTPROVIDER[t]),this.algProv=t+"/"+e;var i=t.substr(4);if(-1!=":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(i)&&"cryptojs"==e){try{var n=A.crypto.Util.CRYPTOJSMESSAGEDIGESTNAME[i];this.mac=g.algo.HMAC.create(n,this.pass)}catch(t){throw"setAlgAndProvider hash alg set fail hashAlg="+i+"/"+t}this.updateString=function(t){this.mac.update(t)},this.updateHex=function(t){var e=g.enc.Hex.parse(t);this.mac.update(e)},this.doFinal=function(){return this.mac.finalize().toString(g.enc.Hex)},this.doFinalString=function(t){return this.updateString(t),this.doFinal()},this.doFinalHex=function(t){return this.updateHex(t),this.doFinal()}}},this.updateString=function(t){throw"updateString(str) not supported for this alg/prov: "+this.algProv},this.updateHex=function(t){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(t){throw"digestString(str) not supported for this alg/prov: "+this.algProv},this.doFinalHex=function(t){throw"digestHex(hex) not supported for this alg/prov: "+this.algProv},this.setPassword=function(t){if("string"==typeof t){var e=t;return t.length%2!=1&&t.match(/^[0-9A-Fa-f]+$/)||(e=dt(t)),void(this.pass=g.enc.Hex.parse(e))}if("object"!=typeof t)throw"KJUR.crypto.Mac unsupported password type: "+t;if(e=null,void 0!==t.hex){if(t.hex.length%2!=0||!t.hex.match(/^[0-9A-Fa-f]+$/))throw"Mac: wrong hex password: "+t.hex;e=t.hex}if(void 0!==t.utf8&&(e=ht(t.utf8)),void 0!==t.rstr&&(e=dt(t.rstr)),void 0!==t.b64&&(e=j(t.b64)),void 0!==t.b64u&&(e=ut(t.b64u)),null==e)throw"KJUR.crypto.Mac unsupported password type: "+t;this.pass=g.enc.Hex.parse(e)},void 0!==t&&(void 0!==t.pass&&this.setPassword(t.pass),void 0!==t.alg&&(this.algName=t.alg,void 0===t.prov&&(this.provName=A.crypto.Util.DEFAULTPROVIDER[this.algName]),this.setAlgAndProvider(this.algName,this.provName)))},A.crypto.Signature=function(t){var e=null;if(this._setAlgNames=function(){var t=this.algName.match(/^(.+)with(.+)$/);t&&(this.mdAlgName=t[1].toLowerCase(),this.pubkeyAlgName=t[2].toLowerCase(),"rsaandmgf1"==this.pubkeyAlgName&&"sha"==this.mdAlgName&&(this.mdAlgName="sha1"))},this._zeroPaddingOfSignature=function(t,e){for(var i="",n=e/4-t.length,r=0;r<n;r++)i+="0";return i+t},this.setAlgAndProvider=function(t,e){if(this._setAlgNames(),"cryptojs/jsrsa"!=e)throw new Error("provider not supported: "+e);if(-1!=":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(this.mdAlgName)){try{this.md=new A.crypto.MessageDigest({alg:this.mdAlgName})}catch(t){throw new Error("setAlgAndProvider hash alg set fail alg="+this.mdAlgName+"/"+t)}this.init=function(t,e){var i=null;try{i=void 0===e?xt.getKey(t):xt.getKey(t,e)}catch(t){throw"init failed:"+t}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(t){this.md.updateString(t)},this.updateHex=function(t){this.md.updateHex(t)},this.sign=function(){if(this.sHashHex=this.md.digest(),void 0===this.prvKey&&void 0!==this.ecprvhex&&void 0!==this.eccurvename&&void 0!==A.crypto.ECDSA&&(this.prvKey=new A.crypto.ECDSA({curve:this.eccurvename,prv:this.ecprvhex})),this.prvKey instanceof et&&"rsaandmgf1"===this.pubkeyAlgName)this.hSign=this.prvKey.signWithMessageHashPSS(this.sHashHex,this.mdAlgName,this.pssSaltLen);else if(this.prvKey instanceof et&&"rsa"===this.pubkeyAlgName)this.hSign=this.prvKey.signWithMessageHash(this.sHashHex,this.mdAlgName);else if(this.prvKey instanceof A.crypto.ECDSA)this.hSign=this.prvKey.signWithMessageHash(this.sHashHex);else{if(!(this.prvKey instanceof A.crypto.DSA))throw"Signature: unsupported private key alg: "+this.pubkeyAlgName;this.hSign=this.prvKey.signWithMessageHash(this.sHashHex)}return this.hSign},this.signString=function(t){return this.updateString(t),this.sign()},this.signHex=function(t){return this.updateHex(t),this.sign()},this.verify=function(t){if(this.sHashHex=this.md.digest(),void 0===this.pubKey&&void 0!==this.ecpubhex&&void 0!==this.eccurvename&&void 0!==A.crypto.ECDSA&&(this.pubKey=new A.crypto.ECDSA({curve:this.eccurvename,pub:this.ecpubhex})),this.pubKey instanceof et&&"rsaandmgf1"===this.pubkeyAlgName)return this.pubKey.verifyWithMessageHashPSS(this.sHashHex,t,this.mdAlgName,this.pssSaltLen);if(this.pubKey instanceof et&&"rsa"===this.pubkeyAlgName)return this.pubKey.verifyWithMessageHash(this.sHashHex,t);if(void 0!==A.crypto.ECDSA&&this.pubKey instanceof A.crypto.ECDSA)return this.pubKey.verifyWithMessageHash(this.sHashHex,t);if(void 0!==A.crypto.DSA&&this.pubKey instanceof A.crypto.DSA)return this.pubKey.verifyWithMessageHash(this.sHashHex,t);throw"Signature: unsupported public key alg: "+this.pubkeyAlgName}}},this.init=function(t,e){throw"init(key, pass) not supported for this alg:prov="+this.algProvName},this.updateString=function(t){throw"updateString(str) not supported for this alg:prov="+this.algProvName},this.updateHex=function(t){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(t){throw"digestString(str) not supported for this alg:prov="+this.algProvName},this.signHex=function(t){throw"digestHex(hex) not supported for this alg:prov="+this.algProvName},this.verify=function(t){throw"verify(hSigVal) not supported for this alg:prov="+this.algProvName},this.initParams=t,void 0!==t&&(void 0!==t.alg&&(this.algName=t.alg,void 0===t.prov?this.provName=A.crypto.Util.DEFAULTPROVIDER[this.algName]:this.provName=t.prov,this.algProvName=this.algName+":"+this.provName,this.setAlgAndProvider(this.algName,this.provName),this._setAlgNames()),void 0!==t.psssaltlen&&(this.pssSaltLen=t.psssaltlen),void 0!==t.prvkeypem)){if(void 0!==t.prvkeypas)throw"both prvkeypem and prvkeypas parameters not supported";try{e=xt.getKey(t.prvkeypem),this.init(e)}catch(t){throw"fatal error to load pem private key: "+t}}},A.crypto.Cipher=function(t){},A.crypto.Cipher.encrypt=function(t,e,i){if(e instanceof et&&e.isPublic){var n=A.crypto.Cipher.getAlgByKeyAndName(e,i);if("RSA"===n)return e.encrypt(t);if("RSAOAEP"===n)return e.encryptOAEP(t,"sha1");var r=n.match(/^RSAOAEP(\d+)$/);if(null!==r)return e.encryptOAEP(t,"sha"+r[1]);throw"Cipher.encrypt: unsupported algorithm for RSAKey: "+i}throw"Cipher.encrypt: unsupported key or algorithm"},A.crypto.Cipher.decrypt=function(t,e,i){if(e instanceof et&&e.isPrivate){var n=A.crypto.Cipher.getAlgByKeyAndName(e,i);if("RSA"===n)return e.decrypt(t);if("RSAOAEP"===n)return e.decryptOAEP(t,"sha1");var r=n.match(/^RSAOAEP(\d+)$/);if(null!==r)return e.decryptOAEP(t,"sha"+r[1]);throw"Cipher.decrypt: unsupported algorithm for RSAKey: "+i}throw"Cipher.decrypt: unsupported key or algorithm"},A.crypto.Cipher.getAlgByKeyAndName=function(t,e){if(t instanceof et){if(-1!=":RSA:RSAOAEP:RSAOAEP224:RSAOAEP256:RSAOAEP384:RSAOAEP512:".indexOf(e))return e;if(null==e)return"RSA";throw"getAlgByKeyAndName: not supported algorithm name for RSAKey: "+e}throw"getAlgByKeyAndName: not supported algorithm name: "+e},A.crypto.OID=new function(){this.oidhex2name={"2a864886f70d010101":"rsaEncryption","2a8648ce3d0201":"ecPublicKey","2a8648ce380401":"dsa","2a8648ce3d030107":"secp256r1","2b8104001f":"secp192k1","2b81040021":"secp224r1","2b8104000a":"secp256k1","2b81040023":"secp521r1","2b81040022":"secp384r1","2a8648ce380403":"SHA1withDSA","608648016503040301":"SHA224withDSA","608648016503040302":"SHA256withDSA"}};var xt=function(){var t=function(t,i,n){return e(g.AES,t,i,n)},e=function(t,e,i,n){var r=g.enc.Hex.parse(e),o=g.enc.Hex.parse(i),s=g.enc.Hex.parse(n),a={};a.key=o,a.iv=s,a.ciphertext=r;var u=t.decrypt(a,o,{iv:s});return g.enc.Hex.stringify(u)},i=function(t,e,i){return n(g.AES,t,e,i)},n=function(t,e,i,n){var r=g.enc.Hex.parse(e),o=g.enc.Hex.parse(i),s=g.enc.Hex.parse(n),a=t.encrypt(r,o,{iv:s}),u=g.enc.Hex.parse(a.toString());return g.enc.Base64.stringify(u)},r={"AES-256-CBC":{proc:t,eproc:i,keylen:32,ivlen:16},"AES-192-CBC":{proc:t,eproc:i,keylen:24,ivlen:16},"AES-128-CBC":{proc:t,eproc:i,keylen:16,ivlen:16},"DES-EDE3-CBC":{proc:function(t,i,n){return e(g.TripleDES,t,i,n)},eproc:function(t,e,i){return n(g.TripleDES,t,e,i)},keylen:24,ivlen:8},"DES-CBC":{proc:function(t,i,n){return e(g.DES,t,i,n)},eproc:function(t,e,i){return n(g.DES,t,e,i)},keylen:8,ivlen:8}},o=function(t){var e={},i=t.match(new RegExp("DEK-Info: ([^,]+),([0-9A-Fa-f]+)","m"));i&&(e.cipher=i[1],e.ivsalt=i[2]);var n=t.match(new RegExp("-----BEGIN ([A-Z]+) PRIVATE KEY-----"));n&&(e.type=n[1]);var r=-1,o=0;-1!=t.indexOf("\r\n\r\n")&&(r=t.indexOf("\r\n\r\n"),o=2),-1!=t.indexOf("\n\n")&&(r=t.indexOf("\n\n"),o=1);var s=t.indexOf("-----END");if(-1!=r&&-1!=s){var a=t.substring(r+2*o,s-o);a=a.replace(/\s+/g,""),e.data=a}return e},s=function(t,e,i){for(var n=i.substring(0,16),o=g.enc.Hex.parse(n),s=g.enc.Utf8.parse(e),a=r[t].keylen+r[t].ivlen,u="",h=null;;){var l=g.algo.MD5.create();if(null!=h&&l.update(h),l.update(s),l.update(o),h=l.finalize(),(u+=g.enc.Hex.stringify(h)).length>=2*a)break}var c={};return c.keyhex=u.substr(0,2*r[t].keylen),c.ivhex=u.substr(2*r[t].keylen,2*r[t].ivlen),c},a=function(t,e,i,n){var o=g.enc.Base64.parse(t),s=g.enc.Hex.stringify(o);return(0,r[e].proc)(s,i,n)};return{version:"1.0.0",parsePKCS5PEM:function(t){return o(t)},getKeyAndUnusedIvByPasscodeAndIvsalt:function(t,e,i){return s(t,e,i)},decryptKeyB64:function(t,e,i,n){return a(t,e,i,n)},getDecryptedKeyHex:function(t,e){var i=o(t),n=(i.type,i.cipher),r=i.ivsalt,u=i.data,h=s(n,e,r).keyhex;return a(u,n,h,r)},getEncryptedPKCS5PEMFromPrvKeyHex:function(t,e,i,n,o){var a="";if(void 0!==n&&null!=n||(n="AES-256-CBC"),void 0===r[n])throw"KEYUTIL unsupported algorithm: "+n;void 0!==o&&null!=o||(o=function(t){var e=g.lib.WordArray.random(t);return g.enc.Hex.stringify(e)}(r[n].ivlen).toUpperCase());var u=function(t,e,i,n){return(0,r[e].eproc)(t,i,n)}(e,n,s(n,i,o).keyhex,o);return a="-----BEGIN "+t+" PRIVATE KEY-----\r\n",a+="Proc-Type: 4,ENCRYPTED\r\n",a+="DEK-Info: "+n+","+o+"\r\n",a+="\r\n",(a+=u.replace(/(.{64})/g,"$1\r\n"))+"\r\n-----END "+t+" PRIVATE KEY-----\r\n"},parseHexOfEncryptedPKCS8:function(t){var e=It,i=e.getChildIdx,n=e.getV,r={},o=i(t,0);if(2!=o.length)throw"malformed format: SEQUENCE(0).items != 2: "+o.length;r.ciphertext=n(t,o[1]);var s=i(t,o[0]);if(2!=s.length)throw"malformed format: SEQUENCE(0.0).items != 2: "+s.length;if("2a864886f70d01050d"!=n(t,s[0]))throw"this only supports pkcs5PBES2";var a=i(t,s[1]);if(2!=s.length)throw"malformed format: SEQUENCE(0.0.1).items != 2: "+a.length;var u=i(t,a[1]);if(2!=u.length)throw"malformed format: SEQUENCE(0.0.1.1).items != 2: "+u.length;if("2a864886f70d0307"!=n(t,u[0]))throw"this only supports TripleDES";r.encryptionSchemeAlg="TripleDES",r.encryptionSchemeIV=n(t,u[1]);var h=i(t,a[0]);if(2!=h.length)throw"malformed format: SEQUENCE(0.0.1.0).items != 2: "+h.length;if("2a864886f70d01050c"!=n(t,h[0]))throw"this only supports pkcs5PBKDF2";var l=i(t,h[1]);if(l.length<2)throw"malformed format: SEQUENCE(0.0.1.0.1).items < 2: "+l.length;r.pbkdf2Salt=n(t,l[0]);var c=n(t,l[1]);try{r.pbkdf2Iter=parseInt(c,16)}catch(t){throw"malformed format pbkdf2Iter: "+c}return r},getPBKDF2KeyHexFromParam:function(t,e){var i=g.enc.Hex.parse(t.pbkdf2Salt),n=t.pbkdf2Iter,r=g.PBKDF2(e,i,{keySize:6,iterations:n});return g.enc.Hex.stringify(r)},_getPlainPKCS8HexFromEncryptedPKCS8PEM:function(t,e){var i=At(t,"ENCRYPTED PRIVATE KEY"),n=this.parseHexOfEncryptedPKCS8(i),r=xt.getPBKDF2KeyHexFromParam(n,e),o={};o.ciphertext=g.enc.Hex.parse(n.ciphertext);var s=g.enc.Hex.parse(r),a=g.enc.Hex.parse(n.encryptionSchemeIV),u=g.TripleDES.decrypt(o,s,{iv:a});return g.enc.Hex.stringify(u)},getKeyFromEncryptedPKCS8PEM:function(t,e){var i=this._getPlainPKCS8HexFromEncryptedPKCS8PEM(t,e);return this.getKeyFromPlainPrivatePKCS8Hex(i)},parsePlainPrivatePKCS8Hex:function(t){var e=It,i=e.getChildIdx,n=e.getV,r={algparam:null};if("30"!=t.substr(0,2))throw new Error("malformed plain PKCS8 private key(code:001)");var o=i(t,0);if(o.length<3)throw new Error("malformed plain PKCS8 private key(code:002)");if("30"!=t.substr(o[1],2))throw new Error("malformed PKCS8 private key(code:003)");var s=i(t,o[1]);if(2!=s.length)throw new Error("malformed PKCS8 private key(code:004)");if("06"!=t.substr(s[0],2))throw new Error("malformed PKCS8 private key(code:005)");if(r.algoid=n(t,s[0]),"06"==t.substr(s[1],2)&&(r.algparam=n(t,s[1])),"04"!=t.substr(o[2],2))throw new Error("malformed PKCS8 private key(code:006)");return r.keyidx=e.getVidx(t,o[2]),r},getKeyFromPlainPrivatePKCS8PEM:function(t){var e=At(t,"PRIVATE KEY");return this.getKeyFromPlainPrivatePKCS8Hex(e)},getKeyFromPlainPrivatePKCS8Hex:function(t){var e,i=this.parsePlainPrivatePKCS8Hex(t);if("2a864886f70d010101"==i.algoid)e=new et;else if("2a8648ce380401"==i.algoid)e=new A.crypto.DSA;else{if("2a8648ce3d0201"!=i.algoid)throw"unsupported private key algorithm";e=new A.crypto.ECDSA}return e.readPKCS8PrvKeyHex(t),e},_getKeyFromPublicPKCS8Hex:function(t){var e,i=It.getVbyList(t,0,[0,0],"06");if("2a864886f70d010101"===i)e=new et;else if("2a8648ce380401"===i)e=new A.crypto.DSA;else{if("2a8648ce3d0201"!==i)throw"unsupported PKCS#8 public key hex";e=new A.crypto.ECDSA}return e.readPKCS8PubKeyHex(t),e},parsePublicRawRSAKeyHex:function(t){var e=It,i=e.getChildIdx,n=e.getV,r={};if("30"!=t.substr(0,2))throw"malformed RSA key(code:001)";var o=i(t,0);if(2!=o.length)throw"malformed RSA key(code:002)";if("02"!=t.substr(o[0],2))throw"malformed RSA key(code:003)";if(r.n=n(t,o[0]),"02"!=t.substr(o[1],2))throw"malformed RSA key(code:004)";return r.e=n(t,o[1]),r},parsePublicPKCS8Hex:function(t){var e=It,i=e.getChildIdx,n=e.getV,r={algparam:null},o=i(t,0);if(2!=o.length)throw"outer DERSequence shall have 2 elements: "+o.length;var s=o[0];if("30"!=t.substr(s,2))throw"malformed PKCS8 public key(code:001)";var a=i(t,s);if(2!=a.length)throw"malformed PKCS8 public key(code:002)";if("06"!=t.substr(a[0],2))throw"malformed PKCS8 public key(code:003)";if(r.algoid=n(t,a[0]),"06"==t.substr(a[1],2)?r.algparam=n(t,a[1]):"30"==t.substr(a[1],2)&&(r.algparam={},r.algparam.p=e.getVbyList(t,a[1],[0],"02"),r.algparam.q=e.getVbyList(t,a[1],[1],"02"),r.algparam.g=e.getVbyList(t,a[1],[2],"02")),"03"!=t.substr(o[1],2))throw"malformed PKCS8 public key(code:004)";return r.key=n(t,o[1]).substr(2),r}}}();xt.getKey=function(t,e,i){var n,r=(y=It).getChildIdx,o=(y.getV,y.getVbyList),s=A.crypto,a=s.ECDSA,u=s.DSA,h=et,l=At,c=xt;if(void 0!==h&&t instanceof h)return t;if(void 0!==a&&t instanceof a)return t;if(void 0!==u&&t instanceof u)return t;if(void 0!==t.curve&&void 0!==t.xy&&void 0===t.d)return new a({pub:t.xy,curve:t.curve});if(void 0!==t.curve&&void 0!==t.d)return new a({prv:t.d,curve:t.curve});if(void 0===t.kty&&void 0!==t.n&&void 0!==t.e&&void 0===t.d)return(T=new h).setPublic(t.n,t.e),T;if(void 0===t.kty&&void 0!==t.n&&void 0!==t.e&&void 0!==t.d&&void 0!==t.p&&void 0!==t.q&&void 0!==t.dp&&void 0!==t.dq&&void 0!==t.co&&void 0===t.qi)return(T=new h).setPrivateEx(t.n,t.e,t.d,t.p,t.q,t.dp,t.dq,t.co),T;if(void 0===t.kty&&void 0!==t.n&&void 0!==t.e&&void 0!==t.d&&void 0===t.p)return(T=new h).setPrivate(t.n,t.e,t.d),T;if(void 0!==t.p&&void 0!==t.q&&void 0!==t.g&&void 0!==t.y&&void 0===t.x)return(T=new u).setPublic(t.p,t.q,t.g,t.y),T;if(void 0!==t.p&&void 0!==t.q&&void 0!==t.g&&void 0!==t.y&&void 0!==t.x)return(T=new u).setPrivate(t.p,t.q,t.g,t.y,t.x),T;if("RSA"===t.kty&&void 0!==t.n&&void 0!==t.e&&void 0===t.d)return(T=new h).setPublic(ut(t.n),ut(t.e)),T;if("RSA"===t.kty&&void 0!==t.n&&void 0!==t.e&&void 0!==t.d&&void 0!==t.p&&void 0!==t.q&&void 0!==t.dp&&void 0!==t.dq&&void 0!==t.qi)return(T=new h).setPrivateEx(ut(t.n),ut(t.e),ut(t.d),ut(t.p),ut(t.q),ut(t.dp),ut(t.dq),ut(t.qi)),T;if("RSA"===t.kty&&void 0!==t.n&&void 0!==t.e&&void 0!==t.d)return(T=new h).setPrivate(ut(t.n),ut(t.e),ut(t.d)),T;if("EC"===t.kty&&void 0!==t.crv&&void 0!==t.x&&void 0!==t.y&&void 0===t.d){var d=(P=new a({curve:t.crv})).ecparams.keylen/4,p="04"+("0000000000"+ut(t.x)).slice(-d)+("0000000000"+ut(t.y)).slice(-d);return P.setPublicKeyHex(p),P}if("EC"===t.kty&&void 0!==t.crv&&void 0!==t.x&&void 0!==t.y&&void 0!==t.d){d=(P=new a({curve:t.crv})).ecparams.keylen/4,p="04"+("0000000000"+ut(t.x)).slice(-d)+("0000000000"+ut(t.y)).slice(-d);var f=("0000000000"+ut(t.d)).slice(-d);return P.setPublicKeyHex(p),P.setPrivateKeyHex(f),P}if("pkcs5prv"===i){var g,m=t,y=It;if(9===(g=r(m,0)).length)(T=new h).readPKCS5PrvKeyHex(m);else if(6===g.length)(T=new u).readPKCS5PrvKeyHex(m);else{if(!(g.length>2&&"04"===m.substr(g[1],2)))throw"unsupported PKCS#1/5 hexadecimal key";(T=new a).readPKCS5PrvKeyHex(m)}return T}if("pkcs8prv"===i)return c.getKeyFromPlainPrivatePKCS8Hex(t);if("pkcs8pub"===i)return c._getKeyFromPublicPKCS8Hex(t);if("x509pub"===i)return Mt.getPublicKeyFromCertHex(t);if(-1!=t.indexOf("-END CERTIFICATE-",0)||-1!=t.indexOf("-END X509 CERTIFICATE-",0)||-1!=t.indexOf("-END TRUSTED CERTIFICATE-",0))return Mt.getPublicKeyFromCertPEM(t);if(-1!=t.indexOf("-END PUBLIC KEY-")){var b=At(t,"PUBLIC KEY");return c._getKeyFromPublicPKCS8Hex(b)}if(-1!=t.indexOf("-END RSA PRIVATE KEY-")&&-1==t.indexOf("4,ENCRYPTED")){var w=l(t,"RSA PRIVATE KEY");return c.getKey(w,null,"pkcs5prv")}if(-1!=t.indexOf("-END DSA PRIVATE KEY-")&&-1==t.indexOf("4,ENCRYPTED")){var E=o(n=l(t,"DSA PRIVATE KEY"),0,[1],"02"),x=o(n,0,[2],"02"),I=o(n,0,[3],"02"),C=o(n,0,[4],"02"),S=o(n,0,[5],"02");return(T=new u).setPrivate(new v(E,16),new v(x,16),new v(I,16),new v(C,16),new v(S,16)),T}if(-1!=t.indexOf("-END EC PRIVATE KEY-")&&-1==t.indexOf("4,ENCRYPTED"))return w=l(t,"EC PRIVATE KEY"),c.getKey(w,null,"pkcs5prv");if(-1!=t.indexOf("-END PRIVATE KEY-"))return c.getKeyFromPlainPrivatePKCS8PEM(t);if(-1!=t.indexOf("-END RSA PRIVATE KEY-")&&-1!=t.indexOf("4,ENCRYPTED")){var B=c.getDecryptedKeyHex(t,e),M=new et;return M.readPKCS5PrvKeyHex(B),M}if(-1!=t.indexOf("-END EC PRIVATE KEY-")&&-1!=t.indexOf("4,ENCRYPTED")){var P,T=o(n=c.getDecryptedKeyHex(t,e),0,[1],"04"),R=o(n,0,[2,0],"06"),k=o(n,0,[3,0],"03").substr(2);if(void 0===A.crypto.OID.oidhex2name[R])throw"undefined OID(hex) in KJUR.crypto.OID: "+R;return(P=new a({curve:A.crypto.OID.oidhex2name[R]})).setPublicKeyHex(k),P.setPrivateKeyHex(T),P.isPublic=!1,P}if(-1!=t.indexOf("-END DSA PRIVATE KEY-")&&-1!=t.indexOf("4,ENCRYPTED"))return E=o(n=c.getDecryptedKeyHex(t,e),0,[1],"02"),x=o(n,0,[2],"02"),I=o(n,0,[3],"02"),C=o(n,0,[4],"02"),S=o(n,0,[5],"02"),(T=new u).setPrivate(new v(E,16),new v(x,16),new v(I,16),new v(C,16),new v(S,16)),T;if(-1!=t.indexOf("-END ENCRYPTED PRIVATE KEY-"))return c.getKeyFromEncryptedPKCS8PEM(t,e);throw new Error("not supported argument")},xt.generateKeypair=function(t,e){if("RSA"==t){var i=e;(s=new et).generate(i,"10001"),s.isPrivate=!0,s.isPublic=!0;var n=new et,r=s.n.toString(16),o=s.e.toString(16);return n.setPublic(r,o),n.isPrivate=!1,n.isPublic=!0,(a={}).prvKeyObj=s,a.pubKeyObj=n,a}if("EC"==t){var s,a,u=e,h=new A.crypto.ECDSA({curve:u}).generateKeyPairHex();return(s=new A.crypto.ECDSA({curve:u})).setPublicKeyHex(h.ecpubhex),s.setPrivateKeyHex(h.ecprvhex),s.isPrivate=!0,s.isPublic=!1,(n=new A.crypto.ECDSA({curve:u})).setPublicKeyHex(h.ecpubhex),n.isPrivate=!1,n.isPublic=!0,(a={}).prvKeyObj=s,a.pubKeyObj=n,a}throw"unknown algorithm: "+t},xt.getPEM=function(t,e,i,n,r,o){var s=A,a=s.asn1,u=a.DERObjectIdentifier,h=a.DERInteger,l=a.ASN1Util.newObject,c=a.x509.SubjectPublicKeyInfo,d=s.crypto,p=d.DSA,f=d.ECDSA,v=et;function m(t){return l({seq:[{int:0},{int:{bigint:t.n}},{int:t.e},{int:{bigint:t.d}},{int:{bigint:t.p}},{int:{bigint:t.q}},{int:{bigint:t.dmp1}},{int:{bigint:t.dmq1}},{int:{bigint:t.coeff}}]})}function y(t){return l({seq:[{int:1},{octstr:{hex:t.prvKeyHex}},{tag:["a0",!0,{oid:{name:t.curveName}}]},{tag:["a1",!0,{bitstr:{hex:"00"+t.pubKeyHex}}]}]})}function b(t){return l({seq:[{int:0},{int:{bigint:t.p}},{int:{bigint:t.q}},{int:{bigint:t.g}},{int:{bigint:t.y}},{int:{bigint:t.x}}]})}if((void 0!==v&&t instanceof v||void 0!==p&&t instanceof p||void 0!==f&&t instanceof f)&&1==t.isPublic&&(void 0===e||"PKCS8PUB"==e))return pt(I=new c(t).getEncodedHex(),"PUBLIC KEY");if("PKCS1PRV"==e&&void 0!==v&&t instanceof v&&(void 0===i||null==i)&&1==t.isPrivate)return pt(I=m(t).getEncodedHex(),"RSA PRIVATE KEY");if("PKCS1PRV"==e&&void 0!==f&&t instanceof f&&(void 0===i||null==i)&&1==t.isPrivate){var w=new u({name:t.curveName}).getEncodedHex(),E=y(t).getEncodedHex(),x="";return(x+=pt(w,"EC PARAMETERS"))+pt(E,"EC PRIVATE KEY")}if("PKCS1PRV"==e&&void 0!==p&&t instanceof p&&(void 0===i||null==i)&&1==t.isPrivate)return pt(I=b(t).getEncodedHex(),"DSA PRIVATE KEY");if("PKCS5PRV"==e&&void 0!==v&&t instanceof v&&void 0!==i&&null!=i&&1==t.isPrivate){var I=m(t).getEncodedHex();return void 0===n&&(n="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("RSA",I,i,n,o)}if("PKCS5PRV"==e&&void 0!==f&&t instanceof f&&void 0!==i&&null!=i&&1==t.isPrivate)return I=y(t).getEncodedHex(),void 0===n&&(n="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("EC",I,i,n,o);if("PKCS5PRV"==e&&void 0!==p&&t instanceof p&&void 0!==i&&null!=i&&1==t.isPrivate)return I=b(t).getEncodedHex(),void 0===n&&(n="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("DSA",I,i,n,o);var C=function(t,e){var i=S(t,e);return new l({seq:[{seq:[{oid:{name:"pkcs5PBES2"}},{seq:[{seq:[{oid:{name:"pkcs5PBKDF2"}},{seq:[{octstr:{hex:i.pbkdf2Salt}},{int:i.pbkdf2Iter}]}]},{seq:[{oid:{name:"des-EDE3-CBC"}},{octstr:{hex:i.encryptionSchemeIV}}]}]}]},{octstr:{hex:i.ciphertext}}]}).getEncodedHex()},S=function(t,e){var i=g.lib.WordArray.random(8),n=g.lib.WordArray.random(8),r=g.PBKDF2(e,i,{keySize:6,iterations:100}),o=g.enc.Hex.parse(t),s=g.TripleDES.encrypt(o,r,{iv:n})+"",a={};return a.ciphertext=s,a.pbkdf2Salt=g.enc.Hex.stringify(i),a.pbkdf2Iter=100,a.encryptionSchemeAlg="DES-EDE3-CBC",a.encryptionSchemeIV=g.enc.Hex.stringify(n),a};if("PKCS8PRV"==e&&null!=v&&t instanceof v&&1==t.isPrivate){var B=m(t).getEncodedHex();return I=l({seq:[{int:0},{seq:[{oid:{name:"rsaEncryption"}},{null:!0}]},{octstr:{hex:B}}]}).getEncodedHex(),void 0===i||null==i?pt(I,"PRIVATE KEY"):pt(E=C(I,i),"ENCRYPTED PRIVATE KEY")}if("PKCS8PRV"==e&&void 0!==f&&t instanceof f&&1==t.isPrivate)return B=new l({seq:[{int:1},{octstr:{hex:t.prvKeyHex}},{tag:["a1",!0,{bitstr:{hex:"00"+t.pubKeyHex}}]}]}).getEncodedHex(),I=l({seq:[{int:0},{seq:[{oid:{name:"ecPublicKey"}},{oid:{name:t.curveName}}]},{octstr:{hex:B}}]}).getEncodedHex(),void 0===i||null==i?pt(I,"PRIVATE KEY"):pt(E=C(I,i),"ENCRYPTED PRIVATE KEY");if("PKCS8PRV"==e&&void 0!==p&&t instanceof p&&1==t.isPrivate)return B=new h({bigint:t.x}).getEncodedHex(),I=l({seq:[{int:0},{seq:[{oid:{name:"dsa"}},{seq:[{int:{bigint:t.p}},{int:{bigint:t.q}},{int:{bigint:t.g}}]}]},{octstr:{hex:B}}]}).getEncodedHex(),void 0===i||null==i?pt(I,"PRIVATE KEY"):pt(E=C(I,i),"ENCRYPTED PRIVATE KEY");throw new Error("unsupported object nor format")},xt.getKeyFromCSRPEM=function(t){var e=At(t,"CERTIFICATE REQUEST");return xt.getKeyFromCSRHex(e)},xt.getKeyFromCSRHex=function(t){var e=xt.parseCSRHex(t);return xt.getKey(e.p8pubkeyhex,null,"pkcs8pub")},xt.parseCSRHex=function(t){var e=It,i=e.getChildIdx,n=e.getTLV,r={},o=t;if("30"!=o.substr(0,2))throw"malformed CSR(code:001)";var s=i(o,0);if(s.length<1)throw"malformed CSR(code:002)";if("30"!=o.substr(s[0],2))throw"malformed CSR(code:003)";var a=i(o,s[0]);if(a.length<3)throw"malformed CSR(code:004)";return r.p8pubkeyhex=n(o,a[2]),r},xt.getKeyID=function(t){var e=xt,i=It;"string"==typeof t&&-1!=t.indexOf("BEGIN ")&&(t=e.getKey(t));var n=At(e.getPEM(t)),r=i.getIdxbyList(n,0,[1]),o=i.getV(n,r).substring(2);return A.crypto.Util.hashHex(o,"sha1")},xt.getJWKFromKey=function(t){var e={};if(t instanceof et&&t.isPrivate)return e.kty="RSA",e.n=at(t.n.toString(16)),e.e=at(t.e.toString(16)),e.d=at(t.d.toString(16)),e.p=at(t.p.toString(16)),e.q=at(t.q.toString(16)),e.dp=at(t.dmp1.toString(16)),e.dq=at(t.dmq1.toString(16)),e.qi=at(t.coeff.toString(16)),e;if(t instanceof et&&t.isPublic)return e.kty="RSA",e.n=at(t.n.toString(16)),e.e=at(t.e.toString(16)),e;if(t instanceof A.crypto.ECDSA&&t.isPrivate){if("P-256"!==(n=t.getShortNISTPCurveName())&&"P-384"!==n)throw"unsupported curve name for JWT: "+n;var i=t.getPublicKeyXYHex();return e.kty="EC",e.crv=n,e.x=at(i.x),e.y=at(i.y),e.d=at(t.prvKeyHex),e}if(t instanceof A.crypto.ECDSA&&t.isPublic){var n;if("P-256"!==(n=t.getShortNISTPCurveName())&&"P-384"!==n)throw"unsupported curve name for JWT: "+n;return i=t.getPublicKeyXYHex(),e.kty="EC",e.crv=n,e.x=at(i.x),e.y=at(i.y),e}throw"not supported key object"},void 0!==A.asn1&&A.asn1||(A.asn1={}),A.asn1.ASN1Util=new function(){this.integerToByteHex=function(t){var e=t.toString(16);return e.length%2==1&&(e="0"+e),e},this.bigIntToMinTwosComplementsHex=function(t){var e=t.toString(16);if("-"!=e.substr(0,1))e.length%2==1?e="0"+e:e.match(/^[0-7]/)||(e="00"+e);else{var i=e.substr(1).length;i%2==1?i+=1:e.match(/^[0-7]/)||(i+=2);for(var n="",r=0;r<i;r++)n+="f";e=new v(n,16).xor(t).add(v.ONE).toString(16).replace(/^-/,"")}return e},this.getPEMStringFromHex=function(t,e){return pt(t,e)},this.newObject=function(t){var e=A.asn1,i=e.ASN1Object,n=e.DERBoolean,r=e.DERInteger,o=e.DERBitString,s=e.DEROctetString,a=e.DERNull,u=e.DERObjectIdentifier,h=e.DEREnumerated,l=e.DERUTF8String,c=e.DERNumericString,d=e.DERPrintableString,p=e.DERTeletexString,f=e.DERIA5String,g=e.DERUTCTime,v=e.DERGeneralizedTime,m=e.DERVisibleString,y=e.DERBMPString,b=e.DERSequence,w=e.DERSet,E=e.DERTaggedObject,x=e.ASN1Util.newObject;if(t instanceof e.ASN1Object)return t;var I=Object.keys(t);if(1!=I.length)throw new Error("key of param shall be only one.");var C=I[0];if(-1==":asn1:bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:visstr:bmpstr:seq:set:tag:".indexOf(":"+C+":"))throw new Error("undefined key: "+C);if("bool"==C)return new n(t[C]);if("int"==C)return new r(t[C]);if("bitstr"==C)return new o(t[C]);if("octstr"==C)return new s(t[C]);if("null"==C)return new a(t[C]);if("oid"==C)return new u(t[C]);if("enum"==C)return new h(t[C]);if("utf8str"==C)return new l(t[C]);if("numstr"==C)return new c(t[C]);if("prnstr"==C)return new d(t[C]);if("telstr"==C)return new p(t[C]);if("ia5str"==C)return new f(t[C]);if("utctime"==C)return new g(t[C]);if("gentime"==C)return new v(t[C]);if("visstr"==C)return new m(t[C]);if("bmpstr"==C)return new y(t[C]);if("asn1"==C)return new i(t[C]);if("seq"==C){for(var S=t[C],B=[],M=0;M<S.length;M++){var P=x(S[M]);B.push(P)}return new b({array:B})}if("set"==C){for(S=t[C],B=[],M=0;M<S.length;M++)P=x(S[M]),B.push(P);return new w({array:B})}if("tag"==C){var T=t[C];if("[object Array]"===Object.prototype.toString.call(T)&&3==T.length){var R=x(T[2]);return new E({tag:T[0],explicit:T[1],obj:R})}return new E(T)}},this.jsonToASN1HEX=function(t){return this.newObject(t).getEncodedHex()}},A.asn1.ASN1Util.oidHexToInt=function(t){for(var e="",i=parseInt(t.substr(0,2),16),n=(e=Math.floor(i/40)+"."+i%40,""),r=2;r<t.length;r+=2){var o=("00000000"+parseInt(t.substr(r,2),16).toString(2)).slice(-8);n+=o.substr(1,7),"0"==o.substr(0,1)&&(e=e+"."+new v(n,2).toString(10),n="")}return e},A.asn1.ASN1Util.oidIntToHex=function(t){var e=function(t){var e=t.toString(16);return 1==e.length&&(e="0"+e),e},i=function(t){var i="",n=new v(t,10).toString(2),r=7-n.length%7;7==r&&(r=0);for(var o="",s=0;s<r;s++)o+="0";for(n=o+n,s=0;s<n.length-1;s+=7){var a=n.substr(s,7);s!=n.length-7&&(a="1"+a),i+=e(parseInt(a,2))}return i};if(!t.match(/^[0-9.]+$/))throw"malformed oid string: "+t;var n="",r=t.split("."),o=40*parseInt(r[0])+parseInt(r[1]);n+=e(o),r.splice(0,2);for(var s=0;s<r.length;s++)n+=i(r[s]);return n},A.asn1.ASN1Object=function(t){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 t=this.hV.length/2,e=t.toString(16);if(e.length%2==1&&(e="0"+e),t<128)return e;var i=e.length/2;if(i>15)throw"ASN.1 length too long to represent by 8x: n = "+t.toString(16);return(128+i).toString(16)+e},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(t){this.params=t},null!=t&&null!=t.tlv&&(this.hTLV=t.tlv,this.isModified=!1)},A.asn1.DERAbstractString=function(t){A.asn1.DERAbstractString.superclass.constructor.call(this),this.getString=function(){return this.s},this.setString=function(t){this.hTLV=null,this.isModified=!0,this.s=t,this.hV=ht(this.s).toLowerCase()},this.setStringHex=function(t){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=t},this.getFreshValueHex=function(){return this.hV},void 0!==t&&("string"==typeof t?this.setString(t):void 0!==t.str?this.setString(t.str):void 0!==t.hex&&this.setStringHex(t.hex))},f.lang.extend(A.asn1.DERAbstractString,A.asn1.ASN1Object),A.asn1.DERAbstractTime=function(t){A.asn1.DERAbstractTime.superclass.constructor.call(this),this.localDateToUTC=function(t){var e=t.getTime()+6e4*t.getTimezoneOffset();return new Date(e)},this.formatDate=function(t,e,i){var n=this.zeroPadding,r=this.localDateToUTC(t),o=String(r.getFullYear());"utc"==e&&(o=o.substr(2,2));var s=o+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);s=s+"."+(u=u.replace(/[0]+$/,""))}}return s+"Z"},this.zeroPadding=function(t,e){return t.length>=e?t:new Array(e-t.length+1).join("0")+t},this.getString=function(){return this.s},this.setString=function(t){this.hTLV=null,this.isModified=!0,this.s=t,this.hV=rt(t)},this.setByDateValue=function(t,e,i,n,r,o){var s=new Date(Date.UTC(t,e-1,i,n,r,o,0));this.setByDate(s)},this.getFreshValueHex=function(){return this.hV}},f.lang.extend(A.asn1.DERAbstractTime,A.asn1.ASN1Object),A.asn1.DERAbstractStructured=function(t){A.asn1.DERAbstractString.superclass.constructor.call(this),this.setByASN1ObjectArray=function(t){this.hTLV=null,this.isModified=!0,this.asn1Array=t},this.appendASN1Object=function(t){this.hTLV=null,this.isModified=!0,this.asn1Array.push(t)},this.asn1Array=new Array,void 0!==t&&void 0!==t.array&&(this.asn1Array=t.array)},f.lang.extend(A.asn1.DERAbstractStructured,A.asn1.ASN1Object),A.asn1.DERBoolean=function(t){A.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",this.hTLV=0==t?"010100":"0101ff"},f.lang.extend(A.asn1.DERBoolean,A.asn1.ASN1Object),A.asn1.DERInteger=function(t){A.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.setByBigInteger=function(t){this.hTLV=null,this.isModified=!0,this.hV=A.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t)},this.setByInteger=function(t){var e=new v(String(t),10);this.setByBigInteger(e)},this.setValueHex=function(t){this.hV=t},this.getFreshValueHex=function(){return this.hV},void 0!==t&&(void 0!==t.bigint?this.setByBigInteger(t.bigint):void 0!==t.int?this.setByInteger(t.int):"number"==typeof t?this.setByInteger(t):void 0!==t.hex&&this.setValueHex(t.hex))},f.lang.extend(A.asn1.DERInteger,A.asn1.ASN1Object),A.asn1.DERBitString=function(t){if(void 0!==t&&void 0!==t.obj){var e=A.asn1.ASN1Util.newObject(t.obj);t.hex="00"+e.getEncodedHex()}A.asn1.DERBitString.superclass.constructor.call(this),this.hT="03",this.setHexValueIncludingUnusedBits=function(t){this.hTLV=null,this.isModified=!0,this.hV=t},this.setUnusedBitsAndHexValue=function(t,e){if(t<0||7<t)throw"unused bits shall be from 0 to 7: u = "+t;var i="0"+t;this.hTLV=null,this.isModified=!0,this.hV=i+e},this.setByBinaryString=function(t){var e=8-(t=t.replace(/0+$/,"")).length%8;8==e&&(e=0);for(var i=0;i<=e;i++)t+="0";var n="";for(i=0;i<t.length-1;i+=8){var r=t.substr(i,8),o=parseInt(r,2).toString(16);1==o.length&&(o="0"+o),n+=o}this.hTLV=null,this.isModified=!0,this.hV="0"+e+n},this.setByBooleanArray=function(t){for(var e="",i=0;i<t.length;i++)1==t[i]?e+="1":e+="0";this.setByBinaryString(e)},this.newFalseArray=function(t){for(var e=new Array(t),i=0;i<t;i++)e[i]=!1;return e},this.getFreshValueHex=function(){return this.hV},void 0!==t&&("string"==typeof t&&t.toLowerCase().match(/^[0-9a-f]+$/)?this.setHexValueIncludingUnusedBits(t):void 0!==t.hex?this.setHexValueIncludingUnusedBits(t.hex):void 0!==t.bin?this.setByBinaryString(t.bin):void 0!==t.array&&this.setByBooleanArray(t.array))},f.lang.extend(A.asn1.DERBitString,A.asn1.ASN1Object),A.asn1.DEROctetString=function(t){if(void 0!==t&&void 0!==t.obj){var e=A.asn1.ASN1Util.newObject(t.obj);t.hex=e.getEncodedHex()}A.asn1.DEROctetString.superclass.constructor.call(this,t),this.hT="04"},f.lang.extend(A.asn1.DEROctetString,A.asn1.DERAbstractString),A.asn1.DERNull=function(){A.asn1.DERNull.superclass.constructor.call(this),this.hT="05",this.hTLV="0500"},f.lang.extend(A.asn1.DERNull,A.asn1.ASN1Object),A.asn1.DERObjectIdentifier=function(t){A.asn1.DERObjectIdentifier.superclass.constructor.call(this),this.hT="06",this.setValueHex=function(t){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=t},this.setValueOidString=function(t){var e=function(t){var e=function(t){var e=t.toString(16);return 1==e.length&&(e="0"+e),e},i=function(t){var i="",n=parseInt(t,10).toString(2),r=7-n.length%7;7==r&&(r=0);for(var o="",s=0;s<r;s++)o+="0";for(n=o+n,s=0;s<n.length-1;s+=7){var a=n.substr(s,7);s!=n.length-7&&(a="1"+a),i+=e(parseInt(a,2))}return i};try{if(!t.match(/^[0-9.]+$/))return null;var n="",r=t.split("."),o=40*parseInt(r[0],10)+parseInt(r[1],10);n+=e(o),r.splice(0,2);for(var s=0;s<r.length;s++)n+=i(r[s]);return n}catch(t){return null}}(t);if(null==e)throw new Error("malformed oid string: "+t);this.hTLV=null,this.isModified=!0,this.s=null,this.hV=e},this.setValueName=function(t){var e=A.asn1.x509.OID.name2oid(t);if(""===e)throw new Error("DERObjectIdentifier oidName undefined: "+t);this.setValueOidString(e)},this.setValueNameOrOid=function(t){t.match(/^[0-2].[0-9.]+$/)?this.setValueOidString(t):this.setValueName(t)},this.getFreshValueHex=function(){return this.hV},this.setByParam=function(t){"string"==typeof t?this.setValueNameOrOid(t):void 0!==t.oid?this.setValueNameOrOid(t.oid):void 0!==t.name?this.setValueNameOrOid(t.name):void 0!==t.hex&&this.setValueHex(t.hex)},void 0!==t&&this.setByParam(t)},f.lang.extend(A.asn1.DERObjectIdentifier,A.asn1.ASN1Object),A.asn1.DEREnumerated=function(t){A.asn1.DEREnumerated.superclass.constructor.call(this),this.hT="0a",this.setByBigInteger=function(t){this.hTLV=null,this.isModified=!0,this.hV=A.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t)},this.setByInteger=function(t){var e=new v(String(t),10);this.setByBigInteger(e)},this.setValueHex=function(t){this.hV=t},this.getFreshValueHex=function(){return this.hV},void 0!==t&&(void 0!==t.int?this.setByInteger(t.int):"number"==typeof t?this.setByInteger(t):void 0!==t.hex&&this.setValueHex(t.hex))},f.lang.extend(A.asn1.DEREnumerated,A.asn1.ASN1Object),A.asn1.DERUTF8String=function(t){A.asn1.DERUTF8String.superclass.constructor.call(this,t),this.hT="0c"},f.lang.extend(A.asn1.DERUTF8String,A.asn1.DERAbstractString),A.asn1.DERNumericString=function(t){A.asn1.DERNumericString.superclass.constructor.call(this,t),this.hT="12"},f.lang.extend(A.asn1.DERNumericString,A.asn1.DERAbstractString),A.asn1.DERPrintableString=function(t){A.asn1.DERPrintableString.superclass.constructor.call(this,t),this.hT="13"},f.lang.extend(A.asn1.DERPrintableString,A.asn1.DERAbstractString),A.asn1.DERTeletexString=function(t){A.asn1.DERTeletexString.superclass.constructor.call(this,t),this.hT="14"},f.lang.extend(A.asn1.DERTeletexString,A.asn1.DERAbstractString),A.asn1.DERIA5String=function(t){A.asn1.DERIA5String.superclass.constructor.call(this,t),this.hT="16"},f.lang.extend(A.asn1.DERIA5String,A.asn1.DERAbstractString),A.asn1.DERVisibleString=function(t){A.asn1.DERIA5String.superclass.constructor.call(this,t),this.hT="1a"},f.lang.extend(A.asn1.DERVisibleString,A.asn1.DERAbstractString),A.asn1.DERBMPString=function(t){A.asn1.DERBMPString.superclass.constructor.call(this,t),this.hT="1e"},f.lang.extend(A.asn1.DERBMPString,A.asn1.DERAbstractString),A.asn1.DERUTCTime=function(t){A.asn1.DERUTCTime.superclass.constructor.call(this,t),this.hT="17",this.setByDate=function(t){this.hTLV=null,this.isModified=!0,this.date=t,this.s=this.formatDate(this.date,"utc"),this.hV=rt(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=rt(this.s)),this.hV},void 0!==t&&(void 0!==t.str?this.setString(t.str):"string"==typeof t&&t.match(/^[0-9]{12}Z$/)?this.setString(t):void 0!==t.hex?this.setStringHex(t.hex):void 0!==t.date&&this.setByDate(t.date))},f.lang.extend(A.asn1.DERUTCTime,A.asn1.DERAbstractTime),A.asn1.DERGeneralizedTime=function(t){A.asn1.DERGeneralizedTime.superclass.constructor.call(this,t),this.hT="18",this.withMillis=!1,this.setByDate=function(t){this.hTLV=null,this.isModified=!0,this.date=t,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=rt(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=rt(this.s)),this.hV},void 0!==t&&(void 0!==t.str?this.setString(t.str):"string"==typeof t&&t.match(/^[0-9]{14}Z$/)?this.setString(t):void 0!==t.hex?this.setStringHex(t.hex):void 0!==t.date&&this.setByDate(t.date),!0===t.millis&&(this.withMillis=!0))},f.lang.extend(A.asn1.DERGeneralizedTime,A.asn1.DERAbstractTime),A.asn1.DERSequence=function(t){A.asn1.DERSequence.superclass.constructor.call(this,t),this.hT="30",this.getFreshValueHex=function(){for(var t="",e=0;e<this.asn1Array.length;e++)t+=this.asn1Array[e].getEncodedHex();return this.hV=t,this.hV}},f.lang.extend(A.asn1.DERSequence,A.asn1.DERAbstractStructured),A.asn1.DERSet=function(t){A.asn1.DERSet.superclass.constructor.call(this,t),this.hT="31",this.sortFlag=!0,this.getFreshValueHex=function(){for(var t=new Array,e=0;e<this.asn1Array.length;e++){var i=this.asn1Array[e];t.push(i.getEncodedHex())}return 1==this.sortFlag&&t.sort(),this.hV=t.join(""),this.hV},void 0!==t&&void 0!==t.sortflag&&0==t.sortflag&&(this.sortFlag=!1)},f.lang.extend(A.asn1.DERSet,A.asn1.DERAbstractStructured),A.asn1.DERTaggedObject=function(t){A.asn1.DERTaggedObject.superclass.constructor.call(this);var e=A.asn1;this.hT="a0",this.hV="",this.isExplicit=!0,this.asn1Object=null,this.setASN1Object=function(t,e,i){this.hT=e,this.isExplicit=t,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(/^../,e),this.isModified=!1)},this.getFreshValueHex=function(){return this.hV},this.setByParam=function(t){null!=t.tag&&(this.hT=t.tag),null!=t.explicit&&(this.isExplicit=t.explicit),null!=t.tage&&(this.hT=t.tage,this.isExplicit=!0),null!=t.tagi&&(this.hT=t.tagi,this.isExplicit=!1),null!=t.obj&&(t.obj instanceof e.ASN1Object?(this.asn1Object=t.obj,this.setASN1Object(this.isExplicit,this.hT,this.asn1Object)):"object"==typeof t.obj&&(this.asn1Object=e.ASN1Util.newObject(t.obj),this.setASN1Object(this.isExplicit,this.hT,this.asn1Object)))},null!=t&&this.setByParam(t)},f.lang.extend(A.asn1.DERTaggedObject,A.asn1.ASN1Object);var It=new function(){};function Ct(t,e){for(var i="",n=e/4-t.length,r=0;r<n;r++)i+="0";return i+t}function St(t,e,i){for(var n="",r=0;n.length<e;)n+=ct(i(dt(t+String.fromCharCode.apply(String,[(4278190080&r)>>24,(16711680&r)>>16,(65280&r)>>8,255&r])))),r+=1;return n}function Bt(t){for(var e in A.crypto.Util.DIGESTINFOHEAD){var i=A.crypto.Util.DIGESTINFOHEAD[e],n=i.length;if(t.substring(0,n)==i)return[e,t.substring(n)]}return[]}function Mt(t){var e,i=It,n=i.getChildIdx,r=i.getV,o=i.getTLV,s=i.getVbyList,a=i.getVbyListEx,u=i.getTLVbyList,h=i.getTLVbyListEx,l=i.getIdxbyList,c=i.getIdxbyListEx,d=i.getVidx,p=i.getInt,f=i.oidname,g=i.hextooidstr,v=At;try{e=A.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV}catch(t){}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 t=u(this.hex,0,[0,0]);if("a0"==t.substr(0,2)){var e=u(t,0,[0]),i=p(e,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 t=h(this.hex,0,[0,1]);return this.getAlgorithmIdentifierName(t)},this.getAlgorithmIdentifierName=function(t){for(var i in e)if(t===e[i])return i;return f(a(t,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 t=s(this.hex,0,[0,4+this.foffset,0]);return t=t.replace(/(..)/g,"%$1"),decodeURIComponent(t)},this.getNotAfter=function(){var t=s(this.hex,0,[0,4+this.foffset,1]);return t=t.replace(/(..)/g,"%$1"),decodeURIComponent(t)},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 t=this.getPublicKeyIdx();return l(this.hex,t,[1,0],"30")},this.getPublicKey=function(){return xt.getKey(this.getPublicKeyHex(),null,"pkcs8pub")},this.getSignatureAlgorithmName=function(){var t=u(this.hex,0,[1],"30");return this.getAlgorithmIdentifierName(t)},this.getSignatureValueHex=function(){return s(this.hex,0,[2],"03",!0)},this.verifySignature=function(t){var e=this.getSignatureAlgorithmField(),i=this.getSignatureValueHex(),n=u(this.hex,0,[0],"30"),r=new A.crypto.Signature({alg:e});return r.init(t),r.updateHex(n),r.verify(i)},this.parseExt=function(t){var e,o,a;if(void 0===t){if(a=this.hex,3!==this.version)return-1;e=l(a,0,[0,7,0],"30"),o=n(a,e)}else{a=At(t);var u=l(a,0,[0,3,0,0],"06");if("2a864886f70d01090e"!=r(a,u))return void(this.aExtInfo=new Array);e=l(a,0,[0,3,0,1,0],"30"),o=n(a,e),this.hex=a}this.aExtInfo=new Array;for(var h=0;h<o.length;h++){var c={critical:!1},p=0;3===n(a,o[h]).length&&(c.critical=!0,p=1),c.oid=i.hextooidstr(s(a,o[h],[0],"06"));var A=l(a,o[h],[1+p]);c.vidx=d(a,A),this.aExtInfo.push(c)}},this.getExtInfo=function(t){var e=this.aExtInfo,i=t;if(t.match(/^[0-9.]+$/)||(i=A.asn1.x509.OID.name2oid(t)),""!==i)for(var n=0;n<e.length;n++)if(e[n].oid===i)return e[n]},this.getExtBasicConstraints=function(t,e){if(void 0===t&&void 0===e){var i=this.getExtInfo("basicConstraints");if(void 0===i)return;t=o(this.hex,i.vidx),e=i.critical}var n={extname:"basicConstraints"};if(e&&(n.critical=!0),"3000"===t)return n;if("30030101ff"===t)return n.cA=!0,n;if("30060101ff02"===t.substr(0,12)){var s=r(t,10),a=parseInt(s,16);return n.cA=!0,n.pathLen=a,n}throw new Error("hExtV parse error: "+t)},this.getExtKeyUsage=function(t,e){if(void 0===t&&void 0===e){var i=this.getExtInfo("keyUsage");if(void 0===i)return;t=o(this.hex,i.vidx),e=i.critical}var n={extname:"keyUsage"};return e&&(n.critical=!0),n.names=this.getExtKeyUsageString(t).split(","),n},this.getExtKeyUsageBin=function(t){if(void 0===t){var e=this.getExtInfo("keyUsage");if(void 0===e)return"";t=o(this.hex,e.vidx)}if(8!=t.length&&10!=t.length)throw new Error("malformed key usage value: "+t);var i="000000000000000"+parseInt(t.substr(6),16).toString(2);return 8==t.length&&(i=i.slice(-8)),10==t.length&&(i=i.slice(-16)),""==(i=i.replace(/0+$/,""))&&(i="0"),i},this.getExtKeyUsageString=function(t){for(var e=this.getExtKeyUsageBin(t),i=new Array,n=0;n<e.length;n++)"1"==e.substr(n,1)&&i.push(Mt.KEYUSAGE_NAME[n]);return i.join(",")},this.getExtSubjectKeyIdentifier=function(t,e){if(void 0===t&&void 0===e){var i=this.getExtInfo("subjectKeyIdentifier");if(void 0===i)return;t=o(this.hex,i.vidx),e=i.critical}var n={extname:"subjectKeyIdentifier"};e&&(n.critical=!0);var s=r(t,0);return n.kid={hex:s},n},this.getExtAuthorityKeyIdentifier=function(t,e){if(void 0===t&&void 0===e){var i=this.getExtInfo("authorityKeyIdentifier");if(void 0===i)return;t=o(this.hex,i.vidx),e=i.critical}var s={extname:"authorityKeyIdentifier"};e&&(s.critical=!0);for(var a=n(t,0),u=0;u<a.length;u++){var h=t.substr(a[u],2);if("80"===h&&(s.kid={hex:r(t,a[u])}),"a1"===h){var l=o(t,a[u]),c=this.getGeneralNames(l);s.issuer=c[0].dn}"82"===h&&(s.sn={hex:r(t,a[u])})}return s},this.getExtExtKeyUsage=function(t,e){if(void 0===t&&void 0===e){var i=this.getExtInfo("extKeyUsage");if(void 0===i)return;t=o(this.hex,i.vidx),e=i.critical}var s={extname:"extKeyUsage",array:[]};e&&(s.critical=!0);for(var a=n(t,0),u=0;u<a.length;u++)s.array.push(f(r(t,a[u])));return s},this.getExtExtKeyUsageName=function(){var t=this.getExtInfo("extKeyUsage");if(void 0===t)return t;var e=new Array,i=o(this.hex,t.vidx);if(""===i)return e;for(var s=n(i,0),a=0;a<s.length;a++)e.push(f(r(i,s[a])));return e},this.getExtSubjectAltName=function(t,e){if(void 0===t&&void 0===e){var i=this.getExtInfo("subjectAltName");if(void 0===i)return;t=o(this.hex,i.vidx),e=i.critical}var n={extname:"subjectAltName",array:[]};return e&&(n.critical=!0),n.array=this.getGeneralNames(t),n},this.getExtIssuerAltName=function(t,e){if(void 0===t&&void 0===e){var i=this.getExtInfo("issuerAltName");if(void 0===i)return;t=o(this.hex,i.vidx),e=i.critical}var n={extname:"issuerAltName",array:[]};return e&&(n.critical=!0),n.array=this.getGeneralNames(t),n},this.getGeneralNames=function(t){for(var e=n(t,0),i=[],r=0;r<e.length;r++){var s=this.getGeneralName(o(t,e[r]));void 0!==s&&i.push(s)}return i},this.getGeneralName=function(t){var e=t.substr(0,2),i=r(t,0),n=ct(i);return"81"==e?{rfc822:n}:"82"==e?{dns:n}:"86"==e?{uri:n}:"87"==e?{ip:gt(i)}:"a4"==e?{dn:this.getX500Name(i)}:void 0},this.getExtSubjectAltName2=function(){var t,e,i,s=this.getExtInfo("subjectAltName");if(void 0===s)return s;for(var a=new Array,u=o(this.hex,s.vidx),h=n(u,0),l=0;l<h.length;l++)i=u.substr(h[l],2),t=r(u,h[l]),"81"===i&&(e=lt(t),a.push(["MAIL",e])),"82"===i&&(e=lt(t),a.push(["DNS",e])),"84"===i&&(e=Mt.hex2dn(t,0),a.push(["DN",e])),"86"===i&&(e=lt(t),a.push(["URI",e])),"87"===i&&(e=gt(t),a.push(["IP",e]));return a},this.getExtCRLDistributionPoints=function(t,e){if(void 0===t&&void 0===e){var i=this.getExtInfo("cRLDistributionPoints");if(void 0===i)return;t=o(this.hex,i.vidx),e=i.critical}var r={extname:"cRLDistributionPoints",array:[]};e&&(r.critical=!0);for(var s=n(t,0),a=0;a<s.length;a++){var u=o(t,s[a]);r.array.push(this.getDistributionPoint(u))}return r},this.getDistributionPoint=function(t){for(var e={},i=n(t,0),r=0;r<i.length;r++){var s=t.substr(i[r],2),a=o(t,i[r]);"a0"==s&&(e.dpname=this.getDistributionPointName(a))}return e},this.getDistributionPointName=function(t){for(var e={},i=n(t,0),r=0;r<i.length;r++){var s=t.substr(i[r],2),a=o(t,i[r]);"a0"==s&&(e.full=this.getGeneralNames(a))}return e},this.getExtCRLDistributionPointsURI=function(){var t=this.getExtInfo("cRLDistributionPoints");if(void 0===t)return t;for(var e=new Array,i=n(this.hex,t.vidx),r=0;r<i.length;r++)try{var o=lt(s(this.hex,i[r],[0,0,0],"86"));e.push(o)}catch(t){}return e},this.getExtAIAInfo=function(){var t=this.getExtInfo("authorityInfoAccess");if(void 0===t)return t;for(var e={ocsp:[],caissuer:[]},i=n(this.hex,t.vidx),r=0;r<i.length;r++){var o=s(this.hex,i[r],[0],"06"),a=s(this.hex,i[r],[1],"86");"2b06010505073001"===o&&e.ocsp.push(lt(a)),"2b06010505073002"===o&&e.caissuer.push(lt(a))}return e},this.getExtAuthorityInfoAccess=function(t,e){if(void 0===t&&void 0===e){var i=this.getExtInfo("authorityInfoAccess");if(void 0===i)return;t=o(this.hex,i.vidx),e=i.critical}var r={extname:"authorityInfoAccess",array:[]};e&&(r.critical=!0);for(var u=n(t,0),h=0;h<u.length;h++){var l=a(t,u[h],[0],"06"),c=lt(s(t,u[h],[1],"86"));if("2b06010505073001"==l)r.array.push({ocsp:c});else{if("2b06010505073002"!=l)throw new Error("unknown method: "+l);r.array.push({caissuer:c})}}return r},this.getExtCertificatePolicies=function(t,e){if(void 0===t&&void 0===e){var i=this.getExtInfo("certificatePolicies");if(void 0===i)return;t=o(this.hex,i.vidx),e=i.critical}var r={extname:"certificatePolicies",array:[]};e&&(r.critical=!0);for(var s=n(t,0),a=0;a<s.length;a++){var u=o(t,s[a]),h=this.getPolicyInformation(u);r.array.push(h)}return r},this.getPolicyInformation=function(t){var e={},i=s(t,0,[0],"06");e.policyoid=f(i);var r=c(t,0,[1],"30");if(-1!=r){e.array=[];for(var a=n(t,r),u=0;u<a.length;u++){var h=o(t,a[u]),l=this.getPolicyQualifierInfo(h);e.array.push(l)}}return e},this.getPolicyQualifierInfo=function(t){var e={},i=s(t,0,[0],"06");if("2b06010505070201"===i){var n=a(t,0,[1],"16");e.cps=ct(n)}else if("2b06010505070202"===i){var r=u(t,0,[1],"30");e.unotice=this.getUserNotice(r)}return e},this.getUserNotice=function(t){for(var e={},i=n(t,0),r=0;r<i.length;r++){var s=o(t,i[r]);"30"!=s.substr(0,2)&&(e.exptext=this.getDisplayText(s))}return e},this.getDisplayText=function(t){var e={};return e.type={"0c":"utf8",16:"ia5","1a":"vis","1e":"bmp"}[t.substr(0,2)],e.str=ct(r(t,0)),e},this.getExtCRLNumber=function(t,e){var i={extname:"cRLNumber"};if(e&&(i.critical=!0),"02"==t.substr(0,2))return i.num={hex:r(t,0)},i;throw new Error("hExtV parse error: "+t)},this.getExtCRLReason=function(t,e){var i={extname:"cRLReason"};if(e&&(i.critical=!0),"0a"==t.substr(0,2))return i.code=parseInt(r(t,0),16),i;throw new Error("hExtV parse error: "+t)},this.getExtOcspNonce=function(t,e){var i={extname:"ocspNonce"};e&&(i.critical=!0);var n=r(t,0);return i.hex=n,i},this.getExtOcspNoCheck=function(t,e){var i={extname:"ocspNoCheck"};return e&&(i.critical=!0),i},this.getExtAdobeTimeStamp=function(t,e){if(void 0===t&&void 0===e){var i=this.getExtInfo("adobeTimeStamp");if(void 0===i)return;t=o(this.hex,i.vidx),e=i.critical}var r={extname:"adobeTimeStamp"};e&&(r.critical=!0);var s=n(t,0);if(s.length>1){var a=o(t,s[1]),u=this.getGeneralName(a);null!=u.uri&&(r.uri=u.uri)}if(s.length>2){var h=o(t,s[2]);"0101ff"==h&&(r.reqauth=!0),"010100"==h&&(r.reqauth=!1)}return r},this.getX500NameRule=function(t){for(var e=null,i=[],n=0;n<t.length;n++)for(var r=t[n],o=0;o<r.length;o++)i.push(r[o]);for(n=0;n<i.length;n++){var s=i[n],a=s.ds,u=s.value,h=s.type;if("prn"!=a&&"utf8"!=a&&"ia5"!=a)return"mixed";if("ia5"==a){if("CN"!=h)return"mixed";if(A.lang.String.isMail(u))continue;return"mixed"}if("C"==h){if("prn"==a)continue;return"mixed"}if(null==e)e=a;else if(e!==a)return"mixed"}return null==e?"prn":e},this.getX500Name=function(t){var e=this.getX500NameArray(t);return{array:e,str:this.dnarraytostr(e)}},this.getX500NameArray=function(t){for(var e=[],i=n(t,0),r=0;r<i.length;r++)e.push(this.getRDN(o(t,i[r])));return e},this.getRDN=function(t){for(var e=[],i=n(t,0),r=0;r<i.length;r++)e.push(this.getAttrTypeAndValue(o(t,i[r])));return e},this.getAttrTypeAndValue=function(t){var e={type:null,value:null,ds:null},i=n(t,0),r=s(t,i[0],[],"06"),o=s(t,i[1],[]),a=A.asn1.ASN1Util.oidHexToInt(r);return e.type=A.asn1.x509.OID.oid2atype(a),e.ds=this.HEX2STAG[t.substr(i[1],2)],"bmp"!=e.ds?e.value=lt(o):e.value=vt(o),e},this.readCertPEM=function(t){this.readCertHex(v(t))},this.readCertHex=function(t){this.hex=t,this.getVersion();try{l(this.hex,0,[0,7],"a3"),this.parseExt()}catch(t){}},this.getParam=function(){var t={};return t.version=this.getVersion(),t.serial={hex:this.getSerialNumberHex()},t.sigalg=this.getSignatureAlgorithmField(),t.issuer=this.getIssuer(),t.notbefore=this.getNotBefore(),t.notafter=this.getNotAfter(),t.subject=this.getSubject(),t.sbjpubkey=pt(this.getPublicKeyHex(),"PUBLIC KEY"),this.aExtInfo.length>0&&(t.ext=this.getExtParamArray()),t.sighex=this.getSignatureValueHex(),t},this.getExtParamArray=function(t){null==t&&-1!=c(this.hex,0,[0,"[3]"])&&(t=h(this.hex,0,[0,"[3]",0],"30"));for(var e=[],i=n(t,0),r=0;r<i.length;r++){var s=o(t,i[r]),a=this.getExtParam(s);null!=a&&e.push(a)}return e},this.getExtParam=function(t){var e=n(t,0).length;if(2!=e&&3!=e)throw new Error("wrong number elements in Extension: "+e+" "+t);var i=g(s(t,0,[0],"06")),r=!1;3==e&&"0101ff"==u(t,0,[1])&&(r=!0);var o=u(t,0,[e-1,0]),a=void 0;if("2.5.29.14"==i?a=this.getExtSubjectKeyIdentifier(o,r):"2.5.29.15"==i?a=this.getExtKeyUsage(o,r):"2.5.29.17"==i?a=this.getExtSubjectAltName(o,r):"2.5.29.18"==i?a=this.getExtIssuerAltName(o,r):"2.5.29.19"==i?a=this.getExtBasicConstraints(o,r):"2.5.29.31"==i?a=this.getExtCRLDistributionPoints(o,r):"2.5.29.32"==i?a=this.getExtCertificatePolicies(o,r):"2.5.29.35"==i?a=this.getExtAuthorityKeyIdentifier(o,r):"2.5.29.37"==i?a=this.getExtExtKeyUsage(o,r):"1.3.6.1.5.5.7.1.1"==i?a=this.getExtAuthorityInfoAccess(o,r):"2.5.29.20"==i?a=this.getExtCRLNumber(o,r):"2.5.29.21"==i?a=this.getExtCRLReason(o,r):"1.3.6.1.5.5.7.48.1.2"==i?a=this.getExtOcspNonce(o,r):"1.3.6.1.5.5.7.48.1.5"==i?a=this.getExtOcspNoCheck(o,r):"1.2.840.113583.1.1.9.1"==i&&(a=this.getExtAdobeTimeStamp(o,r)),null!=a)return a;var h={extname:i,extn:o};return r&&(h.critical=!0),h},this.findExt=function(t,e){for(var i=0;i<t.length;i++)if(t[i].extname==e)return t[i];return null},this.updateExtCDPFullURI=function(t,e){var i=this.findExt(t,"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 o=n[r].dpname.full,s=0;s<o.length;s++){var a=o[r];null!=a.uri&&(a.uri=e)}},this.updateExtAIAOCSP=function(t,e){var i=this.findExt(t,"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=e)},this.updateExtAIACAIssuer=function(t,e){var i=this.findExt(t,"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=e)},this.dnarraytostr=function(t){return"/"+t.map((function(t){return function(t){return t.map((function(t){return function(t){return t.type+"="+t.value}(t).replace(/\+/,"\\+")})).join("+")}(t).replace(/\//,"\\/")})).join("/")},this.getInfo=function(){var t,e,i,n,r=function(t){for(var e="",i=t.array,n=0;n<i.length;n++){var r=i[n];if(e+=" policy oid: "+r.policyoid+"\n",void 0!==r.array)for(var o=0;o<r.array.length;o++){var s=r.array[o];void 0!==s.cps&&(e+=" cps: "+s.cps+"\n")}}return e},o=function(t){for(var e="",i=t.array,n=0;n<i.length;n++){var r=i[n];try{void 0!==r.dpname.full[0].uri&&(e+=" "+r.dpname.full[0].uri+"\n")}catch(t){}try{void 0!==r.dname.full[0].dn.hex&&(e+=" "+Mt.hex2dn(r.dpname.full[0].dn.hex)+"\n")}catch(t){}}return e},s=function(t){for(var e="",i=t.array,n=0;n<i.length;n++){var r=i[n];void 0!==r.caissuer&&(e+=" caissuer: "+r.caissuer+"\n"),void 0!==r.ocsp&&(e+=" ocsp: "+r.ocsp+"\n")}return e};if(t="Basic Fields\n",t+=" serial number: "+this.getSerialNumberHex()+"\n",t+=" signature algorithm: "+this.getSignatureAlgorithmField()+"\n",t+=" issuer: "+this.getIssuerString()+"\n",t+=" notBefore: "+this.getNotBefore()+"\n",t+=" notAfter: "+this.getNotAfter()+"\n",t+=" subject: "+this.getSubjectString()+"\n",t+=" subject public key info: \n",t+=" key algorithm: "+(e=this.getPublicKey()).type+"\n","RSA"===e.type&&(t+=" n="+bt(e.n.toString(16)).substr(0,16)+"...\n",t+=" e="+bt(e.e.toString(16))+"\n"),null!=(i=this.aExtInfo)){t+="X509v3 Extensions:\n";for(var a=0;a<i.length;a++){var u=i[a],h=A.asn1.x509.OID.oid2name(u.oid);""===h&&(h=u.oid);var l="";if(!0===u.critical&&(l="CRITICAL"),t+=" "+h+" "+l+":\n","basicConstraints"===h){var c=this.getExtBasicConstraints();void 0===c.cA?t+=" {}\n":(t+=" cA=true",void 0!==c.pathLen&&(t+=", pathLen="+c.pathLen),t+="\n")}else if("keyUsage"===h)t+=" "+this.getExtKeyUsageString()+"\n";else if("subjectKeyIdentifier"===h)t+=" "+this.getExtSubjectKeyIdentifier().kid.hex+"\n";else if("authorityKeyIdentifier"===h){var d=this.getExtAuthorityKeyIdentifier();void 0!==d.kid&&(t+=" kid="+d.kid.hex+"\n")}else"extKeyUsage"===h?t+=" "+this.getExtExtKeyUsage().array.join(", ")+"\n":"subjectAltName"===h?t+=" "+(n=this.getExtSubjectAltName(),JSON.stringify(n.array).replace(/[\[\]\{\}\"]/g,"")+"\n"):"cRLDistributionPoints"===h?t+=o(this.getExtCRLDistributionPoints()):"authorityInfoAccess"===h?t+=s(this.getExtAuthorityInfoAccess()):"certificatePolicies"===h&&(t+=r(this.getExtCertificatePolicies()))}}return(t+="signature algorithm: "+this.getSignatureAlgorithmName()+"\n")+"signature: "+this.getSignatureValueHex().substr(0,16)+"...\n"},"string"==typeof t&&(-1!=t.indexOf("-----BEGIN")?this.readCertPEM(t):A.lang.String.isHex(t)&&this.readCertHex(t))}function Pt(t){return g.SHA256(t).toString()}It.getLblen=function(t,e){if("8"!=t.substr(e+2,1))return 1;var i=parseInt(t.substr(e+3,1));return 0==i?-1:0<i&&i<10?i+1:-2},It.getL=function(t,e){var i=It.getLblen(t,e);return i<1?"":t.substr(e+2,2*i)},It.getVblen=function(t,e){var i;return""==(i=It.getL(t,e))?-1:("8"===i.substr(0,1)?new v(i.substr(2),16):new v(i,16)).intValue()},It.getVidx=function(t,e){var i=It.getLblen(t,e);return i<0?i:e+2*(i+1)},It.getV=function(t,e){var i=It.getVidx(t,e),n=It.getVblen(t,e);return t.substr(i,2*n)},It.getTLV=function(t,e){return t.substr(e,2)+It.getL(t,e)+It.getV(t,e)},It.getTLVblen=function(t,e){return 2+2*It.getLblen(t,e)+2*It.getVblen(t,e)},It.getNextSiblingIdx=function(t,e){return It.getVidx(t,e)+2*It.getVblen(t,e)},It.getChildIdx=function(t,e){var i,n,r,o=It,s=[];i=o.getVidx(t,e),n=2*o.getVblen(t,e),"03"==t.substr(e,2)&&(i+=2,n-=2),r=0;for(var a=i;r<=n;){var u=o.getTLVblen(t,a);if((r+=u)<=n&&s.push(a),a+=u,r>=n)break}return s},It.getNthChildIdx=function(t,e,i){return It.getChildIdx(t,e)[i]},It.getIdxbyList=function(t,e,i,n){var r,o,s=It;return 0==i.length?void 0!==n&&t.substr(e,2)!==n?-1:e:(r=i.shift())>=(o=s.getChildIdx(t,e)).length?-1:s.getIdxbyList(t,o[r],i,n)},It.getIdxbyListEx=function(t,e,i,n){var r,o,s=It;if(0==i.length)return void 0!==n&&t.substr(e,2)!==n?-1:e;r=i.shift(),o=s.getChildIdx(t,e);for(var a=0,u=0;u<o.length;u++){var h=t.substr(o[u],2);if("number"==typeof r&&!s.isContextTag(h)&&a==r||"string"==typeof r&&s.isContextTag(h,r))return s.getIdxbyListEx(t,o[u],i,n);s.isContextTag(h)||a++}return-1},It.getTLVbyList=function(t,e,i,n){var r=It,o=r.getIdxbyList(t,e,i,n);return-1==o||o>=t.length?null:r.getTLV(t,o)},It.getTLVbyListEx=function(t,e,i,n){var r=It,o=r.getIdxbyListEx(t,e,i,n);return-1==o?null:r.getTLV(t,o)},It.getVbyList=function(t,e,i,n,r){var o,s,a=It;return-1==(o=a.getIdxbyList(t,e,i,n))||o>=t.length?null:(s=a.getV(t,o),!0===r&&(s=s.substr(2)),s)},It.getVbyListEx=function(t,e,i,n,r){var o,s,a=It;return-1==(o=a.getIdxbyListEx(t,e,i,n))?null:(s=a.getV(t,o),"03"==t.substr(o,2)&&!1!==r&&(s=s.substr(2)),s)},It.getInt=function(t,e,i){null==i&&(i=-1);try{var n=t.substr(e,2);if("02"!=n&&"03"!=n)return i;var r=It.getV(t,e);return"02"==n?parseInt(r,16):function(t){try{var e=t.substr(0,2);if("00"==e)return parseInt(t.substr(2),16);var i=parseInt(e,16),n=t.substr(2),r=parseInt(n,16).toString(2);return"0"==r&&(r="00000000"),r=r.slice(0,0-i),parseInt(r,2)}catch(t){return-1}}(r)}catch(t){return i}},It.getOID=function(t,e,i){null==i&&(i=null);try{return"06"!=t.substr(e,2)?i:function(t){if(!yt(t))return null;try{var e=[],i=t.substr(0,2),n=parseInt(i,16);e[0]=new String(Math.floor(n/40)),e[1]=new String(n%40);for(var r=t.substr(2),o=[],s=0;s<r.length/2;s++)o.push(parseInt(r.substr(2*s,2),16));var a=[],u="";for(s=0;s<o.length;s++)128&o[s]?u+=wt((127&o[s]).toString(2),7):(u+=wt((127&o[s]).toString(2),7),a.push(new String(parseInt(u,2))),u="");var h=e.join(".");return a.length>0&&(h=h+"."+a.join(".")),h}catch(t){return null}}(It.getV(t,e))}catch(t){return i}},It.getOIDName=function(t,e,i){null==i&&(i=null);try{var n=It.getOID(t,e,i);if(n==i)return i;var r=A.asn1.x509.OID.oid2name(n);return""==r?n:r}catch(t){return i}},It.getString=function(t,e,i){null==i&&(i=null);try{return ct(It.getV(t,e))}catch(t){return i}},It.hextooidstr=function(t){var e=function(t,e){return t.length>=e?t:new Array(e-t.length+1).join("0")+t},i=[],n=t.substr(0,2),r=parseInt(n,16);i[0]=new String(Math.floor(r/40)),i[1]=new String(r%40);for(var o=t.substr(2),s=[],a=0;a<o.length/2;a++)s.push(parseInt(o.substr(2*a,2),16));var u=[],h="";for(a=0;a<s.length;a++)128&s[a]?h+=e((127&s[a]).toString(2),7):(h+=e((127&s[a]).toString(2),7),u.push(new String(parseInt(h,2))),h="");var l=i.join(".");return u.length>0&&(l=l+"."+u.join(".")),l},It.dump=function(t,e,i,n){var r=It,o=r.getV,s=r.dump,a=r.getChildIdx,u=t;t instanceof A.asn1.ASN1Object&&(u=t.getEncodedHex());var h=function(t,e){return t.length<=2*e?t:t.substr(0,e)+"..(total "+t.length/2+"bytes).."+t.substr(t.length-e,e)};void 0===e&&(e={ommit_long_octet:32}),void 0===i&&(i=0),void 0===n&&(n="");var l,c=e.ommit_long_octet;if("01"==(l=u.substr(i,2)))return"00"==(d=o(u,i))?n+"BOOLEAN FALSE\n":n+"BOOLEAN TRUE\n";if("02"==l)return n+"INTEGER "+h(d=o(u,i),c)+"\n";if("03"==l){var d=o(u,i);return r.isASN1HEX(d.substr(2))?(E=n+"BITSTRING, encapsulates\n")+s(d.substr(2),e,0,n+" "):n+"BITSTRING "+h(d,c)+"\n"}if("04"==l)return d=o(u,i),r.isASN1HEX(d)?(E=n+"OCTETSTRING, encapsulates\n")+s(d,e,0,n+" "):n+"OCTETSTRING "+h(d,c)+"\n";if("05"==l)return n+"NULL\n";if("06"==l){var p=o(u,i),f=A.asn1.ASN1Util.oidHexToInt(p),g=A.asn1.x509.OID.oid2name(f),v=f.replace(/\./g," ");return""!=g?n+"ObjectIdentifier "+g+" ("+v+")\n":n+"ObjectIdentifier ("+v+")\n"}if("0a"==l)return n+"ENUMERATED "+parseInt(o(u,i))+"\n";if("0c"==l)return n+"UTF8String '"+lt(o(u,i))+"'\n";if("13"==l)return n+"PrintableString '"+lt(o(u,i))+"'\n";if("14"==l)return n+"TeletexString '"+lt(o(u,i))+"'\n";if("16"==l)return n+"IA5String '"+lt(o(u,i))+"'\n";if("17"==l)return n+"UTCTime "+lt(o(u,i))+"\n";if("18"==l)return n+"GeneralizedTime "+lt(o(u,i))+"\n";if("1a"==l)return n+"VisualString '"+lt(o(u,i))+"'\n";if("1e"==l)return n+"BMPString '"+vt(o(u,i))+"'\n";if("30"==l){if("3000"==u.substr(i,4))return n+"SEQUENCE {}\n";E=n+"SEQUENCE\n";var m=e;if((2==(w=a(u,i)).length||3==w.length)&&"06"==u.substr(w[0],2)&&"04"==u.substr(w[w.length-1],2)){g=r.oidname(o(u,w[0]));var y=JSON.parse(JSON.stringify(e));y.x509ExtName=g,m=y}for(var b=0;b<w.length;b++)E+=s(u,m,w[b],n+" ");return E}if("31"==l){E=n+"SET\n";var w=a(u,i);for(b=0;b<w.length;b++)E+=s(u,e,w[b],n+" ");return E}if(0!=(128&(l=parseInt(l,16)))){var E,x=31&l;if(0!=(32&l)){for(E=n+"["+x+"]\n",w=a(u,i),b=0;b<w.length;b++)E+=s(u,e,w[b],n+" ");return E}return d=o(u,i),It.isASN1HEX(d)?(E=n+"["+x+"]\n")+s(d,e,0,n+" "):(("68747470"==d.substr(0,8)||"subjectAltName"===e.x509ExtName&&2==x)&&(d=lt(d)),n+"["+x+"] "+d+"\n")}return n+"UNKNOWN("+l+") "+o(u,i)+"\n"},It.isContextTag=function(t,e){var i,n;t=t.toLowerCase();try{i=parseInt(t,16)}catch(t){return-1}if(void 0===e)return 128==(192&i);try{return null!=e.match(/^\[[0-9]+\]$/)&&!((n=parseInt(e.substr(1,e.length-1),10))>31)&&128==(192&i)&&(31&i)==n}catch(t){return!1}},It.isASN1HEX=function(t){var e=It;if(t.length%2==1)return!1;var i=e.getVblen(t,0),n=t.substr(0,2),r=e.getL(t,0);return t.length-n.length-r.length==2*i},It.checkStrictDER=function(t,e,i,n,r){var o=It;if(void 0===i){if("string"!=typeof t)throw new Error("not hex string");if(t=t.toLowerCase(),!A.lang.String.isHex(t))throw new Error("not hex string");i=t.length,r=(n=t.length/2)<128?1:Math.ceil(n.toString(16))+1}if(o.getL(t,e).length>2*r)throw new Error("L of TLV too long: idx="+e);var s=o.getVblen(t,e);if(s>n)throw new Error("value of L too long than hex: idx="+e);var a=o.getTLV(t,e),u=a.length-2-o.getL(t,e).length;if(u!==2*s)throw new Error("V string length and L's value not the same:"+u+"/"+2*s);if(0===e&&t.length!=a.length)throw new Error("total length and TLV length unmatch:"+t.length+"!="+a.length);var h=t.substr(e,2);if("02"===h){var l=o.getVidx(t,e);if("00"==t.substr(l,2)&&t.charCodeAt(l+2)<56)throw new Error("not least zeros for DER INTEGER")}if(32&parseInt(h,16)){for(var c=o.getVblen(t,e),d=0,p=o.getChildIdx(t,e),f=0;f<p.length;f++)d+=o.getTLV(t,p[f]).length,o.checkStrictDER(t,p[f],i,n,r);if(2*c!=d)throw new Error("sum of children's TLV length and L unmatch: "+2*c+"!="+d)}},It.oidname=function(t){var e=A.asn1;A.lang.String.isHex(t)&&(t=e.ASN1Util.oidHexToInt(t));var i=e.x509.OID.oid2name(t);return""===i&&(i=t),i},void 0!==A.asn1&&A.asn1||(A.asn1={}),void 0!==A.asn1.x509&&A.asn1.x509||(A.asn1.x509={}),A.asn1.x509.Certificate=function(t){A.asn1.x509.Certificate.superclass.constructor.call(this);var e=A.asn1,i=e.DERBitString,n=e.DERSequence,r=e.x509,o=r.TBSCertificate,s=r.AlgorithmIdentifier;this.params=void 0,this.setByParam=function(t){this.params=t},this.sign=function(){var t=this.params,e=t.sigalg;null!=t.sigalg.name&&(e=t.sigalg.name);var i=t.tbsobj.getEncodedHex(),n=new A.crypto.Signature({alg:e});n.init(t.cakey),n.updateHex(i),t.sighex=n.sign()},this.getPEM=function(){return pt(this.getEncodedHex(),"CERTIFICATE")},this.getEncodedHex=function(){var t=this.params;if(null!=t.tbsobj&&null!=t.tbsobj||(t.tbsobj=new o(t)),null==t.sighex&&null!=t.cakey&&this.sign(),null==t.sighex)throw new Error("sighex or cakey parameter not defined");var e=[];return e.push(t.tbsobj),e.push(new s({name:t.sigalg})),e.push(new i({hex:"00"+t.sighex})),new n({array:e}).getEncodedHex()},null!=t&&(this.params=t)},Et(A.asn1.x509.Certificate,A.asn1.ASN1Object),A.asn1.x509.TBSCertificate=function(t){A.asn1.x509.TBSCertificate.superclass.constructor.call(this);var e=A.asn1,i=e.x509,n=e.DERTaggedObject,r=e.DERInteger,o=e.DERSequence,s=i.AlgorithmIdentifier,a=i.Time,u=i.X500Name,h=i.Extensions,l=i.SubjectPublicKeyInfo;this.params=null,this.setByParam=function(t){this.params=t},this.getEncodedHex=function(){var t=[],e=this.params;if(null!=e.version||1!=e.version){var i=2;null!=e.version&&(i=e.version-1);var c=new n({obj:new r({int:i})});t.push(c)}return t.push(new r(e.serial)),t.push(new s({name:e.sigalg})),t.push(new u(e.issuer)),t.push(new o({array:[new a(e.notbefore),new a(e.notafter)]})),t.push(new u(e.subject)),t.push(new l(xt.getKey(e.sbjpubkey))),void 0!==e.ext&&e.ext.length>0&&t.push(new n({tag:"a3",obj:new h(e.ext)})),new A.asn1.DERSequence({array:t}).getEncodedHex()},void 0!==t&&this.setByParam(t)},Et(A.asn1.x509.TBSCertificate,A.asn1.ASN1Object),A.asn1.x509.Extensions=function(t){A.asn1.x509.Extensions.superclass.constructor.call(this);var e=A.asn1,i=e.DERSequence,n=e.x509;this.aParam=[],this.setByParam=function(t){this.aParam=t},this.getEncodedHex=function(){for(var t=[],e=0;e<this.aParam.length;e++){var r=this.aParam[e],o=r.extname,s=null;if(null!=r.extn)s=new n.PrivateExtension(r);else if("subjectKeyIdentifier"==o)s=new n.SubjectKeyIdentifier(r);else if("keyUsage"==o)s=new n.KeyUsage(r);else if("subjectAltName"==o)s=new n.SubjectAltName(r);else if("issuerAltName"==o)s=new n.IssuerAltName(r);else if("basicConstraints"==o)s=new n.BasicConstraints(r);else if("cRLDistributionPoints"==o)s=new n.CRLDistributionPoints(r);else if("certificatePolicies"==o)s=new n.CertificatePolicies(r);else if("authorityKeyIdentifier"==o)s=new n.AuthorityKeyIdentifier(r);else if("extKeyUsage"==o)s=new n.ExtKeyUsage(r);else if("authorityInfoAccess"==o)s=new n.AuthorityInfoAccess(r);else if("cRLNumber"==o)s=new n.CRLNumber(r);else if("cRLReason"==o)s=new n.CRLReason(r);else if("ocspNonce"==o)s=new n.OCSPNonce(r);else if("ocspNoCheck"==o)s=new n.OCSPNoCheck(r);else if("adobeTimeStamp"==o)s=new n.AdobeTimeStamp(r);else{if("subjectDirectoryAttributes"!=o)throw new Error("extension not supported:"+JSON.stringify(r));s=new n.SubjectDirectoryAttributes(r)}null!=s&&t.push(s)}return new i({array:t}).getEncodedHex()},null!=t&&this.setByParam(t)},Et(A.asn1.x509.Extensions,A.asn1.ASN1Object),A.asn1.x509.Extension=function(t){A.asn1.x509.Extension.superclass.constructor.call(this);var e=A.asn1,i=e.DERObjectIdentifier,n=e.DEROctetString,r=(e.DERBitString,e.DERBoolean),o=e.DERSequence;this.getEncodedHex=function(){var t=new i({oid:this.oid}),e=new n({hex:this.getExtnValueHex()}),s=new Array;return s.push(t),this.critical&&s.push(new r),s.push(e),new o({array:s}).getEncodedHex()},this.critical=!1,void 0!==t&&void 0!==t.critical&&(this.critical=t.critical)},Et(A.asn1.x509.Extension,A.asn1.ASN1Object),A.asn1.x509.KeyUsage=function(t){A.asn1.x509.KeyUsage.superclass.constructor.call(this,t);var e=Mt.KEYUSAGE_NAME;if(this.getExtnValueHex=function(){return this.asn1ExtnValue.getEncodedHex()},this.oid="2.5.29.15",void 0!==t&&(void 0!==t.bin&&(this.asn1ExtnValue=new A.asn1.DERBitString(t)),void 0!==t.names&&void 0!==t.names.length)){for(var i=t.names,n="000000000",r=0;r<i.length;r++)for(var o=0;o<e.length;o++)i[r]===e[o]&&(n=n.substring(0,o)+"1"+n.substring(o+1,n.length));this.asn1ExtnValue=new A.asn1.DERBitString({bin:n})}},Et(A.asn1.x509.KeyUsage,A.asn1.x509.Extension),A.asn1.x509.BasicConstraints=function(t){A.asn1.x509.BasicConstraints.superclass.constructor.call(this,t);var e=A.asn1,i=e.DERBoolean,n=e.DERInteger,r=e.DERSequence;this.getExtnValueHex=function(){var t=new Array;this.cA&&t.push(new i),this.pathLen>-1&&t.push(new n({int:this.pathLen}));var e=new r({array:t});return this.asn1ExtnValue=e,this.asn1ExtnValue.getEncodedHex()},this.oid="2.5.29.19",this.cA=!1,this.pathLen=-1,void 0!==t&&(void 0!==t.cA&&(this.cA=t.cA),void 0!==t.pathLen&&(this.pathLen=t.pathLen))},Et(A.asn1.x509.BasicConstraints,A.asn1.x509.Extension),A.asn1.x509.CRLDistributionPoints=function(t){A.asn1.x509.CRLDistributionPoints.superclass.constructor.call(this,t);var e=A.asn1,i=e.x509;this.getExtnValueHex=function(){return this.asn1ExtnValue.getEncodedHex()},this.setByDPArray=function(t){for(var n=[],r=0;r<t.length;r++)if(t[r]instanceof A.asn1.ASN1Object)n.push(t[r]);else{var o=new i.DistributionPoint(t[r]);n.push(o)}this.asn1ExtnValue=new e.DERSequence({array:n})},this.setByOneURI=function(t){var e=new i.DistributionPoint({fulluri:t});this.setByDPArray([e])},this.oid="2.5.29.31",void 0!==t&&(void 0!==t.array?this.setByDPArray(t.array):void 0!==t.uri&&this.setByOneURI(t.uri))},Et(A.asn1.x509.CRLDistributionPoints,A.asn1.x509.Extension),A.asn1.x509.DistributionPoint=function(t){A.asn1.x509.DistributionPoint.superclass.constructor.call(this);var e=A.asn1,i=e.x509.DistributionPointName;this.getEncodedHex=function(){var t=new e.DERSequence;if(null!=this.asn1DP){var i=new e.DERTaggedObject({explicit:!0,tag:"a0",obj:this.asn1DP});t.appendASN1Object(i)}return this.hTLV=t.getEncodedHex(),this.hTLV},void 0!==t&&(void 0!==t.dpobj?this.asn1DP=t.dpobj:void 0!==t.dpname?this.asn1DP=new i(t.dpname):void 0!==t.fulluri&&(this.asn1DP=new i({full:[{uri:t.fulluri}]})))},Et(A.asn1.x509.DistributionPoint,A.asn1.ASN1Object),A.asn1.x509.DistributionPointName=function(t){A.asn1.x509.DistributionPointName.superclass.constructor.call(this);var e=A.asn1,i=e.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!==t)if(e.x509.GeneralNames.prototype.isPrototypeOf(t))this.type="full",this.tag="a0",this.asn1V=t;else{if(void 0===t.full)throw new Error("This class supports GeneralNames only as argument");this.type="full",this.tag="a0",this.asn1V=new e.x509.GeneralNames(t.full)}},Et(A.asn1.x509.DistributionPointName,A.asn1.ASN1Object),A.asn1.x509.CertificatePolicies=function(t){A.asn1.x509.CertificatePolicies.superclass.constructor.call(this,t);var e=A.asn1,i=e.x509,n=e.DERSequence,r=i.PolicyInformation;this.params=null,this.getExtnValueHex=function(){for(var t=[],e=0;e<this.params.array.length;e++)t.push(new r(this.params.array[e]));var i=new n({array:t});return this.asn1ExtnValue=i,this.asn1ExtnValue.getEncodedHex()},this.oid="2.5.29.32",void 0!==t&&(this.params=t)},Et(A.asn1.x509.CertificatePolicies,A.asn1.x509.Extension),A.asn1.x509.PolicyInformation=function(t){A.asn1.x509.PolicyInformation.superclass.constructor.call(this,t);var e=A.asn1,i=e.DERSequence,n=e.DERObjectIdentifier,r=e.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 t=[new n(this.params.policyoid)];if(void 0!==this.params.array){for(var e=[],o=0;o<this.params.array.length;o++)e.push(new r(this.params.array[o]));e.length>0&&t.push(new i({array:e}))}return new i({array:t}).getEncodedHex()},void 0!==t&&(this.params=t)},Et(A.asn1.x509.PolicyInformation,A.asn1.ASN1Object),A.asn1.x509.PolicyQualifierInfo=function(t){A.asn1.x509.PolicyQualifierInfo.superclass.constructor.call(this,t);var e=A.asn1,i=e.DERSequence,n=e.DERIA5String,r=e.DERObjectIdentifier,o=e.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 o(this.params.unotice)]}).getEncodedHex():void 0},void 0!==t&&(this.params=t)},Et(A.asn1.x509.PolicyQualifierInfo,A.asn1.ASN1Object),A.asn1.x509.UserNotice=function(t){A.asn1.x509.UserNotice.superclass.constructor.call(this,t);var e=A.asn1.DERSequence,i=(A.asn1.DERInteger,A.asn1.x509.DisplayText),n=A.asn1.x509.NoticeReference;this.params=null,this.getEncodedHex=function(){var t=[];return void 0!==this.params.noticeref&&t.push(new n(this.params.noticeref)),void 0!==this.params.exptext&&t.push(new i(this.params.exptext)),new e({array:t}).getEncodedHex()},void 0!==t&&(this.params=t)},Et(A.asn1.x509.UserNotice,A.asn1.ASN1Object),A.asn1.x509.NoticeReference=function(t){A.asn1.x509.NoticeReference.superclass.constructor.call(this,t);var e=A.asn1.DERSequence,i=A.asn1.DERInteger,n=A.asn1.x509.DisplayText;this.params=null,this.getEncodedHex=function(){var t=[];if(void 0!==this.params.org&&t.push(new n(this.params.org)),void 0!==this.params.noticenum){for(var r=[],o=this.params.noticenum,s=0;s<o.length;s++)r.push(new i(o[s]));t.push(new e({array:r}))}if(0==t.length)throw new Error("parameter is empty");return new e({array:t}).getEncodedHex()},void 0!==t&&(this.params=t)},Et(A.asn1.x509.NoticeReference,A.asn1.ASN1Object),A.asn1.x509.DisplayText=function(t){A.asn1.x509.DisplayText.superclass.constructor.call(this,t),this.hT="0c",void 0!==t&&("ia5"===t.type?this.hT="16":"vis"===t.type?this.hT="1a":"bmp"===t.type&&(this.hT="1e"))},Et(A.asn1.x509.DisplayText,A.asn1.DERAbstractString),A.asn1.x509.ExtKeyUsage=function(t){A.asn1.x509.ExtKeyUsage.superclass.constructor.call(this,t);var e=A.asn1;this.setPurposeArray=function(t){this.asn1ExtnValue=new e.DERSequence;for(var i=0;i<t.length;i++){var n=new e.DERObjectIdentifier(t[i]);this.asn1ExtnValue.appendASN1Object(n)}},this.getExtnValueHex=function(){return this.asn1ExtnValue.getEncodedHex()},this.oid="2.5.29.37",void 0!==t&&void 0!==t.array&&this.setPurposeArray(t.array)},Et(A.asn1.x509.ExtKeyUsage,A.asn1.x509.Extension),A.asn1.x509.AuthorityKeyIdentifier=function(t){A.asn1.x509.AuthorityKeyIdentifier.superclass.constructor.call(this,t);var e=A,i=e.asn1,n=i.DERTaggedObject,r=i.x509.GeneralNames;e.crypto.Util.isKey,this.asn1KID=null,this.asn1CertIssuer=null,this.asn1CertSN=null,this.getExtnValueHex=function(){var t=new Array;this.asn1KID&&t.push(new n({explicit:!1,tag:"80",obj:this.asn1KID})),this.asn1CertIssuer&&t.push(new n({explicit:!1,tag:"a1",obj:new r([{dn:this.asn1CertIssuer}])})),this.asn1CertSN&&t.push(new n({explicit:!1,tag:"82",obj:this.asn1CertSN}));var e=new i.DERSequence({array:t});return this.asn1ExtnValue=e,this.asn1ExtnValue.getEncodedHex()},this.setKIDByParam=function(t){if(void 0!==t.str||void 0!==t.hex)this.asn1KID=new A.asn1.DEROctetString(t);else if("object"==typeof t&&A.crypto.Util.isKey(t)||"string"==typeof t&&-1!=t.indexOf("BEGIN ")){var e=t;"string"==typeof t&&(e=xt.getKey(t));var i=xt.getKeyID(e);this.asn1KID=new A.asn1.DEROctetString({hex:i})}},this.setCertIssuerByParam=function(t){void 0!==t.str||void 0!==t.ldapstr||void 0!==t.hex||void 0!==t.certsubject||void 0!==t.certissuer?this.asn1CertIssuer=new A.asn1.x509.X500Name(t):"string"==typeof t&&-1!=t.indexOf("BEGIN ")&&-1!=t.indexOf("CERTIFICATE")&&(this.asn1CertIssuer=new A.asn1.x509.X500Name({certissuer:t}))},this.setCertSNByParam=function(t){if(void 0!==t.str||void 0!==t.bigint||void 0!==t.hex)this.asn1CertSN=new A.asn1.DERInteger(t);else if("string"==typeof t&&-1!=t.indexOf("BEGIN ")&&t.indexOf("CERTIFICATE")){var e=new Mt;e.readCertPEM(t);var i=e.getSerialNumberHex();this.asn1CertSN=new A.asn1.DERInteger({hex:i})}},this.oid="2.5.29.35",void 0!==t&&(void 0!==t.kid&&this.setKIDByParam(t.kid),void 0!==t.issuer&&this.setCertIssuerByParam(t.issuer),void 0!==t.sn&&this.setCertSNByParam(t.sn),void 0!==t.issuersn&&"string"==typeof t.issuersn&&-1!=t.issuersn.indexOf("BEGIN ")&&t.issuersn.indexOf("CERTIFICATE")&&(this.setCertSNByParam(t.issuersn),this.setCertIssuerByParam(t.issuersn)))},Et(A.asn1.x509.AuthorityKeyIdentifier,A.asn1.x509.Extension),A.asn1.x509.SubjectKeyIdentifier=function(t){A.asn1.x509.SubjectKeyIdentifier.superclass.constructor.call(this,t);var e=A.asn1.DEROctetString;this.asn1KID=null,this.getExtnValueHex=function(){return this.asn1ExtnValue=this.asn1KID,this.asn1ExtnValue.getEncodedHex()},this.setKIDByParam=function(t){if(void 0!==t.str||void 0!==t.hex)this.asn1KID=new e(t);else if("object"==typeof t&&A.crypto.Util.isKey(t)||"string"==typeof t&&-1!=t.indexOf("BEGIN")){var i=t;"string"==typeof t&&(i=xt.getKey(t));var n=xt.getKeyID(i);this.asn1KID=new A.asn1.DEROctetString({hex:n})}},this.oid="2.5.29.14",void 0!==t&&void 0!==t.kid&&this.setKIDByParam(t.kid)},Et(A.asn1.x509.SubjectKeyIdentifier,A.asn1.x509.Extension),A.asn1.x509.AuthorityInfoAccess=function(t){A.asn1.x509.AuthorityInfoAccess.superclass.constructor.call(this,t),this.setAccessDescriptionArray=function(t){for(var e=new Array,i=A.asn1,n=i.DERSequence,r=i.DERObjectIdentifier,o=i.x509.GeneralName,s=0;s<t.length;s++){var a,u=t[s];if(void 0!==u.ocsp)a=new n({array:[new r({oid:"1.3.6.1.5.5.7.48.1"}),new o({uri:u.ocsp})]});else{if(void 0===u.caissuer)throw new Error("unknown AccessMethod parameter: "+JSON.stringify(u));a=new n({array:[new r({oid:"1.3.6.1.5.5.7.48.2"}),new o({uri:u.caissuer})]})}e.push(a)}this.asn1ExtnValue=new n({array:e})},this.getExtnValueHex=function(){return this.asn1ExtnValue.getEncodedHex()},this.oid="1.3.6.1.5.5.7.1.1",void 0!==t&&void 0!==t.array&&this.setAccessDescriptionArray(t.array)},Et(A.asn1.x509.AuthorityInfoAccess,A.asn1.x509.Extension),A.asn1.x509.SubjectAltName=function(t){A.asn1.x509.SubjectAltName.superclass.constructor.call(this,t),this.setNameArray=function(t){this.asn1ExtnValue=new A.asn1.x509.GeneralNames(t)},this.getExtnValueHex=function(){return this.asn1ExtnValue.getEncodedHex()},this.oid="2.5.29.17",void 0!==t&&void 0!==t.array&&this.setNameArray(t.array)},Et(A.asn1.x509.SubjectAltName,A.asn1.x509.Extension),A.asn1.x509.IssuerAltName=function(t){A.asn1.x509.IssuerAltName.superclass.constructor.call(this,t),this.setNameArray=function(t){this.asn1ExtnValue=new A.asn1.x509.GeneralNames(t)},this.getExtnValueHex=function(){return this.asn1ExtnValue.getEncodedHex()},this.oid="2.5.29.18",void 0!==t&&void 0!==t.array&&this.setNameArray(t.array)},Et(A.asn1.x509.IssuerAltName,A.asn1.x509.Extension),A.asn1.x509.SubjectDirectoryAttributes=function(t){A.asn1.x509.SubjectDirectoryAttributes.superclass.constructor.call(this,t);var e=A.asn1,i=e.DERSequence,n=e.ASN1Util.newObject,r=e.x509.OID.name2oid;this.params=null,this.getExtnValueHex=function(){for(var t=[],e=0;e<this.params.array.length;e++){var o=this.params.array[e],s={seq:[{oid:"1.2.3.4"},{set:[{utf8str:"DE"}]}]};if("dateOfBirth"==o.attr)s.seq[0].oid=r(o.attr),s.seq[1].set[0]={gentime:o.str};else if("placeOfBirth"==o.attr)s.seq[0].oid=r(o.attr),s.seq[1].set[0]={utf8str:o.str};else if("gender"==o.attr)s.seq[0].oid=r(o.attr),s.seq[1].set[0]={prnstr:o.str};else if("countryOfCitizenship"==o.attr)s.seq[0].oid=r(o.attr),s.seq[1].set[0]={prnstr:o.str};else{if("countryOfResidence"!=o.attr)throw new Error("unsupported attribute: "+o.attr);s.seq[0].oid=r(o.attr),s.seq[1].set[0]={prnstr:o.str}}t.push(new n(s))}var a=new i({array:t});return this.asn1ExtnValue=a,this.asn1ExtnValue.getEncodedHex()},this.oid="2.5.29.9",void 0!==t&&(this.params=t)},Et(A.asn1.x509.SubjectDirectoryAttributes,A.asn1.x509.Extension),A.asn1.x509.PrivateExtension=function(t){A.asn1.x509.PrivateExtension.superclass.constructor.call(this,t);var e=A,i=e.lang.String.isHex,n=e.asn1,r=n.x509.OID.name2oid,o=n.ASN1Util.newObject;this.params=null,this.setByParam=function(t){this.oid=r(t.extname),this.params=t},this.getExtnValueHex=function(){if(null==this.params.extname||null==this.params.extn)throw new Error("extname or extnhex not specified");var t=this.params.extn;if("string"==typeof t&&i(t))return t;if("object"==typeof t)try{return o(t).getEncodedHex()}catch(t){}throw new Error("unsupported extn value")},null!=t&&this.setByParam(t)},Et(A.asn1.x509.PrivateExtension,A.asn1.x509.Extension),A.asn1.x509.CRL=function(t){A.asn1.x509.CRL.superclass.constructor.call(this);var e=A.asn1,i=e.DERSequence,n=e.DERBitString,r=e.x509,o=r.AlgorithmIdentifier,s=r.TBSCertList;this.params=void 0,this.setByParam=function(t){this.params=t},this.sign=function(){var t=new s(this.params).getEncodedHex(),e=new A.crypto.Signature({alg:this.params.sigalg});e.init(this.params.cakey),e.updateHex(t);var i=e.sign();this.params.sighex=i},this.getPEM=function(){return pt(this.getEncodedHex(),"X509 CRL")},this.getEncodedHex=function(){var t=this.params;if(null==t.tbsobj&&(t.tbsobj=new s(t)),null==t.sighex&&null!=t.cakey&&this.sign(),null==t.sighex)throw new Error("sighex or cakey parameter not defined");var e=[];return e.push(t.tbsobj),e.push(new o({name:t.sigalg})),e.push(new n({hex:"00"+t.sighex})),new i({array:e}).getEncodedHex()},null!=t&&(this.params=t)},Et(A.asn1.x509.CRL,A.asn1.ASN1Object),A.asn1.x509.TBSCertList=function(t){A.asn1.x509.TBSCertList.superclass.constructor.call(this);var e=A.asn1,i=e.DERInteger,n=e.DERSequence,r=e.DERTaggedObject,o=(e.DERObjectIdentifier,e.x509),s=o.AlgorithmIdentifier,a=o.Time,u=o.Extensions,h=o.X500Name;this.params=null,this.setByParam=function(t){this.params=t},this.getRevCertSequence=function(){for(var t=[],e=this.params.revcert,r=0;r<e.length;r++){var o=[new i(e[r].sn),new a(e[r].date)];null!=e[r].ext&&o.push(new u(e[r].ext)),t.push(new n({array:o}))}return new n({array:t})},this.getEncodedHex=function(){var t=[],e=this.params;if(null!=e.version){var o=e.version-1,l=new i({int:o});t.push(l)}if(t.push(new s({name:e.sigalg})),t.push(new h(e.issuer)),t.push(new a(e.thisupdate)),null!=e.nextupdate&&t.push(new a(e.nextupdate)),null!=e.revcert&&t.push(this.getRevCertSequence()),null!=e.ext){var c=new u(e.ext);t.push(new r({tag:"a0",explicit:!0,obj:c}))}return new n({array:t}).getEncodedHex()},void 0!==t&&this.setByParam(t)},Et(A.asn1.x509.TBSCertList,A.asn1.ASN1Object),A.asn1.x509.CRLEntry=function(t){A.asn1.x509.CRLEntry.superclass.constructor.call(this);var e=A.asn1;this.setCertSerial=function(t){this.sn=new e.DERInteger(t)},this.setRevocationDate=function(t){this.time=new e.x509.Time(t)},this.getEncodedHex=function(){var t=new e.DERSequence({array:[this.sn,this.time]});return this.TLV=t.getEncodedHex(),this.TLV},void 0!==t&&(void 0!==t.time&&this.setRevocationDate(t.time),void 0!==t.sn&&this.setCertSerial(t.sn))},Et(A.asn1.x509.CRLEntry,A.asn1.ASN1Object),A.asn1.x509.CRLNumber=function(t){A.asn1.x509.CRLNumber.superclass.constructor.call(this,t),this.params=void 0,this.getExtnValueHex=function(){return this.asn1ExtnValue=new A.asn1.DERInteger(this.params.num),this.asn1ExtnValue.getEncodedHex()},this.oid="2.5.29.20",null!=t&&(this.params=t)},Et(A.asn1.x509.CRLNumber,A.asn1.x509.Extension),A.asn1.x509.CRLReason=function(t){A.asn1.x509.CRLReason.superclass.constructor.call(this,t),this.params=void 0,this.getExtnValueHex=function(){return this.asn1ExtnValue=new A.asn1.DEREnumerated(this.params.code),this.asn1ExtnValue.getEncodedHex()},this.oid="2.5.29.21",null!=t&&(this.params=t)},Et(A.asn1.x509.CRLReason,A.asn1.x509.Extension),A.asn1.x509.OCSPNonce=function(t){A.asn1.x509.OCSPNonce.superclass.constructor.call(this,t),this.params=void 0,this.getExtnValueHex=function(){return this.asn1ExtnValue=new A.asn1.DEROctetString(this.params),this.asn1ExtnValue.getEncodedHex()},this.oid="1.3.6.1.5.5.7.48.1.2",null!=t&&(this.params=t)},Et(A.asn1.x509.OCSPNonce,A.asn1.x509.Extension),A.asn1.x509.OCSPNoCheck=function(t){A.asn1.x509.OCSPNoCheck.superclass.constructor.call(this,t),this.params=void 0,this.getExtnValueHex=function(){return this.asn1ExtnValue=new A.asn1.DERNull,this.asn1ExtnValue.getEncodedHex()},this.oid="1.3.6.1.5.5.7.48.1.5",null!=t&&(this.params=t)},Et(A.asn1.x509.OCSPNoCheck,A.asn1.x509.Extension),A.asn1.x509.AdobeTimeStamp=function(t){A.asn1.x509.AdobeTimeStamp.superclass.constructor.call(this,t);var e=A.asn1,i=e.DERInteger,n=e.DERBoolean,r=e.DERSequence,o=e.x509.GeneralName;this.params=null,this.getExtnValueHex=function(){var t=this.params,e=[new i(1)];return e.push(new o({uri:t.uri})),null!=t.reqauth&&e.push(new n(t.reqauth)),this.asn1ExtnValue=new r({array:e}),this.asn1ExtnValue.getEncodedHex()},this.oid="1.2.840.113583.1.1.9.1",void 0!==t&&this.setByParam(t)},Et(A.asn1.x509.AdobeTimeStamp,A.asn1.x509.Extension),A.asn1.x509.X500Name=function(t){A.asn1.x509.X500Name.superclass.constructor.call(this),this.asn1Array=[],this.paramArray=[],this.sRule="utf8";var e=A.asn1,i=e.x509,n=i.RDN;this.setByString=function(t,e){void 0!==e&&(this.sRule=e);var i=t.split("/");i.shift();for(var r=[],o=0;o<i.length;o++)if(i[o].match(/^[^=]+=.+$/))r.push(i[o]);else{var s=r.length-1;r[s]=r[s]+"/"+i[o]}for(o=0;o<r.length;o++)this.asn1Array.push(new n({str:r[o],rule:this.sRule}))},this.setByLdapString=function(t,e){void 0!==e&&(this.sRule=e);var n=i.X500Name.ldapToCompat(t);this.setByString(n,e)},this.setByObject=function(t,e){for(var i in void 0!==e&&(this.sRule=e),t)if(t.hasOwnProperty(i)){var r=new n({str:i+"="+t[i],rule:this.sRule});this.asn1Array?this.asn1Array.push(r):this.asn1Array=[r]}},this.setByParam=function(t){var e;void 0!==t.rule&&(this.sRule=t.rule),void 0!==t.array?this.paramArray=t.array:void 0!==t.str?this.setByString(t.str):void 0!==t.ldapstr?this.setByLdapString(t.ldapstr):void 0!==t.hex?this.hTLV=t.hex:void 0!==t.certissuer?((e=new Mt).readCertPEM(t.certissuer),this.hTLV=e.getIssuerHex()):void 0!==t.certsubject?((e=new Mt).readCertPEM(t.certsubject),this.hTLV=e.getSubjectHex()):"object"==typeof t&&void 0===t.certsubject&&void 0===t.certissuer&&this.setByObject(t)},this.getEncodedHex=function(){if("string"==typeof this.hTLV)return this.hTLV;if(0==this.asn1Array.length&&this.paramArray.length>0)for(var t=0;t<this.paramArray.length;t++){var i={array:this.paramArray[t]};"utf8"!=this.sRule&&(i.rule=this.sRule);var r=new n(i);this.asn1Array.push(r)}var o=new e.DERSequence({array:this.asn1Array});return this.hTLV=o.getEncodedHex(),this.hTLV},void 0!==t&&this.setByParam(t)},Et(A.asn1.x509.X500Name,A.asn1.ASN1Object),A.asn1.x509.X500Name.compatToLDAP=function(t){if("/"!==t.substr(0,1))throw"malformed input";var e=(t=t.substr(1)).split("/");return e.reverse(),(e=e.map((function(t){return t.replace(/,/,"\\,")}))).join(",")},A.asn1.x509.X500Name.onelineToLDAP=function(t){return A.asn1.x509.X500Name.compatToLDAP(t)},A.asn1.x509.X500Name.ldapToCompat=function(t){for(var e=t.split(","),i=!1,n=[],r=0;e.length>0;r++){var o=e.shift();if(!0===i){var s=(n.pop()+","+o).replace(/\\,/g,",");n.push(s),i=!1}else n.push(o);"\\"===o.substr(-1,1)&&(i=!0)}return(n=n.map((function(t){return t.replace("/","\\/")}))).reverse(),"/"+n.join("/")},A.asn1.x509.X500Name.ldapToOneline=function(t){return A.asn1.x509.X500Name.ldapToCompat(t)},A.asn1.x509.RDN=function(t){A.asn1.x509.RDN.superclass.constructor.call(this),this.asn1Array=[],this.paramArray=[],this.sRule="utf8";var e=A.asn1.x509.AttributeTypeAndValue;this.setByParam=function(t){void 0!==t.rule&&(this.sRule=t.rule),void 0!==t.str&&this.addByMultiValuedString(t.str),void 0!==t.array&&(this.paramArray=t.array)},this.addByString=function(t){this.asn1Array.push(new A.asn1.x509.AttributeTypeAndValue({str:t,rule:this.sRule}))},this.addByMultiValuedString=function(t){for(var e=A.asn1.x509.RDN.parseString(t),i=0;i<e.length;i++)this.addByString(e[i])},this.getEncodedHex=function(){if(0==this.asn1Array.length&&this.paramArray.length>0)for(var t=0;t<this.paramArray.length;t++){var i=this.paramArray[t];void 0!==i.rule&&"utf8"!=this.sRule&&(i.rule=this.sRule);var n=new e(i);this.asn1Array.push(n)}var r=new A.asn1.DERSet({array:this.asn1Array});return this.TLV=r.getEncodedHex(),this.TLV},void 0!==t&&this.setByParam(t)},Et(A.asn1.x509.RDN,A.asn1.ASN1Object),A.asn1.x509.RDN.parseString=function(t){for(var e=t.split(/\+/),i=!1,n=[],r=0;e.length>0;r++){var o=e.shift();if(!0===i){var s=(n.pop()+"+"+o).replace(/\\\+/g,"+");n.push(s),i=!1}else n.push(o);"\\"===o.substr(-1,1)&&(i=!0)}var a=!1,u=[];for(r=0;n.length>0;r++){if(o=n.shift(),!0===a){var h=u.pop();o.match(/"$/)?(s=(h+"+"+o).replace(/^([^=]+)="(.*)"$/,"$1=$2"),u.push(s),a=!1):u.push(h+"+"+o)}else u.push(o);o.match(/^[^=]+="/)&&(a=!0)}return u},A.asn1.x509.AttributeTypeAndValue=function(t){A.asn1.x509.AttributeTypeAndValue.superclass.constructor.call(this),this.sRule="utf8",this.sType=null,this.sValue=null,this.dsType=null;var e=A,i=e.asn1,n=i.DERSequence,r=i.DERUTF8String,o=i.DERPrintableString,s=i.DERTeletexString,a=i.DERIA5String,u=i.DERVisibleString,h=i.DERBMPString,l=e.lang.String.isMail,c=e.lang.String.isPrintable;this.setByParam=function(t){if(void 0!==t.rule&&(this.sRule=t.rule),void 0!==t.ds&&(this.dsType=t.ds),void 0===t.value&&void 0!==t.str){var e=t.str.match(/^([^=]+)=(.+)$/);if(!e)throw new Error("malformed attrTypeAndValueStr: "+attrTypeAndValueStr);this.sType=e[1],this.sValue=e[2]}else this.sType=t.type,this.sValue=t.value},this.setByString=function(t,e){void 0!==e&&(this.sRule=e);var i=t.match(/^([^=]+)=(.+)$/);if(!i)throw new Error("malformed attrTypeAndValueStr: "+attrTypeAndValueStr);this.setByAttrTypeAndValueStr(i[1],i[2])},this._getDsType=function(){var t=this.sType,e=this.sValue,i=this.sRule;return"prn"===i?"CN"==t&&l(e)?"ia5":c(e)?"prn":"utf8":"utf8"===i?"CN"==t&&l(e)?"ia5":"C"==t?"prn":"utf8":"utf8"},this.setByAttrTypeAndValueStr=function(t,e,i){void 0!==i&&(this.sRule=i),this.sType=t,this.sValue=e},this.getValueObj=function(t,e){if("utf8"==t)return new r({str:e});if("prn"==t)return new o({str:e});if("tel"==t)return new s({str:e});if("ia5"==t)return new a({str:e});if("vis"==t)return new u({str:e});if("bmp"==t)return new h({str:e});throw new Error("unsupported directory string type: type="+t+" value="+e)},this.getEncodedHex=function(){null==this.dsType&&(this.dsType=this._getDsType());var t=A.asn1.x509.OID.atype2obj(this.sType),e=this.getValueObj(this.dsType,this.sValue),i=new n({array:[t,e]});return this.TLV=i.getEncodedHex(),this.TLV},void 0!==t&&this.setByParam(t)},Et(A.asn1.x509.AttributeTypeAndValue,A.asn1.ASN1Object),A.asn1.x509.SubjectPublicKeyInfo=function(t){A.asn1.x509.SubjectPublicKeyInfo.superclass.constructor.call(this);var e=A,i=e.asn1,n=i.DERInteger,r=i.DERBitString,o=i.DERObjectIdentifier,s=i.DERSequence,a=i.ASN1Util.newObject,u=i.x509.AlgorithmIdentifier,h=e.crypto;h.ECDSA,h.DSA,this.getASN1Object=function(){if(null==this.asn1AlgId||null==this.asn1SubjPKey)throw"algId and/or subjPubKey not set";return new s({array:[this.asn1AlgId,this.asn1SubjPKey]})},this.getEncodedHex=function(){var t=this.getASN1Object();return this.hTLV=t.getEncodedHex(),this.hTLV},this.setPubKey=function(t){try{if(t instanceof et){var e=a({seq:[{int:{bigint:t.n}},{int:{int:t.e}}]}).getEncodedHex();this.asn1AlgId=new u({name:"rsaEncryption"}),this.asn1SubjPKey=new r({hex:"00"+e})}}catch(t){}try{if(t instanceof A.crypto.ECDSA){var i=new o({name:t.curveName});this.asn1AlgId=new u({name:"ecPublicKey",asn1params:i}),this.asn1SubjPKey=new r({hex:"00"+t.pubKeyHex})}}catch(t){}try{if(t instanceof A.crypto.DSA){i=new a({seq:[{int:{bigint:t.p}},{int:{bigint:t.q}},{int:{bigint:t.g}}]}),this.asn1AlgId=new u({name:"dsa",asn1params:i});var s=new n({bigint:t.y});this.asn1SubjPKey=new r({hex:"00"+s.getEncodedHex()})}}catch(t){}},void 0!==t&&this.setPubKey(t)},Et(A.asn1.x509.SubjectPublicKeyInfo,A.asn1.ASN1Object),A.asn1.x509.Time=function(t){A.asn1.x509.Time.superclass.constructor.call(this);var e=A.asn1,i=e.DERUTCTime,n=e.DERGeneralizedTime;this.setTimeParams=function(t){this.timeParams=t},this.getEncodedHex=function(){var t=null;return t=null!=this.timeParams?"utc"==this.type?new i(this.timeParams):new n(this.timeParams):"utc"==this.type?new i:new n,this.TLV=t.getEncodedHex(),this.TLV},this.type="utc",void 0!==t&&(void 0!==t.type?this.type=t.type:void 0!==t.str&&(t.str.match(/^[0-9]{12}Z$/)&&(this.type="utc"),t.str.match(/^[0-9]{14}Z$/)&&(this.type="gen")),this.timeParams=t)},Et(A.asn1.x509.Time,A.asn1.ASN1Object),A.asn1.x509.AlgorithmIdentifier=function(t){A.asn1.x509.AlgorithmIdentifier.superclass.constructor.call(this),this.nameAlg=null,this.asn1Alg=null,this.asn1Params=null,this.paramEmpty=!1;var e=A.asn1,i=e.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 t=null;for(var n in i)n===this.nameAlg&&(t=i[n]);if(null!==t)return this.hTLV=t,this.hTLV}null!==this.nameAlg&&null===this.asn1Alg&&(this.asn1Alg=e.x509.OID.name2obj(this.nameAlg));var r=[this.asn1Alg];null!==this.asn1Params&&r.push(this.asn1Params);var o=new e.DERSequence({array:r});return this.hTLV=o.getEncodedHex(),this.hTLV},void 0!==t&&(void 0!==t.name&&(this.nameAlg=t.name),void 0!==t.asn1params&&(this.asn1Params=t.asn1params),void 0!==t.paramempty&&(this.paramEmpty=t.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 e.DERNull)}},Et(A.asn1.x509.AlgorithmIdentifier,A.asn1.ASN1Object),A.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV={SHAwithRSAandMGF1:"300d06092a864886f70d01010a3000",SHA256withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040201a11a301806092a864886f70d010108300b0609608648016503040201a203020120",SHA384withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040202a11a301806092a864886f70d010108300b0609608648016503040202a203020130",SHA512withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040203a11a301806092a864886f70d010108300b0609608648016503040203a203020140"},A.asn1.x509.GeneralName=function(t){A.asn1.x509.GeneralName.superclass.constructor.call(this);var e={rfc822:"81",dns:"82",dn:"a4",uri:"86",ip:"87"},i=A.asn1,n=(i.DERSequence,i.DEROctetString),r=i.DERIA5String,o=i.DERTaggedObject,s=i.ASN1Object,a=i.x509.X500Name,u=At;this.explicit=!1,this.setByParam=function(t){var i=null;if(void 0!==t){if(void 0!==t.rfc822&&(this.type="rfc822",i=new r({str:t[this.type]})),void 0!==t.dns&&(this.type="dns",i=new r({str:t[this.type]})),void 0!==t.uri&&(this.type="uri",i=new r({str:t[this.type]})),void 0!==t.dn&&(this.type="dn",this.explicit=!0,i="string"==typeof t.dn?new a({str:t.dn}):t.dn instanceof A.asn1.x509.X500Name?t.dn:new a(t.dn)),void 0!==t.ldapdn&&(this.type="dn",this.explicit=!0,i=new a({ldapstr:t.ldapdn})),void 0!==t.certissuer){this.type="dn",this.explicit=!0;var h=null;if((c=t.certissuer).match(/^[0-9A-Fa-f]+$/),-1!=c.indexOf("-----BEGIN ")&&(h=u(c)),null==h)throw"certissuer param not cert";(d=new Mt).hex=h;var l=d.getIssuerHex();(i=new s).hTLV=l}if(void 0!==t.certsubj){var c,d;if(this.type="dn",this.explicit=!0,h=null,(c=t.certsubj).match(/^[0-9A-Fa-f]+$/),-1!=c.indexOf("-----BEGIN ")&&(h=u(c)),null==h)throw"certsubj param not cert";(d=new Mt).hex=h,l=d.getSubjectHex(),(i=new s).hTLV=l}if(void 0!==t.ip){this.type="ip",this.explicit=!1;var p,f=t.ip,g="malformed IP address";if(f.match(/^[0-9.]+[.][0-9.]+$/)){if(8!==(p=function(t){t=(t=(t=t.replace(/^\s*\[\s*/,"")).replace(/\s*\]\s*$/,"")).replace(/\s*/g,"");try{return t.split(/,/).map((function(t,e,i){var n=parseInt(t);if(n<0||255<n)throw"integer not in range 0-255";return("00"+n.toString(16)).slice(-2)})).join("")}catch(t){throw"malformed integer array string: "+t}}("["+f.split(".").join(",")+"]")).length)throw g}else if(f.match(/^[0-9A-Fa-f:]+:[0-9A-Fa-f:]+$/))p=function(t){var e="malformed IPv6 address";if(!t.match(/^[0-9A-Fa-f:]+$/))throw e;var i=(t=t.toLowerCase()).split(":").length-1;if(i<2)throw e;var n=":".repeat(7-i+2),r=(t=t.replace("::",n)).split(":");if(8!=r.length)throw e;for(var o=0;o<8;o++)r[o]=("0000"+r[o]).slice(-4);return r.join("")}(f);else{if(!f.match(/^([0-9A-Fa-f][0-9A-Fa-f]){1,}$/))throw g;p=f}i=new n({hex:p})}if(null==this.type)throw"unsupported type in params="+t;this.asn1Obj=new o({explicit:this.explicit,tag:e[this.type],obj:i})}},this.getEncodedHex=function(){return this.asn1Obj.getEncodedHex()},void 0!==t&&this.setByParam(t)},Et(A.asn1.x509.GeneralName,A.asn1.ASN1Object),A.asn1.x509.GeneralNames=function(t){A.asn1.x509.GeneralNames.superclass.constructor.call(this);var e=A.asn1;this.setByParamArray=function(t){for(var i=0;i<t.length;i++){var n=new e.x509.GeneralName(t[i]);this.asn1Array.push(n)}},this.getEncodedHex=function(){return new e.DERSequence({array:this.asn1Array}).getEncodedHex()},this.asn1Array=new Array,void 0!==t&&this.setByParamArray(t)},Et(A.asn1.x509.GeneralNames,A.asn1.ASN1Object),A.asn1.x509.OID=new function(t){this.atype2oidList={CN:"2.5.4.3",L:"2.5.4.7",ST:"2.5.4.8",O:"2.5.4.10",OU:"2.5.4.11",C:"2.5.4.6",STREET:"2.5.4.9",DC:"0.9.2342.19200300.100.1.25",UID:"0.9.2342.19200300.100.1.1",SN:"2.5.4.4",T:"2.5.4.12",DN:"2.5.4.49",E:"1.2.840.113549.1.9.1",description:"2.5.4.13",businessCategory:"2.5.4.15",postalCode:"2.5.4.17",serialNumber:"2.5.4.5",uniqueIdentifier:"2.5.4.45",organizationIdentifier:"2.5.4.97",jurisdictionOfIncorporationL:"1.3.6.1.4.1.311.60.2.1.1",jurisdictionOfIncorporationSP:"1.3.6.1.4.1.311.60.2.1.2",jurisdictionOfIncorporationC:"1.3.6.1.4.1.311.60.2.1.3"},this.name2oidList={sha1:"1.3.14.3.2.26",sha256:"2.16.840.1.101.3.4.2.1",sha384:"2.16.840.1.101.3.4.2.2",sha512:"2.16.840.1.101.3.4.2.3",sha224:"2.16.840.1.101.3.4.2.4",md5:"1.2.840.113549.2.5",md2:"1.3.14.7.2.2.1",ripemd160:"1.3.36.3.2.1",MD2withRSA:"1.2.840.113549.1.1.2",MD4withRSA:"1.2.840.113549.1.1.3",MD5withRSA:"1.2.840.113549.1.1.4",SHA1withRSA:"1.2.840.113549.1.1.5","pkcs1-MGF":"1.2.840.113549.1.1.8",rsaPSS:"1.2.840.113549.1.1.10",SHA224withRSA:"1.2.840.113549.1.1.14",SHA256withRSA:"1.2.840.113549.1.1.11",SHA384withRSA:"1.2.840.113549.1.1.12",SHA512withRSA:"1.2.840.113549.1.1.13",SHA1withECDSA:"1.2.840.10045.4.1",SHA224withECDSA:"1.2.840.10045.4.3.1",SHA256withECDSA:"1.2.840.10045.4.3.2",SHA384withECDSA:"1.2.840.10045.4.3.3",SHA512withECDSA:"1.2.840.10045.4.3.4",dsa:"1.2.840.10040.4.1",SHA1withDSA:"1.2.840.10040.4.3",SHA224withDSA:"2.16.840.1.101.3.4.3.1",SHA256withDSA:"2.16.840.1.101.3.4.3.2",rsaEncryption:"1.2.840.113549.1.1.1",commonName:"2.5.4.3",countryName:"2.5.4.6",localityName:"2.5.4.7",stateOrProvinceName:"2.5.4.8",streetAddress:"2.5.4.9",organizationName:"2.5.4.10",organizationalUnitName:"2.5.4.11",domainComponent:"0.9.2342.19200300.100.1.25",userId:"0.9.2342.19200300.100.1.1",surname:"2.5.4.4",givenName:"2.5.4.42",title:"2.5.4.12",distinguishedName:"2.5.4.49",emailAddress:"1.2.840.113549.1.9.1",description:"2.5.4.13",businessCategory:"2.5.4.15",postalCode:"2.5.4.17",uniqueIdentifier:"2.5.4.45",organizationIdentifier:"2.5.4.97",jurisdictionOfIncorporationL:"1.3.6.1.4.1.311.60.2.1.1",jurisdictionOfIncorporationSP:"1.3.6.1.4.1.311.60.2.1.2",jurisdictionOfIncorporationC:"1.3.6.1.4.1.311.60.2.1.3",subjectDirectoryAttributes:"2.5.29.9",subjectKeyIdentifier:"2.5.29.14",keyUsage:"2.5.29.15",subjectAltName:"2.5.29.17",issuerAltName:"2.5.29.18",basicConstraints:"2.5.29.19",cRLNumber:"2.5.29.20",cRLReason:"2.5.29.21",nameConstraints:"2.5.29.30",cRLDistributionPoints:"2.5.29.31",certificatePolicies:"2.5.29.32",anyPolicy:"2.5.29.32.0",authorityKeyIdentifier:"2.5.29.35",policyConstraints:"2.5.29.36",extKeyUsage:"2.5.29.37",authorityInfoAccess:"1.3.6.1.5.5.7.1.1",ocsp:"1.3.6.1.5.5.7.48.1",ocspBasic:"1.3.6.1.5.5.7.48.1.1",ocspNonce:"1.3.6.1.5.5.7.48.1.2",ocspNoCheck:"1.3.6.1.5.5.7.48.1.5",caIssuers:"1.3.6.1.5.5.7.48.2",anyExtendedKeyUsage:"2.5.29.37.0",serverAuth:"1.3.6.1.5.5.7.3.1",clientAuth:"1.3.6.1.5.5.7.3.2",codeSigning:"1.3.6.1.5.5.7.3.3",emailProtection:"1.3.6.1.5.5.7.3.4",timeStamping:"1.3.6.1.5.5.7.3.8",ocspSigning:"1.3.6.1.5.5.7.3.9",dateOfBirth:"1.3.6.1.5.5.7.9.1",placeOfBirth:"1.3.6.1.5.5.7.9.2",gender:"1.3.6.1.5.5.7.9.3",countryOfCitizenship:"1.3.6.1.5.5.7.9.4",countryOfResidence:"1.3.6.1.5.5.7.9.5",ecPublicKey:"1.2.840.10045.2.1","P-256":"1.2.840.10045.3.1.7",secp256r1:"1.2.840.10045.3.1.7",secp256k1:"1.3.132.0.10",secp384r1:"1.3.132.0.34",pkcs5PBES2:"1.2.840.113549.1.5.13",pkcs5PBKDF2:"1.2.840.113549.1.5.12","des-EDE3-CBC":"1.2.840.113549.3.7",data:"1.2.840.113549.1.7.1","signed-data":"1.2.840.113549.1.7.2","enveloped-data":"1.2.840.113549.1.7.3","digested-data":"1.2.840.113549.1.7.5","encrypted-data":"1.2.840.113549.1.7.6","authenticated-data":"1.2.840.113549.1.9.16.1.2",tstinfo:"1.2.840.113549.1.9.16.1.4",signingCertificate:"1.2.840.113549.1.9.16.2.12",timeStampToken:"1.2.840.113549.1.9.16.2.14",signaturePolicyIdentifier:"1.2.840.113549.1.9.16.2.15",etsArchiveTimeStamp:"1.2.840.113549.1.9.16.2.27",signingCertificateV2:"1.2.840.113549.1.9.16.2.47",etsArchiveTimeStampV2:"1.2.840.113549.1.9.16.2.48",extensionRequest:"1.2.840.113549.1.9.14",contentType:"1.2.840.113549.1.9.3",messageDigest:"1.2.840.113549.1.9.4",signingTime:"1.2.840.113549.1.9.5",counterSignature:"1.2.840.113549.1.9.6",archiveTimeStampV3:"0.4.0.1733.2.4",pdfRevocationInfoArchival:"1.2.840.113583.1.1.8",adobeTimeStamp:"1.2.840.113583.1.1.9.1"},this.objCache={},this.name2obj=function(t){if(void 0!==this.objCache[t])return this.objCache[t];if(void 0===this.name2oidList[t])throw"Name of ObjectIdentifier not defined: "+t;var e=this.name2oidList[t],i=new A.asn1.DERObjectIdentifier({oid:e});return this.objCache[t]=i,i},this.atype2obj=function(t){if(void 0!==this.objCache[t])return this.objCache[t];var e;if(t.match(/^\d+\.\d+\.[0-9.]+$/))e=t;else if(void 0!==this.atype2oidList[t])e=this.atype2oidList[t];else{if(void 0===this.name2oidList[t])throw"AttributeType name undefined: "+t;e=this.name2oidList[t]}var i=new A.asn1.DERObjectIdentifier({oid:e});return this.objCache[t]=i,i}},A.asn1.x509.OID.oid2name=function(t){var e=A.asn1.x509.OID.name2oidList;for(var i in e)if(e[i]==t)return i;return""},A.asn1.x509.OID.oid2atype=function(t){var e=A.asn1.x509.OID.atype2oidList;for(var i in e)if(e[i]==t)return i;return t},A.asn1.x509.OID.name2oid=function(t){if(t.match(/^[0-9.]+$/))return t;var e=A.asn1.x509.OID.name2oidList;return void 0===e[t]?"":e[t]},A.asn1.x509.X509Util={},A.asn1.x509.X509Util.newCertPEM=function(t){var e=A.asn1.x509;return e.TBSCertificate,new(0,e.Certificate)(t).getPEM()},et.getPosArrayOfChildrenFromHex=function(t){return It.getChildIdx(t,0)},et.getHexValueArrayOfChildrenFromHex=function(t){var e,i=It.getV,n=i(t,(e=et.getPosArrayOfChildrenFromHex(t))[0]),r=i(t,e[1]),o=i(t,e[2]),s=i(t,e[3]),a=i(t,e[4]),u=i(t,e[5]),h=i(t,e[6]),l=i(t,e[7]),c=i(t,e[8]);return(e=new Array).push(n,r,o,s,a,u,h,l,c),e},et.prototype.readPrivateKeyFromPEMString=function(t){var e=At(t),i=et.getHexValueArrayOfChildrenFromHex(e);this.setPrivateEx(i[1],i[2],i[3],i[4],i[5],i[6],i[7],i[8])},et.prototype.readPKCS5PrvKeyHex=function(t){var e=et.getHexValueArrayOfChildrenFromHex(t);this.setPrivateEx(e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},et.prototype.readPKCS8PrvKeyHex=function(t){var e,i,n,r,o,s,a,u,h=It,l=h.getVbyListEx;if(!1===h.isASN1HEX(t))throw new Error("not ASN.1 hex string");try{e=l(t,0,[2,0,1],"02"),i=l(t,0,[2,0,2],"02"),n=l(t,0,[2,0,3],"02"),r=l(t,0,[2,0,4],"02"),o=l(t,0,[2,0,5],"02"),s=l(t,0,[2,0,6],"02"),a=l(t,0,[2,0,7],"02"),u=l(t,0,[2,0,8],"02")}catch(t){throw new Error("malformed PKCS#8 plain RSA private key")}this.setPrivateEx(e,i,n,r,o,s,a,u)},et.prototype.readPKCS5PubKeyHex=function(t){var e=It,i=e.getV;if(!1===e.isASN1HEX(t))throw new Error("keyHex is not ASN.1 hex string");var n=e.getChildIdx(t,0);if(2!==n.length||"02"!==t.substr(n[0],2)||"02"!==t.substr(n[1],2))throw new Error("wrong hex for PKCS#5 public key");var r=i(t,n[0]),o=i(t,n[1]);this.setPublic(r,o)},et.prototype.readPKCS8PubKeyHex=function(t){var e=It;if(!1===e.isASN1HEX(t))throw new Error("not ASN.1 hex string");if("06092a864886f70d010101"!==e.getTLVbyListEx(t,0,[0,0]))throw new Error("not PKCS8 RSA public key");var i=e.getTLVbyListEx(t,0,[1,0]);this.readPKCS5PubKeyHex(i)},et.prototype.readCertPubKeyHex=function(t,e){var i,n;(i=new Mt).readCertHex(t),n=i.getPublicKeyHex(),this.readPKCS8PubKeyHex(n)},et.prototype.sign=function(t,e){var i=function(t){return A.crypto.Util.hashString(t,e)}(t);return this.signWithMessageHash(i,e)},et.prototype.signWithMessageHash=function(t,e){var i=$(A.crypto.Util.getPaddedDigestInfoHex(t,e,this.n.bitLength()),16);return Ct(this.doPrivate(i).toString(16),this.n.bitLength())},et.prototype.signPSS=function(t,e,i){var n,r=(n=dt(t),A.crypto.Util.hashHex(n,e));return void 0===i&&(i=-1),this.signWithMessageHashPSS(r,e,i)},et.prototype.signWithMessageHashPSS=function(t,e,i){var n,r=ct(t),o=r.length,s=this.n.bitLength()-1,a=Math.ceil(s/8),u=function(t){return A.crypto.Util.hashHex(t,e)};if(-1===i||void 0===i)i=o;else if(-2===i)i=a-o-2;else if(i<-2)throw new Error("invalid salt length");if(a<o+i+2)throw new Error("data too long");var h="";i>0&&(h=new Array(i),(new J).nextBytes(h),h=String.fromCharCode.apply(String,h));var l=ct(u(dt("\0\0\0\0\0\0\0\0"+r+h))),c=[];for(n=0;n<a-i-o-2;n+=1)c[n]=0;var d=String.fromCharCode.apply(String,c)+""+h,p=St(l,d.length,u),f=[];for(n=0;n<d.length;n+=1)f[n]=d.charCodeAt(n)^p.charCodeAt(n);var g=65280>>8*a-s&255;for(f[0]&=~g,n=0;n<o;n++)f.push(l.charCodeAt(n));return f.push(188),Ct(this.doPrivate(new v(f)).toString(16),this.n.bitLength())},et.prototype.verify=function(t,e){if(null==(e=e.toLowerCase()).match(/^[0-9a-f]+$/))return!1;var i=$(e,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 o=Bt(r.replace(/^1f+00/,""));if(0==o.length)return!1;var s=o[0];return o[1]==function(t){return A.crypto.Util.hashString(t,s)}(t)},et.prototype.verifyWithMessageHash=function(t,e){if(e.length!=Math.ceil(this.n.bitLength()/4))return!1;var i=$(e,16);if(i.bitLength()>this.n.bitLength())return 0;var n=Bt(this.doPublic(i).toString(16).replace(/^1f+00/,""));return 0!=n.length&&(n[0],n[1]==t)},et.prototype.verifyPSS=function(t,e,i,n){var r,o=(r=dt(t),A.crypto.Util.hashHex(r,i));return void 0===n&&(n=-1),this.verifyWithMessageHashPSS(o,e,i,n)},et.prototype.verifyWithMessageHashPSS=function(t,e,i,n){if(e.length!=Math.ceil(this.n.bitLength()/4))return!1;var r,o=new v(e,16),s=function(t){return A.crypto.Util.hashHex(t,i)},a=ct(t),u=a.length,h=this.n.bitLength()-1,l=Math.ceil(h/8);if(-1===n||void 0===n)n=u;else if(-2===n)n=l-u-2;else if(n<-2)throw new Error("invalid salt length");if(l<u+n+2)throw new Error("data too long");var c=this.doPublic(o).toByteArray();for(r=0;r<c.length;r+=1)c[r]&=255;for(;c.length<l;)c.unshift(0);if(188!==c[l-1])throw new Error("encoded message does not end in 0xbc");var d=(c=String.fromCharCode.apply(String,c)).substr(0,l-u-1),p=c.substr(d.length,u),f=65280>>8*l-h&255;if(0!=(d.charCodeAt(0)&f))throw new Error("bits beyond keysize not zero");var g=St(p,d.length,s),m=[];for(r=0;r<d.length;r+=1)m[r]=d.charCodeAt(r)^g.charCodeAt(r);m[0]&=~f;var y=l-u-n-2;for(r=0;r<y;r+=1)if(0!==m[r])throw new Error("leftmost octets not zero");if(1!==m[y])throw new Error("0x01 marker not found");return p===ct(s(dt("\0\0\0\0\0\0\0\0"+a+String.fromCharCode.apply(String,m.slice(-n)))))},et.SALT_LEN_HLEN=-1,et.SALT_LEN_MAX=-2,et.SALT_LEN_RECOVER=-2,Mt.hex2dn=function(t,e){void 0===e&&(e=0);var i=new Mt;return It.getTLV(t,e),i.getX500Name(t).str},Mt.hex2rdn=function(t,e){if(void 0===e&&(e=0),"31"!==t.substr(e,2))throw new Error("malformed RDN");for(var i=new Array,n=It.getChildIdx(t,e),r=0;r<n.length;r++)i.push(Mt.hex2attrTypeValue(t,n[r]));return(i=i.map((function(t){return t.replace("+","\\+")}))).join("+")},Mt.hex2attrTypeValue=function(t,e){var i=It,n=i.getV;if(void 0===e&&(e=0),"30"!==t.substr(e,2))throw new Error("malformed attribute type and value");var r=i.getChildIdx(t,e);2!==r.length||t.substr(r[0],2);var o=n(t,r[0]),s=A.asn1.ASN1Util.oidHexToInt(o);return A.asn1.x509.OID.oid2atype(s)+"="+ct(n(t,r[1]))},Mt.getPublicKeyFromCertHex=function(t){var e=new Mt;return e.readCertHex(t),e.getPublicKey()},Mt.getPublicKeyFromCertPEM=function(t){var e=new Mt;return e.readCertPEM(t),e.getPublicKey()},Mt.getPublicKeyInfoPropOfCertPEM=function(t){var e,i,n=It.getVbyList,r={algparam:null};return(e=new Mt).readCertPEM(t),i=e.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},Mt.KEYUSAGE_NAME=["digitalSignature","nonRepudiation","keyEncipherment","dataEncipherment","keyAgreement","keyCertSign","cRLSign","encipherOnly","decipherOnly"];var Tt,Rt=[(Tt=new Mt,Tt.readCertPEM(function(){for(var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pFz\b=OwT``fNJJ:::::R[Q-PR_aVSVPNaR:::::")),Tt)];function kt(t,e){var i=t.getIssuerHex();if(i===t.getSubjectHex())return t.verifySignature(t.getPublicKey());var n=function(t,e){for(var i=0,n=e;i<n.length;i++){var r=n[i];if(r.getSubjectHex()===t)return r}}(i,e);return!!n&&!1!==t.verifySignature(n.getPublicKey())&&kt(n,e)}function Qt(t){return t.getIssuerHex()!==t.getSubjectHex()&&kt(t,Rt)}!function(t){var e=new Mt;"string"==typeof t?e.readCertPEM(t):e.readCertHex(t.hex);Qt(e);Rt.push(e)}(function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var i=113,n=126,r=0,o="";return arguments[r].split(o).map((function(t){return t.charCodeAt(r)>n?t:String.fromCharCode((t.charCodeAt(r)+i)%n)})).join(o)}(":::::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^RSNN\\PNtENZVVPPtXPNtRN?=?]q[VD|{\\oyo`oOu}F\tSAe`tn[t\tu\b8^a]qx\bE_^ZN?[QC\0yuOpybY8r\\RPAS=8rUq\0E8>xean^e\bf]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EdfW?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 Dt=function(t,e){return(Dt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(t,e)};function Nt(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}Dt(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var Ft=function(){return(Ft=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};function Ot(t,e,i){if(i||2===arguments.length)for(var n,r=0,o=e.length;r<o;r++)!n&&r in e||(n||(n=Array.prototype.slice.call(e,0,r)),n[r]=e[r]);return t.concat(n||Array.prototype.slice.call(e))}Object.create,Object.create;var Lt,Vt=(Lt="$$FIVE_EVENT$$","undefined"==typeof Symbol?"$Symbol<".concat(Lt,">$"):Symbol(Lt));function Ht(t){return t[Vt]||(t[Vt]={}),t[Vt]}var zt=function(){function t(){}return t.prototype.hasListener=function(t){var e=Ht(this);return e&&e[t]&&e[t].length>0},t.prototype.on=function(t,e,i){var n=this,r=Ht(this);return r[t]||(r[t]=[]),r[t].push([e,i||!1]),function(){return n.off(t,e)}},t.prototype.once=function(t,e){return this.on(t,e,!0)},t.prototype.off=function(t,e){if(void 0!==t){var i=Ht(this);if(i[t]||(i[t]=[]),void 0!==e){for(var n=0;n<i[t].length&&i[t][n][0]!==e;n++);n<i[t].length&&i[t].splice(n,1)}else i[t].length=0}else this[Vt]||delete this[Vt]},t.prototype.emit=function(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];for(var n=!1,r=Ht(this),o=r[t]||[],s=0,a=o.slice();s<a.length;s++){var u=a[s],h=u[0],l=u[1],c=void 0!==l&&l,d=h.apply(void 0,e);c&&this.off(t,h),!1===d&&(n=!0)}return n},t}();function Kt(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e]}var qt="undefined"!=typeof performance&&void 0!==performance.timing?performance.timing.navigationStart:Date.now(),jt="undefined"!=typeof performance?function(){return qt+performance.now()}:function(){return Date.now()};function Ut(t){Object.freeze(t);var e="function"==typeof t,i=Object.prototype.hasOwnProperty;return Object.getOwnPropertyNames(t).forEach((function(n){!i.call(t,n)||e&&("caller"===n||"callee"===n||"arguments"===n)||null===t[n]||"object"!=typeof t[n]&&"function"!=typeof t[n]||Object.isFrozen(t[n])||Ut(t[n])})),t}var Gt=/^([^.]+)(\.([^.]+))*$/;function _t(t){return/^(([1-9]?\d|1\d\d|2[0-4]\d|25[0-5])(\.(?!$)|$)){4}$/.test(t)}function Wt(t,e){return Gt.test(t)&&Gt.test(e)&&function(t,e){if("*"===t)return!0;var i=t.split(".").reverse(),n=e.split(".").reverse();if(i.length<=1)return t===e;for(var r=0;r<i.length;r++)if(i[r]!==n[r])return!1;return!0}(t,e)}var Xt,Yt=[/\.([0-9a-z]+)\.jsonp([\?\#].*)?$/i,/jsonp_([0-9a-z]+)([\?\#].*)?$/i],Zt=Ut(JSON.parse(function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var i=113,n=126,r=0,o="";return arguments[r].split(o).map((function(t){return t.charCodeAt(r)>n?t:String.fromCharCode((t.charCodeAt(r)+i)%n)})).join(o)}("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"))),Jt=function(t){function e(e,i,n){return t.call(this,"[NETWORK]: response error(type: ".concat(i,", reason: ").concat(n,"): ").concat(e))||this}return Nt(e,t),e}(Error),$t=function(t){function e(e,i,n){var r=t.call(this,"[NETWORK]: response error(type: ".concat(i,", status: ").concat(n,"): ").concat(e))||this;return r.httpStatus=n,r}return Nt(e,t),e}(Error),te=(Nt((function(t,e){return Xt.call(this,"[NETWORK]: request abort(type: ".concat(e,"): ").concat(t))||this}),Xt=Error),function(t){function e(e,i,n){return t.call(this,"[NETWORK]: request timeout(type: ".concat(i,", timeout: ").concat(n,"ms): ").concat(e))||this}return Nt(e,t),e}(Error));function ee(t){for(var e=0,i=Yt;e<i.length;e++){var n=i[e],r=t.match(n);if(r)return"jsonp_"+r[1]}return null}function ie(t){return null!==ee(t)}function ne(t){return Yt.reduce((function(t,e){return t.replace(e,"")}),t)}function re(t){var e=t.match(/^[0-9a-z]+\:\/\/(([^:/?#]*)(?::[0-9]+)?)/);return e?e[2]:location.hostname}!function(t){Nt((function(e,i,n){return t.call(this,"[NETWORK]: request forbidden(type: ".concat(i,", reason: ").concat(n,"): ").concat(e))||this}),t)}(Error);var oe=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Nt(e,t),e}(zt);function se(t,e,i,n,r){return void 0===e&&(e={}),void 0===i&&(i=Kt),void 0===n&&(n=Kt),void 0===r&&(r=Kt),new Promise((function(o,s){var a,u=e.allowHosts?Zt.concat(e.allowHosts):Zt.slice(),h=re(t),l=ee(t);if(0!==location.hostname.length&&!_t(location.hostname)&&0===Zt.filter((function(t){return Wt(t,location.hostname)})).length&&!_t(h)&&0===u.filter((function(t){return Wt(t,h)})).length){var c=l?"Script":"XMLHttpRequest",d=new Jt(t,c,"request host(".concat(h,") is not allowed"));return n(d),s(d),void(null===(a=e.networkSubscribe)||void 0===a||a.emit("network",t,c,"forbidden",d.message))}if(l){var p=window,A=null,f=!1,g=jt(),v=document.createElement("script");p[l]=function(r){var a,u,h=jt(),c=h-g;if(delete p[l],v.parentNode&&v.parentNode.removeChild(v),null!==A&&(window.clearTimeout(A),A=null),!0!==f){if(0!==r.indexOf("data:")){var d=new $t(t,"Script",500);return n(d),s(d),void(null===(a=e.networkSubscribe)||void 0===a||a.emit("network",t,"Script","error",d.message))}var m=r.split(","),y=(m[0].match(/:(.*?);/)||[])[1],b=m[1];if("arraybuffer"===e.responseType||"blob"===e.responseType){for(var w=atob(m[1]),E=w.length,x=new Uint8Array(E),I=0;I<E;I++)x[I]=w.charCodeAt(I);b="arraybuffer"===e.responseType?x.buffer:new Blob([x],{type:y})}var C={body:b,meta:{source:t,requestTime:g,responseTime:h,costs:c,headers:{}}};i(C),o(C),null===(u=e.networkSubscribe)||void 0===u||u.emit("network",t,"Script","ok",JSON.stringify(C.meta)),f=!0}},v.src=t,document.body.appendChild(v),"number"==typeof e.timeout&&(A=window.setTimeout((function(){var i;if(A=null,!0!==f){f=!0;var r=new te(t,"Script",e.timeout||NaN);n(r),s(r),null===(i=e.networkSubscribe)||void 0===i||i.emit("network",t,"Script","timeout",r.message)}}),e.timeout))}else{var m=jt(),y=!1,b=new XMLHttpRequest,w=function(){b&&(b.removeEventListener("timeout",E,!1),b.removeEventListener("progress",x,!1),b.removeEventListener("load",I,!1),b.removeEventListener("error",C,!1)),b=null,w=Kt},E=function(){var i;if(!0!==y){y=!0,w();var r=new te(t,"XMLHttpRequest",e.timeout||NaN);n(r),s(r),null===(i=e.networkSubscribe)||void 0===i||i.emit("network",t,"XMLHttpRequest","timeout",r.message)}},x=function(t){!0!==y&&t.lengthComputable&&(t.total<=0||r(t.loaded/t.total))},I=function(n){var r;if(!0!==y){var s=this.status;if(0===s||s>=200&&s<400){y=!0,w();var a=jt(),u=a-m,h=function(t){if(!t)return{};for(var e={},i=t.trim().split("\n"),n=0;n<i.length;n++){var r=i[n],o=r.indexOf(":"),s=r.slice(0,o).trim().toLowerCase(),a=r.slice(o+1).trim();a&&(e[s]?e[s]+=", "+a:e[s]=a)}return e}(this.getAllResponseHeaders()),l=n.total,c={body:this.response,meta:{source:t,requestTime:m,responseTime:a,costs:u,headers:h,size:l}};i(c),o(c),null===(r=e.networkSubscribe)||void 0===r||r.emit("network",t,"XMLHttpRequest","ok",JSON.stringify(c.meta))}else C.call(this)}},C=function(){var i;if(!0!==y){y=!0,w();var r=new $t(t,"XMLHttpRequest",this.status);n(r),s(r),null===(i=e.networkSubscribe)||void 0===i||i.emit("network",t,"XMLHttpRequest","error",r.message)}};b.addEventListener("timeout",E,!1),b.addEventListener("progress",x,!1),b.addEventListener("load",I,!1),b.addEventListener("error",C,!1),e.responseType&&(b.responseType=e.responseType),"number"==typeof e.timeout&&(b.timeout=e.timeout),b.open("GET",t,!0),b.send(null)}}))}var ae={};function ue(t,e,i,n,r,o){return void 0===e&&(e={}),void 0===i&&(i=Kt),void 0===n&&(n=Kt),void 0===r&&(r=Kt),new Promise((function(s,a){var u,h=e.allowHosts?Zt.concat(e.allowHosts):Zt.slice(),l=re(t);if(0!==location.hostname.length&&!_t(location.hostname)&&0===Zt.filter((function(t){return Wt(t,location.hostname)})).length&&!_t(l)&&0===h.filter((function(t){return Wt(t,l)})).length){var c=new Jt(t,"Image","request host(".concat(l,") is not allowed"));return n(c),a(c),void(null===(u=e.networkSubscribe)||void 0===u||u.emit("network",t,"Image","forbidden",c.message))}var d=null!=o?o:new Image,p=jt(),A=!1,f=null;"number"==typeof e.timeout&&(f=window.setTimeout((function(){var i;if(d.onload=Kt,d.onerror=Kt,f=null,!0!==A){A=!0;var r=new te(t,"Image",e.timeout);n(r),a(r),null===(i=e.networkSubscribe)||void 0===i||i.emit("network",t,"Image","timeout",r.message)}}),e.timeout)),d.onload=function(){var n;if(d.onload=Kt,d.onerror=Kt,null!==f&&(clearTimeout(f),f=null),!0!==A){var o=jt();A=!0;var a={body:d,meta:{headers:{},source:t,requestTime:p,responseTime:o,costs:o-p}};r(1),i(a),s(a),null===(n=e.networkSubscribe)||void 0===n||n.emit("network",t,"Image","ok",JSON.stringify(a.meta))}},d.onerror=function(){var i;if(d.onload=Kt,d.onerror=Kt,null!==f&&(clearTimeout(f),f=null),!0!==A){A=!0;var r=new $t(t,"Image",0);n(r),a(r),null===(i=e.networkSubscribe)||void 0===i||i.emit("network",t,"Image","ok",r.message)}},r(0),d.src=t}))}var he=function(){if("undefined"!=typeof window){var t=window;return t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame||function(t){return setTimeout(t,16)}}return function(t){return setTimeout(t,16)}}(),le=16,ce=function(){function t(){this.frames=[],this.stoped=!1,this.time=jt(),this.loop=this.loop.bind(this),this.loop()}return Object.defineProperty(t,"shared",{get:function(){return this.sharedInstance||(this.sharedInstance=new t),this.sharedInstance},enumerable:!1,configurable:!0}),t.getFrameTime=function(){return le},t.prototype.loop=function(){if(!this.stoped){var t=jt(),e=t-this.time;this.time=t;var i=[];le=e;for(var n=0,r=this.frames;n<r.length;n++){var o=r[n];if(o.delay>0)o.delay=o.delay-1;else{try{o.callback(t,e)}catch(t){console.error(t)}o.once&&i.push(o)}}i.length>0&&(this.frames=this.frames.filter((function(t){return-1===i.indexOf(t)}))),he(this.loop)}},t.prototype.remove=function(t){var e=this.frames.indexOf(t);e>=0&&this.frames.splice(e,1)},t.prototype.add=function(t,e,i,n){var r=this;void 0===e&&(e=!1),void 0===i&&(i=0),void 0===n&&(n=5);var o={callback:t,once:e,delay:i,order:n};return this.frames.push(o),this.frames.sort((function(t,e){return t.order-e.order})),function(){return r.remove(o)}},t.prototype.disponse=function(){this.stoped=!0,this.frames.length=0},t}(),de="//vrlab-public.ljcdn.com/",pe="//vrlab-image[1-4].ljcdn.com/",Ae="//global-public.realsee-cdn.com/",fe="//global-image-[1-4].realsee-cdn.com/",ge="//test-vr-public.realsee-cdn.com/";function ve(t,e){var i,n=t.split("?")[0],r=n.split(".").pop();if("jpeg"===r&&(r="jpg"),"png"!==r&&"jpg"!==r)return t;var o="";if(void 0!==e.format&&e.format!==r&&(o+="/format/".concat(e.format)),void 0!==e.cut&&(o+="/cut/".concat(e.cut[2],"x").concat(e.cut[3],"x").concat(e.cut[0],"x").concat(e.cut[1])),void 0!==e.quality){var s=null!==(i=e.format)&&void 0!==i?i:r;s&&["jpg","webp","tpg","heif","avif"].indexOf(s)>=0&&(o+="/quality/".concat(e.quality))}if(void 0!==e.size){var a=t.match(/\/cube_(\d+)\//);(a?Number(a[1]):NaN)!==Number(e.size)&&(o+="/thumbnail/".concat(e.size,"x"))}return o.length&&(o="?imageMogr2"+o),n+o}function me(t,e){return t.indexOf(de)>=0?(/\.basis(\?|$)/.test(t)&&!0!==e.basisLoaderInitialized&&(t=t.replace(/\.basis(\?|$)/,".jpg$1")),ve(function(t,e){var i=e.split("."),n=i[0],r=i.slice(1);if("texture"===n)return t.replace(de,pe.replace("[1-4]","3"));if("pano"===n||"pano_luminance"===n)switch(r[0],r[1]){case"front":case"left":case"up":return t.replace(de,pe.replace("[1-4]","1"));case"down":case"right":case"back":return t.replace(de,pe.replace("[1-4]","2"))}else if("pano_tile"===n||"pano_tile_luminance"===n){r[0],r[1];var o=r[2],s=r[3],a=r[4],u=Math.pow(2,Number(o))*Number(s)+Number(a);if(!isNaN(u))return t.replace(de,"//vr-tile-[1-2].realsee-cdn.com/".replace("[1-2]",String(u%2+1)))}return t.replace(de,pe.replace("[1-4]","3"))}(t,e.key),e)):t.indexOf(Ae)>=0?(/\.basis(\?|$)/.test(t)&&!0!==e.basisLoaderInitialized&&(t=t.replace(/\.basis(\?|$)/,".jpg$1")),ve(function(t,e){var i=e.split("."),n=i[0],r=i.slice(1);if("texture"===n)return t.replace(Ae,fe.replace("[1-4]","3"));if("pano"===n||"pano_luminance"===n)switch(r[0],r[1]){case"front":case"left":case"up":return t.replace(Ae,fe.replace("[1-4]","1"));case"down":case"right":case"back":return t.replace(Ae,fe.replace("[1-4]","2"))}else if("pano_tile"===n||"pano_tile_luminance"===n){r[0],r[1];var o=r[2],s=r[3],a=r[4],u=Math.pow(2,Number(o))*Number(s)+Number(a);if(!isNaN(u))return t.replace(Ae,"//global-tile-[1-2].realsee-cdn.com/".replace("[1-2]",String(u%2+1)))}return t.replace(Ae,fe.replace("[1-4]","3"))}(t,e.key),e)):t.indexOf(ge)>=0?(/\.basis(\?|$)/.test(t)&&!0!==e.basisLoaderInitialized&&(t=t.replace(/\.basis(\?|$)/,".jpg$1")),ve((i=t,e.key,i.replace(ge,"//test-vr-image.realsee-cdn.com/")),e)):t;var i}var ye=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.floorIndex=0,e.needsRender=!0,e}return Nt(e,t),e}(t.Mesh),be=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.needsRender=!0,e.enableTransparent=!0,e}return Nt(e,t),e.prototype.getTransparent=function(){return this.enableTransparent},e.prototype.setTransparent=function(t){this.enableTransparent=t,this.traverse((function(e){e instanceof ye&&e.material.forEach((function(e){e.transparent=t}))}))},e.prototype.getMaterial=function(){var t=null;return this.traverse((function(e){if(null===t&&e instanceof ye){var i=e.material[0];t={pano0:i.pano0,pano1:i.pano1,modelAlpha:i.modelAlpha,progress:i.progress,useBlackTransition:i.useBlackTransition,perspToOrtho:i.perspToOrtho,opacity:i.opacity}}})),t},e.prototype.setMaterial=function(t){this.traverse((function(e){e instanceof ye&&e.material.forEach((function(e){void 0!==t.pano0&&(e.pano0=t.pano0),void 0!==t.pano1&&(e.pano1=t.pano1),void 0!==t.modelAlpha&&(e.modelAlpha=t.modelAlpha),void 0!==t.progress&&(e.progress=t.progress),void 0!==t.useBlackTransition&&(e.useBlackTransition=t.useBlackTransition),void 0!==t.perspToOrtho&&(e.perspToOrtho=t.perspToOrtho),void 0!==t.opacity&&(e.opacity=t.opacity)}))}))},e.prototype.disposeMaterial=function(){this.traverse((function(t){if(t instanceof ye){var e=[];t.material.forEach((function(t){var i=t.uniforms;Object.keys(i).map((function(t){if(/^pano\d\_/.test(t))i[t].value=null;else{var n=i[t].value;n&&"function"==typeof n.dispose&&-1===e.indexOf(n)&&(i[t].value=null,e.push(n))}})),t.dispose()})),e.forEach((function(t){return t.dispose()}))}}))},e.prototype.disposeGeometry=function(){this.traverse((function(t){t instanceof ye&&t.geometry.dispose()}))},e}(t.Group),we=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.floorIndex=0,e}return Nt(e,t),e}(be);const Ee=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var i=113,n=126,r=0,o="";return arguments[r].split(o).map((function(t){return t.charCodeAt(r)>n?t:String.fromCharCode((t.charCodeAt(r)+i)%n)})).join(o)}("{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"),xe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var i=113,n=126,r=0,o="";return arguments[r].split(o).map((function(t){return t.charCodeAt(r)>n?t:String.fromCharCode((t.charCodeAt(r)+i)%n)})).join(o)}("0qrsv{r-OYNPXlP\\Y\\_-rpA5=;=EC9-=;>=C9-=;>AF9->;=60qrsv{r-aNb-C;?E@>EB?{vs|z-nz}yrPor-}n{|=lzn}H{vs|z-znA-}n{|=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 Ie(){return"undefined"==typeof document?{}:document.createElementNS("http://www.w3.org/1999/xhtml","img")}var Ce=Ie();Ce.width=Ce.height=8;var Se=new t.Texture(Ce);Se.name="EMPTY_TEXTURE";var Be=new t.CubeTexture([Ce,Ce,Ce,Ce,Ce,Ce]);Be.name="EMPTY_CUBE_TEXTURE",Se.dispose=Be.dispose=function(){};var Me=Object.assign({modelAlpha:new t.Uniform(0),progress:new t.Uniform(0),pano0_map:new t.Uniform(Be),pano0_luminanceMap:new t.Uniform(null),pano0_matrix:new t.Uniform(new t.Matrix4),pano1_map:new t.Uniform(Be),pano1_luminanceMap:new t.Uniform(null),pano1_matrix:new t.Uniform(new t.Matrix4),modelCenter:new t.Uniform(new t.Vector3),perspToOrtho:new t.Uniform(0)},{exposure:new t.Uniform(1),emissive:new t.Uniform(new t.Color(0)),emissiveMap:new t.Uniform(null),specular:new t.Uniform(new t.Color(1118481)),specularMap:new t.Uniform(null),normalMap:new t.Uniform(null),bumpMap:new t.Uniform(null),shininess:new t.Uniform(30)},t.UniformsLib.common,t.UniformsLib.lights),Pe=function(e){function i(i){var n,r,o,s,a,u,h;void 0===i&&(i={});var l=e.call(this,{vertexShader:Ee,fragmentShader:xe,uniforms:t.UniformsUtils.clone(Me),defines:{USE_MAP:!0,USE_UV:!0,USE_LUMINANCE:!1,USE_BLACK_TRANSITION:!1,USE_PANO_VIDEO:!1},blending:t.NoBlending,lights:!0})||this;return Object.defineProperties(l,{pano0:{get:function(){return this.uniforms.pano0_map.value===Be?null:{map:this.uniforms.pano0_map.value,luminanceMap:this.uniforms.pano0_luminanceMap.value,matrix:this.uniforms.pano0_matrix.value.clone()}},set:function(t){null===t?(this.uniforms.pano0_map.value=Be,this.uniforms.pano0_luminanceMap.value=null,this.uniforms.pano0_matrix.value.identity()):(this.uniforms.pano0_map.value=t.map,this.uniforms.pano0_luminanceMap.value=t.luminanceMap,this.uniforms.pano0_matrix.value.copy(t.matrix));var e=null!==this.uniforms.pano0_luminanceMap.value&&null!==this.uniforms.pano1_luminanceMap.value;this.defines.USE_LUMINANCE!==e&&(this.defines.USE_LUMINANCE=e,this.needsUpdate=!0)}},pano1:{get:function(){return this.uniforms.pano1_map.value===Be?null:{map:this.uniforms.pano1_map.value,luminanceMap:this.uniforms.pano1_luminanceMap.value,matrix:this.uniforms.pano1_matrix.value.clone()}},set:function(t){null===t?(this.uniforms.pano1_map.value=Be,this.uniforms.pano1_luminanceMap.value=null,this.uniforms.pano1_matrix.value.identity()):(this.uniforms.pano1_map.value=t.map,this.uniforms.pano1_luminanceMap.value=t.luminanceMap,this.uniforms.pano1_matrix.value.copy(t.matrix));var e=null!==this.uniforms.pano0_luminanceMap.value&&null!==this.uniforms.pano1_luminanceMap.value;this.defines.USE_LUMINANCE!==e&&(this.defines.USE_LUMINANCE=e,this.needsUpdate=!0)}},modelAlpha:{get:function(){return this.uniforms.modelAlpha.value},set:function(t){this.uniforms.modelAlpha.value=t}},progress:{get:function(){return this.uniforms.progress.value},set:function(t){this.uniforms.progress.value=t}},useBlackTransition:{get:function(){return this.defines.USE_BLACK_TRANSITION},set:function(t){this.defines.USE_BLACK_TRANSITION!==t&&(this.defines.USE_BLACK_TRANSITION=t,this.needsUpdate=!0)}},opacity:{get:function(){return this.uniforms.opacity.value},set:function(e){this.uniforms.opacity.value=e;var i=e<1?t.NormalBlending:t.NoBlending;i!==this.blending&&(this.blending=i,this.needsUpdate=!0)}},perspToOrtho:{get:function(){return this.uniforms.perspToOrtho.value},set:function(t){this.uniforms.perspToOrtho.value=t}}}),l.pano0=null!==(n=i.pano0)&&void 0!==n?n:null,l.pano1=null!==(r=i.pano1)&&void 0!==r?r:null,l.modelAlpha=null!==(o=i.modelAlpha)&&void 0!==o?o:1,l.progress=null!==(s=i.progress)&&void 0!==s?s:0,l.useBlackTransition=null!==(a=i.useBlackTransition)&&void 0!==a&&a,l.perspToOrtho=null!==(u=i.perspToOrtho)&&void 0!==u?u:0,l.opacity=null!==(h=i.opacity)&&void 0!==h?h:1,l.originOpacity=1,l}return Nt(i,e),i}(t.ShaderMaterial),Te=function(e){function i(i){var n=i.preserveDrawingBuffer,r=void 0===n||n,o=i.backgroundColor,s=void 0===o?1579548:o,a=i.backgroundAlpha,u=void 0===a?1:a,h=i.pixelRatio,l=void 0===h?1:h,c=i.antialias,d=void 0!==c&&c,p=e.call(this,{antialias:d,preserveDrawingBuffer:r,alpha:u<1})||this;return p.setPixelRatio(l),p.setClearColor(s,u),p.outputEncoding=t.sRGBEncoding,p.autoClear=!0,p}return Nt(i,e),i}(t.WebGLRenderer),Re=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Nt(e,t),e.prototype.add=function(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];return t.prototype.add.apply(this,e)},e.prototype.remove=function(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];return t.prototype.remove.apply(this,e)},e}(t.Scene),ke=2*Math.PI,Qe=Math.PI/2;function De(t){return t>0&&t<=ke?t:(t%ke+ke)%ke}var Ne,Fe,Oe,Le,Ve=function(e){function i(i){var n=e.call(this,i,1,.1,1e3)||this;return n.pose={longitude:0,latitude:0,fov:i,distance:0,offset:new t.Vector3},n.computePose(),n}return Nt(i,e),i.prototype.computePose=function(){var e=this.getWorldDirection(new t.Vector3);return this.pose.longitude=De(-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 i,n,r,o,s,a=De(null!==(i=e.longitude)&&void 0!==i?i:this.pose.longitude),u=Math.max(1e-4-Qe,Math.min(Qe-1e-4,null!==(n=e.latitude)&&void 0!==n?n:this.pose.latitude)),h=null!==(r=e.fov)&&void 0!==r?r:this.pose.fov,l=null!==(o=e.distance)&&void 0!==o?o:this.pose.distance,c=null!==(s=e.offset)&&void 0!==s?s:this.pose.offset,d=function(e){var i=Math.abs(Math.cos(e.latitude));return new t.Vector3(-Math.sin(e.longitude)*i,-Math.sin(e.latitude),-Math.cos(e.longitude)*i)}({longitude:a,latitude:u}).normalize();return this.position.set(0,0,0),this.lookAt(d),this.position.add(c).sub(d.clone().setLength(l)),this.fov!==h&&(this.fov=h,this.updateProjectionMatrix()),this.updateMatrixWorld(),this.pose.longitude=a,this.pose.latitude=u,this.pose.fov=h,this.pose.distance=l,this.pose.offset.copy(c),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}(t.PerspectiveCamera),He=function(){function t(t,e,i){this.x=t,this.y=e,this.z=i}return t.prototype.copy=function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this},t.prototype.set=function(t,e,i){return this.x=t,this.y=e,this.z=i,this},t.prototype.fromArray=function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this},t.prototype.add=function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this},t.prototype.multiplyScalar=function(t){return this.x*=t,this.y*=t,this.z*=t,this},t.prototype.subVectors=function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this},t.prototype.dot=function(t){return this.x*t.x+this.y*t.y+this.z*t.z},t.prototype.cross=function(t){var e=this.x,i=this.y,n=this.z;return this.x=i*t.z-n*t.y,this.y=n*t.x-e*t.z,this.z=e*t.y-i*t.x,this},t.prototype.crossVectors=function(t,e){var i=t.x,n=t.y,r=t.z,o=e.x,s=e.y,a=e.z;return this.x=n*a-r*s,this.y=r*o-i*a,this.z=i*s-n*o,this},t.prototype.clone=function(){return new t(this.x,this.y,this.z)},t}(),ze=function(t,e,i){this.extents=t,this.startIndex=e,this.endIndex=i},Ke=function(t,e){this.triangle=t,this.intersectionPoint=e},qe=(Ne=new He(0,0,0),Fe=new He(0,0,0),Oe=new He(0,0,0),Le=new He(0,0,0),function(t,e,i,n,r,o){Fe.subVectors(e,t),Oe.subVectors(i,t),Le.crossVectors(Fe,Oe);var s,a=r.dot(Le);if(a>0){if(o)return null;s=1}else{if(!(a<0))return null;s=-1,a=-a}Ne.subVectors(n,t);var u=s*r.dot(Oe.crossVectors(Ne,Oe));if(u<0)return null;var h=s*r.dot(Fe.cross(Ne));if(h<0)return null;if(u+h>a)return null;var l=-s*Ne.dot(Le);if(l<0)return null;var c=l/a;return new He(0,0,0).copy(r).multiplyScalar(c).add(n)}),je=function(t,e){this.min=t,this.max=e};function Ue(t,e,i){var n=new je(0,0);e.x>=0?(n.min=(i.extents[0]-t.x)*e.x,n.max=(i.extents[3]-t.x)*e.x):(n.min=(i.extents[3]-t.x)*e.x,n.max=(i.extents[0]-t.x)*e.x);var r=new je(0,0);if(e.y>=0?(r.min=(i.extents[1]-t.y)*e.y,r.max=(i.extents[4]-t.y)*e.y):(r.min=(i.extents[4]-t.y)*e.y,r.max=(i.extents[1]-t.y)*e.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 o=new je(0,0);return e.z>=0?(o.min=(i.extents[2]-t.z)*e.z,o.max=(i.extents[5]-t.z)*e.z):(o.min=(i.extents[5]-t.z)*e.z,o.max=(i.extents[2]-t.z)*e.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 Ge(t,e,i,n,r){if(i>=n)return[0,0,0,0,0,0];for(var o=1/0,s=1/0,a=1/0,u=-1/0,h=-1/0,l=-1/0,c=i,d=void 0,p=void 0;c<n;c++)(p=e[d=6*t[c]])<o&&(o=p),(p=e[d+1])<s&&(s=p),(p=e[d+2])<a&&(a=p),(p=e[d+3])>u&&(u=p),(p=e[d+4])>h&&(h=p),(p=e[d+5])>l&&(l=p);return[o-r,s-r,a-r,u+r,h+r,l+r]}var _e=1e-6,We=function(){function t(){}return t.prototype.create=function(t){return this.trianglesArray=t,this},t.prototype.splitNode=function(t){if(!this.trianglesArray)throw new Error("bvh-tree never perpared. call `create` to initialize.");for(var e=this.trianglesArray,i=e.length/9,n=new Uint32Array(i),r=new Float32Array(6*i),o=[],s=1/0,a=1/0,u=1/0,h=-1/0,l=-1/0,c=-1/0,d=0,p=0,A=0,f=void 0,g=void 0,v=void 0,m=void 0,y=void 0,b=void 0,w=void 0;d<i;d++,p+=6,A+=9)n[d]=d,f=m=e[A],(w=e[A+3])<f&&(f=w),w>m&&(m=w),(w=e[A+6])<f&&(f=w),w>m&&(m=w),g=y=e[A+1],(w=e[A+4])<g&&(g=w),w>y&&(y=w),(w=e[A+7])<g&&(g=w),w>y&&(y=w),v=b=e[A+2],(w=e[A+5])<v&&(v=w),w>b&&(b=w),(w=e[A+8])<v&&(v=w),w>b&&(b=w),f<s&&(s=f),m>h&&(h=m),g<a&&(a=g),y>l&&(l=y),v<u&&(u=v),b>c&&(c=b),r[p]=f,r[p+1]=g,r[p+2]=v,r[p+3]=m,r[p+4]=y,r[p+5]=b;var E,x=new ze([s,a,u,h,l,c],0,i);function I(e){for(var i=e.startIndex,s=e.endIndex,a=e.extents,u=[a[3]-a[0],a[4]-a[1],a[5]-a[2]],h=[0,1,2].sort((function(t,e){return u[e]-u[t]})),l=0;l<3;l++){for(var c=h[l],d=a[c]+a[c+3],p=i,A=s-1,f=-1,g=void 0;p<A;)-1===f?(g=n[p],r[6*g+c]+r[6*g+c+3]<d?p++:f=g):(g=n[A],r[6*g+c]+r[6*g+c+3]>=d||(n[p]=g,n[A]=f,f=-1,p++),A--);if(p>i){var v=new ze(Ge(n,r,i,p,_e),i,p);v.endIndex-v.startIndex>t&&o.push(v);var m=new ze(Ge(n,r,p,s,_e),p,s);m.endIndex-m.startIndex>t&&o.push(m),e.node0=v,e.node1=m,e.startIndex=0,e.endIndex=0;break}}}for(o.push(x);E=o.pop();)I(E);return this.offsetArray=n,this.rootNode=x,this},t.prototype.intersectRay=function(t,e,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,o=this.offsetArray,s=this.rootNode,a=[],u=[],h=new He(1/e.x,1/e.y,1/e.z),l=[s];n=l.pop();)if(Ue(t,h,n)){n.node0&&l.push(n.node0),n.node1&&l.push(n.node1);for(var c=n.startIndex;c<n.endIndex;c++)a.push(o[c])}for(var d=new He(0,0,0),p=new He(0,0,0),A=new He(0,0,0),f=new He(t.x,t.y,t.z),g=new He(e.x,e.y,e.z),v=void(c=0),m=a.length;c<m;c++){v=9*a[c],d.x=r[v],d.y=r[v+1],d.z=r[v+2],p.x=r[v+3],p.y=r[v+3+1],p.z=r[v+3+2],A.x=r[v+6],A.y=r[v+6+1],A.z=r[v+6+2];var y=qe(d,p,A,f,g,i);y&&u.push(new Ke([d.clone(),p.clone(),A.clone()],y))}return u},t.prototype.dispose=function(){delete this.offsetArray,delete this.rootNode},t}(),Xe=null,Ye=!1,Ze=[];function Je(t){if(void 0===t&&(t=!1),t||!Ye)if(Xe)Ye=!1;else{Ye=!0;var e=Ze.shift();if(e){try{e()}catch(t){}ce.shared.add((function(){return Je(!0)}),!0,2)}else Ye=!1}}function $e(){Xe=null,Je()}function ti(t){return new Promise((function(e,i){Ze.push((function(){try{e(t())}catch(t){i(t)}})),Je()}))}function ei(){var t={OutWindow:function(){this._windowSize=0}};return t.OutWindow.prototype.create=function(t){this._buffer&&this._windowSize===t||(this._buffer=[]),this._windowSize=t,this._pos=0,this._streamPos=0},t.OutWindow.prototype.flush=function(){var t=this._pos-this._streamPos;if(0!==t){for(;t--;)this._stream.writeByte(this._buffer[this._streamPos++]);this._pos>=this._windowSize&&(this._pos=0),this._streamPos=this._pos}},t.OutWindow.prototype.releaseStream=function(){this.flush(),this._stream=null},t.OutWindow.prototype.setStream=function(t){this.releaseStream(),this._stream=t},t.OutWindow.prototype.init=function(t){t||(this._streamPos=0,this._pos=0)},t.OutWindow.prototype.copyBlock=function(t,e){var i=this._pos-t-1;for(i<0&&(i+=this._windowSize);e--;)i>=this._windowSize&&(i=0),this._buffer[this._pos++]=this._buffer[i++],this._pos>=this._windowSize&&this.flush()},t.OutWindow.prototype.putByte=function(t){this._buffer[this._pos++]=t,this._pos>=this._windowSize&&this.flush()},t.OutWindow.prototype.getByte=function(t){var e=this._pos-t-1;return e<0&&(e+=this._windowSize),this._buffer[e]},t.RangeDecoder=function(){},t.RangeDecoder.prototype.setStream=function(t){this._stream=t},t.RangeDecoder.prototype.releaseStream=function(){this._stream=null},t.RangeDecoder.prototype.init=function(){var t=5;for(this._code=0,this._range=-1;t--;)this._code=this._code<<8|this._stream.readByte()},t.RangeDecoder.prototype.decodeDirectBits=function(t){for(var e,i=0,n=t;n--;)this._range>>>=1,e=this._code-this._range>>>31,this._code-=this._range&e-1,i=i<<1|1-e,0==(4278190080&this._range)&&(this._code=this._code<<8|this._stream.readByte(),this._range<<=8);return i},t.RangeDecoder.prototype.decodeBit=function(t,e){var i=t[e],n=(this._range>>>11)*i;return(2147483648^this._code)<(2147483648^n)?(this._range=n,t[e]+=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,t[e]-=i>>>5,0==(4278190080&this._range)&&(this._code=this._code<<8|this._stream.readByte(),this._range<<=8),1)},t.initBitModels=function(t,e){for(;e--;)t[e]=1024},t.BitTreeDecoder=function(t){this._models=[],this._numBitLevels=t},t.BitTreeDecoder.prototype.init=function(){t.initBitModels(this._models,1<<this._numBitLevels)},t.BitTreeDecoder.prototype.decode=function(t){for(var e=1,i=this._numBitLevels;i--;)e=e<<1|t.decodeBit(this._models,e);return e-(1<<this._numBitLevels)},t.BitTreeDecoder.prototype.reverseDecode=function(t){for(var e,i=1,n=0,r=0;r<this._numBitLevels;++r)i=i<<1|(e=t.decodeBit(this._models,i)),n|=e<<r;return n},t.reverseDecode2=function(t,e,i,n){for(var r,o=1,s=0,a=0;a<n;++a)o=o<<1|(r=i.decodeBit(t,e+o)),s|=r<<a;return s},t.LenDecoder=function(){this._choice=[],this._lowCoder=[],this._midCoder=[],this._highCoder=new t.BitTreeDecoder(8),this._numPosStates=0},t.LenDecoder.prototype.create=function(e){for(;this._numPosStates<e;++this._numPosStates)this._lowCoder[this._numPosStates]=new t.BitTreeDecoder(3),this._midCoder[this._numPosStates]=new t.BitTreeDecoder(3)},t.LenDecoder.prototype.init=function(){var e=this._numPosStates;for(t.initBitModels(this._choice,2);e--;)this._lowCoder[e].init(),this._midCoder[e].init();this._highCoder.init()},t.LenDecoder.prototype.decode=function(t,e){return 0===t.decodeBit(this._choice,0)?this._lowCoder[e].decode(t):0===t.decodeBit(this._choice,1)?8+this._midCoder[e].decode(t):16+this._highCoder.decode(t)},t.Decoder2=function(){this._decoders=[]},t.Decoder2.prototype.init=function(){t.initBitModels(this._decoders,768)},t.Decoder2.prototype.decodeNormal=function(t){var e=1;do{e=e<<1|t.decodeBit(this._decoders,e)}while(e<256);return 255&e},t.Decoder2.prototype.decodeWithMatchByte=function(t,e){var i,n,r=1;do{if(i=e>>7&1,e<<=1,r=r<<1|(n=t.decodeBit(this._decoders,(1+i<<8)+r)),i!==n){for(;r<256;)r=r<<1|t.decodeBit(this._decoders,r);break}}while(r<256);return 255&r},t.LiteralDecoder=function(){},t.LiteralDecoder.prototype.create=function(e,i){var n;if(!this._coders||this._numPrevBits!==i||this._numPosBits!==e)for(this._numPosBits=e,this._posMask=(1<<e)-1,this._numPrevBits=i,this._coders=[],n=1<<this._numPrevBits+this._numPosBits;n--;)this._coders[n]=new t.Decoder2},t.LiteralDecoder.prototype.init=function(){for(var t=1<<this._numPrevBits+this._numPosBits;t--;)this._coders[t].init()},t.LiteralDecoder.prototype.getDecoder=function(t,e){return this._coders[((t&this._posMask)<<this._numPrevBits)+((255&e)>>>8-this._numPrevBits)]},t.Decoder=function(){this._outWindow=new t.OutWindow,this._rangeDecoder=new t.RangeDecoder,this._isMatchDecoders=[],this._isRepDecoders=[],this._isRepG0Decoders=[],this._isRepG1Decoders=[],this._isRepG2Decoders=[],this._isRep0LongDecoders=[],this._posSlotDecoder=[],this._posDecoders=[],this._posAlignDecoder=new t.BitTreeDecoder(4),this._lenDecoder=new t.LenDecoder,this._repLenDecoder=new t.LenDecoder,this._literalDecoder=new t.LiteralDecoder,this._dictionarySize=-1,this._dictionarySizeCheck=-1,this._posSlotDecoder[0]=new t.BitTreeDecoder(6),this._posSlotDecoder[1]=new t.BitTreeDecoder(6),this._posSlotDecoder[2]=new t.BitTreeDecoder(6),this._posSlotDecoder[3]=new t.BitTreeDecoder(6)},t.Decoder.prototype.setDictionarySize=function(t){return!(t<0||(this._dictionarySize!==t&&(this._dictionarySize=t,this._dictionarySizeCheck=Math.max(this._dictionarySize,1),this._outWindow.create(Math.max(this._dictionarySizeCheck,4096))),0))},t.Decoder.prototype.setLcLpPb=function(t,e,i){var n=1<<i;return!(t>8||e>4||i>4||(this._literalDecoder.create(e,t),this._lenDecoder.create(n),this._repLenDecoder.create(n),this._posStateMask=n-1,0))},t.Decoder.prototype.init=function(){var e=4;for(this._outWindow.init(!1),t.initBitModels(this._isMatchDecoders,192),t.initBitModels(this._isRep0LongDecoders,192),t.initBitModels(this._isRepDecoders,12),t.initBitModels(this._isRepG0Decoders,12),t.initBitModels(this._isRepG1Decoders,12),t.initBitModels(this._isRepG2Decoders,12),t.initBitModels(this._posDecoders,114),this._literalDecoder.init();e--;)this._posSlotDecoder[e].init();this._lenDecoder.init(),this._repLenDecoder.init(),this._posAlignDecoder.init(),this._rangeDecoder.init()},t.Decoder.prototype.decode=function(e,i,n){var r,o,s,a,u,h,l=0,c=0,d=0,p=0,A=0,f=0,g=0;for(this._rangeDecoder.setStream(e),this._outWindow.setStream(i),this.init();n<0||f<n;)if(r=f&this._posStateMask,0===this._rangeDecoder.decodeBit(this._isMatchDecoders,(l<<4)+r))o=this._literalDecoder.getDecoder(f++,g),g=l>=7?o.decodeWithMatchByte(this._rangeDecoder,this._outWindow.getByte(c)):o.decodeNormal(this._rangeDecoder),this._outWindow.putByte(g),l=l<4?0:l-(l<10?3:6);else{if(1===this._rangeDecoder.decodeBit(this._isRepDecoders,l))s=0,0===this._rangeDecoder.decodeBit(this._isRepG0Decoders,l)?0===this._rangeDecoder.decodeBit(this._isRep0LongDecoders,(l<<4)+r)&&(l=l<7?9:11,s=1):(0===this._rangeDecoder.decodeBit(this._isRepG1Decoders,l)?a=d:(0===this._rangeDecoder.decodeBit(this._isRepG2Decoders,l)?a=p:(a=A,A=p),p=d),d=c,c=a),0===s&&(s=2+this._repLenDecoder.decode(this._rangeDecoder,r),l=l<7?8:11);else if(A=p,p=d,d=c,s=2+this._lenDecoder.decode(this._rangeDecoder,r),l=l<7?7:10,(u=this._posSlotDecoder[s<=5?s-2:3].decode(this._rangeDecoder))>=4){if(c=(2|1&u)<<(h=(u>>1)-1),u<14)c+=t.reverseDecode2(this._posDecoders,c-u-1,this._rangeDecoder,h);else if(c+=this._rangeDecoder.decodeDirectBits(h-4)<<4,(c+=this._posAlignDecoder.reverseDecode(this._rangeDecoder))<0){if(-1===c)break;return!1}}else c=u;if(c>=f||c>=this._dictionarySizeCheck)return!1;this._outWindow.copyBlock(c,s),f+=s,g=this._outWindow.getByte(0)}return this._outWindow.flush(),this._outWindow.releaseStream(),this._rangeDecoder.releaseStream(),!0},t.Decoder.prototype.setDecoderProperties=function(t){var e,i,n,r,o;return!(t.size<5)&&(i=(e=t.readByte())%9,n=(e=~~(e/9))%5,r=~~(e/5),!!this.setLcLpPb(i,n,r)&&(o=t.readByte(),o|=t.readByte()<<8,o|=t.readByte()<<16,o+=16777216*t.readByte(),this.setDictionarySize(o)))},t.decompress=function(e,i,n,r){var o=new t.Decoder;if(!o.setDecoderProperties(e))throw"Incorrect stream properties";if(!o.decode(i,n,r))throw"Error in data stream";return!0},t.decompressFile=function(e,i){var n,r=new t.Decoder;if(!r.setDecoderProperties(e))throw"Incorrect stream properties";if(n=e.readByte(),n|=e.readByte()<<8,n|=e.readByte()<<16,n+=16777216*e.readByte(),e.readByte(),e.readByte(),e.readByte(),e.readByte(),!r.decode(e,i,n))throw"Error in data stream";return!0},t}var ii=ei(),ni="\nvar decodeLZMA = (function() {\n var LZMA = (".concat(ei.toString(),")();\n return function(data, callback) {\n return (").concat(function(t,e,i){try{var n={data:e,offset:0,readByte:function(){return this.data[this.offset++]}},r=n.data.length,o={data:[],offset:0,writeByte:function(t){var e=Math.floor(this.offset/r);this.data[e]||(this.data[e]=new Uint8Array(r)),this.data[e][this.offset%r]=t,this.offset++}};t.decompressFile(n,o);for(var s=new Uint8Array(o.offset),a=0;a<o.offset;a++)s[a]=o.data[Math.floor(a/r)][a%r];i(null,s)}catch(t){i(t)}}.toString(),")(LZMA, data, callback);\n }\n})();\n\nvar decodeLZMAWithWASM = (function() {\n var LZMA_WASM = (").concat(function(){return function(t){for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=new Uint8Array(256),n=0;n<e.length;n++)i[e.charCodeAt(n)]=n;var r,o,s,a,u,h=.75*t.length,l=t.length,c=0;"="===t[t.length-1]&&(h--,"="===t[t.length-2]&&h--);var d=new ArrayBuffer(h),p=new Uint8Array(d);for(r=0;r<l;r+=4)o=i[t.charCodeAt(r)],s=i[t.charCodeAt(r+1)],a=i[t.charCodeAt(r+2)],u=i[t.charCodeAt(r+3)],p[c++]=o<<2|s>>4,p[c++]=(15&s)<<4|a>>2,p[c++]=(3&a)<<6|63&u;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/QRQQASIAQQA2AgAgAEEAOgAEIABBADYCCCAAQQA2AgwgAEEANgIQIABBDTYCCCAAC0IBAX9BGRABIgBBADYCACAAQQA2AgQgAEEANgIIIABBADYCDCAAQQA2AhAgAEEANgIUIABBADoAGCAAQQA2AhAgAAu1AgEEf0HQABABIgBBADoAACAAQQA2AgQgAEEANgIIIABBADYCDCAAQQA2AhAgAEEAOgAUIABBADYCGCAAQQA2AhwgAEEANgIgIABBADYCJCAAQQA2AiggAEEANgIsIABBADYCMCAAQQA2AjQgAEEANgI4IABBADYCPCAAQQA2AkAgAEEANgJEIABBADYCSCAAQQA2AkxBBBAEIQIDQCABQQRIBEBBBhAHIQMgAigCACABQQJ0aiADNgIIIAFBAWohAQwBCwsgACACNgIkIABBBBAHNgIoIABB8wAQBjYCLCAAQcABEAY2AjAgAEEMEAY2AjQgAEEMEAY2Ajgg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AgATYCBEENEA8hAgNAAkAgA0ENTg0AIAIgAyABIAMQEUH/AXEQEiADQQFqIQMMAQsLIAAoAgAhBCACIQZBBBAPIgIoAgQgAigCAGogBigCBCAGKAIAai0ACCIDOgAIIANB/wFxQeEBTwRAQQBBgAFBoQFBDBAAAAsgAigCBCACKAIAQQFqaiADQf8BcUEJcCIHOgAIIAIoAgQgAigCAGogA0H/AXFBCW4iAzoACCADQQVwIQUgAigCBCACKAIAQQJqaiADQQVuIgM6AAggAigCBCACKAIAQQNqaiAFOgAIIAQgBzYCDCAEIAM2AhAgBCAFOgAUIARBADYCHEEAIQIDQAJAIAJBBE8NACAEIAQoAhwgBigCBCAGKAIAIAJBAWpqai0ACCACQQN0dHI2AhwgAkEBaiECDAELCyAEIAQoAhw2AhggBCgCGEGAIEkEQCAEQYAgNgIYC0EAIQJBACEFQQAhAwNAAkAgA0EITg0AIAYgA0EFahARQf8BcSIEQf8BRwRAQQEhBQsgBCADQQN0dCACciECIANBAWohAwwBCwsgACgCACAFRToAACAAKAIAKAIEIAE2AgAgACgCABAWAkAgACgCACAFIAIQICIBQQFGDQAgAUEDRwRAIAFBAkYEQCAFBEAgACgCACgCCCgCECACRw0DCwUMAgsLIAAoAgAoAgQtAAQaQQFBACAAKAIAKAIIKAIQIAAoAgAoAggoAgQQIQ8LQQBBAUEAQQAQIQsIACMDIAAQIgsWAEG4ASQAIwAkAUGAgIAIJAIQDCQDCwMAAQsLtwEEAEEICxcKAAAAdQBzAGUAIABzAHQAcgBpAGMAdABBIAsdDQAAAH4AbABpAGIALwBhAHIAcgBhAHkALgB0AHMAQcAACzkbAAAAfgBsAGkAYgAvAGkAbgB0AGUAcgBuAGEAbAAvAHQAeQBwAGUAZABhAHIAcgBhAHkALgB0AHMAQYABCzMYAAAAcwByAGMALwBsAHoAbQBhAC8AbAB6AG0AYQAtAGQAZQBjAG8AZABlAHIALgB0AHM=")}.toString(),")();\n return function(data, callback) {\n return (").concat(function(t,e,i){try{var n=new WebAssembly.Memory({initial:16}),r=new WebAssembly.Module(t),o=new WebAssembly.Instance(r,{env:{memory:n,abort:function(){i(new Error("webAssembly abort"))}}}).exports,s=o.newU8Array(e.length);new Uint8Array(n.buffer,s+24,e.length).set(e);var a=o.decode(s),u=new Uint32Array(n.buffer,a,4),h=u[0],l=u[2],c=u[3];h?i(null,new Uint8Array(n.buffer,c+24,l).slice(0,l)):i(new Error("lzma deocder error"))}catch(t){i(t)}}.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'),ri="undefined"!=typeof Worker&&"undefined"!=typeof Blob,oi="";if(ri)try{var si=new Blob([ni],{type:"text/javascript"});oi=URL.createObjectURL(si)}catch(t){}var ai=function(){function t(){var t=this;if(!ri)throw new Error("LZMAWorker cannot work in this broswer.");this.callCounter=0,this.requests={};var e=this.worker=new Worker(oi);e.onmessage=function(e){var i=e.data,n=i.id,r=i.result,o=i.error,s=t.getKey(n);t.requests[s]&&(o?t.requests[s](new Error(o)):t.requests[s](null,r),delete t.requests[s])},e.onerror=function(t){return console.error(t)}}return t.prototype.getKey=function(t){return"key_"+String(t)},t.prototype.decompress=function(t,e){var i=++this.callCounter;this.requests[this.getKey(i)]=e,this.worker.postMessage({type:"decompress",id:i,data:t},[t.buffer])},t.prototype.terminate=function(){this.worker.terminate()},t.support=ri,t}();function ui(t){return Array.prototype.reduce.call(t,(function(t,e,i){return t|e<<8*i}),0)}function hi(t){var e=new Uint8Array(t),i=ui(e.slice(0,4));if(i>10)return Promise.reject(new Error("LZMA got too many sub chunks."));for(var n=[],r=[],o=4+4*i,s=0;s<i;s++)r[s]=ui(e.slice(4+4*s,8+4*s)),n[s]=s===i-1?e.subarray(o,o+r[s]):e.slice(o,o+r[s]),o+=r[s];return ai.support?function(t){for(var e=[],i=t.length,n=function(i){e.push(new Promise((function(e,n){var r=new ai;r.decompress(t[i],(function(t,i){if(r.terminate(),t)return n(t);e(i)}))})))},r=0;r<i;r++)n(r);return Promise.all(e)}(n):Promise.resolve(function(t){for(var e,i=[],n=t.length,r=function(n){var r={data:t[n],offset:0,readByte:function(){return this.data[this.offset++]}},o=r.data.length,s={data:[],offset:0,writeByte:function(t){var e=Math.floor(this.offset/o);this.data[e]||(this.data[e]=new Uint8Array(o)),this.data[e][this.offset%o]=t,this.offset++}};ii.decompressFile(r,s),e=new Uint8Array(s.offset);for(var a=0;a<s.offset;a++)e[a]=s.data[Math.floor(a/o)][a%o];i.push(e)},o=0;o<n;o++)r(o);return i}(n))}function li(t,e){for(var i={},n=0,r=e;n<r.length;n++){var o=r[n];o in t&&(i[o]=t[o])}return i}var ci=!1;try{ci="undefined"!=typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(t){}var di=[];function pi(){var t=this.src;this.onerror=this.onload=Kt,this.removeAttribute("src"),/^blob\:/.test(t)&&URL.revokeObjectURL(t),this.close=Kt}function Ai(){di.push(this)}function fi(){return Object.assign(new Image,{crossOrigin:"",close:pi})}function gi(t){return new Promise((function(e,i){var n=fi();n.onload=function(){n.onload=n.onerror=Kt,setTimeout((function(){return e(n)}),30)},n.onerror=function(){var t=n.src;n.onload=n.onerror=Kt,n.close(),i(new Error("image load error: ".concat(t)))},n.src=URL.createObjectURL(t)}))}function vi(e,i){if(i&&(e.width>i.width||e.height>i.height)){var n=function(t,e){var i=di.shift();if(i)return i.width=t,i.height=e,i;if(ci){var n=new OffscreenCanvas(t,e);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,i.width),Math.min(e.height,i.height)),r=n.getContext("2d");r.clearRect(0,0,n.width,n.height),r.drawImage(e,0,0,n.width,n.height),e.close();var o=new t.Texture(n);o.needsUpdate=!0,o.flipY=!0;var s=o.dispose;return o.dispose=function(){n.close(),s.call(o),delete o.dispose},o}var a=new t.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 mi=new t.WebGLRenderTarget(1,1),yi=new t.OrthographicCamera(-1,1,1,-1,0,1),bi=new t.BufferGeometry;bi.setAttribute("position",new t.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3)),bi.setAttribute("uv",new t.Float32BufferAttribute([0,2,0,0,2,0],2));var wi=new t.Mesh(bi),Ei=new t.Scene;Ei.add(wi);var xi,Ii=new t.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 "}),Ci=new t.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 Si(e,i,n){return void 0!==i.flipY&&(e.flipY=i.flipY),void 0!==i.format&&(e.format=i.format),void 0!==i.encoding&&(e.encoding=i.encoding),void 0!==i.minFilter&&(e.minFilter=i.minFilter),void 0!==i.magFilter&&(e.magFilter=i.magFilter),n?new Promise((function(i){ce.shared.add((function(){try{var r=n.getRenderTarget();n.setRenderTarget(mi),e instanceof t.CubeTexture?(wi.material=Ci,Ci.uniforms.map.value=e,n.render(Ei,yi),Ci.uniforms.map.value=null):(wi.material=Ii,Ii.uniforms.map.value=e,n.render(Ei,yi),Ci.uniforms.map.value=null),n.setRenderTarget(r),i(e)}catch(t){i(e)}}),!0,1)})):Promise.resolve(e)}var Bi='\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',Mi={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},Pi={COMPRESSED_RGB_S3TC_DXT1_EXT:33776,COMPRESSED_RGBA_S3TC_DXT1_EXT:33777,COMPRESSED_RGBA_S3TC_DXT3_EXT:33778,COMPRESSED_RGBA_S3TC_DXT5_EXT:33779},Ti=((xi={})[Mi.cTFBC1]=Pi.COMPRESSED_RGB_S3TC_DXT1_EXT,xi[Mi.cTFBC3]=Pi.COMPRESSED_RGBA_S3TC_DXT5_EXT,xi),Ri=function(){function e(){}return e.setTranscoderPath=function(t){return this.transcoderPath=t,this},e.setWorkerLimit=function(t){return this.workerLimit=t,this},e.isInitialized=function(){return 0!==this.workerPool.filter((function(t){return t._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 i,n,r=this,o=e.byteLength,s=this._allocateWorker(o).then((function(t){return i=t,n=r.workerNextTaskID++,new Promise((function(t,r){i._callbacks[n]={resolve:t,reject:r},i.postMessage({type:"transcode",id:n,buffer:e},[e])}))})).then((function(e){var i,n=r.workerConfig,o=e.width,s=e.height,a=e.mipmaps;switch(e.format){case Mi.cTFASTC_4x4:i=new t.CompressedTexture(a,o,s,t.RGBA_ASTC_4x4_Format);break;case Mi.cTFBC1:case Mi.cTFBC3:i=new t.CompressedTexture(a,o,s,Ti[n.format],t.UnsignedByteType);break;case Mi.cTFETC1:i=new t.CompressedTexture(a,o,s,t.RGB_ETC1_Format);break;case Mi.cTFPVRTC1_4_RGB:i=new t.CompressedTexture(a,o,s,t.RGB_PVRTC_4BPPV1_Format);break;case Mi.cTFPVRTC1_4_RGBA:i=new t.CompressedTexture(a,o,s,t.RGBA_PVRTC_4BPPV1_Format);break;default:throw new Error("BasisTextureLoader: No supported format available.")}return i.minFilter=1===a.length?t.LinearFilter:t.LinearMipmapLinearFilter,i.magFilter=t.LinearFilter,i.generateMipmaps=!1,i.needsUpdate=!0,i}));return s.catch((function(){return!0})).then((function(){i&&n&&(i._taskLoad-=o,delete i._callbacks[n])})),s},e._initTranscoder=function(){var e=this;if(!this.transcoderPending){var i=new t.FileLoader;i.setPath(this.transcoderPath);var n=new Promise((function(t,e){i.load("basis_transcoder.js",t,void 0,e)})),r=new t.FileLoader;r.setPath(this.transcoderPath),r.setResponseType("arraybuffer");var o=new Promise((function(t,e){r.load("basis_transcoder.wasm",t,void 0,e)}));this.transcoderPending=Promise.all([n,o]).then((function(t){var i=t[0],n=t[1],r=["/* basis_transcoder.js */",i,"/* worker */",Bi].join("\n");e.workerSourceURL=URL.createObjectURL(new Blob([r])),e.transcoderBinary=n}))}return this.transcoderPending},e._allocateWorker=function(t){var e=this;return this._initTranscoder().then((function(){if(e.workerPool.length<e.workerLimit){var i=function(t){var e=new Worker(t);return Object.assign(e,{_callbacks:{},_initialized:!1,_taskLoad:0})}(e.workerSourceURL);i._callbacks={},i._initialized=!1,i._taskLoad=0,i.postMessage({type:"init",config:e.workerConfig,transcoderBinary:e.transcoderBinary}),i.onmessage=function(t){var e=t.data;switch(e.type){case"initialized":i._initialized=!0,console.info("BasisTextureLoader: basis loader initialized");break;case"transcode":i._callbacks[e.id].resolve(e);break;case"error":i._callbacks[e.id].reject(e);break;default:console.error('BasisTextureLoader: Unexpected message, "'.concat(e.type,'"'))}},e.workerPool.push(i)}else e.workerPool.sort((function(t,e){return t._taskLoad>e._taskLoad?-1:1}));var n=e.workerPool[e.workerPool.length-1];return n._taskLoad+=t,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=Mi,e.DXT_FORMAT=Pi,e.DXT_FORMAT_MAP=Ti,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 ki(t){var e=t.match(/^([0-9a-z]+\:)\/\/(([^:/?#]*)(?::[0-9]+)?)/);return e?e[1]:location.protocol}var Qi=function(){function e(t){this.timeout=t.timeout,this.allowHosts=t.allowHosts,this.networkSubscribe=t.networkSubscribe}return e.prototype.setAllowHosts=function(t){this.allowHosts=t},e.prototype.setNetworkSubscribe=function(t){this.networkSubscribe=t},e.prototype.load=function(e,i,n,r,o,s){var a;void 0===i&&(i={}),void 0===n&&(n=Kt),void 0===r&&(r=Kt),void 0===o&&(o=Kt);var u=ki(e),h={timeout:this.timeout,allowHosts:this.allowHosts,networkSubscribe:this.networkSubscribe},l=null!==(a=i.viaAjax)&&void 0!==a&&a,c=ie(e),d=/^https?:$/.test(u),p=/\.basis$/.test(ne(e).split("?")[0]);if(c?l=!0:d||(l=!1),l){if(p){var A=null,f="arraybuffer";return!0===i.flipY?Promise.reject(new Error(".basis cannnot set flipY: true.")):se(e,Ft(Ft({},h),{responseType:f}),void 0,void 0,o).then((function(t){return A=t.meta,Ri.createTexture(t.body)})).then((function(e){return!1!==i.preInit?Si(e,Ft({flipY:!1,encoding:t.sRGBEncoding},li(i,["wrapS","wrapT"])),s):e})).then((function(t){var e={meta:A,body:t};return n(e),e})).catch((function(t){return r(t),Promise.reject(t)}))}return f="blob",se(e,Ft(Ft({},h),{responseType:f}),void 0,void 0,o).then((function(t){return gi(t.body)})).then((function(t){return vi(t,i.maxSize)})).then((function(e){return!1!==i.preInit?Si(e,Ft({flipY:!0,encoding:t.sRGBEncoding},i),s):e})).then((function(t){var e={meta:null,body:t};return n(e),e})).catch((function(t){return r(t),Promise.reject(t)}))}if(p){var g=new Error("cannot load basis texture via image");return r(g),Promise.reject(g)}var v=null,m=fi();return ue(e,h,void 0,void 0,o,m).then((function(t){return v=t.meta,vi(t.body,i.maxSize)})).then((function(e){return!1!==i.preInit?Si(e,Ft({flipY:!0,encoding:t.sRGBEncoding},i),s):e})).then((function(t){var e={meta:v,body:t};return n(e),e})).catch((function(t){return m.close(),r(t),Promise.reject(t)}))},e.prototype.loadCube=function(e,i,n,r,o,s){var a;void 0===i&&(i={}),void 0===n&&(n=Kt),void 0===r&&(r=Kt),void 0===o&&(o=Kt),Array.isArray(e)||(e=[e.right,e.left,e.up,e.down,e.front,e.back]);for(var u={timeout:this.timeout,allowHosts:this.allowHosts,networkSubscribe:this.networkSubscribe},h=[],l=[0,0,0,0,0,0],c=[],d=function(t){var n=e[t],s=ki(n),d=function(e){l[t]=e,o(l.reduce((function(t,e){return t+e}),0)/6)},p=null!==(a=i.viaAjax)&&void 0!==a&&a,A=/^https?:$/.test(s),f=ie(n),g=/\.basis$/.test(ne(n).split("?")[0]);if(f?p=!0:A||(p=!1),p)if(g){var v="arraybuffer",m=se(n,Ft(Ft({},u),{responseType:v}),void 0,void 0,d).then((function(e){return c[t]=e.meta,Ri.createTexture(e.body)}));h.push(m)}else v="blob",m=se(n,Ft(Ft({},u),{responseType:v}),void 0,void 0,d).then((function(e){return c[t]=e.meta,gi(e.body)})),h.push(m);else{if(g){var y=new Error("cannot load basis texture via image");return r(y),{value:Promise.reject(y)}}var b=fi();m=ue(n,u,void 0,void 0,d,b).then((function(e){return c[t]=e.meta,e.body})).catch((function(t){return b.close(),Promise.reject(t)})),h.push(m)}},p=0;p<6;p++){var A=d(p);if("object"==typeof A)return A.value}return Promise.all(h).then((function(e){return e[0]instanceof t.CompressedTexture?function(e){var i=new t.CubeTexture(e);i.needsUpdate=!0;var n=i.dispose;return i.dispose=function(){for(var t=0,r=e;t<r.length;t++)r[t].dispose();n.call(i),delete i.dispose},i.isCompressedTexture=!0,i.format=e[0].format,i.minFilter=e[0].minFilter,i.magFilter=e[0].magFilter,i}(e):function(e){var i=new t.CubeTexture(e);i.needsUpdate=!0,i.flipY=!1;var n=i.dispose;return i.dispose=function(){for(var t=0,r=e;t<r.length;t++)r[t].close();n.call(i),delete i.dispose},i}(e)})).then((function(e){return!1!==i.preInit?e.isCompressedTexture?Si(e,Ft({flipY:!1,encoding:t.sRGBEncoding},li(i,["wrapS","wrapT"])),s):Si(e,Ft({flipY:!1,encoding:t.sRGBEncoding},i),s):e})).then((function(t){var e={body:t,meta:c};return n(e),e})).catch((function(e){for(var i=0,n=h;i<n.length;i++)n[i].then((function(e){e instanceof t.Texture?e.dispose():e.close()})).catch(Kt);return r(e),Promise.reject(e)}))},e}(),Di=__webpack_require__(967);const Ni=Di.Reader,Fi=Di.util,Oi=Di.roots["@REALSEE/FIVE:five/loaders/model/proto/pbm.proto"]||(Di.roots["@REALSEE/FIVE:five/loaders/model/proto/pbm.proto"]={}),Li=Oi.Model=(()=>{function t(t){if(this.chunks=[],t)for(let e=Object.keys(t),i=0;i<e.length;++i)null!=t[e[i]]&&(this[e[i]]=t[e[i]])}return t.prototype.chunks=Fi.emptyArray,t.decode=function(t,e){t instanceof Ni||(t=Ni.create(t));let i=void 0===e?t.len:t.pos+e,n=new Oi.Model;for(;t.pos<i;){let e=t.uint32();switch(e>>>3){case 1:n.chunks&&n.chunks.length||(n.chunks=[]),n.chunks.push(Oi.Chunk.decode(t,t.uint32()));break;default:t.skipType(7&e)}}return n},t})();function Vi(e,i,n,r){var o=Ft({key:"texture.pbm",basisLoaderInitialized:Ri.isInitialized()},li(i,["format","quality","size"]));return e=i.transform?i.transform(e,o):me(e,o),new Qi({allowHosts:n,networkSubscribe:r}).load(e,{wrapS:t.ClampToEdgeWrapping,wrapT:t.ClampToEdgeWrapping,minFilter:t.LinearFilter,maxSize:"number"==typeof o.size?new t.Vector2(o.size,o.size):void 0,preInit:!0}).then((function(t){var e=t.body;return e.needsUpdate=!0,e}))}function Hi(e,i,n,r,o,s,a){void 0===o&&(o={});for(var u=[],h=0,l=function(e){var i,n,r=(new t.Matrix4).set(1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1);function o(t){var e=t.match(/(group|floor)-?(\d+)/);return e?parseInt(e[2],10):0}function s(t){var e=t.match(/(chunk)-?(\d+)/);return e?parseInt(e[2],10):0}function a(t){return 1e6*o(t.name)+1e3*s(t.name)+function(t){var e=t.match(/(sub)-?(\d+)/);return e?parseInt(e[2],10):0}(t.name)}for(var u=[],h=0,l=(null!==(i=e.chunks)&&void 0!==i?i:[]).sort((function(t,e){return a(t)-a(e)}));h<l.length;h++){var c=o((k=l[h]).name);u[c]||(u[c]=[]),u[c].push(k)}for(var d=[],p=0;p<u.length;p++){var A=u[p];if(A){for(var f=0,g=0,v=0;v<A.length;v++)g+=(k=A[v]).vertices.xyz.length/3,f+=k.faces.indices.length;for(var m=3*g,y=2*g,b=3*g,w=f,E=new ArrayBuffer(4*m+4*y+4*b+4*w),x=new Float32Array(E,0,m),I=new Float32Array(E,4*m,y),C=new Float32Array(E,4*m+4*y,b),S=new Uint32Array(E,4*m+4*y+4*b,w),B=[],M=[1/0,1/0,1/0,-1/0,-1/0,-1/0],P=0,T=0,R=0;R<A.length;R++){var k,Q=(k=A[R]).vertices.xyz,D=k.vertices.uvs,N=k.faces.indices,F=Q.length/3,O=N.length,L=[1/0,1/0,1/0,-1/0,-1/0,-1/0];for(v=0;v<F;v++){var V=Q[3*v],H=Q[3*v+1],z=Q[3*v+2],K=r.elements,q=1/(K[3]*V+K[7]*H+K[11]*z+K[15]),j=(K[0]*V+K[4]*H+K[8]*z+K[12])*q,U=(K[1]*V+K[5]*H+K[9]*z+K[13])*q,G=(K[2]*V+K[6]*H+K[10]*z+K[14])*q;x[3*T+3*v]=j,x[3*T+3*v+1]=U,x[3*T+3*v+2]=G,I[2*T+2*v]=D[2*v],I[2*T+2*v+1]=D[2*v+1],j<L[0]&&(L[0]=j),U<L[1]&&(L[1]=U),G<L[2]&&(L[2]=G),j>L[3]&&(L[3]=j),U>L[4]&&(L[4]=U),G>L[5]&&(L[5]=G)}for(L[0]<M[0]&&(M[0]=L[0]),L[1]<M[1]&&(M[1]=L[1]),L[2]<M[2]&&(M[2]=L[2]),L[3]>M[3]&&(M[3]=L[3]),L[4]>M[4]&&(M[4]=L[4]),L[5]>M[5]&&(M[5]=L[5]),v=0;v<O;v++)S[P+v]=T+N[v];B.push({materialIndex:R,name:k.name,chunkName:s(k.name),start:P,count:k.faces.indices.length,texture:null!==(n=k.texture)&&void 0!==n?n:void 0}),T+=F,P+=O}for(v=0;v<f;v+=3){var _,W,X,Y,Z,J,$,tt,et,it,nt,rt,ot,st,at,ut,ht,lt,ct;_=3*S[v],W=3*S[v+1],X=3*S[v+2],Y=x[_],Z=x[_+1],J=x[_+2],$=x[W],tt=x[W+1],et=x[W+2],it=x[X],ht=(rt=x[X+1]-tt)*(ut=J-et)-(ot=x[X+2]-et)*(at=Z-tt),lt=ot*(st=Y-$)-(nt=it-$)*ut,ct=nt*at-rt*st,C[_]+=ht,C[_+1]+=lt,C[_+2]+=ct,C[W]+=ht,C[W+1]+=lt,C[W+2]+=ct,C[X]+=ht,C[X+1]+=lt,C[X+2]+=ct}d.push({floorIndex:p,vertices:x,uvs:I,indices:S,normals:C,groups:B,extents:M})}}return d}(e);h<l.length;h++){var c=l[h],d=c.floorIndex,p=c.vertices,A=c.uvs,f=c.indices,g=c.normals,v=c.groups,m=c.extents,y=new t.Box3;y.min.x=m[0],y.min.y=m[1],y.min.z=m[2],y.max.x=m[3],y.max.y=m[4],y.max.z=m[5];var b=new t.BufferGeometry;b.setAttribute("position",new t.BufferAttribute(p,3)),b.setAttribute("uv",new t.BufferAttribute(A,2)),b.setAttribute("normal",new t.BufferAttribute(g,3)),b.setIndex(new t.BufferAttribute(f,1)),b.boundingBox=y,b.boundingSphere=y.getBoundingSphere(new t.Sphere);for(var w=0,E=v;w<E.length;w++){var x=E[w];b.addGroup(x.start,x.count,x.materialIndex)}for(var I=[],C=function(e){var u=n[e.chunkName]||(e.texture?i+e.texture:void 0),h=new Pe;if(I.push(h),u){var l=void 0;u in o?l=o[u]:(l=Vi(u,r,s,a),o[u]=l),l.then((function(t){h.uniforms.map.value=t,h.uniforms.exposure.value=3.3}),(function(){h.defines.USE_MAP=!1,h.uniforms.color.value=new t.Color(16777215)}))}else h.defines.USE_MAP=!1,h.uniforms.color.value=new t.Color(16777215)},S=0,B=v;S<B.length;S++)C(x=B[S]);var M=new ye(b,I);M.name="model_floor_"+d,M.floorIndex=d,u.push(M)}return{objects:u,texturePromise:Promise.all(Object.keys(o).map((function(t){return o[t].catch(Kt)}))).then(Kt)}}function zi(t,e){return!1!==(t=Object.assign({},t)).autoResize&&(t.size=e>96?Math.min(t.size||1/0,100):e>48?Math.min(t.size||1/0,200):e>24?Math.min(t.size||1/0,400):e>12?Math.min(t.size||1/0,800):Math.min(t.size||1/0,1024)),t}function Ki(t){return 0===t.indexOf("//")||/^[0-9a-z]+\:\/\//i.test(t)}Oi.Chunk=(()=>{function t(t){if(t)for(let e=Object.keys(t),i=0;i<e.length;++i)null!=t[e[i]]&&(this[e[i]]=t[e[i]])}return t.prototype.vertices=null,t.prototype.faces=null,t.prototype.name="",t.prototype.texture="",t.decode=function(t,e){t instanceof Ni||(t=Ni.create(t));let i=void 0===e?t.len:t.pos+e,n=new Oi.Chunk;for(;t.pos<i;){let e=t.uint32();switch(e>>>3){case 1:n.vertices=Oi.Vertices.decode(t,t.uint32());break;case 2:n.faces=Oi.Faces.decode(t,t.uint32());break;case 3:n.name=t.string();break;case 4:n.texture=t.string();break;default:t.skipType(7&e)}}if(!n.hasOwnProperty("vertices"))throw Fi.ProtocolError("missing required 'vertices'",{instance:n});if(!n.hasOwnProperty("faces"))throw Fi.ProtocolError("missing required 'faces'",{instance:n});if(!n.hasOwnProperty("name"))throw Fi.ProtocolError("missing required 'name'",{instance:n});return n},t})(),Oi.Vertices=(()=>{function t(t){if(this.xyz=[],this.uvs=[],t)for(let e=Object.keys(t),i=0;i<e.length;++i)null!=t[e[i]]&&(this[e[i]]=t[e[i]])}return t.prototype.xyz=Fi.emptyArray,t.prototype.uvs=Fi.emptyArray,t.decode=function(t,e){t instanceof Ni||(t=Ni.create(t));let i=void 0===e?t.len:t.pos+e,n=new Oi.Vertices;for(;t.pos<i;){let e=t.uint32();switch(e>>>3){case 1:if(n.xyz&&n.xyz.length||(n.xyz=[]),2==(7&e)){let e=t.uint32()+t.pos;for(;t.pos<e;)n.xyz.push(t.float())}else n.xyz.push(t.float());break;case 2:if(n.uvs&&n.uvs.length||(n.uvs=[]),2==(7&e)){let e=t.uint32()+t.pos;for(;t.pos<e;)n.uvs.push(t.float())}else n.uvs.push(t.float());break;default:t.skipType(7&e)}}return n},t})(),Oi.Faces=(()=>{function t(t){if(this.indices=[],t)for(let e=Object.keys(t),i=0;i<e.length;++i)null!=t[e[i]]&&(this[e[i]]=t[e[i]])}return t.prototype.indices=Fi.emptyArray,t.decode=function(t,e){t instanceof Ni||(t=Ni.create(t));let i=void 0===e?t.len:t.pos+e,n=new Oi.Faces;for(;t.pos<i;){let e=t.uint32();switch(e>>>3){case 1:if(n.indices&&n.indices.length||(n.indices=[]),2==(7&e)){let e=t.uint32()+t.pos;for(;t.pos<e;)n.indices.push(t.uint32())}else n.indices.push(t.uint32());break;default:t.skipType(7&e)}}return n},t})();const qi=Di.Reader,ji=Di.util,Ui=Di.roots["@REALSEE/FIVE:five/loaders/model/proto/dome.proto"]||(Di.roots["@REALSEE/FIVE:five/loaders/model/proto/dome.proto"]={}),Gi=Ui.Model=(()=>{function t(t){if(this.meshes=[],t)for(let e=Object.keys(t),i=0;i<e.length;++i)null!=t[e[i]]&&(this[e[i]]=t[e[i]])}return t.prototype.meshes=ji.emptyArray,t.decode=function(t,e){t instanceof qi||(t=qi.create(t));let i=void 0===e?t.len:t.pos+e,n=new Ui.Model;for(;t.pos<i;){let e=t.uint32();switch(e>>>3){case 1:n.meshes&&n.meshes.length||(n.meshes=[]),n.meshes.push(Ui.Mesh.decode(t,t.uint32()));break;default:t.skipType(7&e)}}return n},t})();function _i(t){for(var e=[0,0,0],i=0;i<t.attributes.normal.array.length/9;i++)e[0]=t.attributes.normal.array[9*i],e[1]=t.attributes.normal.array[9*i+1],e[2]=t.attributes.normal.array[9*i+2],t.attributes.normal.array[9*i]=t.attributes.normal.array[9*i+6],t.attributes.normal.array[9*i+1]=t.attributes.normal.array[9*i+7],t.attributes.normal.array[9*i+2]=t.attributes.normal.array[9*i+8],t.attributes.normal.array[9*i+6]=e[0],t.attributes.normal.array[9*i+7]=e[1],t.attributes.normal.array[9*i+8]=e[2];for(i=0;i<t.attributes.position.array.length/9;i++)e[0]=t.attributes.position.array[9*i],e[1]=t.attributes.position.array[9*i+1],e[2]=t.attributes.position.array[9*i+2],t.attributes.position.array[9*i]=t.attributes.position.array[9*i+6],t.attributes.position.array[9*i+1]=t.attributes.position.array[9*i+7],t.attributes.position.array[9*i+2]=t.attributes.position.array[9*i+8],t.attributes.position.array[9*i+6]=e[0],t.attributes.position.array[9*i+7]=e[1],t.attributes.position.array[9*i+8]=e[2];for(i=0;i<t.attributes.uv.array.length/6;i++)e[0]=t.attributes.uv.array[6*i],e[1]=t.attributes.uv.array[6*i+1],t.attributes.uv.array[6*i]=t.attributes.uv.array[6*i+4],t.attributes.uv.array[6*i+1]=t.attributes.uv.array[6*i+5],t.attributes.uv.array[6*i+4]=e[0],t.attributes.uv.array[6*i+5]=e[1];t.attributes.normal.needsUpdate=!0,t.attributes.position.needsUpdate=!0,t.attributes.uv.needsUpdate=!0}function Wi(e){var i=e.position,n=e.normal,r=e.uv,o=e.uv2,s=e.groups,a=new t.BufferGeometry;a.setAttribute("position",new t.BufferAttribute(new Float32Array(i.array),3)),n&&a.setAttribute("normal",new t.BufferAttribute(new Float32Array(n.array),3)),r&&a.setAttribute("uv",new t.BufferAttribute(new Float32Array(r.array),2)),o&&a.setAttribute("uv2",new t.BufferAttribute(new Float32Array(o.array),2));for(var u=0,h=s;u<h.length;u++){var l=h[u];a.addGroup(l.start,l.count,l.materialIndex)}return a}function Xi(e,i,n,r,o,s){if(s.hasOwnProperty(e))return s[e];Ki(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 a=Ft({key:"texture.dome",size:64,basisLoaderInitialized:Ri.isInitialized()},li(n,["quality","format"]));return s[e=n.transform?n.transform(e,a):me(e,a)]=o.load(e,{wrapS:t.RepeatWrapping,wrapT:t.RepeatWrapping,preInit:!0}).then((function(t){var e=t.body;return r&&e.repeat.copy(r),e.needsUpdate=!0,e.updateMatrix(),e}))}function Yi(e,i,n,r,o){var s=[],a=new Pe,u=a.uniforms;u.exposure.value=4.3;var h=a.defines;if(h.USE_MAP=!1,h.USE_UV=!1,e.kd&&(u.diffuse.value=(new t.Color).fromArray(e.kd.rgb)),e.mapkd){var l=null;if(e.mapkdrepeat){var c=e.mapkdrepeat.split(/\s+/).map((function(t){return Number(t)})),d=c[0],p=c[1];l=new t.Vector2(d,p)}s.push(Xi(e.mapkd,i,n,l,r,o).then((function(t){h.USE_MAP=!0,h.USE_UV=!0,u.map.value=t,u.uvTransform.value=t.matrix})).catch(Kt))}if(e.ks&&(u.specular.value=(new t.Color).fromArray(e.ks.rgb)),e.mapks&&s.push(Xi(e.mapks,i,n,null,r,o).then((function(t){u.specularMap.value=t})).catch(Kt)),e.ke&&(u.emissive.value=(new t.Color).fromArray(e.ke.rgb)),e.mapke&&s.push(Xi(e.mapke,i,n,null,r,o).then((function(t){u.emissiveMap.value=t})).catch(Kt)),e.norm&&s.push(Xi(e.norm,i,n,null,r,o).then((function(t){u.normalMap.value=t})).catch(Kt)),e.mapbump&&s.push(Xi(e.mapbump,i,n,null,r,o).then((function(t){u.bumpMap.value=t})).catch(Kt)),e.bump&&s.push(Xi(e.bump,i,n,null,r,o).then((function(t){u.bumpMap.value=t})).catch(Kt)),"number"==typeof e.ns&&(u.shininess.value=e.ns),"number"==typeof e.d){var A=e.d;A>0&&A<1&&(a.originOpacity=A,a.opacity=A)}return{material:a,textureReady:Promise.all(s).then(Kt)}}function Zi(e,i,n,r,o){for(var s,a=[],u=[],h=(s=e,Gi.decode(s).meshes),l=new Qi({allowHosts:r,networkSubscribe:o}),c=new t.Matrix4,d=new t.Vector3,p=new t.Quaternion,A=new t.Vector3,f={},g=0,v=h;g<v.length;g++){var m=v[g],y=m.name,b=m.chunks,w=m.matrix;if("Ceiling"!==y&&"CeilingDrop"!==y)for(var E=0,x=w;E<x.length;E++){var I=x[E];c.elements=I.elements;var C=new we;C.renderOrder=-3;for(var S=0;S<b.length;S++){var B=Wi(b[S].geometry);B.applyMatrix4(c),c.decompose(d,p,A),A.x*A.y*A.z<0&&B.attributes.normal&&B.attributes.position&&B.attributes.uv&&_i(B);for(var M=[],P=0,T=b[S].material;P<T.length;P++){var R=Yi(T[P],i,n,l,f),k=R.material,Q=R.textureReady;u.push(Q),M.push(k)}var D=new ye(B,M);D.name="chunk_"+S,C.add(D)}C.floorIndex=0,C.name=y,a.push(C)}}return{objects:a,texturePromise:Promise.all(u).catch(Kt)}}function Ji(t){return null==t}Ui.Mesh=(()=>{function t(t){if(this.chunks=[],this.matrix=[],t)for(let e=Object.keys(t),i=0;i<e.length;++i)null!=t[e[i]]&&(this[e[i]]=t[e[i]])}return t.prototype.name="",t.prototype.chunks=ji.emptyArray,t.prototype.matrix=ji.emptyArray,t.decode=function(t,e){t instanceof qi||(t=qi.create(t));let i=void 0===e?t.len:t.pos+e,n=new Ui.Mesh;for(;t.pos<i;){let e=t.uint32();switch(e>>>3){case 1:n.name=t.string();break;case 2:n.chunks&&n.chunks.length||(n.chunks=[]),n.chunks.push(Ui.Chunk.decode(t,t.uint32()));break;case 3:n.matrix&&n.matrix.length||(n.matrix=[]),n.matrix.push(Ui.Matrix.decode(t,t.uint32()));break;default:t.skipType(7&e)}}if(!n.hasOwnProperty("name"))throw ji.ProtocolError("missing required 'name'",{instance:n});return n},t})(),Ui.Matrix=(()=>{function t(t){if(this.elements=[],t)for(let e=Object.keys(t),i=0;i<e.length;++i)null!=t[e[i]]&&(this[e[i]]=t[e[i]])}return t.prototype.elements=ji.emptyArray,t.decode=function(t,e){t instanceof qi||(t=qi.create(t));let i=void 0===e?t.len:t.pos+e,n=new Ui.Matrix;for(;t.pos<i;){let e=t.uint32();switch(e>>>3){case 1:if(n.elements&&n.elements.length||(n.elements=[]),2==(7&e)){let e=t.uint32()+t.pos;for(;t.pos<e;)n.elements.push(t.float())}else n.elements.push(t.float());break;default:t.skipType(7&e)}}return n},t})(),Ui.Chunk=(()=>{function t(t){if(this.material=[],t)for(let e=Object.keys(t),i=0;i<e.length;++i)null!=t[e[i]]&&(this[e[i]]=t[e[i]])}return t.prototype.geometry=null,t.prototype.material=ji.emptyArray,t.decode=function(t,e){t instanceof qi||(t=qi.create(t));let i=void 0===e?t.len:t.pos+e,n=new Ui.Chunk;for(;t.pos<i;){let e=t.uint32();switch(e>>>3){case 2:n.geometry=Ui.Geometry.decode(t,t.uint32());break;case 3:n.material&&n.material.length||(n.material=[]),n.material.push(Ui.Material.decode(t,t.uint32()));break;default:t.skipType(7&e)}}if(!n.hasOwnProperty("geometry"))throw ji.ProtocolError("missing required 'geometry'",{instance:n});return n},t})(),Ui.Geometry=(()=>{function t(t){if(this.groups=[],t)for(let e=Object.keys(t),i=0;i<e.length;++i)null!=t[e[i]]&&(this[e[i]]=t[e[i]])}return t.prototype.position=null,t.prototype.uv=null,t.prototype.uv2=null,t.prototype.normal=null,t.prototype.groups=ji.emptyArray,t.decode=function(t,e){t instanceof qi||(t=qi.create(t));let i=void 0===e?t.len:t.pos+e,n=new Ui.Geometry;for(;t.pos<i;){let e=t.uint32();switch(e>>>3){case 1:n.position=Ui.Position.decode(t,t.uint32());break;case 2:n.uv=Ui.UV.decode(t,t.uint32());break;case 3:n.uv2=Ui.UV.decode(t,t.uint32());break;case 4:n.normal=Ui.Normal.decode(t,t.uint32());break;case 5:n.groups&&n.groups.length||(n.groups=[]),n.groups.push(Ui.Group.decode(t,t.uint32()));break;default:t.skipType(7&e)}}if(!n.hasOwnProperty("position"))throw ji.ProtocolError("missing required 'position'",{instance:n});if(!n.hasOwnProperty("normal"))throw ji.ProtocolError("missing required 'normal'",{instance:n});return n},t})(),Ui.Position=(()=>{function t(t){if(this.array=[],t)for(let e=Object.keys(t),i=0;i<e.length;++i)null!=t[e[i]]&&(this[e[i]]=t[e[i]])}return t.prototype.array=ji.emptyArray,t.decode=function(t,e){t instanceof qi||(t=qi.create(t));let i=void 0===e?t.len:t.pos+e,n=new Ui.Position;for(;t.pos<i;){let e=t.uint32();switch(e>>>3){case 1:if(n.array&&n.array.length||(n.array=[]),2==(7&e)){let e=t.uint32()+t.pos;for(;t.pos<e;)n.array.push(t.float())}else n.array.push(t.float());break;default:t.skipType(7&e)}}return n},t})(),Ui.UV=(()=>{function t(t){if(this.array=[],t)for(let e=Object.keys(t),i=0;i<e.length;++i)null!=t[e[i]]&&(this[e[i]]=t[e[i]])}return t.prototype.array=ji.emptyArray,t.decode=function(t,e){t instanceof qi||(t=qi.create(t));let i=void 0===e?t.len:t.pos+e,n=new Ui.UV;for(;t.pos<i;){let e=t.uint32();switch(e>>>3){case 1:if(n.array&&n.array.length||(n.array=[]),2==(7&e)){let e=t.uint32()+t.pos;for(;t.pos<e;)n.array.push(t.float())}else n.array.push(t.float());break;default:t.skipType(7&e)}}return n},t})(),Ui.Normal=(()=>{function t(t){if(this.array=[],t)for(let e=Object.keys(t),i=0;i<e.length;++i)null!=t[e[i]]&&(this[e[i]]=t[e[i]])}return t.prototype.array=ji.emptyArray,t.decode=function(t,e){t instanceof qi||(t=qi.create(t));let i=void 0===e?t.len:t.pos+e,n=new Ui.Normal;for(;t.pos<i;){let e=t.uint32();switch(e>>>3){case 1:if(n.array&&n.array.length||(n.array=[]),2==(7&e)){let e=t.uint32()+t.pos;for(;t.pos<e;)n.array.push(t.float())}else n.array.push(t.float());break;default:t.skipType(7&e)}}return n},t})(),Ui.Group=(()=>{function t(t){if(t)for(let e=Object.keys(t),i=0;i<e.length;++i)null!=t[e[i]]&&(this[e[i]]=t[e[i]])}return t.prototype.start=0,t.prototype.count=0,t.prototype.materialIndex=0,t.decode=function(t,e){t instanceof qi||(t=qi.create(t));let i=void 0===e?t.len:t.pos+e,n=new Ui.Group;for(;t.pos<i;){let e=t.uint32();switch(e>>>3){case 1:n.start=t.uint32();break;case 2:n.count=t.uint32();break;case 3:n.materialIndex=t.uint32();break;default:t.skipType(7&e)}}if(!n.hasOwnProperty("start"))throw ji.ProtocolError("missing required 'start'",{instance:n});if(!n.hasOwnProperty("count"))throw ji.ProtocolError("missing required 'count'",{instance:n});if(!n.hasOwnProperty("materialIndex"))throw ji.ProtocolError("missing required 'materialIndex'",{instance:n});return n},t})(),Ui.Material=(()=>{function t(t){if(t)for(let e=Object.keys(t),i=0;i<e.length;++i)null!=t[e[i]]&&(this[e[i]]=t[e[i]])}return t.prototype.kd=null,t.prototype.ks=null,t.prototype.ke=null,t.prototype.mapkd="",t.prototype.mapks="",t.prototype.mapke="",t.prototype.norm="",t.prototype.mapbump="",t.prototype.bump="",t.prototype.mapd="",t.prototype.ns=0,t.prototype.d=0,t.prototype.tr=0,t.prototype.mapkdrepeat="",t.decode=function(t,e){t instanceof qi||(t=qi.create(t));let i=void 0===e?t.len:t.pos+e,n=new Ui.Material;for(;t.pos<i;){let e=t.uint32();switch(e>>>3){case 1:n.kd=Ui.Color.decode(t,t.uint32());break;case 2:n.ks=Ui.Color.decode(t,t.uint32());break;case 3:n.ke=Ui.Color.decode(t,t.uint32());break;case 4:n.mapkd=t.string();break;case 5:n.mapks=t.string();break;case 6:n.mapke=t.string();break;case 7:n.norm=t.string();break;case 8:n.mapbump=t.string();break;case 9:n.bump=t.string();break;case 10:n.mapd=t.string();break;case 11:n.ns=t.float();break;case 12:n.d=t.float();break;case 13:n.tr=t.float();break;case 14:n.mapkdrepeat=t.string();break;default:t.skipType(7&e)}}return n},t})(),Ui.Color=(()=>{function t(t){if(this.rgb=[],t)for(let e=Object.keys(t),i=0;i<e.length;++i)null!=t[e[i]]&&(this[e[i]]=t[e[i]])}return t.prototype.rgb=ji.emptyArray,t.decode=function(t,e){t instanceof qi||(t=qi.create(t));let i=void 0===e?t.len:t.pos+e,n=new Ui.Color;for(;t.pos<i;){let e=t.uint32();switch(e>>>3){case 1:if(n.rgb&&n.rgb.length||(n.rgb=[]),2==(7&e)){let e=t.uint32()+t.pos;for(;t.pos<e;)n.rgb.push(t.float())}else n.rgb.push(t.float());break;default:t.skipType(7&e)}}return n},t})();var $i=function(e,i){void 0===i&&(i=1e-4),i=Math.max(i,Number.EPSILON);for(var n={},r=e.getIndex(),o=e.getAttribute("position"),s=r?r.count:o.count,a=0,u=Object.keys(e.attributes),h={},l={},c=[],d=["getX","getY","getZ","getW"],p=0,A=u.length;p<A;p++)h[b=u[p]]=[],(I=e.morphAttributes[b])&&(l[b]=new Array(I.length).fill().map((function(){return[]})));var f=Math.log10(1/i),g=Math.pow(10,f);for(p=0;p<s;p++){var v=r?r.getX(p):p,m="",y=0;for(A=u.length;y<A;y++)for(var b=u[y],w=(x=e.getAttribute(b)).itemSize,E=0;E<w;E++)m+="".concat(~~(x[d[E]](v)*g),",");if(m in n)c.push(n[m]);else{for(y=0,A=u.length;y<A;y++){b=u[y];var x=e.getAttribute(b),I=e.morphAttributes[b],C=(w=x.itemSize,h[b]),S=l[b];for(E=0;E<w;E++){var B=d[E];if(C.push(x[B](v)),I)for(var M=0,P=I.length;M<P;M++)S[M].push(I[M][B](v))}}n[m]=a,c.push(a),a++}}var T=e.clone();for(p=0,A=u.length;p<A;p++){b=u[p];var R=e.getAttribute(b),k=new R.array.constructor(h[b]);if(x=new t.BufferAttribute(k,R.itemSize,R.normalized),T.setAttribute(b,x),b in l)for(y=0;y<l[b].length;y++){var Q=e.morphAttributes[b][y],D=(k=new Q.array.constructor(l[b][y]),new t.BufferAttribute(k,Q.itemSize,Q.normalized));T.morphAttributes[b][y]=D}}return T.setIndex(c),T};function tn(e){var i;return new((i=t.Triangle).bind.apply(i,Ot([void 0],e.map((function(e){return new t.Vector3(e.x,e.y,e.z)})),!1)))}var en={at3d:function(t,e){for(var i=zi(e.textureOptions,t.textures.length),n={},r=0,o=t.textures;r<o.length;r++){var s=o[r];n[s]=Vi(s,i,e.allowHosts,e.networkSubscribe)}return Promise.resolve().then((function(){return se(t.file,{responseType:"arraybuffer",allowHosts:e.allowHosts,networkSubscribe:e.networkSubscribe})})).then((function(t){return hi(t.body)})).then((function(t){return ti((function(){for(var e,i={chunks:[]},n=0,r=t;n<r.length;n++){var o=r[n],s=Li.decode(o);s.chunks.length&&(e=i.chunks).push.apply(e,s.chunks)}return i}))})).then((function(r){return ti((function(){return Hi(r,t.textureBase,t.textures.slice(),i,n,e.allowHosts,e.networkSubscribe)}))}))},pbm:function(t,e){for(var i=zi(e.textureOptions,t.textures.length),n={},r=0,o=t.textures;r<o.length;r++){var s=o[r];n[s]=Vi(s,i,e.allowHosts,e.networkSubscribe)}return Promise.resolve().then((function(){return se(t.file,{responseType:"arraybuffer",allowHosts:e.allowHosts,networkSubscribe:e.networkSubscribe})})).then((function(t){return ti((function(){var e=new Uint8Array(t.body);return Li.decode(e)}))})).then((function(r){return ti((function(){return Hi(r,t.textureBase,t.textures.slice(),i,n,e.allowHosts,e.networkSubscribe)}))}))},dome:function(t,e){return Promise.resolve().then((function(){return se(t.file,{responseType:"arraybuffer",allowHosts:e.allowHosts,networkSubscribe:e.networkSubscribe})})).then((function(i){return Zi(new Uint8Array(i.body),t.textureBase,e.textureOptions,e.allowHosts,e.networkSubscribe)}))},domez:function(t,e){return Promise.resolve().then((function(){return se(t.file,{responseType:"arraybuffer",allowHosts:e.allowHosts,networkSubscribe:e.networkSubscribe})})).then((function(t){return hi(t.body)})).then((function(t){var e=t.reduce((function(t,e){return t+e.length}),0),i=new Uint8Array(e),n=0;return t.forEach((function(t){i.set(t,n),n+=t.length})),i})).then((function(i){return Zi(i,t.textureBase,e.textureOptions,e.allowHosts,e.networkSubscribe)}))}},nn=function(e){function i(i){void 0===i&&(i={});var n=e.call(this)||this;return n.empty=!0,n.name="model",n.loaded=!1,n.bvhs=Object.assign([],{loaded:!1}),n.bounding=new t.Box3,n.shownFloor=null,n.floorLength=0,n.networkSubscribe=i.networkSubscribe,n.allowHosts=i.allowHosts,n.renderOrder=-3,n}return Nt(i,e),Object.defineProperty(i.prototype,"shownfloor",{get:function(){return this.shownFloor},enumerable:!1,configurable:!0}),i.prototype.getEdges=function(e){var i;void 0===e&&(e=30/180*Math.PI);for(var n=Math.cos(e),r=[],o=0,s=this.children;o<s.length;o++){var a=s[o];if(a instanceof ye){for(var u={},h=["a","b","c"],l=$i(a.geometry),c=l.getAttribute("position").array,d=(null===(i=l.getIndex())||void 0===i?void 0:i.array)||[],p=[],A=[],f=0,g=c.length;f<g;f+=3)p.push(new t.Vector3(c[f],c[f+1],c[f+2]));for(f=0,g=d.length;f<g;f+=3){var v=d[f],m=d[f+1],y=d[f+2],b=(new t.Vector3).crossVectors(p[m].clone().sub(p[v]),p[y].clone().sub(p[v])).normalize();A.push({a:v,b:m,c:y,normal:b})}for(f=0,g=A.length;f<g;f++)for(var w=A[f],E=0;E<3;E++){var x=w[h[E]],I=w[h[(E+1)%3]],C=[Math.min(x,I),Math.max(x,I)];void 0===u[S=C[0]+"-"+C[1]]?u[S]={index1:C[0],index2:C[1],face1:f}:u[S].face2=f}for(var S in u){var B=u[S];if(void 0===B.face2||A[B.face1].normal.dot(A[B.face2].normal)<=n){var M=p[B.index1],P=p[B.index2];r.push(new t.Line3(M,P))}}l.dispose(),p.length=0,A.length=0}}return r},i.prototype.hasFloors=function(){return this.hasFloors_()},i.prototype.hasFloors_=function(){var t=[];return this.traverse((function(e){e instanceof ye&&(t[e.floorIndex]=!0)})),t.length},i.prototype.show=function(){for(var t,e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];var n=this.shownFloor,r=null,o=1,s=null!==(t=e[1])&&void 0!==t?t:.1,a=0!==e.length;this.shownFloor=r=a?e[0]:null,this.traverse((function(t){t instanceof ye&&t.material.forEach((function(e){null===r||r===t.floorIndex?e.opacity=e.originOpacity*o:e.opacity=e.originOpacity*s}))})),n!==this.shownFloor&&this.emit("shownFloorChange",this.shownFloor,this.floorLength),this.needsRender=!0},i.prototype.intersectRaycaster=function(e,i){var n=e.ray,r=n.origin,o=n.direction;if(Ji(i))if(Ji(this.shownFloor)){var s=this.floorLength;i=[];for(var a=-1;a<s;a++)i.push(a)}else i=[this.shownFloor];var u=[],h=[];Array.isArray(i)?h.push.apply(h,i):h.push(i);for(var l=function(i){var n=c.bvhs&&c.bvhs[i];if(n){var s=new He(r.x,r.y,r.z),a=new He(o.x,o.y,o.z);(h=n.intersectRay(s,a,!0).map((function(e){var i=e.intersectionPoint,n=e.triangle,o=new t.Vector3(i.x,i.y,i.z);return{point:o,face:{normal:tn(n).getNormal(new t.Vector3)},distance:r.distanceTo(o)}}))).length&&u.push.apply(u,h)}else{var h,l=[];c.traverse((function(t){t instanceof ye&&t.floorIndex===i&&l.push(t)})),(h=e.intersectObjects(l).map((function(t){return{face:t.face?{normal:t.face.normal}:void 0,point:t.point,distance:t.distance}}))).length&&u.push.apply(u,h)}},c=this,d=0,p=h;d<p.length;d++)l(p[d]);return u.filter((function(t){var i=t.distance;return i<=e.far&&i>=e.near})).sort((function(t,e){return t.distance-e.distance}))},i.prototype.buildBVH=function(){if(!this.bvhs.loaded){var t=[];this.traverse((function(e){e instanceof ye&&(t[e.floorIndex]=t[e.floorIndex]||[],t[e.floorIndex].push(e.geometry))})),this.bvhs.length=0;for(var e=0,i=t;e<i.length;e++){for(var n=i[e],r=0,o=0,s=n;o<s.length;o++)r+=(c=s[o]).index?c.index.array.length:c.attributes.position.array.length;for(var a=new Float32Array(3*r),u=0,h=0,l=n;h<l.length;h++){var c,d=(c=l[h]).attributes.position.array,p=c.index?c.index.array:null;if(p){for(var A=p.length,f=0,g=void 0,v=void 0;f<A;f++)g=3*(u+f),v=3*p[f],a[g]=d[v],a[g+1]=d[v+1],a[g+2]=d[v+2];u+=A}else{for(A=d.length/3,f=0,g=void 0,v=void 0;f<A;f++)v=3*f,a[g=3*(u+f)]=d[v],a[g+1]=d[v+1],a[g+2]=d[v+2];u+=A}}var m=(new We).create(a).splitNode(50);this.bvhs.push(m)}this.bvhs.loaded=!0,this.emit("bvhLoaded")}},i.prototype.load=function(e,i){var n=this;if(void 0===i&&(i={}),!0===this.loaded)throw new Error("[MODEL LOAD ERROR]: model cannot load twice.");var r=function(t,e){void 0===e&&(e=[]);var i=/([0-9a-z\.\_\-]+)([\?\#].*)?$/i.exec(t);if(!i)return"";for(var n=0,r=String(i[1]).trim().split(".").slice(1).reverse();n<r.length;n++){var o=r[n],s=e.indexOf(o);if(s>=0)return e[s]}return""}(e.file,Object.keys(en)),o=en[r];if(!o)throw new Error("[MODEL LOAD ERROR]: file type(".concat(r,") does not support."));return this.name=e.file,o(e,{textureOptions:i,allowHosts:this.allowHosts,networkSubscribe:this.networkSubscribe}).then((function(e){var i=e.objects,r=e.texturePromise;n.bounding.makeEmpty();for(var o=0,s=i;o<s.length;o++)(l=s[o]).traverse((function(t){if(t instanceof ye){var e=t.geometry;e.boundingBox||e.computeBoundingBox(),e.boundingSphere||e.computeBoundingSphere(),n.bounding.union(e.boundingBox)}})),n.add(l);for(var a=n.bounding.getCenter(new t.Vector3),u=0,h=i;u<h.length;u++){var l;(l=h[u]).traverse((function(t){if(t instanceof ye)for(var e=0,i=t.material;e<i.length;e++)i[e].uniforms.modelCenter.value=a}))}n.floorLength=n.hasFloors_(),n.empty=!1,n.loaded=!0,ti((function(){n.emit("geometryLoaded"),r.then((function(){n.emit("materialLoaded"),n.emit("loaded")}))}))})).catch((function(t){return n.name="",n.emit("error",t),Promise.reject(t)}))},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}(be);Object.assign(nn.prototype,{on:zt.prototype.on,once:zt.prototype.once,off:zt.prototype.off,emit:zt.prototype.emit,hasListener:zt.prototype.hasListener});var rn="Panorama";function on(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var i=[];t=t.map((function(t){return t.trim()})).filter((function(t){return t.length>0&&!/^\/+$/.test(t)}));for(var n=0;n<t.length;n++){var r=0===n,o=n===t.length-1,s=t[n];r||(s=s.replace(/^\/+/,"")),o||(s=s.replace(/\/+$/,"")),i.push(s)}return i.join("/")}function sn(t,e){if(t===e)return!0;if(t&&e&&"object"==typeof t&&"object"==typeof e){if(t.constructor!==e.constructor)return!1;var i,n,r;if(Array.isArray(t)){if((i=t.length)!=e.length)return!1;for(n=i;0!=n--;)if(!sn(t[n],e[n]))return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===e.toString();if((i=(r=Object.keys(t)).length)!==Object.keys(e).length)return!1;for(n=i;0!=n--;)if(!Object.prototype.hasOwnProperty.call(e,r[n]))return!1;for(n=i;0!=n--;){var o=r[n];if(!sn(t[o],e[o]))return!1}return!0}return t!=t&&e!=e}function an(t){return"number"==typeof t}var un=function(){return new Error("Invalid input.")},hn=function(){return new Error("Invalid certificate.")},ln=function(){return new Error("Invalid signature.")};function cn(t,e){void 0===e&&(e=!1);var i=typeof t;if("string"===i)return JSON.stringify(t);if(!0===t)return"true";if(!1===t)return"false";if(null===t)return"null";if(t instanceof Array){for(var n="[",r=t.length-1,o=0;o<r;o++)n+=cn(t[o],!1)+",";return r>-1&&(n+=cn(t[o],!1)),n+"]"}if(t instanceof Object){if("function"==typeof t.toJSON)return cn(t.toJSON(),e);var s=Object.keys(t).sort(),a=s.length;for(n="",o=0;o<a;){var u=s[o],h=cn(t[u],!0);void 0!==h&&(o&&""!==n&&(n+=","),n+=JSON.stringify(u)+":"+h),o++}return"{"+n+"}"}switch(i){case"function":case"undefined":return e?void 0:null;case"number":return 0;default:return isFinite(t)?t:null}}function dn(t){return String(cn(t,!1))}function pn(t){var e,i,n;if(Array.isArray(t)){var r,o,s=void 0;if(t.length<=0)return un();for(var a=function(e){var i=pn(t[e]);if(i instanceof Error)return{value:i};if(s){if(s!==i.issuer)return{value:hn()}}else s=i.issuer;r?i.expire.getTime()<r.getTime()&&(r=i.expire):r=i.expire,o=o?o.filter((function(t){return-1!==i.allowHosts.indexOf(t)})):i.allowHosts},u=0;u<t.length;u++){var h=a(u);if("object"==typeof h)return h.value}return Ut({issuer:s,expire:r,allowHosts:o})}var l=JSON.parse(t),c="undefined"!=typeof location?location.hostname:"",d=Date.now();if("object"!=typeof l)return un();var p=new Date("string"==typeof l.expire_at&&/^\d+$/.test(l.expire_at)?Number(l.expire_at):l.expire_at),A=Array.isArray(l.allow_hosts)?l.allow_hosts:[];if(0===c.length||_t(c)||Zt.filter((function(t){return Wt(t,c)})).length>0){var f=String(null!==(e=l.certificate)&&void 0!==e?e:"");if(f){var g=new Mt;return g.readCertPEM(f),Ut({issuer:g.getSubjectString(),expire:p,allowHosts:A})}return Ut({issuer:"none",expire:p,allowHosts:A})}var v=String(null!==(i=l.certificate)&&void 0!==i?i:"");if(!v)return hn();var m=new Mt;m.readCertPEM(v);var y=String(null!==(n=l._signature)&&void 0!==n?n:"");return y?!1===function(t,e,i){var n=new Mt;if("string"==typeof i?n.readCertPEM(i):n.readCertHex(i.hex),!1===Qt(n))return!1;var r=new et;return r.readCertPubKeyHex(n.hex,6),!!r.verify(t,j(e))}(dn(function(t,e){for(var i={},n=0,r=Object.keys(t);n<r.length;n++){var o=r[n];-1===e.indexOf(o)&&(i[o]=t[o])}return i}(l,["_signature"])),y,m)?ln():d<p.getTime()?0===A.filter((function(t){return Wt(t,c)})).length?function(t){return new Error("host(".concat(JSON.stringify(t),") is not allowed."))}(c):Ut({issuer:m.getSubjectString(),expire:p,allowHosts:A}):function(t){return new Error("date(".concat(t.toString(),") expired."))}(p):ln()}var An=new WeakMap,fn=function(){function t(){this.name="",this.workCode="",this.expire=new Date,this.allowHosts=[],this.initial={mode:rn,latitude:0,longitude:0,panoIndex:0,fov:80},this.observers=[],this.issuer="none",this.raw={works:[""],options:""}}return t.prototype.toJSON=function(){return this.raw.works},t.parse=yn,t}();function gn(t){return null==t?"null":Array.isArray(t)?"dict":"object"==typeof t?"array":"value"}function vn(t,e){var i=gn(t),n=gn(e);if("null"===n)return t;if("value"===n)return e;if(n!==i)return JSON.parse(JSON.stringify(e));if("array"===e)for(var r=0;r<e.length;r++)t[r]=vn(t[r],e[r]);else if("dict"===e)for(var o in e)t[o]=vn(t[o],e[o]);return t}function mn(e,i,n){for(var r,o=JSON.stringify(i),s=[],a=0,u=[].concat(e);a<u.length;a++){var h=u[a];h instanceof fn?s.push.apply(s,h.raw.works):"string"==typeof h?s.push(h):s.push(JSON.stringify(h))}var l=pn(s);if(l instanceof Error)return l;i=JSON.parse(o),e=s.map((function(t){return JSON.parse(t)})).reduce((function(t,e){return vn(t,e)}));var c=new fn;if(l instanceof Error)return l;c.issuer=l.issuer,c.expire=l.expire,c.allowHosts=l.allowHosts,c.raw={works:s,options:o};var d=null!==(r=e.base_url)&&void 0!==r?r:"";d&&"/"!==d[d.length-1]&&(d+="/");var p=function(t,e){return 0===t.indexOf(e)},A=function(t,e){var r,o=t;if(!0===i.jsonp){o=t.replace(/([\?\#].*)?$/i,"");var s=Pt("".concat(o)).slice(0,7);o="".concat(o,".").concat(s,".jsonp")}if(!0===i.shortPath){var a=o.replace(d,"").split("."),u=null!==(r=a.shift())&&void 0!==r?r:"",h=a.join(".");o=on(d,Pt(u))+(h?"."+h:"")}var l=o.replace(d,"");return i.baseURL&&(o=on(i.baseURL,l)),n&&n(t,o,l,e),o},f=function(t,i){var n,r,o,s,a,u,h=t;if(!Ki(t)){var l=null!==(u=null!==(s=null!==(r=null===(n=e.panorama)||void 0===n?void 0:n.pano_high_cube_base_url)&&void 0!==r?r:null===(o=e.panorama)||void 0===o?void 0:o.pano_cube_base_url)&&void 0!==s?s:null===(a=e.panorama)||void 0===a?void 0:a.base_url)&&void 0!==u?u:"";l&&(l=on(l,String(i))),h=on(l,h)}return Ki(h)||(h=on(d,h)),p(h,d)||console.warn("".concat(h," is not start with base_url(").concat(d,").")),A(h,"panorama")},g=function(t){var e=t;return Ki(e)||(e=on(d,t)),p(e,d)||console.warn("".concat(e," is not start with base_url(").concat(d,").")),A(e,"model")},v=function(t,e){void 0===e&&(e="");var i=t;return Ki(i)||(i=on(e,i)),Ki(i)||(i=on(d,i)),p(i,d)||console.warn("".concat(i," is not start with base_url(").concat(d,").")),A(i,"texture")};if(l instanceof Error)return l;if(c.workCode=String(e.work_code||e.code||e.vr_code||e.workCode),c.name=String(e.name),l instanceof Error)return l;if(e.initial&&("Floorplan"!==e.initial.mode&&"Topview"!==e.initial.mode&&"Panorama"!==e.initial.mode&&"VRPanorama"!==e.initial.mode&&"Model"!==e.initial.mode&&"DepthPanorama"!==e.initial.mode||(c.initial.mode=e.initial.mode),an(e.initial.latitude)&&(c.initial.latitude=e.initial.latitude),an(e.initial.longitude)?c.initial.longitude=e.initial.longitude:an(e.initial.heading)&&(c.initial.longitude=-(360*(e.initial.heading-.25)+90)/180*Math.PI),an(e.initial.fov)&&(c.initial.fov=e.initial.fov),an(e.initial.panoIndex)?c.initial.panoIndex=e.initial.panoIndex:an(e.initial.pano_index)?c.initial.panoIndex=e.initial.pano_index:an(e.initial.pano)&&(c.initial.panoIndex=e.initial.pano)),l instanceof Error)return l;if(e.model){var m={bvh:!0,async:!1,textureBase:"",textures:[]};"boolean"==typeof i.modelBvh?m.bvh=i.modelBvh:"boolean"==typeof e.model.bvh?m.bvh=e.model.bvh:"boolean"==typeof e.bvh&&(m.bvh=e.bvh),e.model.file?m.file=g(e.model.file):e.model.file_url&&(m.file=g(e.model.file_url)),e.model.textureBase?m.textureBase=e.model.textureBase:e.model.material_base_url&&(m.textureBase=e.model.material_base_url),Array.isArray(e.model.textures)?m.textures=e.model.textures.map((function(t){return v(t,m.textureBase)})):Array.isArray(e.model.material_textures)&&(m.textures=e.model.material_textures.map((function(t){return v(t,m.textureBase)}))),m.file&&(c.model=m)}if(l instanceof Error)return l;if(e.observers&&Array.isArray(e.observers)){var y=[];e.panorama&&(Array.isArray(e.panorama)?y=e.panorama:Array.isArray(e.panorama.list)?y=e.panorama.list:Array.isArray(e.panorama.info)&&(y=e.panorama.info));for(var b=0;b<e.observers.length;b++){var w={},E=e.observers[b];if(!E)break;var x=y[b];if(!x)break;E=Object.assign({},E,x,{active:!1!==E.active&&!1!==x.active}),w.panoIndex=b,w.active=!1!==E.active,w.loadable=!0===E.loadable,w.images={up:f(E.images?E.images.up:E.up,b),down:f(E.images?E.images.down:E.down,b),right:f(E.images?E.images.right:E.right,b),left:f(E.images?E.images.left:E.left,b),front:f(E.images?E.images.front:E.front,b),back:f(E.images?E.images.back:E.back,b)};var I=E.images?E.images.depth:E.depth;I&&(w.images.depth=f(I,b));var C=E.images?E.images.luminance:E.luminance;C&&(w.images.luminance={up:f(C.up,b),down:f(C.down,b),right:f(C.right,b),left:f(C.left,b),front:f(C.front,b),back:f(C.back,b)});var S=E.images?E.images.tiles:E.tiles;if(S){for(var B=[],M=function(t){var e,i=t.match(/\/cube_(\d+)\//);if(i){var n=Number(i[1]);if(0==((e=n)&e-1)&&0!==e)return n}return!1},P=function(t,e){return t.replace(/\/cube_(\d+)\//,(function(){return"/cube_".concat(e,"/")}))},T=0,R=S;T<R.length;T++){var k=R[T];if("number"==typeof k){var Q=k,D=M(w.images.front);if(!1===D)continue;if((z=Math.max(D,512*Math.pow(2,Q)))>2048){var N=P(w.images.up,z),F=P(w.images.down,z),O=P(w.images.right,z),L=P(w.images.left,z),V=P(w.images.front,z),H=P(w.images.back,z);B.push({level:Q,size:z,up:N,down:F,right:O,left:L,front:V,back:H})}else N=w.images.up,F=w.images.down,O=w.images.right,L=w.images.left,V=w.images.front,H=w.images.back,B.push({level:Q,size:z,up:N,down:F,right:O,left:L,front:V,back:H})}else{var z;if("number"!=typeof(Q=k.level))continue;if("number"!=typeof(z=k.size))continue;N=f(k.up,b),F=f(k.down,b),O=f(k.right,b),L=f(k.left,b),V=f(k.front,b),H=f(k.back,b),B.push({level:Q,size:z,up:N,down:F,right:O,left:L,front:V,back:H})}}B.sort((function(t,e){return t.level-e.level})),w.images.tiles=B}if(E.position instanceof t.Vector3)w.position=E.position.clone();else{if(!Array.isArray(E.position))break;w.position=(new t.Vector3).fromArray(E.position)}if(E.standingPosition instanceof t.Vector3)w.standingPosition=E.standingPosition.clone();else if(Array.isArray(E.standingPosition))w.standingPosition=(new t.Vector3).fromArray(E.standingPosition);else if(E.standing_position instanceof t.Vector3)w.standingPosition=E.standing_position.clone();else{if(!Array.isArray(E.standing_position))break;w.standingPosition=(new t.Vector3).fromArray(E.standing_position)}if(E.quaternion instanceof t.Quaternion)w.quaternion=E.quaternion.clone();else if(Array.isArray(E.quaternion))w.quaternion=(new t.Quaternion).fromArray(E.quaternion);else{if(!E.quaternion)break;var K=E.quaternion,q=K.x,j=K.y,U=K.z,G=K.w;w.quaternion=new t.Quaternion(q,j,U,G)}if(Array.isArray(E.accessibleNodes)?w.accessibleNodes=E.accessibleNodes.slice():Array.isArray(E.accessible_nodes)&&(w.accessibleNodes=E.accessible_nodes.slice()),Array.isArray(E.visibleNodes)?w.visibleNodes=E.visibleNodes.slice():Array.isArray(E.visible_nodes)&&(w.visibleNodes=E.visible_nodes.slice()),an(E.floorIndex)?w.floorIndex=E.floorIndex:an(E.floor_index)?w.floorIndex=E.floor_index:w.floorIndex=0,E.video){var _={};"string"==typeof E.video.source&&(_.source=E.video.source),E.video.matrix instanceof t.Matrix4?_.matrix=E.video.matrix.clone():Array.isArray(E.video.matrix)&&(_.matrix=(new t.Matrix4).fromArray(E.video.matrix)),E.video.size instanceof t.Vector2?_.size=E.video.size.clone():Array.isArray(E.video.size)&&(_.size=(new t.Vector2).fromArray(E.video.size)),_.source&&_.matrix&&_.size&&(w.video=_)}c.observers[b]=w}}if(l instanceof Error)return l;for(var W=0,X=c.observers;W<X.length;W++){if(!(w=X[W]).accessibleNodes){w.accessibleNodes=[];for(var Y=0;Y<c.observers.length;Y++)c.observers[Y]!==w&&w.accessibleNodes.push(Y)}if(!w.visibleNodes)for(w.visibleNodes=[],Y=0;Y<c.observers.length;Y++)c.observers[Y]!==w&&w.visibleNodes.push(Y)}if(l instanceof Error)return l;var Z=Ut(c);return An.set(Z,{works:s,options:o}),Z}function yn(t,e,i){"string"==typeof t&&"{"===t.trim()[0]&&(t=JSON.parse(t));var n=An.get(t);if(n){if(e&&!sn(JSON.parse(n.options),e))throw new Error("[PARSE FAILED]: work is parsed with different options.");return t}var r=mn(t,null!=e?e:{},i);if(r instanceof Error)throw new Error("[PARSE FAILED]: "+r.message);return r}function bn(t,e,i){return t<e?e:t>i?i:t}function wn(t,e,i){return t+(e-t)*i}function En(t,e){var i=e[1]-e[0];return t<e[0]?En(t+i,e):t>=e[1]?En(t-i,e):t}function xn(t,e,i,n){return n?function(t,e,i,n){var r=n[1]-n[0];return t=En(t,n),wn((e=En(e,n))-t>r/2?t+r:t-e>r/2?t-r:t,e,i)}(t,e,i,n):wn(t,e,i)}var In=function(){function t(t){for(var e in this.config={},this.progress=1,this.ended=!0,this.value={},this.startTime=jt(),this.startVelocity=0,this.duration=0,this.keyframes=[],t){var i=t[e];"number"==typeof i?(this.value[e]=i,this.config[e]={circle:!1}):(this.value[e]=i.value,this.config[e]={circle:i.circle})}this.keyframes=[{progress:0,value:Ft({},this.value)},{progress:1,value:Ft({},this.value)}]}return t.prototype.getProgress=function(t){var e=t-this.startTime;return e<0?0:e>=this.duration?1:1-function(t,e,i,n){var r=(e*i+2)/Math.pow(i,3),o=-(2*e*i+3)/Math.pow(i,2),s=e;return r*Math.pow(n,3)+o*Math.pow(n,2)+s*n+1}(0,this.startVelocity,this.duration,e)},t.prototype.getValue=function(t){for(var e=1;e<this.keyframes.length;e++)if(this.keyframes[e].progress>t){var i=this.keyframes[e-1],n=this.keyframes[e],r={};for(var o in this.config){var s=(t-i.progress)/(n.progress-i.progress);r[o]=xn(i.value[o],n.value[o],s,this.config[o].circle)}return r}return Ft({},this.keyframes[this.keyframes.length-1].value)},t.prototype.getProgressVelocity=function(t){var e=t-this.startTime;return e>=this.duration?0:function(t,e,i,n){var r=(e*i+2)/Math.pow(i,3),o=-(2*e*i+3)/Math.pow(i,2),s=e;return 3*r*Math.pow(n,2)+2*o*n+s}(0,this.startVelocity,this.duration,e)},t.prototype.update=function(t){return!!this.ended||(this.progress=Math.min(1,Math.max(0,this.progress,this.getProgress(t))),this.value=this.getValue(this.progress),this.ended=this.progress>=1,this.ended&&this.callbacks&&(this.callbacks[0](),this.callbacks=void 0),this.ended)},t.prototype.getKeyFrameSegment=function(t){for(var e=this.getProgress(t),i=1;i<this.keyframes.length;i++)if(this.keyframes[i].progress>e)return[this.keyframes[i-1],this.keyframes[i]];return[this.keyframes[this.keyframes.length-2],this.keyframes[this.keyframes.length-1]]},t.prototype.getTargetKeyframe=function(){return this.keyframes[this.keyframes.length-1]},t.prototype.set=function(t,e,i,n){var r;void 0===i&&(i=0),n=null!=n?n:jt();var o=this.getProgress(n),s=this.getValue(o),a={};for(var u in this.config)a[u]=null!==(r=t[u])&&void 0!==r?r:s[u];var h=[{progress:0,value:s},{progress:1,value:a}];return this.setKeyframes(h,e,i,n)},t.prototype.setKeyframes=function(t,e,i,n){var r=this;if(void 0===i&&(i=0),t.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,s){n=null!=n?n:jt(),r.progress=0,r.ended=!1,r.startTime=n,r.startVelocity=i,r.keyframes=t,r.duration=e,0===e?(r.progress=1,r.value=Ft({},t[t.length-1].value)):r.value=Ft({},t[0].value),r.callbacks=[o,s]}))},t.prototype.dispose=function(){this.callbacks&&(this.callbacks[1](new Error("motion dispose.")),this.callbacks=void 0)},t}(),Cn=Ie(),Sn=new t.Texture(Cn);Cn.onload=function(){return Sn.needsUpdate=!0},Cn.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAR9JREFUOBF10kFOAzEMBdCZFhCbrrgAN+NqHIULsWKDKO3gF+VHoZpa+rXjfH87nq7btr0ty3KZ8FsxnHeQPL748lA/x0Jsq+AwYe0X8nDtGA33BEJUHIEKW/EorHOLI7BHNlkEbju38YkQAIRZxFkHz2HOirKDxNcIzG+fu/6oLiNmqc5ZrlwTeKyAgJF14tMZmSn87pBrxeX/CRABgk/dl1s+C18dio2Pp9nmCQru2UtdvN+7lI9AFsgb3zNMcSp8FF4LYs3UhLfOAvkDJffci8q1J/ByRLKnQ8gUJUFOd2SeZYliCxwiyJCxCbhUGFKF4zPm61hiq7sVyJnPmATyR5IzLSNyDNEFRCDnkAmA8U2RfCsIefYhDeKOQLv7A+l1ZTyjymNxAAAAAElFTkSuQmCC";var Bn=new t.RingBufferGeometry(.06,.07,32).rotateX(-Math.PI/2),Mn=new t.MeshBasicMaterial({map:Sn,transparent:!0}),Pn=new t.SphereBufferGeometry(.12,16,16),Tn=new t.MeshBasicMaterial({color:16777215,opacity:0,transparent:!0});function Rn(){if("undefined"==typeof document){var e=new t.Texture;return Object.assign(e,{draw:function(t){},retain:!1,pool:!1})}var i=document.createElement("canvas"),n=512,r=256,o=190;i.setAttribute("width",String(n)),i.setAttribute("height",String(n));var s=new t.Texture(i),a=i.getContext("2d");if(!a)throw Error("cannot create canvas context");var u=a.createRadialGradient(r,r,150,r,r,0);function h(){var t=Math.PI/12,e=2*Math.PI/3;a&&(a.beginPath(),a.arc(r,r,o,0*e,1*e-t),a.stroke(),a.beginPath(),a.arc(r,r,o,1*e,2*e-t),a.stroke(),a.beginPath(),a.arc(r,r,o,2*e,3*e-t),a.stroke())}function l(t){a&&(a.clearRect(0,0,n,n),a.lineWidth=20,-1!==t&&(a.globalCompositeOperation="source-over",a.strokeStyle="rgba(255, 255, 255, 1)",h(),a.globalCompositeOperation="source-in",a.beginPath(),a.arc(r,r,o,0,2*Math.PI*t),a.strokeStyle="rgba(255, 255, 255, 1)",a.stroke(),a.globalCompositeOperation="source-over",a.strokeStyle="rgba(255, 255, 255, "+(t?.5:1)+")",h()),a.beginPath(),a.arc(r,r,150,0,2*Math.PI),a.closePath(),a.fillStyle=u,a.fill(),a.fillStyle="rgba(255, 255, 255, 0.01)",a.fillRect(0,0,n,n),s.needsUpdate=!0)}return u.addColorStop(0,"rgba(255, 255, 255, 1)"),u.addColorStop(.15,"rgba(255, 255, 255, 1)"),u.addColorStop(.15,"rgba(255, 255, 255, 0.5)"),u.addColorStop(.4,"rgba(255, 255, 255, 0.0)"),u.addColorStop(1,"rgba(255, 255, 255, 0.0)"),l(0),Object.assign(s,{draw:l,retain:!1,pool:!1})}var kn=[],Qn=Rn();Qn.draw(0);var Dn=Rn();Dn.draw(1);var Nn=Rn();Nn.draw(-1);var Fn=new t.CircleBufferGeometry(.12,32).rotateX(-Math.PI/2);var On=function(e){function i(){var i=e.call(this)||this;return i.loading=!1,i.disabled=!1,i.current=!1,i.progress=0,i.opacity=0,i.hitTestMesh=new t.Mesh(Pn,Tn),i.add(i.hitTestMesh),i.centerMesh=new t.Mesh(Fn,new t.MeshBasicMaterial({map:Qn,transparent:!0})),i.centerMesh.position.y+=.01,i.add(i.centerMesh),i.loadingMesh=new t.Mesh(Bn,Mn),i.loadingMesh.position.y+=.011,i.progressMotion=new In({progress:i.progress}),i.opacityMotion=new In({opacity:i.opacity}),i.needsRender=!0,i.renderOrder=-2,i}return Nt(i,e),i.prototype.setLoading=function(e){var i=this;this.loading=e,this.stopInterval&&this.stopInterval(),e?(this.add(this.loadingMesh),this.stopInterval=ce.shared.add((function(){i.loadingMesh.rotateOnAxis(new t.Vector3(0,1,0),.1),i.needsRender=!0}))):this.remove(this.loadingMesh),this.needsRender=!0},i.prototype.setDisabled=function(t){this.disabled=t,function(t,e){var i=t.map;!0===i.pool&&(i.retain=!1),t.map=e?Nn:Qn}(this.centerMesh.material,t),this.needsRender=!0},i.prototype.setProgress=function(t){this.setLoading(!1),this.setDisabled(!1),this.progress=t=bn(t,0,1),t!==this.progressMotion.getTargetKeyframe().value.progress&&this.progressMotion.set({progress:t},120).catch(Kt)},i.prototype.setOpacity=function(t){this.opacity=t=bn(t,0,1),this.current&&(t=1),t!==this.opacityMotion.getTargetKeyframe().value.opacity&&this.opacityMotion.set({opacity:t},500).catch(Kt)},i.prototype.setCurrent=function(t){this.current!==t&&(this.current=t,this.setOpacity(this.opacity))},i.prototype.updateTime=function(t,e){this.opacityMotion.ended||(this.opacityMotion.update(t),this.centerMesh.material.opacity=this.opacityMotion.value.opacity,this.needsRender=!0),this.progressMotion.ended||(this.progressMotion.update(t),function(t,e){var i=t.map;0===e||1===e?(!0===i.pool&&(i.retain=!1),0===e&&(t.map=Qn),1===e&&(t.map=Dn)):(!0!==i.pool&&(t.map=function(){for(var t=0,e=kn;t<e.length;t++){var i=e[t];if(!1===i.retain)return i}var n=Rn();return n.pool=!0,n.retain=!0,kn.push(n),n}()),t.map.draw(e))}(this.centerMesh.material,this.progressMotion.value.progress),this.needsRender=!0)},i.prototype.dispose=function(){this.setLoading(!1),this.remove(this.hitTestMesh),this.remove(this.centerMesh),this.remove(this.loadingMesh),this.centerMesh.material.dispose()},i}(t.Object3D),Ln=new Float32Array([-.13,0,-.13,.13,0,-.13,-.13,0,.13,.13,0,.13]),Vn=new Float32Array([0,1,1,1,0,0,1,0]),Hn=new Uint8Array([0,2,1,2,3,1]),zn=new t.BufferGeometry;zn.setAttribute("position",new t.BufferAttribute(Ln,3)),zn.setAttribute("uv",new t.BufferAttribute(Vn,2)),zn.setIndex(new t.BufferAttribute(Hn,1));var Kn,qn,jn=(Kn=Ie(),qn=new t.Texture,Kn.onload=function(){if("undefined"!=typeof document){var t=256,e=document.createElement("canvas");e.setAttribute("width",String(t)),e.setAttribute("height",String(t));var i=e.getContext("2d");if(i){i.drawImage(Kn,0,0,t,t),i.globalCompositeOperation="source-out";i.beginPath(),i.lineWidth=29.952,i.arc(128,128,84.48,0,2*Math.PI),i.strokeStyle="rgba(255, 255, 255, 0.5)",i.closePath(),i.stroke(),qn.image=e,qn.needsUpdate=!0}}},Kn.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAR9JREFUOBF10kFOAzEMBdCZFhCbrrgAN+NqHIULsWKDKO3gF+VHoZpa+rXjfH87nq7btr0ty3KZ8FsxnHeQPL748lA/x0Jsq+AwYe0X8nDtGA33BEJUHIEKW/EorHOLI7BHNlkEbju38YkQAIRZxFkHz2HOirKDxNcIzG+fu/6oLiNmqc5ZrlwTeKyAgJF14tMZmSn87pBrxeX/CRABgk/dl1s+C18dio2Pp9nmCQru2UtdvN+7lI9AFsgb3zNMcSp8FF4LYs3UhLfOAvkDJffci8q1J/ByRLKnQ8gUJUFOd2SeZYliCxwiyJCxCbhUGFKF4zPm61hiq7sVyJnPmATyR5IzLSNyDNEFRCDnkAmA8U2RfCsIefYhDeKOQLv7A+l1ZTyjymNxAAAAAElFTkSuQmCC",qn),Un=function(){if("undefined"!=typeof document){var e=document.createElement("canvas");e.setAttribute("width",String(512)),e.setAttribute("height",String(512));var i=e.getContext("2d");if(i){var n=256,r=199.68;return i.beginPath(),i.arc(n,n,r,0,2*Math.PI),i.fillStyle="rgba(255, 255, 255, 0.1)",i.closePath(),i.fill(),i.save(),i.beginPath(),i.arc(n,n,r,0,2*Math.PI),i.strokeStyle="rgba(255, 255, 255, 0.5)",i.lineWidth=10.24,i.closePath(),i.stroke(),new t.CanvasTexture(e)}}return null}(),Gn=function(){if("undefined"!=typeof document){var e=document.createElement("canvas");e.setAttribute("width",String(512)),e.setAttribute("height",String(512));var i=e.getContext("2d");if(i){var n=256,r=138.24,o=i.createLinearGradient(n-Math.cos(Math.PI/4)*r,n-Math.sin(Math.PI/4)*r,n+Math.cos(Math.PI/4)*r,n+Math.sin(Math.PI/4)*r);return o.addColorStop(0,"rgba(255, 255, 255, 1)"),o.addColorStop(.5,"rgba(255, 255, 255, 0.6)"),o.addColorStop(1,"rgba(255, 255, 255, 1)"),i.beginPath(),i.lineWidth=33.28,i.arc(n,n,r,0,2*Math.PI),i.strokeStyle=o,i.shadowBlur=38.4,i.shadowColor="rgba(0, 0, 0, 0.3)",i.closePath(),i.stroke(),new t.CanvasTexture(e)}}return null}(),_n=function(){if("undefined"!=typeof document){var e=document.createElement("canvas");e.setAttribute("width",String(512)),e.setAttribute("height",String(512));var i=e.getContext("2d");if(i){var n=256,r=199.68,o=i.createLinearGradient(n+Math.cos(Math.PI/4)*r,n-Math.sin(Math.PI/4)*r,n-Math.cos(Math.PI/4)*r,n+Math.sin(Math.PI/4)*r);return o.addColorStop(0,"rgba(255, 255, 255, 0.5)"),o.addColorStop(.5,"rgba(255, 255, 255, 0.1)"),o.addColorStop(1,"rgba(255, 255, 255, 0.5)"),i.beginPath(),i.lineWidth=15.36,i.arc(n,n,r,0,2*Math.PI),i.strokeStyle=o,i.shadowBlur=25.6,i.shadowColor="rgba(0, 0, 0, 0.5)",i.closePath(),i.stroke(),new t.CanvasTexture(e)}}return null}(),Wn=function(t,e){t.clearRect(0,0,256,256),t.beginPath(),t.lineWidth=29.44,t.arc(128,128,84.48,0,2*Math.PI*e),t.strokeStyle="rgba(255, 255, 255, 0.2)",t.stroke()},Xn=function(){if("undefined"!=typeof document){var e=document.createElement("canvas");e.setAttribute("width",String(256)),e.setAttribute("height",String(256));var i=e.getContext("2d");i&&Wn(i,2*Math.PI);var n=new t.CanvasTexture(e);return Object.assign(n,{setProgress:function(t){i&&(Wn(i,t),n.needsUpdate=!0)}})}return null},Yn=[],Zn=Xn(),Jn=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 In({angle:0}),i.tapMotion=new In({scale:1,opacity:1}),i.progressMotion=new In({progress:0}),i.progressOpacityMotion=new In({opacity:0}),i.opacityMotion=new In({opacity:0});var n={blending:t.CustomBlending,blendSrc:t.SrcAlphaFactor,blendDst:t.OneMinusSrcAlphaFactor,blendSrcAlpha:t.OneFactor,blendDstAlpha:t.OneMinusSrcAlphaFactor,depthWrite:!1};return i.centerMesh=new t.Mesh(zn,new t.MeshBasicMaterial(Ft(Ft({},n),{map:Gn}))),i.ringMesh=new t.Mesh(zn,new t.MeshBasicMaterial(Ft(Ft({},n),{map:_n}))),i.loadingMesh=new t.Mesh(zn,new t.MeshBasicMaterial(Ft(Ft({},n),{map:jn,opacity:.5}))),i.disableMesh=new t.Mesh(zn,new t.MeshBasicMaterial(Ft(Ft({},n),{map:Un}))),i.progressMesh=new t.Mesh(zn,new t.MeshBasicMaterial(Ft(Ft({},n),{map:Zn,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.renderOrder=-2,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 Nt(i,e),i.prototype.setProgress=function(t){this.setDisabled(!1),this.setLoading(!1),this.progress!==t&&(t=bn(t,0,1),this.tapMotion.ended&&(0===this.progress&&this.progressOpacityMotion.set({opacity:1},300).catch(Kt),0===t?(this.progressOpacityMotion.set({opacity:0},300).catch(Kt),this.progressMotion.set({progress:bn(1.2*t,0,1)},0).catch(Kt)):this.progressMotion.set({progress:bn(1.2*t,0,1)},100).catch(Kt)),this.progress=t)},i.prototype.setOpacity=function(t){this.opacity!==t&&(this.opacity=t=bn(t,0,1),this.opacityMotion.set({opacity:t},500).catch(Kt))},i.prototype.setCurrent=function(t){if(this.current!==t){if(!0===t&&this.ringRotateMotion.ended){var e=[{progress:0,value:{angle:0}},{progress:1,value:{angle:2*Math.PI}}];this.ringRotateMotion.setKeyframes(e,5e3).catch(Kt)}this.current=t}},i.prototype.setLoading=function(t){this.loading!==t&&(this.loading=t,!0===this.disabled&&this.setDisabled(!1),this.loadingMesh.visible=t,this.needsRender=!0)},i.prototype.setDisabled=function(t){this.disabled!==t&&(this.disabled=t,!0===this.loading&&this.setLoading(!1),this.disableMesh.visible=t,this.ringMesh.visible=!t,this.centerMesh.visible=!t,this.needsRender=!0)},i.prototype.tap=function(){var t=this;return this.tapMotion.ended?(this.progressOpacityMotion.set({opacity:0},0).catch(Kt),this.progressMotion.set({progress:0},0).catch(Kt),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(){t.progressOpacityMotion.set({opacity:t.progress>0?1:0},300).catch(Kt),t.progressMotion.set({progress:t.progress},120).catch(Kt)})).catch(Kt)):Promise.resolve()},i.prototype.updateTime=function(e,i){var n;if(!this.progressMotion.ended){this.progressMotion.update(e);var r=this.progressMotion.value.progress;if(null!==this.progressMesh.material.map)if(0===r)this.progressMesh.material.map!==Zn&&(Yn.push(this.progressMesh.material.map),this.progressMesh.material.map=Zn);else if(1===r)this.progressMesh.material.map!==Zn&&(Yn.push(this.progressMesh.material.map),this.progressMesh.material.map=Zn);else{if(this.progressMesh.material.map===Zn){var o=Yn.pop()||Xn();this.progressMesh.material.map=o}null===(n=this.progressMesh.material.map)||void 0===n||n.setProgress(r)}this.needsRender=!0}if(!this.progressOpacityMotion.ended){this.progressOpacityMotion.update(e);var s=this.progressOpacityMotion.value.opacity;this.progressMesh.material.opacity=s,this.needsRender=!0}if(this.opacityMotion.ended||(this.opacityMotion.update(e),s=this.opacityMotion.value.opacity*this.tapMotion.value.opacity,this.centerMesh.material.opacity=s,this.ringMesh.material.opacity=s,this.disableMesh.material.opacity=s,this.loadingMesh.material.opacity=s,this.needsRender=!0),!0===this.loadingMesh.visible&&(this.loadingMesh.rotateY(-i/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),s=this.opacityMotion.value.opacity*this.tapMotion.value.opacity,this.centerMesh.material.opacity=s,this.ringMesh.material.opacity=s,this.disableMesh.material.opacity=s,this.loadingMesh.material.opacity=s,this.needsRender=!0}this.ringRotateMotion.ended||(this.ringRotateMotion.update(e),this.ringMesh.quaternion.setFromEuler(new t.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!==Zn&&(Yn.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}(t.Object3D),$n=new t.CircleBufferGeometry(.1,16),tr=function(){if("undefined"!=typeof document){var e=document.createElement("canvas");e.setAttribute("width",String(512)),e.setAttribute("height",String(512));var i=e.getContext("2d");if(i){var n=256;i.lineWidth=76.8,i.arc(n,n,192,0,2*Math.PI),i.strokeStyle="rgba(147, 162, 255, 0.3)",i.shadowBlur=12.8,i.shadowColor="rgba(255, 255, 255, 0.6)",i.stroke(),i.lineWidth=76.8,i.arc(n,n,192,0,2*Math.PI);var r=i.createRadialGradient(n,n,153.6,n,n,230.4);r.addColorStop(0,"rgba(255, 255, 255, 0.3)"),r.addColorStop(.3,"rgba(255, 255, 255, 0.0)"),r.addColorStop(.7,"rgba(255, 255, 255, 0.0)"),r.addColorStop(1,"rgba(255, 255, 255, 0.3)"),i.strokeStyle=r,i.stroke(),i.beginPath(),i.lineWidth=4.8,i.arc(n,n,228,0,2*Math.PI);var o=i.createLinearGradient(0,0,512,0);return o.addColorStop(.02,"rgba(255, 255, 255, 1.0)"),o.addColorStop(.08,"rgba(255, 255, 255, 0.0)"),o.addColorStop(.92,"rgba(255, 255, 255, 0.0)"),o.addColorStop(.98,"rgba(255, 255, 255, 1.0)"),i.strokeStyle=o,i.stroke(),new t.CanvasTexture(e)}}return null}(),er=new t.MeshBasicMaterial({map:tr,transparent:!0}),ir=function(e){function i(){var i=e.call(this)||this;return i.ringMesh=new t.Mesh($n,er),i.ringMesh.renderOrder=-3,i.add(i.ringMesh),i}return Nt(i,e),i.prototype.dispose=function(){this.remove(this.ringMesh)},i}(t.Object3D);function nr(){return(65536*(1+Math.random())|0).toString(16).substring(1)}function rr(){return(nr()+nr()+"-"+nr()+"-4"+nr().substr(0,3)+"-"+nr()+"-"+nr()+nr()+nr()).toLowerCase()}function or(t,e,i){var n=Math.abs(t-e);return n<.001||void 0!==i&&Math.abs(i-n)<.001}function sr(t,e,i){return!or(t,e,i)}function ar(t,e){return t.distanceTo(e)<.001}function ur(t,e){return!ar(t,e)}var hr=new t.Vector3(0,0,0),lr=function(e){function i(i,n){void 0===n&&(n=hr);var r=e.call(this)||this,o=new t.BoxBufferGeometry(i.max.x-i.min.x+2*n.x,i.max.y-i.min.y+2*n.y,i.max.z-i.min.z+2*n.z,1,1);o.groups.length=0,o.groups.push({start:0,count:36,materialIndex:0}),o.applyMatrix4((new t.Matrix4).makeScale(-1,1,1));var s=new Pe;s.defines.USE_MAP=!1,s.defines.USE_UV=!1,s.uniforms.diffuse.value=new t.Color(16777215);var a=new ye(o,[s]);return a.floorIndex=-1,a.position.copy(i.getCenter(new t.Vector3)),a.frustumCulled=!1,r.renderOrder=-3,r.add(a),r.boundingBox=new t.Box3,r.computeBoundingBox(),r}return Nt(i,e),i.prototype.computeBoundingBox=function(){this.boundingBox.setFromObject(this)},i.prototype.dispose=function(){this.disposeMaterial(),this.disposeGeometry()},i}(we);function cr(t,e){return void 0===e&&(e=hr),new lr(t,e)}var dr=2*Math.PI;function pr(t){return t>=0&&t<dr?t:(t%dr+dr)%dr}var Ar=Math.PI,fr=2*Ar;function gr(t,e,i){if(t===e)return e;var n=e-t;return Math.abs(n)<=i?e:t+(n>0?1:-1)*i}(function(){try{var t=document.createElement("canvas");!window.WebGLRenderingContext||!t.getContext("webgl")&&t.getContext("experimental-webgl")}catch(t){return!1}})(),"undefined"!=typeof history&&"pushState"in history&&"replaceState"in history&&history;var vr=function(){var t="undefined"!=typeof navigator?navigator.userAgent.toLowerCase():"node";return/android/i.test(t)||/webos/i.test(t)||/ipad|iphone|ipod/i.test(t)||/iemobile/i.test(t)||/opera mini/i.test(t)||/blackberry/i.test(t)||/windows phone/i.test(t)};function mr(t,e){t.mode=e.mode,t.panoIndex=e.panoIndex,t.longitude=e.longitude,t.latitude=e.latitude,t.fov=e.fov,t.offset.copy(e.offset)}function yr(t,e){return t.panoIndex===e.panoIndex&&t.mode===e.mode&&or(t.longitude,e.longitude,2*Math.PI)&&or(t.latitude,e.latitude)&&or(t.fov,e.fov)&&ar(t.offset,e.offset)}var br=function(t){return Number(t)};function wr(t,e,i){var n;void 0===e&&(e=br),void 0===i&&(i=!1);for(var r,o=1/0,s=0,a=t;s<a.length;s++){var u=a[s],h=e(u);h<=o&&(r=(n=[u,h])[0],o=n[1])}return i?[r,o]:r}function Er(t){for(var e in t)return!1;return!0}function xr(t){return{longitude:t.longitude,latitude:t.latitude,fov:t.fov,offset:t.offset.clone()}}const Ir=function(t,e,i,n){var r,o=["","webkit","Moz","MS","ms","o"],s=e.createElement?e.createElement("div"):n,a=Math.round,u=Math.abs,h=Date.now;function l(t,e,i){return setTimeout(v(t,i),e)}function c(t,e,i){return!!Array.isArray(t)&&(d(t,i[e],i),!0)}function d(t,e,i){var r;if(t)if(t.forEach)t.forEach(e,i);else if(t.length!==n)for(r=0;r<t.length;)e.call(i,t[r],r,t),r++;else for(r in t)t.hasOwnProperty(r)&&e.call(i,t[r],r,t)}function p(e,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",o=t.console&&(t.console.warn||t.console.log);return o&&o.call(t.console,r,n),e.apply(this,arguments)}}r="function"!=typeof Object.assign?function(t){if(t===n||null===t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),i=1;i<arguments.length;i++){var r=arguments[i];if(r!==n&&null!==r)for(var o in r)r.hasOwnProperty(o)&&(e[o]=r[o])}return e}:Object.assign;var A=p((function(t,e,i){for(var r=Object.keys(e),o=0;o<r.length;)(!i||i&&t[r[o]]===n)&&(t[r[o]]=e[r[o]]),o++;return t}),"extend","Use `assign`."),f=p((function(t,e){return A(t,e,!0)}),"merge","Use `assign`.");function g(t,e,i){var n,o=e.prototype;(n=t.prototype=Object.create(o)).constructor=t,n._super=o,i&&r(n,i)}function v(t,e){return function(){return t.apply(e,arguments)}}function m(t,e){return"function"==typeof t?t.apply(e&&e[0]||n,e):t}function y(t,e){return t===n?e:t}function b(t,e,i){d(I(e),(function(e){t.addEventListener(e,i,!1)}))}function w(t,e,i){d(I(e),(function(e){t.removeEventListener(e,i,!1)}))}function E(t,e){for(;t;){if(t==e)return!0;t=t.parentNode}return!1}function x(t,e){return t.indexOf(e)>-1}function I(t){return t.trim().split(/\s+/g)}function C(t,e,i){if(t.indexOf&&!i)return t.indexOf(e);for(var n=0;n<t.length;){if(i&&t[n][i]==e||!i&&t[n]===e)return n;n++}return-1}function S(t){return Array.prototype.slice.call(t,0)}function B(t,e,i){for(var n=[],r=[],o=0;o<t.length;){var s=e?t[o][e]:t[o];C(r,s)<0&&n.push(t[o]),r[o]=s,o++}return i&&(n=e?n.sort((function(t,i){return t[e]>i[e]})):n.sort()),n}function M(t,e){for(var i,r,s=e[0].toUpperCase()+e.slice(1),a=0;a<o.length;){if((r=(i=o[a])?i+s:e)in t)return r;a++}return n}var P=1;function T(e){var i=e.ownerDocument||e;return i.defaultView||i.parentWindow||t}var R="ontouchstart"in t,k=M(t,"PointerEvent")!==n,Q=R&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),D="touch",N="mouse",F=["x","y"],O=["clientX","clientY"];function L(t,e){var i=this;this.manager=t,this.callback=e,this.element=t.element,this.target=t.options.inputTarget,this.domHandler=function(e){m(t.options.enable,[t])&&i.handler(e)},this.init()}function V(t,e,i){var r=i.pointers.length,o=i.changedPointers.length,s=1&e&&r-o==0,a=12&e&&r-o==0;i.isFirst=!!s,i.isFinal=!!a,s&&(t.session={}),i.eventType=e,function(t,e){var i=t.session,r=e.pointers,o=r.length;i.firstInput||(i.firstInput=H(e)),o>1&&!i.firstMultiple?i.firstMultiple=H(e):1===o&&(i.firstMultiple=!1);var s=i.firstInput,a=i.firstMultiple,l=a?a.center:s.center,c=e.center=z(r);e.timeStamp=h(),e.deltaTime=e.timeStamp-s.timeStamp,e.angle=U(l,c),e.distance=j(l,c),function(t,e){var i=e.center,n=t.offsetDelta||{},r=t.prevDelta||{},o=t.prevInput||{};1!==e.eventType&&4!==o.eventType||(r=t.prevDelta={x:o.deltaX||0,y:o.deltaY||0},n=t.offsetDelta={x:i.x,y:i.y}),e.deltaX=r.x+(i.x-n.x),e.deltaY=r.y+(i.y-n.y)}(i,e),e.offsetDirection=q(e.deltaX,e.deltaY);var d=K(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=d.x,e.overallVelocityY=d.y,e.overallVelocity=u(d.x)>u(d.y)?d.x:d.y,e.scale=a?function(t,e){return j(e[0],e[1],O)/j(t[0],t[1],O)}(a.pointers,r):1,e.rotation=a?function(t,e){return U(e[1],e[0],O)+U(t[1],t[0],O)}(a.pointers,r):0,e.maxPointers=i.prevInput?e.pointers.length>i.prevInput.maxPointers?e.pointers.length:i.prevInput.maxPointers:e.pointers.length,function(t,e){var i,r,o,s,a=t.lastInterval||e,h=e.timeStamp-a.timeStamp;if(8!=e.eventType&&(h>25||a.velocity===n)){var l=e.deltaX-a.deltaX,c=e.deltaY-a.deltaY,d=K(h,l,c);r=d.x,o=d.y,i=u(d.x)>u(d.y)?d.x:d.y,s=q(l,c),t.lastInterval=e}else i=a.velocity,r=a.velocityX,o=a.velocityY,s=a.direction;e.velocity=i,e.velocityX=r,e.velocityY=o,e.direction=s}(i,e);var p=t.element;E(e.srcEvent.target,p)&&(p=e.srcEvent.target),e.target=p}(t,i),t.emit("hammer.input",i),t.recognize(i),t.session.prevInput=i}function H(t){for(var e=[],i=0;i<t.pointers.length;)e[i]={clientX:a(t.pointers[i].clientX),clientY:a(t.pointers[i].clientY)},i++;return{timeStamp:h(),pointers:e,center:z(e),deltaX:t.deltaX,deltaY:t.deltaY}}function z(t){var e=t.length;if(1===e)return{x:a(t[0].clientX),y:a(t[0].clientY)};for(var i=0,n=0,r=0;r<e;)i+=t[r].clientX,n+=t[r].clientY,r++;return{x:a(i/e),y:a(n/e)}}function K(t,e,i){return{x:e/t||0,y:i/t||0}}function q(t,e){return t===e?1:u(t)>=u(e)?t<0?2:4:e<0?8:16}function j(t,e,i){i||(i=F);var n=e[i[0]]-t[i[0]],r=e[i[1]]-t[i[1]];return Math.sqrt(n*n+r*r)}function U(t,e,i){i||(i=F);var n=e[i[0]]-t[i[0]],r=e[i[1]]-t[i[1]];return 180*Math.atan2(r,n)/Math.PI}L.prototype={handler:function(){},init:function(){this.evEl&&b(this.element,this.evEl,this.domHandler),this.evTarget&&b(this.target,this.evTarget,this.domHandler),this.evWin&&b(T(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(T(this.element),this.evWin,this.domHandler)}};var G={mousedown:1,mousemove:2,mouseup:4},_="mousedown",W="mousemove mouseup";function X(){this.evEl=_,this.evWin=W,this.pressed=!1,L.apply(this,arguments)}g(X,L,{handler:function(t){var e=G[t.type];1&e&&0===t.button&&(this.pressed=!0),2&e&&1!==t.which&&(e=4),this.pressed&&(4&e&&(this.pressed=!1),this.callback(this.manager,e,{pointers:[t],changedPointers:[t],pointerType:N,srcEvent:t}))}});var Y={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},Z={2:D,3:"pen",4:N,5:"kinect"},J="pointerdown",$="pointermove pointerup pointercancel";function tt(){this.evEl=J,this.evWin=$,L.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}t.MSPointerEvent&&!t.PointerEvent&&(J="MSPointerDown",$="MSPointerMove MSPointerUp MSPointerCancel"),g(tt,L,{handler:function(t){var e=this.store,i=!1,n=t.type.toLowerCase().replace("ms",""),r=Y[n],o=Z[t.pointerType]||t.pointerType,s=o==D,a=C(e,t.pointerId,"pointerId");1&r&&(0===t.button||s)?a<0&&(e.push(t),a=e.length-1):12&r&&(i=!0),a<0||(e[a]=t,this.callback(this.manager,r,{pointers:e,changedPointers:[t],pointerType:o,srcEvent:t}),i&&e.splice(a,1))}});var et={touchstart:1,touchmove:2,touchend:4,touchcancel:8},it="touchstart",nt="touchstart touchmove touchend touchcancel";function rt(){this.evTarget=it,this.evWin=nt,this.started=!1,L.apply(this,arguments)}function ot(t,e){var i=S(t.touches),n=S(t.changedTouches);return 12&e&&(i=B(i.concat(n),"identifier",!0)),[i,n]}g(rt,L,{handler:function(t){var e=et[t.type];if(1===e&&(this.started=!0),this.started){var i=ot.call(this,t,e);12&e&&i[0].length-i[1].length==0&&(this.started=!1),this.callback(this.manager,e,{pointers:i[0],changedPointers:i[1],pointerType:D,srcEvent:t})}}});var st={touchstart:1,touchmove:2,touchend:4,touchcancel:8},at="touchstart touchmove touchend touchcancel";function ut(){this.evTarget=at,this.targetIds={},L.apply(this,arguments)}function ht(t,e){var i=S(t.touches),n=this.targetIds;if(3&e&&1===i.length)return n[i[0].identifier]=!0,[i,i];var r,o,s=S(t.changedTouches),a=[],u=this.target;if(o=i.filter((function(t){return E(t.target,u)})),1===e)for(r=0;r<o.length;)n[o[r].identifier]=!0,r++;for(r=0;r<s.length;)n[s[r].identifier]&&a.push(s[r]),12&e&&delete n[s[r].identifier],r++;return a.length?[B(o.concat(a),"identifier",!0),a]:void 0}function lt(){L.apply(this,arguments);var t=v(this.handler,this);this.touch=new ut(this.manager,t),this.mouse=new X(this.manager,t),this.primaryTouch=null,this.lastTouches=[]}function ct(t,e){1&t?(this.primaryTouch=e.changedPointers[0].identifier,dt.call(this,e)):12&t&&dt.call(this,e)}function dt(t){var e=t.changedPointers[0];if(e.identifier===this.primaryTouch){var i={x:e.clientX,y:e.clientY};this.lastTouches.push(i);var n=this.lastTouches;setTimeout((function(){var t=n.indexOf(i);t>-1&&n.splice(t,1)}),2500)}}function pt(t){for(var e=t.srcEvent.clientX,i=t.srcEvent.clientY,n=0;n<this.lastTouches.length;n++){var r=this.lastTouches[n],o=Math.abs(e-r.x),s=Math.abs(i-r.y);if(o<=25&&s<=25)return!0}return!1}g(ut,L,{handler:function(t){var e=st[t.type],i=ht.call(this,t,e);i&&this.callback(this.manager,e,{pointers:i[0],changedPointers:i[1],pointerType:D,srcEvent:t})}}),g(lt,L,{handler:function(t,e,i){var n=i.pointerType==D,r=i.pointerType==N;if(!(r&&i.sourceCapabilities&&i.sourceCapabilities.firesTouchEvents)){if(n)ct.call(this,e,i);else if(r&&pt.call(this,i))return;this.callback(t,e,i)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var At=s?M(s.style,"touchAction"):n,ft=At!==n,gt="compute",vt="auto",mt="manipulation",yt="none",bt="pan-x",wt="pan-y",Et=function(){if(!ft)return!1;var e={},i=t.CSS&&t.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach((function(n){e[n]=!i||t.CSS.supports("touch-action",n)})),e}();function xt(t,e){this.manager=t,this.set(e)}xt.prototype={set:function(t){t==gt&&(t=this.compute()),ft&&this.manager.element.style&&Et[t]&&(this.manager.element.style[At]=t),this.actions=t.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var t=[];return d(this.manager.recognizers,(function(e){m(e.options.enable,[e])&&(t=t.concat(e.getTouchAction()))})),function(t){if(x(t,yt))return yt;var e=x(t,bt),i=x(t,wt);return e&&i?yt:e||i?e?bt:wt:x(t,mt)?mt:vt}(t.join(" "))},preventDefaults:function(t){var e=t.srcEvent,i=t.offsetDirection;if(this.manager.session.prevented)e.preventDefault();else{var n=this.actions,r=x(n,yt)&&!Et.none,o=x(n,wt)&&!Et["pan-y"],s=x(n,bt)&&!Et["pan-x"];if(r){var a=1===t.pointers.length,u=t.distance<2,h=t.deltaTime<250;if(a&&u&&h)return}if(!s||!o)return r||o&&6&i||s&&24&i?this.preventSrc(e):void 0}},preventSrc:function(t){this.manager.session.prevented=!0,t.preventDefault()}};var It=32;function Ct(t){this.options=r({},this.defaults,t||{}),this.id=P++,this.manager=null,this.options.enable=y(this.options.enable,!0),this.state=1,this.simultaneous={},this.requireFail=[]}function St(t){return 16&t?"cancel":8&t?"end":4&t?"move":2&t?"start":""}function Bt(t){return 16==t?"down":8==t?"up":2==t?"left":4==t?"right":""}function Mt(t,e){var i=e.manager;return i?i.get(t):t}function Pt(){Ct.apply(this,arguments)}function Tt(){Pt.apply(this,arguments),this.pX=null,this.pY=null}function Rt(){Pt.apply(this,arguments)}function kt(){Ct.apply(this,arguments),this._timer=null,this._input=null}function Qt(){Pt.apply(this,arguments)}function Dt(){Pt.apply(this,arguments)}function Nt(){Ct.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function Ft(t,e){return(e=e||{}).recognizers=y(e.recognizers,Ft.defaults.preset),new Ot(t,e)}function Ot(t,e){this.options=r({},Ft.defaults,e||{}),this.options.inputTarget=this.options.inputTarget||t,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=t,this.input=new(this.options.inputClass||(k?tt:Q?ut:R?lt:X))(this,V),this.touchAction=new xt(this,this.options.touchAction),Lt(this,!0),d(this.options.recognizers,(function(t){var e=this.add(new t[0](t[1]));t[2]&&e.recognizeWith(t[2]),t[3]&&e.requireFailure(t[3])}),this)}function Lt(t,e){var i,n=t.element;n.style&&(d(t.options.cssProps,(function(r,o){i=M(n.style,o),e?(t.oldCssProps[i]=n.style[i],n.style[i]=r):n.style[i]=t.oldCssProps[i]||""})),e||(t.oldCssProps={}))}return Ct.prototype={defaults:{},set:function(t){return r(this.options,t),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(t){if(c(t,"recognizeWith",this))return this;var e=this.simultaneous;return e[(t=Mt(t,this)).id]||(e[t.id]=t,t.recognizeWith(this)),this},dropRecognizeWith:function(t){return c(t,"dropRecognizeWith",this)||(t=Mt(t,this),delete this.simultaneous[t.id]),this},requireFailure:function(t){if(c(t,"requireFailure",this))return this;var e=this.requireFail;return-1===C(e,t=Mt(t,this))&&(e.push(t),t.requireFailure(this)),this},dropRequireFailure:function(t){if(c(t,"dropRequireFailure",this))return this;t=Mt(t,this);var e=C(this.requireFail,t);return e>-1&&this.requireFail.splice(e,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(t){return!!this.simultaneous[t.id]},emit:function(t){var e=this,i=this.state;function n(i){e.manager.emit(i,t)}i<8&&n(e.options.event+St(i)),n(e.options.event),t.additionalEvent&&n(t.additionalEvent),i>=8&&n(e.options.event+St(i))},tryEmit:function(t){if(this.canEmit())return this.emit(t);this.state=It},canEmit:function(){for(var t=0;t<this.requireFail.length;){if(!(33&this.requireFail[t].state))return!1;t++}return!0},recognize:function(t){var e=r({},t);if(!m(this.options.enable,[this,e]))return this.reset(),void(this.state=It);56&this.state&&(this.state=1),this.state=this.process(e),30&this.state&&this.tryEmit(e)},process:function(t){},getTouchAction:function(){},reset:function(){}},g(Pt,Ct,{defaults:{pointers:1},attrTest:function(t){var e=this.options.pointers;return 0===e||t.pointers.length===e},process:function(t){var e=this.state,i=t.eventType,n=6&e,r=this.attrTest(t);return n&&(8&i||!r)?16|e:n||r?4&i?8|e:2&e?4|e:2:It}}),g(Tt,Pt,{defaults:{event:"pan",threshold:10,pointers:1,direction:30},getTouchAction:function(){var t=this.options.direction,e=[];return 6&t&&e.push(wt),24&t&&e.push(bt),e},directionTest:function(t){var e=this.options,i=!0,n=t.distance,r=t.direction,o=t.deltaX,s=t.deltaY;return r&e.direction||(6&e.direction?(r=0===o?1:o<0?2:4,i=o!=this.pX,n=Math.abs(t.deltaX)):(r=0===s?1:s<0?8:16,i=s!=this.pY,n=Math.abs(t.deltaY))),t.direction=r,i&&n>e.threshold&&r&e.direction},attrTest:function(t){return Pt.prototype.attrTest.call(this,t)&&(2&this.state||!(2&this.state)&&this.directionTest(t))},emit:function(t){this.pX=t.deltaX,this.pY=t.deltaY;var e=Bt(t.direction);e&&(t.additionalEvent=this.options.event+e),this._super.emit.call(this,t)}}),g(Rt,Pt,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[yt]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||2&this.state)},emit:function(t){if(1!==t.scale){var e=t.scale<1?"in":"out";t.additionalEvent=this.options.event+e}this._super.emit.call(this,t)}}),g(kt,Ct,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[vt]},process:function(t){var e=this.options,i=t.pointers.length===e.pointers,n=t.distance<e.threshold,r=t.deltaTime>e.time;if(this._input=t,!n||!i||12&t.eventType&&!r)this.reset();else if(1&t.eventType)this.reset(),this._timer=l((function(){this.state=8,this.tryEmit()}),e.time,this);else if(4&t.eventType)return 8;return It},reset:function(){clearTimeout(this._timer)},emit:function(t){8===this.state&&(t&&4&t.eventType?this.manager.emit(this.options.event+"up",t):(this._input.timeStamp=h(),this.manager.emit(this.options.event,this._input)))}}),g(Qt,Pt,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[yt]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||2&this.state)}}),g(Dt,Pt,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return Tt.prototype.getTouchAction.call(this)},attrTest:function(t){var e,i=this.options.direction;return 30&i?e=t.overallVelocity:6&i?e=t.overallVelocityX:24&i&&(e=t.overallVelocityY),this._super.attrTest.call(this,t)&&i&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers==this.options.pointers&&u(e)>this.options.velocity&&4&t.eventType},emit:function(t){var e=Bt(t.offsetDirection);e&&this.manager.emit(this.options.event+e,t),this.manager.emit(this.options.event,t)}}),g(Nt,Ct,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[mt]},process:function(t){var e=this.options,i=t.pointers.length===e.pointers,n=t.distance<e.threshold,r=t.deltaTime<e.time;if(this.reset(),1&t.eventType&&0===this.count)return this.failTimeout();if(n&&r&&i){if(4!=t.eventType)return this.failTimeout();var o=!this.pTime||t.timeStamp-this.pTime<e.interval,s=!this.pCenter||j(this.pCenter,t.center)<e.posThreshold;if(this.pTime=t.timeStamp,this.pCenter=t.center,s&&o?this.count+=1:this.count=1,this._input=t,0==this.count%e.taps)return this.hasRequireFailures()?(this._timer=l((function(){this.state=8,this.tryEmit()}),e.interval,this),2):8}return It},failTimeout:function(){return this._timer=l((function(){this.state=It}),this.options.interval,this),It},reset:function(){clearTimeout(this._timer)},emit:function(){8==this.state&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),Ft.VERSION="2.0.7",Ft.defaults={domEvents:!1,touchAction:gt,enable:!0,inputTarget:null,inputClass:null,preset:[[Qt,{enable:!1}],[Rt,{enable:!1},["rotate"]],[Dt,{direction:6}],[Tt,{direction:6},["swipe"]],[Nt],[Nt,{event:"doubletap",taps:2},["tap"]],[kt]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}},Ot.prototype={set:function(t){return r(this.options,t),t.touchAction&&this.touchAction.update(),t.inputTarget&&(this.input.destroy(),this.input.target=t.inputTarget,this.input.init()),this},stop:function(t){this.session.stopped=t?2:1},recognize:function(t){var e=this.session;if(!e.stopped){var i;this.touchAction.preventDefaults(t);var n=this.recognizers,r=e.curRecognizer;(!r||r&&8&r.state)&&(r=e.curRecognizer=null);for(var o=0;o<n.length;)i=n[o],2===e.stopped||r&&i!=r&&!i.canRecognizeWith(r)?i.reset():i.recognize(t),!r&&14&i.state&&(r=e.curRecognizer=i),o++}},get:function(t){if(t instanceof Ct)return t;for(var e=this.recognizers,i=0;i<e.length;i++)if(e[i].options.event==t)return e[i];return null},add:function(t){if(c(t,"add",this))return this;var e=this.get(t.options.event);return e&&this.remove(e),this.recognizers.push(t),t.manager=this,this.touchAction.update(),t},remove:function(t){if(c(t,"remove",this))return this;if(t=this.get(t)){var e=this.recognizers,i=C(e,t);-1!==i&&(e.splice(i,1),this.touchAction.update())}return this},on:function(t,e){if(t!==n&&e!==n){var i=this.handlers;return d(I(t),(function(t){i[t]=i[t]||[],i[t].push(e)})),this}},off:function(t,e){if(t!==n){var i=this.handlers;return d(I(t),(function(t){e?i[t]&&i[t].splice(C(i[t],e),1):delete i[t]})),this}},emit:function(t,i){this.options.domEvents&&function(t,i){var n=e.createEvent("Event");n.initEvent(t,!0,!0),n.gesture=i,i.target.dispatchEvent(n)}(t,i);var n=this.handlers[t]&&this.handlers[t].slice();if(n&&n.length){i.type=t,i.preventDefault=function(){i.srcEvent.preventDefault()};for(var r=0;r<n.length;)n[r](i),r++}},destroy:function(){this.element&&Lt(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},r(Ft,{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:It,DIRECTION_NONE:1,DIRECTION_LEFT:2,DIRECTION_RIGHT:4,DIRECTION_UP:8,DIRECTION_DOWN:16,DIRECTION_HORIZONTAL:6,DIRECTION_VERTICAL:24,DIRECTION_ALL:30,Manager:Ot,Input:L,TouchAction:xt,TouchInput:ut,MouseInput:X,PointerEventInput:tt,TouchMouseInput:lt,SingleTouchInput:rt,Recognizer:Ct,AttrRecognizer:Pt,Tap:Nt,Pan:Tt,Swipe:Dt,Pinch:Rt,Rotate:Qt,Press:kt,on:b,off:w,each:d,merge:f,extend:A,assign:r,inherit:g,bindFn:v,prefixed:M}),Ft}("undefined"!=typeof window?window:{},"undefined"!=typeof document?document:{});function Cr(e,i,n){var r=i.offsetWidth,o=i.offsetHeight,s=i.getBoundingClientRect(),a=s.top,u=s.left;return n&&(u+=r*n.left,a+=o*(1-n.bottom-n.height),r*=n.width,o*=n.height),new t.Vector2((e.x-u)/r*2-1,-(e.y-a)/o*2+1)}var Sr=new t.OrthographicCamera(-1,1,1,-1,0,1),Br=new t.BufferGeometry;Br.setAttribute("position",new t.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3)),Br.setAttribute("uv",new t.Float32BufferAttribute([0,2,0,0,2,0],2));var Mr=new t.Mesh(Br),Pr=new t.Scene;Pr.add(Mr);var Tr=function(){function e(e,i){var n;this.renderer=e,this.material=new t.ShaderMaterial({vertexShader:null!==(n=i.vertex)&&void 0!==n?n:"\nvarying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n",fragmentShader:i.fragment,uniforms:Object.assign({inputBuffer:new t.Uniform(null)},i.uniforms),defines:Object.assign({},i.defines),blending:t.NoBlending,depthWrite:!1,depthTest:!1})}return e.prototype.render=function(t,e){var i=this.renderer.getRenderTarget(),n=Mr.material;this.material.uniforms.inputBuffer.value=t.texture,Mr.material=this.material,this.renderer.setRenderTarget(e||null),this.renderer.render(Pr,Sr),this.renderer.setRenderTarget(i),Mr.material=n},e.prototype.dispose=function(){this.material.dispose()},e}(),Rr=function(){function e(e){this.renderer=e,this.material=new t.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 t.Uniform(new t.Vector3)}),blending:t.NoBlending,depthWrite:!1,depthTest:!1})}return e.prototype.render=function(t,e){var i=this.renderer.getRenderTarget(),n=Mr.material;this.material.uniforms.inputValue.value.copy(t),Mr.material=this.material,this.renderer.setRenderTarget(e||null),this.renderer.render(Pr,Sr),this.renderer.setRenderTarget(i),Mr.material=n},e.prototype.dispose=function(){this.material.dispose()},e}(),kr=function(t){function e(e){return t.call(this,e,{fragment:"\nuniform sampler2D inputBuffer;\nvarying vec2 vUv;\nvoid main() {\n gl_FragColor = texture2D(inputBuffer, vUv);\n}\n"})||this}return Nt(e,t),e}(Tr),Qr=function(){function t(t){this.enable=!0,this.renderer=t,this.copyPass=new kr(this.renderer)}return t.prototype.render=function(t,e,i){this.copyPass.render(t,e)},t.prototype.dispose=function(){this.copyPass.dispose()},t}(),Dr=function(t){function e(i){var n,r=t.call(this)||this,o=e.parseArgs(i);return r.pending=!0,r.userAction=o.initial[3],r.destroyed=!1,r.ident=o.ident,r.scene=o.scene,r.helper=o.helper,r.camera=o.camera,r.renderer=o.renderer,r.scissor=o.scissor,r.element=o.element,r.model=o.model,r.enableIOSEDR=null!==(n=o.enableIOSEDR)&&void 0!==n&&n,r.work=o.work,r.imageOptions=o.imageOptions,r.videoTexture=o.videoTexture,r.networkSubscribe=o.networkSubscribe,r.needsRender=!0,r.maxFov=120,r.minFov=40,r.maxLatitude=+Math.PI/2,r.minLatitude=-Math.PI/2,r.cameraMotion=new In({longitude:{value:r.camera.pose.longitude,circle:[0,2*Math.PI]},latitude:r.camera.pose.latitude,fov:r.camera.pose.fov}),r.eventUnbinds=[o.element].concat(o.extraElements||[]).map((function(t){return r.bindEvents(t)})),ce.shared.add((function(){return r.initAnimation.apply(r,o.initial)}),!0),r}return Nt(e,t),e.parseArgs=function(t){return Ft({},t)},e.initAnimationEndState=function(t){var e=this.parseArgs(t);return{longitude:e.camera.pose.longitude,latitude:e.camera.pose.latitude,fov:e.camera.pose.fov,offset:e.camera.pose.offset.clone()}},e.prototype.destroy=function(){var t;this.destroyed=!0,this.off(),this.cameraMotion.dispose();for(var e=0,i=this.eventUnbinds;e<i.length;e++)(0,i[e])();this.effect&&(this.effect.dispose(),delete this.effect),delete this.panState,null===(t=this.pressState)||void 0===t||t.stop(),delete this.pressState},e.prototype.isReady=function(){return!1===this.pending&&!0===this.cameraMotion.ended},e.prototype.bindExtraElement=function(t){for(var e=0,i=this.eventUnbinds;e<i.length;e++)if(i[e].element===t)return;this.eventUnbinds.push(this.bindEvents(t))},e.prototype.unbindExtraElement=function(t){for(var e=[],i=0,n=this.eventUnbinds;i<n.length;i++){var r=n[i];r.element===t?r():e.push(r)}this.eventUnbinds=e},e.prototype.updateRenderSize=function(){this.needsRender=!0},e.prototype.updateModel=function(t){this.model=t,this.needsRender=!0},e.prototype.updateWork=function(t,e,i,n,r){return this.work=t,this.userAction=r,!1},e.prototype.updateTime=function(t,e){if(!this.destroyed){var i={};this.cameraMotion.ended&&(this.cameraMotion.update(t),i.longitude=this.cameraMotion.value.longitude,i.latitude=this.cameraMotion.value.latitude,i.fov=this.cameraMotion.value.fov),Er(i)&&this.setCamera(i)}},e.prototype.render=function(t){this.renderer.render(this.scene,this.camera)},e.prototype.postProcessing=function(t,e,i){this.destroyed||(this.effect||(this.effect=new Qr(this.renderer)),this.effect.render(t,e,i))},e.prototype.updateCamera=function(t,e,i){return this.userAction=i,this.cameraMotion.set(t,e)},e.prototype.getTargetPose=function(){var t=this.cameraMotion.getKeyFrameSegment(jt())[1];return{longitude:t.value.longitude,latitude:t.value.latitude,fov:t.value.fov,offset:this.camera.pose.offset.clone()}},e.prototype.moveToPano=function(t,e,i){void 0===e&&(e={}),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()};e.moveStartCallback&&e.moveStartCallback(t,n),this.emit("moveToPano",t,this.userAction),this.emit("panoWillArrive",t,n,this.userAction),this.emit("panoArrived",t,n,this.userAction),e.moveEndCallback&&e.moveEndCallback(t,n)},e.prototype.initAnimation=function(t,e,i,n){this.pending=!1,this.userAction=n},e.prototype.setCamera=function(t){var e,i,n,r,o;void 0===t&&(t={});var s=null!==(e=t.longitude)&&void 0!==e?e:this.camera.pose.longitude,a=null!==(i=t.latitude)&&void 0!==i?i:this.camera.pose.latitude,u=null!==(n=t.fov)&&void 0!==n?n:this.camera.pose.fov,h=null!==(r=t.distance)&&void 0!==r?r:this.camera.pose.distance,l=null!==(o=t.offset)&&void 0!==o?o:this.camera.pose.offset,c=this.camera.position.clone(),d=sr(s,this.camera.pose.longitude,2*Math.PI)||sr(a,this.camera.pose.latitude),p=sr(u,this.camera.pose.fov),A=sr(h,this.camera.pose.distance),f=ur(l,this.camera.pose.offset);this.camera.setFromPose({longitude:s,latitude:a,fov:u,distance:h,offset:l});var g=ur(c,this.camera.position);p&&this.emit("cameraFovUpdate",u,this.userAction),d&&this.emit("cameraDirectionUpdate",{longitude:s,latitude:a},this.userAction),g&&this.emit("cameraPositionUpdate",this.camera.position.clone(),this.userAction),(p||d||f||A)&&this.emit("cameraUpdate",{longitude:s,latitude:a,fov:u,offset:l},this.userAction),this.needsRender=!0,(Xe||0!==Ze.length)&&(Xe&&clearTimeout(Xe),Xe=window.setTimeout($e,200))},e.prototype.onPanGesture=function(t){var e=this.panState,i=t.pointers.length;if(t.isFinal?delete this.panState:this.panState={pointerLength:i,x:t.center.x,y:t.center.y},void 0!==e&&e.pointerLength===i){var n=t.pointers.map((function(t){return li(t,["x","y"])}));this.emit("wantsGesture","pan",n,t.isFinal)||this.emit("gesture","pan",n,t.isFinal)}},e.prototype.onTapGesture=function(t){var e=t.pointers.map((function(t){return li(t,["x","y"])}));this.emit("wantsGesture","tap",e,!0)||this.emit("gesture","tap",e,!0)},e.prototype.onPressGesture=function(t,e){var i,n=[t];if(this.emit("wantsGesture","press",n,e))return null===(i=this.pressState)||void 0===i||i.stop(),void delete this.pressState;this.emit("gesture","press",n,e)},e.prototype.onPinchGesture=function(t){var e=t.pointers.map((function(t){return li(t,["x","y"])}));this.emit("wantsGesture","pinch",e,t.isFinal)||this.emit("gesture","pinch",e,t.isFinal)},e.prototype.onMouseWheel=function(t){var e=(Math.abs(t.deltaY)>Math.abs(t.deltaX)?t.deltaY:t.deltaX)/-60,i=[{x:t.clientX,y:t.clientY,delta:e}];this.emit("wantsGesture","mouseWheel",i,!1)||this.emit("gesture","mouseWheel",i,!1)},e.prototype.onMouseMove=function(t){},e.prototype.onMouseOut=function(){},e.prototype.relativeClientPosition=function(t){return Cr(t,this.element,this.scissor)},e.prototype.bindEvents=function(t){var e=this,i=function(t){var i=Cr(t,e.element,e.scissor);return!(Math.abs(i.x)>1||Math.abs(i.y)>1)},n=new Ir.Manager(t),r=function(t){return t.session.firstInput||null};n.add(new Ir.Pan({threshold:10,pointers:0})),n.add(new Ir.Tap({interval:410})),n.add(new Ir.Pinch({threshold:0,pointers:2}).recognizeWith(n.get("pan"))),n.on("panstart pan",(function(t){var o=r(n);o&&!i(o.center)||(e.onPanGesture(t),c())})),n.on("tap",(function(t){var o=r(n);o&&!i(o.center)||(e.onTapGesture(t),c())})),n.on("pinchstart pinch pinchend",(function(t){var o=r(n);o&&!i(o.center)||(e.onPinchGesture(t),c())}));var o=function(t){var n={x:t.clientX,y:t.clientY};i(n)&&(e.onMouseWheel(t),c())},s=function(t){if(!vr()){var n={x:t.clientX,y:t.clientY};i(n)?(e.onMouseMove(t),e.pressState&&Math.abs(t.clientX-e.pressState.x)>10&&Math.abs(t.clientY-e.pressState.y)>10&&c()):e.onMouseOut()}},a=function(){e.onMouseOut(),c()},u=function(t,n){if(i(t)){e.pressState={x:t.x,y:t.y,time:e.pressState?e.pressState.time:n,stop:Kt};var r=n-e.pressState.time;e.onPressGesture({x:t.x,y:t.y,delta:r},!1),e.pressState&&(e.pressState.stop=ce.shared.add((function(e){return u({x:t.x,y:t.y},e)}),!0,1))}else c()},h=function(t){c(),t.touches.length>1||t.changedTouches.length<=0||u({x:t.changedTouches[0].clientX,y:t.changedTouches[0].clientY},jt())},l=function(t){c(),u({x:t.clientX,y:t.clientY},jt())},c=function(){var t;if(e.pressState){var i=jt()-e.pressState.time;e.onPressGesture({x:e.pressState.x,y:e.pressState.y,delta:i},!0),null===(t=e.pressState)||void 0===t||t.stop(),delete e.pressState}},d=function(e){if(e&&"function"==typeof e.preventDefault&&e.currentTarget===t&&e.preventDefault(),"function"==typeof getSelection){var i=getSelection();i&&i.focusNode&&(i.removeAllRanges&&i.removeAllRanges(),i.empty&&i.empty())}};return t.addEventListener("wheel",o,!1),t.addEventListener("mousemove",s,!1),t.addEventListener("mouseout",a,!1),t.addEventListener("touchstart",h,!1),t.addEventListener("touchend",c,!1),t.addEventListener("touchcancel",c,!1),t.addEventListener("mousedown",l,!1),t.addEventListener("mouseup",c,!1),t.addEventListener("touchstart",d,!1),Object.assign((function(){n.destroy(),t.removeEventListener("wheel",o,!1),t.removeEventListener("mousemove",s,!1),t.removeEventListener("mouseout",a,!1),t.removeEventListener("touchstart",h,!1),t.removeEventListener("touchend",c,!1),t.removeEventListener("touchcancel",c,!1),t.removeEventListener("mousedown",l,!1),t.removeEventListener("mouseup",c,!1),t.removeEventListener("touchstart",d,!1)}),{element:t})},e}(zt),Nr=function(e){function i(t){var n,r,o,s,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 In({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!==(s=null===(o=a.model.getMaterial())||void 0===o?void 0:o.perspToOrtho)&&void 0!==s?s:0}),a}return Nt(i,e),i.parseArgs=function(t){var i,n,r,o,s,a,u,h=e.parseArgs.call(this,t);return Ft(Ft({},h),{defaultLongitude:null!==(i=t.defaultLongitude)&&void 0!==i?i:Math.PI/4,defaultLatitude:null!==(n=t.defaultLatitude)&&void 0!==n?n:Math.PI/4,defaultFov:null!==(r=t.defaultFov)&&void 0!==r?r:80,maxFov:null!==(o=t.maxFov)&&void 0!==o?o:120,minFov:null!==(s=t.minFov)&&void 0!==s?s:40,maxLatitude:null!==(a=t.maxLatitude)&&void 0!==a?a:+Math.PI/2,minLatitude:null!==(u=t.minLatitude)&&void 0!==u?u:-Math.PI/2})},i.initAnimationEndPose=function(e){var i,n,r,o=this.parseArgs(e),s=e.initial[1];return{longitude:null!==(i=s.longitude)&&void 0!==i?i:o.defaultLongitude,latitude:bn(null!==(n=s.latitude)&&void 0!==n?n:o.defaultLatitude,o.minLatitude,o.maxLatitude),fov:null!==(r=s.fov)&&void 0!==r?r:o.defaultFov,offset:e.model.bounding.getCenter(new t.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(t,e,i,n,r){return this.work=t,!0},i.prototype.updateModel=function(i){e.prototype.updateModel.call(this,i);var n=i.bounding.getCenter(new t.Vector3),r=this.cameraDistance(i);this.locationMotion.set({x:n.x,y:n.y,z:n.z,distance:r},0).catch(Kt)},i.prototype.updateTime=function(e,i){if(!this.destroyed){var n={},r={};this.locationMotion.ended||(this.locationMotion.update(e),n.modelAlpha=this.locationMotion.value.modelAlpha,n.perspToOrtho=bn(1-10*(1-this.locationMotion.value.perspToOrtho),0,1),r.distance=this.locationMotion.value.distance,r.offset=new t.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z)),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),Er(n)||this.model.setMaterial(n),Er(r)||this.setCamera(r)}},i.prototype.getTargetPose=function(){var e=this.cameraMotion.getKeyFrameSegment(jt())[1],i=this.locationMotion.getKeyFrameSegment(jt())[1];return{longitude:e.value.longitude,latitude:e.value.latitude,fov:e.value.fov,offset:new t.Vector3(i.value.x,i.value.y,i.value.z)}},i.prototype.initAnimation=function(e,i,n,r){var o,s,a,u=this;if(!this.destroyed){this.pending=!1,this.userAction=r;var h=this.model.bounding.getCenter(new t.Vector3),l={longitude:null!==(o=i.longitude)&&void 0!==o?o:this.defaultLongitude,latitude:bn(null!==(s=i.latitude)&&void 0!==s?s:this.defaultLatitude,this.minLatitude,this.maxLatitude),fov:bn(null!==(a=i.fov)&&void 0!==a?a:this.defaultFov,this.minFov,this.maxFov),offset:this.model.bounding.getCenter(new t.Vector3)},c=this.cameraDistance(this.model),d=li(l,["longitude","latitude","fov"]),p={x:h.x,y:h.y,z:h.z,distance:c,modelAlpha:1,perspToOrtho:0};this.emit("initAnimationWillStart",e,l,this.userAction),this.cameraMotion.set(d,n).catch(Kt),this.locationMotion.set(p,n).then((function(){u.emit("initAnimationEnded",e,l,u.userAction)}),(function(t){var i=xr(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(t){var e=t.bounding,i=this.camera.aspect,n=Math.pow(Math.pow(e.max.x-e.min.x+1,2)+Math.pow(e.max.y-e.min.y+1,2)+Math.pow(e.max.z-e.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(t){var e=this.work.observers.filter((function(t){return t.active})),i=this.model.intersectRaycaster(t)[0];if(!i)return null;var n=wr(e,(function(t){return t.standingPosition.distanceTo(i.point)}),!0),r=n[0];return n[1]<5?this.work.observers.indexOf(r):null},i.prototype.coordinatesForOffset=function(e){var i=this.renderer.getSize(new t.Vector2);return{longitude:2*e.x/(i.x*this.scissor.width),latitude:2*e.y/(i.y*this.scissor.height)}},i.prototype.requestInteriaMovement=function(t,e){var i=this;if(!1!==this.interiaMovement){for(var n=Ft({},t),r={longitude:0,latitude:0},o=0;o<e;o++)n.longitude*=.996,n.latitude*=.994008,r.longitude+=n.longitude,r.latitude+=n.latitude;var s=pr(this.cameraMotion.value.longitude+r.longitude),a=bn(this.cameraMotion.value.latitude+r.latitude,this.minLatitude,this.maxLatitude),u={longitude:s,latitude:a,fov:this.cameraMotion.value.fov,offset:this.camera.pose.offset.clone()};this.cameraMotion.set({longitude:s,latitude:a},0).catch(Kt);var h=n.longitude>1e-4||n.longitude<-1e-4||n.latitude>1e-4||n.latitude<-1e-4;this.emit("interiaPan",u,!h),h?ce.shared.add((function(t,e){i.requestInteriaMovement(n,0|e)}),!0,1):this.interiaMovement=!1}},i.prototype.onPanGesture=function(t){var e=this.panState,i=t.pointers.length;if(t.isFinal?delete this.panState:this.panState={pointerLength:i,x:t.center.x,y:t.center.y},void 0!==e&&e.pointerLength===i){var n=t.pointers.map((function(t){return li(t,["x","y"])}));if(!this.emit("wantsGesture","pan",n,t.isFinal)){var r={x:t.center.x-e.x,y:t.center.y-e.y},o=this.relativeClientPosition(t.center),s=this.camera.pose.latitude<Math.PI/6||o.y<0?-1:1;r.x*=s;var a=this.coordinatesForOffset(r),u=pr(this.cameraMotion.value.longitude+a.longitude),h=bn(this.cameraMotion.value.latitude+a.latitude,this.minLatitude,this.maxLatitude);this.camera.aspect<1&&Math.abs(t.overallVelocityX)>.2&&Math.atan2(Math.abs(t.overallVelocityY),Math.abs(t.overallVelocityX))<Math.PI/6.923&&(h=this.cameraMotion.value.latitude);var l={longitude:u,latitude:h,fov:this.camera.pose.fov,offset:this.camera.pose.offset};if(!this.emit("wantsPanGesture",l,t.isFinal)&&(this.emit("gesture","pan",n,t.isFinal),this.emit("panGesture",l,t.isFinal),this.userAction=!0,this.interiaMovement=!1,this.cameraMotion.set({longitude:l.longitude,latitude:l.latitude,fov:l.fov},0).catch(Kt),t.isFinal&&!this.emit("wantsInteriaPan",l))){this.interiaMovement=!0;var c=t.velocityX*s,d=t.velocityY;this.requestInteriaMovement(this.coordinatesForOffset({x:c,y:d}),0)}}}},i.prototype.onPinchGesture=function(t){var e,i=null===(e=this.pinchState)||void 0===e?void 0:e.fov,n=!1;if("pinchstart"===t.type)return this.pinchState={fov:this.cameraMotion.value.fov},void delete this.panState;if("pinchend"===t.type&&(n=!0,delete this.panState,delete this.pinchState),void 0!==i){var r=t.pointers.map((function(t){return li(t,["x","y"])}));if(!this.emit("wantsGesture","pinch",r,n)){var o=bn(i/t.scale,this.minFov,this.maxFov);this.emit("wantsPinchGesture",t.scale,o,n)||this.emit("wantsChangeCameraFov",o)||(this.emit("gesture","pinch",r,n),this.emit("pinchGesture",t.scale,o,n),this.userAction=!0,this.interiaMovement=!1,this.cameraMotion.set({fov:o},0).catch(Kt))}}},i.prototype.onMouseWheel=function(t){var e=this,i=(Math.abs(t.deltaY)>Math.abs(t.deltaX)?t.deltaY:t.deltaX)/-60,n=[{x:t.clientX,y:t.clientY,delta:i}];if(!this.emit("wantsGesture","mouseWheel",n,!1)){var r=this.minFov,o=this.maxFov,s=bn(this.camera.fov-i,r,o);this.emit("wantsMouseWheel",i,s,!1)||this.emit("wantsChangeCameraFov",s)||(this.emit("gesture","mouseWheel",n,!1),this.emit("mouseWheel",i,s,!1),this.userAction=!0,this.interiaMovement=!1,this.cameraMotion.set({fov:s},0).catch(Kt),this.mouseWheelState&&clearTimeout(this.mouseWheelState.timer),this.mouseWheelState={timer:window.setTimeout((function(){delete e.mouseWheelState,e.emit("wantsGesture","mouseWheel",n,!0)||e.emit("wantsMouseWheel",i,s,!0)||(e.emit("gesture","mouseWheel",n,!0),e.emit("mouseWheel",0,s,!0))}),200)})}},i.prototype.onTapGesture=function(e){var i=e.pointers.map((function(t){return li(t,["x","y"])}));if(!this.emit("wantsGesture","tap",i,!0)){var n=this.relativeClientPosition(e.center),r=new t.Raycaster;if(r.setFromCamera(n,this.camera),!this.emit("wantsTapGesture",r,n,!0)){this.emit("gesture","tap",i,!0),this.emit("tapGesture",r,n,!0),this.interiaMovement=!1;var o=this.getForwardPanoIndexOrNot(r);if(!Ji(o)){this.emit("panoSelected",o);var s={longitude:this.camera.pose.longitude,latitude:0};this.emit("wantsMoveToPano",o,s,!0)}}}},i.prototype.onPressGesture=function(e,i){var n,r,o=[e];if(this.emit("wantsGesture","press",o,i))return null===(n=this.pressState)||void 0===n||n.stop(),void delete this.pressState;var s=this.relativeClientPosition(e),a=new t.Raycaster;if(a.setFromCamera(s,this.camera),this.emit("wantsPressGesture",a,s,e.delta,i))return null===(r=this.pressState)||void 0===r||r.stop(),void delete this.pressState;this.emit("gesture","press",o,i),this.emit("pressGesture",a,s,e.delta,i)},i}(Dr),Fr=function(e){function i(t){var n=i.parseArgs(t);return e.call(this,n)||this}return Nt(i,e),i.parseArgs=function(t){var i=[t.initial[0],Ft(Ft({},t.initial[1]),{longitude:0,latitude:Math.PI/2}),t.initial[2],t.initial[3]],n=Ft(Ft({},t),{initial:i,maxLatitude:Math.PI/2,minLatitude:Math.PI/2,defaultLongitude:0,defaultLatitude: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.updateModel=function(e){this.model=e,this.needsRender=!0;var i=e.bounding.getCenter(new t.Vector3);this.locationMotion.set({x:i.x,y:i.y,z:i.z,distance:this.cameraDistance(e)},0).catch(Kt)},i.prototype.initAnimation=function(e,i,n,r){var o,s=this;if(!this.destroyed){this.pending=!1,this.userAction=r;var a=this.model.bounding.getCenter(new t.Vector3),u={longitude:0,latitude:Math.PI/2,fov:bn(null!==(o=i.fov)&&void 0!==o?o:this.defaultFov,this.minFov,this.maxFov),offset:this.model.bounding.getCenter(new t.Vector3)},h=this.cameraDistance(this.model),l=li(u,["longitude","latitude","fov"]),c={x:a.x,y:a.y,z:a.z,distance:h,modelAlpha:1,perspToOrtho:1};this.cameraMotion.set(l,n).catch(Kt),this.locationMotion.set(c,n).then((function(){s.emit("initAnimationEnded",e,u,s.userAction)}),(function(t){var i=xr(s.camera.pose);s.emit("initAnimationEnded",e,i,s.userAction)}))}},i.prototype.getZoomOffsetFromFov=function(e,i,n){var r=new t.Vector3(0,-1,0),o=Math.tan(n/2*Math.PI/180),s=Math.tan(i.fov/2*Math.PI/180),a=(s-o)/s,u=new t.Raycaster;u.setFromCamera(e,i);var h=u.ray.direction,l=h.angleTo(r),c=this.cameraDistance(this.model),d=c*Math.tan(l),p=h.clone().setLength(c*Math.cos(l)).projectOnPlane(r),A=p.length(),f=a/A*p.x*d,g=a/A*p.z*d;return new t.Vector3(f,0,g)},i.prototype.requestInteriaMovement=function(t,e){},i.prototype.onPanGesture=function(e){var i=this.renderer.getSize(new t.Vector2),n=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!==n&&n.pointerLength===r){var o=e.pointers.map((function(t){return li(t,["x","y"])}));if(!this.emit("wantsGesture","pan",o,e.isFinal)){var s=e.center.x-n.x,a=e.center.y-n.y,u=new t.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z),h=this.camera.position.y*Math.tan(this.camera.fov/2*Math.PI/180);u.add(function(e,i){var n=new t.Vector3;return n.setFromMatrixColumn(i,0),n.multiplyScalar(-e),n}(2*s*h/i.y,this.camera.matrix)),u.add(function(e,i,n){var r=new t.Vector3;return r.setFromMatrixColumn(n,0),r.crossVectors(i,r),r.multiplyScalar(e),r}(2*a*h/i.y,this.camera.up,this.camera.matrix));var l=this.model.bounding,c=l.getCenter(new t.Vector3),d=(l.max.x-l.min.x)/this.defaultFov*this.cameraMotion.value.fov,p=(l.max.y,l.min.y,this.defaultFov,this.cameraMotion.value.fov,(l.max.z-l.min.z)/this.defaultFov*this.cameraMotion.value.fov);u.x=bn(u.x,c.x-d,c.x+d),u.z=bn(u.z,c.z-p,c.z+p),u.y=c.y;var A={longitude:0,latitude:Math.PI/2,fov:this.cameraMotion.value.fov,offset:u};this.emit("wantsPanGesture",A,e.isFinal)||(this.emit("gesture","pan",o,e.isFinal),this.emit("panGesture",A,e.isFinal),this.userAction=!0,this.locationMotion.set({x:u.x,y:u.y,z:u.z},0).catch(Kt))}}},i.prototype.onPinchGesture=function(t){var e,i=null===(e=this.pinchState)||void 0===e?void 0:e.fov,n=!1;if("pinchstart"===t.type)return this.pinchState={fov:this.cameraMotion.value.fov},void delete this.panState;if("pinchend"===t.type&&(n=!0,delete this.panState,delete this.pinchState),void 0!==i){var r=t.pointers.map((function(t){return li(t,["x","y"])}));if(!this.emit("wantsGesture","pinch",r,n)){var o=bn(i/t.scale,this.minFov,this.maxFov),s=this.relativeClientPosition({x:t.center.x,y:t.center.y}),a=this.getZoomOffsetFromFov(s,this.camera,o),u=this.camera.pose.offset.clone().add(a);this.emit("wantsPinchGesture",t.scale,o,n)||this.emit("wantsChangeCameraFov",o)||(this.emit("gesture","pinch",r,n),this.emit("pinchGesture",t.scale,o,n),this.userAction=!0,this.locationMotion.set({x:u.x,y:u.y,z:u.z},0).catch(Kt),this.cameraMotion.set({longitude:0,latitude:Math.PI/2,fov:o},0).catch(Kt))}}},i.prototype.onMouseWheel=function(t){var e=this,i=(Math.abs(t.deltaY)>Math.abs(t.deltaX)?t.deltaY:t.deltaX)/-60,n=[{x:t.clientX,y:t.clientY,delta:i}];if(!this.emit("wantsGesture","mouseWheel",n,!1)){var r=bn(this.cameraMotion.value.fov-i,this.minFov,this.maxFov),o=this.relativeClientPosition({x:t.clientX,y:t.clientY}),s=this.getZoomOffsetFromFov(o,this.camera,r),a=this.camera.pose.offset.clone().add(s);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(Kt),this.cameraMotion.set({longitude:0,latitude:Math.PI/2,fov:r},0).catch(Kt),this.mouseWheelState&&clearTimeout(this.mouseWheelState.timer),this.mouseWheelState={timer:window.setTimeout((function(){delete e.mouseWheelState,e.emit("wantsGesture","mouseWheel",n,!0)||e.emit("wantsMouseWheel",i,r,!0)||e.emit("wantsChangeCameraFov",r)||(e.emit("gesture","mouseWheel",n,!0),e.emit("mouseWheel",0,r,!0))}),200)})}},i}(Nr);function Or(t,e){void 0===e&&(e=!1);var i=typeof t;if("string"===i)return JSON.stringify(t);if(!0===t)return"true";if(!1===t)return"false";if(null===t)return"null";if(t instanceof Array){for(var n="[",r=t.length-1,o=0;o<r;o++)n+=Or(t[o],!1)+",";return r>-1&&(n+=Or(t[o],!1)),n+"]"}if(t instanceof Object){if("function"==typeof t.toJSON)return Or(t.toJSON(),e);var s=Object.keys(t).sort(),a=s.length;for(n="",o=0;o<a;){var u=s[o],h=Or(t[u],!0);void 0!==h&&(o&&""!==n&&(n+=","),n+=JSON.stringify(u)+":"+h),o++}return"{"+n+"}"}switch(i){case"function":case"undefined":return e?void 0:null;case"number":return t;default:return isFinite(t)?t:null}}function Lr(t){return Pt(String(Or(t,!1)))}var Vr,Hr,zr=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 Nt(i,e),i.parseArgs=function(t){var i,n,r,o,s,a,u,h,l,c=e.parseArgs.call(this,t);return Ft(Ft({},c),{defaultLongitude:null!==(i=t.defaultLongitude)&&void 0!==i?i:0,defaultLatitude:null!==(n=t.defaultLatitude)&&void 0!==n?n:0,defaultFov:null!==(r=t.defaultFov)&&void 0!==r?r:90,maxFov:null!==(o=t.maxFov)&&void 0!==o?o:120,minFov:null!==(s=t.minFov)&&void 0!==s?s:40,maxLatitude:null!==(a=t.maxLatitude)&&void 0!==a?a:+Math.PI/2,minLatitude:null!==(u=t.minLatitude)&&void 0!==u?u:-Math.PI/2,moveSpeed:null!==(h=t.moveSpeed)&&void 0!==h?h:3.2,intersectMeshCreator:null!==(l=t.intersectMeshCreator)&&void 0!==l?l:function(){return new ir}})},i.initAnimationEndPose=function(t){var e,i,n,r=this.parseArgs(t),o=t.initial,s=o[0],a=o[1];return{longitude:null!==(e=a.longitude)&&void 0!==e?e:r.defaultLongitude,latitude:bn(null!==(i=a.latitude)&&void 0!==i?i:r.defaultLatitude,r.minLatitude,r.maxLatitude),fov:bn(null!==(n=a.fov)&&void 0!==n?n:r.defaultFov,r.minFov,r.maxFov),offset:r.work.observers[s].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(t,e){switch(typeof t){case"function":return t(e,this.moveSpeed);case"number":return t;case"string":return Number(t);default:return Math.floor(Math.max(Math.min(e/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 i=this.cameraMotion.value.fov,n=this.camera.aspect,r=this.renderer.getSize(new t.Vector2);return{longitude:2*e.x/(r.x*this.scissor.width)*i/95*n,latitude:-2*e.y/(r.y*this.scissor.height)*i/95}},i.prototype.cameraBounce=function(){var t=this.cameraMotion.value,e=t.longitude,i=t.latitude,n=t.fov,r=[{progress:0,value:{longitude:e,latitude:i,fov:n}},{progress:.5,value:{longitude:e,latitude:i,fov:.98*n}},{progress:1,value:{longitude:e,latitude:i,fov:n}}];this.cameraMotion.setKeyframes(r,500).catch(Kt)},i.prototype.requestInteriaMovement=function(t,e){var i=this;if(!1!==this.interiaMovement){for(var n=Ft({},t),r={longitude:0,latitude:0},o=0;o<e;o++)n.longitude*=.996,n.latitude*=.98604,r.longitude+=n.longitude,r.latitude+=n.latitude;var s=pr(this.cameraMotion.value.longitude+r.longitude),a=bn(this.cameraMotion.value.latitude+r.latitude,this.minLatitude,this.maxLatitude),u={longitude:s,latitude:a,fov:this.cameraMotion.value.fov,offset:this.camera.pose.offset.clone()};this.cameraMotion.set({longitude:s,latitude:a},0).catch(Kt);var h=n.longitude>1e-4||n.longitude<-1e-4||n.latitude>1e-4||n.latitude<-1e-4;this.emit("interiaPan",u,!h),h?ce.shared.add((function(t,e){i.requestInteriaMovement(n,0|e)}),!0,1):this.interiaMovement=!1}},i.prototype.onPanGesture=function(t){var e=this.panState,i=t.pointers.length;if(t.isFinal?delete this.panState:this.panState={pointerLength:i,x:t.center.x,y:t.center.y},void 0!==e&&e.pointerLength===i){var n=t.pointers.map((function(t){return li(t,["x","y"])}));if(!this.emit("wantsGesture","pan",n,t.isFinal)){var r={x:t.center.x-e.x,y:t.center.y-e.y},o=this.coordinatesForOffset(r),s=pr(this.cameraMotion.value.longitude+o.longitude),a=bn(this.cameraMotion.value.latitude+o.latitude,this.minLatitude,this.maxLatitude);this.camera.aspect<1&&Math.abs(t.overallVelocityX)>.2&&Math.atan2(Math.abs(t.overallVelocityY),Math.abs(t.overallVelocityX))<Math.PI/6.923&&(a=this.cameraMotion.value.latitude);var u={longitude:s,latitude:a,fov:this.cameraMotion.value.fov,offset:this.camera.pose.offset.clone()};if(!this.emit("wantsPanGesture",u,t.isFinal)){this.emit("gesture","pan",n,t.isFinal),this.emit("panGesture",u,t.isFinal),this.userAction=!0,this.interiaMovement=!1,this.hideIntersectMesh();var h={longitude:u.longitude,latitude:u.latitude,fov:u.fov};if(this.cameraMotion.set(h,0).catch(Kt),t.isFinal&&!this.emit("wantsInteriaPan",u)){this.interiaMovement=!0;var l=t.velocityX,c=.6*t.velocityY;Math.abs(c)>.5&&Math.abs(l)<.5&&(l=0),this.requestInteriaMovement(this.coordinatesForOffset({x:l,y:c}),0)}}}}},i.prototype.onPinchGesture=function(t){var e,i=null===(e=this.pinchState)||void 0===e?void 0:e.fov,n=t.scale,r=!1;if("pinchstart"===t.type)return this.pinchState={fov:this.cameraMotion.value.fov},void delete this.panState;if("pinchend"===t.type&&(r=!0,delete this.panState,delete this.pinchState),void 0!==i){var o=t.pointers.map((function(t){return li(t,["x","y"])}));if(!this.emit("wantsGesture","pinch",o,r)){var s=bn(i/n,this.minFov,this.maxFov);this.emit("wantsPinchGesture",n,s,r)||this.emit("wantsChangeCameraFov",s)||(this.emit("gesture","pinch",o,r),this.emit("pinchGesture",n,s,r),this.userAction=!0,this.interiaMovement=!1,this.cameraMotion.set({fov:s},0).catch(Kt))}}},i.prototype.onMouseWheel=function(t){var e=this,i=(Math.abs(t.deltaY)>Math.abs(t.deltaX)?t.deltaY:t.deltaX)/-60,n=[{x:t.clientX,y:t.clientY,delta:i}];if(!this.emit("wantsGesture","mouseWheel",n,!1)){var r=bn(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(Kt),this.mouseWheelState&&clearTimeout(this.mouseWheelState.timer),this.mouseWheelState={timer:window.setTimeout((function(){delete e.mouseWheelState,e.emit("wantsGesture","mouseWheel",n,!0)||e.emit("wantsMouseWheel",i,r,!0)||e.emit("wantsChangeCameraFov",r)||(e.emit("gesture","mouseWheel",n,!0),e.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 i=this.relativeClientPosition({x:e.clientX,y:e.clientY}),n=new t.Raycaster;if(n.setFromCamera(i,this.camera),this.emit("wantsShowIntersectionOnModel",n))this.hideIntersectMesh();else{var r=this.model.intersectRaycaster(n)[0];if(r&&r.face){var o=r.face.normal,s=o.clone().multiplyScalar(.05),a=r.point.clone().add(s);this.intersectMesh.position.copy(a);var u=a.clone().add(s);if(this.intersectMesh.lookAt(u),Math.abs(o.y)>.99){var h=this.camera.position.clone().sub(a);this.intersectMesh.rotation.z=-Math.atan2(h.z,h.x)}this.intersectMesh.visible=!0,this.needsRender=!0,this.emit("intersectionOnModelUpdate",r,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,i){var n,r,o=[e];if(this.emit("wantsGesture","press",o,i))return null===(n=this.pressState)||void 0===n||n.stop(),void delete this.pressState;var s=this.relativeClientPosition(e),a=new t.Raycaster;if(a.setFromCamera(s,this.camera),this.emit("wantsPressGesture",a,s,e.delta,i))return null===(r=this.pressState)||void 0===r||r.stop(),void delete this.pressState;this.emit("gesture","press",o,i),this.emit("pressGesture",a,s,e.delta,i)},i}(Dr),Kr=function(e){function i(i,n){return void 0===n&&(n=.5),e.call(this,i,{uniforms:{inputBuffer:new t.Uniform(null),scale:new t.Uniform(n)},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 Nt(i,e),i}(Tr),qr=function(e){function i(i,n){void 0===n&&(n=.002);var r=e.call(this,i,{uniforms:{targetBuffer:new t.Uniform(null),inputBuffer:new t.Uniform(null),step:new t.Uniform(n)},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 r.material.extensions.shaderTextureLOD=!0,r}return Nt(i,e),Object.defineProperty(i.prototype,"targetBuffer",{get:function(){return this.material.uniforms.targetBuffer.value},set:function(t){this.material.uniforms.targetBuffer.value=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"step",{get:function(){return this.material.uniforms.step.value},set:function(t){this.material.uniforms.step.value=t},enumerable:!1,configurable:!0}),i}(Tr),jr=function(e){function i(i){var n=e.call(this,i,{uniforms:{inputBuffer:new t.Uniform(null),luminanceAdaptiveBuffer:new t.Uniform(null),progress:new t.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 n.material.transparent=!0,n}return Nt(i,e),Object.defineProperty(i.prototype,"luminanceAdaptiveBuffer",{get:function(){return this.material.uniforms.luminanceAdaptiveBuffer.value},set:function(t){this.material.uniforms.luminanceAdaptiveBuffer.value=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"progress",{get:function(){return this.material.uniforms.progress.value},set:function(t){this.material.uniforms.progress.value=t},enumerable:!1,configurable:!0}),i}(Tr),Ur=function(e){function i(t){var i=e.call(this,t)||this;return i.enableTime=jt(),i.renderer=t,i.valuePass=new Rr(i.renderer),i.luminancePass=new Kr(i.renderer,.75),i.nextStepPass=new qr(i.renderer,.002),i.luminanceAdaptivePass=new jr(i.renderer),i}return Nt(i,e),i.prototype.render=function(e,i,n){if(!this.enable)return this.enableTime=null,void this.copyPass.render(e);null===this.enableTime&&(this.enableTime=jt()),this.luminanceTargetBuffer||(this.luminanceTargetBuffer=new t.WebGLRenderTarget(128,128,{minFilter:t.LinearMipmapLinearFilter,magFilter:t.LinearFilter,encoding:this.renderer.outputEncoding,stencilBuffer:!1,depthBuffer:!1,format:t.RGBAFormat,generateMipmaps:!0}),this.nextStepPass.targetBuffer=this.luminanceTargetBuffer.texture),this.luminancePass.render(e,this.luminanceTargetBuffer),this.luminancePrevBuffer||(this.luminancePrevBuffer=new t.WebGLRenderTarget(1,1,{minFilter:t.NearestFilter,magFilter:t.NearestFilter,type:t.HalfFloatType,encoding:this.renderer.outputEncoding,stencilBuffer:!1,depthBuffer:!1}),this.valuePass.render(new t.Vector3(.5,.5,.5),this.luminancePrevBuffer)),this.luminanceNextBuffer||(this.luminanceNextBuffer=new t.WebGLRenderTarget(1,1,{minFilter:t.NearestFilter,magFilter:t.NearestFilter,type:t.HalfFloatType,encoding:this.renderer.outputEncoding,stencilBuffer:!1,depthBuffer:!1}),this.valuePass.render(new t.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((jt()-this.enableTime)/3e3,1),this.luminanceAdaptivePass.render(e,i)},i.prototype.dispose=function(){var t,e,i;null===(t=this.luminanceTargetBuffer)||void 0===t||t.dispose(),null===(e=this.luminancePrevBuffer)||void 0===e||e.dispose(),null===(i=this.luminanceNextBuffer)||void 0===i||i.dispose(),this.copyPass.dispose(),this.luminancePass.dispose(),this.nextStepPass.dispose(),this.luminanceAdaptivePass.dispose()},i}(Qr),Gr=["up","down","left","right","front","back"],_r=null!==(Hr=Math.SQRT1_2)&&void 0!==Hr?Hr:Math.sqrt(2),Wr={up:new t.Quaternion(_r,0,0,_r),down:new t.Quaternion(-_r,0,0,_r),left:new t.Quaternion(0,_r,0,_r),right:new t.Quaternion(0,-_r,0,_r),front:new t.Quaternion(0,0,0,1),back:new t.Quaternion(0,1,0,0)},Xr=(new t.Quaternion).setFromAxisAngle(new t.Vector3(0,1,0),Math.PI),Yr=new Float32Array([-.5,-.5,0,.5,-.5,0,-.5,.5,0,.5,.5,0]),Zr=new Float32Array([0,0,1,0,0,1,1,1]),Jr=new Uint8Array([0,1,2,1,3,2]),$r=new t.BufferGeometry;$r.setAttribute("position",new t.BufferAttribute(Yr,3)),$r.setAttribute("uv",new t.BufferAttribute(Zr,2)),$r.setIndex(new t.BufferAttribute(Jr,1));var to=function(e){function i(){var i=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 i.depthTest=!1,i.depthWrite=!1,i.blending=t.NoBlending,i.map=i.uniforms.map.value,i.luminanceMap=i.uniforms.luminanceMap.value,Object.defineProperties(i,{map:{get:function(){return this.uniforms.map.value},set:function(t){this.uniforms.map.value=t}},luminanceMap:{get:function(){return this.uniforms.luminanceMap.value},set:function(t){this.uniforms.luminanceMap.value=t,this.defines.USE_LUMINANCE=null!==t,this.needsUpdate=!0}}}),i}return Nt(i,e),i}(t.ShaderMaterial),eo=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.level=0,e.sideCount=0,e.col=0,e.row=0,e.index=0,e.type="up",e}return Nt(e,t),e}(t.Box3),io=function(e){function i(i,n){var r=this,o=new to;return o.visible=!1,(r=e.call(this,$r,o)||this).position.copy(i.getCenter(new t.Vector3)),r.quaternion.copy(Wr[i.type]),r.scale.setScalar(1/Math.pow(2,i.level)),r.level=i.level,r.activeTime=-1,r.disposed=!1,r.needsRender=!1,r.frustumCulled=!1,n.then((function(t){var e=t[0],i=t[1];r.disposed?(e.dispose(),null==i||i.dispose()):(r.material.map=e,r.material.luminanceMap=i,r.material.needsUpdate=!0,r.material.visible=!0)})).catch(Kt),r}return Nt(i,e),i.getBox=function(t,e,i){var n=new eo,r=Math.pow(2,t),o=1/r,s=i%r,a=Math.floor(i/r);switch(n.level=t,n.index=i,n.sideCount=r,n.row=a,n.col=s,n.type=e,e){case"up":n.min.y=.5,n.max.y=.5,n.min.x=+s*o-.5,n.max.x=+s*o-.5+o,n.min.z=-a*o+.5-o,n.max.z=-a*o+.5;break;case"down":n.min.y=-.5,n.max.y=-.5,n.min.x=+s*o-.5,n.max.x=+s*o-.5+o,n.min.z=+a*o-.5,n.max.z=+a*o-.5+o;break;case"left":n.min.x=-.5,n.max.x=-.5,n.min.z=-s*o+.5-o,n.max.z=-s*o+.5,n.min.y=-a*o+.5-o,n.max.y=-a*o+.5;break;case"right":n.min.x=.5,n.max.x=.5,n.min.z=+s*o-.5,n.max.z=+s*o-.5+o,n.min.y=-a*o+.5-o,n.max.y=-a*o+.5;break;case"front":n.min.z=-.5,n.max.z=-.5,n.min.x=+s*o-.5,n.max.x=+s*o-.5+o,n.min.y=-a*o+.5-o,n.max.y=-a*o+.5;break;case"back":n.min.z=.5,n.max.z=.5,n.min.x=-s*o+.5-o,n.max.x=-s*o+.5,n.min.y=-a*o+.5-o,n.max.y=-a*o+.5}return n},i.prototype.updateTime=function(t){},i.prototype.dispose=function(){var t;this.disposed=!0,this.material.map&&(this.material.map.dispose(),null===(t=this.material.luminanceMap)||void 0===t||t.dispose()),this.material.dispose()},i}(t.Mesh),no=function(t){function e(){var e=t.call(this)||this;return e.needsRender=!1,e.name="tiling",e}return Nt(e,t),e}(t.Group),ro=function(){function e(t,e){this.disposed=!1,this.textureLoader=new Qi(t),this.level=0,this.panoIndex=0,this.tiles=[],this.resource=[],this.luminance=null,this.imageOptions=e,this.object=new no}return e.prototype.setAllowHosts=function(t){this.textureLoader.setAllowHosts(t)},e.prototype.setNetworkSubscribe=function(t){this.textureLoader.setNetworkSubscribe(t)},e.prototype.cleanup=function(){for(var t=0;t<this.tiles.length;t++)if(this.tiles[t]){var e=this.tiles[t],i="level-group:"+t,n=this.object.getObjectByName(i);for(var r in e){var o=e[r];o.dispose(),n.remove(o),delete e[r],this.object.needsRender=!0}}},e.prototype.setRotation=function(e){if(!this.disposed){var i=(new t.Quaternion).multiplyQuaternions(e,Xr);this.object.quaternion.equals(i)||(this.object.quaternion.copy(i),this.object.needsRender=!0)}},e.prototype.setPosition=function(t){this.disposed||this.object.position.equals(t)||(this.object.position.copy(t),this.object.needsRender=!0)},e.prototype.setResource=function(e){if(!this.disposed&&this.resource!==e){this.cleanup(),this.resource=e;for(var i=0;i<e.length;i++){var n=e[i].level;this.tiles[n]={};var r="level-group:"+n,o=this.object.getObjectByName(r);o||((o=new t.Group).name=r,o.renderOrder=-2),this.object.add(o)}this.object.needsRender=!0}},e.prototype.setLuminance=function(t){this.luminance=t},e.prototype.getTileResources=function(t){for(var e,i=null!==(e=this.imageOptions.size)&&void 0!==e?e:2048,n=[],r=this.resource.length-1;r>=0;r--)this.resource[r].level<=t&&512*Math.pow(2,this.resource[r].level)>i&&n.unshift(this.resource[r]);return n},e.prototype.update=function(e,i,n){var r=this;if(!this.disposed){this.level=i;var o=(new t.PerspectiveCamera).copy(e);o.position.set(0,0,0),o.quaternion.premultiply(this.object.quaternion.clone().inverse()),o.updateMatrixWorld(!0),o.updateProjectionMatrix();for(var s=o.getWorldDirection(new t.Vector3),a=(new t.Frustum).setFromProjectionMatrix((new t.Matrix4).multiplyMatrices(o.projectionMatrix,o.matrixWorldInverse)),u=this.getTileResources(i),h=function(e){if(e){for(var i=[],o=e.level,u=Math.pow(2,o),h=u*u,c=l.object.getObjectByName("level-group:"+o),d=0,p=Gr;d<p.length;d++)for(var A=p[d],f=0;f<h;f++){var g=io.getBox(o,A,f);a.intersectsBox(g)&&i.push(g)}i.sort((function(e,i){return e.getCenter(new t.Vector3).angleTo(s)-i.getCenter(new t.Vector3).angleTo(s)}));for(var v=[],m=0,y=i;m<y.length;m++){var b=(g=y[m]).sideCount,w=g.row,E=g.col,x=(A=g.type,"tile-level:".concat(o,"-face:").concat(A,"-row:").concat(w,"-col:").concat(E));if(!l.tiles[o][x]){var I=e[A],C=e.size,S=C/b,B=[S*E,S*w,S,S],M=Ft({key:"pano_tile.".concat(l.panoIndex,".").concat(A,".").concat(o,".").concat(w,".").concat(E),basisLoaderInitialized:Ri.isInitialized(),cut:B},li(l.imageOptions,["format"]));o<=1&&("jpg"===M.format||/\.jpg$/.test(I))?(1024!==S&&(M.size=1024),M.quality=70):512!==S&&(M.size=512);var P=l.imageOptions.transform?l.imageOptions.transform(I,M):me(I,M),T=l.textureLoader.load(P,{preInit:!0}).then((function(t){return t.body})),R=null;if(l.luminance){var k=l.luminance[A],Q=k.match(/\/cube_(\d+)\//),D=!!Q&&Number(Q[1]);if(!1!==D){var N=C/D,F=Ft(Ft({},M),{size:256,cut:[B[0]/N,B[1]/N,B[2]/N,B[3]/N],key:"pano_tile_luminance.".concat(l.panoIndex,".").concat(A,".").concat(o,".").concat(w,".").concat(E)}),O=l.imageOptions.transform?l.imageOptions.transform(k,F):me(k,F);R=l.textureLoader.load(O,{format:t.LuminanceFormat,preInit:!0}).then((function(t){return t.body})).catch((function(){return null}))}}(H=l.tiles[o][x]=new io(g,Promise.all([T,R]))).name=x,H.renderOrder=o,c.add(H)}l.tiles[o][x].activeTime=n,v.push(x)}for(var L=0,V=Object.keys(l.tiles[o]).sort((function(t,e){return r.tiles[o][e].activeTime-r.tiles[o][t].activeTime})).slice(Math.max(24,v.length));L<V.length;L++){x=V[L];var H=l.tiles[o][x];c.remove(H),H.dispose(),delete l.tiles[o][x],l.object.needsRender=!0}}},l=this,c=0,d=u;c<d.length;c++)h(d[c]);for(var p=0;p<this.tiles.length;p++)if(this.tiles[p]){var A=u.length>0&&p<=u[u.length-1].level;for(var f in this.tiles[p])this.tiles[p][f].visible!==A&&(this.tiles[p][f].visible=A,this.tiles[p][f].needsRender=!0),this.tiles[p][f].updateTime(n)}}},e.prototype.dispose=function(){this.cleanup(),this.resource=[],this.disposed=!0},e}(),oo=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]),so=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]),ao=new t.BufferGeometry;ao.setAttribute("position",new t.BufferAttribute(oo,3)),ao.setIndex(new t.BufferAttribute(so,1));var uo,ho,lo=function(){function e(){this.material=new t.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 t.Uniform(null),matrix:new t.Uniform(null),alpha:new t.Uniform(null),map:new t.Uniform(null)},depthTest:!1,depthWrite:!1,defines:{USE_PANO_VIDEO:!1},blending:t.CustomBlending,blendSrc:t.SrcAlphaFactor,blendDst:t.OneMinusSrcAlphaFactor,blendSrcAlpha:t.OneFactor,blendDstAlpha:t.OneMinusSrcAlphaFactor}),this.object=new t.Mesh(ao,this.material),this.object.visible=!1,this.object.renderOrder=-1,this.object.frustumCulled=!1,this.alphaMotion=new In({alpha:0})}return e.prototype.setMaterial=function(t){t?(this.material.uniforms.size.value=t.size,this.material.uniforms.matrix.value=t.matrix,this.material.uniforms.map.value=t.map,this.alphaMotion.set({alpha:t.alpha},500).catch(Kt),this.material.uniforms.alpha.value=t.alpha):(this.material.uniforms.size.value=null,this.material.uniforms.matrix.value=null,this.material.uniforms.map.value=null,this.alphaMotion.set({alpha:0},0).catch(Kt));var e=null!==t;e!==this.material.defines.USE_PANO_VIDEO&&(this.material.defines.USE_PANO_VIDEO=e,this.material.needsUpdate=!0,this.object.visible=null!==t)},e.prototype.updateTime=function(t){this.alphaMotion.ended||(this.alphaMotion.update(t),this.material.uniforms.alpha.value=this.alphaMotion.value.alpha)},e.prototype.dispose=function(){this.material.dispose()},e}(),co=(new t.Matrix4).makeRotationAxis(new t.Vector3(0,1,0),Math.PI),po=new t.Vector3(-1,1,1),Ao=function(e){function i(t){var n,r,o,s,a,u,h,l=this,c=i.parseArgs(t);(l=e.call(this,c)||this).initAnimationed=!1,l.currentPanoIndex=c.initial[0],l.maxAccessibleDistance=c.maxAccessibleDistance,l.panoTapTriggerRadius=c.panoTapTriggerRadius,l.panoCircleMeshCreator=c.panoCircleMeshCreator,l.tileLevelForFov=c.tileLevelForFov;var d=l.model.getMaterial()||{},p=d.pano0,A=d.pano1;p&&(null==A?void 0:A.map)!==p.map&&(l.model.setMaterial({pano0:A}),p.map.dispose(),null===(n=p.luminanceMap)||void 0===n||n.dispose()),l.boundingMesh=l.generateBoundingMesh(),l.boundingMesh.setMaterial(l.model.getMaterial()||{}),l.boundingMesh.visible=!1,l.scene.add(l.boundingMesh),l.panoMeshes=[],l.updatePanoMeshes(),l.locationMotion=new In({count:0,distance:l.camera.pose.distance,modelAlpha:null!==(o=null===(r=l.model.getMaterial())||void 0===r?void 0:r.modelAlpha)&&void 0!==o?o:0,perspToOrtho:null!==(a=null===(s=l.model.getMaterial())||void 0===s?void 0:s.perspToOrtho)&&void 0!==a?a:0}),l.panoResources={},l.panoResources[l.locationMotion.keyframes[0].key=l.locationMotion.keyframes[1].key=rr()]={panoIndex:l.currentPanoIndex,workCode:l.work.workCode,panoPicture:null!==(h=null===(u=l.model.getMaterial())||void 0===u?void 0:u.pano1)&&void 0!==h?h:null,position:l.camera.pose.offset.clone(),effect:"fly"};var f={allowHosts:l.work.allowHosts,networkSubscribe:l.networkSubscribe};return l.textureLoader=new Qi(f),l.tiling=new ro(f,l.imageOptions),l.scene.add(l.tiling.object),l.panoVideo=new lo,l.scene.add(l.panoVideo.object),l}return Nt(i,e),i.parseArgs=function(t){var i,n,r,o,s=e.parseArgs.call(this,t);return Ft(Ft({},s),{maxAccessibleDistance:null!==(i=t.maxAccessibleDistance)&&void 0!==i?i:5,panoTapTriggerRadius:null!==(n=t.panoTapTriggerRadius)&&void 0!==n?n:.5,panoCircleMeshCreator:null!==(r=t.panoCircleMeshCreator)&&void 0!==r?r:function(){return new Jn},tileLevelForFov:null!==(o=t.tileLevelForFov)&&void 0!==o?o:function(t,e){var i=2*Math.atan(Math.tan(t/180*Math.PI/2)*(e.width/e.height))/Math.PI*180,n=Math.max(e.width/i,e.height/t),r=s.imageOptions.size;if(void 0===r&&s.work.observers[0]){var o=s.work.observers[0].images.up.match(/\/cube_(\d+)\//);o&&(r=Number(o[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(t){n.helper.remove(t),t.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 o=null!==(t=this.model.getMaterial())&&void 0!==t?t:{},s=o.pano0,a=o.pano1,u=0,h=Object.keys(this.panoResources);u<h.length;u++){var l=h[u],c=this.panoResources[l];if(c.panoPicture){var d=c.panoPicture.map;d&&d!==(null==s?void 0:s.map)&&d!==(null==a?void 0:a.map)&&(d.dispose(),null===(i=c.panoPicture.luminanceMap)||void 0===i||i.dispose(),c.panoPicture=null)}delete this.panoResources[l]}},i.prototype.isReady=function(){return!0===this.locationMotion.ended&&e.prototype.isReady.call(this)},i.prototype.updateWork=function(t,e,i,n,r){var o=this;this.userAction=r,this.work=t,this.currentPanoIndex=e,this.textureLoader.setAllowHosts(this.work.allowHosts),this.tiling.setAllowHosts(this.work.allowHosts),this.tiling.cleanup(),this.initAnimationed=!1;var s={},a=!0;this.boundingMesh&&(s=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(s),this.scene.add(this.boundingMesh),this.hideIntersectMesh(),this.updatePanoMeshes();for(var u=0,h=this.panoMeshes;u<h.length;u++)h[u].visible=!1;return this.moveToPano(e,{effect:"fade",duration:n,longitude:i.longitude,latitude:i.latitude,fov:i.fov,moveEndCallback:function(){o.initAnimationed=!0},moveCancelCallback:function(){o.initAnimationed=!0}},r),!0},i.prototype.updateModel=function(t){this.model=t;var e={},i=!0;this.boundingMesh&&(e=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(e),this.scene.add(this.boundingMesh),this.updatePanoMeshes()},i.prototype.updateTime=function(e,i){var n,r,o,s,a,u,h;if(!this.destroyed){var l={},c={},d=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[0]),p=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]);if(!1===this.locationMotion.ended){this.locationMotion.update(e);var A=this.locationMotion.getKeyFrameSegment(e),f=A[0],g=A[1],v=this.panoResourceFromLocationMotionKeyframe(f),m=this.panoResourceFromLocationMotionKeyframe(g),y=(new t.Vector3).copy(v.position),b=(new t.Vector3).copy(m.position),w=this.locationMotion.value.count-g.value.count+1;l.modelAlpha=this.locationMotion.value.modelAlpha,l.perspToOrtho=bn(1-10*(1-this.locationMotion.value.perspToOrtho),0,1),l.useBlackTransition="instant"===m.effect,m.panoPicture&&(w<1?v.panoPicture&&(l.pano0=v.panoPicture):l.pano0=m.panoPicture,l.pano1=m.panoPicture),"fade"===m.effect&&(l.pano0&&v.panoPicture&&(l.pano0={map:l.pano0.map,luminanceMap:l.pano0.luminanceMap,matrix:v.panoPicture.matrix.clone().setPosition(m.position)}),y.copy(b)),l.progress=w,c.distance=this.locationMotion.value.distance,c.offset=new t.Vector3(y.x+(b.x-y.x)*w,y.y+(b.y-y.y)*w,y.z+(b.z-y.z)*w);for(var E=[],x=[],I=0,C=this.locationMotion.keyframes;I<C.length;I++){var S=C[I],B=S.key,M=S.progress;void 0!==B&&(E.push(B),M>=this.locationMotion.progress&&x.push(B))}for(var P=0,T=Object.keys(this.panoResources);P<T.length;P++){var R=T[P];if(!(x.indexOf(R)>=0)){var k=this.panoResources[R];if(k.panoPicture){var Q=k.panoPicture.map;if(Q){if(Q===(null===(n=l.pano0)||void 0===n?void 0:n.map))continue;if(Q===(null===(r=l.pano1)||void 0===r?void 0:r.map))continue;Q.dispose(),null===(o=k.panoPicture.luminanceMap)||void 0===o||o.dispose(),k.panoPicture=null}}E.indexOf(R)>=0||delete this.panoResources[R]}}v.workCode===m.workCode?this.currentPanoIndex=w<.5?v.panoIndex:m.panoIndex:this.currentPanoIndex=m.panoIndex,this.emit("movingToPano",p.panoIndex,d.panoIndex,this.locationMotion.progress)}if(!1===this.cameraMotion.ended&&(this.cameraMotion.update(e),c.longitude=this.cameraMotion.value.longitude,c.latitude=this.cameraMotion.value.latitude,c.fov=this.cameraMotion.value.fov),!1===Er(l)&&(this.model.setMaterial(l),this.boundingMesh.setMaterial(l)),!1===Er(c)&&this.setCamera(c),this.camera.pose.distance>.1)for(var D=0;D<this.work.observers.length;D++)(L=this.panoMeshes[D])&&(L.visible=!1);else{var N=this.work.observers[this.currentPanoIndex];if(N){var F=N.visibleNodes.concat(this.currentPanoIndex),O=this.getForwardPanoIndexOrNot();for(D=0;D<this.work.observers.length;D++){var L,V=this.work.observers[D];if(L=this.panoMeshes[D])if(V.loadable||V.active)if(-1!==F.indexOf(D)){L.visible=!0;var H=L.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);L.setCurrent(O===D),L.setOpacity(H<.01?0:bn(1.4/H,.5,.7)),L.updateTime&&L.updateTime(e,i)}else L.visible=!1;else L.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);var z=this.tiling.object.visible;if(!1!==this.tileLevelForFov&&this.initAnimationed){var K=p.panoIndex,q=this.work.observers[K];if(q)if(ar(this.camera.position,q.position)){this.tiling.object.visible=!0,this.enableIOSEDR&&this.tiling.setLuminance(null!==(a=q.images.luminance)&&void 0!==a?a:null),this.tiling.panoIndex!==K&&this.tiling.cleanup(),this.tiling.panoIndex=K,this.tiling.setResource(null!==(h=null===(u=q.images)||void 0===u?void 0:u.tiles)&&void 0!==h?h:[]),this.tiling.setRotation(q.quaternion),this.tiling.setPosition(q.position);var j=this.renderer.getSize(new t.Vector2);j.width*=this.scissor.width,j.height*=this.scissor.height,this.tiling.update(this.camera,this.tileLevelForFov(this.camera.fov,j),e)}else this.tiling.object.visible=!1;else this.tiling.object.visible=!1}else this.tiling.object.visible=!1;z!==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(t,e,i){if(!this.destroyed)return this.effect||(this.effect=new Ur(this.renderer)),this.effect.render(t,e,i)},i.prototype.getTargetPose=function(){var t=this.cameraMotion.getKeyFrameSegment(jt())[1],e=this.locationMotion.getKeyFrameSegment(jt())[1],i=this.panoResourceFromLocationMotionKeyframe(e),n=this.work.observers[i.panoIndex];return{longitude:t.value.longitude,latitude:t.value.latitude,fov:t.value.fov,offset:n?n.position.clone():this.camera.position.clone()}},i.prototype.moveToPano=function(e,i,n){var r,o,s,a=this,u=this.work.observers[e],h=Ft({key:"pano.".concat(e),basisLoaderInitialized:Ri.isInitialized()},li(this.imageOptions,["format","size","quality"])),l=null!==(r=this.imageOptions.transform)&&void 0!==r?r:me,c={right:l(u.images.right,Ft(Ft({},h),{key:"".concat(h.key,".right")})),left:l(u.images.left,Ft(Ft({},h),{key:"".concat(h.key,".left")})),up:l(u.images.up,Ft(Ft({},h),{key:"".concat(h.key,".up")})),down:l(u.images.down,Ft(Ft({},h),{key:"".concat(h.key,".down")})),front:l(u.images.front,Ft(Ft({},h),{key:"".concat(h.key,".front")})),back:l(u.images.back,Ft(Ft({},h),{key:"".concat(h.key,".back")}))},d={key:"pano_luminance.".concat(e),basisLoaderInitialized:Ri.isInitialized(),size:h.size?h.size/2:1024},p=this.enableIOSEDR&&u.images.luminance?{right:l(u.images.luminance.right,Ft(Ft({},d),{key:"".concat(d.key,".right")})),left:l(u.images.luminance.left,Ft(Ft({},d),{key:"".concat(d.key,".left")})),up:l(u.images.luminance.up,Ft(Ft({},d),{key:"".concat(d.key,".up")})),down:l(u.images.luminance.down,Ft(Ft({},d),{key:"".concat(d.key,".down")})),front:l(u.images.luminance.front,Ft(Ft({},d),{key:"".concat(d.key,".front")})),back:l(u.images.luminance.back,Ft(Ft({},d),{key:"".concat(d.key,".back")}))}:null,A="pano:"+Lr(c);if(this.pendingTextureTask){if(this.pendingTextureTask.hash===A)return;var f=this.pendingTextureTask.panoIndex;null===(o=this.panoMeshes[f])||void 0===o||o.setProgress(0),this.emit("textureAbort",f,u),this.pendingTextureTask.onError(new Error("texture aborted"))}var g,v=this.model.getMaterial()||{},m=v.pano0,y=v.pano1;if(m&&m.map.name===A&&null!==m.luminanceMap===this.enableIOSEDR?g=m:(null==y?void 0:y.map.name)===A&&null!==y.luminanceMap===this.enableIOSEDR&&(g=y),g){var b={panoIndex:e,workCode:this.work.workCode,effect:null!==(s=i.effect)&&void 0!==s?s:"fly",panoPicture:{map:g.map,luminanceMap:g.luminanceMap,matrix:(new t.Matrix4).compose(u.position,u.quaternion,po)},position:u.position.clone()};this.doMoveToPano(e,b,i,n)}else{this.pending=!0,this.pendingTextureTask={panoIndex:e,hash:A,onLoad:function(r,o){var s,h;if(a.pending=!1,a.destroyed)r.body.dispose();else{r.body.name=A,a.emit("panoLoaded",e);var l={panoIndex:e,workCode:a.work.workCode,effect:null!==(s=i.effect)&&void 0!==s?s:"fly",panoPicture:{map:r.body,luminanceMap:null!==(h=null==o?void 0:o.body)&&void 0!==h?h:null,matrix:(new t.Matrix4).compose(u.position,u.quaternion,po)},position:u.position.clone()};a.doMoveToPano(e,l,i,n)}},onError:function(t){a.pending=!1,i.moveCancelCallback&&i.moveCancelCallback(),a.emit("panoLoadError",t,e),a.emit("moveToPanoCanceled",e)}};var w=this.panoMeshes[e];w&&w.tap&&w.tap(),Promise.all([this.textureLoader.loadCube(c,{format:t.RGBFormat,viaAjax:!0},void 0,void 0,(function(t){var i,n;a.emit("textureLoading",t,e,u),(null===(i=a.pendingTextureTask)||void 0===i?void 0:i.hash)===A&&(null===(n=a.panoMeshes[e])||void 0===n||n.setProgress(t))}),this.renderer),p?this.textureLoader.loadCube(p,{format:t.LuminanceFormat}).catch((function(){return null})):Promise.resolve(null)]).then((function(t){var i,n,r=t[0],o=t[1];(null===(i=a.pendingTextureTask)||void 0===i?void 0:i.hash)===A?(a.pendingTextureTask.onLoad(r,o),null===(n=a.panoMeshes[e])||void 0===n||n.setProgress(0),delete a.pendingTextureTask,a.emit("textureLoaded",e,u,r.meta)):(r.body.dispose(),null==o||o.body.dispose())})).catch((function(t){var i,n;(null===(i=a.pendingTextureTask)||void 0===i?void 0:i.hash)===A&&(a.pendingTextureTask.onError(t),null===(n=a.panoMeshes[e])||void 0===n||n.setProgress(0),delete a.pendingTextureTask,a.emit("textureError",t,e,u),a.emit("error",t))})),this.emit("textureStartLoad",e,u)}},i.prototype.initAnimation=function(t,e,i,n){var r,o,s,a=this;if(!this.destroyed){var u=!1;this.pending=!1,this.userAction=n,this.moveToPano(t,{longitude:null!==(r=e.longitude)&&void 0!==r?r:this.defaultLongitude,latitude:bn(null!==(o=e.latitude)&&void 0!==o?o:this.defaultLatitude,this.minLatitude,this.maxLatitude),fov:bn(null!==(s=e.fov)&&void 0!==s?s:this.defaultFov,this.minFov,this.maxFov),duration:i,moveStartCallback:function(t,e){u=!0,a.emit("initAnimationWillStart",t,e,a.userAction)},moveEndCallback:function(t,e){a.emit("initAnimationEnded",t,e,a.userAction),a.initAnimationed=!0},moveCancelCallback:function(){var t={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,t,a.userAction),a.emit("initAnimationEnded",a.currentPanoIndex,t,a.userAction),a.initAnimationed=!0}},n)}},i.prototype.panoResourceFromLocationMotionKeyframe=function(t){return this.panoResources[t.key]},i.prototype.locationMotionKeyframesLength=function(t){for(var e=0,i=1;i<t.length;i++){var n=this.panoResourceFromLocationMotionKeyframe(t[i-1]).position,r=this.panoResourceFromLocationMotionKeyframe(t[i]).position;e+=n.distanceTo(r)*(t[i].value.count-t[i-1].value.count)}return e},i.prototype.updatePanoMeshes=function(e){void 0===e&&(e=!0);for(var i={},n=0,r=this.panoMeshes;n<r.length;n++)i[(u=r[n]).name]=u;this.panoMeshes.length=0;for(var o=0;o<this.work.observers.length;o++){var s="panoCircle_".concat(this.work.workCode,"_").concat(o),a=this.work.observers[o],u=void 0;if(i[s]?(u=i[s],delete i[s]):((u=this.panoCircleMeshCreator()).name=s,this.helper.add(u)),u.position.copy(a.standingPosition),e&&this.model.loaded&&this.model.bvhs.loaded){var h=new t.Vector3(0,-1,0),l=new t.Vector3(0,.1,0).add(u.position),c=new t.Raycaster(l,h,0,.2),d=this.model.intersectRaycaster(c)[0];d&&d.point.distanceTo(l)<.1&&u.position.copy(d.point)}this.panoMeshes[o]=u}for(var p=0,A=Object.keys(i);p<A.length;p++){var f=A[p];this.helper.remove(i[f]),i[f].dispose(),delete i[f]}},i.prototype.generateBoundingMesh=function(e){void 0===e&&(e=!1);for(var i=this.model.bounding.clone(),n=0,r=this.work.observers;n<r.length;n++){var o=r[n];i.expandByPoint(o.standingPosition),i.expandByPoint((new t.Vector3).fromArray([o.position.x,2*o.position.y-o.standingPosition.y,o.position.z]))}e&&i.expandByPoint(this.camera.position);var s=cr(i,new t.Vector3(1,0,1));return s.name="panorama_bounding",s},i.prototype.doMoveToPano=function(e,i,n,r){var o,s,a,u=this;void 0===n&&(n={}),this.userAction=r;var h,l,c,d=jt(),p=rr();if(this.tiling.cleanup(),this.panoResources[p]=i,this.locationMotion.ended){var A=this.locationMotion.getKeyFrameSegment(d),f=(A[0],A[1]),g=this.locationMotion.value,v=this.panoResourceFromLocationMotionKeyframe(f).position,m=i.position;h=Math.max(v.distanceTo(m),1),l=[{key:f.key,progress:0,value:Ft(Ft({},g),{count:0})},{key:p,progress:1,value:{distance:0,perspToOrtho:0,modelAlpha:0,count:1}}],c=0}else{var y=this.locationMotion.getKeyFrameSegment(d),b=y[0],w=(f=y[1],g=this.locationMotion.value,this.panoResourceFromLocationMotionKeyframe(b).position),E=(v=this.panoResourceFromLocationMotionKeyframe(f).position,m=i.position,f.value.count-g.count),x=Math.max(w.distanceTo(v),1)*E;h=x+Math.max(v.distanceTo(m),1),l=[{key:b.key,progress:0,value:Ft({},g)},{key:f.key,progress:x/h,value:f.value},{key:p,progress:1,value:{count:f.value.count+1,distance:0,perspToOrtho:0,modelAlpha:0}}];var I=this.locationMotionKeyframesLength(this.locationMotion.keyframes),C=this.locationMotionKeyframesLength(l);c=this.locationMotion.getProgressVelocity(d)*I/C}var S=this.calculateMovingDuration(n.duration,h),B={longitude:n.longitude,latitude:n.latitude,fov:n.fov},M={longitude:null!==(o=B.longitude)&&void 0!==o?o:this.camera.pose.longitude,latitude:null!==(s=B.latitude)&&void 0!==s?s:this.camera.pose.latitude,fov:null!==(a=B.fov)&&void 0!==a?a:this.camera.pose.fov,offset:i.position.clone()};n.moveStartCallback&&n.moveStartCallback(e,M),this.emit("panoWillArrive",e,M,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=Kt,this.videoTexture.needsUpdate=!0),this.panoVideo.setMaterial(null),this.cameraMotion.set(B,S).catch(Kt),this.locationMotion.setKeyframes(l,S,c).then((function(){var i,o,s,a={longitude:u.camera.pose.longitude,latitude:u.camera.pose.latitude,fov:u.camera.pose.fov,offset:u.camera.pose.offset.clone()};n.moveEndCallback&&n.moveEndCallback(e,a),u.emit("panoArrived",e,a,r);var h=u.work.observers[u.currentPanoIndex];if(h&&h.video&&u.videoTexture&&u.videoTexture.image instanceof HTMLVideoElement){var l=co.clone().multiply(null!==(s=null===(o=null===(i=u.model.getMaterial())||void 0===i?void 0:i.pano1)||void 0===o?void 0:o.matrix)&&void 0!==s?s:new t.Matrix4).multiply(h.video.matrix),c={map:u.videoTexture,size:h.video.size,matrix:l,alpha:1},d=rr(),p=u.videoTexture.image;p.setAttribute("uuid",d),(Vr||(Vr=new Promise((function(t){var e,i=document.createElement("video");i.muted=!0,i.src="data:video/mp4;base64,AAAAHGZ0eXBNNFYgAAACAGlzb21pc28yYXZjMQAAAAhmcmVlAAAGF21kYXTeBAAAbGliZmFhYyAxLjI4AABCAJMgBDIARwAAArEGBf//rdxF6b3m2Ui3lizYINkj7u94MjY0IC0gY29yZSAxNDIgcjIgOTU2YzhkOCAtIEguMjY0L01QRUctNCBBVkMgY29kZWMgLSBDb3B5bGVmdCAyMDAzLTIwMTQgLSBodHRwOi8vd3d3LnZpZGVvbGFuLm9yZy94MjY0Lmh0bWwgLSBvcHRpb25zOiBjYWJhYz0wIHJlZj0zIGRlYmxvY2s9MTowOjAgYW5hbHlzZT0weDE6MHgxMTEgbWU9aGV4IHN1Ym1lPTcgcHN5PTEgcHN5X3JkPTEuMDA6MC4wMCBtaXhlZF9yZWY9MSBtZV9yYW5nZT0xNiBjaHJvbWFfbWU9MSB0cmVsbGlzPTEgOHg4ZGN0PTAgY3FtPTAgZGVhZHpvbmU9MjEsMTEgZmFzdF9wc2tpcD0xIGNocm9tYV9xcF9vZmZzZXQ9LTIgdGhyZWFkcz02IGxvb2thaGVhZF90aHJlYWRzPTEgc2xpY2VkX3RocmVhZHM9MCBucj0wIGRlY2ltYXRlPTEgaW50ZXJsYWNlZD0wIGJsdXJheV9jb21wYXQ9MCBjb25zdHJhaW5lZF9pbnRyYT0wIGJmcmFtZXM9MCB3ZWlnaHRwPTAga2V5aW50PTI1MCBrZXlpbnRfbWluPTI1IHNjZW5lY3V0PTQwIGludHJhX3JlZnJlc2g9MCByY19sb29rYWhlYWQ9NDAgcmM9Y3JmIG1idHJlZT0xIGNyZj0yMy4wIHFjb21wPTAuNjAgcXBtaW49MCBxcG1heD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AAABAAAADgAAAAIAAAABAAAADwAAAAEAAAABAAAAEAAAAAIAAAABAAAAEQAAAAEAAAABAAAAEgAAAAIAAAABAAAAFAAAAAEAAAABAAAAFQAAAAIAAAABAAAAFgAAAAEAAAABAAAAFwAAAAIAAAABAAAAGAAAAAEAAAABAAAAGQAAAAIAAAABAAAAGgAAAAEAAAABAAAAGwAAAAIAAAABAAAAHQAAAAEAAAABAAAAHgAAAAIAAAABAAAAHwAAAAQAAAABAAAA4HN0c3oAAAAAAAAAAAAAADMAAAAaAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAACMc3RjbwAAAAAAAAAfAAAALAAAA1UAAANyAAADhgAAA6IAAAO+AAAD0QAAA+0AAAQAAAAEHAAABC8AAARLAAAEZwAABHoAAASWAAAEqQAABMUAAATYAAAE9AAABRAAAAUjAAAFPwAABVIAAAVuAAAFgQAABZ0AAAWwAAAFzAAABegAAAX7AAAGFwAAAGJ1ZHRhAAAAWm1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAALWlsc3QAAAAlqXRvbwAAAB1kYXRhAAAAAQAAAABMYXZmNTUuMzMuMTAw",i.addEventListener("timeupdate",(function n(){i.removeEventListener("timeupdate",n,!1),clearTimeout(e);var r=document.createElement("canvas");r.width=r.height=1;var o=r.getContext("2d");o?(o.drawImage(i,0,0,1,1),o.getImageData(0,0,1,1).data[3]>10?t(!0):t(!1)):t(!1)}),!1),i.addEventListener("canplay",(function t(){i.removeEventListener("canplay",t,!1),i.play()}),!1),e=window.setTimeout((function(){return t(!1)}),1e3)})))).then((function(t){t&&h.video&&p.getAttribute("uuid")===d&&(p.oncanplay=function(){p.oncanplay=Kt,p.play()},p.ontimeupdate=function(){p.currentTime>.5&&(p.ontimeupdate=Kt,u.panoVideo.setMaterial(c))},p.src=h.video.source)})).catch((function(){p.removeAttribute("uuid")}))}}),(function(){n.moveCancelCallback&&n.moveCancelCallback(),u.emit("moveToPanoCanceled",e)}))},i.prototype.getForwardPanoIndexOrNot=function(e){var i=this,n=this.camera.getWorldDirection(new t.Vector3),r=this.camera.position.clone(),o=this.work.observers[this.currentPanoIndex];if(!o)return null;var s=o.accessibleNodes.filter((function(e){if(e===i.currentPanoIndex)return!1;var n=i.work.observers[e],o=n.standingPosition.clone().sub(r);return 0!==o.length()&&!(o.angleTo(new t.Vector3(0,-1,0))<Math.PI/12)&&(n.loadable||n.active)})),a=(e?e.ray.direction.clone():n.clone()).setY(0);if(0===a.length())return null;for(var u=s.slice().sort((function(t,e){var n=i.work.observers[t].position.clone().setY(r.y),o=i.work.observers[e].position.clone().setY(r.y);return n.distanceTo(r)-o.distanceTo(r)})),h=0,l=[Math.PI/8,Math.PI/6,Math.PI/4,Math.PI/3];h<l.length;h++)for(var c=l[h],d=0,p=u;d<p.length;d++){var A=p[d],f=this.work.observers[A].position.clone().setY(r.y).sub(r);if(0!==f.length()&&a.angleTo(f)<c)return A}return null},i.prototype.onTapGesture=function(e){var i=this,n=e.pointers.map((function(t){return li(t,["x","y"])}));if(!this.emit("wantsGesture","tap",n,!0)){var r=this.relativeClientPosition(e.center),o=new t.Raycaster;if(o.setFromCamera(r,this.camera),!this.emit("wantsTapGesture",o,r,!0)){this.emit("gesture","tap",n,!0),this.emit("tapGesture",o,r,!0),this.interiaMovement=!1;var s=this.camera.getWorldDirection(new t.Vector3).setY(0),a=null,u=this.work.observers[this.currentPanoIndex];if(u){var h=u.accessibleNodes.filter((function(t){if(t===i.currentPanoIndex)return!1;var e=i.work.observers[t];return!(e.position.distanceTo(i.camera.position)>i.maxAccessibleDistance)&&(e.loadable||e.active)})),l=this.model.intersectRaycaster(o)[0];if(l){var c=wr(h,(function(t){var e=i.work.observers[t].standingPosition.clone();return e.clone().sub(i.camera.position).setY(0).angleTo(s)>Math.PI/2?1/0:e.distanceTo(l.point)}),!0),d=c[0];c[1]<this.panoTapTriggerRadius&&(a=d)}Ji(a)&&(a=this.getForwardPanoIndexOrNot(o));for(var p=0,A=this.locationMotion.keyframes;p<A.length;p++){var f=A[p],g=this.panoResourceFromLocationMotionKeyframe(f);if(!(f.progress<this.locationMotion.progress)&&g.panoIndex===a){a=null;break}}if(this.emit("panoSelected",a),Ji(a))!0===this.locationMotion.ended&&this.cameraBounce();else{var v=this.work.observers[a];if(v.active){for(var m={},y=Math.PI/6,b=Math.PI/12,w=new t.Vector3(0,1,0),E=v.position.clone().setY(0).sub(u.position.clone().setY(0)).normalize(),x=E.clone().applyAxisAngle(w,y),I=E.clone().applyAxisAngle(w,-y),C=[],S=[],B=[],M=0,P=v.accessibleNodes;M<P.length;M++)if((d=P[M])!==this.currentPanoIndex&&d!==a){var T=this.work.observers[d].position.clone().sub(v.position).setY(0);E.angleTo(T)<y?B.push(T):x.angleTo(T)<y?C.push(T):I.angleTo(T)<y&&S.push(T)}var R=(B.length>0?B:Ot(Ot([],C,!0),S,!0)).slice().sort((function(t,e){return t.angleTo(E)-e.angleTo(E)}))[0];R&&R.angleTo(s)>b&&(m.longitude=Math.atan2(-R.x,-R.z)),this.cameraMotion.value.latitude<-Math.PI/4&&(m.latitude=bn(0,this.minLatitude,this.maxLatitude)),this.cameraMotion.value.fov<60&&(m.fov=this.defaultFov),this.emit("wantsMoveToPano",a,m,!0)}else this.panoMeshes[a]&&(this.panoMeshes[a].setDisabled(!1),this.panoMeshes[a].setLoading(!0))}}}}},i}(zr),fo=Math.PI/180,go=180/Math.PI,vo=function(){var t="undefined"!=typeof navigator&&/iPad|iPhone|iPod/.test(navigator.platform);return function(){return t}}(),mo=function(){var t="undefined"!=typeof navigator&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent);return function(){return t}}(),yo=function(){var t="undefined"!=typeof navigator&&-1!==navigator.userAgent.indexOf("Firefox")&&-1!==navigator.userAgent.indexOf("Android");return function(){return t}}(),bo=(uo="undefined"!=typeof navigator?navigator.userAgent.match(/.*Chrome\/([0-9]+)/):null,ho=uo?parseInt(uo[1],10):null,function(){return ho}),wo=function(){var t=!1;if(65===bo()){var e="undefined"!=typeof navigator?navigator.userAgent.match(/.*Chrome\/([0-9\.]*)/):null;if(e){var i=e[1].split("."),n=(i[0],i[1],i[2]),r=i[3];t=3325===parseInt(n,10)&&parseInt(r,10)<148}}return function(){return t}}(),Eo=function(){var t=vo()&&mo()&&"undefined"!=typeof navigator&&-1!==navigator.userAgent.indexOf("13_4");return function(){return t}}(),xo=function(){var t="undefined"!=typeof navigator&&-1!==navigator.userAgent.indexOf("R7 Build");return function(){return t}}();function Io(){var t="undefined"!=typeof window&&(90==window.orientation||-90==window.orientation);return xo()?!t:t}var Co,So=(Co={},function(t,e){void 0===Co[t]&&(console.warn("cardboard: "+e),Co[t]=!0)});function Bo(t){var e,i=t.indexOf("://");e=-1!==i?i+3:0;var n=t.indexOf("/",e);return-1===n&&(n=t.length),t.substring(0,n)}var Mo,Po=function(t,e,i){!function(t,e,i){var n=e?e[0]:0,r=e?e[1]:0,o=e?e[2]:0,s=e?e[3]:1,a=n+n,u=r+r,h=o+o,l=n*a,c=n*u,d=n*h,p=r*u,A=r*h,f=o*h,g=s*a,v=s*u,m=s*h;t[0]=1-(p+f),t[1]=c+m,t[2]=d-v,t[3]=0,t[4]=c-m,t[5]=1-(l+f),t[6]=A+g,t[7]=0,t[8]=d+v,t[9]=A-g,t[10]=1-(l+p),t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1}(t,e),i&&function(t,e,i){var n,r,o,s,a,u,h,l,c,d,p,A,f=i[0],g=i[1],v=i[2];e===t?(t[12]=e[0]*f+e[4]*g+e[8]*v+e[12],t[13]=e[1]*f+e[5]*g+e[9]*v+e[13],t[14]=e[2]*f+e[6]*g+e[10]*v+e[14],t[15]=e[3]*f+e[7]*g+e[11]*v+e[15]):(n=e[0],r=e[1],o=e[2],s=e[3],a=e[4],u=e[5],h=e[6],l=e[7],c=e[8],d=e[9],p=e[10],A=e[11],t[0]=n,t[1]=r,t[2]=o,t[3]=s,t[4]=a,t[5]=u,t[6]=h,t[7]=l,t[8]=c,t[9]=d,t[10]=p,t[11]=A,t[12]=n*f+a*g+c*v+e[12],t[13]=r*f+u*g+d*v+e[13],t[14]=o*f+h*g+p*v+e[14],t[15]=s*f+l*g+A*v+e[15])}(t,t,i),function(t,e){var i=e[0],n=e[1],r=e[2],o=e[3],s=e[4],a=e[5],u=e[6],h=e[7],l=e[8],c=e[9],d=e[10],p=e[11],A=e[12],f=e[13],g=e[14],v=e[15],m=i*a-n*s,y=i*u-r*s,b=i*h-o*s,w=n*u-r*a,E=n*h-o*a,x=r*h-o*u,I=l*f-c*A,C=l*g-d*A,S=l*v-p*A,B=c*g-d*f,M=c*v-p*f,P=d*v-p*g,T=m*P-y*M+b*B+w*S-E*C+x*I;T&&(T=1/T,t[0]=(a*P-u*M+h*B)*T,t[1]=(r*M-n*P-o*B)*T,t[2]=(f*x-g*E+v*w)*T,t[3]=(d*E-c*x-p*w)*T,t[4]=(u*S-s*P-h*C)*T,t[5]=(i*P-r*S+o*C)*T,t[6]=(g*b-A*x-v*y)*T,t[7]=(l*x-d*b+p*y)*T,t[8]=(s*M-a*S+h*I)*T,t[9]=(n*S-i*M-o*I)*T,t[10]=(A*E-f*b+v*m)*T,t[11]=(c*b-l*E-p*m)*T,t[12]=(a*C-s*B-u*I)*T,t[13]=(i*B-n*C+r*I)*T,t[14]=(f*y-A*w-g*m)*T,t[15]=(l*w-c*y+d*m)*T)}(t,t)},To=function(){function e(e,i){void 0===e&&(e=new t.Vector3),void 0===i&&(i=0),this.sample=e,this.timestampS=i}return e.prototype.set=function(t,e){this.sample=t,this.timestampS=e},e.prototype.copy=function(t){this.set(t.sample,t.timestampS)},e}(),Ro=function(){function e(e,i){this.kFilter=e,this.isDebug=i,this.currentAccelMeasurement=new To,this.currentGyroMeasurement=new To,this.previousGyroMeasurement=new To,vo()?this.filterQ=new t.Quaternion(-1,0,0,1):this.filterQ=new t.Quaternion(1,0,0,1),this.previousFilterQ=new t.Quaternion,this.previousFilterQ.copy(this.filterQ),this.accelQ=new t.Quaternion,this.isOrientationInitialized=!1,this.estimatedGravity=new t.Vector3,this.measuredGravity=new t.Vector3,this.gyroIntegralQ=new t.Quaternion}return e.prototype.addAccelMeasurement=function(t,e){this.currentAccelMeasurement.set(t,e)},e.prototype.addGyroMeasurement=function(t,e){var i;this.currentGyroMeasurement.set(t,e),i=e-this.previousGyroMeasurement.timestampS,isNaN(i)||i<=.001||i>1||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,i=this.gyroToQuaternionDelta_(this.currentGyroMeasurement.sample,e);this.gyroIntegralQ.multiply(i),this.filterQ.copy(this.previousFilterQ),this.filterQ.multiply(i);var n=new t.Quaternion;n.copy(this.filterQ),n.inverse(),this.estimatedGravity.set(0,0,-1),this.estimatedGravity.applyQuaternion(n),this.estimatedGravity.normalize(),this.measuredGravity.copy(this.currentAccelMeasurement.sample),this.measuredGravity.normalize();var r,o=new t.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)",go*((r=o).w>1?0:2*Math.acos(r.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 s=new t.Quaternion;s.copy(this.filterQ),s.multiply(o),this.filterQ.slerp(s,1-this.kFilter),this.previousFilterQ.copy(this.filterQ)},e.prototype.accelToQuaternion_=function(e){var i=new t.Vector3;i.copy(e),i.normalize();var n=new t.Quaternion;return n.setFromUnitVectors(new t.Vector3(0,0,-1),i),n.inverse(),n},e.prototype.gyroToQuaternionDelta_=function(e,i){var n=new t.Quaternion,r=new t.Vector3;return r.copy(e),r.normalize(),n.setFromAxisAngle(r,e.length()*i),n},e}(),ko=function(){function e(e,i){this.predictionTimeS=e,this.isDebug=i,this.previousQ=new t.Quaternion,this.previousTimestampS=null,this.deltaQ=new t.Quaternion,this.outQ=new t.Quaternion}return e.prototype.getPrediction=function(e,i,n){if(!this.previousTimestampS)return this.previousQ.copy(e),this.previousTimestampS=n,e;var r=new t.Vector3;r.copy(i),r.normalize();var o=i.length();if(o<20*fo)return this.isDebug&&console.log("Moving slowly, at %s deg/s: no prediction",(go*o).toFixed(1)),this.outQ.copy(e),this.previousQ.copy(e),this.outQ;var s=o*this.predictionTimeS;return this.deltaQ.setFromAxisAngle(r,s),this.outQ.copy(this.previousQ),this.outQ.multiply(this.deltaQ),this.previousQ.copy(e),this.previousTimestampS=n,this.outQ},e}(),Qo=function(){function t(t){this.coefficients=t}return t.prototype.distortInverse=function(t){for(var e=0,i=1,n=t-this.distort(e);Math.abs(i-e)>1e-4;){var r=t-this.distort(i),o=i-r*((i-e)/(r-n));e=i,i=o,n=r}return i},t.prototype.distort=function(t){for(var e=t*t,i=0,n=0;n<this.coefficients.length;n++)i=e*(i+this.coefficients[n]);return(i+1)*t},t}(),Do=function(){this.angularAcceleration=null,this.angularVelocity=null,this.linearAcceleration=null,this.linearVelocity=null,this.orientation=null,this.position=null},No=function(){this.leftDegrees=0,this.rightDegrees=0,this.upDegrees=0,this.downDegrees=0},Fo=function(){function e(e,i,n,r){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=n,this.accelerometer=new t.Vector3,this.gyroscope=new t.Vector3,this.filter=new Ro(e,r),this.posePredictor=new ko(i,r),this.isFirefoxAndroid=yo(),this.isIOS=vo();var o=bo();this.isDeviceMotionInRadians=!this.isIOS&&null!==o&&o<66,this.isWithoutDeviceMotion=wo()||Eo(),this.filterToWorldQ=new t.Quaternion,vo()?this.filterToWorldQ.setFromAxisAngle(new t.Vector3(1,0,0),Math.PI/2):this.filterToWorldQ.setFromAxisAngle(new t.Vector3(1,0,0),-Math.PI/2),this.inverseWorldToScreenQ=new t.Quaternion,this.worldToScreenQ=new t.Quaternion,this.originalPoseAdjustQ=new t.Quaternion;var s="undefined"!=typeof window?-window.orientation*Math.PI/180:0;this.originalPoseAdjustQ.setFromAxisAngle(new t.Vector3(0,0,1),s),this.setScreenTransform_(),Io()&&this.filterToWorldQ.multiply(this.inverseWorldToScreenQ),this.resetQ=new t.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||function(){var e=(new t.Quaternion).setFromAxisAngle(new t.Vector3(0,0,-1),0),i=new t.Quaternion;return"undefined"!=typeof window&&-90===window.orientation?i.setFromAxisAngle(new t.Vector3(0,1,0),Math.PI/-2):i.setFromAxisAngle(new t.Vector3(0,1,0),Math.PI/2),e.multiply(i)}(),this.deviceOrientationFilterToWorldQ=this.deviceOrientationFilterToWorldQ||((n=new t.Quaternion).setFromAxisAngle(new t.Vector3(1,0,0),-Math.PI/2),n),e=this._deviceOrientationQ;var i=new t.Quaternion;return i.copy(e),i.multiply(this.deviceOrientationFilterToWorldQ),i.multiply(this.resetQ),i.multiply(this.worldToScreenQ),i.multiplyQuaternions(this.deviceOrientationFixQ,i),this.yawOnly&&(i.x=0,i.z=0,i.normalize()),this.orientationOut_[0]=i.x,this.orientationOut_[1]=i.y,this.orientationOut_[2]=i.z,this.orientationOut_[3]=i.w,this.orientationOut_}var n,r=this.filter.getOrientation();e=this.posePredictor.getPrediction(r,this.gyroscope,this.previousTimestampS);var o=new t.Quaternion;return o.copy(this.filterToWorldQ),o.multiply(this.resetQ),o.multiply(e),o.multiply(this.worldToScreenQ),this.yawOnly&&(o.x=0,o.z=0,o.normalize()),this.orientationOut_[0]=o.x,this.orientationOut_[1]=o.y,this.orientationOut_[2]=o.z,this.orientationOut_[3]=o.w,this.orientationOut_},e.prototype.getPose=function(){var t=new Do;return t.orientation=this.getOrientation(),t},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(),Io()&&this.resetQ.multiply(this.inverseWorldToScreenQ),this.resetQ.multiply(this.originalPoseAdjustQ)},e.prototype.getFrameData=function(t){var e=this.getOrientation(),i=this.getEyeOffset(),n=this.getEyeProjectionMatrix();return t.pose.angularAcceleration=null,t.pose.angularVelocity=null,t.pose.linearAcceleration=null,t.pose.linearVelocity=null,t.pose.orientation=e,t.pose.position=null,t.timestamp=this.previousTimestampS,t.leftProjectionMatrix.set(n.left),t.rightProjectionMatrix.set(n.right),Po(t.leftViewMatrix,e,i.left),Po(t.rightViewMatrix,e,i.right),t},e.prototype.start=function(){if("undefined"==typeof window)return function(){};var t=this.onDeviceMotion_.bind(this),e=this.onOrientationChange_.bind(this),i=this.onMessage_.bind(this),n=this.onDeviceOrientation_.bind(this);return vo()&&function(){if("undefined"==typeof window)return!1;if("undefined"==typeof document)return!1;var t=window.self!==window.top,e=Bo(document.referrer),i=Bo(window.location.href);return t&&e!==i}()&&window.addEventListener("message",i),window.addEventListener("orientationchange",e),this.isWithoutDeviceMotion?window.addEventListener("deviceorientation",n):window.addEventListener("devicemotion",t),function(){window.removeEventListener("devicemotion",t),window.removeEventListener("deviceorientation",e),window.removeEventListener("orientationchange",e),window.removeEventListener("message",i)}},e.prototype.getEyeOffset=function(){return{left:[.5*-this.viewer.interLensDistance,0,0],right:[.5*this.viewer.interLensDistance,0,0]}},e.prototype.getEyeProjectionMatrix=function(){var t,e,i=this.getEyeFieldOfView(),n=this.depthNear,r=this.depthFar,o={left:[],right:[]},s=i.left.upDegrees*fo,a=i.left.downDegrees*fo,u=2/((t=i.left.leftDegrees*fo)+(e=i.left.rightDegrees*fo)),h=2/(s+a);return o.left[0]=u,o.left[1]=0,o.left[2]=0,o.left[3]=0,o.left[4]=0,o.left[5]=h,o.left[6]=0,o.left[7]=0,o.left[8]=-(t-e)*u*.5,o.left[9]=(s-a)*h*.5,o.left[10]=r/(n-r),o.left[11]=-1,o.left[12]=0,o.left[13]=0,o.left[14]=r*n/(n-r),o.left[15]=0,s=i.right.upDegrees*fo,a=i.right.downDegrees*fo,u=2/((t=i.right.leftDegrees*fo)+(e=i.right.rightDegrees*fo)),h=2/(s+a),o.right[0]=u,o.right[1]=0,o.right[2]=0,o.right[3]=0,o.right[4]=0,o.right[5]=h,o.right[6]=0,o.right[7]=0,o.right[8]=-(t-e)*u*.5,o.right[9]=(s-a)*h*.5,o.right[10]=r/(n-r),o.right[11]=-1,o.right[12]=0,o.right[13]=0,o.right[14]=r*n/(n-r),o.right[15]=0,o},e.prototype.getEyeFieldOfView=function(){var t=this.viewer,e=this.device,i=new Qo(t.distortionCoefficients),n=t.screenLensDistance,r=(e.widthMeters-t.interLensDistance)/2,o=t.interLensDistance/2,s=t.baselineLensDistance-e.bevelMeters,a=e.heightMeters-s,u=go*Math.atan(i.distort(r/n)),h=go*Math.atan(i.distort(o/n)),l=go*Math.atan(i.distort(s/n)),c=go*Math.atan(i.distort(a/n)),d=new No,p=new No;return d.leftDegrees=Math.min(u,t.fov),d.rightDegrees=Math.min(h,t.fov),d.downDegrees=Math.min(l,t.fov),d.upDegrees=Math.min(c,t.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 t.Quaternion;var i=e.alpha,n=e.beta,r=e.gamma;i=(i||0)*Math.PI/180,n=(n||0)*Math.PI/180,r=(r||0)*Math.PI/180,this._deviceOrientationQ.setFromEuler(new t.Euler(i,n,-r,"YXZ"))},e.prototype.onDeviceMotion_=function(t){this.updateDeviceMotion_(t)},e.prototype.updateDeviceMotion_=function(t){var e=t.accelerationIncludingGravity,i=t.rotationRate,n=t.timeStamp/1e3,r=n-this.previousTimestampS;return r<0?(So("fusion-pose-sensor:invalid:non-monotonic","Invalid timestamps detected: non-monotonic timestamp from devicemotion"),void(this.previousTimestampS=n)):r<=.001||r>1?(So("fusion-pose-sensor:invalid:outside-threshold","Invalid timestamps detected: Timestamp from devicemotion outside expected range."),void(this.previousTimestampS=n)):(e&&(this.accelerometer.set(-e.x,-e.y,-e.z),i&&(xo()?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))},e.prototype.onOrientationChange_=function(){this.setScreenTransform_()},e.prototype.onMessage_=function(t){var e=t.data;e&&e.type&&"devicemotion"===e.type.toLowerCase()&&this.updateDeviceMotion_(e.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 t.Vector3(0,0,1),-Math.PI/2);break;case-90:this.worldToScreenQ.setFromAxisAngle(new t.Vector3(0,0,1),Math.PI/2)}this.inverseWorldToScreenQ.copy(this.worldToScreenQ),this.inverseWorldToScreenQ.inverse()},e}(),Oo=[0,0,.5,1],Lo=[.5,0,.5,1],Vo=function(){function e(e){var i=this;this.renderer=e,this.sensor=new Fo(.98,.04,!1,!1),this.scale=1,this.cameraL=new t.PerspectiveCamera,this.cameraR=new t.PerspectiveCamera;var n=this.sensor.start();this.dispose=function(){var e=i.renderer.getSize(new t.Vector2);i.renderer.setScissor(0,0,e.width,e.height),i.renderer.setViewport(0,0,e.width,e.height),i.renderer.setScissorTest(!1),n()}}return e.prototype.render=function(e,i){var n=this.renderer.getSize(new t.Vector2);if(n.width>n.height){var r=e.autoUpdate;r&&(e.updateMatrixWorld(),e.autoUpdate=!1);var o={x:Math.round(n.width*Oo[0]),y:Math.round(n.height*Oo[1]),width:Math.round(n.width*Oo[2]),height:Math.round(n.height*Oo[3])},s={x:Math.round(n.width*Lo[0]),y:Math.round(n.height*Lo[1]),width:Math.round(n.width*Lo[2]),height:Math.round(n.height*Lo[3])};this.renderer.setScissorTest(!0),this.renderer.autoClear&&this.renderer.clear(),null===i.parent&&i.updateMatrixWorld(),i.matrixWorld.decompose(this.cameraL.position,this.cameraL.quaternion,this.cameraL.scale),i.matrixWorld.decompose(this.cameraR.position,this.cameraR.quaternion,this.cameraR.scale);var a=this.sensor.getEyeOffset();this.cameraL.translateOnAxis((new t.Vector3).fromArray(a.left),this.scale),this.cameraR.translateOnAxis((new t.Vector3).fromArray(a.right),this.scale);var u=this.sensor.getEyeProjectionMatrix();this.cameraL.projectionMatrix.elements=u.left.slice(),this.cameraR.projectionMatrix.elements=u.right.slice(),this.renderer.setViewport(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(s.x,s.y,s.width,s.height),this.renderer.setScissor(s.x,s.y,s.width,s.height),this.renderer.render(e,this.cameraR),this.renderer.setViewport(0,0,n.width,n.height),this.renderer.setScissor(0,0,n.width,n.height),this.renderer.setScissorTest(!1),r&&(e.autoUpdate=!0)}else this.renderer.render(e,i)},e.prototype.dispose=function(){},e}(),Ho={zh:{TITLE:"眼镜模式",HIT:"请将手机横屏放入 VR 眼镜中"},en:{TITLE:"GLASSES MODE",HIT:"Please put the mobile phone horizontally into the VR glasses."},ja:{TITLE:"メガネモード",HIT:"携帯電話をVRメガネに水平に入れてください。"}},zo="undefined"!=typeof navigator&&null!==(Mo=Ho[navigator.language.split("-")[0]])&&void 0!==Mo?Mo:Ho.zh,Ko="\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+/Nzc3o6Ojq6urh4eHU1NTR0dGDg4Pl5eWSkpLHx8fj4+Pe3t7X19fAwMDZ2dnCwsKrq6uioqLb29uNjY2enp67u7t5eXmAgIC2traWlpa5ubnKysqmpqZycnKHh4eurq6ysrKKioqDg4Pd3d12dnb9/f1vb2/s7OxlZWXz8/OoqKiZmZlpaWmbm5teXl7W1tbJycnExMRiYmJsbGywsLCPj49aWlq9vb1UVFRYWFhra2t+fn7t7e1RUVFOTk6Dg4OAgICCgoKKioqEhISIiIhqamqCgoKIiIiQkJCIiIiWlpawsLBmZmaAgICenp6Li4uBgYGTk5OMjIyVlZWFhYWCgoKvr6+Ojo59fX2SkpKvr6+Ojo6QkJCurq6BgYGxsbF8fHx4eHitra2enp6srKyJiYmurq54eHj5+fl+fn57e3v////5+fnS0tLAwMCVlZWwsLCurq5QUFCtra2EhISUlJSwsLCUlJSUlJSlpaWVlZW3t7diYmLAwMCFhYV3d3f///+tra3///9XV1eampqnp6d8fHz///////9VVVVlZWVtbW3+/v5SUlKcnJytra28vLzGxsbR0dHX19doaGiWlpafn5/Hx8ezs7Nzc3Nubm7AwMCIiIjj4+NTU1P29vZbW1vl5eVkZGTMzMxYWFjq6upfX1/k5OT////4+PjV1dWkpKRoaGj4+Pizs7Pm5ubAwMCfn5+vr6+urq4wMDCxsbG2tra5ubliYmIuLi6zs7NHR0empqY0NDRCQkKqqqo5OTmoqKg7OztfX19dXV1oaGikpKRkZGStra0hISE/Pz89PT0pKSlmZmZJSUlERERbW1s2NjZVVVUmJia7u7uEhIRXV1d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UvrhFkBX+RkJdmBXCFr1bRA+drjpp52uS35fPPDWxYQnzFbuJo6zhPnIOt6g5s06QxEfN8PAPGytQUf0JbQRbK+x4YjlR9eDpg9dOdOFjEPv0hXiMgOoJXWe7rblnIbLuWms8mz+oX2kozqEOdrLC1hSpJWVjZB+HS1TSjbgDyWZALPmXXwhdNxOvhCWz20JVyluoIYQKiiyRhqNwG/RvLsiGdW18WI2chw2pEkpRWgLEUICk9V1zf6X56bMKMqz6s+s5QrpWuc2PIlQbBSogAO+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/Pz9aWlpkZGQ3NzdcXFxeXl5MTExHR0dhYWFJSUk9PT1WVlZMTEygoKBERERFRUVmZmZQUFA9PT1LS0tra2tPT09ubm5SUlI2NjZXV1czMzOpqalTU1O3t7dVVVVoaGhaWlpqamq1tbWhoaGenp6lpaWurq6ysrJZWVmjo6OgoKBUVFRdXV1cXFyvr6+0tLSwsLCrq6ubm5syMjKbm5twcHCQkJCLi4uGhobLy8uCgoJ9fX1ycnLPz894eHizs7NxcXFgYGCVlZWYmJh7e3umpqa3t7fOzs7JycnFxcWvr6+JiYl0dHRra2uSkpKNjY2IiIi4uLiUlJSsrKx3d3fDw8OHh4eQkJB9fX2dnZ2UlJR/f3++vr6RkZFzc3ODg4OioqKcnJyUlJSCgoJ4eHirq6u4uLh4eHiBgYF2dnaLi4uMjIyjo6OZmZm1tbWwsLCcnJyxsbF6enqAgICwsLC9vb26urqjo6OKioqsrKyWlpaoqKhbW1u2traCgoJ6enqZmZmbm5t+fn6JiYmgoKC0tLS4uLhmZma0tLSYmJhxcXF1dXWlpaWfn5+IiIicnJyzs7Ofn5+xsbGampq7u7vAwMCMjIxgYGChoaGgoKCQkJCOjo5vb2+RkZG1tbWOjo6Hh4d6enq1tbV8fHzGxsZubm5mZmanp6eZmZmvr6+Hh4eTk5Ojo6NwcHCenp6mpqZ6enqlpaWWlpaJiYmlpaVjY2OcnJyKiop9fX1/f3+CgoKlpaV4eHiUlJSIiIixsbGqqqqGhoZxcXGPj4+ysrK1tbWurq63t7eBgYG2tra2tralpaV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jVKlSc3kSLJ5c5V6rTZQAcVkGbBeuOkgCgq2CBM3MoFwGr1tvim2aMpZZqyBBc3N1UF2GX90j9SQJKCBB83OfYAcNVjFcSrvzo95WOShB83Ody5V24fqzO0nAUSzB/89Nph38VqmuOa3gticJOP9fApuHTDt4nFJ7AXdPC0lg8/gq8y5XapSrgpUgbQ0JpF5u97hS1fOC26nlJJA8Yd41Sg3fU4dtRQkKeXSN3jo4Qqm0397OmyZOGatoDrScBIWM3DFn5kXi1ZyqRSUoZtKOa1vWKArztqgEnhIHty4f9/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(zo.TITLE,'</div>\n <div class="$id-modal-content-hit">').concat(zo.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');var qo=new t.CircleBufferGeometry(.12,16),jo=function(){var e=Ie(),i=new t.Texture;return e.onload=function(){if("undefined"!=typeof document){var t=256,n=document.createElement("canvas");n.setAttribute("width",String(t)),n.setAttribute("height",String(t));var r=n.getContext("2d");if(r){r.drawImage(e,0,0,t,t),r.globalCompositeOperation="source-out";r.beginPath(),r.lineWidth=6.4,r.arc(128,128,83.2,0,2*Math.PI),r.strokeStyle="rgba(255, 255, 255, 1.0)",r.closePath(),r.stroke(),i.image=n,i.needsUpdate=!0}}},e.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAR9JREFUOBF10kFOAzEMBdCZFhCbrrgAN+NqHIULsWKDKO3gF+VHoZpa+rXjfH87nq7btr0ty3KZ8FsxnHeQPL748lA/x0Jsq+AwYe0X8nDtGA33BEJUHIEKW/EorHOLI7BHNlkEbju38YkQAIRZxFkHz2HOirKDxNcIzG+fu/6oLiNmqc5ZrlwTeKyAgJF14tMZmSn87pBrxeX/CRABgk/dl1s+C18dio2Pp9nmCQru2UtdvN+7lI9AFsgb3zNMcSp8FF4LYs3UhLfOAvkDJffci8q1J/ByRLKnQ8gUJUFOd2SeZYliCxwiyJCxCbhUGFKF4zPm61hiq7sVyJnPmATyR5IzLSNyDNEFRCDnkAmA8U2RfCsIefYhDeKOQLv7A+l1ZTyjymNxAAAAAElFTkSuQmCC",i}(),Uo=function(){if("undefined"!=typeof document){var e=document.createElement("canvas");e.setAttribute("width",String(512)),e.setAttribute("height",String(512));var i=e.getContext("2d");if(i){var n=256;return i.beginPath(),i.arc(n,n,192,0,2*Math.PI),i.fillStyle="rgba(255, 255, 255, 0.1)",i.closePath(),i.fill(),i.save(),i.beginPath(),i.arc(n,n,192,0,2*Math.PI),i.strokeStyle="rgba(255, 255, 255, 0.5)",i.lineWidth=10.24,i.closePath(),i.stroke(),new t.CanvasTexture(e)}}return null}(),Go=function(){if("undefined"!=typeof document){var e=document.createElement("canvas");e.setAttribute("width",String(512)),e.setAttribute("height",String(512));var i=e.getContext("2d");if(i){var n=256;i.arc(n,n,192,0,2*Math.PI),i.fillStyle="rgba(85, 90, 255, 0.6)",i.shadowBlur=25.6,i.shadowColor="rgba(255, 255, 255, 0.6)",i.fill(),i.arc(n,n,192,0,2*Math.PI);var r=i.createRadialGradient(n,n,0,n,n,n);r.addColorStop(0,"rgba(255, 255, 255, 0.0)"),r.addColorStop(.5,"rgba(255, 255, 255, 0.0)"),r.addColorStop(1,"rgba(255, 255, 255, 0.2)"),i.fillStyle=r,i.fill(),i.lineWidth=4.8,i.arc(n,n,187.2,0,2*Math.PI);var o=i.createLinearGradient(0,0,0,512);return o.addColorStop(.02,"rgba(255, 255, 255, 1.0)"),o.addColorStop(.2,"rgba(255, 255, 255, 0.0)"),o.addColorStop(.8,"rgba(255, 255, 255, 0.0)"),o.addColorStop(.98,"rgba(255, 255, 255, 1.0)"),i.strokeStyle=o,i.stroke(),new t.CanvasTexture(e)}}return null}(),_o=function(){if("undefined"!=typeof document){var e=document.createElement("canvas");e.setAttribute("width",String(512)),e.setAttribute("height",String(512));var i=e.getContext("2d");if(i){var n=256,r=179.2;i.arc(n,n,r,0,2*Math.PI),i.fillStyle="rgba(255, 255, 255, 0.4)",i.shadowBlur=25.6,i.shadowColor="rgba(255, 255, 255, 0.6)",i.fill(),i.arc(n,n,r,0,2*Math.PI);var o=i.createRadialGradient(n,n,0,n,n,n);o.addColorStop(0,"rgba(255, 255, 255, 0.0)"),o.addColorStop(.5,"rgba(255, 255, 255, 0.0)"),o.addColorStop(1,"rgba(255, 255, 255, 0.5)"),i.fillStyle=o,i.fill(),i.lineWidth=4.8,i.arc(n,n,r-4.8,0,2*Math.PI);var s=i.createLinearGradient(0,0,0,512);return s.addColorStop(.02,"rgba(255, 255, 255, 1.0)"),s.addColorStop(.2,"rgba(255, 255, 255, 0.0)"),s.addColorStop(.8,"rgba(255, 255, 255, 0.0)"),s.addColorStop(.98,"rgba(255, 255, 255, 1.0)"),i.strokeStyle=s,i.stroke(),new t.CanvasTexture(e)}}return null}(),Wo=function(){if("undefined"!=typeof document){var e=document.createElement("canvas");e.setAttribute("width",String(512)),e.setAttribute("height",String(512));var i=e.getContext("2d");if(i){var n=256;i.lineWidth=64,i.arc(n,n,217.6,0,2*Math.PI),i.strokeStyle="rgba(147, 162, 255, 0.3)",i.shadowBlur=25.6,i.shadowColor="rgba(255, 255, 255, 0.6)",i.stroke(),i.lineWidth=64,i.arc(n,n,217.6,0,2*Math.PI);var r=i.createRadialGradient(n,n,185.6,n,n,249.6);r.addColorStop(0,"rgba(255, 255, 255, 0.5)"),r.addColorStop(.3,"rgba(255, 255, 255, 0.0)"),r.addColorStop(.7,"rgba(255, 255, 255, 0.0)"),r.addColorStop(1,"rgba(255, 255, 255, 0.5)"),i.strokeStyle=r,i.stroke(),i.beginPath(),i.lineWidth=4,i.arc(n,n,245.6,0,2*Math.PI);var o=i.createLinearGradient(0,0,512,0);return o.addColorStop(.02,"rgba(255, 255, 255, 1.0)"),o.addColorStop(.1,"rgba(255, 255, 255, 0.0)"),o.addColorStop(.9,"rgba(255, 255, 255, 0.0)"),o.addColorStop(.98,"rgba(255, 255, 255, 1.0)"),i.strokeStyle=o,i.stroke(),new t.CanvasTexture(e)}}return null}(),Xo=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.opacityMotion=new In({opacity:0}),i.loadingMotion=new In({opacity:0}),i.currentMotion=new In({ringScale:1.1,ringOpacity:0,circleFade:0,circleOpacity:.5,circleScale:1});var n={blending:t.CustomBlending,blendSrc:t.SrcAlphaFactor,blendDst:t.OneMinusSrcAlphaFactor,blendSrcAlpha:t.OneFactor,blendDstAlpha:t.OneMinusSrcAlphaFactor,depthWrite:!1,transparent:!0};return i.hitTestMesh=new t.Mesh(qo,new t.MeshBasicMaterial(Ft(Ft({},n),{color:0,opacity:0}))),i.hitTestMesh.scale.set(1.5,1.5,1.5),i.centerMesh=new t.Mesh(qo,new t.MeshBasicMaterial(Ft(Ft({},n),{map:Go,opacity:0}))),i.centerMesh2=new t.Mesh(qo,new t.MeshBasicMaterial(Ft(Ft({},n),{map:_o,opacity:0}))),i.ringMesh=new t.Mesh(qo,new t.MeshBasicMaterial(Ft(Ft({},n),{map:Wo,opacity:0}))),i.loadingMesh=new t.Mesh(qo,new t.MeshBasicMaterial(Ft(Ft({},n),{map:jo,opacity:.8}))),i.disableMesh=new t.Mesh(qo,new t.MeshBasicMaterial(Ft(Ft({},n),{map:Uo}))),i.loadingMesh.visible=!1,i.disableMesh.visible=!1,i.hitTestMesh.position.z=0,i.ringMesh.position.z=.003,i.disableMesh.position.z=.002,i.centerMesh.position.z=.002,i.centerMesh2.position.z=.002,i.loadingMesh.position.z=.005,i.hitTestMesh.frustumCulled=!1,i.centerMesh.frustumCulled=!1,i.centerMesh2.frustumCulled=!1,i.ringMesh.frustumCulled=!1,i.loadingMesh.frustumCulled=!1,i.disableMesh.frustumCulled=!1,i.add(i.hitTestMesh),i.add(i.centerMesh),i.add(i.centerMesh2),i.add(i.ringMesh),i.add(i.loadingMesh),i.add(i.disableMesh),i.renderOrder=1e4,i.needsRender=!0,i}return Nt(i,e),i.prototype.setProgress=function(t){this.progress=t,this.setLoading(t>0)},i.prototype.setOpacity=function(t){this.opacity!==t&&(this.opacity=t=bn(t,0,1),this.opacityMotion.set({opacity:t},30).catch(Kt))},i.prototype.setCurrent=function(t){if(this.current!==t){if(t){var e=[{progress:0,value:{ringScale:2,ringOpacity:0,circleFade:0,circleOpacity:.5,circleScale:1}},{progress:.05,value:{ringScale:1,ringOpacity:1,circleFade:0,circleOpacity:.5,circleScale:1}},{progress:.15,value:{ringScale:1.2,ringOpacity:1,circleFade:0,circleOpacity:.5,circleScale:1}},{progress:.25,value:{ringScale:1.1,ringOpacity:1,circleFade:0,circleOpacity:.5,circleScale:1}},{progress:.8,value:{ringScale:1.1,ringOpacity:1,circleFade:1,circleOpacity:1,circleScale:1}},{progress:.9,value:{ringScale:1.1,ringOpacity:1,circleFade:1,circleOpacity:1,circleScale:.8}},{progress:.92,value:{ringScale:1.1,ringOpacity:1,circleFade:1,circleOpacity:1,circleScale:.8}},{progress:1,value:{ringScale:1.1,ringOpacity:1,circleFade:1,circleOpacity:.3,circleScale:1.1}}];this.currentMotion.setKeyframes(e,1500).catch(Kt)}else e=[{progress:0,value:Ft({},this.currentMotion.value)},{progress:1,value:{ringScale:1.1,ringOpacity:0,circleFade:0,circleOpacity:.5,circleScale:1}}],this.currentMotion.setKeyframes(e,200).catch(Kt);this.current=t}},i.prototype.setLoading=function(t){this.loading!==t&&(t?this.loadingMotion.setKeyframes([{progress:0,value:{opacity:0}},{progress:.3,value:{opacity:0}},{progress:1,value:{opacity:.8}}],500):this.loadingMotion.set({opacity:0},0),this.loading=t,!0===this.disabled&&this.setDisabled(!1),this.needsRender=!0)},i.prototype.setDisabled=function(t){this.disabled!==t&&(this.disabled=t,!0===this.loading&&this.setLoading(!1),this.disableMesh.visible=t,this.centerMesh.visible=!t,this.needsRender=!0)},i.prototype.tap=function(){return Promise.resolve()},i.prototype.updateTime=function(t,e){this.opacityMotion.update(t),this.currentMotion.update(t),this.loadingMotion.update(t);var i=this.opacityMotion.value.opacity,n=this.currentMotion.value,r=n.ringScale,o=n.ringOpacity,s=n.circleFade,a=n.circleOpacity,u=n.circleScale;if(this.ringMesh.scale.set(r,r,r),this.centerMesh.scale.set(u,u,u),this.centerMesh2.scale.set(u,u,u),this.ringMesh.material.opacity=o*i,this.centerMesh.material.opacity=(1-s)*i,this.centerMesh2.material.opacity=s*a*i,this.loadingMotion.value.opacity>0){this.loadingMesh.visible=!0,this.loadingMesh.material.opacity=this.loadingMotion.value.opacity,this.loadingMesh.rotateZ(-e/200);var h=this.opacityMotion.value.opacity,l=1.1;this.centerMesh.scale.set(l,l,l),this.centerMesh2.scale.set(l,l,l),this.centerMesh.material.opacity=0*h,this.centerMesh2.material.opacity=.2*h}else this.loadingMesh.visible=!1;this.needsRender=!0},i.prototype.dispose=function(){this.currentMotion.dispose(),this.opacityMotion.dispose(),this.loadingMotion.dispose(),this.ringMesh.material.dispose(),this.disableMesh.material.dispose(),this.centerMesh.material.dispose(),this.loadingMesh.material.dispose()},i}(t.Object3D),Yo=function(e){function i(t){var n=this,r=i.parseArgs(t);(n=e.call(this,r)||this).cardboard=new Vo(n.renderer);var o,s,a,u=(s=function(t){for(var e=1,i=document.getElementsByTagName("meta"),n=0;n<i.length;n++){var r=i[n];if("viewport"===r.getAttribute("name")){var o=(r.getAttribute("content")||"").match(/initial\-scale\=([\d|\.]+)/);o&&(e=Number(o[1])),isNaN(e)&&(e=1)}}return Ko.replace(/\n/g," ").replace(/\ +/g," ").replace(/\$id/g,t).replace(/(\d+)px/g,(function(t,i){return function(t){return Math.floor(t*e)+"px"}(Number(i))}))}(o="five_vr_helper_"+rr()),(a=document.createElement("div")).className=o,a.innerHTML=s,a);n.helperElement=u;var h=new Ir(u);return n.element.parentNode&&(n.element.parentNode.insertBefore(u,n.element),n.setHelperElementSize(),h.on("tap",(function(){return n.emit("vrWantsToExit")}))),n.destroyHelper=function(){h.destroy(),u.parentNode&&u.parentNode.removeChild(u),delete n.helperElement},n.boundingMesh.visible=!0,n}return Nt(i,e),i.parseArgs=function(t){var i=Ft(Ft({},t),{maxLatitude:Math.PI/2,minLatitude:-Math.PI/2});return e.parseArgs.call(this,i)},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.cardboard.dispose(),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.needsRender=!0,this.setHelperElementSize()},i.prototype.updatePanoMeshes=function(){var t=this;this.panoMeshes.forEach((function(e){t.helper.remove(e),e.dispose()})),this.panoMeshes.length=0;for(var e=0;e<this.work.observers.length;e++){var i=this.work.observers[e],n=new Xo;n.name="panoSphere_".concat(this.work.workCode,"_").concat(e),n.position.copy(i.position),n.needsRender=!0,this.helper.add(n),this.panoMeshes[e]=n}},i.prototype.updateTime=function(e,i){var n,r;if(!this.destroyed){this.needsRender=!0;var o={},s={};if(!1===this.locationMotion.ended){this.locationMotion.update(e);var a=this.locationMotion.getKeyFrameSegment(e),u=a[0],h=a[1],l=this.panoResourceFromLocationMotionKeyframe(u),c=this.panoResourceFromLocationMotionKeyframe(h),d=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[0]),p=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]),A=l.position,f=c.position,g=this.locationMotion.value.count-h.value.count+1;o.modelAlpha=this.locationMotion.value.modelAlpha,o.perspToOrtho=bn(1-10*(1-this.locationMotion.value.perspToOrtho),0,1),o.useBlackTransition="instant"===c.effect,c.panoPicture&&(g<1?l.panoPicture&&(o.pano0=l.panoPicture):o.pano0=c.panoPicture,o.pano1=c.panoPicture),"fade"===c.effect&&(o.pano0&&l.panoPicture&&(o.pano0={map:o.pano0.map,luminanceMap:o.pano0.luminanceMap,matrix:l.panoPicture.matrix.clone().setPosition(c.position)}),A.copy(f)),o.progress=g,s.distance=this.locationMotion.value.distance,s.offset=new t.Vector3(A.x+(f.x-A.x)*g,A.y+(f.y-A.y)*g,A.z+(f.z-A.z)*g);for(var v=[],m=[],y=0,b=this.locationMotion.keyframes;y<b.length;y++){var w=b[y],E=w.key,x=w.progress;void 0!==E&&(v.push(E),x>=this.locationMotion.progress&&m.push(E))}for(var I=0,C=Object.keys(this.panoResources);I<C.length;I++){var S=C[I];if(!(m.indexOf(S)>=0)){var B=this.panoResources[S];if(B.panoPicture){var M=B.panoPicture.map;if(M){if(M===(null===(n=o.pano0)||void 0===n?void 0:n.map))continue;if(M===(null===(r=o.pano1)||void 0===r?void 0:r.map))continue;M.dispose(),B.panoPicture=null}}v.indexOf(S)>=0||delete this.panoResources[S]}}this.currentPanoIndex=g<.5?l.panoIndex:c.panoIndex,this.emit("movingToPano",p.panoIndex,d.panoIndex,this.locationMotion.progress)}!1===Er(o)&&(this.model.setMaterial(o),this.boundingMesh.setMaterial(o)),s.offset&&this.camera.position.copy(s.offset);var P=this.camera.pose.longitude,T=this.camera.pose.latitude;this.camera.quaternion.fromArray(this.cardboard.sensor.getOrientation()),this.camera.updateMatrixWorld(),this.camera.computePose();for(var R=this.work.observers[this.currentPanoIndex].visibleNodes.concat(this.currentPanoIndex),k=0;k<this.work.observers.length;k++){var Q=this.work.observers[k];if((F=this.panoMeshes[k]).visible=!0,Q.loadable||Q.active){if(-1===R.indexOf(k))F.visible=!1;else{F.visible=!0;var D=F.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);D<.05?F.setOpacity(0):F.setOpacity(bn(1.5/D,0,1)),this.currentPanoIndex===k&&F.setOpacity(0)}F.lookAt(this.camera.position)}else F.visible=!0}var N=this.intersect(e);for(k=0;k<this.work.observers.length;k++)null==(F=this.panoMeshes[k])||F.setCurrent(F===N);for(k=0;k<this.work.observers.length;k++){var F;(F=this.panoMeshes[k])&&F.updateTime&&F.updateTime(e,i)}P===this.camera.pose.longitude&&T===this.camera.pose.latitude||(this.cameraMotion.set(li(this.camera.pose,["longitude","latitude"]),0).catch(Kt),this.emit("cameraDirectionUpdate",li(this.camera.pose,["longitude","latitude"]),!0),this.emit("cameraUpdate",xr(li(this.camera.pose,["longitude","latitude","fov","offset"])),!0))}},i.prototype.render=function(){this.cardboard.render(this.scene,this.camera)},i.prototype.setCamera=function(t){void 0===t&&(t={})},i.prototype.destroyHelper=function(){},i.prototype.setHelperElementSize=function(){if(this.helperElement){var e=new t.Vector2(this.element.offsetWidth,this.element.offsetHeight),i=e.x*this.scissor.left,n=e.y*(1-this.scissor.bottom-this.scissor.height),r=e.x*this.scissor.width,o=e.y*this.scissor.height;this.helperElement.style.marginLeft=i+"px",this.helperElement.style.marginTop=n+"px",this.helperElement.style.width=r+"px",this.helperElement.style.height=o+"px"}},i.prototype.intersect=function(e){var i;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){var n=this.activePanoMesh;return(h=this.panoMeshes.indexOf(n))>=0&&this.moveToPano(h,{},!0),delete this.activePanoMesh,delete this.activeTime,n}for(var r=this.camera.getWorldDirection(new t.Vector3),o=new t.Raycaster(this.camera.position,r),s=void 0,a=[],u=this.work.observers[this.currentPanoIndex].visibleNodes,h=0;h<this.work.observers.length;h++){var l=this.panoMeshes[h];if(-1!==u.indexOf(h)){var c=o.intersectObject(null!==(i=l.hitTestMesh)&&void 0!==i?i:l,!0)[0];c&&a.push({panoMesh:l,intersection:c})}}var d=a.sort((function(t,e){return t.intersection.distance-e.intersection.distance}))[0];if(d?(s=d.intersection,this.activePanoMesh!==d.panoMesh&&(this.activePanoMesh=d.panoMesh,this.activeTime=e),this.intersectMesh.position.copy(d.panoMesh.position),this.intersectMesh.lookAt(this.camera.position),this.intersectMesh.visible=!1):(this.activePanoMesh=void 0,this.activeTime=void 0),!s)if((s=this.model.intersectRaycaster(o)[0])&&s.face){var p=s.face.normal,A=new t.Quaternion;A.setFromUnitVectors(new t.Vector3(0,0,1),p),this.intersectMesh.quaternion.copy(A);var f=p.clone().multiplyScalar(.05),g=s.point.clone().add(f);this.intersectMesh.position.copy(g),this.intersectMesh.visible=!0,this.emit("intersectionOnModelUpdate",s,this.intersectMesh)}else this.intersectMesh.visible=!1,this.emit("intersectionHidden");return null==d?void 0:d.panoMesh},i.prototype.onPanGesture=function(){},i.prototype.onTapGesture=function(){},i.prototype.onPinchGesture=function(){},i.prototype.onMouseMove=function(){},i.prototype.onMouseOut=function(){},i}(Ao),Zo=function(e){function i(t){var n,r,o,s,a=this,u=i.parseArgs(t);return(a=e.call(this,u)||this).currentPanoIndex=u.initial[0],a.locationMotion=new In({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!==(s=null===(o=a.model.getMaterial())||void 0===o?void 0:o.perspToOrtho)&&void 0!==s?s:0}),a}return Nt(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(t,e,i,n,r){this.work=t,this.currentPanoIndex=e,this.hideIntersectMesh();var o={duration:0,longitude:i.longitude,latitude:i.latitude,fov:i.fov};return this.moveToPano(e,o,r),!0},i.prototype.updateTime=function(e,i){if(!this.destroyed){var n={},r={};if(!this.locationMotion.ended){this.locationMotion.update(e),n.modelAlpha=this.locationMotion.value.modelAlpha,n.perspToOrtho=bn(1-10*(1-this.locationMotion.value.perspToOrtho),0,1),r.distance=this.locationMotion.value.distance,r.offset=new t.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z);var o=new t.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z),s=wr(this.work.observers,(function(t){return t.position.distanceTo(o)}));this.currentPanoIndex=this.work.observers.indexOf(s)}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),Er(n)||this.model.setMaterial(n),Er(r)||this.setCamera(r)}},i.prototype.initAnimation=function(t,e,i,n){var r,o,s,a=this;this.destroyed||(this.pending=!1,this.userAction=n,this.moveToPano(t,{longitude:null!==(r=e.longitude)&&void 0!==r?r:this.defaultLongitude,latitude:bn(null!==(o=e.latitude)&&void 0!==o?o:this.defaultLatitude,this.minLatitude,this.maxLatitude),fov:bn(null!==(s=e.fov)&&void 0!==s?s:this.defaultFov,this.minFov,this.maxFov),duration:i,moveStartCallback:function(t,e){a.emit("initAnimationWillStart",t,e,a.userAction)},moveEndCallback:function(t,e){a.emit("initAnimationEnded",t,e,a.userAction)},moveCancelCallback:function(){var t=a.currentPanoIndex,e={longitude:a.camera.pose.longitude,latitude:a.camera.pose.latitude,fov:a.camera.pose.fov,offset:a.camera.pose.offset.clone()};a.emit("initAnimationEnded",t,e,a.userAction)}},n))},i.prototype.getTargetPose=function(){var e=this.cameraMotion.getKeyFrameSegment(jt())[1],i=this.locationMotion.getKeyFrameSegment(jt())[1];return{longitude:e.value.longitude,latitude:e.value.latitude,fov:e.value.fov,offset:new t.Vector3(i.value.x,i.value.y,i.value.z)}},i.prototype.moveToPano=function(t,e,i){void 0===e&&(e={});var n=this.work.observers[t];n&&this.moveToPosition(n.position,e,i)},i.prototype.moveToPosition=function(e,i,n){var r,o,s,a=this;void 0===i&&(i={}),this.userAction=n;for(var u=jt(),h=new t.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z).distanceTo(e),l=this.locationMotion.getProgressVelocity(u),c=0,d=1;d<this.locationMotion.keyframes.length;d++){var p=this.locationMotion.keyframes[d-1].value,A=p.x,f=p.y,g=p.z,v=this.locationMotion.keyframes[d].value,m=v.x,y=v.y,b=v.z;c+=Math.sqrt(Math.pow(m-A,2)+Math.pow(y-f,2)+Math.pow(b-g,2))}var w=0===h?0:l*c/h,E=this.calculateMovingDuration(i.duration,h),x={x:e.x,y:e.y,z:e.z,distance:0,modelAlpha:1,perspToOrtho:0},I={longitude:i.longitude,latitude:i.latitude,fov:i.fov},C={longitude:null!==(r=I.longitude)&&void 0!==r?r:this.camera.pose.longitude,latitude:null!==(o=I.latitude)&&void 0!==o?o:this.camera.pose.latitude,fov:null!==(s=I.fov)&&void 0!==s?s:this.camera.pose.fov,offset:e.clone()},S=wr(this.work.observers,(function(t){return t.position.distanceTo(e)})),B=this.work.observers.indexOf(S);this.emit("moveToPano",B,this.userAction),i.moveStartCallback&&i.moveStartCallback(B,C),this.emit("panoWillArrive",B,C,this.userAction),this.cameraMotion.set(I,E).catch(Kt),this.locationMotion.set(x,E,w).then((function(){var t=xr(a.camera.pose);i.moveEndCallback&&i.moveEndCallback(B,t),a.emit("panoArrived",B,t,a.userAction)}),(function(){i.moveCancelCallback&&i.moveCancelCallback(),a.emit("moveToPanoCanceled",B)}))},i.prototype.onTapGesture=function(e){var i=e.pointers.map((function(t){return li(t,["x","y"])}));if(!this.emit("wantsGesture","tap",i,!0)){var n=this.relativeClientPosition(e.center),r=new t.Raycaster;if(r.setFromCamera(n,this.camera),!this.emit("wantsTapGesture",r,n,!0)){this.emit("gesture","tap",i,!0),this.emit("tapGesture",r,n,!0),this.interiaMovement=!1;var o=this.model.intersectRaycaster(r)[0];if(o&&o.face){var s=o.face.normal,a=o.point;if(new t.Vector3(0,1,0).angleTo(s)>Math.PI/3){var u=this.camera.position.clone().setY(a.y),h=a.clone().sub(u).setLength(.3),l=a.clone().sub(h);r.set(l,new t.Vector3(0,-1,0)),o=this.model.intersectRaycaster(r)[0]}}if(o){var c=o.point.clone(),d=wr(this.work.observers.filter((function(t){return Math.abs(t.standingPosition.y-c.y)<1})),(function(t){return t.standingPosition.distanceTo(c)}));if(d)return c.y=d.position.y,void this.moveToPosition(c,{},!0)}this.cameraBounce()}}},i}(zr);const Jo=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var i=113,n=126,r=0,o="";return arguments[r].split(o).map((function(t){return t.charCodeAt(r)>n?t:String.fromCharCode((t.charCodeAt(r)+i)%n)})).join(o)}("{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"),$o=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var i=113,n=126,r=0,o="";return arguments[r].split(o).map((function(t){return t.charCodeAt(r)>n?t:String.fromCharCode((t.charCodeAt(r)+i)%n)})).join(o)}("{vs|z-sy|n-|}npv\bH{vs|z-nz}yrPor-}n{|Zn}H{vs|z-nz}yr?Q-}n{|Qv}ynprzr{Zn}Hn\bv{t-rp@-}n{|d|yq]|vv|{H|vq-znv{56-\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");var ts=Object.assign({opacity:new t.Uniform(1),scale:new t.Uniform(13.1),panoMap:new t.Uniform(null),panoDisplacementMap:new t.Uniform(null),panoPosition:new t.Uniform(new t.Vector3),panoMatrix:new t.Uniform(new t.Matrix4)},{emissive:new t.Uniform(new t.Color(0)),emissiveMap:new t.Uniform(null),specular:new t.Uniform(new t.Color(1118481)),specularMap:new t.Uniform(null),normalMap:new t.Uniform(null),bumpMap:new t.Uniform(null),shininess:new t.Uniform(30)},t.UniformsLib.common,t.UniformsLib.lights),es=new t.SphereBufferGeometry(.01,128,128),is=function(){function e(t){void 0===t&&(t={}),this.textureLoader=new Qi({allowHosts:this.allowHosts,networkSubscribe:this.networkSubscribe}),this.allowHosts=t.allowHosts,this.networkSubscribe=t.networkSubscribe}return e.prototype.setAllowHosts=function(t){this.allowHosts=t,this.textureLoader.setAllowHosts(t)},e.prototype.setNetworkSubscribe=function(t){this.networkSubscribe=t,this.textureLoader.setNetworkSubscribe(t)},e.prototype.load=function(e,i,n,r,o,s,a,u){var h=[0,0],l=function(t,e){h[e]=t,a(.8*h[0]+.2*h[1])},c=[this.textureLoader.load(e,{viaAjax:!0},void 0,void 0,(function(t){return l(t,1)}),u),this.textureLoader.loadCube(i,{viaAjax:!0},void 0,void 0,(function(t){return l(t,0)}),u)];return Promise.all(c).then((function(e){var i=e[0],s=e[1],a={body:function(e,i,n,r){var o=new t.ShaderMaterial({side:t.BackSide,vertexShader:Jo,fragmentShader:$o,transparent:!0,uniforms:t.UniformsUtils.clone(ts)}),s=i;return s.needsUpdate=!0,s.minFilter=t.LinearFilter,s.magFilter=t.LinearFilter,e.needsUpdate=!0,e.minFilter=t.LinearFilter,e.magFilter=t.LinearFilter,o.uniforms.opacity.value=0,o.uniforms.panoMap.value=s,o.uniforms.panoDisplacementMap.value=e,o.uniforms.panoPosition.value=n,o.uniforms.panoMatrix.value=r,Object.assign(new t.Mesh(es,o),{frustumCulled:!1,dispose:function(){this.material instanceof t.ShaderMaterial&&(this.material.uniforms.panoDisplacementMap.value.dispose(),this.material.uniforms.panoDisplacementMap.value=null,this.material.dispose())}})}(i.body,s.body,n,r),meta:Ot([i.meta],s.meta,!0)};return o(a),a})).catch((function(t){for(var e=0,i=c;e<i.length;e++)i[e].then((function(t){return t.body.dispose()})).catch(Kt);return s(t),Promise.reject(t)}))},e}(),ns=new t.Vector3(-1,1,1),rs=function(e){function i(n){var r,o,s,a,u,h,l,c=this,d=i.parseArgs(n);return(c=e.call(this,d)||this).currentPanoIndex=d.initial[0],c.maxAccessibleDistance=d.maxAccessibleDistance,c.panoTapTriggerRadius=d.panoTapTriggerRadius,c.panoCircleMeshCreator=d.panoCircleMeshCreator,c.boundingMesh=c.generateBoundingMesh(),c.boundingMesh.setMaterial(c.model.getMaterial()||{}),c.boundingMesh.visible=!1,c.scene.add(c.boundingMesh),c.panoModelGroup=new t.Group,c.panoModelGroup.name="panoModels",c.scene.add(c.panoModelGroup),c.panoMeshes=[],c.updatePanoMeshes(),c.helper.remove(c.intersectMesh),c.locationMotion=new In({count:0,distance:c.camera.pose.distance,modelAlpha:null!==(o=null===(r=c.model.getMaterial())||void 0===r?void 0:r.modelAlpha)&&void 0!==o?o:0,perspToOrtho:null!==(a=null===(s=c.model.getMaterial())||void 0===s?void 0:s.perspToOrtho)&&void 0!==a?a:0}),c.panoResources={},c.panoResources[c.locationMotion.keyframes[0].key=c.locationMotion.keyframes[1].key=rr()]={panoIndex:c.currentPanoIndex,workCode:c.work.workCode,matrix:null!==(l=null===(h=null===(u=c.model.getMaterial())||void 0===u?void 0:u.pano1)||void 0===h?void 0:h.matrix)&&void 0!==l?l:new t.Matrix4,position:c.camera.pose.offset.clone(),effect:"fly"},c.depthTextureLoader=new is({allowHosts:c.work.allowHosts,networkSubscribe:c.networkSubscribe}),c}return Nt(i,e),i.parseArgs=function(t){var i,n,r,o=e.parseArgs.call(this,t);return Ft(Ft({},o),{maxAccessibleDistance:null!==(i=t.maxAccessibleDistance)&&void 0!==i?i:5,panoTapTriggerRadius:null!==(n=t.panoTapTriggerRadius)&&void 0!==n?n:1,panoCircleMeshCreator:null!==(r=t.panoCircleMeshCreator)&&void 0!==r?r:function(){return new Jn}})},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 o=r[n];"function"==typeof o.dispose&&o.dispose()}this.scene.remove(this.panoModelGroup)}this.boundingMesh&&(this.scene.remove(this.boundingMesh),this.boundingMesh.dispose()),this.panoMeshes&&(this.panoMeshes.forEach((function(t){i.helper.remove(t),t.dispose()})),this.panoMeshes.length=0);for(var s=null!==(t=this.model.getMaterial())&&void 0!==t?t:{},a=s.pano0,u=s.pano1,h=0,l=Object.keys(this.panoResources);h<l.length;h++){var c=l[h],d=this.panoResources[c];d.panoModel&&d.panoModel.material.uniforms.panoMap.value!==(null==a?void 0:a.map)&&d.panoModel.material.uniforms.panoMap.value!==(null==u?void 0:u.map)&&(this.panoModelGroup.remove(d.panoModel),d.panoModel.material.uniforms.panoMap.value.dispose(),d.panoModel.dispose(),delete d.panoModel),delete this.panoResources[c]}this.interiaMovement=!1},i.prototype.isReady=function(){return!1===this.locationMotion.ended&&e.prototype.isReady.call(this)},i.prototype.updateWork=function(t,e,i,n,r){this.userAction=r,this.work=t,this.currentPanoIndex=e,this.depthTextureLoader.setAllowHosts(this.work.allowHosts);var o={},s=!0;this.boundingMesh&&(o=this.boundingMesh.getMaterial()||{},s=this.boundingMesh.visible,this.scene.remove(this.boundingMesh),this.boundingMesh.dispose()),this.boundingMesh=this.generateBoundingMesh(!0),this.boundingMesh.visible=s,this.boundingMesh.setMaterial(o),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(e,{effect:"fade",duration:n,longitude:i.longitude,latitude:i.latitude,fov:i.fov},r),!0},i.prototype.updateTime=function(e,i){var n,r,o;if(!this.destroyed){var s={},a={};if(!1===this.locationMotion.ended){this.locationMotion.update(e);var u=this.locationMotion.getKeyFrameSegment(e),h=u[0],l=u[1],c=this.panoResourceFromLocationMotionKeyframe(h),d=this.panoResourceFromLocationMotionKeyframe(l),p=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[0]),A=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]),f=(new t.Vector3).copy(c.position),g=(new t.Vector3).copy(d.position),v=this.locationMotion.value.count-l.value.count+1;s.modelAlpha=this.locationMotion.value.modelAlpha,s.perspToOrtho=bn(1-10*(1-this.locationMotion.value.perspToOrtho),0,1),s.useBlackTransition="instant"===d.effect;for(var m=0,y=this.panoModelGroup.children;m<y.length;m++){var b=y[m];b.visible=b===c.panoModel||b===d.panoModel}c.panoModel&&(c.panoModel.material.uniforms.opacity.value=1-v,c.panoModel.material.depthTest=0!==v),d.panoModel&&(d.panoModel.material.uniforms.opacity.value=v,d.panoModel.material.depthTest=1!==v),d.panoModel&&(v<1?c.panoModel&&(s.pano0={map:c.panoModel.material.uniforms.panoMap.value,luminanceMap:null,matrix:c.matrix}):s.pano0={map:d.panoModel.material.uniforms.panoMap.value,luminanceMap:null,matrix:d.matrix},s.pano1={map:d.panoModel.material.uniforms.panoMap.value,luminanceMap:null,matrix:d.matrix}),"fade"===d.effect&&(s.pano0&&(s.pano0={map:s.pano0.map,luminanceMap:null,matrix:c.matrix.clone().setPosition(d.position)}),f.copy(g)),s.progress=v,a.distance=this.locationMotion.value.distance,a.offset=new t.Vector3(f.x+(g.x-f.x)*v,f.y+(g.y-f.y)*v,f.z+(g.z-f.z)*v);for(var w=[],E=[],x=0,I=this.locationMotion.keyframes;x<I.length;x++){var C=I[x],S=C.key,B=C.progress;void 0!==S&&(w.push(S),B>=this.locationMotion.progress&&E.push(S))}for(var M=0,P=Object.keys(this.panoResources);M<P.length;M++){var T=P[M];if(!(E.indexOf(T)>=0)){var R=this.panoResources[T];if(R.panoModel){if(R.panoModel.material.uniforms.panoMap.value===(null===(n=s.pano0)||void 0===n?void 0:n.map))continue;if(R.panoModel.material.uniforms.panoMap.value===(null===(r=s.pano1)||void 0===r?void 0:r.map))continue;this.panoModelGroup.remove(R.panoModel),R.panoModel.material.uniforms.panoMap.value.dispose(),R.panoModel.dispose(),delete R.panoModel}w.indexOf(T)>=0||delete this.panoResources[T]}}c.workCode===d.workCode?this.currentPanoIndex=v<.5?c.panoIndex:d.panoIndex:this.currentPanoIndex=d.panoIndex,this.emit("movingToPano",A.panoIndex,p.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===Er(s)&&(this.model.setMaterial(s),this.boundingMesh.setMaterial(s)),!1===Er(a)&&this.setCamera(a),this.camera.pose.distance>.1)for(var k=0;k<this.work.observers.length;k++)(F=this.panoMeshes[k])&&(F.visible=!1);else{var Q=this.work.observers[this.currentPanoIndex];if(Q){var D=Q.visibleNodes.concat(this.currentPanoIndex),N=this.getForwardPanoIndexOrNot();for(k=0;k<this.work.observers.length;k++){var F,O=this.work.observers[k];if(F=this.panoMeshes[k])if(O.loadable||O.active)if(-1!==D.indexOf(k)){F.visible=!0;var L=F.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);F.setCurrent(N===k),F.setOpacity(L<.01?0:bn(2/L,.5,1)),F.updateTime&&F.updateTime(e,i)}else F.visible=!1;else F.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)}},i.prototype.getTargetPose=function(){var t=this.cameraMotion.getKeyFrameSegment(jt())[1],e=this.locationMotion.getKeyFrameSegment(jt())[1],i=this.panoResourceFromLocationMotionKeyframe(e),n=this.work.observers[i.panoIndex];return{longitude:t.value.longitude,latitude:t.value.latitude,fov:t.value.fov,offset:n?n.position.clone():this.camera.position.clone()}},i.prototype.moveToPano=function(e,i,n){var r,o,s=this;void 0===i&&(i={});var a=this.work.observers[e].images.depth,u=Ft({key:"pano.".concat(e),basisLoaderInitialized:Ri.isInitialized()},li(this.imageOptions,["format","size","quality"])),h=null!==(r=this.imageOptions.transform)&&void 0!==r?r:me,l={right:h(this.work.observers[e].images.right,Ft(Ft({},u),{key:"pano.".concat(e,".right")})),left:h(this.work.observers[e].images.left,Ft(Ft({},u),{key:"pano.".concat(e,".left")})),up:h(this.work.observers[e].images.up,Ft(Ft({},u),{key:"pano.".concat(e,".up")})),down:h(this.work.observers[e].images.down,Ft(Ft({},u),{key:"pano.".concat(e,".down")})),front:h(this.work.observers[e].images.front,Ft(Ft({},u),{key:"pano.".concat(e,".front")})),back:h(this.work.observers[e].images.back,Ft(Ft({},u),{key:"pano.".concat(e,".back")}))},c=this.work.observers[e],d=c.position,p=c.quaternion,A=(new t.Matrix4).compose(d,p,new t.Vector3(-1,1,1)),f="pano:"+Lr(l);if(this.pendingTextureTask){if(this.pendingTextureTask.hash===f)return;var g=this.pendingTextureTask.panoIndex;null===(o=this.panoMeshes[g])||void 0===o||o.setProgress(0),this.emit("textureAbort",g,this.work.observers[g]),this.pendingTextureTask.onError(new Error("texture aborted"))}this.pending=!0,this.pendingTextureTask={panoIndex:e,hash:f,onLoad:function(t){s.pending=!1,s.destroyed?t.body.dispose():(t.body.name=f,s.emit("panoLoaded",e),s.doMoveToPano(e,t.body,i,n))},onError:function(t){s.pending=!1,i.moveCancelCallback&&i.moveCancelCallback(),s.emit("panoLoadError",t,e),s.emit("moveToPanoCanceled",e)}};var v=this.panoMeshes[e];v&&v.tap&&v.tap(),this.depthTextureLoader.load(a,l,d,A,(function(t){var i,n;(null===(i=s.pendingTextureTask)||void 0===i?void 0:i.hash)===f?(s.pendingTextureTask.onLoad(t),null===(n=s.panoMeshes[e])||void 0===n||n.setProgress(0),delete s.pendingTextureTask,s.emit("textureLoaded",e,s.work.observers[e],t.meta)):t.body.dispose()}),(function(t){var i,n;(null===(i=s.pendingTextureTask)||void 0===i?void 0:i.hash)===f&&(s.pendingTextureTask.onError(t),null===(n=s.panoMeshes[e])||void 0===n||n.setProgress(0),delete s.pendingTextureTask,s.emit("textureError",t,e,s.work.observers[e]),s.emit("error",t))}),(function(t){var i,n;s.emit("textureLoading",t,e,s.work.observers[e]),(null===(i=s.pendingTextureTask)||void 0===i?void 0:i.hash)===f&&(null===(n=s.panoMeshes[e])||void 0===n||n.setProgress(t))}),this.renderer),this.emit("textureStartLoad",e,this.work.observers[e])},i.prototype.initAnimation=function(t,e,i,n){var r,o,s,a=this;if(!this.destroyed){var u=!1;this.pending=!1,this.userAction=n,this.moveToPano(t,{longitude:null!==(r=e.longitude)&&void 0!==r?r:this.defaultLongitude,latitude:bn(null!==(o=e.latitude)&&void 0!==o?o:this.defaultLatitude,this.minLatitude,this.maxLatitude),fov:bn(null!==(s=e.fov)&&void 0!==s?s:this.defaultFov,this.minFov,this.maxFov),duration:i,moveStartCallback:function(t,e){u=!0,a.emit("initAnimationWillStart",t,e,a.userAction)},moveEndCallback:function(t,e){a.emit("initAnimationEnded",t,e,a.userAction)},moveCancelCallback:function(){var t=xr(a.camera.pose);!1===u&&a.emit("initAnimationWillStart",a.currentPanoIndex,t,a.userAction),a.emit("initAnimationEnded",a.currentPanoIndex,t,a.userAction)}},n)}},i.prototype.panoResourceFromLocationMotionKeyframe=function(t){return this.panoResources[t.key]},i.prototype.locationMotionKeyframesLength=function(t){for(var e=0,i=1;i<t.length;i++){var n=this.panoResourceFromLocationMotionKeyframe(t[i-1]).position,r=this.panoResourceFromLocationMotionKeyframe(t[i]).position;e+=n.distanceTo(r)*(t[i].value.count-t[i-1].value.count)}return e},i.prototype.updatePanoMeshes=function(){for(var t={},e=0,i=this.panoMeshes;e<i.length;e++)t[(s=i[e]).name]=s;this.panoMeshes.length=0;for(var n=0;n<this.work.observers.length;n++){var r="panoCircle_".concat(this.work.workCode,"_").concat(n),o=this.work.observers[n],s=void 0;t[r]?(s=t[r],delete t[r]):((s=this.panoCircleMeshCreator()).name=r,this.helper.add(s)),s.position.copy(o.standingPosition),this.panoMeshes[n]=s}for(var a=0,u=Object.keys(t);a<u.length;a++){var h=u[a];this.helper.remove(t[h]),t[h].dispose(),delete t[h]}},i.prototype.generateBoundingMesh=function(e){void 0===e&&(e=!1);for(var i=this.model.bounding.clone(),n=0,r=this.work.observers;n<r.length;n++){var o=r[n];i.expandByPoint(o.standingPosition),i.expandByPoint((new t.Vector3).fromArray([o.position.x,2*o.position.y-o.standingPosition.y,o.position.z]))}e&&i.expandByPoint(this.camera.position);var s=cr(i,new t.Vector3(1,0,1));return s.name="panorama_bounding",s.frustumCulled=!1,s},i.prototype.doMoveToPano=function(e,i,n,r){var o,s,a,u,h=this;void 0===n&&(n={}),this.userAction=r;var l,c,d,p=jt(),A=rr(),f=this.work.observers[e],g=this.panoResources[A]={panoIndex:e,workCode:this.work.workCode,effect:null!==(o=n.effect)&&void 0!==o?o:"fly",panoModel:i,matrix:(new t.Matrix4).compose(f.position,f.quaternion,ns),position:f.position.clone()};if(i.visible=!1,i.renderOrder=-1,this.panoModelGroup.add(i),this.locationMotion.ended){var v=this.locationMotion.getKeyFrameSegment(p),m=(v[0],v[1]),y=this.locationMotion.value,b=this.panoResourceFromLocationMotionKeyframe(m).position,w=g.position;l=Math.max(b.distanceTo(w),1),c=[{key:m.key,progress:0,value:Ft(Ft({},y),{count:0})},{key:A,progress:1,value:{distance:0,perspToOrtho:0,modelAlpha:0,count:1}}],d=0}else{var E=this.locationMotion.getKeyFrameSegment(p),x=E[0],I=(m=E[1],y=this.locationMotion.value,this.panoResourceFromLocationMotionKeyframe(x).position),C=(b=this.panoResourceFromLocationMotionKeyframe(m).position,w=g.position,m.value.count-y.count),S=Math.max(I.distanceTo(b),1)*C;l=S+Math.max(b.distanceTo(w),1),c=[{key:x.key,progress:0,value:Ft({},y)},{key:m.key,progress:S/l,value:m.value},{key:A,progress:1,value:{count:m.value.count+1,distance:0,perspToOrtho:0,modelAlpha:0}}];var B=this.locationMotionKeyframesLength(this.locationMotion.keyframes),M=this.locationMotionKeyframesLength(c);d=this.locationMotion.getProgressVelocity(p)*B/M}var P=this.calculateMovingDuration(n.duration,l),T={longitude:n.longitude,latitude:n.latitude,fov:n.fov},R={longitude:null!==(s=T.longitude)&&void 0!==s?s:this.camera.pose.longitude,latitude:null!==(a=T.latitude)&&void 0!==a?a:this.camera.pose.latitude,fov:null!==(u=T.fov)&&void 0!==u?u:this.camera.pose.fov,offset:f.position.clone()};n.moveStartCallback&&n.moveStartCallback(e,R),this.emit("panoWillArrive",e,R,this.userAction),this.cameraMotion.set(T,P).catch(Kt),this.locationMotion.setKeyframes(c,P,d).then((function(){var t={longitude:h.camera.pose.longitude,latitude:h.camera.pose.latitude,fov:h.camera.pose.fov,offset:h.camera.pose.offset.clone()};n.moveEndCallback&&n.moveEndCallback(e,t),h.emit("panoArrived",e,t,r)}),(function(){n.moveCancelCallback&&n.moveCancelCallback(),h.emit("moveToPanoCanceled",e)}))},i.prototype.getForwardPanoIndexOrNot=function(e){var i=this,n=this.camera.getWorldDirection(new t.Vector3),r=this.camera.position.clone(),o=this.work.observers[this.currentPanoIndex];if(!o)return null;var s=o.accessibleNodes.filter((function(e){if(e===i.currentPanoIndex)return!1;var n=i.work.observers[e],o=n.standingPosition.clone().sub(r);return 0!==o.length()&&!(o.angleTo(new t.Vector3(0,-1,0))<Math.PI/12)&&(n.loadable||n.active)})),a=(e?e.ray.direction.clone():n.clone()).setY(0);if(0===a.length())return null;for(var u=s.slice().sort((function(t,e){var n=i.work.observers[t].position.clone().setY(r.y),o=i.work.observers[e].position.clone().setY(r.y);return n.distanceTo(r)-o.distanceTo(r)})),h=0,l=[Math.PI/8,Math.PI/6,Math.PI/4,Math.PI/3];h<l.length;h++)for(var c=l[h],d=0,p=u;d<p.length;d++){var A=p[d],f=this.work.observers[A].position.clone().setY(r.y).sub(r);if(0!==f.length()&&a.angleTo(f)<c)return A}return null},i.prototype.onTapGesture=function(e){var i=this,n=e.pointers.map((function(t){return li(t,["x","y"])}));if(!this.emit("wantsGesture","tap",n,!0)){var r=this.relativeClientPosition(e.center),o=new t.Raycaster;if(o.setFromCamera(r,this.camera),!this.emit("wantsTapGesture",o,r,!0)){this.emit("gesture","tap",n,!0),this.emit("tapGesture",o,r,!0),this.interiaMovement=!1;var s=this.camera.getWorldDirection(new t.Vector3).setY(0),a=null,u=this.work.observers[this.currentPanoIndex];if(u){var h=u.accessibleNodes.filter((function(t){if(t===i.currentPanoIndex)return!1;var e=i.work.observers[t];return!(e.position.distanceTo(i.camera.position)>i.maxAccessibleDistance)&&(e.loadable||e.active)})),l=o.intersectObject(this.boundingMesh,!0)[0];if(l){var c=wr(h,(function(t){var e=i.work.observers[t].standingPosition.clone();return e.clone().sub(i.camera.position).setY(0).angleTo(s)>Math.PI/2?1/0:e.distanceTo(l.point)}),!0),d=c[0];c[1]<this.panoTapTriggerRadius&&(a=d)}Ji(a)&&(a=this.getForwardPanoIndexOrNot(o));for(var p=0,A=this.locationMotion.keyframes;p<A.length;p++){var f=A[p],g=this.panoResourceFromLocationMotionKeyframe(f);if(!(f.progress<this.locationMotion.progress)&&g.panoIndex===a){a=null;break}}if(this.emit("panoSelected",a),Ji(a))!0===this.locationMotion.ended&&this.cameraBounce();else{var v=this.work.observers[a];if(v.active){for(var m={},y=Math.PI/6,b=Math.PI/12,w=new t.Vector3(0,1,0),E=v.position.clone().setY(0).sub(u.position.clone().setY(0)).normalize(),x=E.clone().applyAxisAngle(w,y),I=E.clone().applyAxisAngle(w,-y),C=[],S=[],B=[],M=0,P=v.accessibleNodes;M<P.length;M++)if((d=P[M])!==this.currentPanoIndex&&d!==a){var T=this.work.observers[d].position.clone().sub(v.position).setY(0);E.angleTo(T)<y?B.push(T):x.angleTo(T)<y?C.push(T):I.angleTo(T)<y&&S.push(T)}var R=(B.length>0?B:Ot(Ot([],C,!0),S,!0)).slice().sort((function(t,e){return t.angleTo(E)-e.angleTo(E)}))[0];R&&R.angleTo(s)>b&&(m.longitude=Math.atan2(-R.x,-R.z)),this.cameraMotion.value.latitude<-Math.PI/4&&(m.latitude=bn(0,this.minLatitude,this.maxLatitude)),this.emit("wantsMoveToPano",a,m,!0)}else this.panoMeshes[a]&&(this.panoMeshes[a].setDisabled(!1),this.panoMeshes[a].setLoading(!0))}}}}},i}(zr),os=["Panorama","DepthPanorama","Model"],ss={Floorplan:Nr,Topview:Fr,Panorama:Ao,VRPanorama:Yo,Model:Zo,DepthPanorama:rs};function as(t){for(var e=0,i=os;e<i.length;e++){var n=i[e];if("string"==typeof t){if(n===t)return!0}else if(t instanceof Dr&&t instanceof ss[n])return!0}return!1}var us=["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 hs(t){for(var e,i,n={},r=0,o=t.split(/(\;|\,)/);r<o.length;r++){var s=o[r].split("="),a=null===(e=s[0])||void 0===e?void 0:e.trim(),u=null===(i=s[1])||void 0===i?void 0:i.trim();a&&u&&(n[a]=u)}return n}function ls(){for(var t,e=document.getElementsByTagName("meta"),i=0;i<e.length;i++){var n=e[i];if("viewport"===n.getAttribute("name")){var r=hs(null!==(t=n.getAttribute("content"))&&void 0!==t?t:""),o=Number(r["initial-scale"]);if(!isNaN(o))return o}}return 1}var cs=[351,63],ds=[20,20],ps=new Float32Array([-.5,-.5,0,.5,-.5,0,-.5,.5,0,.5,.5,0]),As=new Float32Array([0,0,1,0,0,1,1,1]),fs=new Uint8Array([0,1,2,1,3,2]),gs=new t.BufferGeometry;gs.setAttribute("position",new t.BufferAttribute(ps,3)),gs.setAttribute("uv",new t.BufferAttribute(As,2)),gs.setIndex(new t.BufferAttribute(fs,1));var vs=new t.MeshBasicMaterial({transparent:!0,depthTest:!1}),ms=new t.Mesh(gs,vs),ys=new t.Scene;ys.add(ms);var bs=new t.OrthographicCamera(-.5,.5,.5,-.5,.1,1);bs.position.set(0,0,.5),bs.lookAt(0,0,0);var ws=new t.Vector4,Es=new t.Vector4;function xs(e){if(vs.map){var i=e.getViewport(ws),n=e.getScissor(Es),r=e.getScissorTest(),o=e.autoClear;e.setViewport(n.x+ds[0]/3,n.y+ds[1]/3,cs[0]/3,cs[1]/3),e.setScissor(n.x+ds[0]/3,n.y+ds[1]/3,cs[0]/3,cs[1]/3),e.setScissorTest(!0),e.autoClear=!1,e.render(ys,bs),e.setViewport(i),e.setScissor(n),e.setScissorTest(r),e.autoClear=o}else{var s=new t.Texture,a=new Image;a.onload=function(){s.image=a,s.wrapS=t.ClampToEdgeWrapping,s.wrapT=t.ClampToEdgeWrapping,s.minFilter=t.LinearFilter,s.needsUpdate=!0,vs.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/q5PsJKfoGuQjZ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cwmzFK6e8s7DMa2xH4YZdZumSOwsVzFeBWdr37tpIhOpSwXqONNgZq/2KgvBt54znHN1HzlljTO4oVD5fb+prNIJXQNL1ofDKQisbPLJDv3jNSLq9OkYBEIihKIj3v7S1TRQCX5Kdl1ZQlol7LF+E++fwirfiq2sf4cTXxc6hzxffPuLEeqSWrPGWMF58TWr5viyJAP5/4EV4KePiaSE8eNRgjDy8/tyRW+FZjhS+2tlovNJovtJovNJ0uhK6Wo64SDdxEbM//KesjwAAAABJRU5ErkJggg==",vs.map=s}}var Is=new t.Box3(new t.Vector3(-50,-50,-50),new t.Vector3(50,50,50)),Cs=new t.Vector2,Ss=new t.Frustum,Bs=new t.Matrix4,Ms=new t.Clock,Ps=new WeakMap,Ts=function(e){function i(i){var n,r,o,s,a,u,h,l,c,d;void 0===i&&(i={});var p=e.call(this)||this;if(p.ident=rr(),p.renderSwitch01=0,p.panoIndex=0,p.needsRender=!1,p.onlyRenderIfNeeds=null===(n=i.onlyRenderIfNeeds)||void 0===n||n,p.imageOptions=Ft({},null!==(r=i.imageOptions)&&void 0!==r?r:{}),p.textureOptions=Ft({},null!==(o=i.textureOptions)&&void 0!==o?o:{}),p.poweredByRealsee=null===(s=i.poweredByRealsee)||void 0===s||s,p.extraElements=[],p.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)},p.fps={testCount:0,testTime:jt()},p.modeChangeDuration=null!==(a=i.modeChangeDuration)&&void 0!==a?a:1e3,p.panoramaLikeSavedPose={},"undefined"!=typeof window)if(i.renderer)i.renderer instanceof Te&&p.throwError(new Error("cannot render a internal renderer")),p.renderer=i.renderer;else try{p.renderer=new Te({preserveDrawingBuffer:i.preserveDrawingBuffer,backgroundColor:i.backgroundColor,backgroundAlpha:i.backgroundAlpha,antialias:i.antialias});var A=ls();p.renderer.setPixelRatio(1===A?window.devicePixelRatio:1),p.renderer.setSize(512,512)}catch(t){t instanceof Error&&p.throwError(t)}p.getPixelsRenderTarget=new t.WebGLRenderTarget(1,1,{encoding:null!==(h=null===(u=p.renderer)||void 0===u?void 0:u.outputEncoding)&&void 0!==h?h:t.sRGBEncoding}),p.scissor=Object.assign({left:0,bottom:0,width:1,height:1},i.scissor),p.camera=new Ve(80),p.scene=new Re,p.lastLoadWorkTask=Promise.resolve(),p.networkSubscribe=new oe,p.networkSubscribe.on("network",(function(t,e,i,n){var r;p.emit("network",t,e,i,n),null===(r=p.analysis)||void 0===r||r.network(p.work,t,e,i,n)})),p.model=new nn({allowHosts:[],networkSubscribe:p.networkSubscribe});var f=cr(Is);f.name="model_empty",p.model.add(f),p.model.visible=!1,p.readyCallbacks=[],p.modelPending=!1,p.syncingState=!1,p.scene.add(p.model),p.helperGroup=new t.Group,p.helperGroup.name="helper",p.scene.add(p.helperGroup),p.videoTexture=new t.VideoTexture(i.videoInstance||function(){var t=document.createElement("video");t.loop=!0,t.autoplay=!0,t.playsInline=!0,t.muted=!0,t.crossOrigin="";var e=function(){document.removeEventListener("touchstart",e,!1),document.removeEventListener("mousedown",e,!1),t.muted=!1};return document.addEventListener("touchstart",e,!1),document.addEventListener("mousedown",e,!1),t}()),function(e){(i=new t.DirectionalLight(16777215,.5)).position.copy(new t.Vector3(1,1,1)),e.add(i);var i=new t.DirectionalLight(16777215,.3);e.add(i),i=new t.AmbientLight(16777215,.3),e.add(i)}(p.scene),p.state={mode:null!==(l=p.currentMode)&&void 0!==l?l:rn,panoIndex:null!==(c=p.panoIndex)&&void 0!==c?c:0,longitude:p.camera.pose.longitude,latitude:p.camera.pose.latitude,fov:p.camera.pose.fov,offset:p.camera.pose.offset.clone()},p.stateSynced=!1,p._enableIOSEDR=!1,p.destroyed=!1,p.paused=!0,"undefined"!=typeof window&&(!1!==i.play&&p.play(),!1!==(null!==(d=i.initialBasisLoader)&&void 0!==d&&d)&&("string"==typeof i.initialBasisLoader?p.initBasisLoader(i.initialBasisLoader):p.initBasisLoader()),p.stopAnimationLoop=ce.shared.add((function(t,e){p.updateTime(t,e)}),!1,0,10));var g=function(){"undefined"!=typeof document&&null===document.fullscreenElement&&"VRPanorama"===p.currentMode&&p.controller.emit("vrWantsToExit")};if("undefined"!=typeof document&&document.addEventListener("fullscreenchange",g,!1),p.removeEventListeners=function(){"undefined"!=typeof document&&document.removeEventListener("fullscreenchange",g,!1)},p.plugins={},i.plugins&&i.plugins.length)for(var v=0,m=i.plugins;v<m.length;v++){var y=m[v];if("function"==typeof y)y(p);else if(Array.isArray(y)){var b=y[0],w=y[1],E=y[2];if("function"==typeof b){var x=b(p,E);"string"==typeof w&&(p.plugins[w]?p.throwError(new Error("plugin name ".concat(w," is exists."))):p.plugins[w]=x)}}}return p}return Nt(i,e),i.prototype.dispose=function(){var t;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 e=this.getElement();e&&e.parentNode&&e.parentNode.removeChild(e),this.scene.remove(this.model);var i=this.model.getMaterial();i&&(i.pano0&&i.pano0.map.dispose(),i.pano1&&i.pano1.map!==(null===(t=i.pano0)||void 0===t?void 0:t.map)&&i.pano1.map.dispose()),this.model.dispose(),this.renderer instanceof Te&&this.renderer.forceContextLoss&&this.renderer.forceContextLoss()}},i.prototype.setScissor=function(t){Object.assign(this.scissor,t),this.controller&&this.controller.updateRenderSize&&this.controller.updateRenderSize()},Object.defineProperty(i.prototype,"helperVisible",{get:function(){return this.helperGroup.visible},set:function(t){this.helperGroup.visible!==t&&(this.helperGroup.visible=t,this.emit("helpersVisibleChange",t),this.needsRender=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"enableIOSEDR",{get:function(){return this._enableIOSEDR},set:function(t){this._enableIOSEDR!==t&&(this._enableIOSEDR=t,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 i,n;if(e){if(!this.screenBuffer){var r=this.getDrawingBufferSize(Cs);this.screenBuffer=new t.WebGLRenderTarget(r.x,r.y,{encoding:null!==(n=null===(i=this.renderer)||void 0===i?void 0:i.outputEncoding)&&void 0!==n?n:t.sRGBEncoding})}}else this.screenBuffer&&(this.screenBuffer.dispose(),delete this.screenBuffer);this.needsRender=!0},enumerable:!1,configurable:!0}),i.prototype.updateConfiguration=function(t){var e=!1;t.panorama&&(Object.assign(this.controllerInits.Panorama,t.panorama),"Panorama"===this.currentMode&&(e=!0)),t.model&&(Object.assign(this.controllerInits.Model,t.model),"Model"===this.currentMode&&(e=!0)),t.floorplan&&(Object.assign(this.controllerInits.Floorplan,t.floorplan),"Floorplan"===this.currentMode&&(e=!0)),t.topview&&(Object.assign(this.controllerInits.Topview,t.topview),"Topview"===this.currentMode&&(e=!0)),t.depthPanorama&&(Object.assign(this.controllerInits.DepthPanorama,t.depthPanorama),"DepthPanorama"===this.currentMode&&(e=!0)),t.vrPanorama&&(Object.assign(this.controllerInits.VRPanorama,t.vrPanorama),"VRPanorama"===this.currentMode&&(e=!0)),t.imageOptions&&(Object.assign(this.imageOptions,t.imageOptions),"Panorama"!==this.currentMode&&"DepthPanorama"!==this.currentMode&&"VRPanorama"!==this.currentMode||(e=!0)),e&&this.controller&&this.currentMode&&this.changeMode(this.currentMode,this.getCurrentState(),0,!1,!0)},i.prototype.appendTo=function(t,e){if(void 0===e&&(e={}),this.renderer)if(this.renderer instanceof Te){var i=this.getElement();if(i){t.appendChild(i),this.refresh(e);var n=window.getComputedStyle(t).position;"relative"!==n&&"absolute"!==n&&"fixed"!==n&&"sticky"!==n&&(t.style.position="relative")}}else this.throwError(new Error("cannot call appendTo method when render a external renderer"))},i.prototype.refresh=function(e,i){if(void 0===e&&(e={}),this.renderer){var n=this.getElement();if(n){var r=n.parentNode;if(r&&r.nodeName){var o=e.width,s=void 0===o?r.offsetWidth:o,a=e.height,u=void 0===a?r.offsetHeight:a;this.renderer instanceof Te&&(i&&this.renderer.setPixelRatio(i),this.renderer.setSize(s,u))}var h=this.renderer.getSize(new t.Vector2);this.camera.aspect=h.x*this.scissor.width/(h.y*this.scissor.height),this.camera.updateProjectionMatrix(),this.controller&&this.controller.updateRenderSize&&this.controller.updateRenderSize(),this.needsRender=!0}}},i.prototype.addExtraElement=function(t){var e=this;return-1===this.extraElements.indexOf(t)&&(this.extraElements.push(t),this.controller&&this.controller.bindExtraElement(t)),function(){return e.removeExtraElement(t)}},i.prototype.removeExtraElement=function(t){var e=this.extraElements.indexOf(t);-1!==e&&(this.extraElements.splice(e,1),this.controller&&this.controller.unbindExtraElement(t))},i.prototype.getPose=function(){var t=this.camera.copyPose();return{longitude:t.longitude,latitude:t.latitude,fov:t.fov,offset:t.offset}},i.prototype.getSize=function(t){if(!this.renderer)throw new Error("renderer is not initialized");return this.renderer.getSize(t),t.x*=this.scissor.width,t.y*=this.scissor.height,t},i.prototype.getDrawingBufferSize=function(t){if(!this.renderer)throw new Error("renderer is not initialized");return this.renderer.getDrawingBufferSize(t),t.x*=this.scissor.width,t.y*=this.scissor.height,t},i.prototype.updateCamera=function(t,e,i){return void 0===i&&(i=!0),this.controller?this.controller.updateCamera(t,e,i):Promise.reject(new Error("controller is not initialized."))},i.prototype.getLongitudeAndLatitude=function(){var t=this.getPose();return{longitude:t.longitude,latitude:t.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],i=new t.Object3D;return i.position.copy(e.position),i.quaternion.copy(e.quaternion),i.scale.set(1,1,1),i.updateMatrixWorld(!0),function(e,i){var n=new t.Vector3(0,0,-1);n.applyQuaternion(e.quaternion);var r=i.quaternion.clone().inverse();return n.applyQuaternion(r),{theta:Math.atan2(n.x,-n.z),phi:-Math.asin(n.y),lookAtVector:n}}(this.camera,i)}},i.prototype.initBasisLoader=function(t){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 t&&Ri.setTranscoderPath(t),Ri.workerConfig.format||Ri.detectSupport(this.renderer),Ri._allocateWorker(0)}catch(t){t instanceof Error&&this.throwError(t)}},Object.defineProperty(i.prototype,"work",{get:function(){var t=Ps.get(this);if(t&&An.get(t))return t},enumerable:!1,configurable:!0}),i.prototype.load=function(t,e,i,n){var r=this;if(void 0===n&&(n=!0),!this.renderer)throw new Error("renderer is not initialized");var o=this.lastLoadWorkTask.then((function(){return!(o=t)||"object"!=typeof o&&"function"!=typeof o||"function"!=typeof o.then?r.load_(t,e,i,n):t.then((function(t){return r.load_(t,e,i,n)}));var o}));return this.lastLoadWorkTask=o.catch((function(t){r.throwError(t)})),o},i.prototype.load_=function(t,e,n,r){var o,s,a,u,h,l,c,d,p,A=this;void 0===r&&(r=!0);var f,g,v,m=yn(t),y=this.work;void 0===e&&(e=y?"inherit":"initial"),"inherit"===e?(f="number"==typeof this.panoIndex&&m.observers[this.panoIndex]?this.panoIndex:m.initial.panoIndex,g=null!==(o=this.currentMode)&&void 0!==o?o:m.initial.mode,v={longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov}):"initial"===e?(g=null!==(s=this.currentMode)&&void 0!==s?s:m.initial.mode,f=m.initial.panoIndex,v=g===i.Mode.Panorama||g===i.Mode.DepthPanorama||g===i.Mode.Model||g===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}):(f=null!==(a=e.panoIndex)&&void 0!==a?a:m.initial.panoIndex,g=null!==(h=null!==(u=e.mode)&&void 0!==u?u:this.currentMode)&&void 0!==h?h:rn,v={longitude:null!==(l=e.longitude)&&void 0!==l?l:m.initial.longitude,latitude:null!==(c=e.latitude)&&void 0!==c?c:m.initial.latitude,fov:null!==(d=e.fov)&&void 0!==d?d:m.initial.fov}),this.emit("willLoad",t,m,{panoIndex:f,mode:g,longitude:v.longitude,latitude:v.latitude,fov:v.fov});var b=function(){var e;A.panoIndex=f,A.panoramaLikeSavedPose.longitude=m.initial.longitude,A.panoramaLikeSavedPose.latitude=m.initial.latitude,A.panoramaLikeSavedPose.fov=m.initial.fov;var i=A.controller?null!=n?n:A.modeChangeDuration:0,o=Ft(Ft({initial:[f,v,i,r]},A.commonParams()),A.controllerInits[g]);A.controller?!1===A.controller.updateWork(m,f,v,i,r)&&(A.controller.destroy(),A.controller=A.applyController(g,o)):A.controller=A.applyController(g,o),A.emit("load",t,m,{panoIndex:f,mode:g,longitude:v.longitude,latitude:v.latitude,fov:v.fov}),null===(e=A.analysis)||void 0===e||e.work(m)},w=function(t){var e;void 0===t&&(t=Kt),m.model&&(A.model.name!==(null===(e=m.model)||void 0===e?void 0:e.file)?(A.emit("modelWillLoad",m.model),A.loadModel(m.model,m.allowHosts,t,!0)):t&&t())};return Ps.set(this,m),g===i.Mode.Floorplan||g===i.Mode.Topview||g===i.Mode.Model?w((function(){b(),A.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),b(),null===(p=this.controller)||void 0===p||p.once("panoLoaded",(function(){A.needsRender=!0,A.emit("cameraUpdate",A.camera.copyPose(),r),w()}))),this.ready().then((function(){A.emit("loaded",t,A.work)}))},i.prototype.changeMode=function(t,e,n,r,o){var s=this;if(void 0===e&&(e={}),void 0===n&&(n=this.modeChangeDuration),void 0===r&&(r=!0),void 0===o&&(o=!1),!this.renderer)throw new Error("renderer is not initialized.");return new Promise((function(a,u){if(!i.Mode.hasOwnProperty(t)){var h=new Error('mode "'.concat(t,'" is not existed'));return s.throwError(h),void u(h)}if((t===i.Mode.Floorplan||t===i.Mode.Topview||t===i.Mode.Model)&&(Ji(s.model)||!0!==s.model.loaded))return h=new Error("model is not ready."),s.throwError(h),void u(h);if(Ji(s.controller))return h=new Error("controller is not ready."),s.throwError(h),void u(h);var l=s.controller,c=s.currentMode,d=function(){var h,d,p,A;if(s.emit("wantsChangeMode",t,c))u(new Error("change mode canceled."));else{if(s.controller&&!1===o&&c===t)t===i.Mode.Panorama||t===i.Mode.DepthPanorama||t===i.Mode.Model||t===i.Mode.VRPanorama?"number"==typeof e.panoIndex&&e.panoIndex!==s.panoIndex?s.controller.moveToPano(null!==(d=null!==(h=e.panoIndex)&&void 0!==h?h:s.panoIndex)&&void 0!==d?d:0,Ft({duration:n},e),r):s.controller.updateCamera(e,n,r).catch(Kt):("number"==typeof e.panoIndex&&e.panoIndex!==s.panoIndex&&(s.panoIndex=e.panoIndex),s.controller.updateCamera(e,n,r).catch(Kt));else{l.destroy();var f=null!==(A=null!==(p=e.panoIndex)&&void 0!==p?p:s.panoIndex)&&void 0!==A?A:0,g=as(t)?s.panoramaLikeSavedPose:{};"number"!=typeof e.longitude&&"number"!=typeof e.latitude||(g.longitude=e.longitude,g.latitude=e.latitude),"number"==typeof e.fov&&(g.fov=e.fov);var v=Ft(Ft({initial:[f,g,n,r]},s.commonParams()),s.controllerInits[t]);s.saveControllerPose(l),s.controller=s.applyController(t,v);var m=ss[t].initAnimationEndPose(v);s.emit("modeChange",t,c,f,m)}a()}};t===i.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(t){if("granted"==t)return Promise.resolve();var e=new Error("Request DeviceOrientation Permission denied.");return Promise.reject(e)})):Promise.resolve()).then((function(){return d()})).catch((function(t){t instanceof Error&&(s.exitFullscreen(),s.throwError(t),u(t))}))):d()}))},i.prototype.getPixels=function(e,i,n,r,o){if(void 0===o&&(o=1),!this.renderer)throw new Error("renderer is not initialized.");var s=this.getPixelsRenderTarget,a=this.renderer.getSize(new t.Vector2);e=bn(e,Math.floor(n/2),Math.floor(a.x-n)),i=bn(i,Math.floor(r/2),Math.floor(a.y-r)),e*=o,i*=o,n*=o,r*=o,s.setSize(a.x*o,a.y*o),s.scissor.set(e,i,n,r),s.scissorTest=!0,this.renderer.setRenderTarget(s);var u=new Uint8Array(n*r*4);return this.controller?this.controller.render(Ms.getDelta()):this.renderer.render(this.scene,this.camera),this.renderer.readRenderTargetPixels(s,e,i,n,r,u),this.renderer.setRenderTarget(null),s.setSize(1,1),s.scissor.set(0,0,0,0),s.scissorTest=!1,u},i.prototype.getElement=function(){var t;return null===(t=this.renderer)||void 0===t?void 0:t.domElement},i.prototype.render=function(t,e){var i=this;if(void 0===e&&(e=!1),!this.renderer)return null;if(e){var n=this.renderer.getSize(Cs);this.scene.traverseVisible((function(t){t.setResolution&&t.setResolution(n.x,n.y)}))}var r=Ms.getDelta();if(this.controller&&this.screenBuffer&&null===this.renderer.getRenderTarget()){var o=this.getDrawingBufferSize(Cs);return this.screenBuffer.setSize(o.x,o.y),this.renderer.setRenderTarget(this.screenBuffer),this.controller.render(r),this.renderer.setRenderTarget(null),"VRPanorama"!==this.currentMode&&this.poweredByRealsee&&xs(this.renderer),this.renderer.setRenderTarget(null),t&&ce.shared.add(t,!0),this.screenBuffer}return this.aroundScissor((function(){i.renderer&&(i.controller?i.controller.render(r):i.renderer.render(i.scene,i.camera),"VRPanorama"!==i.currentMode&&i.poweredByRealsee&&xs(i.renderer)),t&&ce.shared.add(t,!0)})),null},i.prototype.updateTime=function(e,i){var n=this;if(!this.destroyed){this.syncingState=this.syncState(e,i),this.controller&&this.controller.updateTime(e,i),this.syncingState=!1;var r=new t.Vector2(512,512),o=new t.Vector2(512,512);this.renderer&&(this.renderer.getSize(r),r.x*=this.scissor.width,r.y*=this.scissor.height,this.renderer.getDrawingBufferSize(o),o.x*=this.scissor.width,o.y*=this.scissor.height);var s=[];if(Bs.multiplyMatrices(this.camera.projectionMatrix,this.camera.matrixWorldInverse),Ss.setFromProjectionMatrix(Bs),this.scene.traverse((function(e){e.setResolution&&e.setResolution(r.x,r.y),e.mixer instanceof t.AnimationMixer&&e.mixer.update(Ms.getDelta()),(e instanceof t.Mesh||e instanceof t.Line||e instanceof t.Points)&&(e instanceof t.ImmediateRenderObject||!e.frustumCulled||Ss.intersectsObject(e))&&s.push(e)})),o.width*o.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,h=s;u<h.length;u++){var l=h[u],c=function(t){!0===t.needsRender?(t.needsRender=!1,n.needsRender=!0):t.mixer&&t.mixer.stats.actions.inUse>0&&(n.needsRender=!0)};c(l),l.traverseAncestors(c)}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 n.controller.postProcessing(n.screenBuffer,void 0,Ms.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 d=function(t){var e=t.getError();if(e===t.NO_ERROR)return null;switch(e){case t.INVALID_ENUM:return new Error("webgl error: INVALID_ENUM");case t.INVALID_VALUE:return new Error("webgl error: INVALID_VALUE");case t.INVALID_OPERATION:return new Error("webgl error: INVALID_OPERATION");case t.INVALID_FRAMEBUFFER_OPERATION:return new Error("webgl error: INVALID_FRAMEBUFFER_OPERATION");case t.OUT_OF_MEMORY:return new Error("webgl error: OUT_OF_MEMORY");case t.CONTEXT_LOST_WEBGL:return new Error("webgl error: CONTEXT_LOST_WEBGL");default:return null}}(this.renderer.getContext());d&&this.throwError(d)}}},i.prototype.pause=function(){this.paused=!0,this.renderer&&this.renderer instanceof Te&&this.renderer.clear(!0,!0,!0)},i.prototype.play=function(){this.needsRender=!0,this.paused=!1},i.prototype.moveToPano=function(t,e,n){void 0===e&&(e={}),void 0===n&&(n=!0);var r=this,o=r.controller,s=r.currentMode,a=r.renderer;o?a?s===i.Mode.Floorplan||s===i.Mode.Topview?Ji(t)||(this.panoIndex=t,this.changeMode(i.Mode.Panorama,e,void 0,n)):o.moveToPano(t,e,n):this.throwError(new Error("renderer is not initialized.")):this.throwError(new Error("controller is not initialized."))},i.prototype.preloadPano=function(t,e){var i=this;if(void 0===e&&(e=Kt),!this.work)return Promise.reject(new Error("work never loaded"));var n=this.work.observers[t],r=jt();return Promise.all(["right","left","up","down","front","back"].map((function(e){var r=Ft({key:"pano.".concat(t,".").concat(e),basisLoaderInitialized:Ri.isInitialized()},li(i.imageOptions,["size","format","quality"])),o=n.images[e];return function(t,e){return void 0===e&&(e={}),t in ae?ae[t]:ae[t]=new Promise((function(i,n){var r=document.createElement("link");r.href=t,r.rel=r.relList&&r.relList.supports("prefetch")?"prefetch":"preload",r.as="fetch",r.crossOrigin="";var o=jt(),s=document.head||document.getElementsByTagName("head")[0];s&&s.appendChild(r);var a=!1;r.onload=function(){var n;if(!0!==a){a=!0,i();var r=jt(),s={source:t,requestTime:o,responseTime:r,costs:r-o,headers:{}};null===(n=e.networkSubscribe)||void 0===n||n.emit("network",t,"Link","preload",JSON.stringify(s))}},r.onerror=function(i){var r;if(!0!==a){a=!0;var o=new $t(t,"Link",0);n(o),null===(r=e.networkSubscribe)||void 0===r||r.emit("network",t,"Link","error",o.message)}}}))}(i.imageOptions.transform?i.imageOptions.transform(o,r):me(o,r),{networkSubscribe:i.networkSubscribe})}))).then((function(){var t=jt()-r;return e(t),t}))},i.prototype.project2d=function(e,i){if(void 0===i&&(i=!1),!this.renderer)return null;if(!1===this.model.empty&&i){var n=this.camera.position,r=e.clone().sub(n),o=new t.Raycaster(n,r.clone().normalize()),s=this.model.intersectRaycaster(o)[0];if(s&&s.distance+.01<r.length())return null}var a=e.clone().project(this.camera);if(Math.abs(a.z)>1)return null;var u=this.renderer.getSize(new t.Vector2),h=u.x*this.scissor.width,l=u.y*this.scissor.height,c=u.x*this.scissor.left+(a.x+1)/2*h,d=u.y*(1-this.scissor.bottom-this.scissor.height)+(1-a.y)/2*l;return new t.Vector2(c,d)},i.prototype.getRenderObjects=function(e){Bs.multiplyMatrices(this.camera.projectionMatrix,this.camera.matrixWorldInverse),Ss.setFromProjectionMatrix(Bs),e||(e=this.scene);var i=[];return e.traverseVisible((function(e){(e instanceof t.Mesh||e instanceof t.Line||e instanceof t.Points)&&(e instanceof t.ImmediateRenderObject||!e.frustumCulled||Ss.intersectsObject(e))&&i.push(e)})),i},i.prototype.getCurrentState=function(){return Ft(Ft({},this.getPose()),{mode:this.currentMode||i.Mode.Panorama,panoIndex:this.panoIndex||0})},i.prototype.setState=function(e,n,r){var o,s,a,u,h,l,c,d;void 0===n&&(n=!1),void 0===r&&(r=!0),!(e=Object.assign({},e)).offset||e instanceof t.Vector3||(e.offset=new t.Vector3(e.offset.x,e.offset.y,e.offset.z));var p,A,f,g,v=null!==(o=e.panoIndex)&&void 0!==o?o:this.state.panoIndex,m=null!==(s=e.mode)&&void 0!==s?s:this.state.mode;if(this.work)if(this.work.observers[v])if(e.mode!==i.Mode.Floorplan&&e.mode!==i.Mode.Topview&&e.mode!==i.Mode.Model||!Ji(this.model)&&!0===this.model.loaded){if(this.state.mode!==m){if("VRPanorama"===m)return void this.changeMode("VRPanorama",void 0,void 0,!0);var y=void 0;y=as(this.state.mode)&&as(m)?Ft({},this.state):as(m)?Ft({},this.panoramaLikeSavedPose):Ft({},e),"number"==typeof e.longitude&&(y.longitude=e.longitude),"number"==typeof e.latitude&&(y.latitude=e.latitude),"number"==typeof e.fov&&(y.fov=e.fov);var b=Ft(Ft({initial:[v,y,this.modeChangeDuration,!1]},this.commonParams()),this.controllerInits[m]),w=ss[m].initAnimationEndPose(b);p=w.longitude,A=w.latitude,f=w.fov,g=w.offset}else p=null!==(a=e.longitude)&&void 0!==a?a:this.state.longitude,A=null!==(u=e.latitude)&&void 0!==u?u:this.state.latitude,f=null!==(h=e.fov)&&void 0!==h?h:this.state.fov,g=null!==(l=e.offset)&&void 0!==l?l:this.state.offset;var E={panoIndex:v,mode:m,longitude:p,latitude:A,fov:f,offset:g};this.emit("setState",E),yr(this.state,E)||(mr(this.state,E),this.controller&&(this.controller.userAction=r),n&&this.state.mode===E.mode&&(this.syncingState=this.syncState(jt(),0,n),this.syncingState&&(null===(c=this.controller)||void 0===c||c.updateTime(jt(),0),this.syncingState=!1)),this.emit("stateChange",this.state,r),null===(d=this.analysis)||void 0===d||d.state(this.work,this.state))}else this.throwError(new Error("model is not ready."));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 i=new t.Vector2,n=0!==this.scissor.left||0!==this.scissor.bottom||1!==this.scissor.width||1!==this.scissor.height;if(n){this.renderer.getSize(i);var r=Math.floor(i.x*this.scissor.left),o=Math.floor(i.y*this.scissor.bottom),s=Math.floor(i.x*this.scissor.width),a=Math.floor(i.y*this.scissor.height);this.renderer.setViewport(r,o,s,a),this.renderer.setScissor(r,o,s,a),this.renderer.setScissorTest(!0)}e(),n&&(this.renderer.setViewport(0,0,i.x,i.y),this.renderer.setScissor(0,0,i.x,i.y),this.renderer.setScissorTest(!1))}},i.prototype.syncState=function(e,n,r){void 0===r&&(r=!1);var o=this.stateSynced;if(this.stateSynced=!1,!this.controller)return!1;if(this.state.mode!==this.currentMode){var s={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,s,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 ss.Model){if(!this.camera.pose.offset.equals(this.state.offset)){var h={longitude:this.state.longitude,latitude:this.state.latitude,fov:this.state.fov,offset:this.state.offset};return this.controller.moveToPosition(this.state.offset,h,!1),!0}}else if(this.state.panoIndex!==this.panoIndex)return h={longitude:this.state.longitude,latitude:this.state.latitude,fov:this.state.fov,offset:this.state.offset},this.controller.moveToPano(this.state.panoIndex,h,!1),!0;if(this.controller instanceof ss.Topview){var l=1,c=r?this.state.fov:gr(this.camera.pose.fov,this.state.fov,l),d=r?new t.Vector3(this.state.offset.x,this.state.offset.y,this.state.offset.z):new t.Vector3(gr(this.camera.pose.offset.x,this.state.offset.x,.2),gr(this.camera.pose.offset.y,this.state.offset.y,.2),gr(this.camera.pose.offset.z,this.state.offset.z,.2));if(sr(c,this.camera.pose.fov)||ur(d,this.camera.pose.offset))return this.controller.cameraMotion.set({fov:c},0).catch(Kt),this.controller.locationMotion.set({x:d.x,y:d.y,z:d.z},0).catch(Kt),!0}else{l=1;var p=Math.PI/45,A=(c=r?this.state.fov:gr(this.camera.pose.fov,this.state.fov,l),r?{longitude:this.state.longitude,latitude:this.state.latitude}:function(t,e,i){if(t.longitude===e.longitude&&t.latitude===e.latitude)return{longitude:e.longitude,latitude:e.latitude};var n=pr(t.longitude),r=t.latitude,o=pr(e.longitude),s=e.latitude;o-n>Ar?n+=fr:n-o>Ar&&(n-=fr);var a=i/Math.sqrt(Math.pow(o-n,2)+Math.pow(s-r,2));return a>=1?{longitude:e.longitude,latitude:e.latitude}:{longitude:n+(o-n)*a,latitude:r+(s-r)*a}}({longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude},{longitude:this.state.longitude,latitude:this.state.latitude},p)),f=A.longitude,g=A.latitude;if(sr(f,this.camera.pose.longitude,2*Math.PI)||sr(g,this.camera.pose.latitude)||sr(c,this.camera.pose.fov))return this.controller.cameraMotion.set({longitude:f,latitude:g,fov:c},0).catch(Kt),!0}return this.stateSynced=!0,!1===o&&this.emit("stateSynced",this.state),!1},i.prototype.ready=function(){var t=this;return new Promise((function(e){return t.readyCallbacks.push(e)}))},i.prototype.requestFullscreen=function(){var t;if(vr()){var e=null===(t=this.getElement())||void 0===t?void 0:t.parentNode;e&&"requestFullscreen"in e&&"undefined"!=typeof document&&null===document.fullscreenElement&&e.requestFullscreen()}},i.prototype.exitFullscreen=function(){"undefined"!=typeof document&&document.fullscreenElement&&"exitFullscreen"in document&&document.exitFullscreen()},i.prototype.throwError=function(t){this.hasListener("error")?this.emit("error",t):console.error(t)},i.prototype.loadModel=function(e,i,n,r){var o=this,s=e.file;this.emit("modelWillLoad",e);var a=new nn({allowHosts:i,networkSubscribe:this.networkSubscribe});a.once("bvhLoaded",(function(){var t,e;o.destroyed||s===(null===(e=null===(t=o.work)||void 0===t?void 0:t.model)||void 0===e?void 0:e.file)&&o.emit("modelBvhLoaded",a)})),a.once("materialLoaded",(function(){var t,e;o.destroyed||s===(null===(e=null===(t=o.work)||void 0===t?void 0:t.model)||void 0===e?void 0:e.file)&&o.emit("modelMaterialLoaded",a)})),a.once("geometryLoaded",(function(){var t,i,n,r;if(!o.destroyed&&s===(null===(i=null===(t=o.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,h=o.model;h&&(h.show(),u=h.getMaterial()||{},o.scene.remove(h),h.dispose(),a.setTransparent(h.getTransparent())),u&&a.setMaterial(u),e.bvh&&a.buildBVH(),o.model=a,o.scene.add(a),null===(n=o.controller)||void 0===n||n.updateModel(a),null===(r=o.renderer)||void 0===r||r.compile(o.scene,o.camera),o.needsRender=!0,o.modelPending=!1,o.emit("modelGeometryLoaded",a)}})),a.once("loaded",(function(){var t,e;o.destroyed||s===(null===(e=null===(t=o.work)||void 0===t?void 0:t.model)||void 0===e?void 0:e.file)&&(n(),o.emit("modelLoaded",a))})),a.on("shownFloorChange",(function(t,e){var i,n;o.destroyed||s===(null===(n=null===(i=o.work)||void 0===i?void 0:i.model)||void 0===n?void 0:n.file)&&o.emit("modelShownFloorChange",t,e)})),a.on("error",(function(e){var i,r,u,h;if(!o.destroyed&&s===(null===(r=null===(i=o.work)||void 0===i?void 0:i.model)||void 0===r?void 0:r.file)){a.bounding.makeEmpty();for(var l=0,c=o.work.observers;l<c.length;l++){var d=c[l];a.bounding.expandByPoint(d.standingPosition),a.bounding.expandByPoint((new t.Vector3).fromArray([d.position.x,2*d.position.y-d.standingPosition.y,d.position.z]))}var p=cr(a.bounding,new t.Vector3(1,0,1));p.visible=!0,p.name="model_empty",a.add(p);var A,f=o.model;f&&(f.show(),A=f.getMaterial()||{},o.scene.remove(f),f.dispose(),a.setTransparent(f.getTransparent())),A&&a.setMaterial(A),o.model=a,o.scene.add(a),null===(u=o.controller)||void 0===u||u.updateModel(a),null===(h=o.renderer)||void 0===h||h.compile(o.scene,o.camera),o.emit("modelLoadError",e,a),o.throwError(e),o.modelPending=!1,n()}})),this.modelPending=!0,a.load(e,this.textureOptions).catch(Kt)},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(t){void 0===t&&(t=this.controller),t&&as(t)&&(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(t,e){var n=this;if(!this.renderer)throw new Error("renderer is not initialized.");var r=ss[t];t===this.currentMode||this.model.empty||this.model.show(),this.model.setTransparent(t===i.Mode.Floorplan||t===i.Mode.Topview||t===i.Mode.Model),this.currentMode=t;for(var o=new r(e),s=function(t){o.on(t,(function(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];var r=n.emit.apply(n,Ot([t],e,!1));if(r)return!1}))},a=0,u=us;a<u.length;a++)s(u[a]);var h=ss[t].initAnimationEndPose(e),l=e.initial[3],c={panoIndex:e.initial[0],mode:t,longitude:h.longitude,latitude:h.latitude,fov:h.fov,offset:h.offset};return yr(this.state,c)||(mr(this.state,c),this.emit("stateChange",this.state,l)),this.emit("currentStateChange",this.getCurrentState(),l),o.on("cameraUpdate",(function(e,i){var r;if(n.controller){var o=Ft(Ft({},n.controller.getTargetPose()),{panoIndex:n.panoIndex,mode:t});i&&!1===n.syncingState&&n.state.mode===o.mode&&!yr(n.state,o)&&(mr(n.state,o),n.emit("stateChange",n.state,i),null===(r=n.analysis)||void 0===r||r.state(n.work,n.state))}n.emit("currentStateChange",n.getCurrentState(),i)})),o.on("initAnimationWillStart",(function(e,i,r){var o,s=Ft(Ft({},i),{panoIndex:e,mode:t});r&&n.state.mode===s.mode&&!yr(n.state,s)&&(mr(n.state,s),n.emit("stateChange",n.state,r),null===(o=n.analysis)||void 0===o||o.state(n.work,n.state))})),o.on("initAnimationEnded",(function(e,i,r){var o,s=Ft(Ft({},i),{panoIndex:e,mode:t});r&&n.state.mode===s.mode&&!yr(n.state,s)&&(mr(n.state,s),n.emit("stateChange",n.state,r),null===(o=n.analysis)||void 0===o||o.state(n.work,n.state))})),o.on("panoWillArrive",(function(e,i,r){var o;n.panoIndex=e;var s=Ft(Ft({},i),{panoIndex:e,mode:t});r&&n.state.mode===s.mode&&!yr(n.state,s)&&(mr(n.state,s),n.emit("stateChange",n.state,r),null===(o=n.analysis)||void 0===o||o.state(n.work,n.state))})),o.on("panoArrived",(function(e,i,r){var o,s=Ft(Ft({},i),{panoIndex:e,mode:t});r&&n.state.mode===s.mode&&!yr(n.state,s)&&(mr(n.state,s),n.emit("stateChange",n.state,r),null===(o=n.analysis)||void 0===o||o.state(n.work,n.state))})),o.on("moveToPano",(function(t,e){n.emit("currentStateChange",n.getCurrentState(),e)})),o.on("wantsMoveToPano",(function(t,e,i){var r=n.emit("wantsMoveToPano",t,e,i);r||(r=n.emit("wantsToMoveToPano",t,e,i)),r||n.moveToPano(t,e,i)})),o.on("vrWantsToExit",(function(){n.currentMode===i.Mode.VRPanorama&&(n.exitFullscreen(),n.changeMode(i.Mode.Panorama))})),o.on("error",(function(t){return n.throwError(t)})),o},i.prototype.removeEventListeners=function(){},i.Mode={Panorama:"Panorama",Model:"Model",Floorplan:"Floorplan",Topview:"Topview",DepthPanorama:"DepthPanorama",VRPanorama:"VRPanorama"},i.Line=null,i}(zt)})(),__webpack_exports__})()}));