@realsee/five 6.6.0-alpha.5 → 6.6.0-alpha.6

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 (78) hide show
  1. package/docs/classes/five.Fetcher.html +2 -2
  2. package/docs/classes/five.NetworkSubscribe.html +1 -1
  3. package/docs/classes/five.Tileset.html +1 -1
  4. package/docs/classes/five.Work.html +2 -2
  5. package/docs/classes/plugins.BasePlugin.Controller.html +5 -5
  6. package/docs/interfaces/five.AddableObject.html +3 -3
  7. package/docs/interfaces/five.AjaxOptions.html +5 -5
  8. package/docs/interfaces/five.FiveInitArgs.html +2 -2
  9. package/docs/interfaces/five.FiveLoadOptions.html +1 -1
  10. package/docs/interfaces/five.ImageOptions.html +1 -1
  11. package/docs/interfaces/five.ModelLike.html +2 -2
  12. package/docs/interfaces/five.NetworkAbortError.html +1 -1
  13. package/docs/interfaces/five.NetworkFirbiddenError.html +1 -1
  14. package/docs/interfaces/five.NetworkOptions.html +4 -4
  15. package/docs/interfaces/five.NetworkProxyError.html +1 -1
  16. package/docs/interfaces/five.NetworkResponseError.html +2 -2
  17. package/docs/interfaces/five.NetworkTimeoutError.html +1 -1
  18. package/docs/interfaces/five.PanoCircleMeshInterface.html +3 -3
  19. package/docs/interfaces/five.TextureOptions.html +1 -1
  20. package/docs/interfaces/five.TilesetHeader.html +2 -2
  21. package/docs/interfaces/plugins.BackgroundPluginController.html +4 -4
  22. package/docs/interfaces/plugins.BackgroundPluginType.EventMap.html +3 -3
  23. package/docs/interfaces/plugins.ItemMaskController.html +4 -4
  24. package/docs/interfaces/plugins.OrientationPluginController.html +3 -3
  25. package/docs/interfaces/plugins.PanoAnimeController.html +4 -4
  26. package/docs/interfaces/plugins.TrajectoryController.html +5 -5
  27. package/docs/interfaces/react.FiveInjectionTypes.html +10 -10
  28. package/docs/types/five.AjaxResponseType.html +1 -1
  29. package/docs/types/five.AjaxResponseTypeMapping.html +1 -1
  30. package/docs/types/five.EventTypes.html +1 -1
  31. package/docs/types/five.Mode.html +1 -1
  32. package/docs/types/five.Models.html +1 -1
  33. package/docs/types/five.NetWorkMeta.html +2 -2
  34. package/docs/types/five.NetworkError.html +1 -1
  35. package/docs/types/five.NetworkErrorCallback.html +1 -1
  36. package/docs/types/five.NetworkProgressCallback.html +1 -1
  37. package/docs/types/five.NetworkResponse.html +2 -2
  38. package/docs/types/five.NetworkState.html +1 -1
  39. package/docs/types/five.NetworkSuccessCallback.html +1 -1
  40. package/docs/types/five.NetworkType.html +1 -1
  41. package/docs/types/five.SubscribeEventMap.html +1 -1
  42. package/docs/types/plugins.PanoAnimePluginType.PluginData.html +1 -1
  43. package/docs/types/plugins.PanoAnimePluginType.ServerData.html +1 -1
  44. package/docs/types/react.StoreActionMapType.html +1 -1
  45. package/docs/types/vue.FiveModelIntersectRaycaster.html +1 -1
  46. package/docs/types/vue.Project2d.html +1 -1
  47. package/docs/variables/five.controllersDefaultInitArgs.html +1 -1
  48. package/docs/variables/react.useFiveScene.html +1 -1
  49. package/five/index.js +8 -8
  50. package/five/index.mjs +17 -17
  51. package/gltf-loader/index.js +3 -3
  52. package/gltf-loader/index.mjs +3 -3
  53. package/line/index.js +3 -3
  54. package/line/index.mjs +3 -3
  55. package/package.json +2 -2
  56. package/plugins/index.js +2 -2
  57. package/plugins/index.mjs +2 -2
  58. package/react/index.js +2 -2
  59. package/react/index.mjs +2 -2
  60. package/shader-lib/index.js +2 -2
  61. package/shader-lib/index.mjs +2 -2
  62. package/sticker/index.js +3 -3
  63. package/sticker/index.mjs +3 -3
  64. package/umd/five-gltf-loader.js +3 -3
  65. package/umd/five-line.js +3 -3
  66. package/umd/five-plugins.js +2 -2
  67. package/umd/five-react.js +2 -2
  68. package/umd/five-shader-lib.js +2 -2
  69. package/umd/five-sticker.js +3 -3
  70. package/umd/five-vfx.js +2 -2
  71. package/umd/five-vue.js +2 -2
  72. package/umd/five.js +8 -8
  73. package/vfx/index.js +2 -2
  74. package/vfx/index.mjs +2 -2
  75. package/vue/index.js +2 -2
  76. package/vue/index.mjs +2 -2
  77. package/work-downloader/index.js +2 -2
  78. package/work-downloader/index.mjs +2 -2
package/five/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @license
3
3
  * @realsee/five
4
- * Generated: 8/26/2025
5
- * Version: 6.6.0-alpha.5
4
+ * Generated: 8/27/2025
5
+ * Version: 6.6.0-alpha.6
6
6
  * Terms:
7
7
  * Realsee SDK License Agreement
8
8
  * Update: July 28, 2021
@@ -401,8 +401,8 @@
401
401
  `)),c.fragmentShader=c.fragmentShader.replace(/MAIN_START/g,b.map(function(F){return F.fragment.mainStart}).filter(function(F){return!!F}).join(`
402
402
  `)),c.fragmentShader=c.fragmentShader.replace(/MAIN_END/g,b.map(function(F){return F.fragment.mainEnd}).filter(function(F){return!!F}).join(`
403
403
  `)),c.fragmentShader=c.fragmentShader.replace(/MAIN_MODEL_COLOR/g,b.map(function(F){return F.fragment.mainModelColor}).filter(function(F){return!!F}).join(`
404
- `));var M=String(r.clippers.length);c.vertexShader=c.vertexShader.replace(/NUM_CLIPPERS/g,M),c.fragmentShader=c.fragmentShader.replace(/NUM_CLIPPERS/g,M);for(var B=0,C=b;B<C.length;B++){var P=C[B];P.onBeforeCompile&&P.onBeforeCompile(c,f)}};var u="";r.onBeforeRender=function(c,f,p,d,h,g){var A=r.shaderType;p instanceof Camera?(s.pixelRatio.value=p.pixelRatio,s.resolution.value.copy(p.resolution)):(s.pixelRatio.value=c.getPixelRatio(),c.getViewport(scratchViewport$1),s.resolution.value.set(scratchViewport$1.width,scratchViewport$1.height));var m=r.customShaders.filter(function(v){return v.type.includes(A)}),E=m.map(function(v){return"".concat(v.id,":").concat(v.version)}).join("|");u!==E&&(u=E,r.needsUpdate=!0)},Object.defineProperty(r,"uniform",{configurable:!1,enumerable:!1,get:function(){return s}}),defineProperty(r,"isPBMPointCloudMaterial",{get:function(){return!0}}),defineProperty(r,"isShaderMaterial",{get:function(){return!0}}),defineProperty(r,"opacity",{get:function(){return s.opacity.value},set:function(c){s.opacity.value=c}}),defineProperty(r,"vertexMarks",{get:function(){return!!o.USE_VERTEX_MARK},set:function(c){o.USE_VERTEX_MARK!==c&&(o.USE_VERTEX_MARK=c,this.needsUpdate=!0)}}),defineProperty(r,"pointScale",{get:function(){return s.pointScale.value},set:function(c){s.pointScale.value=c}}),defineProperty(r,"pointMinPixel",{get:function(){return s.pointMinPixel.value},set:function(c){s.pointMinPixel.value=c}}),defineProperty(r,"pointMaxPixel",{get:function(){return s.pointMinPixel.value},set:function(c){s.pointMaxPixel.value=c}}),defineProperty(r,"pointSize",{get:function(){return this.defines.USE_POINT_SIZE_ATTENUATION===!0?"ATTENUATION":"FIXED"},set:function(c){var f=c==="ATTENUATION";this.defines.USE_POINT_SIZE_ATTENUATION!==f&&(this.defines.USE_POINT_SIZE_ATTENUATION=f,this.needsUpdate=!0)}}),defineProperty(r,"pointShape",{get:function(){return this.defines.USE_POINT_SHAPE_CIRCLE===!0?"CIRCLE":"SQUARE"},set:function(c){var f=c==="CIRCLE";this.defines.USE_POINT_SHAPE_CIRCLE!==f&&(this.defines.USE_POINT_SHAPE_CIRCLE=f,this.needsUpdate=!0)}}),defineProperty(r,"pointBack",{get:function(){return this.defines.USE_POINT_BACK_HIDDEN===!0?"HIDDEN":this.defines.USE_POINT_BACK_DARK===!0?"DARK":"VISIBLE"},set:function(c){var f=c==="HIDDEN",p=c==="DARK";this.defines.USE_POINT_BACK_HIDDEN!==f&&(this.defines.USE_POINT_BACK_HIDDEN=f,this.needsUpdate=!0),this.defines.USE_POINT_BACK_DARK!==p&&(this.defines.USE_POINT_BACK_DARK=p,this.needsUpdate=!0)}}),defineProperty(r,"modelAlpha",{get:function(){return s.modelAlpha.value},set:function(c){s.modelAlpha.value=c}}),defineProperty(r,"logDepthAlpha",{get:function(){return s.logDepthAlpha.value},set:function(c){s.logDepthAlpha.value=c}}),defineProperty(r,"colorStyle",{get:function(){return o.USE_COLOR_CONSTANT?"CONSTANT":o.USE_COLOR_ALTITUDE?"ALTITUDE":"RGB"},set:function(c){var f=c==="CONSTANT",p=c==="ALTITUDE";o.USE_COLOR_CONSTANT!==f&&(o.USE_COLOR_CONSTANT=f,this.needsUpdate=!0),o.USE_COLOR_ALTITUDE!==p&&(o.USE_COLOR_ALTITUDE=p,this.needsUpdate=!0)}}),defineProperty(r,"constantColor",{get:function(){return s.constantColor.value},set:function(c){s.constantColor.value=c}}),defineProperty(r,"floorIndex",{get:function(){return s.floorIndex.value},set:function(c){s.floorIndex.value=c}}),defineProperty(r,"shownFloorIndex",{get:function(){return s.shownFloorIndex.value},set:function(c){s.shownFloorIndex.value=c}}),defineProperty(r,"floorStyle",{get:function(){return o.USE_FLOOR_STYLE_VISIBILITY?"VISIBILITY":"OPACITY"},set:function(c){var f=c==="VISIBILITY";o.USE_FLOOR_STYLE_VISIBILITY!==f&&(o.USE_FLOOR_STYLE_VISIBILITY=f,this.needsUpdate=!0)}}),defineProperty(r,"gradientTexture",{get:function(){return s.gradientTexture.value},set:function(c){s.gradientTexture.value=c}}),defineProperty(r,"brightness",{get:function(){return s.brightness.value},set:function(c){s.brightness.value=c}});var l=[];return defineProperty(r,"clippers",{get:function(){return l},set:function(c){l!==c&&(l=c,s.clippers.value=l.map(function(f){var p=typeof f.floorIndex=="number"?f.floorIndex:-1,d=new THREE__namespace.Matrix4().getInverse(f.clippingBoxMatrix);return{matrixInverse:d,floorIndex:p}}),this.needsUpdate=!0)}}),defineProperty(r,"colorSaturation",{get:function(){return s.colorSaturation.value},set:function(c){s.colorSaturation.value=c;var f=s.colorSaturation.value!==0||s.colorBrightness.value!==0||s.outlineGain.value!==0||s.distanceGain.value!==0;o.USE_COLOR_ADJUSTMENT!==f&&(o.USE_COLOR_ADJUSTMENT=f,this.needsUpdate=!0)}}),defineProperty(r,"colorBrightness",{get:function(){return s.colorBrightness.value},set:function(c){s.colorBrightness.value=c;var f=s.colorSaturation.value!==0||s.colorBrightness.value!==0||s.outlineGain.value!==0||s.distanceGain.value!==0;o.USE_COLOR_ADJUSTMENT!==f&&(o.USE_COLOR_ADJUSTMENT=f,this.needsUpdate=!0)}}),defineProperty(r,"outlineGain",{get:function(){return s.outlineGain.value},set:function(c){s.outlineGain.value=c;var f=s.colorSaturation.value!==0||s.colorBrightness.value!==0||s.outlineGain.value!==0||s.distanceGain.value!==0;o.USE_COLOR_ADJUSTMENT!==f&&(o.USE_COLOR_ADJUSTMENT=f,this.needsUpdate=!0)}}),defineProperty(r,"distanceGain",{get:function(){return s.distanceGain.value},set:function(c){s.distanceGain.value=c;var f=s.colorSaturation.value!==0||s.colorBrightness.value!==0||s.outlineGain.value!==0||s.distanceGain.value!==0;o.USE_COLOR_ADJUSTMENT!==f&&(o.USE_COLOR_ADJUSTMENT=f,this.needsUpdate=!0)}}),defineProperty(r,"useHQWeight",{get:function(){return o.USE_HQ_WEIGHT},set:function(c){c!==o.USE_HQ_WEIGHT&&(o.USE_HQ_WEIGHT=c,this.needsUpdate=!0)}}),defineProperty(r,"useHQDepth",{get:function(){return o.USE_HQ_DEPTH},set:function(c){c!==o.USE_HQ_DEPTH&&(o.USE_HQ_DEPTH=c,this.needsUpdate=!0)}}),defineProperty(r,"modelBoundingMin",{get:function(){return s.modelBoundingMin.value},set:function(c){s.modelBoundingMin.value=c}}),defineProperty(r,"modelBoundingMax",{get:function(){return s.modelBoundingMax.value},set:function(c){s.modelBoundingMax.value=c}}),typeof e=="object"&&r.setValues(e),r}return t.prototype.copy=function(e){return n.prototype.copy.call(this,e),this.pointScale=e.pointScale,this.pointMinPixel=e.pointMinPixel,this.pointMaxPixel=e.pointMaxPixel,this.customShaders=e.customShaders,this.modelAlpha=e.modelAlpha,this.logDepthAlpha=e.logDepthAlpha,this.colorStyle=e.colorStyle,this.constantColor.copy(e.constantColor),this.floorIndex=e.floorIndex,this.shownFloorIndex=e.shownFloorIndex,this.floorStyle=e.floorStyle,this.gradientTexture=e.gradientTexture,this.brightness=e.brightness,this.clippers=e.clippers,this.colorSaturation=e.colorSaturation,this.colorBrightness=e.colorBrightness,this.outlineGain=e.outlineGain,this.distanceGain=e.distanceGain,this.useEDL=e.useEDL,this.useHQWeight=e.useHQWeight,this.useHQDepth=e.useHQDepth,this.modelBoundingMin.copy(e.modelBoundingMin),this.modelBoundingMax.copy(e.modelBoundingMax),this},t.prototype.clone=function(){var e=this.constructor;return new e().copy(this)},t.prototype.refreshUniforms=function(){},t})(PBMMaterial),PBMPointCloud=(function(n){__extends(t,n);function t(e,r){var o=n.call(this,e,r)||this;return o.onBeforeRender=function(s,u,l,c,f,p){f instanceof PBMPointCloudMaterial&&f.onBeforeRender&&f.onBeforeRender(s,u,l,c,o,p)},o}return t})(THREE__namespace.Points);const gradientDataURL="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAABCAYAAACouxZ2AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAACAKADAAQAAAABAAAAAQAAAAB7UD0+AAACA0lEQVRIDXWUW3YjIQxEwdnV/GT/q8kO3FO3pAJst3PSAaR6Cbszf//9XeMxxpjXmI+pVXudp2s6PC4dqHff9e6D7/PZLy46xQvG+sZvrfK8xgXUeq85yINe9bdmtOK1+kun5vjgq58a+eZPna9jvmjiserqG/+Whathvo3L3WhV89L9sXI/m18z2uene9ap/ftsuT9WZxoHXzW56/fpj8l7+tTw7P011NdpqnY19sRsfuHMA9u8oZWfDz4+fra/dfG1V60ydZ7qba1g7UNAeK0JP7ydD7/OqH6wO2f7HTq+B/lbL9qsB3/N1/UzR81XfPzw4tp5OPvRneacteq8Xo0xR3vuv/kPz0KtX0Nhg0eHuaNXdWI3X/ld427h++vzyp99V6VPrzWFhbv4ayay4oFecm198MmUXN/mL+x7npq/uJXBGb/MTw4+t+SvbLoTZnUW5uHhz7nWcTxT73OwXV7cxT9wbBf/0LnDBgcnHmtPLYba32Hp808sMy1u88yhr58n70/v4xX92GSN19l/2UsqGmiH94Hpxjcs+DO/ccpIVNVp62PUWXu//ur1GQy1Cf+GZ13rtNYN1po3/NI79fGXibHkq4z25xvV2pW3szpneXsW8SsreTe/NIPrtXMnH7wPf+LEN6tqhUVHj3XKD/72p9eafCeYB3zuonnbv7yqP8d/o4K6gRb1wbYAAAAASUVORK5CYII=";function valueEqual(n,t){return n==t}function arrayValueEqual(n,t){if(Array.isArray(n)&&Array.isArray(t)){if(n.length!==t.length)return!1;for(var e=0;e<n.length;e++)if(n[e]!==t[e])return!1;return!0}return n===t}var parameterValueEqualFn={customShaders:arrayValueEqual,castShadow:valueEqual,receiveShadow:valueEqual,vertexMarks:valueEqual,pano0:valueEqual,pano1:valueEqual,pano0Depth:valueEqual,pano1Depth:valueEqual,refinedScreen:valueEqual,modelAlpha:valueEqual,logDepthAlpha:valueEqual,progress:valueEqual,transition:valueEqual,opacity:valueEqual,floorStyle:valueEqual,colorStyle:valueEqual,constantColor:function(n,t){return n instanceof THREE__namespace.Vector3&&t instanceof THREE__namespace.Vector3?n.equals(t):n===t},shownFloorIndex:valueEqual,clippers:arrayValueEqual,brightness:valueEqual,useHQWeight:valueEqual,useHQDepth:valueEqual,pointShape:valueEqual,pointSize:valueEqual,pointBack:valueEqual,pointScale:valueEqual,pointMinPixel:valueEqual,pointMaxPixel:valueEqual,pointAppearAnimation:valueEqual,colorSaturation:valueEqual,colorBrightness:valueEqual,useAddBlend:valueEqual,outlineGain:valueEqual,distanceGain:valueEqual,gradientTexture:valueEqual,boundingBox:function(n,t){return n instanceof THREE__namespace.Box3&&t instanceof THREE__namespace.Box3?n.equals(t):n===t},minLevelOfDetail:valueEqual,maxLevelOfDetail:valueEqual,minGeometricError:valueEqual,maxGeometricError:valueEqual,panoramaMinGeometricError:valueEqual,skipLevelOfDetail:valueEqual,mostDetail:valueEqual,loadSiblings:valueEqual,cameraCulling:valueEqual,maxMemoryUsage:valueEqual,maxRequests:valueEqual,requestOrder:valueEqual,maxScreenSpaceError:valueEqual,memoryAdjustedOverflow:valueEqual,memoryAdjustedScreenSpaceError:valueEqual,cacheCameras:arrayValueEqual};function assignValue(n,t,e){var r=parameterValueEqualFn[t];if(!r)return!1;Array.isArray(e)&&(e=e.slice());var o=n[t];return r(o,e)?!1:(n[t]=e,!0)}var defaultGradientTexture=(function(){var n;return typeof document!="undefined"?n=new THREE__namespace.TextureLoader().load(gradientDataURL):n=new THREE__namespace.Texture,n.minFilter=THREE__namespace.NearestFilter,n.magFilter=THREE__namespace.NearestFilter,n.wrapS=THREE__namespace.RepeatWrapping,n.wrapT=THREE__namespace.RepeatWrapping,n})(),defineConstantColor=Object.freeze(new THREE__namespace.Vector3(.6,.6,.6)),defineClippers=Object.freeze([]),defineBoundingBox=Object.freeze(new THREE__namespace.Box3),defineCustomShaders=Object.freeze([]),defineCacheCameras=Object.freeze([]);function createDefault(){return{customShaders:defineCustomShaders,castShadow:!1,receiveShadow:!1,vertexMarks:!0,pano0:null,pano1:null,pano0Depth:null,pano1Depth:null,refinedScreen:null,floorStyle:"OPACITY",colorStyle:"RGB",constantColor:defineConstantColor,shownFloorIndex:-1,modelAlpha:1,logDepthAlpha:0,opacity:1,progress:0,transition:"FADE",clippers:defineClippers,brightness:1,useHQWeight:!1,useHQDepth:!1,pointSize:"ATTENUATION",pointBack:"DARK",pointShape:"CIRCLE",pointScale:.02,pointMaxPixel:40,pointMinPixel:0,pointAppearAnimation:!0,gradientTexture:defaultGradientTexture,colorSaturation:0,colorBrightness:0,outlineGain:0,distanceGain:0,useAddBlend:!1,boundingBox:defineBoundingBox,minLevelOfDetail:0,maxLevelOfDetail:20,minGeometricError:0,maxGeometricError:1e4,panoramaMinGeometricError:.03,skipLevelOfDetail:!1,mostDetail:!1,loadSiblings:!1,cameraCulling:!0,maxMemoryUsage:256,maxRequests:6,requestOrder:"SCREEN_SPACE_ERROR",maxScreenSpaceError:4,memoryAdjustedOverflow:4,memoryAdjustedScreenSpaceError:!1,cacheCameras:defineCacheCameras}}var parameterKeys=Object.keys(createDefault()),Parameter=(function(){function n(t){this.value=Object.create(null),this.id=createUuid(),this.versionNumber=0,t&&this.copy(t);for(var e=function(l){Object.defineProperty(r,l,{get:function(){return this.value[l]}})},r=this,o=0,s=parameterKeys;o<s.length;o++){var u=s[o];e(u)}}return n.createDefault=function(){return createDefault()},n.resolveValue=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var r=Object.assign(this.createDefault(),{versions:[],version:""}),o=0,s=t;o<s.length;o++){var u=s[o],l=u instanceof n?u.version:createUuid();r.versions.push(l);for(var c=0,f=parameterKeys;c<f.length;c++){var p=f[c],d=u[p];d!==void 0&&(r[p]=d)}}return r.version=r.versions.toString(),r},Object.defineProperty(n.prototype,"version",{get:function(){return"".concat(this.id,":").concat(this.versionNumber)},enumerable:!1,configurable:!0}),n.prototype.resolveValue=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return n.resolveValue.apply(n,t.concat(this))},n.prototype.set=function(t,e){var r=!1;if(typeof t=="string"){if(e!==void 0){var o=assignValue(this.value,t,e);o&&(r=!0)}}else for(var s=t,u=Object.keys(s),l=0,c=u;l<c.length;l++){var f=c[l],p=s[f];if(p!==void 0){var o=assignValue(this.value,f,p);o&&(r=!0)}}return r&&this.versionNumber++,this},n.prototype.reset=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var r=!1,o=0,s=t;o<s.length;o++){var u=s[o];this.value!==void 0&&(delete this.value[u],r=!0)}return r&&this.versionNumber++,this},n.prototype.resetAll=function(){for(var t=!1,e=Object.keys(this.value),r=0,o=e;r<o.length;r++){var s=o[r];delete this.value[s],t=!0}return t&&this.versionNumber++,this},n.prototype.copy=function(t){for(var e=!0,r=Object.keys(this.value),o=0,s=r;o<s.length;o++){var u=s[o];delete this.value[u]}r=Object.keys(t);for(var l=0,c=r;l<c.length;l++){var f=c[l],p=t[f];if(p!==void 0){var d=assignValue(this.value,f,p);d&&(e=!0)}}return e&&this.versionNumber++,this},n})(),PBMContainer=(function(n){__extends(t,n);function t(){var e=n!==null&&n.apply(this,arguments)||this;return e.parameter=new Parameter,e.needsRender=!0,e}return Object.defineProperty(t.prototype,"materialParameters",{get:function(){return this.parameter.resolveValue()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pbmMaterialParametersVersion",{get:function(){return this.parameter.resolveValue().version},enumerable:!1,configurable:!0}),t.prototype.setMaterial=function(e){this.parameter.set(e),this.update(),this.needsRender=!0},t.prototype.getMaterial=function(){return this.parameter.resolveValue()},t.prototype.update=function(){var e=this.parameter.resolveValue();this.traverse(function(r){r instanceof PBMMesh||r instanceof PBMSkinnedMesh?updatePBMMesh$1(r,e):r instanceof PBMPointCloud&&updatePBMPointCloud$1(r,e)})},t})(THREE__namespace.Group);function updatePBMMesh$1(n,t){var e=n.material;n.castShadow=t.castShadow,n.receiveShadow=t.receiveShadow;for(var r=0,o=e;r<o.length;r++){var s=o[r];s.customShaders=t.customShaders,s.pano0=t.pano0,s.pano1=t.pano1,s.pano0Depth=t.pano0Depth,s.pano1Depth=t.pano1Depth,s.refinedScreen=t.refinedScreen,s.modelAlpha=t.modelAlpha,s.logDepthAlpha=t.logDepthAlpha,s.progress=t.progress,s.transition=t.transition,s.opacity=t.opacity,s.floorStyle=t.floorStyle,s.constantColor=t.constantColor,s.shownFloorIndex=t.shownFloorIndex,s.clippers=t.clippers,s.brightness=t.brightness,s.useHQWeight=t.useHQWeight,s.useHQDepth=t.useHQDepth,s.colorSaturation=t.colorSaturation,s.colorBrightness=t.colorBrightness,s.gradientTexture=t.gradientTexture,s.shaderType==="none"?(s.transparent=!0,s.blending=THREE__namespace.NormalBlending,s.blendDst=THREE__namespace.OneMinusSrcAlphaFactor,s.blendEquation=THREE__namespace.AddEquation,s.blendSrcAlpha=null,s.blendDstAlpha=null,s.blendEquationAlpha=null,s.depthWrite=!1,s.depthTest=!0):(s.transparent=s.alphaMode==="BLEND",s.blending=THREE__namespace.NormalBlending,s.blendDst=THREE__namespace.OneMinusSrcAlphaFactor,s.blendEquation=THREE__namespace.AddEquation,s.blendSrcAlpha=null,s.blendDstAlpha=null,s.blendEquationAlpha=null,s.depthWrite=!0,s.depthTest=!0,t.useAddBlend&&(s.depthWrite=!1,s.depthTest=!1,s.blending=THREE__namespace.AdditiveBlending),s.shownFloorIndex>-1&&s.shownFloorIndex!==s.floorIndex&&(s.transparent=!0),s.opacity<1&&(s.transparent=!0),s.alphaMap&&(s.transparent=!0),s.brightness<1&&(s.transparent=!0),s.logDepthAlpha>0?s.transparent=!1:t.useAddBlend&&(s.depthWrite=!1,s.depthTest=!1,s.blending=THREE__namespace.AdditiveBlending))}}function updatePBMPointCloud$1(n,t){var e=[n.material];n.castShadow=t.castShadow,n.receiveShadow=t.receiveShadow;for(var r=0,o=e;r<o.length;r++){var s=o[r];s.customShaders=t.customShaders,s.pointScale=t.pointScale,s.pointMinPixel=t.pointMinPixel,s.pointMaxPixel=t.pointMaxPixel,s.pointSize=t.pointSize,s.pointShape=t.pointShape,s.pointBack=t.pointBack,s.modelAlpha=t.modelAlpha,s.logDepthAlpha=t.logDepthAlpha,s.opacity=t.opacity,s.floorStyle=t.floorStyle,s.constantColor=t.constantColor,s.shownFloorIndex=t.shownFloorIndex,s.clippers=t.clippers,s.brightness=t.brightness,s.useHQWeight=t.useHQWeight,s.useHQDepth=t.useHQDepth,s.colorSaturation=t.colorSaturation,s.colorBrightness=t.colorBrightness,s.outlineGain=t.outlineGain,s.distanceGain=t.distanceGain,s.gradientTexture=t.gradientTexture,s.transparent=!1,s.blending=THREE__namespace.NormalBlending,s.blendDst=THREE__namespace.OneMinusSrcAlphaFactor,s.blendEquation=THREE__namespace.AddEquation,s.blendSrcAlpha=null,s.blendDstAlpha=null,s.blendEquationAlpha=null,s.depthWrite=!0,s.depthTest=!0,s.shownFloorIndex>-1&&(s.transparent=s.shownFloorIndex!==s.floorIndex),s.modelAlpha<1&&(s.transparent=!0),s.opacity<1&&(s.transparent=!0),s.brightness<1&&(s.transparent=!0),s.logDepthAlpha>0?s.transparent=!1:t.useAddBlend&&(s.depthWrite=!1,s.depthTest=!1,s.blending=THREE__namespace.AdditiveBlending),s.useHQWeight&&(s.depthWrite=!1,s.blending=THREE__namespace.CustomBlending,s.blendSrc=THREE__namespace.SrcAlphaFactor,s.blendSrcAlpha=THREE__namespace.SrcAlphaFactor,s.blendDst=THREE__namespace.OneFactor,s.blendDstAlpha=THREE__namespace.OneFactor)}}var ROTATE_X_MATRIX=new THREE__namespace.Matrix4().fromArray([1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1]),ROTATE_X_MATRIX_INVERSE=new THREE__namespace.Matrix4().getInverse(ROTATE_X_MATRIX);function createSymbol(n){return typeof Symbol=="undefined"?"$Symbol<".concat(n,">$"):Symbol(n)}var EVENT_SYMBOL=createSymbol("$$FIVE_EVENT$$");function __generateEventIfNotExisted(n){return n[EVENT_SYMBOL]||(n[EVENT_SYMBOL]={}),n[EVENT_SYMBOL]}function __removeEvents(n){n[EVENT_SYMBOL]&&delete n[EVENT_SYMBOL]}var Subscribe=(function(){function n(){}return n.prototype.hasListener=function(t){var e=__generateEventIfNotExisted(this);return e&&e[t]&&e[t].callbacks.length>0},n.prototype.on=function(t,e,r){var o=this,s=__generateEventIfNotExisted(this);return s[t]||(s[t]={callbacks:[]}),s[t].callbacks.push([e,r||!1]),function(){return o.off(t,e)}},n.prototype.once=function(t,e){return this.on(t,e,!0)},n.prototype.off=function(t,e){if(t===void 0){__removeEvents(this);return}var r=__generateEventIfNotExisted(this);if(r[t]||(r[t]={callbacks:[]}),e===void 0){r[t].callbacks.length=0;return}for(var o=0;o<r[t].callbacks.length&&r[t].callbacks[o][0]!==e;o++);o<r[t].callbacks.length&&r[t].callbacks.splice(o,1)},n.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];var o=!1,s=__generateEventIfNotExisted(this);s[t]||(s[t]={callbacks:[]});for(var u=s[t].callbacks.slice(),l=0,c=u;l<c.length;l++){var f=c[l],p=f[0],d=f[1],h=d===void 0?!1:d,g=p.apply(void 0,e);h&&this.off(t,p),g===!1&&(o=!0)}return o},n.prototype.waitUntil=function(t,e){var r=this;return new Promise(function(o){var s=r.on(t,function(){for(var u=[],l=0;l<arguments.length;l++)u[l]=arguments[l];(!e||e.apply(void 0,u)!==!1)&&(o(u),s())})})},n})();function noop(){}var JSONP_REGEXPS=[/\.([0-9a-z]+)\.jsonp([\?\#].*)?$/i,/jsonp_([0-9a-z]+)([\?\#].*)?$/i],NetworkProxyError=(function(n){__extends(t,n);function t(e,r,o){return n.call(this,"[NETWORK]: request proxy error(type: ".concat(r,", reason: ").concat(o,"): ").concat(e))||this}return t})(Error),NetworkResponseError=(function(n){__extends(t,n);function t(e,r,o){var s=n.call(this,"[NETWORK]: response error(type: ".concat(r,", status: ").concat(o,"): ").concat(e))||this;return s.httpStatus=o,s}return t})(Error);(function(n){__extends(t,n);function t(e,r){return n.call(this,"[NETWORK]: request abort(type: ".concat(r,"): ").concat(e))||this}return t})(Error);var NetworkTimeoutError=(function(n){__extends(t,n);function t(e,r,o){return n.call(this,"[NETWORK]: request timeout(type: ".concat(r,", timeout: ").concat(o,"ms): ").concat(e))||this}return t})(Error);(function(n){__extends(t,n);function t(e,r,o){return n.call(this,"[NETWORK]: request forbidden(type: ".concat(r,", reason: ").concat(o,"): ").concat(e))||this}return t})(Error);function parseHeaders(n){if(!n)return{};for(var t={},e=n.trim().split(`
405
- `),r=0;r<e.length;r++){var o=e[r],s=o.indexOf(":"),u=o.slice(0,s).trim().toLowerCase(),l=o.slice(s+1).trim();l&&(t[u]?t[u]+=", "+l:t[u]=l)}return t}function matchJsonpFunctionName(n){for(var t=0,e=JSONP_REGEXPS;t<e.length;t++){var r=e[t],o=n.match(r);if(o)return"jsonp_"+o[1]}return null}function isJsonp(n){return matchJsonpFunctionName(n)!==null}var NetworkSubscribe=(function(n){__extends(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t})(Subscribe);function ajax(n,t,e,r,o){t===void 0&&(t={}),e===void 0&&(e=noop),r===void 0&&(r=noop),o===void 0&&(o=noop);var s=now(),u=n;return Promise.resolve().then(function(){return t.requestProxy?t.requestProxy(n):n}).then(function(l){return/^https\:/.test(location.href)&&/^http\:/.test(l)?(console.warn("The page at '".concat(location.href,"' was loaded over HTTPS, but requested an insecure element '").concat(l,"'. This request was automatically upgraded to HTTPS")),l.replace(/^http\:/,"https:")):l}).catch(function(l){var c;matchJsonpFunctionName(n);var f=new NetworkProxyError(u,"XMLHttpRequest",l&&l.message?String(l.message):String(l));return(c=t.networkSubscribe)===null||c===void 0||c.emit("network",n,"XMLHttpRequest","forbidden",f.message),Promise.reject(f)}).then(function(l){return new Promise(function(c,f){var p=matchJsonpFunctionName(l);if(p){var d=window,h=null,g=!1,A=document.createElement("script"),m=function(){var w;if(h=null,g!==!0){g=!0;var M=new NetworkTimeoutError(l,"XMLHttpRequest",t.timeout||NaN);r(M),f(M),(w=t.networkSubscribe)===null||w===void 0||w.emit("network",l,"XMLHttpRequest","timeout",M.message)}},E=function(w){var M,B,C=now(),P=C-s;if(delete d[p],A.parentNode&&A.parentNode.removeChild(A),h!==null&&(window.clearTimeout(h),h=null),g!==!0){if(w.indexOf("data:")!==0){var F=new NetworkResponseError(l,"XMLHttpRequest",500);r(F),f(F),(M=t.networkSubscribe)===null||M===void 0||M.emit("network",l,"XMLHttpRequest","error",F.message);return}var L=w.split(","),O=(L[0].match(/:(.*?);/)||[])[1],k=L[1];if(t.responseType==="arraybuffer"||t.responseType==="blob"){for(var D=atob(L[1]),J=D.length,G=new Uint8Array(J),U=0;U<J;U++)G[U]=D.charCodeAt(U);t.responseType==="arraybuffer"?k=G.buffer:k=new Blob([G],{type:O})}var z={},q={body:k,meta:{origin:u,source:l,requestTime:s,responseTime:C,costs:P,headers:z}};e(q),c(q),(B=t.networkSubscribe)===null||B===void 0||B.emit("network",l,"XMLHttpRequest","ok",JSON.stringify(q.meta)),g=!0}};d[p]=E,A.src=l,document.body.appendChild(A),typeof t.timeout=="number"&&(h=window.setTimeout(m,t.timeout))}else{var v=!1,y=new XMLHttpRequest,b=function(){y&&(y.removeEventListener("timeout",_,!1),y.removeEventListener("progress",T,!1),y.removeEventListener("load",S,!1),y.removeEventListener("error",R,!1)),y=null,b=noop},_=function(){var w;if(v!==!0){v=!0,b();var M=new NetworkTimeoutError(l,"XMLHttpRequest",t.timeout||NaN);r(M),f(M),(w=t.networkSubscribe)===null||w===void 0||w.emit("network",l,"XMLHttpRequest","timeout",M.message)}},T=function(w){v!==!0&&w.lengthComputable&&(w.total<=0||o(w.loaded/w.total))},S=function(w){var M;if(v!==!0){var B=this.status;if(B===0||B>=200&&B<400){v=!0,b();var C=now(),P=C-s,F=parseHeaders(this.getAllResponseHeaders()),L=w.total,O={body:this.response,meta:{origin:u,source:l,requestTime:s,responseTime:C,costs:P,headers:F,size:L}};e(O),c(O),(M=t.networkSubscribe)===null||M===void 0||M.emit("network",l,"XMLHttpRequest","ok",JSON.stringify(O.meta))}else R.call(this)}},R=function(){var w;if(v!==!0){v=!0,b();var M=new NetworkResponseError(l,"XMLHttpRequest",this.status);r(M),f(M),(w=t.networkSubscribe)===null||w===void 0||w.emit("network",l,"XMLHttpRequest","error",M.message)}};y.addEventListener("timeout",_,!1),y.addEventListener("progress",T,!1),y.addEventListener("load",S,!1),y.addEventListener("error",R,!1),t.responseType&&(y.responseType=t.responseType),typeof t.timeout=="number"&&(y.timeout=t.timeout),y.open("GET",l,!0),y.send(null)}})})}var preloadCache={};function preload(n,t){t===void 0&&(t={});var e=now(),r=n;return Promise.resolve().then(function(){return t.requestProxy?t.requestProxy(n):n}).then(function(o){return/^https\:/.test(location.href)&&/^http\:/.test(o)?(console.warn("The page at '".concat(location.href,"' was loaded over HTTPS, but requested an insecure element '").concat(o,"'. This request was automatically upgraded to HTTPS")),o.replace(/^http\:/,"https:")):o}).catch(function(o){var s,u=new NetworkProxyError(r,"Link",o&&o.message?String(o.message):String(o));return(s=t.networkSubscribe)===null||s===void 0||s.emit("network",n,"Link","forbidden",u.message),Promise.reject(u)}).then(function(o){return o in preloadCache?preloadCache[o]:preloadCache[o]=new Promise(function(s,u){var l=document.createElement("link"),c=!1,f=null;l.onload=function(d){var h;if(f!==null&&(clearTimeout(f),f=null),c!==!0){c=!0,s();var g=now(),A=g-e,m={},E={origin:r,source:o,requestTime:e,responseTime:g,costs:A,headers:m};(h=t.networkSubscribe)===null||h===void 0||h.emit("network",o,"Link","preload",JSON.stringify(E))}},l.onerror=function(d){var h;if(f!==null&&(clearTimeout(f),f=null),c!==!0){c=!0;var g=new NetworkResponseError(o,"Link",0);u(g),(h=t.networkSubscribe)===null||h===void 0||h.emit("network",o,"Link","error",g.message)}},typeof t.timeout=="number"&&(f=window.setTimeout(function(){var d;if(f=null,c!==!0){c=!0,s();var h=now(),g=h-e,A={},m={origin:r,source:o,requestTime:e,responseTime:h,costs:g,headers:A};(d=t.networkSubscribe)===null||d===void 0||d.emit("network",o,"Link","timeout",JSON.stringify(m))}},t.timeout)),l.rel=l.relList&&l.relList.supports("prefetch")?"prefetch":"preload",l.as="fetch",l.crossOrigin="",l.fetchPriority="high",l.href=o;var p=document.head||document.getElementsByTagName("head")[0];p&&p.appendChild(l)})})}function loadImage(n,t,e,r,o,s){t===void 0&&(t={}),e===void 0&&(e=noop),r===void 0&&(r=noop),o===void 0&&(o=noop);var u=now(),l=n;return Promise.resolve().then(function(){return t.requestProxy?t.requestProxy(n):n}).then(function(c){return/^https\:/.test(location.href)&&/^http\:/.test(c)?(console.warn("The page at '".concat(location.href,"' was loaded over HTTPS, but requested an insecure element '").concat(c,"'. This request was automatically upgraded to HTTPS")),c.replace(/^http\:/,"https:")):c}).catch(function(c){var f,p=new NetworkProxyError(l,"Image",c&&c.message?String(c.message):String(c));return(f=t.networkSubscribe)===null||f===void 0||f.emit("network",n,"Image","forbidden",p.message),Promise.reject(p)}).then(function(c){return isJsonp(c)?ajax(c,{responseType:"blob",networkSubscribe:t.networkSubscribe}).then(function(f){return URL.createObjectURL(f.body)}):c}).then(function(c){return new Promise(function(f,p){var d=s!=null?s:new Image,h=!1,g=null,A=function(){var E;if(d.onload=noop,d.onerror=noop,g!==null&&(clearTimeout(g),g=null),h!==!0){var v=now(),y={headers:{},origin:l,source:c,requestTime:u,responseTime:v,costs:v-u};h=!0;var b={body:d,meta:y};o(1),e(b),f(b),(E=t.networkSubscribe)===null||E===void 0||E.emit("network",c,"Image","ok",JSON.stringify(b.meta))}},m=function(){var E;if(d.onload=noop,d.onerror=noop,g!==null&&(clearTimeout(g),g=null),h!==!0){h=!0;var v=new NetworkResponseError(c,"Image",0);r(v),p(v),(E=t.networkSubscribe)===null||E===void 0||E.emit("network",c,"Image","ok",v.message)}};typeof t.timeout=="number"&&(g=window.setTimeout(function(){var E;if(d.onload=noop,d.onerror=noop,g=null,h!==!0){h=!0;var v=new NetworkTimeoutError(c,"Image",t.timeout);r(v),p(v),(E=t.networkSubscribe)===null||E===void 0||E.emit("network",c,"Image","timeout",v.message)}},t.timeout)),d.onload=A,d.onerror=m,o(0),d.src=c})})}var Fetcher=(function(){function n(t){t===void 0&&(t={}),this.options=t}return n.prototype.ajax=function(t,e,r,o,s){var u;e===void 0&&(e={}),r===void 0&&(r=noop),o===void 0&&(o=noop),s===void 0&&(s=noop);var l=this.options,c={responseType:e.responseType,timeout:(u=e.timeout)!==null&&u!==void 0?u:l.timeout,get requestProxy(){var f;return(f=e.requestProxy)!==null&&f!==void 0?f:l.requestProxy},get networkSubscribe(){var f;return(f=e.networkSubscribe)!==null&&f!==void 0?f:l.networkSubscribe}};return ajax(t,c,r,o,s)},n.prototype.loadImage=function(t,e,r,o,s,u){var l;e===void 0&&(e={}),r===void 0&&(r=noop),o===void 0&&(o=noop),s===void 0&&(s=noop);var c=this.options,f={timeout:(l=e.timeout)!==null&&l!==void 0?l:c.timeout,get requestProxy(){var p;return(p=e.requestProxy)!==null&&p!==void 0?p:c.requestProxy},get networkSubscribe(){var p;return(p=e.networkSubscribe)!==null&&p!==void 0?p:c.networkSubscribe}};return loadImage(t,f,r,o,s,u)},n.prototype.preload=function(t,e){var r;e===void 0&&(e={});var o=this.options,s={timeout:(r=e.timeout)!==null&&r!==void 0?r:o.timeout,get requestProxy(){var u;return(u=e.requestProxy)!==null&&u!==void 0?u:o.requestProxy},get networkSubscribe(){var u;return(u=e.networkSubscribe)!==null&&u!==void 0?u:o.networkSubscribe}};return preload(t,s)},n})(),internalFetcher=new Fetcher;function pick(n,t){for(var e={},r=0,o=t;r<o.length;r++){var s=o[r];s in n&&(e[s]=n[s])}return e}function omit(n,t){for(var e=__assign({},n),r=0,o=t;r<o.length;r++){var s=o[r];s in e&&delete e[s]}return e}function omitUndefinedFields(n){var t={};for(var e in n){var r=n[e];r!==void 0&&(t[e]=r)}return t}function pathJoin(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];var e=[];n=n.map(function(l){return(l!=null?l:"").trim()}).filter(function(l){return l.length>0&&!/^\/+$/.test(l)});for(var r=0;r<n.length;r++){var o=r===0,s=r===n.length-1,u=n[r];o||(u=u.replace(/^\.\//,"").replace(/^\/+/,"")),s||(u=u.replace(/\/+$/,"")),e.push(u)}return e.join("/")}function isAbsoluteURL(n){return n.indexOf("/")===0||/^[0-9a-z]+\:/i.test(n)}var webp="data:image/webp;base64,UklGRiQAAABXRUJQVlA4IBgAAAAwAQCdASoCAAIAAUAmJaQAA3AA/vz0AAA=",avif="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAAGhbWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAsaWxvYwAAAABEAAACAAEAAAABAAAB3gAAABkAAgAAAAEAAAHJAAAAFQAAAEJpaW5mAAAAAAACAAAAGmluZmUCAAAAAAEAAGF2MDFDb2xvcgAAAAAaaW5mZQIAAAAAAgAAYXYwMUFscGhhAAAAABppcmVmAAAAAAAAAA5hdXhsAAIAAQABAAAA12lwcnAAAACxaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIAAoAAAAAUaXNwZQAAAAAAAAACAAAAAgAAAA5waXhpAAAAAAEIAAAADGF2MUOBABwAAAAAOGF1eEMAAAAAdXJuOm1wZWc6bXBlZ0I6Y2ljcDpzeXN0ZW1zOmF1eGlsaWFyeTphbHBoYQAAAAAeaXBtYQAAAAAAAAACAAEEAQKDBAACBAUGhwgAAAA2bWRhdBIACgQYADLVMgsWQBhhIAQqrNj/+BIACgUYADLEoDIOFkADDDDCQAACDaqCCb4=",heif="data:image/heif;base64,AAAAGGZ0eXBoZWljAAAAAG1pZjFoZWljAAABL21ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAHBpY3QAAAAAAAAAAAAAAAAAAAAADnBpdG0AAAAAAAEAAAAjaWluZgAAAAAAAQAAABVpbmZlAgAAAAABAABodmMxAAAAAK9pcHJwAAAAkmlwY28AAAB2aHZjQwEBYAAAAAAAAAAAAADwAPz9+PgAACcDoAABAB5AAQwG//8BYAAAAwAAAwAAAwAAAwAAAwAAreTLgSChAAEAI0IBBwFgAAADAAADAAADAAADAAADAAChInJJlreTLySZNdggogABAAdEAcA98DMkAAAAFGlzcGUAAAAAAAAAAgAAAAIAAAAVaXBtYQAAAAAAAAABAAECgQIAAAAiaWxvYwAAAABEQAABAAEAAAAAAU8AAQAAAAAAAAAOAAAAFm1kYXQAAAAKJgGvLvkQwuWM4A==";function checkImage(n){return new Promise(function(t){if(typeof Image=="undefined"){t(!1);return}var e=new Image,r=setTimeout(function(){e.onload=e.onerror=function(){},clearTimeout(r),t(!1)},100);e.onload=e.onerror=function(){e.onload=e.onerror=function(){},clearTimeout(r),t(e.height===2)},e.src=n})}var imageSupportCache=null;function imageSupport(){return imageSupportCache||(imageSupportCache=Promise.all([checkImage(webp),checkImage(avif),checkImage(heif)]).then(function(n){return{webp:n[0],avif:n[1],heif:n[2]}}))}var _a$5,supportAvif=!1,supportWebp=!1,supportHeif=!1;imageSupport().then(function(n){supportAvif=n.avif,supportWebp=n.webp,supportHeif=n.heif});var IMAGE_FORMATS=["jpg","jpeg","png","heif","heic","webp","avif"];function isImageExt(n){return IMAGE_FORMATS.indexOf(n)>=0}var DEFAULT_IMAGE_URL_MAPPINGS={"vrlab-public.ljcdn.com":{type:"tencentCloud",pano:["vrlab-image1.ljcdn.com","vrlab-image2.ljcdn.com"],texture:["vrlab-image3.ljcdn.com"],tile:["vr-tile-1.realsee-cdn.cn","vr-tile-2.realsee-cdn.cn"],model:["vr-model-1.realsee-cdn.cn","vr-model-2.realsee-cdn.cn"],default:["vrlab-image4.ljcdn.com"]},"vr-public.realsee-cdn.cn":{type:"tencentCloud",pano:["vr-image-1.realsee-cdn.cn","vr-image-2.realsee-cdn.cn"],texture:["vr-image-3.realsee-cdn.cn"],tile:["vr-tile-1.realsee-cdn.cn","vr-tile-2.realsee-cdn.cn"],model:["vr-model-1.realsee-cdn.cn","vr-model-2.realsee-cdn.cn"],default:["vr-image-4.realsee-cdn.cn"]},"vr-public.rscdn.cn":{type:"tencentCloud",pano:["vr-image-1.rscdn.cn","vr-image-2.rscdn.cn"],texture:["vr-image-3.rscdn.cn"],tile:["vr-tile-1.rscdn.cn","vr-tile-2.rscdn.cn"],model:["vr-model-1.rscdn.cn","vr-model-2.rscdn.cn"],default:["vr-image-4.rscdn.cn"]},"mars-public.realsee-cdn.cn":{type:"aliyun",pano:["mars-image-1.realsee-cdn.cn","mars-image-2.realsee-cdn.cn"],texture:["mars-image-3.realsee-cdn.cn"],tile:["mars-tile-1.realsee-cdn.cn","mars-tile-2.realsee-cdn.cn"],model:["mars-model-1.realsee-cdn.cn","mars-model-2.realsee-cdn.cn"],default:["mars-image-4.realsee-cdn.cn"]},"global-public.realsee-cdn.com":{type:"tencentCloud",pano:["global-image-1.realsee-cdn.com","global-image-2.realsee-cdn.com"],texture:["global-image-3.realsee-cdn.com"],tile:["global-tile-1.realsee-cdn.com","global-tile-2.realsee-cdn.com"],model:["global-model-1.realsee-cdn.com","global-model-2.realsee-cdn.com"],default:["global-image-4.realsee-cdn.com"]},"earth-ga-public.realsee-cdn.cn":{type:"tencentCloud",pano:["earth-ga-image-1.realsee-cdn.cn","earth-ga-image-2.realsee-cdn.cn"],texture:["earth-ga-image-3.realsee-cdn.cn"],tile:["earth-ga-tile-1.realsee-cdn.cn","earth-ga-tile-2.realsee-cdn.cn"],model:["earth-ga-model-1.realsee-cdn.cn","earth-ga-model-2.realsee-cdn.cn"],default:["earth-ga-image-4.realsee-cdn.cn"]},"test-vr-public.realsee-cdn.com":{type:"tencentCloud",pano:["test-vr-image.realsee-cdn.com","test-vr-image.realsee-cdn.com"],texture:["test-vr-image.realsee-cdn.com"],tile:["test-vr-image.realsee-cdn.com","test-vr-image.realsee-cdn.com"],model:["test-vr-image.realsee-cdn.com","test-vr-image.realsee-cdn.com"],default:["test-vr-image.realsee-cdn.com"]},"test-vr-public.realsee-cdn.cn":{type:"tencentCloud",pano:["test-vr-image.realsee-cdn.cn","test-vr-image.realsee-cdn.cn"],texture:["test-vr-image.realsee-cdn.cn"],tile:["test-vr-image.realsee-cdn.cn","test-vr-image.realsee-cdn.cn"],model:["test-vr-image.realsee-cdn.cn","test-vr-image.realsee-cdn.cn"],default:["test-vr-image.realsee-cdn.cn"]}},URL_DOMAIN_REGEX=/^https?\:\/\/?([^\/]+)/;function getDomain(n){var t=n.match(URL_DOMAIN_REGEX);return t===null?null:t[1]}function replaceDomain(n,t,e){var r,o,s=(o=(r=t[e])!==null&&r!==void 0?r:t[t.length-1])!==null&&o!==void 0?o:n;return n.replace(URL_DOMAIN_REGEX,function(u,l){return u.slice(0,u.length-l.length)+s})}function route(n,t,e){var r=t.split("."),o=r[0],s=r.slice(1);if(o==="texture")return replaceDomain(n,e.texture,0);if(o==="pano"){s[0];var u=s[1];switch(u){case"front":case"left":case"up":return replaceDomain(n,e.pano,0);case"down":case"right":case"back":return replaceDomain(n,e.pano,1)}}else if(o==="pano_tile"){s[0],s[1];var l=s[2],c=s[3],f=s[4],p=Math.pow(2,Number(l))*Number(c)+Number(f);if(!isNaN(p))return replaceDomain(n,e.tile,p%2)}else if(o==="model"){var d=s[0],p=Number(d);if(!isNaN(p))return replaceDomain(n,e.model,p%2)}return replaceDomain(n,e.default,0)}var tencentCloudImageProcesser=function(n,t){var e=n.split("?")[0],r=e.split(".").pop();if(r==="jpeg"&&(r="jpg"),r==="heif"&&(r="heic"),r&&!isImageExt(r))return n;var o=[],s=t.format,u=t.cut,l=t.quality,c=t.size,f=t.sharpen;if(s==="jpeg"&&(s="jpg"),s==="heif"&&(s="heic"),(!supportAvif&&(s!=null?s:r)==="avif"||!supportWebp&&(s!=null?s:r)==="webp"||!supportHeif&&(s!=null?s:r)==="heic")&&(s="jpg"),s!==void 0&&s!==r&&o.push("format/".concat(s)),u!==void 0&&o.push("cut/".concat(u[2],"x").concat(u[3],"x").concat(u[0],"x").concat(u[1])),l!==void 0){var p=s!=null?s:r;p&&["jpg","webp","heic","avif"].indexOf(p)>=0&&o.push("quality/".concat(l))}if(c!==void 0){var d=n.match(/\/cube_(\d+)\//),h=d?Number(d[1]):NaN;h!==Number(c)&&o.push("thumbnail/".concat(c,"x"))}f!==void 0&&o.push("sharpen/".concat(f));var g="";return o.length&&(g="?imageMogr2/"+o.join("/")),e+g},aliyunOOSImageProcesser=function(n,t){var e=n.split("?")[0],r=e.split(".").pop();if(r==="jpeg"&&(r="jpg"),r==="heif"&&(r="heic"),r&&!isImageExt(r))return n;var o=[],s=t.format,u=t.cut,l=t.quality,c=t.size,f=t.sharpen;if(s==="jpeg"&&(s="jpg"),s==="heif"&&(s="heic"),(!supportAvif&&(s!=null?s:r)==="avif"||!supportWebp&&(s!=null?s:r)==="webp"||!supportHeif&&(s!=null?s:r)==="heic")&&(s="jpg"),s!==void 0&&s!==r&&o.push("format,".concat(s)),u!==void 0){var p=u[0],d=u[1],h=u[2],g=u[3];o.push("crop,x_".concat(p,",y_").concat(d,",w_").concat(h,",h_").concat(g,",g_nw"))}if(l!==void 0&&l!==100){var A=s!=null?s:r;A&&["jpg","webp","heic","avif"].indexOf(A)>=0&&o.push("quality,Q_".concat(l))}c&&c!==2048&&o.push("resize,w_".concat(c)),f!==void 0&&o.push("sharpen,".concat(f));var m="";return o.length&&(m="?x-oss-process=image/"+o.join("/")),e+m},MAX_SAFE_INTEGER=9007199254740991;function formatNumber(n){var t=Math.round(n);return Math.abs(t-n)<.001?t:Math.floor(n)}function formatOptions(n){return n=Object.assign({},n),n.size!==void 0&&(n.size=formatNumber(clamp$1(n.size,0,MAX_SAFE_INTEGER))),n.quality!==void 0&&(n.quality=formatNumber(clamp$1(n.quality,0,100))),n.cut!==void 0&&(n.cut=[formatNumber(clamp$1(n.cut[0],0,MAX_SAFE_INTEGER)),formatNumber(clamp$1(n.cut[1],0,MAX_SAFE_INTEGER)),formatNumber(clamp$1(n.cut[2],0,MAX_SAFE_INTEGER)),formatNumber(clamp$1(n.cut[3],0,MAX_SAFE_INTEGER))]),n.sharpen!==void 0&&(n.sharpen=formatNumber(clamp$1(n.sharpen,0,MAX_SAFE_INTEGER))),n}function imageURL(n,t){var e=__assign(__assign({},DEFAULT_IMAGE_URL_MAPPINGS),t.mappings),r=getDomain(n);if(r===null)return n;t=formatOptions(t);var o=e[r];return o?(n=route(n,t.key,o),/\.basis(\?|$)/.test(n)&&(n=n.replace(/\.basis(\?|$)/,".jpg$1")),o.type==="tencentCloud"?tencentCloudImageProcesser(n,t):o.type==="aliyun"?aliyunOOSImageProcesser(n,t):n):n}function applyImageURLOptions(n,t,e){t===void 0&&(t=imageURL);var r=t(n,e);if(r===n&&e.cut)throw new Error("ImageURL: cut option not applied.");return r}var IMAGE_SIZE_REG=/\/cube_(\d+)\//;function getImageSizeFromURL(n){var t=n.match(IMAGE_SIZE_REG);return t?Number(t[1]):null}function replaceImageSize(n,t){return n.replace(IMAGE_SIZE_REG,"/cube_".concat(t,"/"))}var log2=(_a$5=Math.log2)!==null&&_a$5!==void 0?_a$5:(function(n){return Math.log(n)*Math.LOG2E});function getImageSizeLevel(n){return Math.floor(Math.max(log2(n/512),0))}var canUseNativeImageBitmap=(function(){return!1})();function createImageBitmapLikeImage(n){n===void 0&&(n={});var t=Object.assign(document.createElementNS("http://www.w3.org/1999/xhtml","img"),{crossOrigin:"",close:function(){n.onClose&&n.onClose.call(this),this.onerror=this.onload=this.close=noop,this.removeAttribute("src")}});return t}function createImageBitmapLike(n){return new Promise(function(t,e){var r=URL.createObjectURL(n),o=createImageBitmapLikeImage({onClose:function(){this.src===r&&URL.revokeObjectURL(r)}});o.onload=function(){o.src===r&&URL.revokeObjectURL(r),o.onload=o.onerror=noop,setTimeout(function(){t(o)},10)},o.onerror=function(){var s=o.src;o.onload=o.onerror=noop,o.close(),e(new Error("image load error: ".concat(s)))},o.decoding="async",o.src=r})}var canvasPool=[];function createCanvas(n,t){var e=canvasPool.shift();if(e)return e.width=n,e.height=t,e;var r=Object.assign(document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),{close:function(){r.close=noop,canvasPool.push(r)}});return r}function poolImageToTexture(n,t){if(t&&(n.width>t.width||n.height>t.height)){var e=createCanvas(Math.min(n.width,t.width),Math.min(n.height,t.height)),r=e.getContext("2d");r.clearRect(0,0,e.width,e.height),r.drawImage(n,0,0,e.width,e.height),n.close();var o=new THREE__namespace.Texture(e);o.needsUpdate=!0,o.flipY=!0;var s=o.dispose;return o.dispose=function(){e.close(),s.call(o),o.dispose=s},o}else{var u=new THREE__namespace.Texture(n);u.needsUpdate=!0,typeof ImageBitmap!="undefined"&&n instanceof ImageBitmap?u.flipY=!1:u.flipY=!0;var l=u.dispose;return u.dispose=function(){n.close(),l.call(u),u.dispose=l},u}}function poolImagesToCubeTexture(n){var t=new THREE__namespace.CubeTexture(n);t.needsUpdate=!0,t.flipY=!1;var e=t.dispose;return t.dispose=function(){for(var r=0,o=n;r<o.length;r++){var s=o[r];s.close()}e.call(t),t.dispose=e},t}var FACE_ORDER$2=["right","left","up","down","front","back"],TextureLoader=(function(){function n(){}return n.prototype.loadTexture=function(t,e,r,o,s,u){var l,c,f,p,d,h,g;r===void 0&&(r=noop),o===void 0&&(o=noop),s===void 0&&(s=noop);var A={};typeof e.flipY!="undefined"&&(A.flipY=e.flipY),typeof e.format!="undefined"&&(A.format=e.format),typeof e.encoding!="undefined"&&(A.encoding=e.encoding),A.generateMipmaps=(l=e.generateMipmaps)!==null&&l!==void 0?l:!1,A.minFilter=(c=e.minFilter)!==null&&c!==void 0?c:THREE__namespace.LinearFilter,A.magFilter=(f=e.magFilter)!==null&&f!==void 0?f:THREE__namespace.LinearFilter;var m=(d=(p=e.imageURL)===null||p===void 0?void 0:p.options)!==null&&d!==void 0?d:{key:"unknown"};t=applyImageURLOptions(t,(h=e.imageURL)===null||h===void 0?void 0:h.transform,m);var E=(g=e.viaAjax)!==null&&g!==void 0?g:canUseNativeImageBitmap;if(E){var v=null,y="blob";return e.fetcher.ajax(t,{timeout:e.timeout,responseType:y},void 0,void 0,s).then(function(T){return createImageBitmapLike(T.body)}).then(function(T){return poolImageToTexture(T,e.maxSize)}).then(function(T){return Object.assign(T,A),T}).then(function(T){var S={meta:v,body:T};return r(S),S}).catch(function(T){return o(T),Promise.reject(T)})}else{var b=null,_;return Promise.resolve().then(function(){return createImageBitmapLikeImage()}).then(function(T){return _=T,e.fetcher.loadImage(t,{timeout:e.timeout},void 0,void 0,s,T)}).then(function(T){return b=T.meta,poolImageToTexture(T.body,e.maxSize)}).then(function(T){return Object.assign(T,A),T}).then(function(T){var S={meta:b,body:T};return r(S),S}).catch(function(T){return _&&_.close(),o(T),Promise.reject(T)})}},n.prototype.loadCubeTexture=function(t,e,r,o,s,u){var l,c,f,p,d,h,g;r===void 0&&(r=noop),o===void 0&&(o=noop),s===void 0&&(s=noop);var A={};typeof e.format!="undefined"&&(A.format=e.format),A.generateMipmaps=(l=e.generateMipmaps)!==null&&l!==void 0?l:!1,A.minFilter=(c=e.minFilter)!==null&&c!==void 0?c:THREE__namespace.LinearFilter,A.magFilter=(f=e.magFilter)!==null&&f!==void 0?f:THREE__namespace.LinearFilter;for(var m=[t[FACE_ORDER$2[0]],t[FACE_ORDER$2[1]],t[FACE_ORDER$2[2]],t[FACE_ORDER$2[3]],t[FACE_ORDER$2[4]],t[FACE_ORDER$2[5]]],E=[],v=[0,0,0,0,0,0],y=[],b=function(T){var S=(d=(p=e.imageURL)===null||p===void 0?void 0:p.options)!==null&&d!==void 0?d:{key:"unknown"},R=applyImageURLOptions(m[T],(h=e.imageURL)===null||h===void 0?void 0:h.transform,__assign(__assign({},S),{key:S.key+"."+FACE_ORDER$2[T]})),w=function(F){v[T]=F,s(v.reduce(function(L,O){return L+O},0)/6)},M=(g=e.viaAjax)!==null&&g!==void 0?g:!1;if(M){var B="blob",C=e.fetcher.ajax(R,{timeout:e.timeout,responseType:B},void 0,void 0,w).then(function(F){return y[T]=F.meta,createImageBitmapLike(F.body)});E.push(C)}else{var P,C=Promise.resolve().then(function(){return createImageBitmapLikeImage()}).then(function(L){return P=L,e.fetcher.loadImage(R,{timeout:e.timeout},void 0,void 0,w,L)}).then(function(L){return y[T]=L.meta,L.body}).catch(function(L){return P&&P.close(),Promise.reject(L)});E.push(C)}},_=0;_<6;_++)b(_);return Promise.all(E).then(function(T){return poolImagesToCubeTexture(T)}).then(function(T){return Object.assign(T,__assign({encoding:THREE__namespace.sRGBEncoding},A)),T}).then(function(T){var S={body:T,meta:y};return r(S),S}).catch(function(T){for(var S=0,R=E;S<R.length;S++){var w=R[S];w.then(function(M){return M.close()}).catch(noop)}return o(T),Promise.reject(T)})},n})(),windowSTOContext=(function(){var n=now();return{requestAnimationFrame:function(t){var e=now(),r=clamp$1(16+(e-n),16,33),o=setTimeout(function(){t(e+r)},r);return n=e+r,o},cancelAnimationFrame:function(t){return clearTimeout(t)}}})(),windowRAFContext=(function(){if(typeof window!="undefined"){var n=window;if(n.requestAnimationFrame)return{requestAnimationFrame:n.requestAnimationFrame.bind(n),cancelAnimationFrame:n.cancelAnimationFrame.bind(n)};if(n.mozRequestAnimationFrame)return{requestAnimationFrame:n.mozRequestAnimationFrame.bind(n),cancelAnimationFrame:n.mozCancelAnimationFrame.bind(n)};if(n.webkitRequestAnimationFrame)return{requestAnimationFrame:n.webkitRequestAnimationFrame.bind(n),cancelAnimationFrame:n.webkitCancelAnimationFrame.bind(n)};if(n.msRequestAnimationFrame)return{requestAnimationFrame:n.msRequestAnimationFrame.bind(n),cancelAnimationFrame:n.msCancelAnimationFrame.bind(n)}}return windowSTOContext})(),DEFAULT_ORDER=5,deviceFrameTime=16,AnimationFrameLoop=(function(){function n(){this.loopType="raf",this.frames=[],this.isAnimating=!1,this.context=null;var t=now();this.loop=(function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];if(this.isAnimating!==!1){var o=now(),s=o-t;t=o,deviceFrameTime=s;for(var u=0;u<this.frames.length;u++){var l=this.frames[u];if(l.delay>0){l.delay=l.delay-1;continue}try{l.callback.apply(l,__spreadArray([o,s],e,!1))}catch(c){console.error(c)}l.once&&(this.frames.splice(u,1),u--)}this.requestId=this.requestAnimationFrame(this.loop)}}).bind(this),this.start()}return Object.defineProperty(n,"shared",{get:function(){return this.sharedInstance||(this.sharedInstance=new n),this.sharedInstance},enumerable:!1,configurable:!0}),n.getFrameTime=function(){return deviceFrameTime},n.prototype.start=function(){this.isAnimating!==!0&&(this.isAnimating=!0,this.requestId=this.requestAnimationFrame(this.loop))},n.prototype.stop=function(){this.isAnimating=!1,this.cancelAnimationFrame(this.requestId)},n.prototype.setContext=function(t){t!==this.context&&(this.stop(),this.context=t,this.start())},n.prototype.getContext=function(){return this.context},n.prototype.setLoopType=function(t){t!==this.loopType&&(this.stop(),this.loopType=t,this.start())},n.prototype.getLoopType=function(){return this.loopType},n.prototype.requestAnimationFrame=function(t){if(this.context)return this.context.requestAnimationFrame(t);if(this.loopType==="raf")return windowRAFContext.requestAnimationFrame(t);if(this.loopType==="sto")return windowSTOContext.requestAnimationFrame(t)},n.prototype.cancelAnimationFrame=function(t){if(this.context)this.context.cancelAnimationFrame(t);else if(this.loopType==="raf")windowRAFContext.cancelAnimationFrame(t);else if(this.loopType==="sto")return windowSTOContext.cancelAnimationFrame(t)},n.prototype.remove=function(t){var e=this.frames.indexOf(t);e>=0&&this.frames.splice(e,1)},n.prototype.add=function(t,e,r,o){var s=this;e===void 0&&(e=!1),r===void 0&&(r=0),o===void 0&&(o=DEFAULT_ORDER);for(var u={callback:t,once:e,delay:r,order:o},l=this.frames.length;--l>=0;)if(this.frames[l].order<=o){this.frames.splice(l+1,0,u);break}return l<0&&this.frames.unshift(u),function(){return s.remove(u)}},n.prototype.clear=function(){this.frames.length=0},n})(),dequeuing=!1,queue=[];function dequeue(n){if(n===void 0&&(n=!1),!(!n&&dequeuing)){dequeuing=!0;var t=queue.shift();if(t){try{t()}catch(e){}AnimationFrameLoop.shared.add(function(){return dequeue(!0)},!0,2,-100)}else dequeuing=!1}}function delay$1(n){return new Promise(function(t,e){var r=function(){try{t(n())}catch(o){e(o)}};queue.push(r),AnimationFrameLoop.shared.add(function(){return dequeue()},!0,2,-100)})}var commonjsGlobal=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},indexMinimal={},minimal$1={},aspromise,hasRequiredAspromise;function requireAspromise(){if(hasRequiredAspromise)return aspromise;hasRequiredAspromise=1,aspromise=n;function n(t,e){for(var r=new Array(arguments.length-1),o=0,s=2,u=!0;s<arguments.length;)r[o++]=arguments[s++];return new Promise(function(c,f){r[o]=function(d){if(u)if(u=!1,d)f(d);else{for(var h=new Array(arguments.length-1),g=0;g<h.length;)h[g++]=arguments[g];c.apply(null,h)}};try{t.apply(e||null,r)}catch(p){u&&(u=!1,f(p))}})}return aspromise}var base64={},hasRequiredBase64;function requireBase64(){return hasRequiredBase64||(hasRequiredBase64=1,(function(n){var t=n;t.length=function(l){var c=l.length;if(!c)return 0;for(var f=0;--c%4>1&&l.charAt(c)==="=";)++f;return Math.ceil(l.length*3)/4-f};for(var e=new Array(64),r=new Array(123),o=0;o<64;)r[e[o]=o<26?o+65:o<52?o+71:o<62?o-4:o-59|43]=o++;t.encode=function(l,c,f){for(var p=null,d=[],h=0,g=0,A;c<f;){var m=l[c++];switch(g){case 0:d[h++]=e[m>>2],A=(m&3)<<4,g=1;break;case 1:d[h++]=e[A|m>>4],A=(m&15)<<2,g=2;break;case 2:d[h++]=e[A|m>>6],d[h++]=e[m&63],g=0;break}h>8191&&((p||(p=[])).push(String.fromCharCode.apply(String,d)),h=0)}return g&&(d[h++]=e[A],d[h++]=61,g===1&&(d[h++]=61)),p?(h&&p.push(String.fromCharCode.apply(String,d.slice(0,h))),p.join("")):String.fromCharCode.apply(String,d.slice(0,h))};var s="invalid encoding";t.decode=function(l,c,f){for(var p=f,d=0,h,g=0;g<l.length;){var A=l.charCodeAt(g++);if(A===61&&d>1)break;if((A=r[A])===void 0)throw Error(s);switch(d){case 0:h=A,d=1;break;case 1:c[f++]=h<<2|(A&48)>>4,h=A,d=2;break;case 2:c[f++]=(h&15)<<4|(A&60)>>2,h=A,d=3;break;case 3:c[f++]=(h&3)<<6|A,d=0;break}}if(d===1)throw Error(s);return f-p},t.test=function(l){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(l)}})(base64)),base64}var eventemitter,hasRequiredEventemitter;function requireEventemitter(){if(hasRequiredEventemitter)return eventemitter;hasRequiredEventemitter=1,eventemitter=n;function n(){this._listeners={}}return n.prototype.on=function(e,r,o){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:r,ctx:o||this}),this},n.prototype.off=function(e,r){if(e===void 0)this._listeners={};else if(r===void 0)this._listeners[e]=[];else for(var o=this._listeners[e],s=0;s<o.length;)o[s].fn===r?o.splice(s,1):++s;return this},n.prototype.emit=function(e){var r=this._listeners[e];if(r){for(var o=[],s=1;s<arguments.length;)o.push(arguments[s++]);for(s=0;s<r.length;)r[s].fn.apply(r[s++].ctx,o)}return this},eventemitter}var float,hasRequiredFloat;function requireFloat(){if(hasRequiredFloat)return float;hasRequiredFloat=1,float=n(n);function n(s){return typeof Float32Array!="undefined"?(function(){var u=new Float32Array([-0]),l=new Uint8Array(u.buffer),c=l[3]===128;function f(g,A,m){u[0]=g,A[m]=l[0],A[m+1]=l[1],A[m+2]=l[2],A[m+3]=l[3]}function p(g,A,m){u[0]=g,A[m]=l[3],A[m+1]=l[2],A[m+2]=l[1],A[m+3]=l[0]}s.writeFloatLE=c?f:p,s.writeFloatBE=c?p:f;function d(g,A){return l[0]=g[A],l[1]=g[A+1],l[2]=g[A+2],l[3]=g[A+3],u[0]}function h(g,A){return l[3]=g[A],l[2]=g[A+1],l[1]=g[A+2],l[0]=g[A+3],u[0]}s.readFloatLE=c?d:h,s.readFloatBE=c?h:d})():(function(){function u(c,f,p,d){var h=f<0?1:0;if(h&&(f=-f),f===0)c(1/f>0?0:2147483648,p,d);else if(isNaN(f))c(2143289344,p,d);else if(f>34028234663852886e22)c((h<<31|2139095040)>>>0,p,d);else if(f<11754943508222875e-54)c((h<<31|Math.round(f/1401298464324817e-60))>>>0,p,d);else{var g=Math.floor(Math.log(f)/Math.LN2),A=Math.round(f*Math.pow(2,-g)*8388608)&8388607;c((h<<31|g+127<<23|A)>>>0,p,d)}}s.writeFloatLE=u.bind(null,t),s.writeFloatBE=u.bind(null,e);function l(c,f,p){var d=c(f,p),h=(d>>31)*2+1,g=d>>>23&255,A=d&8388607;return g===255?A?NaN:h*(1/0):g===0?h*1401298464324817e-60*A:h*Math.pow(2,g-150)*(A+8388608)}s.readFloatLE=l.bind(null,r),s.readFloatBE=l.bind(null,o)})(),typeof Float64Array!="undefined"?(function(){var u=new Float64Array([-0]),l=new Uint8Array(u.buffer),c=l[7]===128;function f(g,A,m){u[0]=g,A[m]=l[0],A[m+1]=l[1],A[m+2]=l[2],A[m+3]=l[3],A[m+4]=l[4],A[m+5]=l[5],A[m+6]=l[6],A[m+7]=l[7]}function p(g,A,m){u[0]=g,A[m]=l[7],A[m+1]=l[6],A[m+2]=l[5],A[m+3]=l[4],A[m+4]=l[3],A[m+5]=l[2],A[m+6]=l[1],A[m+7]=l[0]}s.writeDoubleLE=c?f:p,s.writeDoubleBE=c?p:f;function d(g,A){return l[0]=g[A],l[1]=g[A+1],l[2]=g[A+2],l[3]=g[A+3],l[4]=g[A+4],l[5]=g[A+5],l[6]=g[A+6],l[7]=g[A+7],u[0]}function h(g,A){return l[7]=g[A],l[6]=g[A+1],l[5]=g[A+2],l[4]=g[A+3],l[3]=g[A+4],l[2]=g[A+5],l[1]=g[A+6],l[0]=g[A+7],u[0]}s.readDoubleLE=c?d:h,s.readDoubleBE=c?h:d})():(function(){function u(c,f,p,d,h,g){var A=d<0?1:0;if(A&&(d=-d),d===0)c(0,h,g+f),c(1/d>0?0:2147483648,h,g+p);else if(isNaN(d))c(0,h,g+f),c(2146959360,h,g+p);else if(d>17976931348623157e292)c(0,h,g+f),c((A<<31|2146435072)>>>0,h,g+p);else{var m;if(d<22250738585072014e-324)m=d/5e-324,c(m>>>0,h,g+f),c((A<<31|m/4294967296)>>>0,h,g+p);else{var E=Math.floor(Math.log(d)/Math.LN2);E===1024&&(E=1023),m=d*Math.pow(2,-E),c(m*4503599627370496>>>0,h,g+f),c((A<<31|E+1023<<20|m*1048576&1048575)>>>0,h,g+p)}}}s.writeDoubleLE=u.bind(null,t,0,4),s.writeDoubleBE=u.bind(null,e,4,0);function l(c,f,p,d,h){var g=c(d,h+f),A=c(d,h+p),m=(A>>31)*2+1,E=A>>>20&2047,v=4294967296*(A&1048575)+g;return E===2047?v?NaN:m*(1/0):E===0?m*5e-324*v:m*Math.pow(2,E-1075)*(v+4503599627370496)}s.readDoubleLE=l.bind(null,r,0,4),s.readDoubleBE=l.bind(null,o,4,0)})(),s}function t(s,u,l){u[l]=s&255,u[l+1]=s>>>8&255,u[l+2]=s>>>16&255,u[l+3]=s>>>24}function e(s,u,l){u[l]=s>>>24,u[l+1]=s>>>16&255,u[l+2]=s>>>8&255,u[l+3]=s&255}function r(s,u){return(s[u]|s[u+1]<<8|s[u+2]<<16|s[u+3]<<24)>>>0}function o(s,u){return(s[u]<<24|s[u+1]<<16|s[u+2]<<8|s[u+3])>>>0}return float}var inquire_1,hasRequiredInquire;function requireInquire(){if(hasRequiredInquire)return inquire_1;hasRequiredInquire=1,inquire_1=inquire;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(n){}return null}return inquire_1}var utf8={},hasRequiredUtf8;function requireUtf8(){return hasRequiredUtf8||(hasRequiredUtf8=1,(function(n){var t=n;t.length=function(r){for(var o=0,s=0,u=0;u<r.length;++u)s=r.charCodeAt(u),s<128?o+=1:s<2048?o+=2:(s&64512)===55296&&(r.charCodeAt(u+1)&64512)===56320?(++u,o+=4):o+=3;return o},t.read=function(r,o,s){var u=s-o;if(u<1)return"";for(var l=null,c=[],f=0,p;o<s;)p=r[o++],p<128?c[f++]=p:p>191&&p<224?c[f++]=(p&31)<<6|r[o++]&63:p>239&&p<365?(p=((p&7)<<18|(r[o++]&63)<<12|(r[o++]&63)<<6|r[o++]&63)-65536,c[f++]=55296+(p>>10),c[f++]=56320+(p&1023)):c[f++]=(p&15)<<12|(r[o++]&63)<<6|r[o++]&63,f>8191&&((l||(l=[])).push(String.fromCharCode.apply(String,c)),f=0);return l?(f&&l.push(String.fromCharCode.apply(String,c.slice(0,f))),l.join("")):String.fromCharCode.apply(String,c.slice(0,f))},t.write=function(r,o,s){for(var u=s,l,c,f=0;f<r.length;++f)l=r.charCodeAt(f),l<128?o[s++]=l:l<2048?(o[s++]=l>>6|192,o[s++]=l&63|128):(l&64512)===55296&&((c=r.charCodeAt(f+1))&64512)===56320?(l=65536+((l&1023)<<10)+(c&1023),++f,o[s++]=l>>18|240,o[s++]=l>>12&63|128,o[s++]=l>>6&63|128,o[s++]=l&63|128):(o[s++]=l>>12|224,o[s++]=l>>6&63|128,o[s++]=l&63|128);return s-u}})(utf8)),utf8}var pool_1,hasRequiredPool;function requirePool(){if(hasRequiredPool)return pool_1;hasRequiredPool=1,pool_1=n;function n(t,e,r){var o=r||8192,s=o>>>1,u=null,l=o;return function(f){if(f<1||f>s)return t(f);l+f>o&&(u=t(o),l=0);var p=e.call(u,l,l+=f);return l&7&&(l=(l|7)+1),p}}return pool_1}var longbits,hasRequiredLongbits;function requireLongbits(){if(hasRequiredLongbits)return longbits;hasRequiredLongbits=1,longbits=t;var n=requireMinimal$1();function t(s,u){this.lo=s>>>0,this.hi=u>>>0}var e=t.zero=new t(0,0);e.toNumber=function(){return 0},e.zzEncode=e.zzDecode=function(){return this},e.length=function(){return 1};var r=t.zeroHash="\0\0\0\0\0\0\0\0";t.fromNumber=function(u){if(u===0)return e;var l=u<0;l&&(u=-u);var c=u>>>0,f=(u-c)/4294967296>>>0;return l&&(f=~f>>>0,c=~c>>>0,++c>4294967295&&(c=0,++f>4294967295&&(f=0))),new t(c,f)},t.from=function(u){if(typeof u=="number")return t.fromNumber(u);if(n.isString(u))if(n.Long)u=n.Long.fromString(u);else return t.fromNumber(parseInt(u,10));return u.low||u.high?new t(u.low>>>0,u.high>>>0):e},t.prototype.toNumber=function(u){if(!u&&this.hi>>>31){var l=~this.lo+1>>>0,c=~this.hi>>>0;return l||(c=c+1>>>0),-(l+c*4294967296)}return this.lo+this.hi*4294967296},t.prototype.toLong=function(u){return n.Long?new n.Long(this.lo|0,this.hi|0,!!u):{low:this.lo|0,high:this.hi|0,unsigned:!!u}};var o=String.prototype.charCodeAt;return t.fromHash=function(u){return u===r?e:new t((o.call(u,0)|o.call(u,1)<<8|o.call(u,2)<<16|o.call(u,3)<<24)>>>0,(o.call(u,4)|o.call(u,5)<<8|o.call(u,6)<<16|o.call(u,7)<<24)>>>0)},t.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},t.prototype.zzEncode=function(){var u=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^u)>>>0,this.lo=(this.lo<<1^u)>>>0,this},t.prototype.zzDecode=function(){var u=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^u)>>>0,this.hi=(this.hi>>>1^u)>>>0,this},t.prototype.length=function(){var u=this.lo,l=(this.lo>>>28|this.hi<<4)>>>0,c=this.hi>>>24;return c===0?l===0?u<16384?u<128?1:2:u<2097152?3:4:l<16384?l<128?5:6:l<2097152?7:8:c<128?9:10},longbits}var hasRequiredMinimal$1;function requireMinimal$1(){return hasRequiredMinimal$1||(hasRequiredMinimal$1=1,(function(n){var t=n;t.asPromise=requireAspromise(),t.base64=requireBase64(),t.EventEmitter=requireEventemitter(),t.float=requireFloat(),t.inquire=requireInquire(),t.utf8=requireUtf8(),t.pool=requirePool(),t.LongBits=requireLongbits(),t.isNode=!!(typeof commonjsGlobal!="undefined"&&commonjsGlobal&&commonjsGlobal.process&&commonjsGlobal.process.versions&&commonjsGlobal.process.versions.node),t.global=t.isNode&&commonjsGlobal||typeof window!="undefined"&&window||typeof self!="undefined"&&self||minimal$1,t.emptyArray=Object.freeze?Object.freeze([]):[],t.emptyObject=Object.freeze?Object.freeze({}):{},t.isInteger=Number.isInteger||function(s){return typeof s=="number"&&isFinite(s)&&Math.floor(s)===s},t.isString=function(s){return typeof s=="string"||s instanceof String},t.isObject=function(s){return s&&typeof s=="object"},t.isset=t.isSet=function(s,u){var l=s[u];return l!=null&&s.hasOwnProperty(u)?typeof l!="object"||(Array.isArray(l)?l.length:Object.keys(l).length)>0:!1},t.Buffer=(function(){try{var o=t.inquire("buffer").Buffer;return o.prototype.utf8Write?o:null}catch(s){return null}})(),t._Buffer_from=null,t._Buffer_allocUnsafe=null,t.newBuffer=function(s){return typeof s=="number"?t.Buffer?t._Buffer_allocUnsafe(s):new t.Array(s):t.Buffer?t._Buffer_from(s):typeof Uint8Array=="undefined"?s:new Uint8Array(s)},t.Array=typeof Uint8Array!="undefined"?Uint8Array:Array,t.Long=t.global.dcodeIO&&t.global.dcodeIO.Long||t.global.Long||t.inquire("long"),t.key2Re=/^true|false|0|1$/,t.key32Re=/^-?(?:0|[1-9][0-9]*)$/,t.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,t.longToHash=function(s){return s?t.LongBits.from(s).toHash():t.LongBits.zeroHash},t.longFromHash=function(s,u){var l=t.LongBits.fromHash(s);return t.Long?t.Long.fromBits(l.lo,l.hi,u):l.toNumber(!!u)};function e(o,s,u){for(var l=Object.keys(s),c=0;c<l.length;++c)(o[l[c]]===void 0||!u)&&(o[l[c]]=s[l[c]]);return o}t.merge=e,t.lcFirst=function(s){return s.charAt(0).toLowerCase()+s.substring(1)};function r(o){function s(u,l){if(!(this instanceof s))return new s(u,l);Object.defineProperty(this,"message",{get:function(){return u}}),Error.captureStackTrace?Error.captureStackTrace(this,s):Object.defineProperty(this,"stack",{value:new Error().stack||""}),l&&e(this,l)}return s.prototype=Object.create(Error.prototype,{constructor:{value:s,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return o},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),s}t.newError=r,t.ProtocolError=r("ProtocolError"),t.oneOfGetter=function(s){for(var u={},l=0;l<s.length;++l)u[s[l]]=1;return function(){for(var c=Object.keys(this),f=c.length-1;f>-1;--f)if(u[c[f]]===1&&this[c[f]]!==void 0&&this[c[f]]!==null)return c[f]}},t.oneOfSetter=function(s){return function(u){for(var l=0;l<s.length;++l)s[l]!==u&&delete this[s[l]]}},t.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},t._configure=function(){var o=t.Buffer;if(!o){t._Buffer_from=t._Buffer_allocUnsafe=null;return}t._Buffer_from=o.from!==Uint8Array.from&&o.from||function(u,l){return new o(u,l)},t._Buffer_allocUnsafe=o.allocUnsafe||function(u){return new o(u)}}})(minimal$1)),minimal$1}var writer,hasRequiredWriter;function requireWriter(){if(hasRequiredWriter)return writer;hasRequiredWriter=1,writer=c;var n=requireMinimal$1(),t,e=n.LongBits,r=n.base64,o=n.utf8;function s(E,v,y){this.fn=E,this.len=v,this.next=void 0,this.val=y}function u(){}function l(E){this.head=E.head,this.tail=E.tail,this.len=E.len,this.next=E.states}function c(){this.len=0,this.head=new s(u,0,0),this.tail=this.head,this.states=null}var f=function(){return n.Buffer?function(){return(c.create=function(){return new t})()}:function(){return new c}};c.create=f(),c.alloc=function(v){return new n.Array(v)},n.Array!==Array&&(c.alloc=n.pool(c.alloc,n.Array.prototype.subarray)),c.prototype._push=function(v,y,b){return this.tail=this.tail.next=new s(v,y,b),this.len+=y,this};function p(E,v,y){v[y]=E&255}function d(E,v,y){for(;E>127;)v[y++]=E&127|128,E>>>=7;v[y]=E}function h(E,v){this.len=E,this.next=void 0,this.val=v}h.prototype=Object.create(s.prototype),h.prototype.fn=d,c.prototype.uint32=function(v){return this.len+=(this.tail=this.tail.next=new h((v=v>>>0)<128?1:v<16384?2:v<2097152?3:v<268435456?4:5,v)).len,this},c.prototype.int32=function(v){return v<0?this._push(g,10,e.fromNumber(v)):this.uint32(v)},c.prototype.sint32=function(v){return this.uint32((v<<1^v>>31)>>>0)};function g(E,v,y){for(;E.hi;)v[y++]=E.lo&127|128,E.lo=(E.lo>>>7|E.hi<<25)>>>0,E.hi>>>=7;for(;E.lo>127;)v[y++]=E.lo&127|128,E.lo=E.lo>>>7;v[y++]=E.lo}c.prototype.uint64=function(v){var y=e.from(v);return this._push(g,y.length(),y)},c.prototype.int64=c.prototype.uint64,c.prototype.sint64=function(v){var y=e.from(v).zzEncode();return this._push(g,y.length(),y)},c.prototype.bool=function(v){return this._push(p,1,v?1:0)};function A(E,v,y){v[y]=E&255,v[y+1]=E>>>8&255,v[y+2]=E>>>16&255,v[y+3]=E>>>24}c.prototype.fixed32=function(v){return this._push(A,4,v>>>0)},c.prototype.sfixed32=c.prototype.fixed32,c.prototype.fixed64=function(v){var y=e.from(v);return this._push(A,4,y.lo)._push(A,4,y.hi)},c.prototype.sfixed64=c.prototype.fixed64,c.prototype.float=function(v){return this._push(n.float.writeFloatLE,4,v)},c.prototype.double=function(v){return this._push(n.float.writeDoubleLE,8,v)};var m=n.Array.prototype.set?function(v,y,b){y.set(v,b)}:function(v,y,b){for(var _=0;_<v.length;++_)y[b+_]=v[_]};return c.prototype.bytes=function(v){var y=v.length>>>0;if(!y)return this._push(p,1,0);if(n.isString(v)){var b=c.alloc(y=r.length(v));r.decode(v,b,0),v=b}return this.uint32(y)._push(m,y,v)},c.prototype.string=function(v){var y=o.length(v);return y?this.uint32(y)._push(o.write,y,v):this._push(p,1,0)},c.prototype.fork=function(){return this.states=new l(this),this.head=this.tail=new s(u,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 s(u,0,0),this.len=0),this},c.prototype.ldelim=function(){var v=this.head,y=this.tail,b=this.len;return this.reset().uint32(b),b&&(this.tail.next=v.next,this.tail=y,this.len+=b),this},c.prototype.finish=function(){for(var v=this.head.next,y=this.constructor.alloc(this.len),b=0;v;)v.fn(v.val,y,b),b+=v.len,v=v.next;return y},c._configure=function(E){t=E,c.create=f(),t._configure()},writer}var writer_buffer,hasRequiredWriter_buffer;function requireWriter_buffer(){if(hasRequiredWriter_buffer)return writer_buffer;hasRequiredWriter_buffer=1,writer_buffer=e;var n=requireWriter();(e.prototype=Object.create(n.prototype)).constructor=e;var t=requireMinimal$1();function e(){n.call(this)}e._configure=function(){e.alloc=t._Buffer_allocUnsafe,e.writeBytesBuffer=t.Buffer&&t.Buffer.prototype instanceof Uint8Array&&t.Buffer.prototype.set.name==="set"?function(s,u,l){u.set(s,l)}:function(s,u,l){if(s.copy)s.copy(u,l,0,s.length);else for(var c=0;c<s.length;)u[l++]=s[c++]}},e.prototype.bytes=function(s){t.isString(s)&&(s=t._Buffer_from(s,"base64"));var u=s.length>>>0;return this.uint32(u),u&&this._push(e.writeBytesBuffer,u,s),this};function r(o,s,u){o.length<40?t.utf8.write(o,s,u):s.utf8Write?s.utf8Write(o,u):s.write(o,u)}return e.prototype.string=function(s){var u=t.Buffer.byteLength(s);return this.uint32(u),u&&this._push(r,u,s),this},e._configure(),writer_buffer}var reader,hasRequiredReader;function requireReader(){if(hasRequiredReader)return reader;hasRequiredReader=1,reader=s;var n=requireMinimal$1(),t,e=n.LongBits,r=n.utf8;function o(d,h){return RangeError("index out of range: "+d.pos+" + "+(h||1)+" > "+d.len)}function s(d){this.buf=d,this.pos=0,this.len=d.length}var u=typeof Uint8Array!="undefined"?function(h){if(h instanceof Uint8Array||Array.isArray(h))return new s(h);throw Error("illegal buffer")}:function(h){if(Array.isArray(h))return new s(h);throw Error("illegal buffer")},l=function(){return n.Buffer?function(g){return(s.create=function(m){return n.Buffer.isBuffer(m)?new t(m):u(m)})(g)}:u};s.create=l(),s.prototype._slice=n.Array.prototype.subarray||n.Array.prototype.slice,s.prototype.uint32=(function(){var h=4294967295;return function(){if(h=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(h=(h|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(h=(h|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(h=(h|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(h=(h|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return h;if((this.pos+=5)>this.len)throw this.pos=this.len,o(this,10);return h}})(),s.prototype.int32=function(){return this.uint32()|0},s.prototype.sint32=function(){var h=this.uint32();return h>>>1^-(h&1)|0};function c(){var d=new e(0,0),h=0;if(this.len-this.pos>4){for(;h<4;++h)if(d.lo=(d.lo|(this.buf[this.pos]&127)<<h*7)>>>0,this.buf[this.pos++]<128)return d;if(d.lo=(d.lo|(this.buf[this.pos]&127)<<28)>>>0,d.hi=(d.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return d;h=0}else{for(;h<3;++h){if(this.pos>=this.len)throw o(this);if(d.lo=(d.lo|(this.buf[this.pos]&127)<<h*7)>>>0,this.buf[this.pos++]<128)return d}return d.lo=(d.lo|(this.buf[this.pos++]&127)<<h*7)>>>0,d}if(this.len-this.pos>4){for(;h<5;++h)if(d.hi=(d.hi|(this.buf[this.pos]&127)<<h*7+3)>>>0,this.buf[this.pos++]<128)return d}else for(;h<5;++h){if(this.pos>=this.len)throw o(this);if(d.hi=(d.hi|(this.buf[this.pos]&127)<<h*7+3)>>>0,this.buf[this.pos++]<128)return d}throw Error("invalid varint encoding")}s.prototype.bool=function(){return this.uint32()!==0};function f(d,h){return(d[h-4]|d[h-3]<<8|d[h-2]<<16|d[h-1]<<24)>>>0}s.prototype.fixed32=function(){if(this.pos+4>this.len)throw o(this,4);return f(this.buf,this.pos+=4)},s.prototype.sfixed32=function(){if(this.pos+4>this.len)throw o(this,4);return f(this.buf,this.pos+=4)|0};function p(){if(this.pos+8>this.len)throw o(this,8);return new e(f(this.buf,this.pos+=4),f(this.buf,this.pos+=4))}return s.prototype.float=function(){if(this.pos+4>this.len)throw o(this,4);var h=n.float.readFloatLE(this.buf,this.pos);return this.pos+=4,h},s.prototype.double=function(){if(this.pos+8>this.len)throw o(this,4);var h=n.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,h},s.prototype.bytes=function(){var h=this.uint32(),g=this.pos,A=this.pos+h;if(A>this.len)throw o(this,h);if(this.pos+=h,Array.isArray(this.buf))return this.buf.slice(g,A);if(g===A){var m=n.Buffer;return m?m.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,g,A)},s.prototype.string=function(){var h=this.bytes();return r.read(h,0,h.length)},s.prototype.skip=function(h){if(typeof h=="number"){if(this.pos+h>this.len)throw o(this,h);this.pos+=h}else do if(this.pos>=this.len)throw o(this);while(this.buf[this.pos++]&128);return this},s.prototype.skipType=function(d){switch(d){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(d=this.uint32()&7)!==4;)this.skipType(d);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+d+" at offset "+this.pos)}return this},s._configure=function(d){t=d,s.create=l(),t._configure();var h=n.Long?"toLong":"toNumber";n.merge(s.prototype,{int64:function(){return c.call(this)[h](!1)},uint64:function(){return c.call(this)[h](!0)},sint64:function(){return c.call(this).zzDecode()[h](!1)},fixed64:function(){return p.call(this)[h](!0)},sfixed64:function(){return p.call(this)[h](!1)}})},reader}var reader_buffer,hasRequiredReader_buffer;function requireReader_buffer(){if(hasRequiredReader_buffer)return reader_buffer;hasRequiredReader_buffer=1,reader_buffer=e;var n=requireReader();(e.prototype=Object.create(n.prototype)).constructor=e;var t=requireMinimal$1();function e(r){n.call(this,r)}return e._configure=function(){t.Buffer&&(e.prototype._slice=t.Buffer.prototype.slice)},e.prototype.string=function(){var o=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+o,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+o,this.len))},e._configure(),reader_buffer}var rpc={},service,hasRequiredService;function requireService(){if(hasRequiredService)return service;hasRequiredService=1,service=t;var n=requireMinimal$1();(t.prototype=Object.create(n.EventEmitter.prototype)).constructor=t;function t(e,r,o){if(typeof e!="function")throw TypeError("rpcImpl must be a function");n.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=!!r,this.responseDelimited=!!o}return t.prototype.rpcCall=function e(r,o,s,u,l){if(!u)throw TypeError("request must be specified");var c=this;if(!l)return n.asPromise(e,c,r,o,s,u);if(!c.rpcImpl){setTimeout(function(){l(Error("already ended"))},0);return}try{return c.rpcImpl(r,o[c.requestDelimited?"encodeDelimited":"encode"](u).finish(),function(p,d){if(p)return c.emit("error",p,r),l(p);if(d===null){c.end(!0);return}if(!(d instanceof s))try{d=s[c.responseDelimited?"decodeDelimited":"decode"](d)}catch(h){return c.emit("error",h,r),l(h)}return c.emit("data",d,r),l(null,d)})}catch(f){c.emit("error",f,r),setTimeout(function(){l(f)},0);return}},t.prototype.end=function(r){return this.rpcImpl&&(r||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this},service}var hasRequiredRpc;function requireRpc(){return hasRequiredRpc||(hasRequiredRpc=1,(function(n){var t=n;t.Service=requireService()})(rpc)),rpc}var roots,hasRequiredRoots;function requireRoots(){return hasRequiredRoots||(hasRequiredRoots=1,roots={}),roots}var hasRequiredIndexMinimal;function requireIndexMinimal(){return hasRequiredIndexMinimal||(hasRequiredIndexMinimal=1,(function(n){var t=n;t.build="minimal",t.Writer=requireWriter(),t.BufferWriter=requireWriter_buffer(),t.Reader=requireReader(),t.BufferReader=requireReader_buffer(),t.util=requireMinimal$1(),t.rpc=requireRpc(),t.roots=requireRoots(),t.configure=e;function e(){t.util._configure(),t.Writer._configure(t.BufferWriter),t.Reader._configure(t.BufferReader)}e()})(indexMinimal)),indexMinimal}var minimal,hasRequiredMinimal;function requireMinimal(){return hasRequiredMinimal||(hasRequiredMinimal=1,minimal=requireIndexMinimal()),minimal}var minimalExports=requireMinimal();const $Reader$1=minimalExports.Reader,$util$1=minimalExports.util,$root$1=minimalExports.roots["@REALSEE/FIVE:five/model/loaders/protobuf/pbm.proto"]||(minimalExports.roots["@REALSEE/FIVE:five/model/loaders/protobuf/pbm.proto"]={}),Model$2=$root$1.Model=(()=>{function n(t){if(this.chunks=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.chunks=$util$1.emptyArray,n.prototype.createAt=$util$1.Long?$util$1.Long.fromBits(0,0,!0):0,n.prototype.description="",n.decode=function(e,r,o){e instanceof $Reader$1||(e=$Reader$1.create(e));let s=r===void 0?e.len:e.pos+r,u=new $root$1.Model;for(;e.pos<s;){let l=e.uint32();if(l===o)break;switch(l>>>3){case 1:{u.chunks&&u.chunks.length||(u.chunks=[]),u.chunks.push($root$1.Chunk.decode(e,e.uint32()));break}case 2:{u.createAt=e.uint64();break}case 3:{u.description=e.string();break}default:e.skipType(l&7);break}}return u},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Model"},n})();$root$1.Chunk=(()=>{function n(t){if(t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.vertices=null,n.prototype.faces=null,n.prototype.name="",n.prototype.texture="",n.decode=function(e,r,o){e instanceof $Reader$1||(e=$Reader$1.create(e));let s=r===void 0?e.len:e.pos+r,u=new $root$1.Chunk;for(;e.pos<s;){let l=e.uint32();if(l===o)break;switch(l>>>3){case 1:{u.vertices=$root$1.Vertices.decode(e,e.uint32());break}case 2:{u.faces=$root$1.Faces.decode(e,e.uint32());break}case 3:{u.name=e.string();break}case 4:{u.texture=e.string();break}default:e.skipType(l&7);break}}if(!u.hasOwnProperty("vertices"))throw $util$1.ProtocolError("missing required 'vertices'",{instance:u});if(!u.hasOwnProperty("faces"))throw $util$1.ProtocolError("missing required 'faces'",{instance:u});if(!u.hasOwnProperty("name"))throw $util$1.ProtocolError("missing required 'name'",{instance:u});return u},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Chunk"},n})();$root$1.Vertices=(()=>{function n(t){if(this.xyz=[],this.uvs=[],this.marks=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.xyz=$util$1.emptyArray,n.prototype.uvs=$util$1.emptyArray,n.prototype.marks=$util$1.emptyArray,n.decode=function(e,r,o){e instanceof $Reader$1||(e=$Reader$1.create(e));let s=r===void 0?e.len:e.pos+r,u=new $root$1.Vertices;for(;e.pos<s;){let l=e.uint32();if(l===o)break;switch(l>>>3){case 1:{if(u.xyz&&u.xyz.length||(u.xyz=[]),(l&7)===2){let c=e.uint32()+e.pos;for(;e.pos<c;)u.xyz.push(e.float())}else u.xyz.push(e.float());break}case 2:{if(u.uvs&&u.uvs.length||(u.uvs=[]),(l&7)===2){let c=e.uint32()+e.pos;for(;e.pos<c;)u.uvs.push(e.float())}else u.uvs.push(e.float());break}case 3:{if(u.marks&&u.marks.length||(u.marks=[]),(l&7)===2){let c=e.uint32()+e.pos;for(;e.pos<c;)u.marks.push(e.int32())}else u.marks.push(e.int32());break}default:e.skipType(l&7);break}}return u},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Vertices"},n})();$root$1.Faces=(()=>{function n(t){if(this.indices=[],this.normals=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.indices=$util$1.emptyArray,n.prototype.normals=$util$1.emptyArray,n.decode=function(e,r,o){e instanceof $Reader$1||(e=$Reader$1.create(e));let s=r===void 0?e.len:e.pos+r,u=new $root$1.Faces;for(;e.pos<s;){let l=e.uint32();if(l===o)break;switch(l>>>3){case 1:{if(u.indices&&u.indices.length||(u.indices=[]),(l&7)===2){let c=e.uint32()+e.pos;for(;e.pos<c;)u.indices.push(e.uint32())}else u.indices.push(e.uint32());break}case 2:{if(u.normals&&u.normals.length||(u.normals=[]),(l&7)===2){let c=e.uint32()+e.pos;for(;e.pos<c;)u.normals.push(e.float())}else u.normals.push(e.float());break}default:e.skipType(l&7);break}}return u},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Faces"},n})();$root$1.VertexMark=(()=>{const n={},t=Object.create(n);return t[n[0]="VERTEX_MARK_UNSPECIFIED"]=0,t[n[1]="VERTEX_MARK_ROOF"]=1,t})();function fixNumber(n){return isNaN(n)||!isFinite(n)?0:n}function getGeometryMemoryUsed(n){var t=0;if(n instanceof THREE__namespace.BufferGeometry){for(var e in n.attributes){var r=n.getAttribute(e),o=4;"BYTES_PER_ELEMENT"in r.array&&typeof r.array.BYTES_PER_ELEMENT=="number"&&(o=r.array.BYTES_PER_ELEMENT),t+=fixNumber(r.count*r.itemSize*o)}var s=n.getIndex();if(s){var o=4;"BYTES_PER_ELEMENT"in s.array&&typeof s.array.BYTES_PER_ELEMENT=="number"&&(o=s.array.BYTES_PER_ELEMENT),t+=fixNumber(s.count*s.itemSize*o)}}else n instanceof THREE__namespace.Geometry&&(t+=fixNumber(n.faces.length*3*3*4),t+=fixNumber(n.faceVertexUvs.length*3*2*4));return t}function makeComputeBlockRectSizeFunction(n,t,e){return function(r,o,s){var u=(r+n-1)/n|0,l=(o+t-1)/t|0;return u*l*e*s}}function makeComputePaddedRectSizeFunction(n,t,e){return function(r,o,s){return(Math.max(r,n)*Math.max(o,t)/e|0)*s}}var compressedTextureFunctions=new Map([[THREE__namespace.RGB_S3TC_DXT1_Format,makeComputeBlockRectSizeFunction(4,4,8)],[THREE__namespace.RGBA_S3TC_DXT1_Format,makeComputeBlockRectSizeFunction(4,4,8)],[THREE__namespace.RGBA_S3TC_DXT3_Format,makeComputeBlockRectSizeFunction(4,4,16)],[THREE__namespace.RGBA_S3TC_DXT5_Format,makeComputeBlockRectSizeFunction(4,4,16)],[THREE__namespace.RGB_ETC1_Format,makeComputeBlockRectSizeFunction(4,4,8)],[THREE__namespace.RGB_PVRTC_4BPPV1_Format,makeComputePaddedRectSizeFunction(8,8,2)],[THREE__namespace.RGBA_PVRTC_4BPPV1_Format,makeComputePaddedRectSizeFunction(8,8,2)],[THREE__namespace.RGB_PVRTC_2BPPV1_Format,makeComputePaddedRectSizeFunction(16,8,4)],[THREE__namespace.RGBA_PVRTC_2BPPV1_Format,makeComputePaddedRectSizeFunction(16,8,4)],[THREE__namespace.RGB_ETC2_Format,makeComputeBlockRectSizeFunction(4,4,8)],[THREE__namespace.RGBA_ETC2_EAC_Format,makeComputeBlockRectSizeFunction(4,4,16)],[THREE__namespace.RGBA_ASTC_4x4_Format,makeComputeBlockRectSizeFunction(4,4,16)],[THREE__namespace.SRGB8_ALPHA8_ASTC_4x4_Format,makeComputeBlockRectSizeFunction(4,4,16)],[THREE__namespace.RGBA_ASTC_5x4_Format,makeComputeBlockRectSizeFunction(5,4,16)],[THREE__namespace.SRGB8_ALPHA8_ASTC_5x4_Format,makeComputeBlockRectSizeFunction(5,4,16)],[THREE__namespace.RGBA_ASTC_5x5_Format,makeComputeBlockRectSizeFunction(5,5,16)],[THREE__namespace.SRGB8_ALPHA8_ASTC_5x5_Format,makeComputeBlockRectSizeFunction(5,5,16)],[THREE__namespace.RGBA_ASTC_6x5_Format,makeComputeBlockRectSizeFunction(6,5,16)],[THREE__namespace.SRGB8_ALPHA8_ASTC_6x5_Format,makeComputeBlockRectSizeFunction(6,5,16)],[THREE__namespace.RGBA_ASTC_6x6_Format,makeComputeBlockRectSizeFunction(6,6,16)],[THREE__namespace.SRGB8_ALPHA8_ASTC_6x6_Format,makeComputeBlockRectSizeFunction(6,6,16)],[THREE__namespace.RGBA_ASTC_8x5_Format,makeComputeBlockRectSizeFunction(8,5,16)],[THREE__namespace.SRGB8_ALPHA8_ASTC_8x5_Format,makeComputeBlockRectSizeFunction(8,5,16)],[THREE__namespace.RGBA_ASTC_8x6_Format,makeComputeBlockRectSizeFunction(8,6,16)],[THREE__namespace.SRGB8_ALPHA8_ASTC_8x6_Format,makeComputeBlockRectSizeFunction(8,6,16)],[THREE__namespace.RGBA_ASTC_8x8_Format,makeComputeBlockRectSizeFunction(8,8,16)],[THREE__namespace.SRGB8_ALPHA8_ASTC_8x8_Format,makeComputeBlockRectSizeFunction(8,8,16)],[THREE__namespace.RGBA_ASTC_10x5_Format,makeComputeBlockRectSizeFunction(10,5,16)],[THREE__namespace.SRGB8_ALPHA8_ASTC_10x5_Format,makeComputeBlockRectSizeFunction(10,5,16)],[THREE__namespace.RGBA_ASTC_10x6_Format,makeComputeBlockRectSizeFunction(10,6,16)],[THREE__namespace.SRGB8_ALPHA8_ASTC_10x6_Format,makeComputeBlockRectSizeFunction(10,6,16)],[THREE__namespace.RGBA_ASTC_10x8_Format,makeComputeBlockRectSizeFunction(10,8,16)],[THREE__namespace.SRGB8_ALPHA8_ASTC_10x8_Format,makeComputeBlockRectSizeFunction(10,8,16)],[THREE__namespace.RGBA_ASTC_10x10_Format,makeComputeBlockRectSizeFunction(10,10,16)],[THREE__namespace.SRGB8_ALPHA8_ASTC_10x10_Format,makeComputeBlockRectSizeFunction(10,10,16)],[THREE__namespace.RGBA_ASTC_12x10_Format,makeComputeBlockRectSizeFunction(12,10,16)],[THREE__namespace.SRGB8_ALPHA8_ASTC_12x10_Format,makeComputeBlockRectSizeFunction(12,10,16)],[THREE__namespace.RGBA_ASTC_12x12_Format,makeComputeBlockRectSizeFunction(12,12,16)],[THREE__namespace.SRGB8_ALPHA8_ASTC_12x12_Format,makeComputeBlockRectSizeFunction(12,12,16)],[THREE__namespace.RGBA_BPTC_Format,makeComputeBlockRectSizeFunction(4,4,16)]]);function getTextureMemoryUsed(n){var t=0,e=1;(n.generateMipmaps===!0||n.mipmaps&&n.mipmaps.length>1)&&(e=1.33);for(var r=n instanceof THREE__namespace.CompressedTexture,o=r?compressedTextureFunctions.get(n.format):void 0,s=[].concat(n.image),u=0,l=s;u<l.length;u++){var c=l[u];if(c)if(c instanceof THREE__namespace.Texture)t+=getTextureMemoryUsed(c);else{var f=c.width,p=f===void 0?1:f,d=c.height,h=d===void 0?1:d,g=c.depth,A=g===void 0?1:g;o?t+=fixNumber(o(p,h,A)*e):t+=fixNumber(p*h*A*4*e)}}return t}var textureSet=new Set,textureNames=["map","alphaMap","bumpMap","normalMap","displacementMap","emissiveMap","specularMap","envMap","flipEnvMap","lightMap","aoMap","gradientMap","metalnessMap","roughnessMap","sheenColorMap","sheenRoughnessMap","clearcoatMap","clearcoatRoughnessMap","clearcoatNormalMap","iridescenceMap","iridescenceThicknessMap","transmissionMap","thicknessMap","anisotropyMap","specularColorMap","specularIntensityMap"];function getMaterialMemoryUsed(n){var t=0;if(textureSet.clear(),n instanceof THREE__namespace.ShaderMaterial)for(var e in n.uniforms){var r=n.uniforms[e],o=r&&r.value&&r.value instanceof THREE__namespace.Texture?r.value:void 0;o instanceof THREE__namespace.Texture&&(textureSet.has(o)||(t=getTextureMemoryUsed(o),textureSet.add(o)))}else for(var s=0,u=textureNames;s<u.length;s++){var l=u[s],o=n[l];o instanceof THREE__namespace.Texture&&(textureSet.has(o)||(t=getTextureMemoryUsed(o),textureSet.add(o)))}return textureSet.clear(),t}var sceneSet=new Set;function getMemoryUsage(n){var t=0;return sceneSet.clear(),n.traverse(function(e){if(e instanceof THREE__namespace.Mesh||e instanceof THREE__namespace.Line||e instanceof THREE__namespace.Points){var r=e.geometry;(r instanceof THREE__namespace.BufferGeometry||r instanceof THREE__namespace.Geometry)&&(sceneSet.has(r)||(t+=getGeometryMemoryUsed(r),sceneSet.add(r)));for(var o=[].concat(e.material),s=0,u=o;s<u.length;s++){var l=u[s];l instanceof THREE__namespace.Material&&(sceneSet.has(l)||(t+=getMaterialMemoryUsed(l),sceneSet.add(l)))}}}),sceneSet.clear(),t}function guessTextureBaseUriFromFileUrl(n){var t=n.lastIndexOf("/");if(t>=0){var e=n.slice(0,t+1),r=e.replace(/\/(model)(\/|$)/,function(o,s,u){return"/materials"+u});return r}return""}function loadPbm(n,t){var e,r,o,s,u,l;t===void 0&&(t={});for(var c=(e=t.upAxis)!==null&&e!==void 0?e:"Z",f=(r=t.light)!==null&&r!==void 0?r:!1,p=(o=t.fetcher)!==null&&o!==void 0?o:internalFetcher,d=(s=t.textureBaseUri)!==null&&s!==void 0?s:guessTextureBaseUriFromFileUrl(n),h=((u=t.textureArray)!==null&&u!==void 0?u:[]).slice(),g=autoRestImageOptionsByTextureLength((l=t.textureOptions)!==null&&l!==void 0?l:{},h.length),A={},m=0,E=h;m<E.length;m++){var v=E[m];A[v]=loadTexture$1(v,d,g,p)}var y={byteLength:0};return Promise.resolve().then(function(){return p.ajax(n,{responseType:"arraybuffer"})}).then(function(b){return y.byteLength=b.body.byteLength,delay$1(function(){var _=new Uint8Array(b.body);return Model$2.decode(_)})}).then(function(b){return delay$1(function(){return parse$4(b,f,d,h,g,A,p)})}).then(function(b){var _=new THREE__namespace.Group;_.name=n;for(var T=0,S=b.objects;T<S.length;T++){var R=S[T];_.add(R)}return c==="Y"&&_.applyMatrix4(ROTATE_X_MATRIX_INVERSE),{type:"pbm",modelUpAxis:"Z",upAxis:c,uri:n,byteLength:y.byteLength,memoryUsage:getMemoryUsage(_),scene:_,textures:b.textures,animations:[],dispose:function(){return b.dispose()}}})}function parseFloorName(n){var t=n.match(/(group|floor)-?(\d+)/);return t?parseInt(t[2],10):0}function parseChunkName(n){var t=n.match(/(chunk)-?(\d+)/);return t?parseInt(t[2],10):0}function parseSubName(n){var t=n.match(/(sub)-?(\d+)/);return t?parseInt(t[2],10):0}function chunkOrder(n){var t=parseFloorName(n.name),e=parseChunkName(n.name),r=parseSubName(n.name);return t*1e6+e*1e3+r}function parsePBMModel(n){for(var t,e,r,o=typeof n.createAt=="number"?n.createAt:0,s=(t=n.description)!==null&&t!==void 0?t:"",u=[],l=!0,c=!0,f=0,p=n.chunks;f<p.length;f++){var d=p[f];if(!d.vertices.marks||d.vertices.marks.length===0){c=!1;break}}for(var h=0,g=n.chunks;h<g.length;h++){var d=g[h];if(!d.faces.normals||d.faces.normals.length===0){l=!1;break}}for(var A=n.chunks.sort(function(pe,oe){return chunkOrder(pe)-chunkOrder(oe)}),m=[],E=0,v=A;E<v.length;E++){var d=v[E],y=parseFloorName(d.name);m[y]||(m[y]=[]),m[y].push(d)}for(var b=0;b<m.length;b++){var _=m[b];if(_)if(l){for(var T=0,S=0;S<_.length;S++){var d=_[S];T+=d.faces.indices.length}for(var R=new Float32Array(T*3),w=new Float32Array(T*2),M=new Float32Array(T*3),B=c?new Float32Array(T):void 0,C=[],P=[1/0,1/0,1/0,-1/0,-1/0,-1/0],F=0,L=0;L<_.length;L++){for(var O=[1/0,1/0,1/0,-1/0,-1/0,-1/0],d=_[L],k=d.vertices.xyz,D=d.vertices.uvs,J=d.faces.indices,G=d.faces.normals,U=d.vertices.marks,z=J.length,S=0;S<z;S++){var q=J[S],j=R[F*3+S*3]=k[q*3],K=R[F*3+S*3+1]=k[q*3+1],Y=R[F*3+S*3+2]=k[q*3+2];B&&(B[F+S]=U[q]),w[F*2+S*2]=D[q*2],w[F*2+S*2+1]=D[q*2+1];var X=Math.floor(S/3)*3;M[F*3+S*3]=G[X],M[F*3+S*3+1]=G[X+1],M[F*3+S*3+2]=G[X+2],j<O[0]&&(O[0]=j),K<O[1]&&(O[1]=K),Y<O[2]&&(O[2]=Y),j>O[3]&&(O[3]=j),K>O[4]&&(O[4]=K),Y>O[5]&&(O[5]=Y)}O[0]<P[0]&&(P[0]=O[0]),O[1]<P[1]&&(P[1]=O[1]),O[2]<P[2]&&(P[2]=O[2]),O[3]>P[3]&&(P[3]=O[3]),O[4]>P[4]&&(P[4]=O[4]),O[5]>P[5]&&(P[5]=O[5]),C.push({materialIndex:L,name:d.name,chunkName:parseChunkName(d.name),start:F,count:d.faces.indices.length,texture:(e=d.texture)!==null&&e!==void 0?e:void 0}),F+=z}var Q={createAt:o,description:s,vertices:R,uvs:w,normals:M,masks:B,indices:null,floorIndex:b,groups:C,extents:P};u.push(Q)}else{for(var T=0,W=0,S=0;S<_.length;S++){var d=_[S];W+=d.vertices.xyz.length/3,T+=d.faces.indices.length}for(var R=new Float32Array(W*3),w=new Float32Array(W*2),M=void 0,$=new Float32Array(W),ie=new Uint32Array(T),B=c?new Float32Array(T):void 0,C=[],P=[1/0,1/0,1/0,-1/0,-1/0,-1/0],ee=0,F=0,L=0;L<_.length;L++){for(var O=[1/0,1/0,1/0,-1/0,-1/0,-1/0],d=_[L],k=d.vertices.xyz,ne=d.vertices.marks,D=d.vertices.uvs,J=d.faces.indices,te=k.length/3,z=J.length,S=0;S<te;S++){var j=R[F*3+S*3]=k[S*3],K=R[F*3+S*3+1]=k[S*3+1],Y=R[F*3+S*3+2]=k[S*3+2];B&&(B[F+S]=ne[S]),w[F*2+S*2]=D[S*2],w[F*2+S*2+1]=D[S*2+1],$[F+S]=b,j<O[0]&&(O[0]=j),K<O[1]&&(O[1]=K),Y<O[2]&&(O[2]=Y),j>O[3]&&(O[3]=j),K>O[4]&&(O[4]=K),Y>O[5]&&(O[5]=Y)}O[0]<P[0]&&(P[0]=O[0]),O[1]<P[1]&&(P[1]=O[1]),O[2]<P[2]&&(P[2]=O[2]),O[3]>P[3]&&(P[3]=O[3]),O[4]>P[4]&&(P[4]=O[4]),O[5]>P[5]&&(P[5]=O[5]);for(var S=0;S<z;S++)ie[ee+S]=F+J[S];C.push({materialIndex:L,name:d.name,chunkName:parseChunkName(d.name),start:ee,count:d.faces.indices.length,texture:(r=d.texture)!==null&&r!==void 0?r:void 0}),F+=te,ee+=z}var Q={createAt:o,description:s,vertices:R,uvs:w,normals:M,masks:B,indices:ie,floorIndex:b,groups:C,extents:P};u.push(Q)}}return u}function loadTexture$1(n,t,e,r){var o=__assign({key:"texture.pbm"},pick(e,["format","quality","size","sharpen","mappings"])),s=new TextureLoader,u=isAbsoluteURL(n)?n:pathJoin(t,n),l=s.loadTexture(u,{imageURL:{transform:e.transform,options:o},encoding:THREE__namespace.sRGBEncoding,wrapS:THREE__namespace.ClampToEdgeWrapping,wrapT:THREE__namespace.ClampToEdgeWrapping,minFilter:THREE__namespace.LinearFilter,maxSize:typeof o.size=="number"?new THREE__namespace.Vector2(o.size,o.size):void 0,fetcher:r}).then(function(c){var f=c.body;return f.needsUpdate=!0,f});return Object.assign(l,{url:u,textureOptions:e})}function parse$4(n,t,e,r,o,s,u){s===void 0&&(s={});for(var l=parsePBMModel(n),c=0,f="",p=[],d={},h=new Set,g=0,A=0,m=l;A<m.length;A++){var E=m[A],v=E.createAt,y=E.description,b=E.vertices,_=E.masks,T=E.uvs,S=E.normals,R=E.indices,w=E.floorIndex,M=E.groups,B=E.extents,C=new THREE__namespace.Box3;C.min.x=B[0],C.min.y=B[1],C.min.z=B[2],C.max.x=B[3],C.max.y=B[4],C.max.z=B[5];var P=new THREE__namespace.BufferGeometry;P.setAttribute("position",new THREE__namespace.BufferAttribute(b,3)),P.setAttribute("uv",new THREE__namespace.BufferAttribute(T,2)),S&&P.setAttribute("normal",new THREE__namespace.BufferAttribute(S,3)),_&&P.setAttribute("_feature_id_rsmask",new THREE__namespace.BufferAttribute(_,1)),R&&P.setIndex(new THREE__namespace.BufferAttribute(R,1)),P.boundingBox=C,P.boundingSphere=C.getBoundingSphere(new THREE__namespace.Sphere);for(var F=0,L=M;F<L.length;F++){var O=L[F];P.addGroup(O.start,O.count,O.materialIndex)}h.add(P);for(var k=[],D=0,J=M;D<J.length;D++){var O=J[D],G=r[O.chunkName]||(O.texture?pathJoin(e||"",O.texture):void 0),U=new PBMMeshMaterial(t?"phong":"basic");U.floorIndex=w,P.attributes.normal===void 0&&(U.flatShading=!0),P.attributes._feature_id_rsmask&&(U.defines.USE_VERTEX_MARK=!0),k.push(U),G?(g++,d[G]?d[G].push(U):d[G]=[U]):U.color=new THREE__namespace.Color(16777215),h.add(U)}var z=new PBMMesh(P,k);z.name="model_floor_"+w,z.userData.createAt=v,z.userData.description=y,z.matrix.compose(z.position,z.quaternion,z.scale),z.matrixAutoUpdate=!1,z.frustumCulled=!1,c=v,f=y,p.push(z)}var q=function(j){j=autoRestImageOptionsByTextureLength(j,g);for(var K=[],Y=function($){var ie=null;$ in s&&(ie=s[$]),ie||(ie=loadTexture$1($,e,j,u)),K.push(ie.then(function(ee){for(var ne=0,te=d[$];ne<te.length;ne++){var pe=te[ne];pe.map&&(h.delete(pe.map),pe.map.dispose()),pe.map=ee,h.add(ee)}return ee}).catch(function(){for(var ee=0,ne=d[$];ee<ne.length;ee++){var te=ne[ee];te.map&&(h.delete(te.map),te.map.dispose()),te.map=null,te.color=new THREE__namespace.Color(16777215)}return null}))},X=0,Q=Object.keys(d);X<Q.length;X++){var W=Q[X];Y(W)}for(var W in s)delete s[W];return Promise.all(K).then(function($){return $.filter(function(ie){return ie})})};return q(o).then(function(j){return{createAt:c,description:f,objects:p,textures:j,dispose:function(){h.forEach(function(K){K.dispose()}),h.clear()}}})}function autoRestImageOptionsByTextureLength(n,t){return n=Object.assign({},n),n.autoResize!==!1&&(t>96?n.size=Math.min(n.size||1/0,100):t>48?n.size=Math.min(n.size||1/0,200):t>24?n.size=Math.min(n.size||1/0,400):t>22?n.size=Math.min(n.size||1/0,800):t>5&&(n.size=Math.min(n.size||1/0,1024))),n}function createLZMA(){var n={};return n.OutWindow=function(){this._windowSize=0},n.OutWindow.prototype.create=function(t){(!this._buffer||this._windowSize!==t)&&(this._buffer=[]),this._windowSize=t,this._pos=0,this._streamPos=0},n.OutWindow.prototype.flush=function(){var t=this._pos-this._streamPos;if(t!==0){for(;t--;)this._stream.writeByte(this._buffer[this._streamPos++]);this._pos>=this._windowSize&&(this._pos=0),this._streamPos=this._pos}},n.OutWindow.prototype.releaseStream=function(){this.flush(),this._stream=null},n.OutWindow.prototype.setStream=function(t){this.releaseStream(),this._stream=t},n.OutWindow.prototype.init=function(t){t||(this._streamPos=0,this._pos=0)},n.OutWindow.prototype.copyBlock=function(t,e){var r=this._pos-t-1;for(r<0&&(r+=this._windowSize);e--;)r>=this._windowSize&&(r=0),this._buffer[this._pos++]=this._buffer[r++],this._pos>=this._windowSize&&this.flush()},n.OutWindow.prototype.putByte=function(t){this._buffer[this._pos++]=t,this._pos>=this._windowSize&&this.flush()},n.OutWindow.prototype.getByte=function(t){var e=this._pos-t-1;return e<0&&(e+=this._windowSize),this._buffer[e]},n.RangeDecoder=function(){},n.RangeDecoder.prototype.setStream=function(t){this._stream=t},n.RangeDecoder.prototype.releaseStream=function(){this._stream=null},n.RangeDecoder.prototype.init=function(){var t=5;for(this._code=0,this._range=-1;t--;)this._code=this._code<<8|this._stream.readByte()},n.RangeDecoder.prototype.decodeDirectBits=function(t){for(var e=0,r=t,o;r--;)this._range>>>=1,o=this._code-this._range>>>31,this._code-=this._range&o-1,e=e<<1|1-o,(this._range&4278190080)===0&&(this._code=this._code<<8|this._stream.readByte(),this._range<<=8);return e},n.RangeDecoder.prototype.decodeBit=function(t,e){var r=t[e],o=(this._range>>>11)*r;return(this._code^2147483648)<(o^2147483648)?(this._range=o,t[e]+=2048-r>>>5,(this._range&4278190080)===0&&(this._code=this._code<<8|this._stream.readByte(),this._range<<=8),0):(this._range-=o,this._code-=o,t[e]-=r>>>5,(this._range&4278190080)===0&&(this._code=this._code<<8|this._stream.readByte(),this._range<<=8),1)},n.initBitModels=function(t,e){for(;e--;)t[e]=1024},n.BitTreeDecoder=function(t){this._models=[],this._numBitLevels=t},n.BitTreeDecoder.prototype.init=function(){n.initBitModels(this._models,1<<this._numBitLevels)},n.BitTreeDecoder.prototype.decode=function(t){for(var e=1,r=this._numBitLevels;r--;)e=e<<1|t.decodeBit(this._models,e);return e-(1<<this._numBitLevels)},n.BitTreeDecoder.prototype.reverseDecode=function(t){for(var e=1,r=0,o=0,s;o<this._numBitLevels;++o)s=t.decodeBit(this._models,e),e=e<<1|s,r|=s<<o;return r},n.reverseDecode2=function(t,e,r,o){for(var s=1,u=0,l=0,c;l<o;++l)c=r.decodeBit(t,e+s),s=s<<1|c,u|=c<<l;return u},n.LenDecoder=function(){this._choice=[],this._lowCoder=[],this._midCoder=[],this._highCoder=new n.BitTreeDecoder(8),this._numPosStates=0},n.LenDecoder.prototype.create=function(t){for(;this._numPosStates<t;++this._numPosStates)this._lowCoder[this._numPosStates]=new n.BitTreeDecoder(3),this._midCoder[this._numPosStates]=new n.BitTreeDecoder(3)},n.LenDecoder.prototype.init=function(){var t=this._numPosStates;for(n.initBitModels(this._choice,2);t--;)this._lowCoder[t].init(),this._midCoder[t].init();this._highCoder.init()},n.LenDecoder.prototype.decode=function(t,e){return t.decodeBit(this._choice,0)===0?this._lowCoder[e].decode(t):t.decodeBit(this._choice,1)===0?8+this._midCoder[e].decode(t):16+this._highCoder.decode(t)},n.Decoder2=function(){this._decoders=[]},n.Decoder2.prototype.init=function(){n.initBitModels(this._decoders,768)},n.Decoder2.prototype.decodeNormal=function(t){var e=1;do e=e<<1|t.decodeBit(this._decoders,e);while(e<256);return e&255},n.Decoder2.prototype.decodeWithMatchByte=function(t,e){var r=1,o,s;do if(o=e>>7&1,e<<=1,s=t.decodeBit(this._decoders,(1+o<<8)+r),r=r<<1|s,o!==s){for(;r<256;)r=r<<1|t.decodeBit(this._decoders,r);break}while(r<256);return r&255},n.LiteralDecoder=function(){},n.LiteralDecoder.prototype.create=function(t,e){var r;if(!(this._coders&&this._numPrevBits===e&&this._numPosBits===t))for(this._numPosBits=t,this._posMask=(1<<t)-1,this._numPrevBits=e,this._coders=[],r=1<<this._numPrevBits+this._numPosBits;r--;)this._coders[r]=new n.Decoder2},n.LiteralDecoder.prototype.init=function(){for(var t=1<<this._numPrevBits+this._numPosBits;t--;)this._coders[t].init()},n.LiteralDecoder.prototype.getDecoder=function(t,e){return this._coders[((t&this._posMask)<<this._numPrevBits)+((e&255)>>>8-this._numPrevBits)]},n.Decoder=function(){this._outWindow=new n.OutWindow,this._rangeDecoder=new n.RangeDecoder,this._isMatchDecoders=[],this._isRepDecoders=[],this._isRepG0Decoders=[],this._isRepG1Decoders=[],this._isRepG2Decoders=[],this._isRep0LongDecoders=[],this._posSlotDecoder=[],this._posDecoders=[],this._posAlignDecoder=new n.BitTreeDecoder(4),this._lenDecoder=new n.LenDecoder,this._repLenDecoder=new n.LenDecoder,this._literalDecoder=new n.LiteralDecoder,this._dictionarySize=-1,this._dictionarySizeCheck=-1,this._posSlotDecoder[0]=new n.BitTreeDecoder(6),this._posSlotDecoder[1]=new n.BitTreeDecoder(6),this._posSlotDecoder[2]=new n.BitTreeDecoder(6),this._posSlotDecoder[3]=new n.BitTreeDecoder(6)},n.Decoder.prototype.setDictionarySize=function(t){return t<0?!1:(this._dictionarySize!==t&&(this._dictionarySize=t,this._dictionarySizeCheck=Math.max(this._dictionarySize,1),this._outWindow.create(Math.max(this._dictionarySizeCheck,4096))),!0)},n.Decoder.prototype.setLcLpPb=function(t,e,r){var o=1<<r;return t>8||e>4||r>4?!1:(this._literalDecoder.create(e,t),this._lenDecoder.create(o),this._repLenDecoder.create(o),this._posStateMask=o-1,!0)},n.Decoder.prototype.init=function(){var t=4;for(this._outWindow.init(!1),n.initBitModels(this._isMatchDecoders,192),n.initBitModels(this._isRep0LongDecoders,192),n.initBitModels(this._isRepDecoders,12),n.initBitModels(this._isRepG0Decoders,12),n.initBitModels(this._isRepG1Decoders,12),n.initBitModels(this._isRepG2Decoders,12),n.initBitModels(this._posDecoders,114),this._literalDecoder.init();t--;)this._posSlotDecoder[t].init();this._lenDecoder.init(),this._repLenDecoder.init(),this._posAlignDecoder.init(),this._rangeDecoder.init()},n.Decoder.prototype.decode=function(t,e,r){var o=0,s=0,u=0,l=0,c=0,f=0,p=0,d,h,g,A,m,E;for(this._rangeDecoder.setStream(t),this._outWindow.setStream(e),this.init();r<0||f<r;)if(d=f&this._posStateMask,this._rangeDecoder.decodeBit(this._isMatchDecoders,(o<<4)+d)===0)h=this._literalDecoder.getDecoder(f++,p),o>=7?p=h.decodeWithMatchByte(this._rangeDecoder,this._outWindow.getByte(s)):p=h.decodeNormal(this._rangeDecoder),this._outWindow.putByte(p),o=o<4?0:o-(o<10?3:6);else{if(this._rangeDecoder.decodeBit(this._isRepDecoders,o)===1)g=0,this._rangeDecoder.decodeBit(this._isRepG0Decoders,o)===0?this._rangeDecoder.decodeBit(this._isRep0LongDecoders,(o<<4)+d)===0&&(o=o<7?9:11,g=1):(this._rangeDecoder.decodeBit(this._isRepG1Decoders,o)===0?A=u:(this._rangeDecoder.decodeBit(this._isRepG2Decoders,o)===0?A=l:(A=c,c=l),l=u),u=s,s=A),g===0&&(g=2+this._repLenDecoder.decode(this._rangeDecoder,d),o=o<7?8:11);else if(c=l,l=u,u=s,g=2+this._lenDecoder.decode(this._rangeDecoder,d),o=o<7?7:10,m=this._posSlotDecoder[g<=5?g-2:3].decode(this._rangeDecoder),m>=4){if(E=(m>>1)-1,s=(2|m&1)<<E,m<14)s+=n.reverseDecode2(this._posDecoders,s-m-1,this._rangeDecoder,E);else if(s+=this._rangeDecoder.decodeDirectBits(E-4)<<4,s+=this._posAlignDecoder.reverseDecode(this._rangeDecoder),s<0){if(s===-1)break;return!1}}else s=m;if(s>=f||s>=this._dictionarySizeCheck)return!1;this._outWindow.copyBlock(s,g),f+=g,p=this._outWindow.getByte(0)}return this._outWindow.flush(),this._outWindow.releaseStream(),this._rangeDecoder.releaseStream(),!0},n.Decoder.prototype.setDecoderProperties=function(t){var e,r,o,s,u;return t.size<5||(e=t.readByte(),r=e%9,e=~~(e/9),o=e%5,s=~~(e/5),!this.setLcLpPb(r,o,s))?!1:(u=t.readByte(),u|=t.readByte()<<8,u|=t.readByte()<<16,u+=t.readByte()*16777216,this.setDictionarySize(u))},n.decompress=function(t,e,r,o){var s=new n.Decoder;if(!s.setDecoderProperties(t))throw"Incorrect stream properties";if(!s.decode(e,r,o))throw"Error in data stream";return!0},n.decompressFile=function(t,e){var r=new n.Decoder,o;if(!r.setDecoderProperties(t))throw"Incorrect stream properties";if(o=t.readByte(),o|=t.readByte()<<8,o|=t.readByte()<<16,o+=t.readByte()*16777216,t.readByte(),t.readByte(),t.readByte(),t.readByte(),!r.decode(t,e,o))throw"Error in data stream";return!0},n}var LZMA=createLZMA();function createWASM(){function n(e){for(var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=new Uint8Array(256),s=0;s<r.length;s++)o[r.charCodeAt(s)]=s;var u=e.length*.75,l=e.length,c,f=0,p,d,h,g;e[e.length-1]==="="&&(u--,e[e.length-2]==="="&&u--);var A=new ArrayBuffer(u),m=new Uint8Array(A);for(c=0;c<l;c+=4)p=o[e.charCodeAt(c)],d=o[e.charCodeAt(c+1)],h=o[e.charCodeAt(c+2)],g=o[e.charCodeAt(c+3)],m[f++]=p<<2|d>>4,m[f++]=(d&15)<<4|h>>2,m[f++]=(h&3)<<6|g&63;return A}var t="AGFzbQEAAAABSg1gAABgAX8Bf2ACf38Bf2AEf39/fwBgA39/fwBgAX8AYAJ/fwBgA39/fwF/YAR/f39/AX9gAn9/AGABfwF/YAABf2AEf39/fwF/AhsCA2VudgVhYm9ydAADA2VudgZtZW1vcnkCAAEDJiUBAQkKAgoKCwsLCwsAAgoBAgQKAQYFCAoFBQQEBwgCBwwCAQAABAQBcAABBhoFfwFBAAt/AUEAC38BQQALfwFBAAt/AUEACwc9BgZtZW1vcnkCAAV0YWJsZQEABXJlc2V0AA0KbmV3VThBcnJheQAQCnVucGFja1NpemUAFAZkZWNvZGUAIwgBJAkHAQBBAAsBJQqAViVoAQN/IABBgICAgARLBEAACyMBIgEgAEEBIABBAUsbakEHakF4cSICPwAiA0EQdEsEQCADIAIgAWtB//8DakGAgHxxQRB2IgAgAyAAShtAAEEASARAIABAAEEASARAAAsLCyACJAEgAQsbAQF/QQFBICAAQQdqZ2t0EAEiASAANgIAIAELkQMBAX8gAUUEQA8LIABBADoAACAAIAFqQQFrQQA6AAAgAUECTQRADwsgAEEBakEAOgAAIABBAmpBADoAACAAIAFqIgJBAmtBADoAACACQQNrQQA6AAAgAUEGTQRADwsgAEEDakEAOgAAIAAgAWpBBGtBADoAACABQQhNBEAPC0EAIABrQQNxIgIgAGoiAEEANgIAIAEgAmtBfHEiASAAakEEa0EANgIAIAFBCE0EQA8LIABBBGpBADYCACAAQQhqQQA2AgAgACABaiICQQxrQQA2AgAgAkEIa0EANgIAIAFBGE0EQA8LIABBDGpBADYCACAAQRBqQQA2AgAgAEEUakEANgIAIABBGGpBADYCACAAIAFqIgJBHGtBADYCACACQRhrQQA2AgAgAkEUa0EANgIAIAJBEGtBADYCACAAQQRxQRhqIgIgAGohACABIAJrIQEDQCABQSBPBEAgAEIANwMAIABBCGpCADcDACAAQRBqQgA3AwAgAEEYakIANwMAIAFBIGshASAAQSBqIQAMAQsLC1EBA38gAEH+////AEsEQEEAQSBBLUEnEAAACyAAQQJ0IgMQAiECQQgQASIBQQA2AgAgAUEANgIEIAEgAjYCACABIAA2AgQgAkEIaiADEAMgAQtmAQF/IAFB/P///wFLBEBBAEHAAEEXQSIQAAALIAFBAXQiARACIgJBCGogARADIABFBEBBDBABIQALIABBADYCACAAQQA2AgQgAEEANgIIIAAgAjYCACAAQQA2AgQgACABNgIIIAALCgBBDBABIAAQBQsuAQF/QQgQASIBQQA2AgAgAUEANgIEIAEgADYCBCABQQEgASgCBHQQBjYCACABC6EBAQR/QRAQASIBQQA2AgAgAUEANgIEIAFBADYCCCABQQA2AgxBEBAEIQIDQCAAQRBIBEBBAxAHIQMgAigCACAAQQJ0aiADNgIIIABBAWohAAwBCwsgASACNgIEQRAQBCECQQAhAANAIABBEEgEQEEDEAchAyACKAIAIABBAnRqIAM2AgggAEEBaiEADAELCyABIAI2AgggAUEIEAc2AgwgAQs0AQF/QRQQASIAQQA2AgAgAEEAOgAEIABBADYCCCAAQQA2AgwgAEEANgIQIABBDTYCCCAAC0IBAX9BGRABIgBBADYCACAAQQA2AgQgAEEANgIIIABBADYCDCAAQQA2AhAgAEEANgIUIABBADoAGCAAQQA2AhAgAAu1AgEEf0HQABABIgBBADoAACAAQQA2AgQgAEEANgIIIABBADYCDCAAQQA2AhAgAEEAOgAUIABBADYCGCAAQQA2AhwgAEEANgIgIABBADYCJCAAQQA2AiggAEEANgIsIABBADYCMCAAQQA2AjQgAEEANgI4IABBADYCPCAAQQA2AkAgAEEANgJEIABBADYCSCAAQQA2AkxBBBAEIQIDQCABQQRIBEBBBhAHIQMgAigCACABQQJ0aiADNgIIIAFBAWohAQwBCwsgACACNgIkIABBBBAHNgIoIABB8wAQBjYCLCAAQcABEAY2AjAgAEEMEAY2AjQgAEEMEAY2AjggAEEMEAY2AjwgAEEMEAY2AkAgAEHAARAGNgJEIAAQCDYCSCAAEAg2AkwgABAJNgIEIAAQCjYCCCAACx8BAX9BCBABIgBBADYCACAAQQA2AgQgABALNgIAIAALCgAjACQBEAwkAwthAQF/IAFB+P///wNLBEBBAEHAAEEXQSIQAAALIAEQAiICQQhqIAEQAyAARQRAQQwQASEACyAAQQA2AgAgAEEANgIEIABBADYCCCAAIAI2AgAgAEEANgIEIAAgATYCCCAACwoAQQwQASAAEA4LBgAgABAPCyoAIAEgACgCCE8EQEEAQcAAQSdBPxAAAAsgACgCBCABIAAoAgBqai0ACAssACABIAAoAghPBEBBAEHAAEEyQT8QAAALIAAoAgQgASAAKAIAamogAjoACAtkAQJ/QQ0QDyECA0AgAUENSARAIAIgASAAIAEQEUH/AXEQEiABQQFqIQEMAQsLQQAhAEEAIQEDQCABQQhIBEAgAiABQQVqEBFB/wFxIAFBA3R0IAByIQAgAUEBaiEBDAELCyAACwYAIAAQEwsnACAAIAEQDzYCCCAAQQA2AgwgACABNgIUIABBADoAGCAAQQA2AgALJAAgACgCCCAAKAIYEBUgAEGABiAAKAIMIAAtABRqdBAGNgIgC5UBAQR/IAEhBSAAIgYoAgAhASAAKAIEIQcgACgCCEEBdiEEIAJBAEgEfyACIARqIgBBACAAQQBKGwUgAiIAIAQgACAESBsLIQIgA0EASAR/IAMgBGoiAEEAIABBAEobBSADIgAgBCAAIARIGwshAwNAIAIgA05FBEAgAkEBdCABaiAHaiAFOwEIIAJBAWohAgwBCwsgBgssAQF/AkACQAJAIwRBAWsOAwEBAgALAAtB/////wchAQsgAEGACEEAIAEQFwvBAQECfyAAQQIQBjYCACAAKAIAIgEoAgAgASgCBGpBgAg7AQggACgCACICKAIAIQEgAigCBCABQQJqakGACDsBCCAAKAIMKAIAQQEkBBAYGkEAIQIDQCACQRBIBEAgAiAAKAIEKAIAIgEoAgBBAnZJBH8gAkECdCABaigCCAUACygCAEEBJAQQGBogAiAAKAIIKAIAIgEoAgBBAnZJBH8gAkECdCABaigCCAUACygCAEEBJAQQGBogAkEBaiECDAELCwuHAgEFfyAAIQJBgAYgACgCDCAALQAUanQhAQNAIAMgAUgEQCACKAIgIgQoAgAhBSAEKAIEIANBAXQgBWpqQYAIOwEIIANBAWohAwwBCwsgAiEBQQAhAgNAIAJBBEkEQCACIAEoAiQoAgAiAygCAEECdkkEfyACQQJ0IANqKAIIBQALKAIAQQEkBBAYGiACQQFqIQIMAQsLIAEoAigoAgBBASQEEBgaIAEoAixBASQEEBgaIAAoAjBBASQEEBgaIAAoAjRBASQEEBgaIAAoAjhBASQEEBgaIAAoAjxBASQEEBgaIAAoAkBBASQEEBgaIAAoAkRBASQEEBgaIAAoAkgQGSAAKAJMEBkLyAwBA38DQCABQQNxIAIgAhsEQCAAIgRBAWohACABIgNBAWohASAEIAMtAAA6AAAgAkEBayECDAELCyAAQQNxRQRAA0AgAkEQTwRAIAAgASgCADYCACAAQQRqIAFBBGooAgA2AgAgAEEIaiABQQhqKAIANgIAIABBDGogAUEMaigCADYCACABQRBqIQEgAEEQaiEAIAJBEGshAgwBCwsgAkEIcQRAIAAgASgCADYCACAAQQRqIAFBBGooAgA2AgAgAUEIaiEBIABBCGohAAsgAkEEcQRAIAAgASgCADYCACABQQRqIQEgAEEEaiEACyACQQJxBEAgACABLwEAOwEAIAFBAmohASAAQQJqIQALIAJBAXEEQCAAIAEtAAA6AAALDwsgAkEgTwRAAkACQAJAIABBA3EiA0EBRwRAIANBAkYNASADQQNGDQIMAwsgASgCACEFIAAgASIDLQAAOgAAIABBAWoiASABIANBAWoiAS0AADoAAEEBaiIEQQFqIQAgAUEBaiIDQQFqIQEgBCADLQAAOgAAIAJBA2shAgNAIAJBEU8EQCAAIAFBAWooAgAiA0EIdCAFQRh2cjYCACAAQQRqIAFBBWooAgAiBUEIdCADQRh2cjYCACAAQQhqIAFBCWooAgAiA0EIdCAFQRh2cjYCACAAQQxqIAFBDWooAgAiBUEIdCADQRh2cjYCACABQRBqIQEgAEEQaiEAIAJBEGshAgwBCwsMAgsgASgCACEFIAAgAS0AADoAACAAQQFqIgRBAWohACABQQFqIgNBAWohASAEIAMtAAA6AAAgAkECayECA0AgAkESTwRAIAAgAUECaigCACIDQRB0IAVBEHZyNgIAIABBBGogAUEGaigCACIFQRB0IANBEHZyNgIAIABBCGogAUEKaigCACIDQRB0IAVBEHZyNgIAIABBDGogAUEOaigCACIFQRB0IANBEHZyNgIAIAFBEGohASAAQRBqIQAgAkEQayECDAELCwwBCyABKAIAIQUgACIEQQFqIQAgASIDQQFqIQEgBCADLQAAOgAAIAJBAWshAgNAIAJBE08EQCAAIAFBA2ooAgAiA0EYdCAFQQh2cjYCACAAQQRqIAFBB2ooAgAiBUEYdCADQQh2cjYCACAAQQhqIAFBC2ooAgAiA0EY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";return n(t)}function decodeLZMA(n,t,e){try{var r={data:t,offset:0,readByte:function(){return this.data[this.offset++]}},o=r.data.length,s={data:[],offset:0,writeByte:function(c){var f=Math.floor(this.offset/o);this.data[f]||(this.data[f]=new Uint8Array(o)),this.data[f][this.offset%o]=c,this.offset++}};n.decompressFile(r,s);for(var u=new Uint8Array(s.offset),l=0;l<s.offset;l++)u[l]=s.data[Math.floor(l/o)][l%o];e(null,u)}catch(c){e(c)}}function decodeLZMAWithWASM(n,t,e){var r=24;try{var o=new WebAssembly.Memory({initial:16}),s=new WebAssembly.Module(n),u=new WebAssembly.Instance(s,{env:{memory:o,abort:function(){e(new Error("webAssembly abort"))}}}),l=u.exports,c=l.newU8Array(t.length),f=new Uint8Array(o.buffer,c+r,t.length);f.set(t);var p=l.decode(c),d=new Uint32Array(o.buffer,p,4),h=d[0],g=d[2],A=d[3];h?e(null,new Uint8Array(o.buffer,A+r,g).slice(0,g)):e(new Error("lzma deocder error"))}catch(m){e(m)}}var lzmaWorkerSource=`
404
+ `));var M=String(r.clippers.length);c.vertexShader=c.vertexShader.replace(/NUM_CLIPPERS/g,M),c.fragmentShader=c.fragmentShader.replace(/NUM_CLIPPERS/g,M);for(var B=0,C=b;B<C.length;B++){var P=C[B];P.onBeforeCompile&&P.onBeforeCompile(c,f)}};var u="";r.onBeforeRender=function(c,f,p,d,h,g){var A=r.shaderType;p instanceof Camera?(s.pixelRatio.value=p.pixelRatio,s.resolution.value.copy(p.resolution)):(s.pixelRatio.value=c.getPixelRatio(),c.getViewport(scratchViewport$1),s.resolution.value.set(scratchViewport$1.width,scratchViewport$1.height));var m=r.customShaders.filter(function(v){return v.type.includes(A)}),E=m.map(function(v){return"".concat(v.id,":").concat(v.version)}).join("|");u!==E&&(u=E,r.needsUpdate=!0)},Object.defineProperty(r,"uniform",{configurable:!1,enumerable:!1,get:function(){return s}}),defineProperty(r,"isPBMPointCloudMaterial",{get:function(){return!0}}),defineProperty(r,"isShaderMaterial",{get:function(){return!0}}),defineProperty(r,"opacity",{get:function(){return s.opacity.value},set:function(c){s.opacity.value=c}}),defineProperty(r,"vertexMarks",{get:function(){return!!o.USE_VERTEX_MARK},set:function(c){o.USE_VERTEX_MARK!==c&&(o.USE_VERTEX_MARK=c,this.needsUpdate=!0)}}),defineProperty(r,"pointScale",{get:function(){return s.pointScale.value},set:function(c){s.pointScale.value=c}}),defineProperty(r,"pointMinPixel",{get:function(){return s.pointMinPixel.value},set:function(c){s.pointMinPixel.value=c}}),defineProperty(r,"pointMaxPixel",{get:function(){return s.pointMinPixel.value},set:function(c){s.pointMaxPixel.value=c}}),defineProperty(r,"pointSize",{get:function(){return this.defines.USE_POINT_SIZE_ATTENUATION===!0?"ATTENUATION":"FIXED"},set:function(c){var f=c==="ATTENUATION";this.defines.USE_POINT_SIZE_ATTENUATION!==f&&(this.defines.USE_POINT_SIZE_ATTENUATION=f,this.needsUpdate=!0)}}),defineProperty(r,"pointShape",{get:function(){return this.defines.USE_POINT_SHAPE_CIRCLE===!0?"CIRCLE":"SQUARE"},set:function(c){var f=c==="CIRCLE";this.defines.USE_POINT_SHAPE_CIRCLE!==f&&(this.defines.USE_POINT_SHAPE_CIRCLE=f,this.needsUpdate=!0)}}),defineProperty(r,"pointBack",{get:function(){return this.defines.USE_POINT_BACK_HIDDEN===!0?"HIDDEN":this.defines.USE_POINT_BACK_DARK===!0?"DARK":"VISIBLE"},set:function(c){var f=c==="HIDDEN",p=c==="DARK";this.defines.USE_POINT_BACK_HIDDEN!==f&&(this.defines.USE_POINT_BACK_HIDDEN=f,this.needsUpdate=!0),this.defines.USE_POINT_BACK_DARK!==p&&(this.defines.USE_POINT_BACK_DARK=p,this.needsUpdate=!0)}}),defineProperty(r,"modelAlpha",{get:function(){return s.modelAlpha.value},set:function(c){s.modelAlpha.value=c}}),defineProperty(r,"logDepthAlpha",{get:function(){return s.logDepthAlpha.value},set:function(c){s.logDepthAlpha.value=c}}),defineProperty(r,"colorStyle",{get:function(){return o.USE_COLOR_CONSTANT?"CONSTANT":o.USE_COLOR_ALTITUDE?"ALTITUDE":"RGB"},set:function(c){var f=c==="CONSTANT",p=c==="ALTITUDE";o.USE_COLOR_CONSTANT!==f&&(o.USE_COLOR_CONSTANT=f,this.needsUpdate=!0),o.USE_COLOR_ALTITUDE!==p&&(o.USE_COLOR_ALTITUDE=p,this.needsUpdate=!0)}}),defineProperty(r,"constantColor",{get:function(){return s.constantColor.value},set:function(c){s.constantColor.value=c}}),defineProperty(r,"floorIndex",{get:function(){return s.floorIndex.value},set:function(c){s.floorIndex.value=c}}),defineProperty(r,"shownFloorIndex",{get:function(){return s.shownFloorIndex.value},set:function(c){s.shownFloorIndex.value=c}}),defineProperty(r,"floorStyle",{get:function(){return o.USE_FLOOR_STYLE_VISIBILITY?"VISIBILITY":"OPACITY"},set:function(c){var f=c==="VISIBILITY";o.USE_FLOOR_STYLE_VISIBILITY!==f&&(o.USE_FLOOR_STYLE_VISIBILITY=f,this.needsUpdate=!0)}}),defineProperty(r,"gradientTexture",{get:function(){return s.gradientTexture.value},set:function(c){s.gradientTexture.value=c}}),defineProperty(r,"brightness",{get:function(){return s.brightness.value},set:function(c){s.brightness.value=c}});var l=[];return defineProperty(r,"clippers",{get:function(){return l},set:function(c){l!==c&&(l=c,s.clippers.value=l.map(function(f){var p=typeof f.floorIndex=="number"?f.floorIndex:-1,d=new THREE__namespace.Matrix4().getInverse(f.clippingBoxMatrix);return{matrixInverse:d,floorIndex:p}}),this.needsUpdate=!0)}}),defineProperty(r,"colorSaturation",{get:function(){return s.colorSaturation.value},set:function(c){s.colorSaturation.value=c;var f=s.colorSaturation.value!==0||s.colorBrightness.value!==0||s.outlineGain.value!==0||s.distanceGain.value!==0;o.USE_COLOR_ADJUSTMENT!==f&&(o.USE_COLOR_ADJUSTMENT=f,this.needsUpdate=!0)}}),defineProperty(r,"colorBrightness",{get:function(){return s.colorBrightness.value},set:function(c){s.colorBrightness.value=c;var f=s.colorSaturation.value!==0||s.colorBrightness.value!==0||s.outlineGain.value!==0||s.distanceGain.value!==0;o.USE_COLOR_ADJUSTMENT!==f&&(o.USE_COLOR_ADJUSTMENT=f,this.needsUpdate=!0)}}),defineProperty(r,"outlineGain",{get:function(){return s.outlineGain.value},set:function(c){s.outlineGain.value=c;var f=s.colorSaturation.value!==0||s.colorBrightness.value!==0||s.outlineGain.value!==0||s.distanceGain.value!==0;o.USE_COLOR_ADJUSTMENT!==f&&(o.USE_COLOR_ADJUSTMENT=f,this.needsUpdate=!0)}}),defineProperty(r,"distanceGain",{get:function(){return s.distanceGain.value},set:function(c){s.distanceGain.value=c;var f=s.colorSaturation.value!==0||s.colorBrightness.value!==0||s.outlineGain.value!==0||s.distanceGain.value!==0;o.USE_COLOR_ADJUSTMENT!==f&&(o.USE_COLOR_ADJUSTMENT=f,this.needsUpdate=!0)}}),defineProperty(r,"useHQWeight",{get:function(){return o.USE_HQ_WEIGHT},set:function(c){c!==o.USE_HQ_WEIGHT&&(o.USE_HQ_WEIGHT=c,this.needsUpdate=!0)}}),defineProperty(r,"useHQDepth",{get:function(){return o.USE_HQ_DEPTH},set:function(c){c!==o.USE_HQ_DEPTH&&(o.USE_HQ_DEPTH=c,this.needsUpdate=!0)}}),defineProperty(r,"modelBoundingMin",{get:function(){return s.modelBoundingMin.value},set:function(c){s.modelBoundingMin.value=c}}),defineProperty(r,"modelBoundingMax",{get:function(){return s.modelBoundingMax.value},set:function(c){s.modelBoundingMax.value=c}}),typeof e=="object"&&r.setValues(e),r}return t.prototype.copy=function(e){return n.prototype.copy.call(this,e),this.pointScale=e.pointScale,this.pointMinPixel=e.pointMinPixel,this.pointMaxPixel=e.pointMaxPixel,this.customShaders=e.customShaders,this.modelAlpha=e.modelAlpha,this.logDepthAlpha=e.logDepthAlpha,this.colorStyle=e.colorStyle,this.constantColor.copy(e.constantColor),this.floorIndex=e.floorIndex,this.shownFloorIndex=e.shownFloorIndex,this.floorStyle=e.floorStyle,this.gradientTexture=e.gradientTexture,this.brightness=e.brightness,this.clippers=e.clippers,this.colorSaturation=e.colorSaturation,this.colorBrightness=e.colorBrightness,this.outlineGain=e.outlineGain,this.distanceGain=e.distanceGain,this.useEDL=e.useEDL,this.useHQWeight=e.useHQWeight,this.useHQDepth=e.useHQDepth,this.modelBoundingMin.copy(e.modelBoundingMin),this.modelBoundingMax.copy(e.modelBoundingMax),this},t.prototype.clone=function(){var e=this.constructor;return new e().copy(this)},t.prototype.refreshUniforms=function(){},t})(PBMMaterial),PBMPointCloud=(function(n){__extends(t,n);function t(e,r){var o=n.call(this,e,r)||this;return o.onBeforeRender=function(s,u,l,c,f,p){f instanceof PBMPointCloudMaterial&&f.onBeforeRender&&f.onBeforeRender(s,u,l,c,o,p)},o}return t})(THREE__namespace.Points);const gradientDataURL="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAABCAYAAACouxZ2AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAACAKADAAQAAAABAAAAAQAAAAB7UD0+AAACA0lEQVRIDXWUW3YjIQxEwdnV/GT/q8kO3FO3pAJst3PSAaR6Cbszf//9XeMxxpjXmI+pVXudp2s6PC4dqHff9e6D7/PZLy46xQvG+sZvrfK8xgXUeq85yINe9bdmtOK1+kun5vjgq58a+eZPna9jvmjiserqG/+Whathvo3L3WhV89L9sXI/m18z2uene9ap/ftsuT9WZxoHXzW56/fpj8l7+tTw7P011NdpqnY19sRsfuHMA9u8oZWfDz4+fra/dfG1V60ydZ7qba1g7UNAeK0JP7ydD7/OqH6wO2f7HTq+B/lbL9qsB3/N1/UzR81XfPzw4tp5OPvRneacteq8Xo0xR3vuv/kPz0KtX0Nhg0eHuaNXdWI3X/ld427h++vzyp99V6VPrzWFhbv4ayay4oFecm198MmUXN/mL+x7npq/uJXBGb/MTw4+t+SvbLoTZnUW5uHhz7nWcTxT73OwXV7cxT9wbBf/0LnDBgcnHmtPLYba32Hp808sMy1u88yhr58n70/v4xX92GSN19l/2UsqGmiH94Hpxjcs+DO/ccpIVNVp62PUWXu//ur1GQy1Cf+GZ13rtNYN1po3/NI79fGXibHkq4z25xvV2pW3szpneXsW8SsreTe/NIPrtXMnH7wPf+LEN6tqhUVHj3XKD/72p9eafCeYB3zuonnbv7yqP8d/o4K6gRb1wbYAAAAASUVORK5CYII=";function valueEqual(n,t){return n==t}function arrayValueEqual(n,t){if(Array.isArray(n)&&Array.isArray(t)){if(n.length!==t.length)return!1;for(var e=0;e<n.length;e++)if(n[e]!==t[e])return!1;return!0}return n===t}var parameterValueEqualFn={customShaders:arrayValueEqual,castShadow:valueEqual,receiveShadow:valueEqual,vertexMarks:valueEqual,pano0:valueEqual,pano1:valueEqual,pano0Depth:valueEqual,pano1Depth:valueEqual,refinedScreen:valueEqual,modelAlpha:valueEqual,logDepthAlpha:valueEqual,progress:valueEqual,transition:valueEqual,opacity:valueEqual,floorStyle:valueEqual,colorStyle:valueEqual,constantColor:function(n,t){return n instanceof THREE__namespace.Vector3&&t instanceof THREE__namespace.Vector3?n.equals(t):n===t},shownFloorIndex:valueEqual,clippers:arrayValueEqual,brightness:valueEqual,useHQWeight:valueEqual,useHQDepth:valueEqual,pointShape:valueEqual,pointSize:valueEqual,pointBack:valueEqual,pointScale:valueEqual,pointMinPixel:valueEqual,pointMaxPixel:valueEqual,pointAppearAnimation:valueEqual,colorSaturation:valueEqual,colorBrightness:valueEqual,useAddBlend:valueEqual,outlineGain:valueEqual,distanceGain:valueEqual,gradientTexture:valueEqual,boundingBox:function(n,t){return n instanceof THREE__namespace.Box3&&t instanceof THREE__namespace.Box3?n.equals(t):n===t},minLevelOfDetail:valueEqual,maxLevelOfDetail:valueEqual,minGeometricError:valueEqual,maxGeometricError:valueEqual,panoramaMinGeometricError:valueEqual,skipLevelOfDetail:valueEqual,mostDetail:valueEqual,loadSiblings:valueEqual,cameraCulling:valueEqual,maxMemoryUsage:valueEqual,maxRequests:valueEqual,requestOrder:valueEqual,maxScreenSpaceError:valueEqual,memoryAdjustedOverflow:valueEqual,memoryAdjustedScreenSpaceError:valueEqual,cacheCameras:arrayValueEqual};function assignValue(n,t,e){var r=parameterValueEqualFn[t];if(!r)return!1;Array.isArray(e)&&(e=e.slice());var o=n[t];return r(o,e)?!1:(n[t]=e,!0)}var defaultGradientTexture=(function(){var n;return typeof document!="undefined"?n=new THREE__namespace.TextureLoader().load(gradientDataURL):n=new THREE__namespace.Texture,n.minFilter=THREE__namespace.NearestFilter,n.magFilter=THREE__namespace.NearestFilter,n.wrapS=THREE__namespace.RepeatWrapping,n.wrapT=THREE__namespace.RepeatWrapping,n})(),defineConstantColor=Object.freeze(new THREE__namespace.Vector3(.6,.6,.6)),defineClippers=Object.freeze([]),defineBoundingBox=Object.freeze(new THREE__namespace.Box3),defineCustomShaders=Object.freeze([]),defineCacheCameras=Object.freeze([]);function createDefault(){return{customShaders:defineCustomShaders,castShadow:!1,receiveShadow:!1,vertexMarks:!0,pano0:null,pano1:null,pano0Depth:null,pano1Depth:null,refinedScreen:null,floorStyle:"OPACITY",colorStyle:"RGB",constantColor:defineConstantColor,shownFloorIndex:-1,modelAlpha:1,logDepthAlpha:0,opacity:1,progress:0,transition:"FADE",clippers:defineClippers,brightness:1,useHQWeight:!1,useHQDepth:!1,pointSize:"ATTENUATION",pointBack:"DARK",pointShape:"CIRCLE",pointScale:.02,pointMaxPixel:40,pointMinPixel:0,pointAppearAnimation:!0,gradientTexture:defaultGradientTexture,colorSaturation:0,colorBrightness:0,outlineGain:0,distanceGain:0,useAddBlend:!1,boundingBox:defineBoundingBox,minLevelOfDetail:0,maxLevelOfDetail:20,minGeometricError:0,maxGeometricError:1e4,panoramaMinGeometricError:.03,skipLevelOfDetail:!1,mostDetail:!1,loadSiblings:!1,cameraCulling:!0,maxMemoryUsage:256,maxRequests:6,requestOrder:"SCREEN_SPACE_ERROR",maxScreenSpaceError:4,memoryAdjustedOverflow:4,memoryAdjustedScreenSpaceError:!1,cacheCameras:defineCacheCameras}}var parameterKeys=Object.keys(createDefault()),Parameter=(function(){function n(t){this.value=Object.create(null),this.id=createUuid(),this.versionNumber=0,t&&this.copy(t);for(var e=function(l){Object.defineProperty(r,l,{get:function(){return this.value[l]}})},r=this,o=0,s=parameterKeys;o<s.length;o++){var u=s[o];e(u)}}return n.createDefault=function(){return createDefault()},n.resolveValue=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var r=Object.assign(this.createDefault(),{versions:[],version:""}),o=0,s=t;o<s.length;o++){var u=s[o],l=u instanceof n?u.version:createUuid();r.versions.push(l);for(var c=0,f=parameterKeys;c<f.length;c++){var p=f[c],d=u[p];d!==void 0&&(r[p]=d)}}return r.version=r.versions.toString(),r},Object.defineProperty(n.prototype,"version",{get:function(){return"".concat(this.id,":").concat(this.versionNumber)},enumerable:!1,configurable:!0}),n.prototype.resolveValue=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return n.resolveValue.apply(n,t.concat(this))},n.prototype.set=function(t,e){var r=!1;if(typeof t=="string"){if(e!==void 0){var o=assignValue(this.value,t,e);o&&(r=!0)}}else for(var s=t,u=Object.keys(s),l=0,c=u;l<c.length;l++){var f=c[l],p=s[f];if(p!==void 0){var o=assignValue(this.value,f,p);o&&(r=!0)}}return r&&this.versionNumber++,this},n.prototype.reset=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var r=!1,o=0,s=t;o<s.length;o++){var u=s[o];this.value!==void 0&&(delete this.value[u],r=!0)}return r&&this.versionNumber++,this},n.prototype.resetAll=function(){for(var t=!1,e=Object.keys(this.value),r=0,o=e;r<o.length;r++){var s=o[r];delete this.value[s],t=!0}return t&&this.versionNumber++,this},n.prototype.copy=function(t){for(var e=!0,r=Object.keys(this.value),o=0,s=r;o<s.length;o++){var u=s[o];delete this.value[u]}r=Object.keys(t);for(var l=0,c=r;l<c.length;l++){var f=c[l],p=t[f];if(p!==void 0){var d=assignValue(this.value,f,p);d&&(e=!0)}}return e&&this.versionNumber++,this},n})(),PBMContainer=(function(n){__extends(t,n);function t(){var e=n!==null&&n.apply(this,arguments)||this;return e.parameter=new Parameter,e.needsRender=!0,e}return Object.defineProperty(t.prototype,"materialParameters",{get:function(){return this.parameter.resolveValue()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pbmMaterialParametersVersion",{get:function(){return this.parameter.resolveValue().version},enumerable:!1,configurable:!0}),t.prototype.setMaterial=function(e){this.parameter.set(e),this.update(),this.needsRender=!0},t.prototype.getMaterial=function(){return this.parameter.resolveValue()},t.prototype.update=function(){var e=this.parameter.resolveValue();this.traverse(function(r){r instanceof PBMMesh||r instanceof PBMSkinnedMesh?updatePBMMesh$1(r,e):r instanceof PBMPointCloud&&updatePBMPointCloud$1(r,e)})},t})(THREE__namespace.Group);function updatePBMMesh$1(n,t){var e=n.material;n.castShadow=t.castShadow,n.receiveShadow=t.receiveShadow;for(var r=0,o=e;r<o.length;r++){var s=o[r];s.customShaders=t.customShaders,s.pano0=t.pano0,s.pano1=t.pano1,s.pano0Depth=t.pano0Depth,s.pano1Depth=t.pano1Depth,s.refinedScreen=t.refinedScreen,s.modelAlpha=t.modelAlpha,s.logDepthAlpha=t.logDepthAlpha,s.progress=t.progress,s.transition=t.transition,s.opacity=t.opacity,s.floorStyle=t.floorStyle,s.constantColor=t.constantColor,s.shownFloorIndex=t.shownFloorIndex,s.clippers=t.clippers,s.brightness=t.brightness,s.useHQWeight=t.useHQWeight,s.useHQDepth=t.useHQDepth,s.colorSaturation=t.colorSaturation,s.colorBrightness=t.colorBrightness,s.gradientTexture=t.gradientTexture,s.shaderType==="none"?(s.transparent=!0,s.blending=THREE__namespace.NormalBlending,s.blendDst=THREE__namespace.OneMinusSrcAlphaFactor,s.blendEquation=THREE__namespace.AddEquation,s.blendSrcAlpha=null,s.blendDstAlpha=null,s.blendEquationAlpha=null,s.depthWrite=!1,s.depthTest=!0):(s.transparent=s.alphaMode==="BLEND",s.blending=THREE__namespace.NormalBlending,s.blendDst=THREE__namespace.OneMinusSrcAlphaFactor,s.blendEquation=THREE__namespace.AddEquation,s.blendSrcAlpha=null,s.blendDstAlpha=null,s.blendEquationAlpha=null,s.depthWrite=!0,s.depthTest=!0,t.useAddBlend&&(s.depthWrite=!1,s.depthTest=!1,s.blending=THREE__namespace.AdditiveBlending),s.shownFloorIndex>-1&&s.shownFloorIndex!==s.floorIndex&&(s.transparent=!0),s.opacity<1&&(s.transparent=!0),s.alphaMap&&(s.transparent=!0),s.brightness<1&&(s.transparent=!0),s.logDepthAlpha>0?s.transparent=!1:t.useAddBlend&&(s.depthWrite=!1,s.depthTest=!1,s.blending=THREE__namespace.AdditiveBlending))}}function updatePBMPointCloud$1(n,t){var e=[n.material];n.castShadow=t.castShadow,n.receiveShadow=t.receiveShadow;for(var r=0,o=e;r<o.length;r++){var s=o[r];s.customShaders=t.customShaders,s.pointScale=t.pointScale,s.pointMinPixel=t.pointMinPixel,s.pointMaxPixel=t.pointMaxPixel,s.pointSize=t.pointSize,s.pointShape=t.pointShape,s.pointBack=t.pointBack,s.modelAlpha=t.modelAlpha,s.logDepthAlpha=t.logDepthAlpha,s.opacity=t.opacity,s.floorStyle=t.floorStyle,s.constantColor=t.constantColor,s.shownFloorIndex=t.shownFloorIndex,s.clippers=t.clippers,s.brightness=t.brightness,s.useHQWeight=t.useHQWeight,s.useHQDepth=t.useHQDepth,s.colorSaturation=t.colorSaturation,s.colorBrightness=t.colorBrightness,s.outlineGain=t.outlineGain,s.distanceGain=t.distanceGain,s.gradientTexture=t.gradientTexture,s.transparent=!1,s.blending=THREE__namespace.NormalBlending,s.blendDst=THREE__namespace.OneMinusSrcAlphaFactor,s.blendEquation=THREE__namespace.AddEquation,s.blendSrcAlpha=null,s.blendDstAlpha=null,s.blendEquationAlpha=null,s.depthWrite=!0,s.depthTest=!0,s.shownFloorIndex>-1&&(s.transparent=s.shownFloorIndex!==s.floorIndex),s.modelAlpha<1&&(s.transparent=!0),s.opacity<1&&(s.transparent=!0),s.brightness<1&&(s.transparent=!0),s.logDepthAlpha>0?s.transparent=!1:t.useAddBlend&&(s.depthWrite=!1,s.depthTest=!1,s.blending=THREE__namespace.AdditiveBlending),s.useHQWeight&&(s.depthWrite=!1,s.blending=THREE__namespace.CustomBlending,s.blendSrc=THREE__namespace.SrcAlphaFactor,s.blendSrcAlpha=THREE__namespace.SrcAlphaFactor,s.blendDst=THREE__namespace.OneFactor,s.blendDstAlpha=THREE__namespace.OneFactor)}}var ROTATE_X_MATRIX=new THREE__namespace.Matrix4().fromArray([1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1]),ROTATE_X_MATRIX_INVERSE=new THREE__namespace.Matrix4().getInverse(ROTATE_X_MATRIX);function createSymbol(n){return typeof Symbol=="undefined"?"$Symbol<".concat(n,">$"):Symbol(n)}var EVENT_SYMBOL=createSymbol("$$FIVE_EVENT$$");function __generateEventIfNotExisted(n){return n[EVENT_SYMBOL]||(n[EVENT_SYMBOL]={}),n[EVENT_SYMBOL]}function __removeEvents(n){n[EVENT_SYMBOL]&&delete n[EVENT_SYMBOL]}var Subscribe=(function(){function n(){}return n.prototype.hasListener=function(t){var e=__generateEventIfNotExisted(this);return e&&e[t]&&e[t].callbacks.length>0},n.prototype.on=function(t,e,r){var o=this,s=__generateEventIfNotExisted(this);return s[t]||(s[t]={callbacks:[]}),s[t].callbacks.push([e,r||!1]),function(){return o.off(t,e)}},n.prototype.once=function(t,e){return this.on(t,e,!0)},n.prototype.off=function(t,e){if(t===void 0){__removeEvents(this);return}var r=__generateEventIfNotExisted(this);if(r[t]||(r[t]={callbacks:[]}),e===void 0){r[t].callbacks.length=0;return}for(var o=0;o<r[t].callbacks.length&&r[t].callbacks[o][0]!==e;o++);o<r[t].callbacks.length&&r[t].callbacks.splice(o,1)},n.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];var o=!1,s=__generateEventIfNotExisted(this);s[t]||(s[t]={callbacks:[]});for(var u=s[t].callbacks.slice(),l=0,c=u;l<c.length;l++){var f=c[l],p=f[0],d=f[1],h=d===void 0?!1:d,g=p.apply(void 0,e);h&&this.off(t,p),g===!1&&(o=!0)}return o},n.prototype.waitUntil=function(t,e){var r=this;return new Promise(function(o){var s=r.on(t,function(){for(var u=[],l=0;l<arguments.length;l++)u[l]=arguments[l];(!e||e.apply(void 0,u)!==!1)&&(o(u),s())})})},n})();function noop(){}var JSONP_REGEXPS=[/\.([0-9a-z]+)\.jsonp([\?\#].*)?$/i,/jsonp_([0-9a-z]+)([\?\#].*)?$/i],locationHref=typeof location!="undefined"?location.href:"",locationIsHttps=/^https\:/.test(locationHref),NetworkProxyError=(function(n){__extends(t,n);function t(e,r,o){return n.call(this,"[NETWORK]: request proxy error(type: ".concat(r,", reason: ").concat(o,"): ").concat(e))||this}return t})(Error),NetworkResponseError=(function(n){__extends(t,n);function t(e,r,o){var s=n.call(this,"[NETWORK]: response error(type: ".concat(r,", status: ").concat(o,"): ").concat(e))||this;return s.httpStatus=o,s}return t})(Error);(function(n){__extends(t,n);function t(e,r){return n.call(this,"[NETWORK]: request abort(type: ".concat(r,"): ").concat(e))||this}return t})(Error);var NetworkTimeoutError=(function(n){__extends(t,n);function t(e,r,o){return n.call(this,"[NETWORK]: request timeout(type: ".concat(r,", timeout: ").concat(o,"ms): ").concat(e))||this}return t})(Error);(function(n){__extends(t,n);function t(e,r,o){return n.call(this,"[NETWORK]: request forbidden(type: ".concat(r,", reason: ").concat(o,"): ").concat(e))||this}return t})(Error);function parseHeaders(n){if(!n)return{};for(var t={},e=n.trim().split(`
405
+ `),r=0;r<e.length;r++){var o=e[r],s=o.indexOf(":"),u=o.slice(0,s).trim().toLowerCase(),l=o.slice(s+1).trim();l&&(t[u]?t[u]+=", "+l:t[u]=l)}return t}function matchJsonpFunctionName(n){for(var t=0,e=JSONP_REGEXPS;t<e.length;t++){var r=e[t],o=n.match(r);if(o)return"jsonp_"+o[1]}return null}function isJsonp(n){return matchJsonpFunctionName(n)!==null}var NetworkSubscribe=(function(n){__extends(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t})(Subscribe);function ajax(n,t,e,r,o){t===void 0&&(t={}),e===void 0&&(e=noop),r===void 0&&(r=noop),o===void 0&&(o=noop);var s=now(),u=n;return Promise.resolve().then(function(){return t.requestProxy?t.requestProxy(n):n}).then(function(l){return locationIsHttps&&/^http\:/.test(l)?(console.warn("The page at '".concat(locationIsHttps,"' was loaded over HTTPS, but requested an insecure element '").concat(l,"'. This request was automatically upgraded to HTTPS")),l.replace(/^http\:/,"https:")):l}).catch(function(l){var c;matchJsonpFunctionName(n);var f=new NetworkProxyError(u,"XMLHttpRequest",l&&l.message?String(l.message):String(l));return(c=t.networkSubscribe)===null||c===void 0||c.emit("network",n,"XMLHttpRequest","forbidden",f.message),Promise.reject(f)}).then(function(l){return new Promise(function(c,f){var p=matchJsonpFunctionName(l);if(p){var d=window,h=null,g=!1,A=document.createElement("script"),m=function(){var w;if(h=null,g!==!0){g=!0;var M=new NetworkTimeoutError(l,"XMLHttpRequest",t.timeout||NaN);r(M),f(M),(w=t.networkSubscribe)===null||w===void 0||w.emit("network",l,"XMLHttpRequest","timeout",M.message)}},E=function(w){var M,B,C=now(),P=C-s;if(delete d[p],A.parentNode&&A.parentNode.removeChild(A),h!==null&&(window.clearTimeout(h),h=null),g!==!0){if(w.indexOf("data:")!==0){var F=new NetworkResponseError(l,"XMLHttpRequest",500);r(F),f(F),(M=t.networkSubscribe)===null||M===void 0||M.emit("network",l,"XMLHttpRequest","error",F.message);return}var L=w.split(","),O=(L[0].match(/:(.*?);/)||[])[1],k=L[1];if(t.responseType==="arraybuffer"||t.responseType==="blob"){for(var D=atob(L[1]),J=D.length,G=new Uint8Array(J),U=0;U<J;U++)G[U]=D.charCodeAt(U);t.responseType==="arraybuffer"?k=G.buffer:k=new Blob([G],{type:O})}var z={},q={body:k,meta:{origin:u,source:l,requestTime:s,responseTime:C,costs:P,headers:z}};e(q),c(q),(B=t.networkSubscribe)===null||B===void 0||B.emit("network",l,"XMLHttpRequest","ok",JSON.stringify(q.meta)),g=!0}};d[p]=E,A.src=l,document.body.appendChild(A),typeof t.timeout=="number"&&(h=window.setTimeout(m,t.timeout))}else{var v=!1,y=new XMLHttpRequest,b=function(){y&&(y.removeEventListener("timeout",_,!1),y.removeEventListener("progress",T,!1),y.removeEventListener("load",S,!1),y.removeEventListener("error",R,!1)),y=null,b=noop},_=function(){var w;if(v!==!0){v=!0,b();var M=new NetworkTimeoutError(l,"XMLHttpRequest",t.timeout||NaN);r(M),f(M),(w=t.networkSubscribe)===null||w===void 0||w.emit("network",l,"XMLHttpRequest","timeout",M.message)}},T=function(w){v!==!0&&w.lengthComputable&&(w.total<=0||o(w.loaded/w.total))},S=function(w){var M;if(v!==!0){var B=this.status;if(B===0||B>=200&&B<400){v=!0,b();var C=now(),P=C-s,F=parseHeaders(this.getAllResponseHeaders()),L=w.total,O={body:this.response,meta:{origin:u,source:l,requestTime:s,responseTime:C,costs:P,headers:F,size:L}};e(O),c(O),(M=t.networkSubscribe)===null||M===void 0||M.emit("network",l,"XMLHttpRequest","ok",JSON.stringify(O.meta))}else R.call(this)}},R=function(){var w;if(v!==!0){v=!0,b();var M=new NetworkResponseError(l,"XMLHttpRequest",this.status);r(M),f(M),(w=t.networkSubscribe)===null||w===void 0||w.emit("network",l,"XMLHttpRequest","error",M.message)}};y.addEventListener("timeout",_,!1),y.addEventListener("progress",T,!1),y.addEventListener("load",S,!1),y.addEventListener("error",R,!1),t.responseType&&(y.responseType=t.responseType),typeof t.timeout=="number"&&(y.timeout=t.timeout),y.open("GET",l,!0),y.send(null)}})})}var preloadCache={};function preload(n,t){t===void 0&&(t={});var e=now(),r=n;return Promise.resolve().then(function(){return t.requestProxy?t.requestProxy(n):n}).then(function(o){return locationIsHttps&&/^http\:/.test(o)?(console.warn("The page at '".concat(locationIsHttps,"' was loaded over HTTPS, but requested an insecure element '").concat(o,"'. This request was automatically upgraded to HTTPS")),o.replace(/^http\:/,"https:")):o}).catch(function(o){var s,u=new NetworkProxyError(r,"Link",o&&o.message?String(o.message):String(o));return(s=t.networkSubscribe)===null||s===void 0||s.emit("network",n,"Link","forbidden",u.message),Promise.reject(u)}).then(function(o){return o in preloadCache?preloadCache[o]:preloadCache[o]=new Promise(function(s,u){var l=document.createElement("link"),c=!1,f=null;l.onload=function(d){var h;if(f!==null&&(clearTimeout(f),f=null),c!==!0){c=!0,s();var g=now(),A=g-e,m={},E={origin:r,source:o,requestTime:e,responseTime:g,costs:A,headers:m};(h=t.networkSubscribe)===null||h===void 0||h.emit("network",o,"Link","preload",JSON.stringify(E))}},l.onerror=function(d){var h;if(f!==null&&(clearTimeout(f),f=null),c!==!0){c=!0;var g=new NetworkResponseError(o,"Link",0);u(g),(h=t.networkSubscribe)===null||h===void 0||h.emit("network",o,"Link","error",g.message)}},typeof t.timeout=="number"&&(f=window.setTimeout(function(){var d;if(f=null,c!==!0){c=!0,s();var h=now(),g=h-e,A={},m={origin:r,source:o,requestTime:e,responseTime:h,costs:g,headers:A};(d=t.networkSubscribe)===null||d===void 0||d.emit("network",o,"Link","timeout",JSON.stringify(m))}},t.timeout)),l.rel=l.relList&&l.relList.supports("prefetch")?"prefetch":"preload",l.as="fetch",l.crossOrigin="",l.fetchPriority="high",l.href=o;var p=document.head||document.getElementsByTagName("head")[0];p&&p.appendChild(l)})})}function loadImage(n,t,e,r,o,s){t===void 0&&(t={}),e===void 0&&(e=noop),r===void 0&&(r=noop),o===void 0&&(o=noop);var u=now(),l=n;return Promise.resolve().then(function(){return t.requestProxy?t.requestProxy(n):n}).then(function(c){return locationIsHttps&&/^http\:/.test(c)?(console.warn("The page at '".concat(locationIsHttps,"' was loaded over HTTPS, but requested an insecure element '").concat(c,"'. This request was automatically upgraded to HTTPS")),c.replace(/^http\:/,"https:")):c}).catch(function(c){var f,p=new NetworkProxyError(l,"Image",c&&c.message?String(c.message):String(c));return(f=t.networkSubscribe)===null||f===void 0||f.emit("network",n,"Image","forbidden",p.message),Promise.reject(p)}).then(function(c){return isJsonp(c)?ajax(c,{responseType:"blob",networkSubscribe:t.networkSubscribe}).then(function(f){return URL.createObjectURL(f.body)}):c}).then(function(c){return new Promise(function(f,p){var d=s!=null?s:new Image,h=!1,g=null,A=function(){var E;if(d.onload=noop,d.onerror=noop,g!==null&&(clearTimeout(g),g=null),h!==!0){var v=now(),y={headers:{},origin:l,source:c,requestTime:u,responseTime:v,costs:v-u};h=!0;var b={body:d,meta:y};o(1),e(b),f(b),(E=t.networkSubscribe)===null||E===void 0||E.emit("network",c,"Image","ok",JSON.stringify(b.meta))}},m=function(){var E;if(d.onload=noop,d.onerror=noop,g!==null&&(clearTimeout(g),g=null),h!==!0){h=!0;var v=new NetworkResponseError(c,"Image",0);r(v),p(v),(E=t.networkSubscribe)===null||E===void 0||E.emit("network",c,"Image","ok",v.message)}};typeof t.timeout=="number"&&(g=window.setTimeout(function(){var E;if(d.onload=noop,d.onerror=noop,g=null,h!==!0){h=!0;var v=new NetworkTimeoutError(c,"Image",t.timeout);r(v),p(v),(E=t.networkSubscribe)===null||E===void 0||E.emit("network",c,"Image","timeout",v.message)}},t.timeout)),d.onload=A,d.onerror=m,o(0),d.src=c})})}var Fetcher=(function(){function n(t){t===void 0&&(t={}),this.options=t}return n.prototype.ajax=function(t,e,r,o,s){var u;e===void 0&&(e={}),r===void 0&&(r=noop),o===void 0&&(o=noop),s===void 0&&(s=noop);var l=this.options,c={responseType:e.responseType,timeout:(u=e.timeout)!==null&&u!==void 0?u:l.timeout,get requestProxy(){var f;return(f=e.requestProxy)!==null&&f!==void 0?f:l.requestProxy},get networkSubscribe(){var f;return(f=e.networkSubscribe)!==null&&f!==void 0?f:l.networkSubscribe}};return ajax(t,c,r,o,s)},n.prototype.loadImage=function(t,e,r,o,s,u){var l;e===void 0&&(e={}),r===void 0&&(r=noop),o===void 0&&(o=noop),s===void 0&&(s=noop);var c=this.options,f={timeout:(l=e.timeout)!==null&&l!==void 0?l:c.timeout,get requestProxy(){var p;return(p=e.requestProxy)!==null&&p!==void 0?p:c.requestProxy},get networkSubscribe(){var p;return(p=e.networkSubscribe)!==null&&p!==void 0?p:c.networkSubscribe}};return loadImage(t,f,r,o,s,u)},n.prototype.preload=function(t,e){var r;e===void 0&&(e={});var o=this.options,s={timeout:(r=e.timeout)!==null&&r!==void 0?r:o.timeout,get requestProxy(){var u;return(u=e.requestProxy)!==null&&u!==void 0?u:o.requestProxy},get networkSubscribe(){var u;return(u=e.networkSubscribe)!==null&&u!==void 0?u:o.networkSubscribe}};return preload(t,s)},n})(),internalFetcher=new Fetcher;function pick(n,t){for(var e={},r=0,o=t;r<o.length;r++){var s=o[r];s in n&&(e[s]=n[s])}return e}function omit(n,t){for(var e=__assign({},n),r=0,o=t;r<o.length;r++){var s=o[r];s in e&&delete e[s]}return e}function omitUndefinedFields(n){var t={};for(var e in n){var r=n[e];r!==void 0&&(t[e]=r)}return t}function pathJoin(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];var e=[];n=n.map(function(l){return(l!=null?l:"").trim()}).filter(function(l){return l.length>0&&!/^\/+$/.test(l)});for(var r=0;r<n.length;r++){var o=r===0,s=r===n.length-1,u=n[r];o||(u=u.replace(/^\.\//,"").replace(/^\/+/,"")),s||(u=u.replace(/\/+$/,"")),e.push(u)}return e.join("/")}function isAbsoluteURL(n){return n.indexOf("/")===0||/^[0-9a-z]+\:/i.test(n)}var webp="data:image/webp;base64,UklGRiQAAABXRUJQVlA4IBgAAAAwAQCdASoCAAIAAUAmJaQAA3AA/vz0AAA=",avif="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAAGhbWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAsaWxvYwAAAABEAAACAAEAAAABAAAB3gAAABkAAgAAAAEAAAHJAAAAFQAAAEJpaW5mAAAAAAACAAAAGmluZmUCAAAAAAEAAGF2MDFDb2xvcgAAAAAaaW5mZQIAAAAAAgAAYXYwMUFscGhhAAAAABppcmVmAAAAAAAAAA5hdXhsAAIAAQABAAAA12lwcnAAAACxaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIAAoAAAAAUaXNwZQAAAAAAAAACAAAAAgAAAA5waXhpAAAAAAEIAAAADGF2MUOBABwAAAAAOGF1eEMAAAAAdXJuOm1wZWc6bXBlZ0I6Y2ljcDpzeXN0ZW1zOmF1eGlsaWFyeTphbHBoYQAAAAAeaXBtYQAAAAAAAAACAAEEAQKDBAACBAUGhwgAAAA2bWRhdBIACgQYADLVMgsWQBhhIAQqrNj/+BIACgUYADLEoDIOFkADDDDCQAACDaqCCb4=",heif="data:image/heif;base64,AAAAGGZ0eXBoZWljAAAAAG1pZjFoZWljAAABL21ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAHBpY3QAAAAAAAAAAAAAAAAAAAAADnBpdG0AAAAAAAEAAAAjaWluZgAAAAAAAQAAABVpbmZlAgAAAAABAABodmMxAAAAAK9pcHJwAAAAkmlwY28AAAB2aHZjQwEBYAAAAAAAAAAAAADwAPz9+PgAACcDoAABAB5AAQwG//8BYAAAAwAAAwAAAwAAAwAAAwAAreTLgSChAAEAI0IBBwFgAAADAAADAAADAAADAAADAAChInJJlreTLySZNdggogABAAdEAcA98DMkAAAAFGlzcGUAAAAAAAAAAgAAAAIAAAAVaXBtYQAAAAAAAAABAAECgQIAAAAiaWxvYwAAAABEQAABAAEAAAAAAU8AAQAAAAAAAAAOAAAAFm1kYXQAAAAKJgGvLvkQwuWM4A==";function checkImage(n){return new Promise(function(t){if(typeof Image=="undefined"){t(!1);return}var e=new Image,r=setTimeout(function(){e.onload=e.onerror=function(){},clearTimeout(r),t(!1)},100);e.onload=e.onerror=function(){e.onload=e.onerror=function(){},clearTimeout(r),t(e.height===2)},e.src=n})}var imageSupportCache=null;function imageSupport(){return imageSupportCache||(imageSupportCache=Promise.all([checkImage(webp),checkImage(avif),checkImage(heif)]).then(function(n){return{webp:n[0],avif:n[1],heif:n[2]}}))}var _a$5,supportAvif=!1,supportWebp=!1,supportHeif=!1;imageSupport().then(function(n){supportAvif=n.avif,supportWebp=n.webp,supportHeif=n.heif});var IMAGE_FORMATS=["jpg","jpeg","png","heif","heic","webp","avif"];function isImageExt(n){return IMAGE_FORMATS.indexOf(n)>=0}var DEFAULT_IMAGE_URL_MAPPINGS={"vrlab-public.ljcdn.com":{type:"tencentCloud",pano:["vrlab-image1.ljcdn.com","vrlab-image2.ljcdn.com"],texture:["vrlab-image3.ljcdn.com"],tile:["vr-tile-1.realsee-cdn.cn","vr-tile-2.realsee-cdn.cn"],model:["vr-model-1.realsee-cdn.cn","vr-model-2.realsee-cdn.cn"],default:["vrlab-image4.ljcdn.com"]},"vr-public.realsee-cdn.cn":{type:"tencentCloud",pano:["vr-image-1.realsee-cdn.cn","vr-image-2.realsee-cdn.cn"],texture:["vr-image-3.realsee-cdn.cn"],tile:["vr-tile-1.realsee-cdn.cn","vr-tile-2.realsee-cdn.cn"],model:["vr-model-1.realsee-cdn.cn","vr-model-2.realsee-cdn.cn"],default:["vr-image-4.realsee-cdn.cn"]},"vr-public.rscdn.cn":{type:"tencentCloud",pano:["vr-image-1.rscdn.cn","vr-image-2.rscdn.cn"],texture:["vr-image-3.rscdn.cn"],tile:["vr-tile-1.rscdn.cn","vr-tile-2.rscdn.cn"],model:["vr-model-1.rscdn.cn","vr-model-2.rscdn.cn"],default:["vr-image-4.rscdn.cn"]},"mars-public.realsee-cdn.cn":{type:"aliyun",pano:["mars-image-1.realsee-cdn.cn","mars-image-2.realsee-cdn.cn"],texture:["mars-image-3.realsee-cdn.cn"],tile:["mars-tile-1.realsee-cdn.cn","mars-tile-2.realsee-cdn.cn"],model:["mars-model-1.realsee-cdn.cn","mars-model-2.realsee-cdn.cn"],default:["mars-image-4.realsee-cdn.cn"]},"global-public.realsee-cdn.com":{type:"tencentCloud",pano:["global-image-1.realsee-cdn.com","global-image-2.realsee-cdn.com"],texture:["global-image-3.realsee-cdn.com"],tile:["global-tile-1.realsee-cdn.com","global-tile-2.realsee-cdn.com"],model:["global-model-1.realsee-cdn.com","global-model-2.realsee-cdn.com"],default:["global-image-4.realsee-cdn.com"]},"earth-ga-public.realsee-cdn.cn":{type:"tencentCloud",pano:["earth-ga-image-1.realsee-cdn.cn","earth-ga-image-2.realsee-cdn.cn"],texture:["earth-ga-image-3.realsee-cdn.cn"],tile:["earth-ga-tile-1.realsee-cdn.cn","earth-ga-tile-2.realsee-cdn.cn"],model:["earth-ga-model-1.realsee-cdn.cn","earth-ga-model-2.realsee-cdn.cn"],default:["earth-ga-image-4.realsee-cdn.cn"]},"test-vr-public.realsee-cdn.com":{type:"tencentCloud",pano:["test-vr-image.realsee-cdn.com","test-vr-image.realsee-cdn.com"],texture:["test-vr-image.realsee-cdn.com"],tile:["test-vr-image.realsee-cdn.com","test-vr-image.realsee-cdn.com"],model:["test-vr-image.realsee-cdn.com","test-vr-image.realsee-cdn.com"],default:["test-vr-image.realsee-cdn.com"]},"test-vr-public.realsee-cdn.cn":{type:"tencentCloud",pano:["test-vr-image.realsee-cdn.cn","test-vr-image.realsee-cdn.cn"],texture:["test-vr-image.realsee-cdn.cn"],tile:["test-vr-image.realsee-cdn.cn","test-vr-image.realsee-cdn.cn"],model:["test-vr-image.realsee-cdn.cn","test-vr-image.realsee-cdn.cn"],default:["test-vr-image.realsee-cdn.cn"]}},URL_DOMAIN_REGEX=/^https?\:\/\/?([^\/]+)/;function getDomain(n){var t=n.match(URL_DOMAIN_REGEX);return t===null?null:t[1]}function replaceDomain(n,t,e){var r,o,s=(o=(r=t[e])!==null&&r!==void 0?r:t[t.length-1])!==null&&o!==void 0?o:n;return n.replace(URL_DOMAIN_REGEX,function(u,l){return u.slice(0,u.length-l.length)+s})}function route(n,t,e){var r=t.split("."),o=r[0],s=r.slice(1);if(o==="texture")return replaceDomain(n,e.texture,0);if(o==="pano"){s[0];var u=s[1];switch(u){case"front":case"left":case"up":return replaceDomain(n,e.pano,0);case"down":case"right":case"back":return replaceDomain(n,e.pano,1)}}else if(o==="pano_tile"){s[0],s[1];var l=s[2],c=s[3],f=s[4],p=Math.pow(2,Number(l))*Number(c)+Number(f);if(!isNaN(p))return replaceDomain(n,e.tile,p%2)}else if(o==="model"){var d=s[0],p=Number(d);if(!isNaN(p))return replaceDomain(n,e.model,p%2)}return replaceDomain(n,e.default,0)}var tencentCloudImageProcesser=function(n,t){var e=n.split("?")[0],r=e.split(".").pop();if(r==="jpeg"&&(r="jpg"),r==="heif"&&(r="heic"),r&&!isImageExt(r))return n;var o=[],s=t.format,u=t.cut,l=t.quality,c=t.size,f=t.sharpen;if(s==="jpeg"&&(s="jpg"),s==="heif"&&(s="heic"),(!supportAvif&&(s!=null?s:r)==="avif"||!supportWebp&&(s!=null?s:r)==="webp"||!supportHeif&&(s!=null?s:r)==="heic")&&(s="jpg"),s!==void 0&&s!==r&&o.push("format/".concat(s)),u!==void 0&&o.push("cut/".concat(u[2],"x").concat(u[3],"x").concat(u[0],"x").concat(u[1])),l!==void 0){var p=s!=null?s:r;p&&["jpg","webp","heic","avif"].indexOf(p)>=0&&o.push("quality/".concat(l))}if(c!==void 0){var d=n.match(/\/cube_(\d+)\//),h=d?Number(d[1]):NaN;h!==Number(c)&&o.push("thumbnail/".concat(c,"x"))}f!==void 0&&o.push("sharpen/".concat(f));var g="";return o.length&&(g="?imageMogr2/"+o.join("/")),e+g},aliyunOOSImageProcesser=function(n,t){var e=n.split("?")[0],r=e.split(".").pop();if(r==="jpeg"&&(r="jpg"),r==="heif"&&(r="heic"),r&&!isImageExt(r))return n;var o=[],s=t.format,u=t.cut,l=t.quality,c=t.size,f=t.sharpen;if(s==="jpeg"&&(s="jpg"),s==="heif"&&(s="heic"),(!supportAvif&&(s!=null?s:r)==="avif"||!supportWebp&&(s!=null?s:r)==="webp"||!supportHeif&&(s!=null?s:r)==="heic")&&(s="jpg"),s!==void 0&&s!==r&&o.push("format,".concat(s)),u!==void 0){var p=u[0],d=u[1],h=u[2],g=u[3];o.push("crop,x_".concat(p,",y_").concat(d,",w_").concat(h,",h_").concat(g,",g_nw"))}if(l!==void 0&&l!==100){var A=s!=null?s:r;A&&["jpg","webp","heic","avif"].indexOf(A)>=0&&o.push("quality,Q_".concat(l))}c&&c!==2048&&o.push("resize,w_".concat(c)),f!==void 0&&o.push("sharpen,".concat(f));var m="";return o.length&&(m="?x-oss-process=image/"+o.join("/")),e+m},MAX_SAFE_INTEGER=9007199254740991;function formatNumber(n){var t=Math.round(n);return Math.abs(t-n)<.001?t:Math.floor(n)}function formatOptions(n){return n=Object.assign({},n),n.size!==void 0&&(n.size=formatNumber(clamp$1(n.size,0,MAX_SAFE_INTEGER))),n.quality!==void 0&&(n.quality=formatNumber(clamp$1(n.quality,0,100))),n.cut!==void 0&&(n.cut=[formatNumber(clamp$1(n.cut[0],0,MAX_SAFE_INTEGER)),formatNumber(clamp$1(n.cut[1],0,MAX_SAFE_INTEGER)),formatNumber(clamp$1(n.cut[2],0,MAX_SAFE_INTEGER)),formatNumber(clamp$1(n.cut[3],0,MAX_SAFE_INTEGER))]),n.sharpen!==void 0&&(n.sharpen=formatNumber(clamp$1(n.sharpen,0,MAX_SAFE_INTEGER))),n}function imageURL(n,t){var e=__assign(__assign({},DEFAULT_IMAGE_URL_MAPPINGS),t.mappings),r=getDomain(n);if(r===null)return n;t=formatOptions(t);var o=e[r];return o?(n=route(n,t.key,o),/\.basis(\?|$)/.test(n)&&(n=n.replace(/\.basis(\?|$)/,".jpg$1")),o.type==="tencentCloud"?tencentCloudImageProcesser(n,t):o.type==="aliyun"?aliyunOOSImageProcesser(n,t):n):n}function applyImageURLOptions(n,t,e){t===void 0&&(t=imageURL);var r=t(n,e);if(r===n&&e.cut)throw new Error("ImageURL: cut option not applied.");return r}var IMAGE_SIZE_REG=/\/cube_(\d+)\//;function getImageSizeFromURL(n){var t=n.match(IMAGE_SIZE_REG);return t?Number(t[1]):null}function replaceImageSize(n,t){return n.replace(IMAGE_SIZE_REG,"/cube_".concat(t,"/"))}var log2=(_a$5=Math.log2)!==null&&_a$5!==void 0?_a$5:(function(n){return Math.log(n)*Math.LOG2E});function getImageSizeLevel(n){return Math.floor(Math.max(log2(n/512),0))}var canUseNativeImageBitmap=(function(){return!1})();function createImageBitmapLikeImage(n){n===void 0&&(n={});var t=Object.assign(document.createElementNS("http://www.w3.org/1999/xhtml","img"),{crossOrigin:"",close:function(){n.onClose&&n.onClose.call(this),this.onerror=this.onload=this.close=noop,this.removeAttribute("src")}});return t}function createImageBitmapLike(n){return new Promise(function(t,e){var r=URL.createObjectURL(n),o=createImageBitmapLikeImage({onClose:function(){this.src===r&&URL.revokeObjectURL(r)}});o.onload=function(){o.src===r&&URL.revokeObjectURL(r),o.onload=o.onerror=noop,setTimeout(function(){t(o)},10)},o.onerror=function(){var s=o.src;o.onload=o.onerror=noop,o.close(),e(new Error("image load error: ".concat(s)))},o.decoding="async",o.src=r})}var canvasPool=[];function createCanvas(n,t){var e=canvasPool.shift();if(e)return e.width=n,e.height=t,e;var r=Object.assign(document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),{close:function(){r.close=noop,canvasPool.push(r)}});return r}function poolImageToTexture(n,t){if(t&&(n.width>t.width||n.height>t.height)){var e=createCanvas(Math.min(n.width,t.width),Math.min(n.height,t.height)),r=e.getContext("2d");r.clearRect(0,0,e.width,e.height),r.drawImage(n,0,0,e.width,e.height),n.close();var o=new THREE__namespace.Texture(e);o.needsUpdate=!0,o.flipY=!0;var s=o.dispose;return o.dispose=function(){e.close(),s.call(o),o.dispose=s},o}else{var u=new THREE__namespace.Texture(n);u.needsUpdate=!0,typeof ImageBitmap!="undefined"&&n instanceof ImageBitmap?u.flipY=!1:u.flipY=!0;var l=u.dispose;return u.dispose=function(){n.close(),l.call(u),u.dispose=l},u}}function poolImagesToCubeTexture(n){var t=new THREE__namespace.CubeTexture(n);t.needsUpdate=!0,t.flipY=!1;var e=t.dispose;return t.dispose=function(){for(var r=0,o=n;r<o.length;r++){var s=o[r];s.close()}e.call(t),t.dispose=e},t}var FACE_ORDER$2=["right","left","up","down","front","back"],TextureLoader=(function(){function n(){}return n.prototype.loadTexture=function(t,e,r,o,s,u){var l,c,f,p,d,h,g;r===void 0&&(r=noop),o===void 0&&(o=noop),s===void 0&&(s=noop);var A={};typeof e.flipY!="undefined"&&(A.flipY=e.flipY),typeof e.format!="undefined"&&(A.format=e.format),typeof e.encoding!="undefined"&&(A.encoding=e.encoding),A.generateMipmaps=(l=e.generateMipmaps)!==null&&l!==void 0?l:!1,A.minFilter=(c=e.minFilter)!==null&&c!==void 0?c:THREE__namespace.LinearFilter,A.magFilter=(f=e.magFilter)!==null&&f!==void 0?f:THREE__namespace.LinearFilter;var m=(d=(p=e.imageURL)===null||p===void 0?void 0:p.options)!==null&&d!==void 0?d:{key:"unknown"};t=applyImageURLOptions(t,(h=e.imageURL)===null||h===void 0?void 0:h.transform,m);var E=(g=e.viaAjax)!==null&&g!==void 0?g:canUseNativeImageBitmap;if(E){var v=null,y="blob";return e.fetcher.ajax(t,{timeout:e.timeout,responseType:y},void 0,void 0,s).then(function(T){return createImageBitmapLike(T.body)}).then(function(T){return poolImageToTexture(T,e.maxSize)}).then(function(T){return Object.assign(T,A),T}).then(function(T){var S={meta:v,body:T};return r(S),S}).catch(function(T){return o(T),Promise.reject(T)})}else{var b=null,_;return Promise.resolve().then(function(){return createImageBitmapLikeImage()}).then(function(T){return _=T,e.fetcher.loadImage(t,{timeout:e.timeout},void 0,void 0,s,T)}).then(function(T){return b=T.meta,poolImageToTexture(T.body,e.maxSize)}).then(function(T){return Object.assign(T,A),T}).then(function(T){var S={meta:b,body:T};return r(S),S}).catch(function(T){return _&&_.close(),o(T),Promise.reject(T)})}},n.prototype.loadCubeTexture=function(t,e,r,o,s,u){var l,c,f,p,d,h,g;r===void 0&&(r=noop),o===void 0&&(o=noop),s===void 0&&(s=noop);var A={};typeof e.format!="undefined"&&(A.format=e.format),A.generateMipmaps=(l=e.generateMipmaps)!==null&&l!==void 0?l:!1,A.minFilter=(c=e.minFilter)!==null&&c!==void 0?c:THREE__namespace.LinearFilter,A.magFilter=(f=e.magFilter)!==null&&f!==void 0?f:THREE__namespace.LinearFilter;for(var m=[t[FACE_ORDER$2[0]],t[FACE_ORDER$2[1]],t[FACE_ORDER$2[2]],t[FACE_ORDER$2[3]],t[FACE_ORDER$2[4]],t[FACE_ORDER$2[5]]],E=[],v=[0,0,0,0,0,0],y=[],b=function(T){var S=(d=(p=e.imageURL)===null||p===void 0?void 0:p.options)!==null&&d!==void 0?d:{key:"unknown"},R=applyImageURLOptions(m[T],(h=e.imageURL)===null||h===void 0?void 0:h.transform,__assign(__assign({},S),{key:S.key+"."+FACE_ORDER$2[T]})),w=function(F){v[T]=F,s(v.reduce(function(L,O){return L+O},0)/6)},M=(g=e.viaAjax)!==null&&g!==void 0?g:!1;if(M){var B="blob",C=e.fetcher.ajax(R,{timeout:e.timeout,responseType:B},void 0,void 0,w).then(function(F){return y[T]=F.meta,createImageBitmapLike(F.body)});E.push(C)}else{var P,C=Promise.resolve().then(function(){return createImageBitmapLikeImage()}).then(function(L){return P=L,e.fetcher.loadImage(R,{timeout:e.timeout},void 0,void 0,w,L)}).then(function(L){return y[T]=L.meta,L.body}).catch(function(L){return P&&P.close(),Promise.reject(L)});E.push(C)}},_=0;_<6;_++)b(_);return Promise.all(E).then(function(T){return poolImagesToCubeTexture(T)}).then(function(T){return Object.assign(T,__assign({encoding:THREE__namespace.sRGBEncoding},A)),T}).then(function(T){var S={body:T,meta:y};return r(S),S}).catch(function(T){for(var S=0,R=E;S<R.length;S++){var w=R[S];w.then(function(M){return M.close()}).catch(noop)}return o(T),Promise.reject(T)})},n})(),windowSTOContext=(function(){var n=now();return{requestAnimationFrame:function(t){var e=now(),r=clamp$1(16+(e-n),16,33),o=setTimeout(function(){t(e+r)},r);return n=e+r,o},cancelAnimationFrame:function(t){return clearTimeout(t)}}})(),windowRAFContext=(function(){if(typeof window!="undefined"){var n=window;if(n.requestAnimationFrame)return{requestAnimationFrame:n.requestAnimationFrame.bind(n),cancelAnimationFrame:n.cancelAnimationFrame.bind(n)};if(n.mozRequestAnimationFrame)return{requestAnimationFrame:n.mozRequestAnimationFrame.bind(n),cancelAnimationFrame:n.mozCancelAnimationFrame.bind(n)};if(n.webkitRequestAnimationFrame)return{requestAnimationFrame:n.webkitRequestAnimationFrame.bind(n),cancelAnimationFrame:n.webkitCancelAnimationFrame.bind(n)};if(n.msRequestAnimationFrame)return{requestAnimationFrame:n.msRequestAnimationFrame.bind(n),cancelAnimationFrame:n.msCancelAnimationFrame.bind(n)}}return windowSTOContext})(),DEFAULT_ORDER=5,deviceFrameTime=16,AnimationFrameLoop=(function(){function n(){this.loopType="raf",this.frames=[],this.isAnimating=!1,this.context=null;var t=now();this.loop=(function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];if(this.isAnimating!==!1){var o=now(),s=o-t;t=o,deviceFrameTime=s;for(var u=0;u<this.frames.length;u++){var l=this.frames[u];if(l.delay>0){l.delay=l.delay-1;continue}try{l.callback.apply(l,__spreadArray([o,s],e,!1))}catch(c){console.error(c)}l.once&&(this.frames.splice(u,1),u--)}this.requestId=this.requestAnimationFrame(this.loop)}}).bind(this),this.start()}return Object.defineProperty(n,"shared",{get:function(){return this.sharedInstance||(this.sharedInstance=new n),this.sharedInstance},enumerable:!1,configurable:!0}),n.getFrameTime=function(){return deviceFrameTime},n.prototype.start=function(){this.isAnimating!==!0&&(this.isAnimating=!0,this.requestId=this.requestAnimationFrame(this.loop))},n.prototype.stop=function(){this.isAnimating=!1,this.cancelAnimationFrame(this.requestId)},n.prototype.setContext=function(t){t!==this.context&&(this.stop(),this.context=t,this.start())},n.prototype.getContext=function(){return this.context},n.prototype.setLoopType=function(t){t!==this.loopType&&(this.stop(),this.loopType=t,this.start())},n.prototype.getLoopType=function(){return this.loopType},n.prototype.requestAnimationFrame=function(t){if(this.context)return this.context.requestAnimationFrame(t);if(this.loopType==="raf")return windowRAFContext.requestAnimationFrame(t);if(this.loopType==="sto")return windowSTOContext.requestAnimationFrame(t)},n.prototype.cancelAnimationFrame=function(t){if(this.context)this.context.cancelAnimationFrame(t);else if(this.loopType==="raf")windowRAFContext.cancelAnimationFrame(t);else if(this.loopType==="sto")return windowSTOContext.cancelAnimationFrame(t)},n.prototype.remove=function(t){var e=this.frames.indexOf(t);e>=0&&this.frames.splice(e,1)},n.prototype.add=function(t,e,r,o){var s=this;e===void 0&&(e=!1),r===void 0&&(r=0),o===void 0&&(o=DEFAULT_ORDER);for(var u={callback:t,once:e,delay:r,order:o},l=this.frames.length;--l>=0;)if(this.frames[l].order<=o){this.frames.splice(l+1,0,u);break}return l<0&&this.frames.unshift(u),function(){return s.remove(u)}},n.prototype.clear=function(){this.frames.length=0},n})(),dequeuing=!1,queue=[];function dequeue(n){if(n===void 0&&(n=!1),!(!n&&dequeuing)){dequeuing=!0;var t=queue.shift();if(t){try{t()}catch(e){}AnimationFrameLoop.shared.add(function(){return dequeue(!0)},!0,2,-100)}else dequeuing=!1}}function delay$1(n){return new Promise(function(t,e){var r=function(){try{t(n())}catch(o){e(o)}};queue.push(r),AnimationFrameLoop.shared.add(function(){return dequeue()},!0,2,-100)})}var commonjsGlobal=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},indexMinimal={},minimal$1={},aspromise,hasRequiredAspromise;function requireAspromise(){if(hasRequiredAspromise)return aspromise;hasRequiredAspromise=1,aspromise=n;function n(t,e){for(var r=new Array(arguments.length-1),o=0,s=2,u=!0;s<arguments.length;)r[o++]=arguments[s++];return new Promise(function(c,f){r[o]=function(d){if(u)if(u=!1,d)f(d);else{for(var h=new Array(arguments.length-1),g=0;g<h.length;)h[g++]=arguments[g];c.apply(null,h)}};try{t.apply(e||null,r)}catch(p){u&&(u=!1,f(p))}})}return aspromise}var base64={},hasRequiredBase64;function requireBase64(){return hasRequiredBase64||(hasRequiredBase64=1,(function(n){var t=n;t.length=function(l){var c=l.length;if(!c)return 0;for(var f=0;--c%4>1&&l.charAt(c)==="=";)++f;return Math.ceil(l.length*3)/4-f};for(var e=new Array(64),r=new Array(123),o=0;o<64;)r[e[o]=o<26?o+65:o<52?o+71:o<62?o-4:o-59|43]=o++;t.encode=function(l,c,f){for(var p=null,d=[],h=0,g=0,A;c<f;){var m=l[c++];switch(g){case 0:d[h++]=e[m>>2],A=(m&3)<<4,g=1;break;case 1:d[h++]=e[A|m>>4],A=(m&15)<<2,g=2;break;case 2:d[h++]=e[A|m>>6],d[h++]=e[m&63],g=0;break}h>8191&&((p||(p=[])).push(String.fromCharCode.apply(String,d)),h=0)}return g&&(d[h++]=e[A],d[h++]=61,g===1&&(d[h++]=61)),p?(h&&p.push(String.fromCharCode.apply(String,d.slice(0,h))),p.join("")):String.fromCharCode.apply(String,d.slice(0,h))};var s="invalid encoding";t.decode=function(l,c,f){for(var p=f,d=0,h,g=0;g<l.length;){var A=l.charCodeAt(g++);if(A===61&&d>1)break;if((A=r[A])===void 0)throw Error(s);switch(d){case 0:h=A,d=1;break;case 1:c[f++]=h<<2|(A&48)>>4,h=A,d=2;break;case 2:c[f++]=(h&15)<<4|(A&60)>>2,h=A,d=3;break;case 3:c[f++]=(h&3)<<6|A,d=0;break}}if(d===1)throw Error(s);return f-p},t.test=function(l){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(l)}})(base64)),base64}var eventemitter,hasRequiredEventemitter;function requireEventemitter(){if(hasRequiredEventemitter)return eventemitter;hasRequiredEventemitter=1,eventemitter=n;function n(){this._listeners={}}return n.prototype.on=function(e,r,o){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:r,ctx:o||this}),this},n.prototype.off=function(e,r){if(e===void 0)this._listeners={};else if(r===void 0)this._listeners[e]=[];else for(var o=this._listeners[e],s=0;s<o.length;)o[s].fn===r?o.splice(s,1):++s;return this},n.prototype.emit=function(e){var r=this._listeners[e];if(r){for(var o=[],s=1;s<arguments.length;)o.push(arguments[s++]);for(s=0;s<r.length;)r[s].fn.apply(r[s++].ctx,o)}return this},eventemitter}var float,hasRequiredFloat;function requireFloat(){if(hasRequiredFloat)return float;hasRequiredFloat=1,float=n(n);function n(s){return typeof Float32Array!="undefined"?(function(){var u=new Float32Array([-0]),l=new Uint8Array(u.buffer),c=l[3]===128;function f(g,A,m){u[0]=g,A[m]=l[0],A[m+1]=l[1],A[m+2]=l[2],A[m+3]=l[3]}function p(g,A,m){u[0]=g,A[m]=l[3],A[m+1]=l[2],A[m+2]=l[1],A[m+3]=l[0]}s.writeFloatLE=c?f:p,s.writeFloatBE=c?p:f;function d(g,A){return l[0]=g[A],l[1]=g[A+1],l[2]=g[A+2],l[3]=g[A+3],u[0]}function h(g,A){return l[3]=g[A],l[2]=g[A+1],l[1]=g[A+2],l[0]=g[A+3],u[0]}s.readFloatLE=c?d:h,s.readFloatBE=c?h:d})():(function(){function u(c,f,p,d){var h=f<0?1:0;if(h&&(f=-f),f===0)c(1/f>0?0:2147483648,p,d);else if(isNaN(f))c(2143289344,p,d);else if(f>34028234663852886e22)c((h<<31|2139095040)>>>0,p,d);else if(f<11754943508222875e-54)c((h<<31|Math.round(f/1401298464324817e-60))>>>0,p,d);else{var g=Math.floor(Math.log(f)/Math.LN2),A=Math.round(f*Math.pow(2,-g)*8388608)&8388607;c((h<<31|g+127<<23|A)>>>0,p,d)}}s.writeFloatLE=u.bind(null,t),s.writeFloatBE=u.bind(null,e);function l(c,f,p){var d=c(f,p),h=(d>>31)*2+1,g=d>>>23&255,A=d&8388607;return g===255?A?NaN:h*(1/0):g===0?h*1401298464324817e-60*A:h*Math.pow(2,g-150)*(A+8388608)}s.readFloatLE=l.bind(null,r),s.readFloatBE=l.bind(null,o)})(),typeof Float64Array!="undefined"?(function(){var u=new Float64Array([-0]),l=new Uint8Array(u.buffer),c=l[7]===128;function f(g,A,m){u[0]=g,A[m]=l[0],A[m+1]=l[1],A[m+2]=l[2],A[m+3]=l[3],A[m+4]=l[4],A[m+5]=l[5],A[m+6]=l[6],A[m+7]=l[7]}function p(g,A,m){u[0]=g,A[m]=l[7],A[m+1]=l[6],A[m+2]=l[5],A[m+3]=l[4],A[m+4]=l[3],A[m+5]=l[2],A[m+6]=l[1],A[m+7]=l[0]}s.writeDoubleLE=c?f:p,s.writeDoubleBE=c?p:f;function d(g,A){return l[0]=g[A],l[1]=g[A+1],l[2]=g[A+2],l[3]=g[A+3],l[4]=g[A+4],l[5]=g[A+5],l[6]=g[A+6],l[7]=g[A+7],u[0]}function h(g,A){return l[7]=g[A],l[6]=g[A+1],l[5]=g[A+2],l[4]=g[A+3],l[3]=g[A+4],l[2]=g[A+5],l[1]=g[A+6],l[0]=g[A+7],u[0]}s.readDoubleLE=c?d:h,s.readDoubleBE=c?h:d})():(function(){function u(c,f,p,d,h,g){var A=d<0?1:0;if(A&&(d=-d),d===0)c(0,h,g+f),c(1/d>0?0:2147483648,h,g+p);else if(isNaN(d))c(0,h,g+f),c(2146959360,h,g+p);else if(d>17976931348623157e292)c(0,h,g+f),c((A<<31|2146435072)>>>0,h,g+p);else{var m;if(d<22250738585072014e-324)m=d/5e-324,c(m>>>0,h,g+f),c((A<<31|m/4294967296)>>>0,h,g+p);else{var E=Math.floor(Math.log(d)/Math.LN2);E===1024&&(E=1023),m=d*Math.pow(2,-E),c(m*4503599627370496>>>0,h,g+f),c((A<<31|E+1023<<20|m*1048576&1048575)>>>0,h,g+p)}}}s.writeDoubleLE=u.bind(null,t,0,4),s.writeDoubleBE=u.bind(null,e,4,0);function l(c,f,p,d,h){var g=c(d,h+f),A=c(d,h+p),m=(A>>31)*2+1,E=A>>>20&2047,v=4294967296*(A&1048575)+g;return E===2047?v?NaN:m*(1/0):E===0?m*5e-324*v:m*Math.pow(2,E-1075)*(v+4503599627370496)}s.readDoubleLE=l.bind(null,r,0,4),s.readDoubleBE=l.bind(null,o,4,0)})(),s}function t(s,u,l){u[l]=s&255,u[l+1]=s>>>8&255,u[l+2]=s>>>16&255,u[l+3]=s>>>24}function e(s,u,l){u[l]=s>>>24,u[l+1]=s>>>16&255,u[l+2]=s>>>8&255,u[l+3]=s&255}function r(s,u){return(s[u]|s[u+1]<<8|s[u+2]<<16|s[u+3]<<24)>>>0}function o(s,u){return(s[u]<<24|s[u+1]<<16|s[u+2]<<8|s[u+3])>>>0}return float}var inquire_1,hasRequiredInquire;function requireInquire(){if(hasRequiredInquire)return inquire_1;hasRequiredInquire=1,inquire_1=inquire;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(n){}return null}return inquire_1}var utf8={},hasRequiredUtf8;function requireUtf8(){return hasRequiredUtf8||(hasRequiredUtf8=1,(function(n){var t=n;t.length=function(r){for(var o=0,s=0,u=0;u<r.length;++u)s=r.charCodeAt(u),s<128?o+=1:s<2048?o+=2:(s&64512)===55296&&(r.charCodeAt(u+1)&64512)===56320?(++u,o+=4):o+=3;return o},t.read=function(r,o,s){var u=s-o;if(u<1)return"";for(var l=null,c=[],f=0,p;o<s;)p=r[o++],p<128?c[f++]=p:p>191&&p<224?c[f++]=(p&31)<<6|r[o++]&63:p>239&&p<365?(p=((p&7)<<18|(r[o++]&63)<<12|(r[o++]&63)<<6|r[o++]&63)-65536,c[f++]=55296+(p>>10),c[f++]=56320+(p&1023)):c[f++]=(p&15)<<12|(r[o++]&63)<<6|r[o++]&63,f>8191&&((l||(l=[])).push(String.fromCharCode.apply(String,c)),f=0);return l?(f&&l.push(String.fromCharCode.apply(String,c.slice(0,f))),l.join("")):String.fromCharCode.apply(String,c.slice(0,f))},t.write=function(r,o,s){for(var u=s,l,c,f=0;f<r.length;++f)l=r.charCodeAt(f),l<128?o[s++]=l:l<2048?(o[s++]=l>>6|192,o[s++]=l&63|128):(l&64512)===55296&&((c=r.charCodeAt(f+1))&64512)===56320?(l=65536+((l&1023)<<10)+(c&1023),++f,o[s++]=l>>18|240,o[s++]=l>>12&63|128,o[s++]=l>>6&63|128,o[s++]=l&63|128):(o[s++]=l>>12|224,o[s++]=l>>6&63|128,o[s++]=l&63|128);return s-u}})(utf8)),utf8}var pool_1,hasRequiredPool;function requirePool(){if(hasRequiredPool)return pool_1;hasRequiredPool=1,pool_1=n;function n(t,e,r){var o=r||8192,s=o>>>1,u=null,l=o;return function(f){if(f<1||f>s)return t(f);l+f>o&&(u=t(o),l=0);var p=e.call(u,l,l+=f);return l&7&&(l=(l|7)+1),p}}return pool_1}var longbits,hasRequiredLongbits;function requireLongbits(){if(hasRequiredLongbits)return longbits;hasRequiredLongbits=1,longbits=t;var n=requireMinimal$1();function t(s,u){this.lo=s>>>0,this.hi=u>>>0}var e=t.zero=new t(0,0);e.toNumber=function(){return 0},e.zzEncode=e.zzDecode=function(){return this},e.length=function(){return 1};var r=t.zeroHash="\0\0\0\0\0\0\0\0";t.fromNumber=function(u){if(u===0)return e;var l=u<0;l&&(u=-u);var c=u>>>0,f=(u-c)/4294967296>>>0;return l&&(f=~f>>>0,c=~c>>>0,++c>4294967295&&(c=0,++f>4294967295&&(f=0))),new t(c,f)},t.from=function(u){if(typeof u=="number")return t.fromNumber(u);if(n.isString(u))if(n.Long)u=n.Long.fromString(u);else return t.fromNumber(parseInt(u,10));return u.low||u.high?new t(u.low>>>0,u.high>>>0):e},t.prototype.toNumber=function(u){if(!u&&this.hi>>>31){var l=~this.lo+1>>>0,c=~this.hi>>>0;return l||(c=c+1>>>0),-(l+c*4294967296)}return this.lo+this.hi*4294967296},t.prototype.toLong=function(u){return n.Long?new n.Long(this.lo|0,this.hi|0,!!u):{low:this.lo|0,high:this.hi|0,unsigned:!!u}};var o=String.prototype.charCodeAt;return t.fromHash=function(u){return u===r?e:new t((o.call(u,0)|o.call(u,1)<<8|o.call(u,2)<<16|o.call(u,3)<<24)>>>0,(o.call(u,4)|o.call(u,5)<<8|o.call(u,6)<<16|o.call(u,7)<<24)>>>0)},t.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},t.prototype.zzEncode=function(){var u=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^u)>>>0,this.lo=(this.lo<<1^u)>>>0,this},t.prototype.zzDecode=function(){var u=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^u)>>>0,this.hi=(this.hi>>>1^u)>>>0,this},t.prototype.length=function(){var u=this.lo,l=(this.lo>>>28|this.hi<<4)>>>0,c=this.hi>>>24;return c===0?l===0?u<16384?u<128?1:2:u<2097152?3:4:l<16384?l<128?5:6:l<2097152?7:8:c<128?9:10},longbits}var hasRequiredMinimal$1;function requireMinimal$1(){return hasRequiredMinimal$1||(hasRequiredMinimal$1=1,(function(n){var t=n;t.asPromise=requireAspromise(),t.base64=requireBase64(),t.EventEmitter=requireEventemitter(),t.float=requireFloat(),t.inquire=requireInquire(),t.utf8=requireUtf8(),t.pool=requirePool(),t.LongBits=requireLongbits(),t.isNode=!!(typeof commonjsGlobal!="undefined"&&commonjsGlobal&&commonjsGlobal.process&&commonjsGlobal.process.versions&&commonjsGlobal.process.versions.node),t.global=t.isNode&&commonjsGlobal||typeof window!="undefined"&&window||typeof self!="undefined"&&self||minimal$1,t.emptyArray=Object.freeze?Object.freeze([]):[],t.emptyObject=Object.freeze?Object.freeze({}):{},t.isInteger=Number.isInteger||function(s){return typeof s=="number"&&isFinite(s)&&Math.floor(s)===s},t.isString=function(s){return typeof s=="string"||s instanceof String},t.isObject=function(s){return s&&typeof s=="object"},t.isset=t.isSet=function(s,u){var l=s[u];return l!=null&&s.hasOwnProperty(u)?typeof l!="object"||(Array.isArray(l)?l.length:Object.keys(l).length)>0:!1},t.Buffer=(function(){try{var o=t.inquire("buffer").Buffer;return o.prototype.utf8Write?o:null}catch(s){return null}})(),t._Buffer_from=null,t._Buffer_allocUnsafe=null,t.newBuffer=function(s){return typeof s=="number"?t.Buffer?t._Buffer_allocUnsafe(s):new t.Array(s):t.Buffer?t._Buffer_from(s):typeof Uint8Array=="undefined"?s:new Uint8Array(s)},t.Array=typeof Uint8Array!="undefined"?Uint8Array:Array,t.Long=t.global.dcodeIO&&t.global.dcodeIO.Long||t.global.Long||t.inquire("long"),t.key2Re=/^true|false|0|1$/,t.key32Re=/^-?(?:0|[1-9][0-9]*)$/,t.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,t.longToHash=function(s){return s?t.LongBits.from(s).toHash():t.LongBits.zeroHash},t.longFromHash=function(s,u){var l=t.LongBits.fromHash(s);return t.Long?t.Long.fromBits(l.lo,l.hi,u):l.toNumber(!!u)};function e(o,s,u){for(var l=Object.keys(s),c=0;c<l.length;++c)(o[l[c]]===void 0||!u)&&(o[l[c]]=s[l[c]]);return o}t.merge=e,t.lcFirst=function(s){return s.charAt(0).toLowerCase()+s.substring(1)};function r(o){function s(u,l){if(!(this instanceof s))return new s(u,l);Object.defineProperty(this,"message",{get:function(){return u}}),Error.captureStackTrace?Error.captureStackTrace(this,s):Object.defineProperty(this,"stack",{value:new Error().stack||""}),l&&e(this,l)}return s.prototype=Object.create(Error.prototype,{constructor:{value:s,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return o},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),s}t.newError=r,t.ProtocolError=r("ProtocolError"),t.oneOfGetter=function(s){for(var u={},l=0;l<s.length;++l)u[s[l]]=1;return function(){for(var c=Object.keys(this),f=c.length-1;f>-1;--f)if(u[c[f]]===1&&this[c[f]]!==void 0&&this[c[f]]!==null)return c[f]}},t.oneOfSetter=function(s){return function(u){for(var l=0;l<s.length;++l)s[l]!==u&&delete this[s[l]]}},t.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},t._configure=function(){var o=t.Buffer;if(!o){t._Buffer_from=t._Buffer_allocUnsafe=null;return}t._Buffer_from=o.from!==Uint8Array.from&&o.from||function(u,l){return new o(u,l)},t._Buffer_allocUnsafe=o.allocUnsafe||function(u){return new o(u)}}})(minimal$1)),minimal$1}var writer,hasRequiredWriter;function requireWriter(){if(hasRequiredWriter)return writer;hasRequiredWriter=1,writer=c;var n=requireMinimal$1(),t,e=n.LongBits,r=n.base64,o=n.utf8;function s(E,v,y){this.fn=E,this.len=v,this.next=void 0,this.val=y}function u(){}function l(E){this.head=E.head,this.tail=E.tail,this.len=E.len,this.next=E.states}function c(){this.len=0,this.head=new s(u,0,0),this.tail=this.head,this.states=null}var f=function(){return n.Buffer?function(){return(c.create=function(){return new t})()}:function(){return new c}};c.create=f(),c.alloc=function(v){return new n.Array(v)},n.Array!==Array&&(c.alloc=n.pool(c.alloc,n.Array.prototype.subarray)),c.prototype._push=function(v,y,b){return this.tail=this.tail.next=new s(v,y,b),this.len+=y,this};function p(E,v,y){v[y]=E&255}function d(E,v,y){for(;E>127;)v[y++]=E&127|128,E>>>=7;v[y]=E}function h(E,v){this.len=E,this.next=void 0,this.val=v}h.prototype=Object.create(s.prototype),h.prototype.fn=d,c.prototype.uint32=function(v){return this.len+=(this.tail=this.tail.next=new h((v=v>>>0)<128?1:v<16384?2:v<2097152?3:v<268435456?4:5,v)).len,this},c.prototype.int32=function(v){return v<0?this._push(g,10,e.fromNumber(v)):this.uint32(v)},c.prototype.sint32=function(v){return this.uint32((v<<1^v>>31)>>>0)};function g(E,v,y){for(;E.hi;)v[y++]=E.lo&127|128,E.lo=(E.lo>>>7|E.hi<<25)>>>0,E.hi>>>=7;for(;E.lo>127;)v[y++]=E.lo&127|128,E.lo=E.lo>>>7;v[y++]=E.lo}c.prototype.uint64=function(v){var y=e.from(v);return this._push(g,y.length(),y)},c.prototype.int64=c.prototype.uint64,c.prototype.sint64=function(v){var y=e.from(v).zzEncode();return this._push(g,y.length(),y)},c.prototype.bool=function(v){return this._push(p,1,v?1:0)};function A(E,v,y){v[y]=E&255,v[y+1]=E>>>8&255,v[y+2]=E>>>16&255,v[y+3]=E>>>24}c.prototype.fixed32=function(v){return this._push(A,4,v>>>0)},c.prototype.sfixed32=c.prototype.fixed32,c.prototype.fixed64=function(v){var y=e.from(v);return this._push(A,4,y.lo)._push(A,4,y.hi)},c.prototype.sfixed64=c.prototype.fixed64,c.prototype.float=function(v){return this._push(n.float.writeFloatLE,4,v)},c.prototype.double=function(v){return this._push(n.float.writeDoubleLE,8,v)};var m=n.Array.prototype.set?function(v,y,b){y.set(v,b)}:function(v,y,b){for(var _=0;_<v.length;++_)y[b+_]=v[_]};return c.prototype.bytes=function(v){var y=v.length>>>0;if(!y)return this._push(p,1,0);if(n.isString(v)){var b=c.alloc(y=r.length(v));r.decode(v,b,0),v=b}return this.uint32(y)._push(m,y,v)},c.prototype.string=function(v){var y=o.length(v);return y?this.uint32(y)._push(o.write,y,v):this._push(p,1,0)},c.prototype.fork=function(){return this.states=new l(this),this.head=this.tail=new s(u,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 s(u,0,0),this.len=0),this},c.prototype.ldelim=function(){var v=this.head,y=this.tail,b=this.len;return this.reset().uint32(b),b&&(this.tail.next=v.next,this.tail=y,this.len+=b),this},c.prototype.finish=function(){for(var v=this.head.next,y=this.constructor.alloc(this.len),b=0;v;)v.fn(v.val,y,b),b+=v.len,v=v.next;return y},c._configure=function(E){t=E,c.create=f(),t._configure()},writer}var writer_buffer,hasRequiredWriter_buffer;function requireWriter_buffer(){if(hasRequiredWriter_buffer)return writer_buffer;hasRequiredWriter_buffer=1,writer_buffer=e;var n=requireWriter();(e.prototype=Object.create(n.prototype)).constructor=e;var t=requireMinimal$1();function e(){n.call(this)}e._configure=function(){e.alloc=t._Buffer_allocUnsafe,e.writeBytesBuffer=t.Buffer&&t.Buffer.prototype instanceof Uint8Array&&t.Buffer.prototype.set.name==="set"?function(s,u,l){u.set(s,l)}:function(s,u,l){if(s.copy)s.copy(u,l,0,s.length);else for(var c=0;c<s.length;)u[l++]=s[c++]}},e.prototype.bytes=function(s){t.isString(s)&&(s=t._Buffer_from(s,"base64"));var u=s.length>>>0;return this.uint32(u),u&&this._push(e.writeBytesBuffer,u,s),this};function r(o,s,u){o.length<40?t.utf8.write(o,s,u):s.utf8Write?s.utf8Write(o,u):s.write(o,u)}return e.prototype.string=function(s){var u=t.Buffer.byteLength(s);return this.uint32(u),u&&this._push(r,u,s),this},e._configure(),writer_buffer}var reader,hasRequiredReader;function requireReader(){if(hasRequiredReader)return reader;hasRequiredReader=1,reader=s;var n=requireMinimal$1(),t,e=n.LongBits,r=n.utf8;function o(d,h){return RangeError("index out of range: "+d.pos+" + "+(h||1)+" > "+d.len)}function s(d){this.buf=d,this.pos=0,this.len=d.length}var u=typeof Uint8Array!="undefined"?function(h){if(h instanceof Uint8Array||Array.isArray(h))return new s(h);throw Error("illegal buffer")}:function(h){if(Array.isArray(h))return new s(h);throw Error("illegal buffer")},l=function(){return n.Buffer?function(g){return(s.create=function(m){return n.Buffer.isBuffer(m)?new t(m):u(m)})(g)}:u};s.create=l(),s.prototype._slice=n.Array.prototype.subarray||n.Array.prototype.slice,s.prototype.uint32=(function(){var h=4294967295;return function(){if(h=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(h=(h|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(h=(h|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(h=(h|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(h=(h|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return h;if((this.pos+=5)>this.len)throw this.pos=this.len,o(this,10);return h}})(),s.prototype.int32=function(){return this.uint32()|0},s.prototype.sint32=function(){var h=this.uint32();return h>>>1^-(h&1)|0};function c(){var d=new e(0,0),h=0;if(this.len-this.pos>4){for(;h<4;++h)if(d.lo=(d.lo|(this.buf[this.pos]&127)<<h*7)>>>0,this.buf[this.pos++]<128)return d;if(d.lo=(d.lo|(this.buf[this.pos]&127)<<28)>>>0,d.hi=(d.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return d;h=0}else{for(;h<3;++h){if(this.pos>=this.len)throw o(this);if(d.lo=(d.lo|(this.buf[this.pos]&127)<<h*7)>>>0,this.buf[this.pos++]<128)return d}return d.lo=(d.lo|(this.buf[this.pos++]&127)<<h*7)>>>0,d}if(this.len-this.pos>4){for(;h<5;++h)if(d.hi=(d.hi|(this.buf[this.pos]&127)<<h*7+3)>>>0,this.buf[this.pos++]<128)return d}else for(;h<5;++h){if(this.pos>=this.len)throw o(this);if(d.hi=(d.hi|(this.buf[this.pos]&127)<<h*7+3)>>>0,this.buf[this.pos++]<128)return d}throw Error("invalid varint encoding")}s.prototype.bool=function(){return this.uint32()!==0};function f(d,h){return(d[h-4]|d[h-3]<<8|d[h-2]<<16|d[h-1]<<24)>>>0}s.prototype.fixed32=function(){if(this.pos+4>this.len)throw o(this,4);return f(this.buf,this.pos+=4)},s.prototype.sfixed32=function(){if(this.pos+4>this.len)throw o(this,4);return f(this.buf,this.pos+=4)|0};function p(){if(this.pos+8>this.len)throw o(this,8);return new e(f(this.buf,this.pos+=4),f(this.buf,this.pos+=4))}return s.prototype.float=function(){if(this.pos+4>this.len)throw o(this,4);var h=n.float.readFloatLE(this.buf,this.pos);return this.pos+=4,h},s.prototype.double=function(){if(this.pos+8>this.len)throw o(this,4);var h=n.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,h},s.prototype.bytes=function(){var h=this.uint32(),g=this.pos,A=this.pos+h;if(A>this.len)throw o(this,h);if(this.pos+=h,Array.isArray(this.buf))return this.buf.slice(g,A);if(g===A){var m=n.Buffer;return m?m.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,g,A)},s.prototype.string=function(){var h=this.bytes();return r.read(h,0,h.length)},s.prototype.skip=function(h){if(typeof h=="number"){if(this.pos+h>this.len)throw o(this,h);this.pos+=h}else do if(this.pos>=this.len)throw o(this);while(this.buf[this.pos++]&128);return this},s.prototype.skipType=function(d){switch(d){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(d=this.uint32()&7)!==4;)this.skipType(d);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+d+" at offset "+this.pos)}return this},s._configure=function(d){t=d,s.create=l(),t._configure();var h=n.Long?"toLong":"toNumber";n.merge(s.prototype,{int64:function(){return c.call(this)[h](!1)},uint64:function(){return c.call(this)[h](!0)},sint64:function(){return c.call(this).zzDecode()[h](!1)},fixed64:function(){return p.call(this)[h](!0)},sfixed64:function(){return p.call(this)[h](!1)}})},reader}var reader_buffer,hasRequiredReader_buffer;function requireReader_buffer(){if(hasRequiredReader_buffer)return reader_buffer;hasRequiredReader_buffer=1,reader_buffer=e;var n=requireReader();(e.prototype=Object.create(n.prototype)).constructor=e;var t=requireMinimal$1();function e(r){n.call(this,r)}return e._configure=function(){t.Buffer&&(e.prototype._slice=t.Buffer.prototype.slice)},e.prototype.string=function(){var o=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+o,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+o,this.len))},e._configure(),reader_buffer}var rpc={},service,hasRequiredService;function requireService(){if(hasRequiredService)return service;hasRequiredService=1,service=t;var n=requireMinimal$1();(t.prototype=Object.create(n.EventEmitter.prototype)).constructor=t;function t(e,r,o){if(typeof e!="function")throw TypeError("rpcImpl must be a function");n.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=!!r,this.responseDelimited=!!o}return t.prototype.rpcCall=function e(r,o,s,u,l){if(!u)throw TypeError("request must be specified");var c=this;if(!l)return n.asPromise(e,c,r,o,s,u);if(!c.rpcImpl){setTimeout(function(){l(Error("already ended"))},0);return}try{return c.rpcImpl(r,o[c.requestDelimited?"encodeDelimited":"encode"](u).finish(),function(p,d){if(p)return c.emit("error",p,r),l(p);if(d===null){c.end(!0);return}if(!(d instanceof s))try{d=s[c.responseDelimited?"decodeDelimited":"decode"](d)}catch(h){return c.emit("error",h,r),l(h)}return c.emit("data",d,r),l(null,d)})}catch(f){c.emit("error",f,r),setTimeout(function(){l(f)},0);return}},t.prototype.end=function(r){return this.rpcImpl&&(r||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this},service}var hasRequiredRpc;function requireRpc(){return hasRequiredRpc||(hasRequiredRpc=1,(function(n){var t=n;t.Service=requireService()})(rpc)),rpc}var roots,hasRequiredRoots;function requireRoots(){return hasRequiredRoots||(hasRequiredRoots=1,roots={}),roots}var hasRequiredIndexMinimal;function requireIndexMinimal(){return hasRequiredIndexMinimal||(hasRequiredIndexMinimal=1,(function(n){var t=n;t.build="minimal",t.Writer=requireWriter(),t.BufferWriter=requireWriter_buffer(),t.Reader=requireReader(),t.BufferReader=requireReader_buffer(),t.util=requireMinimal$1(),t.rpc=requireRpc(),t.roots=requireRoots(),t.configure=e;function e(){t.util._configure(),t.Writer._configure(t.BufferWriter),t.Reader._configure(t.BufferReader)}e()})(indexMinimal)),indexMinimal}var minimal,hasRequiredMinimal;function requireMinimal(){return hasRequiredMinimal||(hasRequiredMinimal=1,minimal=requireIndexMinimal()),minimal}var minimalExports=requireMinimal();const $Reader$1=minimalExports.Reader,$util$1=minimalExports.util,$root$1=minimalExports.roots["@REALSEE/FIVE:five/model/loaders/protobuf/pbm.proto"]||(minimalExports.roots["@REALSEE/FIVE:five/model/loaders/protobuf/pbm.proto"]={}),Model$2=$root$1.Model=(()=>{function n(t){if(this.chunks=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.chunks=$util$1.emptyArray,n.prototype.createAt=$util$1.Long?$util$1.Long.fromBits(0,0,!0):0,n.prototype.description="",n.decode=function(e,r,o){e instanceof $Reader$1||(e=$Reader$1.create(e));let s=r===void 0?e.len:e.pos+r,u=new $root$1.Model;for(;e.pos<s;){let l=e.uint32();if(l===o)break;switch(l>>>3){case 1:{u.chunks&&u.chunks.length||(u.chunks=[]),u.chunks.push($root$1.Chunk.decode(e,e.uint32()));break}case 2:{u.createAt=e.uint64();break}case 3:{u.description=e.string();break}default:e.skipType(l&7);break}}return u},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Model"},n})();$root$1.Chunk=(()=>{function n(t){if(t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.vertices=null,n.prototype.faces=null,n.prototype.name="",n.prototype.texture="",n.decode=function(e,r,o){e instanceof $Reader$1||(e=$Reader$1.create(e));let s=r===void 0?e.len:e.pos+r,u=new $root$1.Chunk;for(;e.pos<s;){let l=e.uint32();if(l===o)break;switch(l>>>3){case 1:{u.vertices=$root$1.Vertices.decode(e,e.uint32());break}case 2:{u.faces=$root$1.Faces.decode(e,e.uint32());break}case 3:{u.name=e.string();break}case 4:{u.texture=e.string();break}default:e.skipType(l&7);break}}if(!u.hasOwnProperty("vertices"))throw $util$1.ProtocolError("missing required 'vertices'",{instance:u});if(!u.hasOwnProperty("faces"))throw $util$1.ProtocolError("missing required 'faces'",{instance:u});if(!u.hasOwnProperty("name"))throw $util$1.ProtocolError("missing required 'name'",{instance:u});return u},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Chunk"},n})();$root$1.Vertices=(()=>{function n(t){if(this.xyz=[],this.uvs=[],this.marks=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.xyz=$util$1.emptyArray,n.prototype.uvs=$util$1.emptyArray,n.prototype.marks=$util$1.emptyArray,n.decode=function(e,r,o){e instanceof $Reader$1||(e=$Reader$1.create(e));let s=r===void 0?e.len:e.pos+r,u=new $root$1.Vertices;for(;e.pos<s;){let l=e.uint32();if(l===o)break;switch(l>>>3){case 1:{if(u.xyz&&u.xyz.length||(u.xyz=[]),(l&7)===2){let c=e.uint32()+e.pos;for(;e.pos<c;)u.xyz.push(e.float())}else u.xyz.push(e.float());break}case 2:{if(u.uvs&&u.uvs.length||(u.uvs=[]),(l&7)===2){let c=e.uint32()+e.pos;for(;e.pos<c;)u.uvs.push(e.float())}else u.uvs.push(e.float());break}case 3:{if(u.marks&&u.marks.length||(u.marks=[]),(l&7)===2){let c=e.uint32()+e.pos;for(;e.pos<c;)u.marks.push(e.int32())}else u.marks.push(e.int32());break}default:e.skipType(l&7);break}}return u},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Vertices"},n})();$root$1.Faces=(()=>{function n(t){if(this.indices=[],this.normals=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.indices=$util$1.emptyArray,n.prototype.normals=$util$1.emptyArray,n.decode=function(e,r,o){e instanceof $Reader$1||(e=$Reader$1.create(e));let s=r===void 0?e.len:e.pos+r,u=new $root$1.Faces;for(;e.pos<s;){let l=e.uint32();if(l===o)break;switch(l>>>3){case 1:{if(u.indices&&u.indices.length||(u.indices=[]),(l&7)===2){let c=e.uint32()+e.pos;for(;e.pos<c;)u.indices.push(e.uint32())}else u.indices.push(e.uint32());break}case 2:{if(u.normals&&u.normals.length||(u.normals=[]),(l&7)===2){let c=e.uint32()+e.pos;for(;e.pos<c;)u.normals.push(e.float())}else u.normals.push(e.float());break}default:e.skipType(l&7);break}}return u},n.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/Faces"},n})();$root$1.VertexMark=(()=>{const n={},t=Object.create(n);return t[n[0]="VERTEX_MARK_UNSPECIFIED"]=0,t[n[1]="VERTEX_MARK_ROOF"]=1,t})();function fixNumber(n){return isNaN(n)||!isFinite(n)?0:n}function getGeometryMemoryUsed(n){var t=0;if(n instanceof THREE__namespace.BufferGeometry){for(var e in n.attributes){var r=n.getAttribute(e),o=4;"BYTES_PER_ELEMENT"in r.array&&typeof r.array.BYTES_PER_ELEMENT=="number"&&(o=r.array.BYTES_PER_ELEMENT),t+=fixNumber(r.count*r.itemSize*o)}var s=n.getIndex();if(s){var o=4;"BYTES_PER_ELEMENT"in s.array&&typeof s.array.BYTES_PER_ELEMENT=="number"&&(o=s.array.BYTES_PER_ELEMENT),t+=fixNumber(s.count*s.itemSize*o)}}else n instanceof THREE__namespace.Geometry&&(t+=fixNumber(n.faces.length*3*3*4),t+=fixNumber(n.faceVertexUvs.length*3*2*4));return t}function makeComputeBlockRectSizeFunction(n,t,e){return function(r,o,s){var u=(r+n-1)/n|0,l=(o+t-1)/t|0;return u*l*e*s}}function makeComputePaddedRectSizeFunction(n,t,e){return function(r,o,s){return(Math.max(r,n)*Math.max(o,t)/e|0)*s}}var compressedTextureFunctions=new Map([[THREE__namespace.RGB_S3TC_DXT1_Format,makeComputeBlockRectSizeFunction(4,4,8)],[THREE__namespace.RGBA_S3TC_DXT1_Format,makeComputeBlockRectSizeFunction(4,4,8)],[THREE__namespace.RGBA_S3TC_DXT3_Format,makeComputeBlockRectSizeFunction(4,4,16)],[THREE__namespace.RGBA_S3TC_DXT5_Format,makeComputeBlockRectSizeFunction(4,4,16)],[THREE__namespace.RGB_ETC1_Format,makeComputeBlockRectSizeFunction(4,4,8)],[THREE__namespace.RGB_PVRTC_4BPPV1_Format,makeComputePaddedRectSizeFunction(8,8,2)],[THREE__namespace.RGBA_PVRTC_4BPPV1_Format,makeComputePaddedRectSizeFunction(8,8,2)],[THREE__namespace.RGB_PVRTC_2BPPV1_Format,makeComputePaddedRectSizeFunction(16,8,4)],[THREE__namespace.RGBA_PVRTC_2BPPV1_Format,makeComputePaddedRectSizeFunction(16,8,4)],[THREE__namespace.RGB_ETC2_Format,makeComputeBlockRectSizeFunction(4,4,8)],[THREE__namespace.RGBA_ETC2_EAC_Format,makeComputeBlockRectSizeFunction(4,4,16)],[THREE__namespace.RGBA_ASTC_4x4_Format,makeComputeBlockRectSizeFunction(4,4,16)],[THREE__namespace.SRGB8_ALPHA8_ASTC_4x4_Format,makeComputeBlockRectSizeFunction(4,4,16)],[THREE__namespace.RGBA_ASTC_5x4_Format,makeComputeBlockRectSizeFunction(5,4,16)],[THREE__namespace.SRGB8_ALPHA8_ASTC_5x4_Format,makeComputeBlockRectSizeFunction(5,4,16)],[THREE__namespace.RGBA_ASTC_5x5_Format,makeComputeBlockRectSizeFunction(5,5,16)],[THREE__namespace.SRGB8_ALPHA8_ASTC_5x5_Format,makeComputeBlockRectSizeFunction(5,5,16)],[THREE__namespace.RGBA_ASTC_6x5_Format,makeComputeBlockRectSizeFunction(6,5,16)],[THREE__namespace.SRGB8_ALPHA8_ASTC_6x5_Format,makeComputeBlockRectSizeFunction(6,5,16)],[THREE__namespace.RGBA_ASTC_6x6_Format,makeComputeBlockRectSizeFunction(6,6,16)],[THREE__namespace.SRGB8_ALPHA8_ASTC_6x6_Format,makeComputeBlockRectSizeFunction(6,6,16)],[THREE__namespace.RGBA_ASTC_8x5_Format,makeComputeBlockRectSizeFunction(8,5,16)],[THREE__namespace.SRGB8_ALPHA8_ASTC_8x5_Format,makeComputeBlockRectSizeFunction(8,5,16)],[THREE__namespace.RGBA_ASTC_8x6_Format,makeComputeBlockRectSizeFunction(8,6,16)],[THREE__namespace.SRGB8_ALPHA8_ASTC_8x6_Format,makeComputeBlockRectSizeFunction(8,6,16)],[THREE__namespace.RGBA_ASTC_8x8_Format,makeComputeBlockRectSizeFunction(8,8,16)],[THREE__namespace.SRGB8_ALPHA8_ASTC_8x8_Format,makeComputeBlockRectSizeFunction(8,8,16)],[THREE__namespace.RGBA_ASTC_10x5_Format,makeComputeBlockRectSizeFunction(10,5,16)],[THREE__namespace.SRGB8_ALPHA8_ASTC_10x5_Format,makeComputeBlockRectSizeFunction(10,5,16)],[THREE__namespace.RGBA_ASTC_10x6_Format,makeComputeBlockRectSizeFunction(10,6,16)],[THREE__namespace.SRGB8_ALPHA8_ASTC_10x6_Format,makeComputeBlockRectSizeFunction(10,6,16)],[THREE__namespace.RGBA_ASTC_10x8_Format,makeComputeBlockRectSizeFunction(10,8,16)],[THREE__namespace.SRGB8_ALPHA8_ASTC_10x8_Format,makeComputeBlockRectSizeFunction(10,8,16)],[THREE__namespace.RGBA_ASTC_10x10_Format,makeComputeBlockRectSizeFunction(10,10,16)],[THREE__namespace.SRGB8_ALPHA8_ASTC_10x10_Format,makeComputeBlockRectSizeFunction(10,10,16)],[THREE__namespace.RGBA_ASTC_12x10_Format,makeComputeBlockRectSizeFunction(12,10,16)],[THREE__namespace.SRGB8_ALPHA8_ASTC_12x10_Format,makeComputeBlockRectSizeFunction(12,10,16)],[THREE__namespace.RGBA_ASTC_12x12_Format,makeComputeBlockRectSizeFunction(12,12,16)],[THREE__namespace.SRGB8_ALPHA8_ASTC_12x12_Format,makeComputeBlockRectSizeFunction(12,12,16)],[THREE__namespace.RGBA_BPTC_Format,makeComputeBlockRectSizeFunction(4,4,16)]]);function getTextureMemoryUsed(n){var t=0,e=1;(n.generateMipmaps===!0||n.mipmaps&&n.mipmaps.length>1)&&(e=1.33);for(var r=n instanceof THREE__namespace.CompressedTexture,o=r?compressedTextureFunctions.get(n.format):void 0,s=[].concat(n.image),u=0,l=s;u<l.length;u++){var c=l[u];if(c)if(c instanceof THREE__namespace.Texture)t+=getTextureMemoryUsed(c);else{var f=c.width,p=f===void 0?1:f,d=c.height,h=d===void 0?1:d,g=c.depth,A=g===void 0?1:g;o?t+=fixNumber(o(p,h,A)*e):t+=fixNumber(p*h*A*4*e)}}return t}var textureSet=new Set,textureNames=["map","alphaMap","bumpMap","normalMap","displacementMap","emissiveMap","specularMap","envMap","flipEnvMap","lightMap","aoMap","gradientMap","metalnessMap","roughnessMap","sheenColorMap","sheenRoughnessMap","clearcoatMap","clearcoatRoughnessMap","clearcoatNormalMap","iridescenceMap","iridescenceThicknessMap","transmissionMap","thicknessMap","anisotropyMap","specularColorMap","specularIntensityMap"];function getMaterialMemoryUsed(n){var t=0;if(textureSet.clear(),n instanceof THREE__namespace.ShaderMaterial)for(var e in n.uniforms){var r=n.uniforms[e],o=r&&r.value&&r.value instanceof THREE__namespace.Texture?r.value:void 0;o instanceof THREE__namespace.Texture&&(textureSet.has(o)||(t=getTextureMemoryUsed(o),textureSet.add(o)))}else for(var s=0,u=textureNames;s<u.length;s++){var l=u[s],o=n[l];o instanceof THREE__namespace.Texture&&(textureSet.has(o)||(t=getTextureMemoryUsed(o),textureSet.add(o)))}return textureSet.clear(),t}var sceneSet=new Set;function getMemoryUsage(n){var t=0;return sceneSet.clear(),n.traverse(function(e){if(e instanceof THREE__namespace.Mesh||e instanceof THREE__namespace.Line||e instanceof THREE__namespace.Points){var r=e.geometry;(r instanceof THREE__namespace.BufferGeometry||r instanceof THREE__namespace.Geometry)&&(sceneSet.has(r)||(t+=getGeometryMemoryUsed(r),sceneSet.add(r)));for(var o=[].concat(e.material),s=0,u=o;s<u.length;s++){var l=u[s];l instanceof THREE__namespace.Material&&(sceneSet.has(l)||(t+=getMaterialMemoryUsed(l),sceneSet.add(l)))}}}),sceneSet.clear(),t}function guessTextureBaseUriFromFileUrl(n){var t=n.lastIndexOf("/");if(t>=0){var e=n.slice(0,t+1),r=e.replace(/\/(model)(\/|$)/,function(o,s,u){return"/materials"+u});return r}return""}function loadPbm(n,t){var e,r,o,s,u,l;t===void 0&&(t={});for(var c=(e=t.upAxis)!==null&&e!==void 0?e:"Z",f=(r=t.light)!==null&&r!==void 0?r:!1,p=(o=t.fetcher)!==null&&o!==void 0?o:internalFetcher,d=(s=t.textureBaseUri)!==null&&s!==void 0?s:guessTextureBaseUriFromFileUrl(n),h=((u=t.textureArray)!==null&&u!==void 0?u:[]).slice(),g=autoRestImageOptionsByTextureLength((l=t.textureOptions)!==null&&l!==void 0?l:{},h.length),A={},m=0,E=h;m<E.length;m++){var v=E[m];A[v]=loadTexture$1(v,d,g,p)}var y={byteLength:0};return Promise.resolve().then(function(){return p.ajax(n,{responseType:"arraybuffer"})}).then(function(b){return y.byteLength=b.body.byteLength,delay$1(function(){var _=new Uint8Array(b.body);return Model$2.decode(_)})}).then(function(b){return delay$1(function(){return parse$4(b,f,d,h,g,A,p)})}).then(function(b){var _=new THREE__namespace.Group;_.name=n;for(var T=0,S=b.objects;T<S.length;T++){var R=S[T];_.add(R)}return c==="Y"&&_.applyMatrix4(ROTATE_X_MATRIX_INVERSE),{type:"pbm",modelUpAxis:"Z",upAxis:c,uri:n,byteLength:y.byteLength,memoryUsage:getMemoryUsage(_),scene:_,textures:b.textures,animations:[],dispose:function(){return b.dispose()}}})}function parseFloorName(n){var t=n.match(/(group|floor)-?(\d+)/);return t?parseInt(t[2],10):0}function parseChunkName(n){var t=n.match(/(chunk)-?(\d+)/);return t?parseInt(t[2],10):0}function parseSubName(n){var t=n.match(/(sub)-?(\d+)/);return t?parseInt(t[2],10):0}function chunkOrder(n){var t=parseFloorName(n.name),e=parseChunkName(n.name),r=parseSubName(n.name);return t*1e6+e*1e3+r}function parsePBMModel(n){for(var t,e,r,o=typeof n.createAt=="number"?n.createAt:0,s=(t=n.description)!==null&&t!==void 0?t:"",u=[],l=!0,c=!0,f=0,p=n.chunks;f<p.length;f++){var d=p[f];if(!d.vertices.marks||d.vertices.marks.length===0){c=!1;break}}for(var h=0,g=n.chunks;h<g.length;h++){var d=g[h];if(!d.faces.normals||d.faces.normals.length===0){l=!1;break}}for(var A=n.chunks.sort(function(pe,oe){return chunkOrder(pe)-chunkOrder(oe)}),m=[],E=0,v=A;E<v.length;E++){var d=v[E],y=parseFloorName(d.name);m[y]||(m[y]=[]),m[y].push(d)}for(var b=0;b<m.length;b++){var _=m[b];if(_)if(l){for(var T=0,S=0;S<_.length;S++){var d=_[S];T+=d.faces.indices.length}for(var R=new Float32Array(T*3),w=new Float32Array(T*2),M=new Float32Array(T*3),B=c?new Float32Array(T):void 0,C=[],P=[1/0,1/0,1/0,-1/0,-1/0,-1/0],F=0,L=0;L<_.length;L++){for(var O=[1/0,1/0,1/0,-1/0,-1/0,-1/0],d=_[L],k=d.vertices.xyz,D=d.vertices.uvs,J=d.faces.indices,G=d.faces.normals,U=d.vertices.marks,z=J.length,S=0;S<z;S++){var q=J[S],j=R[F*3+S*3]=k[q*3],K=R[F*3+S*3+1]=k[q*3+1],Y=R[F*3+S*3+2]=k[q*3+2];B&&(B[F+S]=U[q]),w[F*2+S*2]=D[q*2],w[F*2+S*2+1]=D[q*2+1];var X=Math.floor(S/3)*3;M[F*3+S*3]=G[X],M[F*3+S*3+1]=G[X+1],M[F*3+S*3+2]=G[X+2],j<O[0]&&(O[0]=j),K<O[1]&&(O[1]=K),Y<O[2]&&(O[2]=Y),j>O[3]&&(O[3]=j),K>O[4]&&(O[4]=K),Y>O[5]&&(O[5]=Y)}O[0]<P[0]&&(P[0]=O[0]),O[1]<P[1]&&(P[1]=O[1]),O[2]<P[2]&&(P[2]=O[2]),O[3]>P[3]&&(P[3]=O[3]),O[4]>P[4]&&(P[4]=O[4]),O[5]>P[5]&&(P[5]=O[5]),C.push({materialIndex:L,name:d.name,chunkName:parseChunkName(d.name),start:F,count:d.faces.indices.length,texture:(e=d.texture)!==null&&e!==void 0?e:void 0}),F+=z}var Q={createAt:o,description:s,vertices:R,uvs:w,normals:M,masks:B,indices:null,floorIndex:b,groups:C,extents:P};u.push(Q)}else{for(var T=0,W=0,S=0;S<_.length;S++){var d=_[S];W+=d.vertices.xyz.length/3,T+=d.faces.indices.length}for(var R=new Float32Array(W*3),w=new Float32Array(W*2),M=void 0,$=new Float32Array(W),ie=new Uint32Array(T),B=c?new Float32Array(T):void 0,C=[],P=[1/0,1/0,1/0,-1/0,-1/0,-1/0],ee=0,F=0,L=0;L<_.length;L++){for(var O=[1/0,1/0,1/0,-1/0,-1/0,-1/0],d=_[L],k=d.vertices.xyz,ne=d.vertices.marks,D=d.vertices.uvs,J=d.faces.indices,te=k.length/3,z=J.length,S=0;S<te;S++){var j=R[F*3+S*3]=k[S*3],K=R[F*3+S*3+1]=k[S*3+1],Y=R[F*3+S*3+2]=k[S*3+2];B&&(B[F+S]=ne[S]),w[F*2+S*2]=D[S*2],w[F*2+S*2+1]=D[S*2+1],$[F+S]=b,j<O[0]&&(O[0]=j),K<O[1]&&(O[1]=K),Y<O[2]&&(O[2]=Y),j>O[3]&&(O[3]=j),K>O[4]&&(O[4]=K),Y>O[5]&&(O[5]=Y)}O[0]<P[0]&&(P[0]=O[0]),O[1]<P[1]&&(P[1]=O[1]),O[2]<P[2]&&(P[2]=O[2]),O[3]>P[3]&&(P[3]=O[3]),O[4]>P[4]&&(P[4]=O[4]),O[5]>P[5]&&(P[5]=O[5]);for(var S=0;S<z;S++)ie[ee+S]=F+J[S];C.push({materialIndex:L,name:d.name,chunkName:parseChunkName(d.name),start:ee,count:d.faces.indices.length,texture:(r=d.texture)!==null&&r!==void 0?r:void 0}),F+=te,ee+=z}var Q={createAt:o,description:s,vertices:R,uvs:w,normals:M,masks:B,indices:ie,floorIndex:b,groups:C,extents:P};u.push(Q)}}return u}function loadTexture$1(n,t,e,r){var o=__assign({key:"texture.pbm"},pick(e,["format","quality","size","sharpen","mappings"])),s=new TextureLoader,u=isAbsoluteURL(n)?n:pathJoin(t,n),l=s.loadTexture(u,{imageURL:{transform:e.transform,options:o},encoding:THREE__namespace.sRGBEncoding,wrapS:THREE__namespace.ClampToEdgeWrapping,wrapT:THREE__namespace.ClampToEdgeWrapping,minFilter:THREE__namespace.LinearFilter,maxSize:typeof o.size=="number"?new THREE__namespace.Vector2(o.size,o.size):void 0,fetcher:r}).then(function(c){var f=c.body;return f.needsUpdate=!0,f});return Object.assign(l,{url:u,textureOptions:e})}function parse$4(n,t,e,r,o,s,u){s===void 0&&(s={});for(var l=parsePBMModel(n),c=0,f="",p=[],d={},h=new Set,g=0,A=0,m=l;A<m.length;A++){var E=m[A],v=E.createAt,y=E.description,b=E.vertices,_=E.masks,T=E.uvs,S=E.normals,R=E.indices,w=E.floorIndex,M=E.groups,B=E.extents,C=new THREE__namespace.Box3;C.min.x=B[0],C.min.y=B[1],C.min.z=B[2],C.max.x=B[3],C.max.y=B[4],C.max.z=B[5];var P=new THREE__namespace.BufferGeometry;P.setAttribute("position",new THREE__namespace.BufferAttribute(b,3)),P.setAttribute("uv",new THREE__namespace.BufferAttribute(T,2)),S&&P.setAttribute("normal",new THREE__namespace.BufferAttribute(S,3)),_&&P.setAttribute("_feature_id_rsmask",new THREE__namespace.BufferAttribute(_,1)),R&&P.setIndex(new THREE__namespace.BufferAttribute(R,1)),P.boundingBox=C,P.boundingSphere=C.getBoundingSphere(new THREE__namespace.Sphere);for(var F=0,L=M;F<L.length;F++){var O=L[F];P.addGroup(O.start,O.count,O.materialIndex)}h.add(P);for(var k=[],D=0,J=M;D<J.length;D++){var O=J[D],G=r[O.chunkName]||(O.texture?pathJoin(e||"",O.texture):void 0),U=new PBMMeshMaterial(t?"phong":"basic");U.floorIndex=w,P.attributes.normal===void 0&&(U.flatShading=!0),P.attributes._feature_id_rsmask&&(U.defines.USE_VERTEX_MARK=!0),k.push(U),G?(g++,d[G]?d[G].push(U):d[G]=[U]):U.color=new THREE__namespace.Color(16777215),h.add(U)}var z=new PBMMesh(P,k);z.name="model_floor_"+w,z.userData.createAt=v,z.userData.description=y,z.matrix.compose(z.position,z.quaternion,z.scale),z.matrixAutoUpdate=!1,z.frustumCulled=!1,c=v,f=y,p.push(z)}var q=function(j){j=autoRestImageOptionsByTextureLength(j,g);for(var K=[],Y=function($){var ie=null;$ in s&&(ie=s[$]),ie||(ie=loadTexture$1($,e,j,u)),K.push(ie.then(function(ee){for(var ne=0,te=d[$];ne<te.length;ne++){var pe=te[ne];pe.map&&(h.delete(pe.map),pe.map.dispose()),pe.map=ee,h.add(ee)}return ee}).catch(function(){for(var ee=0,ne=d[$];ee<ne.length;ee++){var te=ne[ee];te.map&&(h.delete(te.map),te.map.dispose()),te.map=null,te.color=new THREE__namespace.Color(16777215)}return null}))},X=0,Q=Object.keys(d);X<Q.length;X++){var W=Q[X];Y(W)}for(var W in s)delete s[W];return Promise.all(K).then(function($){return $.filter(function(ie){return ie})})};return q(o).then(function(j){return{createAt:c,description:f,objects:p,textures:j,dispose:function(){h.forEach(function(K){K.dispose()}),h.clear()}}})}function autoRestImageOptionsByTextureLength(n,t){return n=Object.assign({},n),n.autoResize!==!1&&(t>96?n.size=Math.min(n.size||1/0,100):t>48?n.size=Math.min(n.size||1/0,200):t>24?n.size=Math.min(n.size||1/0,400):t>22?n.size=Math.min(n.size||1/0,800):t>5&&(n.size=Math.min(n.size||1/0,1024))),n}function createLZMA(){var n={};return n.OutWindow=function(){this._windowSize=0},n.OutWindow.prototype.create=function(t){(!this._buffer||this._windowSize!==t)&&(this._buffer=[]),this._windowSize=t,this._pos=0,this._streamPos=0},n.OutWindow.prototype.flush=function(){var t=this._pos-this._streamPos;if(t!==0){for(;t--;)this._stream.writeByte(this._buffer[this._streamPos++]);this._pos>=this._windowSize&&(this._pos=0),this._streamPos=this._pos}},n.OutWindow.prototype.releaseStream=function(){this.flush(),this._stream=null},n.OutWindow.prototype.setStream=function(t){this.releaseStream(),this._stream=t},n.OutWindow.prototype.init=function(t){t||(this._streamPos=0,this._pos=0)},n.OutWindow.prototype.copyBlock=function(t,e){var r=this._pos-t-1;for(r<0&&(r+=this._windowSize);e--;)r>=this._windowSize&&(r=0),this._buffer[this._pos++]=this._buffer[r++],this._pos>=this._windowSize&&this.flush()},n.OutWindow.prototype.putByte=function(t){this._buffer[this._pos++]=t,this._pos>=this._windowSize&&this.flush()},n.OutWindow.prototype.getByte=function(t){var e=this._pos-t-1;return e<0&&(e+=this._windowSize),this._buffer[e]},n.RangeDecoder=function(){},n.RangeDecoder.prototype.setStream=function(t){this._stream=t},n.RangeDecoder.prototype.releaseStream=function(){this._stream=null},n.RangeDecoder.prototype.init=function(){var t=5;for(this._code=0,this._range=-1;t--;)this._code=this._code<<8|this._stream.readByte()},n.RangeDecoder.prototype.decodeDirectBits=function(t){for(var e=0,r=t,o;r--;)this._range>>>=1,o=this._code-this._range>>>31,this._code-=this._range&o-1,e=e<<1|1-o,(this._range&4278190080)===0&&(this._code=this._code<<8|this._stream.readByte(),this._range<<=8);return e},n.RangeDecoder.prototype.decodeBit=function(t,e){var r=t[e],o=(this._range>>>11)*r;return(this._code^2147483648)<(o^2147483648)?(this._range=o,t[e]+=2048-r>>>5,(this._range&4278190080)===0&&(this._code=this._code<<8|this._stream.readByte(),this._range<<=8),0):(this._range-=o,this._code-=o,t[e]-=r>>>5,(this._range&4278190080)===0&&(this._code=this._code<<8|this._stream.readByte(),this._range<<=8),1)},n.initBitModels=function(t,e){for(;e--;)t[e]=1024},n.BitTreeDecoder=function(t){this._models=[],this._numBitLevels=t},n.BitTreeDecoder.prototype.init=function(){n.initBitModels(this._models,1<<this._numBitLevels)},n.BitTreeDecoder.prototype.decode=function(t){for(var e=1,r=this._numBitLevels;r--;)e=e<<1|t.decodeBit(this._models,e);return e-(1<<this._numBitLevels)},n.BitTreeDecoder.prototype.reverseDecode=function(t){for(var e=1,r=0,o=0,s;o<this._numBitLevels;++o)s=t.decodeBit(this._models,e),e=e<<1|s,r|=s<<o;return r},n.reverseDecode2=function(t,e,r,o){for(var s=1,u=0,l=0,c;l<o;++l)c=r.decodeBit(t,e+s),s=s<<1|c,u|=c<<l;return u},n.LenDecoder=function(){this._choice=[],this._lowCoder=[],this._midCoder=[],this._highCoder=new n.BitTreeDecoder(8),this._numPosStates=0},n.LenDecoder.prototype.create=function(t){for(;this._numPosStates<t;++this._numPosStates)this._lowCoder[this._numPosStates]=new n.BitTreeDecoder(3),this._midCoder[this._numPosStates]=new n.BitTreeDecoder(3)},n.LenDecoder.prototype.init=function(){var t=this._numPosStates;for(n.initBitModels(this._choice,2);t--;)this._lowCoder[t].init(),this._midCoder[t].init();this._highCoder.init()},n.LenDecoder.prototype.decode=function(t,e){return t.decodeBit(this._choice,0)===0?this._lowCoder[e].decode(t):t.decodeBit(this._choice,1)===0?8+this._midCoder[e].decode(t):16+this._highCoder.decode(t)},n.Decoder2=function(){this._decoders=[]},n.Decoder2.prototype.init=function(){n.initBitModels(this._decoders,768)},n.Decoder2.prototype.decodeNormal=function(t){var e=1;do e=e<<1|t.decodeBit(this._decoders,e);while(e<256);return e&255},n.Decoder2.prototype.decodeWithMatchByte=function(t,e){var r=1,o,s;do if(o=e>>7&1,e<<=1,s=t.decodeBit(this._decoders,(1+o<<8)+r),r=r<<1|s,o!==s){for(;r<256;)r=r<<1|t.decodeBit(this._decoders,r);break}while(r<256);return r&255},n.LiteralDecoder=function(){},n.LiteralDecoder.prototype.create=function(t,e){var r;if(!(this._coders&&this._numPrevBits===e&&this._numPosBits===t))for(this._numPosBits=t,this._posMask=(1<<t)-1,this._numPrevBits=e,this._coders=[],r=1<<this._numPrevBits+this._numPosBits;r--;)this._coders[r]=new n.Decoder2},n.LiteralDecoder.prototype.init=function(){for(var t=1<<this._numPrevBits+this._numPosBits;t--;)this._coders[t].init()},n.LiteralDecoder.prototype.getDecoder=function(t,e){return this._coders[((t&this._posMask)<<this._numPrevBits)+((e&255)>>>8-this._numPrevBits)]},n.Decoder=function(){this._outWindow=new n.OutWindow,this._rangeDecoder=new n.RangeDecoder,this._isMatchDecoders=[],this._isRepDecoders=[],this._isRepG0Decoders=[],this._isRepG1Decoders=[],this._isRepG2Decoders=[],this._isRep0LongDecoders=[],this._posSlotDecoder=[],this._posDecoders=[],this._posAlignDecoder=new n.BitTreeDecoder(4),this._lenDecoder=new n.LenDecoder,this._repLenDecoder=new n.LenDecoder,this._literalDecoder=new n.LiteralDecoder,this._dictionarySize=-1,this._dictionarySizeCheck=-1,this._posSlotDecoder[0]=new n.BitTreeDecoder(6),this._posSlotDecoder[1]=new n.BitTreeDecoder(6),this._posSlotDecoder[2]=new n.BitTreeDecoder(6),this._posSlotDecoder[3]=new n.BitTreeDecoder(6)},n.Decoder.prototype.setDictionarySize=function(t){return t<0?!1:(this._dictionarySize!==t&&(this._dictionarySize=t,this._dictionarySizeCheck=Math.max(this._dictionarySize,1),this._outWindow.create(Math.max(this._dictionarySizeCheck,4096))),!0)},n.Decoder.prototype.setLcLpPb=function(t,e,r){var o=1<<r;return t>8||e>4||r>4?!1:(this._literalDecoder.create(e,t),this._lenDecoder.create(o),this._repLenDecoder.create(o),this._posStateMask=o-1,!0)},n.Decoder.prototype.init=function(){var t=4;for(this._outWindow.init(!1),n.initBitModels(this._isMatchDecoders,192),n.initBitModels(this._isRep0LongDecoders,192),n.initBitModels(this._isRepDecoders,12),n.initBitModels(this._isRepG0Decoders,12),n.initBitModels(this._isRepG1Decoders,12),n.initBitModels(this._isRepG2Decoders,12),n.initBitModels(this._posDecoders,114),this._literalDecoder.init();t--;)this._posSlotDecoder[t].init();this._lenDecoder.init(),this._repLenDecoder.init(),this._posAlignDecoder.init(),this._rangeDecoder.init()},n.Decoder.prototype.decode=function(t,e,r){var o=0,s=0,u=0,l=0,c=0,f=0,p=0,d,h,g,A,m,E;for(this._rangeDecoder.setStream(t),this._outWindow.setStream(e),this.init();r<0||f<r;)if(d=f&this._posStateMask,this._rangeDecoder.decodeBit(this._isMatchDecoders,(o<<4)+d)===0)h=this._literalDecoder.getDecoder(f++,p),o>=7?p=h.decodeWithMatchByte(this._rangeDecoder,this._outWindow.getByte(s)):p=h.decodeNormal(this._rangeDecoder),this._outWindow.putByte(p),o=o<4?0:o-(o<10?3:6);else{if(this._rangeDecoder.decodeBit(this._isRepDecoders,o)===1)g=0,this._rangeDecoder.decodeBit(this._isRepG0Decoders,o)===0?this._rangeDecoder.decodeBit(this._isRep0LongDecoders,(o<<4)+d)===0&&(o=o<7?9:11,g=1):(this._rangeDecoder.decodeBit(this._isRepG1Decoders,o)===0?A=u:(this._rangeDecoder.decodeBit(this._isRepG2Decoders,o)===0?A=l:(A=c,c=l),l=u),u=s,s=A),g===0&&(g=2+this._repLenDecoder.decode(this._rangeDecoder,d),o=o<7?8:11);else if(c=l,l=u,u=s,g=2+this._lenDecoder.decode(this._rangeDecoder,d),o=o<7?7:10,m=this._posSlotDecoder[g<=5?g-2:3].decode(this._rangeDecoder),m>=4){if(E=(m>>1)-1,s=(2|m&1)<<E,m<14)s+=n.reverseDecode2(this._posDecoders,s-m-1,this._rangeDecoder,E);else if(s+=this._rangeDecoder.decodeDirectBits(E-4)<<4,s+=this._posAlignDecoder.reverseDecode(this._rangeDecoder),s<0){if(s===-1)break;return!1}}else s=m;if(s>=f||s>=this._dictionarySizeCheck)return!1;this._outWindow.copyBlock(s,g),f+=g,p=this._outWindow.getByte(0)}return this._outWindow.flush(),this._outWindow.releaseStream(),this._rangeDecoder.releaseStream(),!0},n.Decoder.prototype.setDecoderProperties=function(t){var e,r,o,s,u;return t.size<5||(e=t.readByte(),r=e%9,e=~~(e/9),o=e%5,s=~~(e/5),!this.setLcLpPb(r,o,s))?!1:(u=t.readByte(),u|=t.readByte()<<8,u|=t.readByte()<<16,u+=t.readByte()*16777216,this.setDictionarySize(u))},n.decompress=function(t,e,r,o){var s=new n.Decoder;if(!s.setDecoderProperties(t))throw"Incorrect stream properties";if(!s.decode(e,r,o))throw"Error in data stream";return!0},n.decompressFile=function(t,e){var r=new n.Decoder,o;if(!r.setDecoderProperties(t))throw"Incorrect stream properties";if(o=t.readByte(),o|=t.readByte()<<8,o|=t.readByte()<<16,o+=t.readByte()*16777216,t.readByte(),t.readByte(),t.readByte(),t.readByte(),!r.decode(t,e,o))throw"Error in data stream";return!0},n}var LZMA=createLZMA();function createWASM(){function n(e){for(var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=new Uint8Array(256),s=0;s<r.length;s++)o[r.charCodeAt(s)]=s;var u=e.length*.75,l=e.length,c,f=0,p,d,h,g;e[e.length-1]==="="&&(u--,e[e.length-2]==="="&&u--);var A=new ArrayBuffer(u),m=new Uint8Array(A);for(c=0;c<l;c+=4)p=o[e.charCodeAt(c)],d=o[e.charCodeAt(c+1)],h=o[e.charCodeAt(c+2)],g=o[e.charCodeAt(c+3)],m[f++]=p<<2|d>>4,m[f++]=(d&15)<<4|h>>2,m[f++]=(h&3)<<6|g&63;return A}var t="AGFzbQEAAAABSg1gAABgAX8Bf2ACf38Bf2AEf39/fwBgA39/fwBgAX8AYAJ/fwBgA39/fwF/YAR/f39/AX9gAn9/AGABfwF/YAABf2AEf39/fwF/AhsCA2VudgVhYm9ydAADA2VudgZtZW1vcnkCAAEDJiUBAQkKAgoKCwsLCwsAAgoBAgQKAQYFCAoFBQQEBwgCBwwCAQAABAQBcAABBhoFfwFBAAt/AUEAC38BQQALfwFBAAt/AUEACwc9BgZtZW1vcnkCAAV0YWJsZQEABXJlc2V0AA0KbmV3VThBcnJheQAQCnVucGFja1NpemUAFAZkZWNvZGUAIwgBJAkHAQBBAAsBJQqAViVoAQN/IABBgICAgARLBEAACyMBIgEgAEEBIABBAUsbakEHakF4cSICPwAiA0EQdEsEQCADIAIgAWtB//8DakGAgHxxQRB2IgAgAyAAShtAAEEASARAIABAAEEASARAAAsLCyACJAEgAQsbAQF/QQFBICAAQQdqZ2t0EAEiASAANgIAIAELkQMBAX8gAUUEQA8LIABBADoAACAAIAFqQQFrQQA6AAAgAUECTQRADwsgAEEBakEAOgAAIABBAmpBADoAACAAIAFqIgJBAmtBADoAACACQQNrQQA6AAAgAUEGTQRADwsgAEEDakEAOgAAIAAgAWpBBGtBADoAACABQQhNBEAPC0EAIABrQQNxIgIgAGoiAEEANgIAIAEgAmtBfHEiASAAakEEa0EANgIAIAFBCE0EQA8LIABBBGpBADYCACAAQQhqQQA2AgAgACABaiICQQxrQQA2AgAgAkEIa0EANgIAIAFBGE0EQA8LIABBDGpBADYCACAAQRBqQQA2AgAgAEEUakEANgIAIABBGGpBADYCACAAIAFqIgJBHGtBADYCACACQRhrQQA2AgAgAkEUa0EANgIAIAJBEGtBADYCACAAQQRxQRhqIgIgAGohACABIAJrIQEDQCABQSBPBEAgAEIANwMAIABBCGpCADcDACAAQRBqQgA3AwAgAEEYakIANwMAIAFBIGshASAAQSBqIQAMAQsLC1EBA38gAEH+////AEsEQEEAQSBBLUEnEAAACyAAQQJ0IgMQAiECQQgQASIBQQA2AgAgAUEANgIEIAEgAjYCACABIAA2AgQgAkEIaiADEAMgAQtmAQF/IAFB/P///wFLBEBBAEHAAEEXQSIQAAALIAFBAXQiARACIgJBCGogARADIABFBEBBDBABIQALIABBADYCACAAQQA2AgQgAEEANgIIIAAgAjYCACAAQQA2AgQgACABNgIIIAALCgBBDBABIAAQBQsuAQF/QQgQASIBQQA2AgAgAUEANgIEIAEgADYCBCABQQEgASgCBHQQBjYCACABC6EBAQR/QRAQASIBQQA2AgAgAUEANgIEIAFBADYCCCABQQA2AgxBEBAEIQIDQCAAQRBIBEBBAxAHIQMgAigCACAAQQJ0aiADNgIIIABBAWohAAwBCwsgASACNgIEQRAQBCECQQAhAANAIABBEEgEQEEDEAchAyACKAIAIABBAnRqIAM2AgggAEEBaiEADAELCyABIAI2AgggAUEIEAc2AgwgAQs0AQF/QRQQASIAQQA2AgAgAEEAOgAEIABBADYCCCAAQQA2AgwgAEEANgIQIABBDTYCCCAAC0IBAX9BGRABIgBBADYCACAAQQA2AgQgAEEANgIIIABBADYCDCAAQQA2AhAgAEEANgIUIABBADoAGCAAQQA2AhAgAAu1AgEEf0HQABABIgBBADoAACAAQQA2AgQgAEEANgIIIABBADYCDCAAQQA2AhAgAEEAOgAUIABBADYCGCAAQQA2AhwgAEEANgIgIABBADYCJCAAQQA2AiggAEEANgIsIABBADYCMCAAQQA2AjQgAEEANgI4IABBADYCPCAAQQA2AkAgAEEANgJEIABBADYCSCAAQQA2AkxBBBAEIQIDQCABQQRIBEBBBhAHIQMgAigCACABQQJ0aiADNgIIIAFBAWohAQwBCwsgACACNgIkIABBBBAHNgIoIABB8wAQBjYCLCAAQcABEAY2AjAgAEEMEAY2AjQgAEEMEAY2AjggAEEMEAY2AjwgAEEMEAY2AkAgAEHAARAGNgJEIAAQCDYCSCAAEAg2AkwgABAJNgIEIAAQCjYCCCAACx8BAX9BCBABIgBBADYCACAAQQA2AgQgABALNgIAIAALCgAjACQBEAwkAwthAQF/IAFB+P///wNLBEBBAEHAAEEXQSIQAAALIAEQAiICQQhqIAEQAyAARQRAQQwQASEACyAAQQA2AgAgAEEANgIEIABBADYCCCAAIAI2AgAgAEEANgIEIAAgATYCCCAACwoAQQwQASAAEA4LBgAgABAPCyoAIAEgACgCCE8EQEEAQcAAQSdBPxAAAAsgACgCBCABIAAoAgBqai0ACAssACABIAAoAghPBEBBAEHAAEEyQT8QAAALIAAoAgQgASAAKAIAamogAjoACAtkAQJ/QQ0QDyECA0AgAUENSARAIAIgASAAIAEQEUH/AXEQEiABQQFqIQEMAQsLQQAhAEEAIQEDQCABQQhIBEAgAiABQQVqEBFB/wFxIAFBA3R0IAByIQAgAUEBaiEBDAELCyAACwYAIAAQEwsnACAAIAEQDzYCCCAAQQA2AgwgACABNgIUIABBADoAGCAAQQA2AgALJAAgACgCCCAAKAIYEBUgAEGABiAAKAIMIAAtABRqdBAGNgIgC5UBAQR/IAEhBSAAIgYoAgAhASAAKAIEIQcgACgCCEEBdiEEIAJBAEgEfyACIARqIgBBACAAQQBKGwUgAiIAIAQgACAESBsLIQIgA0EASAR/IAMgBGoiAEEAIABBAEobBSADIgAgBCAAIARIGwshAwNAIAIgA05FBEAgAkEBdCABaiAHaiAFOwEIIAJBAWohAgwBCwsgBgssAQF/AkACQAJAIwRBAWsOAwEBAgALAAtB/////wchAQsgAEGACEEAIAEQFwvBAQECfyAAQQIQBjYCACAAKAIAIgEoAgAgASgCBGpBgAg7AQggACgCACICKAIAIQEgAigCBCABQQJqakGACDsBCCAAKAIMKAIAQQEkBBAYGkEAIQIDQCACQRBIBEAgAiAAKAIEKAIAIgEoAgBBAnZJBH8gAkECdCABaigCCAUACygCAEEBJAQQGBogAiAAKAIIKAIAIgEoAgBBAnZJBH8gAkECdCABaigCCAUACygCAEEBJAQQGBogAkEBaiECDAELCwuHAgEFfyAAIQJBgAYgACgCDCAALQAUanQhAQNAIAMgAUgEQCACKAIgIgQoAgAhBSAEKAIEIANBAXQgBWpqQYAIOwEIIANBAWohAwwBCwsgAiEBQQAhAgNAIAJBBEkEQCACIAEoAiQoAgAiAygCAEECdkkEfyACQQJ0IANqKAIIBQALKAIAQQEkBBAYGiACQQFqIQIMAQsLIAEoAigoAgBBASQEEBgaIAEoAixBASQEEBgaIAAoAjBBASQEEBgaIAAoAjRBASQEEBgaIAAoAjhBASQEEBgaIAAoAjxBASQEEBgaIAAoAkBBASQEEBgaIAAoAkRBASQEEBgaIAAoAkgQGSAAKAJMEBkLyAwBA38DQCABQQNxIAIgAhsEQCAAIgRBAWohACABIgNBAWohASAEIAMtAAA6AAAgAkEBayECDAELCyAAQQNxRQRAA0AgAkEQTwRAIAAgASgCADYCACAAQQRqIAFBBGooAgA2AgAgAEEIaiABQQhqKAIANgIAIABBDGogAUEMaigCADYCACABQRBqIQEgAEEQaiEAIAJBEGshAgwBCwsgAkEIcQRAIAAgASgCADYCACAAQQRqIAFBBGooAgA2AgAgAUEIaiEBIABBCGohAAsgAkEEcQRAIAAgASgCADYCACABQQRqIQEgAEEEaiEACyACQQJxBEAgACABLwEAOwEAIAFBAmohASAAQQJqIQALIAJBAXEEQCAAIAEtAAA6AAALDwsgAkEgTwRAAkACQAJAIABBA3EiA0EBRwRAIANBAkYNASADQQNGDQIMAwsgASgCACEFIAAgASIDLQAAOgAAIABBAWoiASABIANBAWoiAS0AADoAAEEBaiIEQQFqIQAgAUEBaiIDQQFqIQEgBCADLQAAOgAAIAJBA2shAgNAIAJBEU8EQCAAIAFBAWooAgAiA0EIdCAFQRh2cjYCACAAQQRqIAFBBWooAgAiBUEIdCADQRh2cjYCACAAQQhqIAFBCWooAgAiA0EIdCAFQRh2cjYCACAAQQxqIAFBDWooAgAiBUEIdCADQRh2cjYCACABQRBqIQEgAEEQaiEAIAJBEGshAgwBCwsMAgsgASgCACEFIAAgAS0AADoAACAAQQFqIgRBAWohACABQQFqIgNBAWohASAEIAMtAAA6AAAgAkECayECA0AgAkESTwRAIAAgAUECaigCACIDQRB0IAVBEHZyNgIAIABBBGogAUEGaigCACIFQRB0IANBEHZyNgIAIABBCGogAUEKaigCACIDQRB0IAVBEHZyNgIAIABBDGogAUEOaigCACIFQRB0IANBEHZyNgIAIAFBEGohASAAQRBqIQAgAkEQayECDAELCwwBCyABKAIAIQUgACIEQQFqIQAgASIDQQFqIQEgBCADLQAAOgAAIAJBAWshAgNAIAJBE08EQCAAIAFBA2ooAgAiA0EYdCAFQQh2cjYCACAAQQRqIAFBB2ooAgAiBUEYdCADQQh2cjYCACAAQQhqIAFBC2ooAgAiA0EY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";return n(t)}function decodeLZMA(n,t,e){try{var r={data:t,offset:0,readByte:function(){return this.data[this.offset++]}},o=r.data.length,s={data:[],offset:0,writeByte:function(c){var f=Math.floor(this.offset/o);this.data[f]||(this.data[f]=new Uint8Array(o)),this.data[f][this.offset%o]=c,this.offset++}};n.decompressFile(r,s);for(var u=new Uint8Array(s.offset),l=0;l<s.offset;l++)u[l]=s.data[Math.floor(l/o)][l%o];e(null,u)}catch(c){e(c)}}function decodeLZMAWithWASM(n,t,e){var r=24;try{var o=new WebAssembly.Memory({initial:16}),s=new WebAssembly.Module(n),u=new WebAssembly.Instance(s,{env:{memory:o,abort:function(){e(new Error("webAssembly abort"))}}}),l=u.exports,c=l.newU8Array(t.length),f=new Uint8Array(o.buffer,c+r,t.length);f.set(t);var p=l.decode(c),d=new Uint32Array(o.buffer,p,4),h=d[0],g=d[2],A=d[3];h?e(null,new Uint8Array(o.buffer,A+r,g).slice(0,g)):e(new Error("lzma deocder error"))}catch(m){e(m)}}var lzmaWorkerSource=`
406
406
  var decodeLZMA = (function() {
407
407
  var LZMA = (`.concat(createLZMA.toString(),`)();
408
408
  return function(data, callback) {
@@ -1023,7 +1023,7 @@ void main() {
1023
1023
  #include <fog_fragment>
1024
1024
  #include <premultiplied_alpha_fragment>
1025
1025
  }
1026
- `,uniforms:{diffuse:{value:new THREE__namespace.Color},opacity:{value:1},displacementScalar:{value:0}}};function createPipeBufferGeometry(n,t,e,r){for(var o=new Float32Array((e+1)*(r+1)*3),s=new Float32Array((e+1)*(r+1)*3),u=new Float32Array((e+1)*(r+1)*2),l=new Uint32Array(e*r*6),c=n.computeFrenetFrames(e),f=new THREE__namespace.Vector3,p=new THREE__namespace.Vector3,d=new THREE__namespace.Vector2,h=new THREE__namespace.Vector3,g=0;g<=e;g++){h=n.getPointAt(g/e,h);for(var A=c.normals[g],m=c.binormals[g],E=0;E<=r;E++){var v=g*(r+1)+E,y=E/r*Math.PI*2,b=Math.sin(y),_=-Math.cos(y);p.x=_*A.x+b*m.x,p.y=_*A.y+b*m.y,p.z=_*A.z+b*m.z,p.normalize(),p.toArray(s,v*3),f.x=h.x+t*p.x,f.y=h.y+t*p.y,f.z=h.z+t*p.z,f.toArray(o,v*3),d.x=g/e,d.y=E/r,d.toArray(u,v*2)}}for(var g=0;g<e;g++)for(var E=0;E<r;E++){var T=(g*r+E)*6,S=(r+1)*g+E,R=(r+1)*(g+1)+E,w=(r+1)*(g+1)+(E+1),M=(r+1)*g+(E+1);l[T]=S,l[T+1]=R,l[T+2]=M,l[T+3]=R,l[T+4]=w,l[T+5]=M}var B=new THREE__namespace.BufferGeometry;return B.setIndex(new THREE__namespace.BufferAttribute(l,1)),B.setAttribute("position",new THREE__namespace.BufferAttribute(o,3)),B.setAttribute("normal",new THREE__namespace.BufferAttribute(s,3)),B.setAttribute("uv",new THREE__namespace.BufferAttribute(u,2)),B}function parseTrajectoryObject(n,t){for(var e=new THREE__namespace.Color(0).convertSRGBToLinear(),r=new THREE__namespace.Color(52949).convertSRGBToLinear(),o=new THREE__namespace.Color(3370495).convertSRGBToLinear(),s=new THREE__namespace.Color(16777215).convertSRGBToLinear(),u=0,l=new THREE__namespace.CurvePath,c=n.length,f=3;f<c;f+=3){var p=new THREE__namespace.Vector3().fromArray(n,f-3),d=new THREE__namespace.Vector3().fromArray(n,f);u+=p.distanceTo(d);var h=new THREE__namespace.LineCurve3(p,d);l.add(h)}var g=.03,A=Math.ceil(u*100),m=6,E=createPipeBufferGeometry(l,g,A,m);E.clearGroups(),E.addGroup(0,E.index?E.index.count:E.attributes.position.count,0),E.addGroup(0,E.index?E.index.count:E.attributes.position.count,1),E.addGroup(0,E.index?E.index.count:E.attributes.position.count,2);var v=new THREE__namespace.ShaderMaterial({vertexShader:TRAJECTOR_PIPE_SHADER.vertexShader,fragmentShader:TRAJECTOR_PIPE_SHADER.fragmentShader,uniforms:THREE__namespace.UniformsUtils.clone(TRAJECTOR_PIPE_SHADER.uniforms),side:THREE__namespace.BackSide});v.uniforms.totalLength.value=u,v.uniforms.diffuse.value=e,v.uniforms.diffuse2.value=e,v.uniforms.opacity.value=.5,v.transparent=!0;var y=new THREE__namespace.ShaderMaterial({vertexShader:TRAJECTOR_PIPE_SHADER.vertexShader,fragmentShader:TRAJECTOR_PIPE_SHADER.fragmentShader,uniforms:THREE__namespace.UniformsUtils.clone(TRAJECTOR_PIPE_SHADER.uniforms),side:THREE__namespace.BackSide});y.uniforms.totalLength.value=u,y.uniforms.displacementScalar.value=-.01,y.uniforms.diffuse.value=r,y.uniforms.diffuse2.value=o;var b=new THREE__namespace.ShaderMaterial({vertexShader:TRAJECTOR_PIPE_SHADER.vertexShader,fragmentShader:TRAJECTOR_PIPE_SHADER.fragmentShader,uniforms:THREE__namespace.UniformsUtils.clone(TRAJECTOR_PIPE_SHADER.uniforms),side:THREE__namespace.DoubleSide});b.uniforms.totalLength.value=u,b.uniforms.displacementScalar.value=-.026,b.uniforms.dashSize.value=new THREE__namespace.Vector2(.06,.09),b.uniforms.diffuse.value=s,b.uniforms.diffuse2.value=s;var _=new THREE__namespace.Mesh(E,[v,y,b]),T=.08,S=24,R=new THREE__namespace.SphereBufferGeometry(T,S,S);R.clearGroups(),R.addGroup(0,E.index?E.index.count:E.attributes.position.count,0),R.addGroup(0,E.index?E.index.count:E.attributes.position.count,1);var w=new THREE__namespace.ShaderMaterial({vertexShader:TRAJECTOR_SPHERE_SHADER.vertexShader,fragmentShader:TRAJECTOR_SPHERE_SHADER.fragmentShader,uniforms:THREE__namespace.UniformsUtils.clone(TRAJECTOR_SPHERE_SHADER.uniforms),side:THREE__namespace.BackSide});w.uniforms.diffuse.value=e,w.uniforms.opacity.value=.5,w.transparent=!0;var M=new THREE__namespace.ShaderMaterial({vertexShader:TRAJECTOR_SPHERE_SHADER.vertexShader,fragmentShader:TRAJECTOR_SPHERE_SHADER.fragmentShader,uniforms:THREE__namespace.UniformsUtils.clone(TRAJECTOR_SPHERE_SHADER.uniforms),side:THREE__namespace.FrontSide});M.uniforms.displacementScalar.value=-.01,M.uniforms.diffuse.value=r;var B=new THREE__namespace.Mesh(R,[w,M]);B.position.fromArray(n,0),_.add(B);var C=new THREE__namespace.ShaderMaterial({vertexShader:TRAJECTOR_SPHERE_SHADER.vertexShader,fragmentShader:TRAJECTOR_SPHERE_SHADER.fragmentShader,uniforms:THREE__namespace.UniformsUtils.clone(TRAJECTOR_SPHERE_SHADER.uniforms),side:THREE__namespace.FrontSide});C.uniforms.displacementScalar.value=-.01,C.uniforms.diffuse.value=o;var P=new THREE__namespace.Mesh(R,[w,C]);return P.position.fromArray(n,n.length-3),_.add(P),{scene:_,dispose:function(){E.dispose(),v.dispose(),y.dispose(),b.dispose(),R.dispose(),w.dispose(),M.dispose(),C.dispose()}}}function loadTrajectory(n,t){var e=n.name,r=appendSearch(n.content.uri,t.search),o=imageURL(r,{key:"model.0"});return n.content.loadState="LOADING",n.content.loadStateUpdateTime=now(),loadPly(o,{type:"geometry",customPropertyMapping:{time:{itemType:"uint32",itemNames:["time_milisec"]}},fetcher:t.fetcher}).then(function(s){var u,l,c,f,p=(l=(u=s.scene.attributes)===null||u===void 0?void 0:u.time.array)!==null&&l!==void 0?l:[],d=(f=(c=s.scene.attributes)===null||c===void 0?void 0:c.position.array)!==null&&f!==void 0?f:[],h=s.byteLength,g=s.memoryUsage,A=parseTrajectoryObject(d);A.scene.applyMatrix4(n.transform),A.scene.updateWorldMatrix(!1,!0),A.scene.matrixAutoUpdate=!1;var m=new TrajectoryNode(e,A.scene);return n.content.data={uri:o,byteLength:h,memoryUsage:g,positionArray:d,timeArray:p,object:m},n.content.byteLength=h,n.content.memoryUsage=g,n.content.loadState="READY",n.content.loadStateUpdateTime=now(),n}).catch(function(s){return n.content.data=void 0,n.content.loadState="FAILED",n.content.loadStateUpdateTime=now(),s instanceof NetworkResponseError&&s.httpStatus===0||s instanceof NetworkTimeoutError||s instanceof NetworkProxyError?n.content.loadfailRetryDelay=clamp$1(n.content.loadfailRetryDelay+RETRY_DELAY_STEP,RETRY_DELAY_STEP,MAX_RETRY_DELAY):n.content.loadfailRetryDelay=1/0,Promise.reject(s)})}function unloadTrajectory(n){n.content&&(n.content.data&&n.content.data.object.dispose(),n.content.data=void 0,n.content.loadState="UNLOADED",n.content.loadStateUpdateTime=now(),n.content.byteLength=0,n.content.memoryUsage=0)}var scratchVector3$7=new THREE__namespace.Vector3,scratchMatrix3=new THREE__namespace.Matrix3,scratchMatrix4$3=new THREE__namespace.Matrix4,a=6378137,invF=298.257223563;function ecefToLla(n){for(var t=a-a/invF,e=(a*a-t*t)/(a*a),r=Math.sqrt(n.x*n.x+n.y*n.y),o=1e-12,s=1e3,u=0,l=Math.atan2(n.z,r),c=0;u++<s;){var f=Math.sin(l),p=a/Math.sqrt(1-e*f*f);c=r/Math.cos(l)-p;var d=Math.atan2(n.z/(p*(1-e)+c),r/(p+c));if(isNaN(d))break;var h=Math.abs(d-l);if(h<o)break;l=d}return n.set(l,Math.atan2(n.y,n.x),c)}function llaToEcef(n){var t=n.x,e=n.y,r=n.z,o=a-a/invF,s=(a*a-o*o)/(a*a),u=Math.sin(t),l=Math.cos(t),c=Math.sin(e),f=Math.cos(e),p=a/Math.sqrt(1-s*u*u),d=(p+r)*l*f,h=(p+r)*l*c,g=(o*o/(a*a)*p+r)*u;return n.set(d,h,g)}function getEcefToEnuMatrix(n,t){var e=ecefToLla(scratchVector3$7.copy(n)),r=e.x,o=e.y,s=e.z,u=Math.sin(r),l=Math.sin(o),c=Math.cos(r),f=Math.cos(o);t.fromArray([-l,-u*f,c*f,0,+f,-u*l,c*l,0,0,c,u,0,0,0,0,1]);var p=scratchMatrix3.setFromMatrix4(t),d=scratchVector3$7.copy(n).applyMatrix3(p).multiplyScalar(-1);t.setPosition(d);var h=scratchMatrix4$3.fromArray([1,0,0,0,0,1,0,0,0,0,1,0,0,0,s,1]);return t.premultiply(h),t}var ROTATE_X_90_MATRIX=new THREE__namespace.Matrix4().fromArray([1,0,0,0,0,0,-1,0,0,1,0,0,0,0,0,1]),ROTATE_X_90_MATRIX_INVERSE=new THREE__namespace.Matrix4().fromArray([1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1]),enuToLocalMatrix=new THREE__namespace.Matrix4().copy(ROTATE_X_90_MATRIX),localToEnuMatrix=new THREE__namespace.Matrix4().copy(ROTATE_X_90_MATRIX_INVERSE);function getRecommendTile3dProps(n,t){var e,r,o;t===void 0&&(t={});var s,u,l,c=typeof n.tileset.rootMeta.creationTime=="string";if(c){var f=typeof n.tileset.rootMeta.numTotalPoints=="number"&&n.tileset.rootMeta.numTotalPoints>0;if(f){l=4,t.powerPreference==="high"&&(l=2),s=l/1.6;var p=0;if(((e=n.tileset.rootMeta.taskParameters)===null||e===void 0?void 0:e.point_homogenization)==="1"&&(!((r=n.tileset.rootMeta.taskParameters)===null||r===void 0)&&r.homo_point_density)){var d=Number((o=n.tileset.rootMeta.taskParameters)===null||o===void 0?void 0:o.homo_point_density);isFinite(d)&&!isNaN(d)&&(p=d)}p<=0&&(p=.02),u=p*1.4}else l=5,t.powerPreference==="high"&&(l=4),s=0,u=.03}else l=6,s=0,u=.03,n.name==="aerophoto"?(l=12,t.powerPreference==="high"&&(l=10)):n.tileset.asset.extras&&typeof n.tileset.asset.extras.name=="string"&&/^matterport\b/i.test(n.tileset.asset.extras.name)&&(l=5,t.powerPreference==="high"&&(l=4));return{pointScale:u,pointMinPixel:s,maxScreenSpaceError:l}}var scratchVector3$6=new THREE__namespace.Vector3,scratchSphereBoundingVolume=new SphereBoundingVolume,scratchBoxBoundingVolume=new BoxBoundingVolume,parameterVersionMap=new WeakMap,tileVersionMap=new WeakMap,trajectoryVersionMap=new WeakMap,STENCIL_CONSTANT={TILE_MASK:128,SKIP_LOD_MASK:112,SKIP_LOD_BIT_SHIFT:4},SKIP_BACKFACE_MATERIAL=(function(){var n=new THREE__namespace.MeshBasicMaterial;return n.side=THREE__namespace.BackSide,n.color.setHex(16711935),n.colorWrite=!1,n.stencilWrite=!0,n.polygonOffset=!0,n.polygonOffsetFactor=2,n.polygonOffsetUnits=2,n.stencilRef=STENCIL_CONSTANT.TILE_MASK,n.stencilFunc=THREE__namespace.AlwaysStencilFunc,n.stencilFuncMask=STENCIL_CONSTANT.TILE_MASK,n.stencilZPass=THREE__namespace.ReplaceStencilOp,n.stencilWriteMask=STENCIL_CONSTANT.TILE_MASK,n})(),SKIP_BACKFACE_TRANSPARENT_MATERIAL=(function(){var n=new THREE__namespace.MeshBasicMaterial;return n.visible=!1,n})(),CLEAR_STENCIL_GEOMETRY=new THREE__namespace.BufferGeometry,CLEAR_STENCIL_MATERIAL=new THREE__namespace.MeshBasicMaterial;function cloneSkipBackfaceObject(n){var t;n instanceof THREE__namespace.Mesh?t=new THREE__namespace.Mesh(n.geometry,Array.isArray(n.material)?n.material.map(function(s){return s.transparent?SKIP_BACKFACE_TRANSPARENT_MATERIAL:SKIP_BACKFACE_MATERIAL}):n.material&&n.material.transparent?SKIP_BACKFACE_TRANSPARENT_MATERIAL:SKIP_BACKFACE_MATERIAL):n instanceof THREE__namespace.Group?t=new THREE__namespace.Group:t=new THREE__namespace.Object3D,t.position.copy(n.position),t.quaternion.copy(n.quaternion),t.scale.copy(n.scale),t.matrix.compose(n.position,n.quaternion,n.scale),t.matrixAutoUpdate=!1,t.frustumCulled=n.frustumCulled,t.visible=n.visible;for(var e=0,r=n.children;e<r.length;e++){var o=r[e];t.add(cloneSkipBackfaceObject(o))}return t}var Tile3D=(function(n){__extends(t,n);function t(e,r){var o,s,u=n.call(this)||this;return u.parameter=new Parameter,u.renderObjects=[],u.backfaceObjects=[],u.tileObjects=[],u.frameNumber=0,u.error=(o=r.error)!==null&&o!==void 0?o:null,u.name=r.name,u.type=r.type,u.upAxis=r.upAxis,u.light=r.light,u.fetcher=r.fetcher,u.search=(s=r.search)!==null&&s!==void 0?s:"",u.groundHeight=r.groundHeight,u.enuToEcefMatrix=new THREE__namespace.Matrix4().copy(r.enuToEcefMatrix),u.ecefToEnuMatrix=new THREE__namespace.Matrix4().copy(r.ecefToEnuMatrix),u.boundingBox=new THREE__namespace.Box3,u.autoRefine=!0,u.refined=!1,u.refineProgress=[0,0],u.loaded=!1,u.disposed=!1,u.clearStencilObject=new THREE__namespace.Mesh(CLEAR_STENCIL_GEOMETRY,CLEAR_STENCIL_MATERIAL),u.clearStencilObject.frustumCulled=!1,u.clearStencilObject.onAfterRender=function(l){return l.clearStencil()},u.tileset=new Tileset(e,{tileLoader:function(l){return u.loadContent(l)},tileUnloader:function(l){return u.unloadContent(l)},onTileLoad:function(){},onTileUnload:function(l){},onTileError:function(l,c){u.onError&&u.onError(Object.assign(c,{error:c})),console.error("Tile error",l.id,c)},trajectoryLoader:function(l){return u.loadTrajectory(l)},trajectoryUnloader:function(l){return u.unloadTrajectory(l)},onTrajectoryLoad:function(){},onTrajectoryUnload:function(l){},onTrajectoryError:function(l,c){u.onError&&u.onError(Object.assign(c,{error:c})),console.error("Trajectory error",l,c)}}),u.tileset.root.boundingVolume&&u.tileset.root.boundingVolume.getBoundingBox(u.boundingBox),u}return Object.defineProperty(t.prototype,"viewerRequestVolume",{get:function(){return this.tileset.root.viewerRequestVolume},set:function(e){this.tileset.root.viewerRequestVolume=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tiles",{get:function(){return this.tileset.selectedTiles},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"trajectories",{get:function(){return this.tileset.trajectories},enumerable:!1,configurable:!0}),t.prototype.getRecommendProps=function(e){return e===void 0&&(e={}),getRecommendTile3dProps(this,e)},t.prototype.loadContent=function(e){var r=this;return loadTileContent(e,{light:this.light,fetcher:this.fetcher,search:this.search,renderer:this.renderer}).then(function(o){e.type==="SCENEGRAPH"&&(r.disposed||!e.content?unloadTileContent(e):e.content.data&&r.boundingBox.expandByObject(e.content.data.object))})},t.prototype.unloadContent=function(e){return unloadTileContent(e),Promise.resolve()},t.prototype.loadAllTilesets=function(){var e=this,r=function(o){var s=[];return e.tileset.root.traverse(function(u){var l;u.type==="TILESET"&&((l=u.content)===null||l===void 0?void 0:l.loadState)!=="READY"&&s.push(u)}),Promise.all(s.map(function(u){return e.loadContent(u).then(function(){return r()})})).then(function(){})};return r(this.tileset.root)},t.prototype.loadTrajectory=function(e){var r=this;return loadTrajectory(e,{fetcher:this.fetcher,search:this.search,renderer:this.renderer}).then(function(o){r.disposed&&unloadTrajectory(o)})},t.prototype.unloadTrajectory=function(e){return unloadTrajectory(e),Promise.resolve()},t.prototype.intersectRaycaster=function(e,r){for(var o,s,u,l=r!=null?r:[],c=[this.tileset.root],f=this.tileset.transform,p,d=e.sortByDistance,h=(s=(o=e.params.Points)===null||o===void 0?void 0:o.threshold)!==null&&s!==void 0?s:0,g=1/0;p=c.pop();){var A=void 0;if(p.boundingVolume){var m=void 0;p.boundingVolume instanceof BoxBoundingVolume?m=scratchBoxBoundingVolume.copy(p.boundingVolume):p.boundingVolume instanceof SphereBoundingVolume?m=scratchSphereBoundingVolume.copy(p.boundingVolume):m=p.boundingVolume.clone(),m.applyMatrix4(f),A=m.intersectRay(e.ray,h,g)}else A=!0;if(A){for(var E=0,v=p.children.length;E<v;E++)c.push(p.children[E]);if(p.selected&&p.content&&p.content.data&&p.content.data.object.visible&&(p.content.data.object.intersectRaycaster(e,l),e.firstHitOnly)){var y=l[0];y&&g>y.distance&&(g=y.distance)}}}e.sortByDistance=d,sortIntersects(l,e.sortByDistance,e.firstHitOnly);for(var b=0,_=l;b<_.length;b++){var y=_[b];y.model=(u=this.parent)!==null&&u!==void 0?u:void 0,y.viewLayer=this}return l},t.prototype.update=function(e,r,o,s){var u,l,c=this,f,p,d,h,g;this.renderer=e,this.frameNumber++;var A=!1,m=this.parameter.resolveValue(o.parameter,s.parameter);parameterVersionMap.get(this)!==m.version&&(parameterVersionMap.set(this,m.version),A=!0);var E=m.maxLevelOfDetail;E=Math.max(E,0);var v=Math.min(m.minLevelOfDetail,E);(!this.visible||!this.loaded||!o.loaded)&&(E=Math.max(v,0));var y=m.minGeometricError,b=r.controllerMode;(b==="Panorama"||b==="VRPanorama"||b==="XRPanorama")&&m.modelAlpha<.1&&(y=m.panoramaMinGeometricError);var _=m.maxGeometricError;_=Math.max(y,_);var T={time:r.time,camera:{type:r.type,position:new THREE__namespace.Vector3().copy(r.position),direction:r.getDirection(new THREE__namespace.Vector3),up:new THREE__namespace.Vector3().copy(r.up).applyQuaternion(r.quaternion),projectionMatrix:r.projectionMatrix.clone(),visible:r.visible,refine:r.refineModel},height:r.resolution.height,pixelRatio:r.pixelRatio,frameNumber:this.frameNumber,sseDenominator:2*Math.tan(.5*r.fov/180*Math.PI),cullingVolume:new CullingVolume().setFromCamera(r),minLevelOfDetail:v,maxLevelOfDetail:E,minGeometricError:y,maxGeometricError:_,skipLevelOfDetail:m.skipLevelOfDetail,mostDetail:m.mostDetail,loadSiblings:m.loadSiblings,cameraCulling:m.cameraCulling,maxMemoryUsage:m.maxMemoryUsage,maxRequests:m.maxRequests,requestOrder:m.requestOrder,maxScreenSpaceError:m.maxScreenSpaceError,memoryAdjustedOverflow:m.memoryAdjustedOverflow,memoryAdjustedScreenSpaceError:m.memoryAdjustedScreenSpaceError},S=m.cacheCameras.map(function(re){return re.updateProjectionMatrix(),__assign(__assign({},T),{camera:{type:r.type,position:new THREE__namespace.Vector3().copy(re.position),direction:re.getWorldDirection(new THREE__namespace.Vector3),up:new THREE__namespace.Vector3().copy(re.up),projectionMatrix:re.projectionMatrix.clone(),visible:re.visible,refine:!0},cullingVolume:new CullingVolume().setFromCamera(re)})});this.updateWorldMatrix(!0,!1),this.tileset.transform.equals(this.matrixWorld)||(this.tileset.transform.copy(this.matrixWorld),A=!0);var R=!this.autoRefine;if(R===!1){var w=m.progress>.01&&m.progress<.99;if(w){var M=new THREE__namespace.Vector3;m.pano0&&M.setFromMatrixPosition(m.pano0.matrix);var B=M.clone();m.pano1&&B.setFromMatrixPosition(m.pano1.matrix),M.distanceTo(B)<10&&(R=!0)}}if(R||this.tileset.update(T,S),this.refined=!0,this.refineProgress[0]=0,this.refineProgress[1]=0,this.tileset.needsRefinedTiles.forEach(function(re){if(c.refineProgress[1]++,re.content){var ue=re.content.loadState;if(ue==="UNLOADED"||ue==="LOADING"){c.refined=!1;return}}c.refineProgress[0]++}),this.loaded===!1&&this.autoRefine){this.loaded=!0;var C=!1;this.tileset.needsRefinedTiles.forEach(function(re){if(c.loaded!==!1&&re.content){if(re.state.visible&&(C=!0),T.skipLevelOfDetail){if(re.state.finalResolution){var ue=re.state.ancestorWithContentAvailable,ve=ue&&ue.content?ue.content:re.content,ye=ve.loadState;(ye==="UNLOADED"||ye==="LOADING")&&(c.loaded=!1)}}else if(re.state.visible&&re.levelOfContent<=0){var ye=re.content.loadState;(ye==="UNLOADED"||ye==="LOADING")&&(c.loaded=!1)}}}),C&&this.tileset.selectedTiles.length===0&&this.tileset.frameNumber<500&&(this.loaded=!1),this.loaded===!0&&(this.refined=!1,this.refineProgress[1]++)}this.renderObjects.length=0,this.backfaceObjects.length=0,this.tileObjects.length=0,this.remove.apply(this,this.children),T.skipLevelOfDetail||this.tileset.selectedTiles.sort(function(re,ue){return re.floor!==ue.floor?re.floor-ue.floor:re.levelOfContent!==ue.levelOfContent?ue.levelOfContent-re.levelOfContent:re.state.distanceToCamera!==ue.state.distanceToCamera?re.state.distanceToCamera-ue.state.distanceToCamera:re.state.centerZDepth-ue.state.centerZDepth});for(var P=[],F=0,L=this.tileset.selectedTiles;F<L.length;F++){var O=L[F],k=(p=(f=O.content)===null||f===void 0?void 0:f.data)===null||p===void 0?void 0:p.object;if(k){var D=k.update(e,r,o,this,O,m);if(P.push(O.id),D&&(A=!0),this.tileset.hasMixedContent&&T.skipLevelOfDetail){if(!O.state.finalResolution){var J=cloneSkipBackfaceObject(k);J.name="skipBackface:"+k.name,this.backfaceObjects.push(J)}for(var G=O.state.selectionDepth,U=STENCIL_CONSTANT.TILE_MASK|G<<STENCIL_CONSTANT.SKIP_LOD_BIT_SHIFT,z=THREE__namespace.GreaterEqualStencilFunc,q=STENCIL_CONSTANT.SKIP_LOD_MASK,j=THREE__namespace.ReplaceStencilOp,K=STENCIL_CONSTANT.TILE_MASK|STENCIL_CONSTANT.SKIP_LOD_MASK,Y=0,X=k.materials;Y<X.length;Y++){var Q=X[Y];Q.stencilWrite=!0,Q.stencilRef=U,Q.stencilFunc=z,Q.stencilFuncMask=q,Q.stencilZPass=j,Q.stencilWriteMask=K}}else for(var W=0,$=k.materials;W<$.length;W++){var Q=$[W];Q.stencilWrite=!1,Q.stencilRef=STENCIL_CONSTANT.TILE_MASK,Q.stencilFunc=THREE__namespace.AlwaysStencilFunc,Q.stencilFuncMask=STENCIL_CONSTANT.TILE_MASK,Q.stencilZPass=THREE__namespace.ReplaceStencilOp,Q.stencilWriteMask=STENCIL_CONSTANT.TILE_MASK}this.tileObjects.push(k)}}var ie=P.toString();tileVersionMap.get(this)!==ie&&(tileVersionMap.set(this,ie),A=!0),T.skipLevelOfDetail&&this.backfaceObjects.length&&(u=this.renderObjects).push.apply(u,this.backfaceObjects),this.tileObjects.length&&(l=this.renderObjects).push.apply(l,this.tileObjects),T.skipLevelOfDetail&&this.renderObjects.push(this.clearStencilObject);for(var ee=[],ne=0,te=this.tileset.selectedTrajectories;ne<te.length;ne++){var pe=te[ne],oe=(d=pe.content.data)===null||d===void 0?void 0:d.object;if(oe){var D=oe.update(e,r,o,this,pe,m);ee.push(pe.id),D&&(A=!0),this.renderObjects.push(oe)}}var de=ee.toString();trajectoryVersionMap.get(this)!==de&&(trajectoryVersionMap.set(this,de),A=!0);for(var me=Math.min(0,((g=(h=this.parent)===null||h===void 0?void 0:h.children)!==null&&g!==void 0?g:[]).indexOf(this)),be=me*1e4,_e=function(re){var ue=le.renderObjects[re],ve=re+be;ue.traverse(function(ye){(ye instanceof THREE__namespace.Mesh||ye instanceof THREE__namespace.Line||ye instanceof THREE__namespace.Points)&&(ye.renderOrder=ve)}),le.add(ue)},le=this,fe=0;fe<this.renderObjects.length;fe++)_e(fe);return A},t.prototype.dispose=function(){this.disposed=!0,this.tileset.reset(),/^blob\:/.test(this.tileset.id)&&URL.revokeObjectURL(this.tileset.id),this.remove.apply(this,this.children),this.refined=!1,this.loaded=!1,this.refineProgress[0]=this.refineProgress[1]=0},Object.defineProperty(t.prototype,"model",{get:function(){return this.parent},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"scene",{get:function(){return this},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"viewLayer",{get:function(){return this},enumerable:!1,configurable:!0}),t.prototype.localToEnu=function(e){return e.applyMatrix4(localToEnuMatrix)},t.prototype.enuToLocal=function(e){return e.applyMatrix4(enuToLocalMatrix)},t.prototype.enuToEcef=function(e){return e.applyMatrix4(this.enuToEcefMatrix)},t.prototype.ecefToEnu=function(e){return e.applyMatrix4(this.ecefToEnuMatrix)},t.prototype.localToEcef=function(e){return this.enuToEcef(this.localToEnu(e))},t.prototype.ecefToLocal=function(e){return this.enuToLocal(this.ecefToEnu(e))},t.prototype.localToLla=function(e){return ecefToLla(this.enuToEcef(this.localToEnu(e)))},t.prototype.llaToLocal=function(e){return this.enuToLocal(this.ecefToEnu(llaToEcef(e)))},t.prototype.worldToEnu=function(e){return this.localToEnu(this.worldToLocal(e))},t.prototype.enuToWorld=function(e){return this.localToWorld(this.enuToLocal(e))},t.prototype.worldToEcef=function(e){return this.localToEcef(this.worldToLocal(e))},t.prototype.ecefToWorld=function(e){return this.localToWorld(this.ecefToLocal(e))},t.prototype.worldToLla=function(e){return this.localToLla(this.worldToLocal(e))},t.prototype.llaToWorld=function(e){return this.localToWorld(this.llaToLocal(e))},Object.defineProperty(t.prototype,"coordinates",{get:function(){scratchVector3$6.setScalar(0);var e=this.localToLla(scratchVector3$6),r=e.x,o=e.y;return[r,o].map(function(s){return(s/Math.PI*180).toFixed(6)}).join(",")},enumerable:!1,configurable:!0}),t.prototype.getTransformMatrix4=function(e){return e===void 0&&(e=new THREE__namespace.Matrix4),e.copy(this.ecefToEnuMatrix),e.premultiply(enuToLocalMatrix),e.premultiply(this.matrixWorld),e},t.prototype.coordinatesToWorldPoint=function(e){var r=new THREE__namespace.Vector3(e.latitude,e.longitude,e.altitude);return this.llaToWorld(r)},t.prototype.worldPointToCoordinates=function(e){return scratchVector3$6.copy(e),this.worldToLla(scratchVector3$6),{latitude:scratchVector3$6.x,longitude:scratchVector3$6.y,altitude:scratchVector3$6.z}},t.prototype.resetBrightness=function(){this.parameter.reset("brightness")},Object.defineProperty(t.prototype,"minLevelOfDetail",{get:function(){var e,r=[];return this.parent&&this.parent.parameter instanceof Parameter&&(r.unshift(this.parent.parameter),this.parent.parent&&this.parent.parent.parameter instanceof Parameter&&r.unshift(this.parent.parent.parameter)),(e=this.parameter).resolveValue.apply(e,r).minLevelOfDetail},set:function(e){this.parameter.set("minLevelOfDetail",e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxLevelOfDetail",{get:function(){var e,r=[];return this.parent&&this.parent.parameter instanceof Parameter&&(r.unshift(this.parent.parameter),this.parent.parent&&this.parent.parent.parameter instanceof Parameter&&r.unshift(this.parent.parent.parameter)),(e=this.parameter).resolveValue.apply(e,r).maxLevelOfDetail},set:function(e){this.parameter.set("maxLevelOfDetail",e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"minGeometricError",{get:function(){var e,r=[];return this.parent&&this.parent.parameter instanceof Parameter&&(r.unshift(this.parent.parameter),this.parent.parent&&this.parent.parent.parameter instanceof Parameter&&r.unshift(this.parent.parent.parameter)),(e=this.parameter).resolveValue.apply(e,r).minGeometricError},set:function(e){this.parameter.set("minGeometricError",e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxGeometricError",{get:function(){var e,r=[];return this.parent&&this.parent.parameter instanceof Parameter&&(r.unshift(this.parent.parameter),this.parent.parent&&this.parent.parent.parameter instanceof Parameter&&r.unshift(this.parent.parent.parameter)),(e=this.parameter).resolveValue.apply(e,r).maxGeometricError},set:function(e){this.parameter.set("maxGeometricError",e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"panoramaMinGeometricError",{get:function(){var e,r=[];return this.parent&&this.parent.parameter instanceof Parameter&&(r.unshift(this.parent.parameter),this.parent.parent&&this.parent.parent.parameter instanceof Parameter&&r.unshift(this.parent.parent.parameter)),(e=this.parameter).resolveValue.apply(e,r).panoramaMinGeometricError},set:function(e){this.parameter.set("panoramaMinGeometricError",e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"skipLevelOfDetail",{get:function(){var e,r=[];return this.parent&&this.parent.parameter instanceof Parameter&&(r.unshift(this.parent.parameter),this.parent.parent&&this.parent.parent.parameter instanceof Parameter&&r.unshift(this.parent.parent.parameter)),(e=this.parameter).resolveValue.apply(e,r).skipLevelOfDetail},set:function(e){this.parameter.set("skipLevelOfDetail",e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mostDetail",{get:function(){var e,r=[];return this.parent&&this.parent.parameter instanceof Parameter&&(r.unshift(this.parent.parameter),this.parent.parent&&this.parent.parent.parameter instanceof Parameter&&r.unshift(this.parent.parent.parameter)),(e=this.parameter).resolveValue.apply(e,r).mostDetail},set:function(e){this.parameter.set("mostDetail",e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"loadSiblings",{get:function(){var e,r=[];return this.parent&&this.parent.parameter instanceof Parameter&&(r.unshift(this.parent.parameter),this.parent.parent&&this.parent.parent.parameter instanceof Parameter&&r.unshift(this.parent.parent.parameter)),(e=this.parameter).resolveValue.apply(e,r).loadSiblings},set:function(e){this.parameter.set("loadSiblings",e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxMemoryUsage",{get:function(){var e,r=[];return this.parent&&this.parent.parameter instanceof Parameter&&(r.unshift(this.parent.parameter),this.parent.parent&&this.parent.parent.parameter instanceof Parameter&&r.unshift(this.parent.parent.parameter)),(e=this.parameter).resolveValue.apply(e,r).maxMemoryUsage},set:function(e){this.parameter.set("maxMemoryUsage",e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxRequests",{get:function(){var e,r=[];return this.parent&&this.parent.parameter instanceof Parameter&&(r.unshift(this.parent.parameter),this.parent.parent&&this.parent.parent.parameter instanceof Parameter&&r.unshift(this.parent.parent.parameter)),(e=this.parameter).resolveValue.apply(e,r).maxRequests},set:function(e){this.parameter.set("maxRequests",e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"requestOrder",{get:function(){var e,r=[];return this.parent&&this.parent.parameter instanceof Parameter&&(r.unshift(this.parent.parameter),this.parent.parent&&this.parent.parent.parameter instanceof Parameter&&r.unshift(this.parent.parent.parameter)),(e=this.parameter).resolveValue.apply(e,r).requestOrder},set:function(e){this.parameter.set("requestOrder",e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxScreenSpaceError",{get:function(){var e,r=[];return this.parent&&this.parent.parameter instanceof Parameter&&(r.unshift(this.parent.parameter),this.parent.parent&&this.parent.parent.parameter instanceof Parameter&&r.unshift(this.parent.parent.parameter)),(e=this.parameter).resolveValue.apply(e,r).maxScreenSpaceError},set:function(e){this.parameter.set("maxScreenSpaceError",e)},enumerable:!1,configurable:!0}),t})(THREE__namespace.Object3D),fetcherMap=new Map;function getFetcher(n){var t=fetcherMap.get(n);if(t)return t;throw new Error("fetcher never registered.")}function registerFetcher(n,t){return fetcherMap.set(n,t)}var scratchVector3$5=new THREE__namespace.Vector3,scratchMatrix4$2=new THREE__namespace.Matrix4;function getEcefToEnuMatrixFromUpAxis(n,t,e){switch(n){case"Z":e.identity();break;case"Y":e.fromArray([1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1]);break;case"-Y":e.fromArray([1,0,0,0,0,0,-1,0,0,1,0,0,0,0,0,1]);break;case"WGS84":case"GCJ02":case"BD09":getEcefToEnuMatrix(t,e);break;default:e.identity();break}return e}function getExt(n){var t=/([0-9a-z\.\_\-]+)([\?\#].*)?$/i.exec(n);if(t){var e=String(t[1]).trim().split(".").slice(1).reverse()[0];if(e)return e}return""}function loadViewLayer(n,t){var e,r=n.tileset,o=n.name,s=n.type,u=n.work.getURL(r),l=u.split("#"),c=l[0],f=l[1],p=(e=(f||c).split("?")[1])!==null&&e!==void 0?e:"";return t.fetcher.ajax(u,{responseType:"text"}).catch(function(d){return{error:d,body:JSON.stringify({asset:{version:"0.0"},geometricError:0,root:{geometricError:0}})}}).then(function(d){var h,g="error"in d?d.error:null,A=normalizeTilesetHeader(JSON.parse(d.body),u),m=A.root,E=A.rootMeta,v=E===void 0?{}:E,y=n.upAxis;v.upAxis&&v.upAxis!==y&&(y=v.upAxis),"lodVersion"in A&&(y="-Y","floorInfo"in A&&(A.properties=A.properties||{},A.properties.floorInfo=A.floorInfo.map(function(w){return{ground:-w.ground,height:w.height}}),delete A.floorInfo),A.asset.tilesetVersion=String(A.lodVersion),delete A.lodVersion);var b=m.boundingVolume?makeBoundingVolume(m.boundingVolume):void 0;b&&m.transform&&b.applyMatrix4(scratchMatrix4$2.fromArray(m.transform));var _=null,T=new THREE__namespace.Matrix4,S=new THREE__namespace.Matrix4;v.coordinate?(_=v.coordinate.ground_height,T.fromArray(v.coordinate.pose_ecef_to_enu),S.fromArray(v.coordinate.pose_enu_to_ecef)):(b?b.getCenter(scratchVector3$5):scratchVector3$5.setScalar(0),getEcefToEnuMatrixFromUpAxis(y,scratchVector3$5,T),S.getInverse(T)),A.root={refine:(h=m.refine)!==null&&h!==void 0?h:"REPLACE",geometricError:m.geometricError,transform:scratchMatrix4$2.copy(T).premultiply(enuToLocalMatrix).toArray(),boundingVolume:b?b.toJson():void 0,children:[m]};var R=new Tile3D(A,{name:o,type:s,upAxis:y,light:t.light,fetcher:t.fetcher,search:p,groundHeight:_,enuToEcefMatrix:S,ecefToEnuMatrix:T,error:g});return R})}function loadViewLayers(n,t){var e,r,o=n.layers.slice();if(n.file){for(var s=!1,u=0,l=o;u<l.length;u++){var c=l[u];if(c.type==="mesh"){s=!0;break}}if(s===!1){var f=getExt(n.file)||"at3d",p=JSON.stringify({asset:{version:"0.0"},geometricError:0,root:{refine:"REPLACE",geometricError:0,transform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],content:{uri:n.work.getURL(n.file)},extras:(e={},e[f]={textureBaseUri:typeof n.textureBase=="string"?n.work.getURL(n.textureBase):void 0,textureArray:n.textures,textureOptions:(r=t.textureOptions)!==null&&r!==void 0?r:{}},e)}});o.push({work:n.work,name:"fallback",type:"mesh",upAxis:"Z",tileset:URL.createObjectURL(new Blob([p],{type:"application/json"}))})}}return o.map(function(d){return loadViewLayer(d,{fetcher:t.fetcher,light:t.light}).then(function(h){return t.onError&&(h.error&&t.onError(h.error),h.onError=t.onError),h})})}var BufferGeometryUtils={computeTangents:function(n){var t=n.index,e=n.attributes;if(t===null||e.position===void 0||e.normal===void 0||e.uv===void 0){console.warn("THREE.BufferGeometry: Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()");return}var r=t.array,o=e.position.array,s=e.normal.array,u=e.uv.array,l=o.length/3;e.tangent===void 0&&n.setAttribute("tangent",new THREE__namespace.BufferAttribute(new Float32Array(4*l),4));for(var c=e.tangent.array,f=[],p=[],d=0;d<l;d++)f[d]=new THREE__namespace.Vector3,p[d]=new THREE__namespace.Vector3;var h=new THREE__namespace.Vector3,g=new THREE__namespace.Vector3,A=new THREE__namespace.Vector3,m=new THREE__namespace.Vector2,E=new THREE__namespace.Vector2,v=new THREE__namespace.Vector2,y=new THREE__namespace.Vector3,b=new THREE__namespace.Vector3;function _(U,z,q){h.fromArray(o,U*3),g.fromArray(o,z*3),A.fromArray(o,q*3),m.fromArray(u,U*2),E.fromArray(u,z*2),v.fromArray(u,q*2);var j=g.x-h.x,K=A.x-h.x,Y=g.y-h.y,X=A.y-h.y,Q=g.z-h.z,W=A.z-h.z,$=E.x-m.x,ie=v.x-m.x,ee=E.y-m.y,ne=v.y-m.y,te=1/($*ne-ie*ee);y.set((ne*j-ee*K)*te,(ne*Y-ee*X)*te,(ne*Q-ee*W)*te),b.set(($*K-ie*j)*te,($*X-ie*Y)*te,($*W-ie*Q)*te),f[U].add(y),f[z].add(y),f[q].add(y),p[U].add(b),p[z].add(b),p[q].add(b)}var T=n.groups;T.length===0&&(T=[{start:0,count:r.length}]);for(var d=0,S=T.length;d<S;++d)for(var R=T[d],w=R.start,M=R.count,B=w,C=w+M;B<C;B+=3)_(r[B+0],r[B+1],r[B+2]);var P=new THREE__namespace.Vector3,F=new THREE__namespace.Vector3,L=new THREE__namespace.Vector3,O=new THREE__namespace.Vector3,k,D,J;function G(U){L.fromArray(s,U*3),O.copy(L),D=f[U],P.copy(D),P.sub(L.multiplyScalar(L.dot(D))).normalize(),F.crossVectors(O,D),J=F.dot(p[U]),k=J<0?-1:1,c[U*4]=P.x,c[U*4+1]=P.y,c[U*4+2]=P.z,c[U*4+3]=k}for(var d=0,S=T.length;d<S;++d)for(var R=T[d],w=R.start,M=R.count,B=w,C=w+M;B<C;B+=3)G(r[B+0]),G(r[B+1]),G(r[B+2])},mergeBufferGeometries:function(n,t){for(var e=n[0].index!==null,r=new Set(Object.keys(n[0].attributes)),o=new Set(Object.keys(n[0].morphAttributes)),s={},u={},l=new THREE__namespace.BufferGeometry,c=0,f=0;f<n.length;++f){var p=n[f];if(e!==(p.index!==null))return null;for(var d in p.attributes){if(!r.has(d))return null;s[d]===void 0&&(s[d]=[]),s[d].push(p.attributes[d])}for(var d in p.morphAttributes){if(!o.has(d))return null;u[d]===void 0&&(u[d]=[]),u[d].push(p.morphAttributes[d])}if(l.userData.mergedUserData=l.userData.mergedUserData||[],l.userData.mergedUserData.push(p.userData),t){var h;if(e)h=p.index.count;else if(p.attributes.position!==void 0)h=p.attributes.position.count;else return null;l.addGroup(c,h,f),c+=h}}if(e){for(var g=0,A=[],f=0;f<n.length;++f){for(var m=n[f].index,E=0;E<m.count;++E)A.push(m.getX(E)+g);g+=n[f].attributes.position.count}l.setIndex(A)}for(var d in s){var v=this.mergeBufferAttributes(s[d]);if(!v)return null;l.setAttribute(d,v)}for(var d in u){var y=u[d][0].length;if(y===0)break;l.morphAttributes=l.morphAttributes||{},l.morphAttributes[d]=[];for(var f=0;f<y;++f){for(var b=[],E=0;E<u[d].length;++E)b.push(u[d][E][f]);var _=this.mergeBufferAttributes(b);if(!_)return null;l.morphAttributes[d].push(_)}}return l},mergeBufferAttributes:function(n){for(var t,e,r,o=0,s=0;s<n.length;++s){var u=n[s];if(u.isInterleavedBufferAttribute||(t===void 0&&(t=u.array.constructor),t!==u.array.constructor)||(e===void 0&&(e=u.itemSize),e!==u.itemSize)||(r===void 0&&(r=u.normalized),r!==u.normalized))return null;o+=u.array.length}for(var l=new t(o),c=0,s=0;s<n.length;++s)l.set(n[s].array,c),c+=n[s].array.length;return new THREE__namespace.BufferAttribute(l,e,r)},interleaveAttributes:function(n){for(var t,e=0,r=0,o=0,s=n.length;o<s;++o){var u=n[o];if(t===void 0&&(t=u.array.constructor),t!==u.array.constructor)return console.warn("AttributeBuffers of different types cannot be interleaved"),null;e+=u.array.length,r+=u.itemSize}for(var l=new THREE__namespace.InterleavedBuffer(new t(e),r),c=0,f=[],p=["getX","getY","getZ","getW"],d=["setX","setY","setZ","setW"],h=0,s=n.length;h<s;h++){var u=n[h],g=u.itemSize,A=u.count,m=new THREE__namespace.InterleavedBufferAttribute(l,g,c,u.normalized);f.push(m),c+=g;for(var E=0;E<A;E++)for(var v=0;v<g;v++)m[d[v]](E,u[p[v]](E))}return f},estimateBytesUsed:function(n){var t=0;for(var e in n.attributes){var r=n.getAttribute(e);t+=r.count*r.itemSize*r.array.BYTES_PER_ELEMENT}var o=n.getIndex();return t+=o?o.count*o.itemSize*o.array.BYTES_PER_ELEMENT:0,t},mergeVertices:function(n,t){t===void 0&&(t=1e-4),t=Math.max(t,Number.EPSILON);for(var e={},r=n.getIndex(),o=n.getAttribute("position"),s=r?r.count:o.count,u=0,l=Object.keys(n.attributes),c={},f={},p=[],d=["getX","getY","getZ","getW"],h=0,g=l.length;h<g;h++){var A=l[h];c[A]=[];var m=n.morphAttributes[A];m&&(f[A]=new Array(m.length).fill().map(function(){return[]}))}for(var E=Math.log10(1/t),v=Math.pow(10,E),h=0;h<s;h++){for(var y=r?r.getX(h):h,b="",_=0,g=l.length;_<g;_++)for(var A=l[_],T=n.getAttribute(A),S=T.itemSize,R=0;R<S;R++)b+="".concat(~~(T[d[R]](y)*v),",");if(b in e)p.push(e[b]);else{for(var _=0,g=l.length;_<g;_++)for(var A=l[_],T=n.getAttribute(A),m=n.morphAttributes[A],S=T.itemSize,w=c[A],M=f[A],R=0;R<S;R++){var B=d[R];if(w.push(T[B](y)),m)for(var C=0,P=m.length;C<P;C++)M[C].push(m[C][B](y))}e[b]=u,p.push(u),u++}}for(var F=n.clone(),h=0,g=l.length;h<g;h++){var A=l[h],L=n.getAttribute(A),O=new L.array.constructor(c[A]),T=new THREE__namespace.BufferAttribute(O,L.itemSize,L.normalized);if(F.setAttribute(A,T),A in f)for(var _=0;_<f[A].length;_++){var k=n.morphAttributes[A][_],O=new k.array.constructor(f[A][_]),D=new THREE__namespace.BufferAttribute(O,k.itemSize,k.normalized);F.morphAttributes[A][_]=D}}return F.setIndex(p),F}},scratchSphere$1=new THREE__namespace.Sphere,scratchMatrix4$1=new THREE__namespace.Matrix4,scratchMatrix4Inverse=new THREE__namespace.Matrix4;function getEdgesBySphere(n,t,e){e===void 0&&(e=30/180*Math.PI);for(var r=Math.cos(e),o=[],s=0,u=n.children;s<u.length;s++){var l=u[s];l instanceof Tile3D&&l.tileset.selectedTiles.forEach(function(c){var f,p,d,h=(p=(f=c.content)===null||f===void 0?void 0:f.data)===null||p===void 0?void 0:p.object;if(h&&h.visible){var g=[];if(h.traverseVisible(function(z){if(z instanceof THREE__namespace.Mesh){var q=getBvhTreeForMesh(z);if(q){scratchMatrix4$1.copy(z.matrixWorld),scratchMatrix4Inverse.getInverse(scratchMatrix4$1),scratchSphere$1.copy(t).applyMatrix4(scratchMatrix4Inverse);var j=q.trianglesInSphere(scratchSphere$1.center,scratchSphere$1.radius),K=new THREE__namespace.BufferGeometry;K.setAttribute("position",new THREE__namespace.BufferAttribute(j,3)),K.applyMatrix4(z.matrixWorld),K=BufferGeometryUtils.mergeVertices(K,.01),g.push(K)}}}),g.length===0)return;for(var A=["a","b","c"],m=BufferGeometryUtils.mergeBufferGeometries(g,!1),E=m.getAttribute("position").array,v=((d=m.getIndex())===null||d===void 0?void 0:d.array)||[],y=[],b=[],_=0,T=E.length;_<T;_+=3){var S=new THREE__namespace.Vector3(E[_],E[_+1],E[_+2]);y.push(S)}for(var _=0,T=v.length;_<T;_+=3){var R=v[_],w=v[_+1],M=v[_+2],B=new THREE__namespace.Vector3().crossVectors(y[w].clone().sub(y[R]),y[M].clone().sub(y[R])).normalize();b.push({a:R,b:w,c:M,normal:B})}for(var C={},_=0,T=b.length;_<T;_++)for(var P=b[_],F=0;F<3;F++){var L=P[A[F]],O=P[A[(F+1)%3]],k=[Math.min(L,O),Math.max(L,O)],D=k[0]+"-"+k[1];C[D]===void 0?C[D]={index1:k[0],index2:k[1],face1:_}:C[D].face2=_}for(var D in C){var J=C[D];if(J.face2===void 0||b[J.face1].normal.dot(b[J.face2].normal)<=r){var G=y[J.index1],U=y[J.index2];o.push(new THREE__namespace.Line3(G,U))}}y.length=0,b.length=0}})}return o}var scratchBoundingBox$1=new THREE__namespace.Box3,scratchViewLayerBox=new THREE__namespace.Box3,scratchObserverBox$3=new THREE__namespace.Box3,Model=(function(n){__extends(t,n);function t(e,r){r===void 0&&(r={});var o,s=n.call(this)||this;s.disposed=!1,s.parameter=new Parameter,s.outdated=!1,s.autoRefine=!0,s.metaPending=!1,s.loaded=!1,s.refined=!1,s.refineProgress=[0,0],s.boundingBox=new THREE__namespace.Box3,s.needsRender=!1,s.work=e,s.name=s.work.workCode;for(var u=0,l=0,c=e.observers;l<c.length;l++){var f=c[l];u=Math.max(u,f.floorIndex)}if(s.floorLength=u+1,e.model){s.metaPending=!0;var p=loadViewLayers(e.model,{fetcher:getFetcher(e),light:(o=r.light)!==null&&o!==void 0?o:!1,textureOptions:r.textureOptions,onError:function(d){return s.dispatchEvent({type:"error",error:d})}});s.initReady=Promise.all(p).then(function(d){if(s.metaPending=!1,d.length)if(s.disposed)for(var h=0,g=d;h<g.length;h++){var A=g[h];A.dispose()}else s.add.apply(s,d)}),s.loadedReady=new Promise(function(d){s.addEventListener("load",function(){return d()})})}else s.refined=!0,s.loaded=!0,s.initReady=Promise.resolve(),s.loadedReady=Promise.resolve();return s.parameter.set("boundingBox",s.boundingBox.clone()),s}return t.prototype.dispose=function(){this.disposed=!0;for(var e;e=this.children[0];)typeof e.dispose=="function"&&e.dispose(),this.remove(e)},Object.defineProperty(t.prototype,"empty",{get:function(){return this.children.length===0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"viewLayers",{get:function(){return this.children},enumerable:!1,configurable:!0}),t.prototype.getEdgesBySphere=function(e,r){return r===void 0&&(r=30/180*Math.PI),getEdgesBySphere(this,e,r)},t.prototype.intersectRaycaster=function(e,r){var o=r!=null?r:[],s=e.sortByDistance;e.sortByDistance=!1;for(var u=0,l=this.children.length;u<l;u++){var c=this.children[u];c.visible&&typeof c.intersectRaycaster=="function"&&c.intersectRaycaster(e,o)}return e.sortByDistance=s,sortIntersects(o,e.sortByDistance,e.firstHitOnly),o},t.prototype.update=function(e,r,o){var s=!1;this.needsRender===!0&&(this.needsRender=!1,s=!0);var u=this.loaded;this.refined=!this.metaPending,this.loaded=!this.metaPending,this.refineProgress[0]=this.refineProgress[1]=0,this.work.transform.equals(this.matrix)||(this.matrix.copy(this.work.transform),this.matrix.decompose(this.position,this.quaternion,this.scale),this.matrixAutoUpdate=!1,s=!0);for(var l=0,c=this.children;l<c.length;l++){var f=c[l];f.autoRefine=this.autoRefine;var p=f.update(e,r,o,this);p&&(s=!0),f.refined===!1&&(this.refined=!1),f.loaded===!1&&(this.loaded=!1),this.refineProgress[0]+=f.refineProgress[0],this.refineProgress[1]+=f.refineProgress[1]}scratchBoundingBox$1.makeEmpty(),scratchObserverBox$3.copy(this.work.observerBox),scratchObserverBox$3.isEmpty()||(scratchObserverBox$3.max.x+=1,scratchObserverBox$3.max.z+=1,scratchObserverBox$3.max.y+=1,scratchObserverBox$3.min.x-=1,scratchObserverBox$3.min.z-=1,scratchBoundingBox$1.union(scratchObserverBox$3));for(var d=0,h=this.viewLayers;d<h.length;d++){var f=h[d];f.boundingBox.isEmpty()||(scratchViewLayerBox.copy(f.boundingBox),scratchBoundingBox$1.union(scratchViewLayerBox))}return scratchBoundingBox$1.applyMatrix4(this.matrix),scratchBoundingBox$1.equals(this.boundingBox)||(this.boundingBox.copy(scratchBoundingBox$1),this.parameter.set("boundingBox",scratchBoundingBox$1.clone())),u===!1&&this.loaded===!0&&this.dispatchEvent({type:"load"}),s},t.prototype.localToEnu=function(e){return e.applyMatrix4(localToEnuMatrix)},t.prototype.enuToLocal=function(e){return e.applyMatrix4(enuToLocalMatrix)},t.prototype.worldToEnu=function(e){return this.localToEnu(this.worldToLocal(e))},t.prototype.enuToWorld=function(e){return this.localToWorld(this.enuToLocal(e))},Object.defineProperty(t.prototype,"shownFloor",{get:function(){return this.shownFloorIndex===-1?null:this.shownFloorIndex},set:function(e){this.shownFloorIndex=e===null?-1:e},enumerable:!1,configurable:!0}),t.prototype.show=function(e){this.shownFloor=e!=null?e:null,this.dispatchEvent({type:"changeShownFloor",shownFloor:e})},Object.defineProperty(t.prototype,"bounding",{get:function(){return this.boundingBox},enumerable:!1,configurable:!0}),t.prototype.setMaterial=function(e){this.parameter.set(e)},t.prototype.getMaterial=function(){var e,r=[];return this.parent&&this.parent.parameter instanceof Parameter&&r.unshift(this.parent.parameter),(e=this.parameter).resolveValue.apply(e,r)},Object.defineProperty(t.prototype,"shownFloorIndex",{get:function(){var e,r=[];return this.parent&&this.parent.parameter instanceof Parameter&&r.unshift(this.parent.parameter),(e=this.parameter).resolveValue.apply(e,r).shownFloorIndex},set:function(e){this.parameter.set("shownFloorIndex",e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"brightness",{get:function(){var e,r=[];return this.parent&&this.parent.parameter instanceof Parameter&&r.unshift(this.parent.parameter),(e=this.parameter).resolveValue.apply(e,r).brightness},set:function(e){this.parameter.set("brightness",e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"clippers",{get:function(){var e,r=[];return this.parent&&this.parent.parameter instanceof Parameter&&r.unshift(this.parent.parameter),(e=this.parameter).resolveValue.apply(e,r).clippers},set:function(e){this.parameter.set("clippers",e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"customShaders",{get:function(){var e,r=[];return this.parent&&this.parent.parameter instanceof Parameter&&r.unshift(this.parent.parameter),(e=this.parameter).resolveValue.apply(e,r).customShaders},set:function(e){this.parameter.set("customShaders",e)},enumerable:!1,configurable:!0}),t.prototype.resetBrightness=function(){this.parameter.reset("brightness");for(var e=0,r=this.viewLayers;e<r.length;e++){var o=r[e];o.resetBrightness()}},t})(THREE__namespace.Object3D),scratchBoundingBox3=new THREE__namespace.Box3,scratchModelBoundingBox3=new THREE__namespace.Box3,ModelScene=(function(n){__extends(t,n);function t(){var e=n.call(this)||this;e.needsRender=!0,e.autoRefine=!0,e.boundingBox=new THREE__namespace.Box3,e.loaded=!1,e.refined=!1,e.refineProgress=[0,0],e.parameter=new Parameter;var r=e.models=[];e.parameter.set("boundingBox",e.boundingBox.clone());var o=e;return defineProperty(r,"autoUpdate",{get:function(){return o.autoRefine},set:function(s){o.autoRefine=s}}),defineProperty(r,"bounding",{get:function(){return o.boundingBox}}),defineProperty(r,"loaded",{get:function(){return o.loaded}}),defineProperty(r,"refined",{get:function(){return o.refined}}),defineProperty(r,"refineProgress",{get:function(){return o.refineProgress}}),defineProperty(r,"cacheCameras",{get:function(){return o.parameter.resolveValue().cacheCameras},set:function(s){o.parameter.set("cacheCameras",s)}}),defineProperty(r,"intersectRaycaster",{value:function(s){return o.intersectRaycaster(s)}}),defineProperty(r,"setMaterial",{value:function(s){return o.setMaterial(s)}}),defineProperty(r,"getMaterial",{value:function(){return o.getMaterial()}}),defineProperty(r,"resetBrightness",{value:function(){return o.resetBrightness()}}),e}return t.prototype.add=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];n.prototype.add.apply(this,e),this.models.length=0;for(var o=0,s=this.children;o<s.length;o++){var u=s[o];u instanceof Model&&u.outdated!==!0&&this.models.push(u)}return this.needsRender=!0,this},t.prototype.remove=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];n.prototype.remove.apply(this,e),this.models.length=0;for(var o=0,s=this.children;o<s.length;o++){var u=s[o];u instanceof Model&&u.outdated!==!0&&this.models.push(u)}scratchBoundingBox3.makeEmpty();for(var l=0,c=this.children;l<c.length;l++){var u=c[l];u instanceof Model&&(scratchModelBoundingBox3.copy(u.boundingBox).applyMatrix4(u.matrix),scratchBoundingBox3.union(scratchModelBoundingBox3))}return this.boundingBox.copy(scratchBoundingBox3),this.needsRender=!0,this},t.prototype.intersectRaycaster=function(e,r){var o=r!=null?r:[],s=this.children.filter(function(p){return p instanceof Model});if(s.length===1)s[0].intersectRaycaster(e,o);else{var u=e.sortByDistance;e.sortByDistance=!1;for(var l=0,c=s;l<c.length;l++){var f=c[l];f.visible&&f.intersectRaycaster(e,o)}e.sortByDistance=u,sortIntersects(o,e.sortByDistance,e.firstHitOnly)}return o},t.prototype.update=function(e,r){var o=!1;scratchBoundingBox3.makeEmpty(),this.loaded=this.models.length>0,this.refined=this.models.length>0,this.refineProgress[0]=this.refineProgress[1]=0,this.models.length=0;for(var s=0,u=this.children;s<u.length;s++){var l=u[s];if(l instanceof Model)if(l.outdated){l.autoRefine=!1;var c=l.update(e,r,this);c&&(o=!0)}else{this.models.push(l),l.autoRefine=this.autoRefine;var c=l.update(e,r,this);c&&(o=!0),l.loaded===!1&&(this.loaded=!1),l.refined===!1&&(this.refined=!1),this.refineProgress[0]+=l.refineProgress[0],this.refineProgress[1]+=l.refineProgress[1],scratchModelBoundingBox3.copy(l.boundingBox),scratchBoundingBox3.union(scratchModelBoundingBox3)}else if(l.update){var c=l.update(e,r,this);c&&(o=!0)}}return scratchBoundingBox3.equals(this.boundingBox)||(this.boundingBox.copy(scratchBoundingBox3),this.parameter.set("boundingBox",scratchBoundingBox3.clone())),this.needsRender=o,o},Object.defineProperty(t.prototype,"bounding",{get:function(){return this.boundingBox},enumerable:!1,configurable:!0}),t.prototype.setMaterial=function(e){this.parameter.set(e)},t.prototype.getMaterial=function(){return this.parameter.resolveValue()},t.prototype.resetBrightness=function(){this.parameter.reset("brightness");for(var e=0,r=this.models;e<r.length;e++){var o=r[e];o.resetBrightness()}},t})(THREE__namespace.Scene);function workInitialToJson(n){var t,e={};return e.mode=n.mode,e.pano_index=n.panoIndex,e.longitude=n.longitude,e.latitude=n.latitude,e.fov=n.fov,e.distance=n.distance,e.offset=(t=n.offset)===null||t===void 0?void 0:t.toArray(),e}function workModelToJson(n){var t;if(n)return{file_url:n.file,material_base_url:n.textureBase,material_textures:(t=n.textures)===null||t===void 0?void 0:t.slice(),layers:n.layers.map(function(e){return{tileset_url:e.tileset,up_axis:e.upAxis,name:e.name,type:e.type}})}}function workObserverToObserverJson(n){return{index:n.index,floor_index:n.floorIndex,position:n.position.toArray(),standing_position:n.standingPosition.toArray(),quaternion:{x:n.quaternion.x,y:n.quaternion.y,z:n.quaternion.z,w:n.quaternion.w},visible_nodes:n.visibleNodes.slice(),accessible_nodes:n.accessibleNodes.slice()}}function workObserverToPanoramaJson(n){return{index:n.index,active:n.active,loadable:n.loadable,derived_id:n.derivedId,derived_id_str:n.derivedIdStr,size_list:n.images.sizeList.slice(),up:n.images.up,down:n.images.down,right:n.images.right,left:n.images.left,front:n.images.front,back:n.images.back,video:n.video?{matrix:n.video.matrix.toArray(),size:n.video.size.toArray(),source:n.video.source}:void 0}}function workToJson(n){return{_signature:"",allow_hosts:n.allowHosts.slice(),expire_at:n.expire.getTime().toString(),code:n.workCode,name:n.name,base_url:n.baseURL,initial:workInitialToJson(n.initial),model:workModelToJson(n.model),observers:n.observers.map(function(t){return workObserverToObserverJson(t)}),panorama:{count:n.observers.length,list:n.observers.map(function(t){return workObserverToPanoramaJson(t)})}}}function isNumber(n){return typeof n=="number"}function jsonClone(n){if(typeof n!="object"||n===null)return n;if(Array.isArray(n))return n.map(function(o){return typeof o!="object"||o===null?o:jsonClone(o)});var t={};for(var e in n){var r=n[e];t[e]=typeof r!="object"||r===null?r:jsonClone(r)}return t}function getType(n){return n==null?"null":Array.isArray(n)?"array":typeof n=="object"?"dict":"value"}function jsonMerge(n,t){var e=getType(n),r=getType(t);if(r==="null")return n;if(r==="value")return t;if(r!==e)return jsonClone(t);if(r==="array")for(var o=0;o<t.length;o++)n[o]=jsonMerge(n[o],t[o]);else if(r==="dict")for(var s in t)n[s]=jsonMerge(n[s],t[s]);return n}function jsonStableStrinfiy_(n,t){t===void 0&&(t=!1);var e=typeof n;if(e==="string")return JSON.stringify(n);if(n===!0)return"true";if(n===!1)return"false";if(n===null)return"null";if(n instanceof Array){for(var r="[",o=n.length-1,s=0;s<o;s++)r+=jsonStableStrinfiy_(n[s],!1)+",";return o>-1&&(r+=jsonStableStrinfiy_(n[s],!1)),r+"]"}if(n instanceof Object){if(typeof n.toJSON=="function")return jsonStableStrinfiy_(n.toJSON(),t);for(var u=Object.keys(n).sort(),l=u.length,r="",s=0;s<l;){var c=u[s],f=jsonStableStrinfiy_(n[c],!0);f!==void 0&&(s&&r!==""&&(r+=","),r+=JSON.stringify(c)+":"+f),s++}return"{"+r+"}"}switch(e){case"function":return JSON.stringify(n.toString());case"undefined":return t?void 0:null;case"number":return n;default:return isFinite(n)?n:null}}function jsonStableStrinfiy(n){return jsonStableStrinfiy_(n,!1)}function jsonHash(n){return"hash::".concat(sha256(jsonStableStrinfiy(n)))}function deepFreeze(n){Object.freeze(n);var t=typeof n=="function",e=Object.prototype.hasOwnProperty;return Object.getOwnPropertyNames(n).forEach(function(r){e.call(n,r)&&(!t||r!=="caller"&&r!=="callee"&&r!=="arguments")&&n[r]!==null&&(typeof n[r]=="object"||typeof n[r]=="function")&&!Object.isFrozen(n[r])&&deepFreeze(n[r])}),n}var URL_REGEXP=/^[0-9a-z]+\:\/\/(([^:/?#]*)(?::[0-9]+)?)/i,BUILDIN_ALLOW_HOST=deepFreeze(JSON.parse((function n(){var t=113,e=126,r=0,o="";return arguments[r].split(o).map(function(s){return s.charCodeAt(r)>e?s:String.fromCharCode((s.charCodeAt(r)+t)%e)}).join(o)})("h/y|pnyu|/9/xr;p|z/9/yvn{wvn;p|z/9/rnyrr;p|z/9/rnyrr;p{/9/rnyrr;w}/9/uv;p|z/9/uv;p{/9/rnyrr;p{/9/rnyrr;p|z/9/ywpq{;p|z/9/rnyrr:pq{;p|z/9/rnyrr:pq{;p{/9/rnyrr;nv/9/;p{/9/pq{;p{/9/pnyp{|qr;vr/j"))),domainRegex=/^([^.]+)(\.([^.]+))*$/;function isIPDomain(n){return/^(([1-9]?\d|1\d\d|2[0-4]\d|25[0-5])(\.(?!$)|$)){4}$/.test(n)}function matchDomain(n,t){if(!domainRegex.test(n)||!domainRegex.test(t))return!1;if(n==="*")return!0;var e=n.split(".").reverse(),r=t.split(".").reverse();if(e.length<=1)return n===t;for(var o=0;o<e.length;o++)if(e[o]!==r[o])return!1;return!0}function hostnameFromURL(n){if(/^blob\:/i.test(n)&&(n=n.slice(5)),/^data\:/i.test(n))return location.hostname;var t=n.match(URL_REGEXP);return t?t[2]:location.hostname}var error_invalid_input=function(){return new Error("Invalid input.")},error_invalid_certificate=function(){return new Error("Invalid certificate.")},error_invalid_signature=function(){return new Error("Invalid signature.")},error_date_expired=function(n){return new Error("Date(".concat(n.toString(),") expired."))},error_host_not_allowed=function(n){return new Error("Host(".concat(JSON.stringify(n),") is not allowed."))};function ObjectOmit(n,t){for(var e={},r=0,o=Object.keys(n);r<o.length;r++){var s=o[r];t.indexOf(s)===-1&&(e[s]=n[s])}return e}function jsonStableNoneNumberStrinfiy_(n,t){t===void 0&&(t=!1);var e=typeof n;if(e==="string")return JSON.stringify(n);if(n===!0)return"true";if(n===!1)return"false";if(n===null)return"null";if(n instanceof Array){for(var r="[",o=n.length-1,s=0;s<o;s++)r+=jsonStableNoneNumberStrinfiy_(n[s],!1)+",";return o>-1&&(r+=jsonStableNoneNumberStrinfiy_(n[s],!1)),r+"]"}if(n instanceof Object){if(typeof n.toJSON=="function")return jsonStableNoneNumberStrinfiy_(n.toJSON(),t);for(var u=Object.keys(n).sort(),l=u.length,r="",s=0;s<l;){var c=u[s],f=jsonStableNoneNumberStrinfiy_(n[c],!0);f!==void 0&&(s&&r!==""&&(r+=","),r+=JSON.stringify(c)+":"+f),s++}return"{"+r+"}"}switch(e){case"function":case"undefined":return t?void 0:null;case"number":return 0;default:return isFinite(n)?n:null}}function jsonStableNoneNumberStrinfiy(n){return String(jsonStableNoneNumberStrinfiy_(n,!1))}function verify(n){var t,e,r,o={};try{o=typeof n=="string"?JSON.parse(n):n}catch(m){return error_invalid_input()}if(typeof o!="object")return error_invalid_input();var s=typeof location!="undefined"?location.hostname:"",u=Date.now(),l=new Date(typeof o.expire_at=="string"&&/^\d+$/.test(o.expire_at)?Number(o.expire_at):o.expire_at),c=Array.isArray(o.allow_hosts)?o.allow_hosts:[];if(s.length===0||isIPDomain(s)||BUILDIN_ALLOW_HOST.filter(function(m){return matchDomain(m,s)}).length>0){var f=String((t=o.certificate)!==null&&t!==void 0?t:"");if(f){var p=new X509;return p.readCertPEM(f),deepFreeze({issuer:p.getSubjectString(),expire:l,allowHosts:c})}return deepFreeze({issuer:"none",expire:l,allowHosts:c})}var d=String((e=o.certificate)!==null&&e!==void 0?e:"");if(!d)return error_invalid_certificate();var h=new X509;h.readCertPEM(d);var g=String((r=o._signature)!==null&&r!==void 0?r:"");if(!g)return error_invalid_signature();var A=jsonStableNoneNumberStrinfiy(ObjectOmit(o,["_signature"]));return verifyMessage(A,g,h)===!1?error_invalid_signature():u<l.getTime()?BUILDIN_ALLOW_HOST.concat(c).filter(function(m){return matchDomain(m,s)}).length===0?error_host_not_allowed(s):deepFreeze({issuer:h.getSubjectString(),expire:l,allowHosts:c}):error_date_expired(l)}function verifyURL(n,t){var e=hostnameFromURL(n);return location.hostname.length!==0&&!isIPDomain(location.hostname)&&BUILDIN_ALLOW_HOST.filter(function(r){return matchDomain(r,location.hostname)}).length===0&&!isIPDomain(e)&&BUILDIN_ALLOW_HOST.concat(t).filter(function(r){return matchDomain(r,e)}).length===0?error_host_not_allowed(e):n}var PANO_TEXTURE_SCALE=new THREE__namespace.Vector3(1,1,1),FACE_ORDER$1=["right","left","up","down","front","back"];function relativeURL(n,t){if(!isAbsoluteURL(n))return n;if(n.indexOf(t)===0)return n.slice(t.length);var e=t.replace(/^https\:/,"http:");if(n.indexOf(e)===0)return n.slice(e.length);var r=t.replace(/^http\:/,"https:");return n.indexOf(r)===0?n.slice(r.length):(console.warn("".concat(n," is not start with base_url(").concat(t,").")),n)}function panoURL(n,t,e){return!isAbsoluteURL(n)&&typeof t=="string"&&t.length>0&&(n=pathJoin(t,String(e),n)),n}function getTileLevel(n){for(var t=10;t>=0;t--){var e=512*Math.pow(2,t);if(e<=n)return t}return null}function sortTile(n){n=n.slice().sort(function(u,l){return u.level-l.level});for(var t=[],e=0,r=n;e<r.length;e++){var o=r[e];if(t.length===0){t.push(o);continue}var s=t[t.length-1];if(o.level>s.level){t.push(o);continue}if(o.size>s.size){t[t.length-1]=o;continue}}return t}function parse(n,t){for(var e,r,o,s,u,l,c,f,p,d,h,g,A,m,E=[],v=null,y=0,b=[].concat(n);y<b.length;y++){var _=b[y];if("getURL"in _)v={allowHosts:_.allowHosts,expire:_.expire,issuer:_.issuer},E.push(workToJson(_));else{var T=typeof _=="string"?JSON.parse(_):jsonClone(_),S=verify(T);if(S instanceof Error)return S;v===null&&(v=S),E.push(T)}}if(v===null)return new Error("Empty");defineProperty(t,"issuer",{configurable:!1,writable:!1,value:v.issuer}),defineProperty(t,"expire",{configurable:!1,writable:!1,value:Object.freeze(v.expire)}),defineProperty(t,"allowHosts",{configurable:!1,writable:!1,value:Object.freeze(v.allowHosts)});var R=E.reduce(function(U,z){return jsonMerge(U,z)});defineProperty(t,"name",{configurable:!1,writable:!1,value:String((e=R.name)!==null&&e!==void 0?e:"Unknown")}),defineProperty(t,"workCode",{writable:!0,value:String(R.resource_code||R.basic_code||R.vr_code||R.code||R.project_id||R.work_code||R.workCode||createUuid())}),defineProperty(t,"baseURL",{writable:!0,value:(function(){var U,z=(U=R.base_url)!==null&&U!==void 0?U:"";return z&&z[z.length-1]!=="/"&&(z+="/"),z})()});var w=void 0;R.model&&(w={},defineProperty(w,"work",{enumerable:!1,configurable:!1,writable:!1,value:t}),typeof R.model=="object"&&(defineProperty(w,"work",{enumerable:!1,configurable:!1,writable:!1,value:t}),defineProperty(w,"file",{configurable:!1,writable:!1,value:(function(){var U=R.model.file_url;if(U)return relativeURL(U,t.baseURL)})()}),defineProperty(w,"textureBase",{configurable:!1,writable:!1,value:(function(){var U=R.model.material_base_url;return U&&(U=relativeURL(U,t.baseURL)),U})()}),defineProperty(w,"textures",{configurable:!1,writable:!1,value:(function(){var U=void 0;return Array.isArray(R.model.material_textures)&&(U=R.model.material_textures.slice(),Object.freeze(U)),U})()}),defineProperty(w,"layers",{configurable:!1,writable:!1,value:(function(){var U,z,q,j=[];if(Array.isArray(R.model.layers))for(var K=0,Y=R.model.layers;K<Y.length;K++){var X=Y[K];if(X&&X.tileset_url){var Q={};defineProperty(Q,"work",{enumerable:!1,configurable:!1,writable:!1,value:t}),defineProperty(Q,"name",{configurable:!1,writable:!1,value:(U=X.name)!==null&&U!==void 0?U:""}),defineProperty(Q,"type",{configurable:!1,writable:!1,value:(z=X.type)!==null&&z!==void 0?z:"mesh"}),defineProperty(Q,"upAxis",{configurable:!1,writable:!1,value:(q=X.up_axis)!==null&&q!==void 0?q:"Z"}),defineProperty(Q,"tileset",{configurable:!1,writable:!1,value:relativeURL(X.tileset_url,t.baseURL)}),j.push(Q)}}if(typeof R.model.tiles=="object"){var X=R.model.tiles;if(X&&X.tileset_url){var Q={};defineProperty(Q,"work",{enumerable:!1,configurable:!1,writable:!1,value:t}),defineProperty(Q,"name",{configurable:!1,writable:!1,value:"lod"}),defineProperty(Q,"type",{configurable:!1,writable:!1,value:"mesh"}),defineProperty(Q,"upAxis",{configurable:!1,writable:!1,value:"-Y"}),defineProperty(Q,"tileset",{configurable:!1,writable:!1,value:relativeURL(X.tileset_url,t.baseURL)}),j.push(Q)}}return Object.freeze(j)})()}))),defineProperty(t,"model",{configurable:!1,writable:!1,value:w});var M=[];if(Array.isArray(R.observers)&&R.panorama&&Array.isArray(R.panorama.list||R.panorama.info))for(var B=R.observers,C=(r=R.panorama.list||R.panorama.info)!==null&&r!==void 0?r:[],P=(f=(l=(s=(o=R.panorama)===null||o===void 0?void 0:o.pano_high_cube_base_url)!==null&&s!==void 0?s:(u=R.panorama)===null||u===void 0?void 0:u.pano_cube_base_url)!==null&&l!==void 0?l:(c=R.panorama)===null||c===void 0?void 0:c.base_url)!==null&&f!==void 0?f:"",F=Math.min(B.length,C.length),L=function(U){var z=B[U],q=C[U],j={};defineProperty(j,"work",{enumerable:!1,configurable:!1,writable:!1,value:t}),defineProperty(j,"index",{configurable:!1,writable:!1,value:U}),defineProperty(j,"panoIndex",{configurable:!1,writable:!1,value:U}),defineProperty(j,"floorIndex",{configurable:!1,writable:!1,value:(p=z.floor_index)!==null&&p!==void 0?p:z.floor}),defineProperty(j,"derivedId",{configurable:!1,writable:!1,value:z.derived_id}),defineProperty(j,"derivedIdStr",{configurable:!1,writable:!1,value:z.derived_id_str}),defineProperty(j,"active",{configurable:!1,writable:!1,value:z.active!==!1&&q.active!==!1}),defineProperty(j,"loadable",{configurable:!1,writable:!1,value:(h=(d=z.active)!==null&&d!==void 0?d:q.active)!==null&&h!==void 0?h:!1}),defineProperty(j,"position",{configurable:!1,writable:!1,value:Object.freeze(new THREE__namespace.Vector3().fromArray((g=z.position)!==null&&g!==void 0?g:[0,0,0]))}),defineProperty(j,"standingPosition",{configurable:!1,writable:!1,value:Object.freeze(new THREE__namespace.Vector3().fromArray((m=(A=z.standing_position)!==null&&A!==void 0?A:z.standingPosition)!==null&&m!==void 0?m:[0,0,0]))}),defineProperty(j,"quaternion",{configurable:!1,writable:!1,value:Object.freeze(new THREE__namespace.Quaternion().fromArray(z.quaternion?[z.quaternion.x,z.quaternion.y,z.quaternion.z,z.quaternion.w]:[0,0,0,1]))}),defineProperty(j,"matrix",{configurable:!1,writable:!1,value:Object.freeze(new THREE__namespace.Matrix4().compose(j.position,j.quaternion,PANO_TEXTURE_SCALE))}),defineProperty(j,"accessibleNodes",{configurable:!1,writable:!1,value:(function(){var K,Y,X=((Y=(K=z.accessible_nodes)!==null&&K!==void 0?K:z.accessibleNodes)!==null&&Y!==void 0?Y:[]).filter(function(W){return W<F});if(X.length===0)for(var Q=0;Q<F;Q++)Q!==U&&X.push(Q);return Object.freeze(X)})()}),defineProperty(j,"visibleNodes",{configurable:!1,writable:!1,value:(function(){var K,Y,X=((Y=(K=z.visible_nodes)!==null&&K!==void 0?K:z.visibleNodes)!==null&&Y!==void 0?Y:[]).filter(function(W){return W<F});if(X.length===0)for(var Q=0;Q<F;Q++)Q!==U&&X.push(Q);return Object.freeze(X)})()}),defineProperty(j,"images",{configurable:!1,writable:!1,value:(function(){var K={};defineProperty(K,"work",{enumerable:!1,configurable:!1,writable:!1,value:t});for(var Y=0,X=FACE_ORDER$1;Y<X.length;Y++){var Q=X[Y];defineProperty(K,Q,{configurable:!1,writable:!1,value:relativeURL(panoURL(q[Q],P,U),t.baseURL)})}return defineProperty(K,"sizeList",{configurable:!1,writable:!1,value:(function(){var W=getImageSizeFromURL(K[FACE_ORDER$1[0]]);if(W){if(q.size_list){var $=q.size_list.slice().sort(function(oe,de){return oe-de});return Object.freeze($)}else if(q.tiles){for(var $=[W],ie=q.tiles.slice().sort(function(de,me){return de-me}),ee=0,ne=ie;ee<ne.length;ee++){var te=ne[ee],pe=512*Math.pow(2,te);pe>W&&$.push(pe)}return Object.freeze($)}}return Object.freeze([])})()}),defineProperty(K,"tiles",{configurable:!1,writable:!1,value:(function(){var W=getImageSizeFromURL(K.front);if(W){var $=K.sizeList.slice();if($[0]){var ie=getTileLevel($[0]);if(ie)for(var ee=ie-1;ee>=0;ee--)$.unshift(512*Math.pow(2,ee))}if(!($.length<=0)){for(var ne=[],te=0,pe=$;te<pe.length;te++){var oe=pe[te],de=getTileLevel(oe);if(typeof de=="number"){var me={};if(defineProperty(me,"work",{enumerable:!1,configurable:!1,writable:!1,value:t}),defineProperty(me,"level",{configurable:!1,writable:!1,value:de}),oe>W){defineProperty(me,"size",{configurable:!1,writable:!1,value:oe}),defineProperty(me,"scale",{configurable:!1,writable:!1,value:1});for(var be=0,_e=FACE_ORDER$1;be<_e.length;be++){var le=_e[be];defineProperty(me,le,{configurable:!1,writable:!1,value:replaceImageSize(K[le],oe)})}}else{defineProperty(me,"size",{configurable:!1,writable:!1,value:W}),defineProperty(me,"scale",{configurable:!1,writable:!1,value:oe/W});for(var fe=0,re=FACE_ORDER$1;fe<re.length;fe++){var le=re[fe];defineProperty(me,le,{configurable:!1,writable:!1,value:K[le]})}}ne.push(me)}}return ne=sortTile(ne),Object.freeze(ne)}}})()}),K})()}),defineProperty(j,"video",{configurable:!1,writable:!1,value:(function(){var K=void 0;return q.video&&(K={},defineProperty(K,"work",{enumerable:!1,configurable:!1,writable:!1,value:t}),defineProperty(K,"source",{configurable:!1,writable:!1,value:q.video.source}),defineProperty(K,"matrix",{configurable:!1,writable:!1,value:new THREE__namespace.Matrix4().fromArray(q.video.matrix)}),defineProperty(K,"size",{configurable:!1,writable:!1,value:new THREE__namespace.Vector2().fromArray(q.video.size)})),K})()}),M.push(j)},O=0;O<F;O++)L(O);defineProperty(t,"observers",{configurable:!1,writable:!1,value:Object.freeze(M)});var k={};if(defineProperty(k,"work",{enumerable:!1,configurable:!1,writable:!1,value:t}),R.initial){if(t.observers.length>0){var D=void 0;isNumber(R.initial.panoIndex)?D=R.initial.panoIndex:isNumber(R.initial.pano_index)?D=R.initial.pano_index:isNumber(R.initial.pano)&&(D=R.initial.pano),typeof D=="number"&&(D=clamp$1(D,0,t.observers.length-1),defineProperty(k,"panoIndex",{writable:!0,value:D}))}if(R.initial.mode==="Panorama"&&t.observers.length===0||R.initial.mode==="Floorplan"||R.initial.mode==="Topview"||R.initial.mode==="Model"||R.initial.mode==="Mapview"?defineProperty(k,"mode",{writable:!0,value:R.initial.mode}):typeof k.panoIndex=="number"?defineProperty(k,"mode",{writable:!0,value:"Panorama"}):defineProperty(k,"mode",{writable:!0,value:"Mapview"}),isNumber(R.initial.latitude)&&defineProperty(k,"latitude",{writable:!0,value:R.initial.latitude}),isNumber(R.initial.longitude)?defineProperty(k,"longitude",{writable:!0,value:R.initial.longitude}):isNumber(R.initial.heading)&&defineProperty(k,"longitude",{writable:!0,value:headingToLongitude(R.initial.heading)}),isNumber(R.initial.fov)&&defineProperty(k,"fov",{writable:!0,value:R.initial.fov}),isNumber(R.initial.distance)&&defineProperty(k,"distance",{writable:!0,value:R.initial.distance}),Array.isArray(R.initial.offset)){var J=R.initial.offset,G=[0,0,0].map(function(U,z){var q=Number(J[z]);return isNaN(q)||!isFinite(q)?0:q});defineProperty(k,"offset",{writable:!0,value:new THREE__namespace.Vector3().fromArray(G)})}else typeof R.initial.offset=="object"&&typeof R.initial.offset.x=="number"&&typeof R.initial.offset.y=="number"&&typeof R.initial.offset.z=="number"&&defineProperty(k,"offset",{writable:!0,value:new THREE__namespace.Vector3().fromArray([R.initial.offset.x,R.initial.offset.y,R.initial.offset.z])})}return defineProperty(t,"initial",{configurable:!1,writable:!1,value:k}),t}function parseNull(n,t){return defineProperty(t,"issuer",{configurable:!1,writable:!1,value:"null"}),defineProperty(t,"expire",{configurable:!1,writable:!1,value:Object.freeze(new Date)}),defineProperty(t,"allowHosts",{configurable:!1,writable:!1,value:Object.freeze(["*"])}),defineProperty(t,"name",{configurable:!1,writable:!1,value:"Null"}),defineProperty(t,"workCode",{value:createUuid()}),defineProperty(t,"baseURL",{value:"/"}),defineProperty(t,"model",{configurable:!1,writable:!1,value:void 0}),defineProperty(t,"observers",{configurable:!1,writable:!1,value:Object.freeze([])}),defineProperty(t,"initial",{configurable:!1,writable:!1,value:(function(){var e={};return defineProperty(e,"work",{enumerable:!1,configurable:!1,writable:!1,value:t}),defineProperty(e,"mode",{writable:!0,value:"Mapview"}),e})()}),t}function parsePano(n,t){var e,r;return defineProperty(t,"issuer",{configurable:!1,writable:!1,value:"null"}),defineProperty(t,"expire",{configurable:!1,writable:!1,value:Object.freeze(new Date)}),defineProperty(t,"allowHosts",{configurable:!1,writable:!1,value:Object.freeze(["*"])}),defineProperty(t,"name",{configurable:!1,writable:!1,value:String((e=n.name)!==null&&e!==void 0?e:"Unknown")}),defineProperty(t,"workCode",{writable:!0,value:(r=n.code)!==null&&r!==void 0?r:createUuid()}),defineProperty(t,"baseURL",{writable:!0,value:"/"}),defineProperty(t,"model",{configurable:!1,writable:!1,value:void 0}),defineProperty(t,"observers",{configurable:!1,writable:!1,value:(function(){var o={};return defineProperty(o,"work",{enumerable:!1,configurable:!1,writable:!1,value:t}),defineProperty(o,"index",{configurable:!1,writable:!1,value:0}),defineProperty(o,"panoIndex",{configurable:!1,writable:!1,value:0}),defineProperty(o,"floorIndex",{configurable:!1,writable:!1,value:0}),defineProperty(o,"derivedId",{configurable:!1,writable:!1,value:void 0}),defineProperty(o,"derivedIdStr",{configurable:!1,writable:!1,value:void 0}),defineProperty(o,"active",{configurable:!1,writable:!1,value:!0}),defineProperty(o,"loadable",{configurable:!1,writable:!1,value:!1}),defineProperty(o,"position",{configurable:!1,writable:!1,value:new THREE__namespace.Vector3(0,1.5,0)}),defineProperty(o,"standingPosition",{configurable:!1,writable:!1,value:new THREE__namespace.Vector3(0,0,0)}),defineProperty(o,"quaternion",{configurable:!1,writable:!1,value:new THREE__namespace.Quaternion(0,1,0,0)}),defineProperty(o,"matrix",{configurable:!1,writable:!1,value:new THREE__namespace.Matrix4().compose(o.position,o.quaternion,PANO_TEXTURE_SCALE)}),defineProperty(o,"accessibleNodes",{configurable:!1,writable:!1,value:Object.freeze([])}),defineProperty(o,"visibleNodes",{configurable:!1,writable:!1,value:Object.freeze([])}),defineProperty(o,"images",{configurable:!1,writable:!1,value:(function(){var s={};defineProperty(s,"work",{enumerable:!1,configurable:!1,writable:!1,value:t});for(var u=0,l=FACE_ORDER$1;u<l.length;u++){var c=l[u];defineProperty(s,c,{configurable:!1,writable:!1,value:n[c]})}return defineProperty(s,"sizeList",{configurable:!1,writable:!1,value:Object.freeze([n.size])}),defineProperty(s,"tiles",{configurable:!1,writable:!1,value:(function(){var f=getImageSizeFromURL(s.front);if(f){var p=s.sizeList.slice();if(p[0]){var d=getTileLevel(p[0]);if(d)for(var h=d-1;h>=0;h--)p.unshift(512*Math.pow(2,h))}if(!(p.length<=0)){for(var g=[],A=0,m=p;A<m.length;A++){var E=m[A],v=getTileLevel(E);if(typeof v=="number"){var y={};if(defineProperty(y,"work",{enumerable:!1,configurable:!1,writable:!1,value:t}),defineProperty(y,"level",{configurable:!1,writable:!1,value:v}),E>f){defineProperty(y,"size",{configurable:!1,writable:!1,value:E}),defineProperty(y,"scale",{configurable:!1,writable:!1,value:1});for(var b=0,_=FACE_ORDER$1;b<_.length;b++){var T=_[b];defineProperty(y,T,{configurable:!1,writable:!1,value:replaceImageSize(s[T],E)})}}else{defineProperty(y,"size",{configurable:!1,writable:!1,value:f}),defineProperty(y,"scale",{configurable:!1,writable:!1,value:E/f});for(var S=0,R=FACE_ORDER$1;S<R.length;S++){var T=R[S];defineProperty(y,T,{configurable:!1,writable:!1,value:s[T]})}}g.push(y)}}return g=sortTile(g),Object.freeze(g)}}})()}),s})()}),defineProperty(o,"video",{configurable:!1,writable:!1,value:void 0}),Object.freeze([o])})()}),defineProperty(t,"initial",{configurable:!1,writable:!1,value:(function(){var o={};return defineProperty(o,"work",{enumerable:!1,configurable:!1,writable:!1,value:t}),defineProperty(o,"mode",{writable:!0,value:"Panorama"}),defineProperty(o,"panoIndex",{writable:!0,value:0}),o})()}),t}var workVerifySet=new WeakSet,hrefAElement=typeof document!="undefined"?document.createElement("a"):{href:""},Work=(function(){function n(t,e){this.observerBox=new THREE__namespace.Box3,this.observerBox=new THREE__namespace.Box3,this.transform=new THREE__namespace.Matrix4,this.shortPath=!1,this.jsonp=!1;var r;if(t!==null?typeof t=="object"&&typeof t.size=="number"&&typeof t.up=="string"&&typeof t.down=="string"&&typeof t.right=="string"&&typeof t.left=="string"&&typeof t.front=="string"&&typeof t.back=="string"?r=parsePano(t,this):r=parse(t,this):r=parseNull(t,this),r instanceof Error)throw new Error("[PARSE FAILED]: "+r.message+`
1026
+ `,uniforms:{diffuse:{value:new THREE__namespace.Color},opacity:{value:1},displacementScalar:{value:0}}};function createPipeBufferGeometry(n,t,e,r){for(var o=new Float32Array((e+1)*(r+1)*3),s=new Float32Array((e+1)*(r+1)*3),u=new Float32Array((e+1)*(r+1)*2),l=new Uint32Array(e*r*6),c=n.computeFrenetFrames(e),f=new THREE__namespace.Vector3,p=new THREE__namespace.Vector3,d=new THREE__namespace.Vector2,h=new THREE__namespace.Vector3,g=0;g<=e;g++){h=n.getPointAt(g/e,h);for(var A=c.normals[g],m=c.binormals[g],E=0;E<=r;E++){var v=g*(r+1)+E,y=E/r*Math.PI*2,b=Math.sin(y),_=-Math.cos(y);p.x=_*A.x+b*m.x,p.y=_*A.y+b*m.y,p.z=_*A.z+b*m.z,p.normalize(),p.toArray(s,v*3),f.x=h.x+t*p.x,f.y=h.y+t*p.y,f.z=h.z+t*p.z,f.toArray(o,v*3),d.x=g/e,d.y=E/r,d.toArray(u,v*2)}}for(var g=0;g<e;g++)for(var E=0;E<r;E++){var T=(g*r+E)*6,S=(r+1)*g+E,R=(r+1)*(g+1)+E,w=(r+1)*(g+1)+(E+1),M=(r+1)*g+(E+1);l[T]=S,l[T+1]=R,l[T+2]=M,l[T+3]=R,l[T+4]=w,l[T+5]=M}var B=new THREE__namespace.BufferGeometry;return B.setIndex(new THREE__namespace.BufferAttribute(l,1)),B.setAttribute("position",new THREE__namespace.BufferAttribute(o,3)),B.setAttribute("normal",new THREE__namespace.BufferAttribute(s,3)),B.setAttribute("uv",new THREE__namespace.BufferAttribute(u,2)),B}function parseTrajectoryObject(n,t){for(var e=new THREE__namespace.Color(0).convertSRGBToLinear(),r=new THREE__namespace.Color(52949).convertSRGBToLinear(),o=new THREE__namespace.Color(3370495).convertSRGBToLinear(),s=new THREE__namespace.Color(16777215).convertSRGBToLinear(),u=0,l=new THREE__namespace.CurvePath,c=n.length,f=3;f<c;f+=3){var p=new THREE__namespace.Vector3().fromArray(n,f-3),d=new THREE__namespace.Vector3().fromArray(n,f);u+=p.distanceTo(d);var h=new THREE__namespace.LineCurve3(p,d);l.add(h)}var g=.03,A=Math.ceil(u*100),m=6,E=createPipeBufferGeometry(l,g,A,m);E.clearGroups(),E.addGroup(0,E.index?E.index.count:E.attributes.position.count,0),E.addGroup(0,E.index?E.index.count:E.attributes.position.count,1),E.addGroup(0,E.index?E.index.count:E.attributes.position.count,2);var v=new THREE__namespace.ShaderMaterial({vertexShader:TRAJECTOR_PIPE_SHADER.vertexShader,fragmentShader:TRAJECTOR_PIPE_SHADER.fragmentShader,uniforms:THREE__namespace.UniformsUtils.clone(TRAJECTOR_PIPE_SHADER.uniforms),side:THREE__namespace.BackSide});v.uniforms.totalLength.value=u,v.uniforms.diffuse.value=e,v.uniforms.diffuse2.value=e,v.uniforms.opacity.value=.5,v.transparent=!0;var y=new THREE__namespace.ShaderMaterial({vertexShader:TRAJECTOR_PIPE_SHADER.vertexShader,fragmentShader:TRAJECTOR_PIPE_SHADER.fragmentShader,uniforms:THREE__namespace.UniformsUtils.clone(TRAJECTOR_PIPE_SHADER.uniforms),side:THREE__namespace.BackSide});y.uniforms.totalLength.value=u,y.uniforms.displacementScalar.value=-.01,y.uniforms.diffuse.value=r,y.uniforms.diffuse2.value=o;var b=new THREE__namespace.ShaderMaterial({vertexShader:TRAJECTOR_PIPE_SHADER.vertexShader,fragmentShader:TRAJECTOR_PIPE_SHADER.fragmentShader,uniforms:THREE__namespace.UniformsUtils.clone(TRAJECTOR_PIPE_SHADER.uniforms),side:THREE__namespace.DoubleSide});b.uniforms.totalLength.value=u,b.uniforms.displacementScalar.value=-.026,b.uniforms.dashSize.value=new THREE__namespace.Vector2(.06,.09),b.uniforms.diffuse.value=s,b.uniforms.diffuse2.value=s;var _=new THREE__namespace.Mesh(E,[v,y,b]),T=.08,S=24,R=new THREE__namespace.SphereBufferGeometry(T,S,S);R.clearGroups(),R.addGroup(0,E.index?E.index.count:E.attributes.position.count,0),R.addGroup(0,E.index?E.index.count:E.attributes.position.count,1);var w=new THREE__namespace.ShaderMaterial({vertexShader:TRAJECTOR_SPHERE_SHADER.vertexShader,fragmentShader:TRAJECTOR_SPHERE_SHADER.fragmentShader,uniforms:THREE__namespace.UniformsUtils.clone(TRAJECTOR_SPHERE_SHADER.uniforms),side:THREE__namespace.BackSide});w.uniforms.diffuse.value=e,w.uniforms.opacity.value=.5,w.transparent=!0;var M=new THREE__namespace.ShaderMaterial({vertexShader:TRAJECTOR_SPHERE_SHADER.vertexShader,fragmentShader:TRAJECTOR_SPHERE_SHADER.fragmentShader,uniforms:THREE__namespace.UniformsUtils.clone(TRAJECTOR_SPHERE_SHADER.uniforms),side:THREE__namespace.FrontSide});M.uniforms.displacementScalar.value=-.01,M.uniforms.diffuse.value=r;var B=new THREE__namespace.Mesh(R,[w,M]);B.position.fromArray(n,0),_.add(B);var C=new THREE__namespace.ShaderMaterial({vertexShader:TRAJECTOR_SPHERE_SHADER.vertexShader,fragmentShader:TRAJECTOR_SPHERE_SHADER.fragmentShader,uniforms:THREE__namespace.UniformsUtils.clone(TRAJECTOR_SPHERE_SHADER.uniforms),side:THREE__namespace.FrontSide});C.uniforms.displacementScalar.value=-.01,C.uniforms.diffuse.value=o;var P=new THREE__namespace.Mesh(R,[w,C]);return P.position.fromArray(n,n.length-3),_.add(P),{scene:_,dispose:function(){E.dispose(),v.dispose(),y.dispose(),b.dispose(),R.dispose(),w.dispose(),M.dispose(),C.dispose()}}}function loadTrajectory(n,t){var e=n.name,r=appendSearch(n.content.uri,t.search),o=imageURL(r,{key:"model.0"});return n.content.loadState="LOADING",n.content.loadStateUpdateTime=now(),loadPly(o,{type:"geometry",customPropertyMapping:{time:{itemType:"uint32",itemNames:["time_milisec"]}},fetcher:t.fetcher}).then(function(s){var u,l,c,f,p=(l=(u=s.scene.attributes)===null||u===void 0?void 0:u.time.array)!==null&&l!==void 0?l:[],d=(f=(c=s.scene.attributes)===null||c===void 0?void 0:c.position.array)!==null&&f!==void 0?f:[],h=s.byteLength,g=s.memoryUsage,A=parseTrajectoryObject(d);A.scene.applyMatrix4(n.transform),A.scene.updateWorldMatrix(!1,!0),A.scene.matrixAutoUpdate=!1;var m=new TrajectoryNode(e,A.scene);return n.content.data={uri:o,byteLength:h,memoryUsage:g,positionArray:d,timeArray:p,object:m},n.content.byteLength=h,n.content.memoryUsage=g,n.content.loadState="READY",n.content.loadStateUpdateTime=now(),n}).catch(function(s){return n.content.data=void 0,n.content.loadState="FAILED",n.content.loadStateUpdateTime=now(),s instanceof NetworkResponseError&&s.httpStatus===0||s instanceof NetworkTimeoutError||s instanceof NetworkProxyError?n.content.loadfailRetryDelay=clamp$1(n.content.loadfailRetryDelay+RETRY_DELAY_STEP,RETRY_DELAY_STEP,MAX_RETRY_DELAY):n.content.loadfailRetryDelay=1/0,Promise.reject(s)})}function unloadTrajectory(n){n.content&&(n.content.data&&n.content.data.object.dispose(),n.content.data=void 0,n.content.loadState="UNLOADED",n.content.loadStateUpdateTime=now(),n.content.byteLength=0,n.content.memoryUsage=0)}var scratchVector3$7=new THREE__namespace.Vector3,scratchMatrix3=new THREE__namespace.Matrix3,scratchMatrix4$3=new THREE__namespace.Matrix4,a=6378137,invF=298.257223563;function ecefToLla(n){for(var t=a-a/invF,e=(a*a-t*t)/(a*a),r=Math.sqrt(n.x*n.x+n.y*n.y),o=1e-12,s=1e3,u=0,l=Math.atan2(n.z,r),c=0;u++<s;){var f=Math.sin(l),p=a/Math.sqrt(1-e*f*f);c=r/Math.cos(l)-p;var d=Math.atan2(n.z/(p*(1-e)+c),r/(p+c));if(isNaN(d))break;var h=Math.abs(d-l);if(h<o)break;l=d}return n.set(l,Math.atan2(n.y,n.x),c)}function llaToEcef(n){var t=n.x,e=n.y,r=n.z,o=a-a/invF,s=(a*a-o*o)/(a*a),u=Math.sin(t),l=Math.cos(t),c=Math.sin(e),f=Math.cos(e),p=a/Math.sqrt(1-s*u*u),d=(p+r)*l*f,h=(p+r)*l*c,g=(o*o/(a*a)*p+r)*u;return n.set(d,h,g)}function getEcefToEnuMatrix(n,t){var e=ecefToLla(scratchVector3$7.copy(n)),r=e.x,o=e.y,s=e.z,u=Math.sin(r),l=Math.sin(o),c=Math.cos(r),f=Math.cos(o);t.fromArray([-l,-u*f,c*f,0,+f,-u*l,c*l,0,0,c,u,0,0,0,0,1]);var p=scratchMatrix3.setFromMatrix4(t),d=scratchVector3$7.copy(n).applyMatrix3(p).multiplyScalar(-1);t.setPosition(d);var h=scratchMatrix4$3.fromArray([1,0,0,0,0,1,0,0,0,0,1,0,0,0,s,1]);return t.premultiply(h),t}var ROTATE_X_90_MATRIX=new THREE__namespace.Matrix4().fromArray([1,0,0,0,0,0,-1,0,0,1,0,0,0,0,0,1]),ROTATE_X_90_MATRIX_INVERSE=new THREE__namespace.Matrix4().fromArray([1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1]),enuToLocalMatrix=new THREE__namespace.Matrix4().copy(ROTATE_X_90_MATRIX),localToEnuMatrix=new THREE__namespace.Matrix4().copy(ROTATE_X_90_MATRIX_INVERSE);function getRecommendTile3dProps(n,t){var e,r,o;t===void 0&&(t={});var s,u,l,c=typeof n.tileset.rootMeta.creationTime=="string";if(c){var f=typeof n.tileset.rootMeta.numTotalPoints=="number"&&n.tileset.rootMeta.numTotalPoints>0;if(f){l=4,t.powerPreference==="high"&&(l=2),s=l/1.6;var p=0;if(((e=n.tileset.rootMeta.taskParameters)===null||e===void 0?void 0:e.point_homogenization)==="1"&&(!((r=n.tileset.rootMeta.taskParameters)===null||r===void 0)&&r.homo_point_density)){var d=Number((o=n.tileset.rootMeta.taskParameters)===null||o===void 0?void 0:o.homo_point_density);isFinite(d)&&!isNaN(d)&&(p=d)}p<=0&&(p=.02),u=p*1.4}else l=5,t.powerPreference==="high"&&(l=4),s=0,u=.03}else l=6,s=0,u=.03,n.name==="aerophoto"?(l=12,t.powerPreference==="high"&&(l=10)):n.tileset.asset.extras&&typeof n.tileset.asset.extras.name=="string"&&/^matterport\b/i.test(n.tileset.asset.extras.name)&&(l=5,t.powerPreference==="high"&&(l=4));return{pointScale:u,pointMinPixel:s,maxScreenSpaceError:l}}var scratchVector3$6=new THREE__namespace.Vector3,scratchSphereBoundingVolume=new SphereBoundingVolume,scratchBoxBoundingVolume=new BoxBoundingVolume,parameterVersionMap=new WeakMap,tileVersionMap=new WeakMap,trajectoryVersionMap=new WeakMap,STENCIL_CONSTANT={TILE_MASK:128,SKIP_LOD_MASK:112,SKIP_LOD_BIT_SHIFT:4},SKIP_BACKFACE_MATERIAL=(function(){var n=new THREE__namespace.MeshBasicMaterial;return n.side=THREE__namespace.BackSide,n.color.setHex(16711935),n.colorWrite=!1,n.stencilWrite=!0,n.polygonOffset=!0,n.polygonOffsetFactor=2,n.polygonOffsetUnits=2,n.stencilRef=STENCIL_CONSTANT.TILE_MASK,n.stencilFunc=THREE__namespace.AlwaysStencilFunc,n.stencilFuncMask=STENCIL_CONSTANT.TILE_MASK,n.stencilZPass=THREE__namespace.ReplaceStencilOp,n.stencilWriteMask=STENCIL_CONSTANT.TILE_MASK,n})(),SKIP_BACKFACE_TRANSPARENT_MATERIAL=(function(){var n=new THREE__namespace.MeshBasicMaterial;return n.visible=!1,n})(),CLEAR_STENCIL_GEOMETRY=new THREE__namespace.BufferGeometry,CLEAR_STENCIL_MATERIAL=new THREE__namespace.MeshBasicMaterial;function cloneSkipBackfaceObject(n){var t;n instanceof THREE__namespace.Mesh?t=new THREE__namespace.Mesh(n.geometry,Array.isArray(n.material)?n.material.map(function(s){return s.transparent?SKIP_BACKFACE_TRANSPARENT_MATERIAL:SKIP_BACKFACE_MATERIAL}):n.material&&n.material.transparent?SKIP_BACKFACE_TRANSPARENT_MATERIAL:SKIP_BACKFACE_MATERIAL):n instanceof THREE__namespace.Group?t=new THREE__namespace.Group:t=new THREE__namespace.Object3D,t.position.copy(n.position),t.quaternion.copy(n.quaternion),t.scale.copy(n.scale),t.matrix.compose(n.position,n.quaternion,n.scale),t.matrixAutoUpdate=!1,t.frustumCulled=n.frustumCulled,t.visible=n.visible;for(var e=0,r=n.children;e<r.length;e++){var o=r[e];t.add(cloneSkipBackfaceObject(o))}return t}var Tile3D=(function(n){__extends(t,n);function t(e,r){var o,s,u=n.call(this)||this;return u.parameter=new Parameter,u.renderObjects=[],u.backfaceObjects=[],u.tileObjects=[],u.frameNumber=0,u.error=(o=r.error)!==null&&o!==void 0?o:null,u.name=r.name,u.type=r.type,u.upAxis=r.upAxis,u.light=r.light,u.fetcher=r.fetcher,u.search=(s=r.search)!==null&&s!==void 0?s:"",u.groundHeight=r.groundHeight,u.enuToEcefMatrix=new THREE__namespace.Matrix4().copy(r.enuToEcefMatrix),u.ecefToEnuMatrix=new THREE__namespace.Matrix4().copy(r.ecefToEnuMatrix),u.boundingBox=new THREE__namespace.Box3,u.autoRefine=!0,u.refined=!1,u.refineProgress=[0,0],u.loaded=!1,u.disposed=!1,u.clearStencilObject=new THREE__namespace.Mesh(CLEAR_STENCIL_GEOMETRY,CLEAR_STENCIL_MATERIAL),u.clearStencilObject.frustumCulled=!1,u.clearStencilObject.onAfterRender=function(l){return l.clearStencil()},u.tileset=new Tileset(e,{tileLoader:function(l){return u.loadContent(l)},tileUnloader:function(l){return u.unloadContent(l)},onTileLoad:function(){},onTileUnload:function(l){},onTileError:function(l,c){u.onError&&u.onError(Object.assign(c,{error:c})),console.error("Tile error",l.id,c)},trajectoryLoader:function(l){return u.loadTrajectory(l)},trajectoryUnloader:function(l){return u.unloadTrajectory(l)},onTrajectoryLoad:function(){},onTrajectoryUnload:function(l){},onTrajectoryError:function(l,c){u.onError&&u.onError(Object.assign(c,{error:c})),console.error("Trajectory error",l,c)}}),u.tileset.root.boundingVolume&&u.tileset.root.boundingVolume.getBoundingBox(u.boundingBox),u}return Object.defineProperty(t.prototype,"viewerRequestVolume",{get:function(){return this.tileset.root.viewerRequestVolume},set:function(e){this.tileset.root.viewerRequestVolume=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tiles",{get:function(){return this.tileset.selectedTiles},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"trajectories",{get:function(){return this.tileset.trajectories},enumerable:!1,configurable:!0}),t.prototype.getRecommendProps=function(e){return e===void 0&&(e={}),getRecommendTile3dProps(this,e)},t.prototype.loadContent=function(e){var r=this;return loadTileContent(e,{light:this.light,fetcher:this.fetcher,search:this.search,renderer:this.renderer}).then(function(o){e.type==="SCENEGRAPH"&&(r.disposed||!e.content?unloadTileContent(e):e.content.data&&r.boundingBox.expandByObject(e.content.data.object))})},t.prototype.unloadContent=function(e){return unloadTileContent(e),Promise.resolve()},t.prototype.loadAllTilesets=function(){var e=this,r=function(o){var s=[];return e.tileset.root.traverse(function(u){var l;u.type==="TILESET"&&((l=u.content)===null||l===void 0?void 0:l.loadState)!=="READY"&&s.push(u)}),Promise.all(s.map(function(u){return e.loadContent(u).then(function(){return r()})})).then(function(){})};return r(this.tileset.root)},t.prototype.loadTrajectory=function(e){var r=this;return loadTrajectory(e,{fetcher:this.fetcher,search:this.search,renderer:this.renderer}).then(function(o){r.disposed&&unloadTrajectory(o)})},t.prototype.unloadTrajectory=function(e){return unloadTrajectory(e),Promise.resolve()},t.prototype.intersectRaycaster=function(e,r){for(var o,s,u,l=r!=null?r:[],c=[this.tileset.root],f=this.tileset.transform,p,d=e.sortByDistance,h=(s=(o=e.params.Points)===null||o===void 0?void 0:o.threshold)!==null&&s!==void 0?s:0,g=1/0;p=c.pop();){var A=void 0;if(p.boundingVolume){var m=void 0;p.boundingVolume instanceof BoxBoundingVolume?m=scratchBoxBoundingVolume.copy(p.boundingVolume):p.boundingVolume instanceof SphereBoundingVolume?m=scratchSphereBoundingVolume.copy(p.boundingVolume):m=p.boundingVolume.clone(),m.applyMatrix4(f),A=m.intersectRay(e.ray,h,g)}else A=!0;if(A){for(var E=0,v=p.children.length;E<v;E++)c.push(p.children[E]);if(p.selected&&p.content&&p.content.data&&p.content.data.object.visible&&(p.content.data.object.intersectRaycaster(e,l),e.firstHitOnly)){var y=l[0];y&&g>y.distance&&(g=y.distance)}}}e.sortByDistance=d,sortIntersects(l,e.sortByDistance,e.firstHitOnly);for(var b=0,_=l;b<_.length;b++){var y=_[b];y.model=(u=this.parent)!==null&&u!==void 0?u:void 0,y.viewLayer=this}return l},t.prototype.update=function(e,r,o,s){var u,l,c=this,f,p,d,h,g;this.renderer=e,this.frameNumber++;var A=!1,m=this.parameter.resolveValue(o.parameter,s.parameter);parameterVersionMap.get(this)!==m.version&&(parameterVersionMap.set(this,m.version),A=!0);var E=m.maxLevelOfDetail;E=Math.max(E,0);var v=Math.min(m.minLevelOfDetail,E);(!this.visible||!this.loaded||!o.loaded)&&(E=Math.max(v,0));var y=m.minGeometricError,b=r.controllerMode;(b==="Panorama"||b==="VRPanorama"||b==="XRPanorama")&&m.modelAlpha<.1&&(y=m.panoramaMinGeometricError);var _=m.maxGeometricError;_=Math.max(y,_);var T={time:r.time,camera:{type:r.type,position:new THREE__namespace.Vector3().copy(r.position),direction:r.getDirection(new THREE__namespace.Vector3),up:new THREE__namespace.Vector3().copy(r.up).applyQuaternion(r.quaternion),projectionMatrix:r.projectionMatrix.clone(),visible:r.visible,refine:r.refineModel},height:r.resolution.height,pixelRatio:r.pixelRatio,frameNumber:this.frameNumber,sseDenominator:2*Math.tan(.5*r.fov/180*Math.PI),cullingVolume:new CullingVolume().setFromCamera(r),minLevelOfDetail:v,maxLevelOfDetail:E,minGeometricError:y,maxGeometricError:_,skipLevelOfDetail:m.skipLevelOfDetail,mostDetail:m.mostDetail,loadSiblings:m.loadSiblings,cameraCulling:m.cameraCulling,maxMemoryUsage:m.maxMemoryUsage,maxRequests:m.maxRequests,requestOrder:m.requestOrder,maxScreenSpaceError:m.maxScreenSpaceError,memoryAdjustedOverflow:m.memoryAdjustedOverflow,memoryAdjustedScreenSpaceError:m.memoryAdjustedScreenSpaceError},S=m.cacheCameras.map(function(re){return re.updateProjectionMatrix(),__assign(__assign({},T),{camera:{type:r.type,position:new THREE__namespace.Vector3().copy(re.position),direction:re.getWorldDirection(new THREE__namespace.Vector3),up:new THREE__namespace.Vector3().copy(re.up),projectionMatrix:re.projectionMatrix.clone(),visible:re.visible,refine:!0},cullingVolume:new CullingVolume().setFromCamera(re)})});this.updateWorldMatrix(!0,!1),this.tileset.transform.equals(this.matrixWorld)||(this.tileset.transform.copy(this.matrixWorld),A=!0);var R=!this.autoRefine;if(R===!1){var w=m.progress>.01&&m.progress<.99;if(w){var M=new THREE__namespace.Vector3;m.pano0&&M.setFromMatrixPosition(m.pano0.matrix);var B=M.clone();m.pano1&&B.setFromMatrixPosition(m.pano1.matrix),M.distanceTo(B)<10&&(R=!0)}}if(R||this.tileset.update(T,S),this.refined=!0,this.refineProgress[0]=0,this.refineProgress[1]=0,this.tileset.needsRefinedTiles.forEach(function(re){if(c.refineProgress[1]++,re.content){var ue=re.content.loadState;if(ue==="UNLOADED"||ue==="LOADING"){c.refined=!1;return}}c.refineProgress[0]++}),this.loaded===!1&&this.autoRefine){this.loaded=!0;var C=!1;this.tileset.needsRefinedTiles.forEach(function(re){if(c.loaded!==!1&&re.content){if(re.state.visible&&(C=!0),T.skipLevelOfDetail){if(re.state.finalResolution){var ue=re.state.ancestorWithContentAvailable,ve=ue&&ue.content?ue.content:re.content,ye=ve.loadState;(ye==="UNLOADED"||ye==="LOADING")&&(c.loaded=!1)}}else if(re.state.visible&&re.levelOfContent<=0){var ye=re.content.loadState;(ye==="UNLOADED"||ye==="LOADING")&&(c.loaded=!1)}}}),C&&this.tileset.selectedTiles.length===0&&this.tileset.frameNumber<500&&(this.loaded=!1),this.loaded===!0&&(this.refined=!1,this.refineProgress[1]++)}this.renderObjects.length=0,this.backfaceObjects.length=0,this.tileObjects.length=0,this.remove.apply(this,this.children),T.skipLevelOfDetail||this.tileset.selectedTiles.sort(function(re,ue){return re.floor!==ue.floor?re.floor-ue.floor:re.levelOfContent!==ue.levelOfContent?ue.levelOfContent-re.levelOfContent:re.state.distanceToCamera!==ue.state.distanceToCamera?re.state.distanceToCamera-ue.state.distanceToCamera:re.state.centerZDepth-ue.state.centerZDepth});for(var P=[],F=0,L=this.tileset.selectedTiles;F<L.length;F++){var O=L[F],k=(p=(f=O.content)===null||f===void 0?void 0:f.data)===null||p===void 0?void 0:p.object;if(k){var D=k.update(e,r,o,this,O,m);if(P.push(O.id),D&&(A=!0),this.tileset.hasMixedContent&&T.skipLevelOfDetail){if(!O.state.finalResolution){var J=cloneSkipBackfaceObject(k);J.name="skipBackface:"+k.name,this.backfaceObjects.push(J)}for(var G=O.state.selectionDepth,U=STENCIL_CONSTANT.TILE_MASK|G<<STENCIL_CONSTANT.SKIP_LOD_BIT_SHIFT,z=THREE__namespace.GreaterEqualStencilFunc,q=STENCIL_CONSTANT.SKIP_LOD_MASK,j=THREE__namespace.ReplaceStencilOp,K=STENCIL_CONSTANT.TILE_MASK|STENCIL_CONSTANT.SKIP_LOD_MASK,Y=0,X=k.materials;Y<X.length;Y++){var Q=X[Y];Q.stencilWrite=!0,Q.stencilRef=U,Q.stencilFunc=z,Q.stencilFuncMask=q,Q.stencilZPass=j,Q.stencilWriteMask=K}}else for(var W=0,$=k.materials;W<$.length;W++){var Q=$[W];Q.stencilWrite=!1,Q.stencilRef=STENCIL_CONSTANT.TILE_MASK,Q.stencilFunc=THREE__namespace.AlwaysStencilFunc,Q.stencilFuncMask=STENCIL_CONSTANT.TILE_MASK,Q.stencilZPass=THREE__namespace.ReplaceStencilOp,Q.stencilWriteMask=STENCIL_CONSTANT.TILE_MASK}this.tileObjects.push(k)}}var ie=P.toString();tileVersionMap.get(this)!==ie&&(tileVersionMap.set(this,ie),A=!0),T.skipLevelOfDetail&&this.backfaceObjects.length&&(u=this.renderObjects).push.apply(u,this.backfaceObjects),this.tileObjects.length&&(l=this.renderObjects).push.apply(l,this.tileObjects),T.skipLevelOfDetail&&this.renderObjects.push(this.clearStencilObject);for(var ee=[],ne=0,te=this.tileset.selectedTrajectories;ne<te.length;ne++){var pe=te[ne],oe=(d=pe.content.data)===null||d===void 0?void 0:d.object;if(oe){var D=oe.update(e,r,o,this,pe,m);ee.push(pe.id),D&&(A=!0),this.renderObjects.push(oe)}}var de=ee.toString();trajectoryVersionMap.get(this)!==de&&(trajectoryVersionMap.set(this,de),A=!0);for(var me=Math.min(0,((g=(h=this.parent)===null||h===void 0?void 0:h.children)!==null&&g!==void 0?g:[]).indexOf(this)),be=me*1e4,_e=function(re){var ue=le.renderObjects[re],ve=re+be;ue.traverse(function(ye){(ye instanceof THREE__namespace.Mesh||ye instanceof THREE__namespace.Line||ye instanceof THREE__namespace.Points)&&(ye.renderOrder=ve)}),le.add(ue)},le=this,fe=0;fe<this.renderObjects.length;fe++)_e(fe);return A},t.prototype.dispose=function(){this.disposed=!0,this.tileset.reset(),/^blob\:/.test(this.tileset.id)&&URL.revokeObjectURL(this.tileset.id),this.remove.apply(this,this.children),this.refined=!1,this.loaded=!1,this.refineProgress[0]=this.refineProgress[1]=0},Object.defineProperty(t.prototype,"model",{get:function(){return this.parent},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"scene",{get:function(){return this},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"viewLayer",{get:function(){return this},enumerable:!1,configurable:!0}),t.prototype.localToEnu=function(e){return e.applyMatrix4(localToEnuMatrix)},t.prototype.enuToLocal=function(e){return e.applyMatrix4(enuToLocalMatrix)},t.prototype.enuToEcef=function(e){return e.applyMatrix4(this.enuToEcefMatrix)},t.prototype.ecefToEnu=function(e){return e.applyMatrix4(this.ecefToEnuMatrix)},t.prototype.localToEcef=function(e){return this.enuToEcef(this.localToEnu(e))},t.prototype.ecefToLocal=function(e){return this.enuToLocal(this.ecefToEnu(e))},t.prototype.localToLla=function(e){return ecefToLla(this.enuToEcef(this.localToEnu(e)))},t.prototype.llaToLocal=function(e){return this.enuToLocal(this.ecefToEnu(llaToEcef(e)))},t.prototype.worldToEnu=function(e){return this.localToEnu(this.worldToLocal(e))},t.prototype.enuToWorld=function(e){return this.localToWorld(this.enuToLocal(e))},t.prototype.worldToEcef=function(e){return this.localToEcef(this.worldToLocal(e))},t.prototype.ecefToWorld=function(e){return this.localToWorld(this.ecefToLocal(e))},t.prototype.worldToLla=function(e){return this.localToLla(this.worldToLocal(e))},t.prototype.llaToWorld=function(e){return this.localToWorld(this.llaToLocal(e))},Object.defineProperty(t.prototype,"coordinates",{get:function(){scratchVector3$6.setScalar(0);var e=this.localToLla(scratchVector3$6),r=e.x,o=e.y;return[r,o].map(function(s){return(s/Math.PI*180).toFixed(6)}).join(",")},enumerable:!1,configurable:!0}),t.prototype.getTransformMatrix4=function(e){return e===void 0&&(e=new THREE__namespace.Matrix4),e.copy(this.ecefToEnuMatrix),e.premultiply(enuToLocalMatrix),e.premultiply(this.matrixWorld),e},t.prototype.coordinatesToWorldPoint=function(e){var r=new THREE__namespace.Vector3(e.latitude,e.longitude,e.altitude);return this.llaToWorld(r)},t.prototype.worldPointToCoordinates=function(e){return scratchVector3$6.copy(e),this.worldToLla(scratchVector3$6),{latitude:scratchVector3$6.x,longitude:scratchVector3$6.y,altitude:scratchVector3$6.z}},t.prototype.resetBrightness=function(){this.parameter.reset("brightness")},Object.defineProperty(t.prototype,"minLevelOfDetail",{get:function(){var e,r=[];return this.parent&&this.parent.parameter instanceof Parameter&&(r.unshift(this.parent.parameter),this.parent.parent&&this.parent.parent.parameter instanceof Parameter&&r.unshift(this.parent.parent.parameter)),(e=this.parameter).resolveValue.apply(e,r).minLevelOfDetail},set:function(e){this.parameter.set("minLevelOfDetail",e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxLevelOfDetail",{get:function(){var e,r=[];return this.parent&&this.parent.parameter instanceof Parameter&&(r.unshift(this.parent.parameter),this.parent.parent&&this.parent.parent.parameter instanceof Parameter&&r.unshift(this.parent.parent.parameter)),(e=this.parameter).resolveValue.apply(e,r).maxLevelOfDetail},set:function(e){this.parameter.set("maxLevelOfDetail",e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"minGeometricError",{get:function(){var e,r=[];return this.parent&&this.parent.parameter instanceof Parameter&&(r.unshift(this.parent.parameter),this.parent.parent&&this.parent.parent.parameter instanceof Parameter&&r.unshift(this.parent.parent.parameter)),(e=this.parameter).resolveValue.apply(e,r).minGeometricError},set:function(e){this.parameter.set("minGeometricError",e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxGeometricError",{get:function(){var e,r=[];return this.parent&&this.parent.parameter instanceof Parameter&&(r.unshift(this.parent.parameter),this.parent.parent&&this.parent.parent.parameter instanceof Parameter&&r.unshift(this.parent.parent.parameter)),(e=this.parameter).resolveValue.apply(e,r).maxGeometricError},set:function(e){this.parameter.set("maxGeometricError",e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"panoramaMinGeometricError",{get:function(){var e,r=[];return this.parent&&this.parent.parameter instanceof Parameter&&(r.unshift(this.parent.parameter),this.parent.parent&&this.parent.parent.parameter instanceof Parameter&&r.unshift(this.parent.parent.parameter)),(e=this.parameter).resolveValue.apply(e,r).panoramaMinGeometricError},set:function(e){this.parameter.set("panoramaMinGeometricError",e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"skipLevelOfDetail",{get:function(){var e,r=[];return this.parent&&this.parent.parameter instanceof Parameter&&(r.unshift(this.parent.parameter),this.parent.parent&&this.parent.parent.parameter instanceof Parameter&&r.unshift(this.parent.parent.parameter)),(e=this.parameter).resolveValue.apply(e,r).skipLevelOfDetail},set:function(e){this.parameter.set("skipLevelOfDetail",e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mostDetail",{get:function(){var e,r=[];return this.parent&&this.parent.parameter instanceof Parameter&&(r.unshift(this.parent.parameter),this.parent.parent&&this.parent.parent.parameter instanceof Parameter&&r.unshift(this.parent.parent.parameter)),(e=this.parameter).resolveValue.apply(e,r).mostDetail},set:function(e){this.parameter.set("mostDetail",e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"loadSiblings",{get:function(){var e,r=[];return this.parent&&this.parent.parameter instanceof Parameter&&(r.unshift(this.parent.parameter),this.parent.parent&&this.parent.parent.parameter instanceof Parameter&&r.unshift(this.parent.parent.parameter)),(e=this.parameter).resolveValue.apply(e,r).loadSiblings},set:function(e){this.parameter.set("loadSiblings",e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxMemoryUsage",{get:function(){var e,r=[];return this.parent&&this.parent.parameter instanceof Parameter&&(r.unshift(this.parent.parameter),this.parent.parent&&this.parent.parent.parameter instanceof Parameter&&r.unshift(this.parent.parent.parameter)),(e=this.parameter).resolveValue.apply(e,r).maxMemoryUsage},set:function(e){this.parameter.set("maxMemoryUsage",e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxRequests",{get:function(){var e,r=[];return this.parent&&this.parent.parameter instanceof Parameter&&(r.unshift(this.parent.parameter),this.parent.parent&&this.parent.parent.parameter instanceof Parameter&&r.unshift(this.parent.parent.parameter)),(e=this.parameter).resolveValue.apply(e,r).maxRequests},set:function(e){this.parameter.set("maxRequests",e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"requestOrder",{get:function(){var e,r=[];return this.parent&&this.parent.parameter instanceof Parameter&&(r.unshift(this.parent.parameter),this.parent.parent&&this.parent.parent.parameter instanceof Parameter&&r.unshift(this.parent.parent.parameter)),(e=this.parameter).resolveValue.apply(e,r).requestOrder},set:function(e){this.parameter.set("requestOrder",e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxScreenSpaceError",{get:function(){var e,r=[];return this.parent&&this.parent.parameter instanceof Parameter&&(r.unshift(this.parent.parameter),this.parent.parent&&this.parent.parent.parameter instanceof Parameter&&r.unshift(this.parent.parent.parameter)),(e=this.parameter).resolveValue.apply(e,r).maxScreenSpaceError},set:function(e){this.parameter.set("maxScreenSpaceError",e)},enumerable:!1,configurable:!0}),t})(THREE__namespace.Object3D),fetcherMap=new Map;function getFetcher(n){var t=fetcherMap.get(n);if(t)return t;throw new Error("fetcher never registered.")}function registerFetcher(n,t){return fetcherMap.set(n,t)}var scratchVector3$5=new THREE__namespace.Vector3,scratchMatrix4$2=new THREE__namespace.Matrix4;function getEcefToEnuMatrixFromUpAxis(n,t,e){switch(n){case"Z":e.identity();break;case"Y":e.fromArray([1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1]);break;case"-Y":e.fromArray([1,0,0,0,0,0,-1,0,0,1,0,0,0,0,0,1]);break;case"WGS84":case"GCJ02":case"BD09":getEcefToEnuMatrix(t,e);break;default:e.identity();break}return e}function getExt(n){var t=/([0-9a-z\.\_\-]+)([\?\#].*)?$/i.exec(n);if(t){var e=String(t[1]).trim().split(".").slice(1).reverse()[0];if(e)return e}return""}function loadViewLayer(n,t){var e,r=n.tileset,o=n.name,s=n.type,u=n.work.getURL(r),l=u.split("#"),c=l[0],f=l[1],p=(e=(f||c).split("?")[1])!==null&&e!==void 0?e:"";return t.fetcher.ajax(u,{responseType:"text"}).catch(function(d){return{error:d,body:JSON.stringify({asset:{version:"0.0"},geometricError:0,root:{geometricError:0}})}}).then(function(d){var h,g="error"in d?d.error:null,A=normalizeTilesetHeader(JSON.parse(d.body),u),m=A.root,E=A.rootMeta,v=E===void 0?{}:E,y=n.upAxis;v.upAxis&&v.upAxis!==y&&(y=v.upAxis),"lodVersion"in A&&(y="-Y","floorInfo"in A&&(A.properties=A.properties||{},A.properties.floorInfo=A.floorInfo.map(function(w){return{ground:-w.ground,height:w.height}}),delete A.floorInfo),A.asset.tilesetVersion=String(A.lodVersion),delete A.lodVersion);var b=m.boundingVolume?makeBoundingVolume(m.boundingVolume):void 0;b&&m.transform&&b.applyMatrix4(scratchMatrix4$2.fromArray(m.transform));var _=null,T=new THREE__namespace.Matrix4,S=new THREE__namespace.Matrix4;v.coordinate?(_=v.coordinate.ground_height,T.fromArray(v.coordinate.pose_ecef_to_enu),S.fromArray(v.coordinate.pose_enu_to_ecef)):(b?b.getCenter(scratchVector3$5):scratchVector3$5.setScalar(0),getEcefToEnuMatrixFromUpAxis(y,scratchVector3$5,T),S.getInverse(T)),A.root={refine:(h=m.refine)!==null&&h!==void 0?h:"REPLACE",geometricError:m.geometricError,transform:scratchMatrix4$2.copy(T).premultiply(enuToLocalMatrix).toArray(),boundingVolume:b?b.toJson():void 0,children:[m]};var R=new Tile3D(A,{name:o,type:s,upAxis:y,light:t.light,fetcher:t.fetcher,search:p,groundHeight:_,enuToEcefMatrix:S,ecefToEnuMatrix:T,error:g});return R})}function loadViewLayers(n,t){var e,r,o=n.layers.slice();if(n.file){for(var s=!1,u=0,l=o;u<l.length;u++){var c=l[u];if(c.type==="mesh"){s=!0;break}}if(s===!1){var f=getExt(n.file)||"at3d",p=JSON.stringify({asset:{version:"0.0"},geometricError:0,root:{refine:"REPLACE",geometricError:0,transform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],content:{uri:n.work.getURL(n.file)},extras:(e={},e[f]={textureBaseUri:typeof n.textureBase=="string"?n.work.getURL(n.textureBase):void 0,textureArray:n.textures,textureOptions:(r=t.textureOptions)!==null&&r!==void 0?r:{}},e)}});o.push({work:n.work,name:"fallback",type:"mesh",upAxis:"Z",tileset:URL.createObjectURL(new Blob([p],{type:"application/json"}))})}}return o.map(function(d){return loadViewLayer(d,{fetcher:t.fetcher,light:t.light}).then(function(h){return t.onError&&(h.error&&t.onError(h.error),h.onError=t.onError),h})})}var BufferGeometryUtils={computeTangents:function(n){var t=n.index,e=n.attributes;if(t===null||e.position===void 0||e.normal===void 0||e.uv===void 0){console.warn("THREE.BufferGeometry: Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()");return}var r=t.array,o=e.position.array,s=e.normal.array,u=e.uv.array,l=o.length/3;e.tangent===void 0&&n.setAttribute("tangent",new THREE__namespace.BufferAttribute(new Float32Array(4*l),4));for(var c=e.tangent.array,f=[],p=[],d=0;d<l;d++)f[d]=new THREE__namespace.Vector3,p[d]=new THREE__namespace.Vector3;var h=new THREE__namespace.Vector3,g=new THREE__namespace.Vector3,A=new THREE__namespace.Vector3,m=new THREE__namespace.Vector2,E=new THREE__namespace.Vector2,v=new THREE__namespace.Vector2,y=new THREE__namespace.Vector3,b=new THREE__namespace.Vector3;function _(U,z,q){h.fromArray(o,U*3),g.fromArray(o,z*3),A.fromArray(o,q*3),m.fromArray(u,U*2),E.fromArray(u,z*2),v.fromArray(u,q*2);var j=g.x-h.x,K=A.x-h.x,Y=g.y-h.y,X=A.y-h.y,Q=g.z-h.z,W=A.z-h.z,$=E.x-m.x,ie=v.x-m.x,ee=E.y-m.y,ne=v.y-m.y,te=1/($*ne-ie*ee);y.set((ne*j-ee*K)*te,(ne*Y-ee*X)*te,(ne*Q-ee*W)*te),b.set(($*K-ie*j)*te,($*X-ie*Y)*te,($*W-ie*Q)*te),f[U].add(y),f[z].add(y),f[q].add(y),p[U].add(b),p[z].add(b),p[q].add(b)}var T=n.groups;T.length===0&&(T=[{start:0,count:r.length}]);for(var d=0,S=T.length;d<S;++d)for(var R=T[d],w=R.start,M=R.count,B=w,C=w+M;B<C;B+=3)_(r[B+0],r[B+1],r[B+2]);var P=new THREE__namespace.Vector3,F=new THREE__namespace.Vector3,L=new THREE__namespace.Vector3,O=new THREE__namespace.Vector3,k,D,J;function G(U){L.fromArray(s,U*3),O.copy(L),D=f[U],P.copy(D),P.sub(L.multiplyScalar(L.dot(D))).normalize(),F.crossVectors(O,D),J=F.dot(p[U]),k=J<0?-1:1,c[U*4]=P.x,c[U*4+1]=P.y,c[U*4+2]=P.z,c[U*4+3]=k}for(var d=0,S=T.length;d<S;++d)for(var R=T[d],w=R.start,M=R.count,B=w,C=w+M;B<C;B+=3)G(r[B+0]),G(r[B+1]),G(r[B+2])},mergeBufferGeometries:function(n,t){for(var e=n[0].index!==null,r=new Set(Object.keys(n[0].attributes)),o=new Set(Object.keys(n[0].morphAttributes)),s={},u={},l=new THREE__namespace.BufferGeometry,c=0,f=0;f<n.length;++f){var p=n[f];if(e!==(p.index!==null))return null;for(var d in p.attributes){if(!r.has(d))return null;s[d]===void 0&&(s[d]=[]),s[d].push(p.attributes[d])}for(var d in p.morphAttributes){if(!o.has(d))return null;u[d]===void 0&&(u[d]=[]),u[d].push(p.morphAttributes[d])}if(l.userData.mergedUserData=l.userData.mergedUserData||[],l.userData.mergedUserData.push(p.userData),t){var h;if(e)h=p.index.count;else if(p.attributes.position!==void 0)h=p.attributes.position.count;else return null;l.addGroup(c,h,f),c+=h}}if(e){for(var g=0,A=[],f=0;f<n.length;++f){for(var m=n[f].index,E=0;E<m.count;++E)A.push(m.getX(E)+g);g+=n[f].attributes.position.count}l.setIndex(A)}for(var d in s){var v=this.mergeBufferAttributes(s[d]);if(!v)return null;l.setAttribute(d,v)}for(var d in u){var y=u[d][0].length;if(y===0)break;l.morphAttributes=l.morphAttributes||{},l.morphAttributes[d]=[];for(var f=0;f<y;++f){for(var b=[],E=0;E<u[d].length;++E)b.push(u[d][E][f]);var _=this.mergeBufferAttributes(b);if(!_)return null;l.morphAttributes[d].push(_)}}return l},mergeBufferAttributes:function(n){for(var t,e,r,o=0,s=0;s<n.length;++s){var u=n[s];if(u.isInterleavedBufferAttribute||(t===void 0&&(t=u.array.constructor),t!==u.array.constructor)||(e===void 0&&(e=u.itemSize),e!==u.itemSize)||(r===void 0&&(r=u.normalized),r!==u.normalized))return null;o+=u.array.length}for(var l=new t(o),c=0,s=0;s<n.length;++s)l.set(n[s].array,c),c+=n[s].array.length;return new THREE__namespace.BufferAttribute(l,e,r)},interleaveAttributes:function(n){for(var t,e=0,r=0,o=0,s=n.length;o<s;++o){var u=n[o];if(t===void 0&&(t=u.array.constructor),t!==u.array.constructor)return console.warn("AttributeBuffers of different types cannot be interleaved"),null;e+=u.array.length,r+=u.itemSize}for(var l=new THREE__namespace.InterleavedBuffer(new t(e),r),c=0,f=[],p=["getX","getY","getZ","getW"],d=["setX","setY","setZ","setW"],h=0,s=n.length;h<s;h++){var u=n[h],g=u.itemSize,A=u.count,m=new THREE__namespace.InterleavedBufferAttribute(l,g,c,u.normalized);f.push(m),c+=g;for(var E=0;E<A;E++)for(var v=0;v<g;v++)m[d[v]](E,u[p[v]](E))}return f},estimateBytesUsed:function(n){var t=0;for(var e in n.attributes){var r=n.getAttribute(e);t+=r.count*r.itemSize*r.array.BYTES_PER_ELEMENT}var o=n.getIndex();return t+=o?o.count*o.itemSize*o.array.BYTES_PER_ELEMENT:0,t},mergeVertices:function(n,t){t===void 0&&(t=1e-4),t=Math.max(t,Number.EPSILON);for(var e={},r=n.getIndex(),o=n.getAttribute("position"),s=r?r.count:o.count,u=0,l=Object.keys(n.attributes),c={},f={},p=[],d=["getX","getY","getZ","getW"],h=0,g=l.length;h<g;h++){var A=l[h];c[A]=[];var m=n.morphAttributes[A];m&&(f[A]=new Array(m.length).fill().map(function(){return[]}))}for(var E=Math.log10(1/t),v=Math.pow(10,E),h=0;h<s;h++){for(var y=r?r.getX(h):h,b="",_=0,g=l.length;_<g;_++)for(var A=l[_],T=n.getAttribute(A),S=T.itemSize,R=0;R<S;R++)b+="".concat(~~(T[d[R]](y)*v),",");if(b in e)p.push(e[b]);else{for(var _=0,g=l.length;_<g;_++)for(var A=l[_],T=n.getAttribute(A),m=n.morphAttributes[A],S=T.itemSize,w=c[A],M=f[A],R=0;R<S;R++){var B=d[R];if(w.push(T[B](y)),m)for(var C=0,P=m.length;C<P;C++)M[C].push(m[C][B](y))}e[b]=u,p.push(u),u++}}for(var F=n.clone(),h=0,g=l.length;h<g;h++){var A=l[h],L=n.getAttribute(A),O=new L.array.constructor(c[A]),T=new THREE__namespace.BufferAttribute(O,L.itemSize,L.normalized);if(F.setAttribute(A,T),A in f)for(var _=0;_<f[A].length;_++){var k=n.morphAttributes[A][_],O=new k.array.constructor(f[A][_]),D=new THREE__namespace.BufferAttribute(O,k.itemSize,k.normalized);F.morphAttributes[A][_]=D}}return F.setIndex(p),F}},scratchSphere$1=new THREE__namespace.Sphere,scratchMatrix4$1=new THREE__namespace.Matrix4,scratchMatrix4Inverse=new THREE__namespace.Matrix4;function getEdgesBySphere(n,t,e){e===void 0&&(e=30/180*Math.PI);for(var r=Math.cos(e),o=[],s=0,u=n.children;s<u.length;s++){var l=u[s];l instanceof Tile3D&&l.tileset.selectedTiles.forEach(function(c){var f,p,d,h=(p=(f=c.content)===null||f===void 0?void 0:f.data)===null||p===void 0?void 0:p.object;if(h&&h.visible){var g=[];if(h.traverseVisible(function(z){if(z instanceof THREE__namespace.Mesh){var q=getBvhTreeForMesh(z);if(q){scratchMatrix4$1.copy(z.matrixWorld),scratchMatrix4Inverse.getInverse(scratchMatrix4$1),scratchSphere$1.copy(t).applyMatrix4(scratchMatrix4Inverse);var j=q.trianglesInSphere(scratchSphere$1.center,scratchSphere$1.radius),K=new THREE__namespace.BufferGeometry;K.setAttribute("position",new THREE__namespace.BufferAttribute(j,3)),K.applyMatrix4(z.matrixWorld),K=BufferGeometryUtils.mergeVertices(K,.01),g.push(K)}}}),g.length===0)return;for(var A=["a","b","c"],m=BufferGeometryUtils.mergeBufferGeometries(g,!1),E=m.getAttribute("position").array,v=((d=m.getIndex())===null||d===void 0?void 0:d.array)||[],y=[],b=[],_=0,T=E.length;_<T;_+=3){var S=new THREE__namespace.Vector3(E[_],E[_+1],E[_+2]);y.push(S)}for(var _=0,T=v.length;_<T;_+=3){var R=v[_],w=v[_+1],M=v[_+2],B=new THREE__namespace.Vector3().crossVectors(y[w].clone().sub(y[R]),y[M].clone().sub(y[R])).normalize();b.push({a:R,b:w,c:M,normal:B})}for(var C={},_=0,T=b.length;_<T;_++)for(var P=b[_],F=0;F<3;F++){var L=P[A[F]],O=P[A[(F+1)%3]],k=[Math.min(L,O),Math.max(L,O)],D=k[0]+"-"+k[1];C[D]===void 0?C[D]={index1:k[0],index2:k[1],face1:_}:C[D].face2=_}for(var D in C){var J=C[D];if(J.face2===void 0||b[J.face1].normal.dot(b[J.face2].normal)<=r){var G=y[J.index1],U=y[J.index2];o.push(new THREE__namespace.Line3(G,U))}}y.length=0,b.length=0}})}return o}var scratchBoundingBox$1=new THREE__namespace.Box3,scratchViewLayerBox=new THREE__namespace.Box3,scratchObserverBox$3=new THREE__namespace.Box3,Model=(function(n){__extends(t,n);function t(e,r){r===void 0&&(r={});var o,s=n.call(this)||this;s.disposed=!1,s.parameter=new Parameter,s.outdated=!1,s.autoRefine=!0,s.metaPending=!1,s.loaded=!1,s.refined=!1,s.refineProgress=[0,0],s.boundingBox=new THREE__namespace.Box3,s.needsRender=!1,s.work=e,s.name=s.work.workCode;for(var u=0,l=0,c=e.observers;l<c.length;l++){var f=c[l];u=Math.max(u,f.floorIndex)}if(s.floorLength=u+1,e.model){s.metaPending=!0;var p=loadViewLayers(e.model,{fetcher:getFetcher(e),light:(o=r.light)!==null&&o!==void 0?o:!1,textureOptions:r.textureOptions,onError:function(d){return s.dispatchEvent({type:"error",error:d})}});s.initReady=Promise.all(p).then(function(d){if(s.metaPending=!1,d.length)if(s.disposed)for(var h=0,g=d;h<g.length;h++){var A=g[h];A.dispose()}else s.add.apply(s,d)}),s.loadedReady=new Promise(function(d){s.addEventListener("load",function(){return d()})})}else s.refined=!0,s.loaded=!0,s.initReady=Promise.resolve(),s.loadedReady=Promise.resolve();return s.parameter.set("boundingBox",s.boundingBox.clone()),s}return t.prototype.dispose=function(){this.disposed=!0;for(var e;e=this.children[0];)typeof e.dispose=="function"&&e.dispose(),this.remove(e)},Object.defineProperty(t.prototype,"empty",{get:function(){return this.children.length===0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"viewLayers",{get:function(){return this.children},enumerable:!1,configurable:!0}),t.prototype.getEdgesBySphere=function(e,r){return r===void 0&&(r=30/180*Math.PI),getEdgesBySphere(this,e,r)},t.prototype.intersectRaycaster=function(e,r){var o=r!=null?r:[],s=e.sortByDistance;e.sortByDistance=!1;for(var u=0,l=this.children.length;u<l;u++){var c=this.children[u];c.visible&&typeof c.intersectRaycaster=="function"&&c.intersectRaycaster(e,o)}return e.sortByDistance=s,sortIntersects(o,e.sortByDistance,e.firstHitOnly),o},t.prototype.update=function(e,r,o){var s=!1;this.needsRender===!0&&(this.needsRender=!1,s=!0);var u=this.loaded;this.refined=!this.metaPending,this.loaded=!this.metaPending,this.refineProgress[0]=this.refineProgress[1]=0,this.work.transform.equals(this.matrix)||(this.matrix.copy(this.work.transform),this.matrix.decompose(this.position,this.quaternion,this.scale),this.matrixAutoUpdate=!1,s=!0);for(var l=0,c=this.children;l<c.length;l++){var f=c[l];f.autoRefine=this.autoRefine;var p=f.update(e,r,o,this);p&&(s=!0),f.refined===!1&&(this.refined=!1),f.loaded===!1&&(this.loaded=!1),this.refineProgress[0]+=f.refineProgress[0],this.refineProgress[1]+=f.refineProgress[1]}scratchBoundingBox$1.makeEmpty(),scratchObserverBox$3.copy(this.work.observerBox),scratchObserverBox$3.isEmpty()||(scratchObserverBox$3.max.x+=1,scratchObserverBox$3.max.z+=1,scratchObserverBox$3.max.y+=1,scratchObserverBox$3.min.x-=1,scratchObserverBox$3.min.z-=1,scratchBoundingBox$1.union(scratchObserverBox$3));for(var d=0,h=this.viewLayers;d<h.length;d++){var f=h[d];f.boundingBox.isEmpty()||(scratchViewLayerBox.copy(f.boundingBox),scratchBoundingBox$1.union(scratchViewLayerBox))}return scratchBoundingBox$1.applyMatrix4(this.matrix),scratchBoundingBox$1.equals(this.boundingBox)||(this.boundingBox.copy(scratchBoundingBox$1),this.parameter.set("boundingBox",scratchBoundingBox$1.clone())),u===!1&&this.loaded===!0&&this.dispatchEvent({type:"load"}),s},t.prototype.localToEnu=function(e){return e.applyMatrix4(localToEnuMatrix)},t.prototype.enuToLocal=function(e){return e.applyMatrix4(enuToLocalMatrix)},t.prototype.worldToEnu=function(e){return this.localToEnu(this.worldToLocal(e))},t.prototype.enuToWorld=function(e){return this.localToWorld(this.enuToLocal(e))},Object.defineProperty(t.prototype,"shownFloor",{get:function(){return this.shownFloorIndex===-1?null:this.shownFloorIndex},set:function(e){this.shownFloorIndex=e===null?-1:e},enumerable:!1,configurable:!0}),t.prototype.show=function(e){this.shownFloor=e!=null?e:null,this.dispatchEvent({type:"changeShownFloor",shownFloor:e})},Object.defineProperty(t.prototype,"bounding",{get:function(){return this.boundingBox},enumerable:!1,configurable:!0}),t.prototype.setMaterial=function(e){this.parameter.set(e)},t.prototype.getMaterial=function(){var e,r=[];return this.parent&&this.parent.parameter instanceof Parameter&&r.unshift(this.parent.parameter),(e=this.parameter).resolveValue.apply(e,r)},Object.defineProperty(t.prototype,"shownFloorIndex",{get:function(){var e,r=[];return this.parent&&this.parent.parameter instanceof Parameter&&r.unshift(this.parent.parameter),(e=this.parameter).resolveValue.apply(e,r).shownFloorIndex},set:function(e){this.parameter.set("shownFloorIndex",e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"brightness",{get:function(){var e,r=[];return this.parent&&this.parent.parameter instanceof Parameter&&r.unshift(this.parent.parameter),(e=this.parameter).resolveValue.apply(e,r).brightness},set:function(e){this.parameter.set("brightness",e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"clippers",{get:function(){var e,r=[];return this.parent&&this.parent.parameter instanceof Parameter&&r.unshift(this.parent.parameter),(e=this.parameter).resolveValue.apply(e,r).clippers},set:function(e){this.parameter.set("clippers",e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"customShaders",{get:function(){var e,r=[];return this.parent&&this.parent.parameter instanceof Parameter&&r.unshift(this.parent.parameter),(e=this.parameter).resolveValue.apply(e,r).customShaders},set:function(e){this.parameter.set("customShaders",e)},enumerable:!1,configurable:!0}),t.prototype.resetBrightness=function(){this.parameter.reset("brightness");for(var e=0,r=this.viewLayers;e<r.length;e++){var o=r[e];o.resetBrightness()}},t})(THREE__namespace.Object3D),scratchBoundingBox3=new THREE__namespace.Box3,scratchModelBoundingBox3=new THREE__namespace.Box3,ModelScene=(function(n){__extends(t,n);function t(){var e=n.call(this)||this;e.needsRender=!0,e.autoRefine=!0,e.boundingBox=new THREE__namespace.Box3,e.loaded=!1,e.refined=!1,e.refineProgress=[0,0],e.parameter=new Parameter;var r=e.models=[];e.parameter.set("boundingBox",e.boundingBox.clone());var o=e;return defineProperty(r,"autoUpdate",{get:function(){return o.autoRefine},set:function(s){o.autoRefine=s}}),defineProperty(r,"bounding",{get:function(){return o.boundingBox}}),defineProperty(r,"loaded",{get:function(){return o.loaded}}),defineProperty(r,"refined",{get:function(){return o.refined}}),defineProperty(r,"refineProgress",{get:function(){return o.refineProgress}}),defineProperty(r,"cacheCameras",{get:function(){return o.parameter.resolveValue().cacheCameras},set:function(s){o.parameter.set("cacheCameras",s)}}),defineProperty(r,"intersectRaycaster",{value:function(s){return o.intersectRaycaster(s)}}),defineProperty(r,"setMaterial",{value:function(s){return o.setMaterial(s)}}),defineProperty(r,"getMaterial",{value:function(){return o.getMaterial()}}),defineProperty(r,"resetBrightness",{value:function(){return o.resetBrightness()}}),e}return t.prototype.add=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];n.prototype.add.apply(this,e),this.models.length=0;for(var o=0,s=this.children;o<s.length;o++){var u=s[o];u instanceof Model&&u.outdated!==!0&&this.models.push(u)}return this.needsRender=!0,this},t.prototype.remove=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];n.prototype.remove.apply(this,e),this.models.length=0;for(var o=0,s=this.children;o<s.length;o++){var u=s[o];u instanceof Model&&u.outdated!==!0&&this.models.push(u)}scratchBoundingBox3.makeEmpty();for(var l=0,c=this.children;l<c.length;l++){var u=c[l];u instanceof Model&&(scratchModelBoundingBox3.copy(u.boundingBox).applyMatrix4(u.matrix),scratchBoundingBox3.union(scratchModelBoundingBox3))}return this.boundingBox.copy(scratchBoundingBox3),this.needsRender=!0,this},t.prototype.intersectRaycaster=function(e,r){var o=r!=null?r:[],s=this.children.filter(function(p){return p instanceof Model});if(s.length===1)s[0].intersectRaycaster(e,o);else{var u=e.sortByDistance;e.sortByDistance=!1;for(var l=0,c=s;l<c.length;l++){var f=c[l];f.visible&&f.intersectRaycaster(e,o)}e.sortByDistance=u,sortIntersects(o,e.sortByDistance,e.firstHitOnly)}return o},t.prototype.update=function(e,r){var o=!1;scratchBoundingBox3.makeEmpty(),this.loaded=this.models.length>0,this.refined=this.models.length>0,this.refineProgress[0]=this.refineProgress[1]=0,this.models.length=0;for(var s=0,u=this.children;s<u.length;s++){var l=u[s];if(l instanceof Model)if(l.outdated){l.autoRefine=!1;var c=l.update(e,r,this);c&&(o=!0)}else{this.models.push(l),l.autoRefine=this.autoRefine;var c=l.update(e,r,this);c&&(o=!0),l.loaded===!1&&(this.loaded=!1),l.refined===!1&&(this.refined=!1),this.refineProgress[0]+=l.refineProgress[0],this.refineProgress[1]+=l.refineProgress[1],scratchModelBoundingBox3.copy(l.boundingBox),scratchBoundingBox3.union(scratchModelBoundingBox3)}else if(l.update){var c=l.update(e,r,this);c&&(o=!0)}}return scratchBoundingBox3.equals(this.boundingBox)||(this.boundingBox.copy(scratchBoundingBox3),this.parameter.set("boundingBox",scratchBoundingBox3.clone())),this.needsRender=o,o},Object.defineProperty(t.prototype,"bounding",{get:function(){return this.boundingBox},enumerable:!1,configurable:!0}),t.prototype.setMaterial=function(e){this.parameter.set(e)},t.prototype.getMaterial=function(){return this.parameter.resolveValue()},t.prototype.resetBrightness=function(){this.parameter.reset("brightness");for(var e=0,r=this.models;e<r.length;e++){var o=r[e];o.resetBrightness()}},t})(THREE__namespace.Scene);function workInitialToJson(n){var t,e={};return e.mode=n.mode,e.pano_index=n.panoIndex,e.longitude=n.longitude,e.latitude=n.latitude,e.fov=n.fov,e.distance=n.distance,e.offset=(t=n.offset)===null||t===void 0?void 0:t.toArray(),e}function workModelToJson(n){var t;if(n)return{file_url:n.file,material_base_url:n.textureBase,material_textures:(t=n.textures)===null||t===void 0?void 0:t.slice(),layers:n.layers.map(function(e){return{tileset_url:e.tileset,up_axis:e.upAxis,name:e.name,type:e.type}})}}function workObserverToObserverJson(n){return{index:n.index,floor_index:n.floorIndex,position:n.position.toArray(),standing_position:n.standingPosition.toArray(),quaternion:{x:n.quaternion.x,y:n.quaternion.y,z:n.quaternion.z,w:n.quaternion.w},visible_nodes:n.visibleNodes.slice(),accessible_nodes:n.accessibleNodes.slice()}}function workObserverToPanoramaJson(n){return{index:n.index,active:n.active,loadable:n.loadable,derived_id:n.derivedId,derived_id_str:n.derivedIdStr,size_list:n.images.sizeList.slice(),up:n.images.up,down:n.images.down,right:n.images.right,left:n.images.left,front:n.images.front,back:n.images.back,video:n.video?{matrix:n.video.matrix.toArray(),size:n.video.size.toArray(),source:n.video.source}:void 0}}function workToJson(n){return{_signature:"",allow_hosts:n.allowHosts.slice(),expire_at:n.expire.getTime().toString(),code:n.workCode,name:n.name,base_url:n.baseURL,initial:workInitialToJson(n.initial),model:workModelToJson(n.model),observers:n.observers.map(function(t){return workObserverToObserverJson(t)}),panorama:{count:n.observers.length,list:n.observers.map(function(t){return workObserverToPanoramaJson(t)})}}}function isNumber(n){return typeof n=="number"}function jsonClone(n){if(typeof n!="object"||n===null)return n;if(Array.isArray(n))return n.map(function(o){return typeof o!="object"||o===null?o:jsonClone(o)});var t={};for(var e in n){var r=n[e];t[e]=typeof r!="object"||r===null?r:jsonClone(r)}return t}function getType(n){return n==null?"null":Array.isArray(n)?"array":typeof n=="object"?"dict":"value"}function jsonMerge(n,t){var e=getType(n),r=getType(t);if(r==="null")return n;if(r==="value")return t;if(r!==e)return jsonClone(t);if(r==="array")for(var o=0;o<t.length;o++)n[o]=jsonMerge(n[o],t[o]);else if(r==="dict")for(var s in t)n[s]=jsonMerge(n[s],t[s]);return n}function jsonStableStrinfiy_(n,t){t===void 0&&(t=!1);var e=typeof n;if(e==="string")return JSON.stringify(n);if(n===!0)return"true";if(n===!1)return"false";if(n===null)return"null";if(n instanceof Array){for(var r="[",o=n.length-1,s=0;s<o;s++)r+=jsonStableStrinfiy_(n[s],!1)+",";return o>-1&&(r+=jsonStableStrinfiy_(n[s],!1)),r+"]"}if(n instanceof Object){if(typeof n.toJSON=="function")return jsonStableStrinfiy_(n.toJSON(),t);for(var u=Object.keys(n).sort(),l=u.length,r="",s=0;s<l;){var c=u[s],f=jsonStableStrinfiy_(n[c],!0);f!==void 0&&(s&&r!==""&&(r+=","),r+=JSON.stringify(c)+":"+f),s++}return"{"+r+"}"}switch(e){case"function":return JSON.stringify(n.toString());case"undefined":return t?void 0:null;case"number":return n;default:return isFinite(n)?n:null}}function jsonStableStrinfiy(n){return jsonStableStrinfiy_(n,!1)}function jsonHash(n){return"hash::".concat(sha256(jsonStableStrinfiy(n)))}function deepFreeze(n){Object.freeze(n);var t=typeof n=="function",e=Object.prototype.hasOwnProperty;return Object.getOwnPropertyNames(n).forEach(function(r){e.call(n,r)&&(!t||r!=="caller"&&r!=="callee"&&r!=="arguments")&&n[r]!==null&&(typeof n[r]=="object"||typeof n[r]=="function")&&!Object.isFrozen(n[r])&&deepFreeze(n[r])}),n}var URL_REGEXP=/^[0-9a-z]+\:\/\/(([^:/?#]*)(?::[0-9]+)?)/i,BUILDIN_ALLOW_HOST=deepFreeze(JSON.parse((function n(){var t=113,e=126,r=0,o="";return arguments[r].split(o).map(function(s){return s.charCodeAt(r)>e?s:String.fromCharCode((s.charCodeAt(r)+t)%e)}).join(o)})("h/y|pnyu|/9/xr;p|z/9/yvn{wvn;p|z/9/rnyrr;p|z/9/rnyrr;p{/9/rnyrr;w}/9/uv;p|z/9/uv;p{/9/rnyrr;p{/9/rnyrr;p|z/9/ywpq{;p|z/9/rnyrr:pq{;p|z/9/rnyrr:pq{;p{/9/rnyrr;nv/9/;p{/9/pq{;p{/9/pnyp{|qr;vr/j"))),domainRegex=/^([^.]+)(\.([^.]+))*$/,currentHostname=typeof location!="undefined"?location.hostname:"localhost";function isIPDomain(n){return/^(([1-9]?\d|1\d\d|2[0-4]\d|25[0-5])(\.(?!$)|$)){4}$/.test(n)}function matchDomain(n,t){if(!domainRegex.test(n)||!domainRegex.test(t))return!1;if(n==="*")return!0;var e=n.split(".").reverse(),r=t.split(".").reverse();if(e.length<=1)return n===t;for(var o=0;o<e.length;o++)if(e[o]!==r[o])return!1;return!0}function hostnameFromURL(n){if(/^blob\:/i.test(n)||/^data\:/i.test(n))return currentHostname;var t=n.match(URL_REGEXP);return t?t[2]:currentHostname}var error_invalid_input=function(){return new Error("Invalid input.")},error_invalid_certificate=function(){return new Error("Invalid certificate.")},error_invalid_signature=function(){return new Error("Invalid signature.")},error_date_expired=function(n){return new Error("Date(".concat(n.toString(),") expired."))},error_host_not_allowed=function(n){return new Error("Host(".concat(JSON.stringify(n),") is not allowed."))};function ObjectOmit(n,t){for(var e={},r=0,o=Object.keys(n);r<o.length;r++){var s=o[r];t.indexOf(s)===-1&&(e[s]=n[s])}return e}function jsonStableNoneNumberStrinfiy_(n,t){t===void 0&&(t=!1);var e=typeof n;if(e==="string")return JSON.stringify(n);if(n===!0)return"true";if(n===!1)return"false";if(n===null)return"null";if(n instanceof Array){for(var r="[",o=n.length-1,s=0;s<o;s++)r+=jsonStableNoneNumberStrinfiy_(n[s],!1)+",";return o>-1&&(r+=jsonStableNoneNumberStrinfiy_(n[s],!1)),r+"]"}if(n instanceof Object){if(typeof n.toJSON=="function")return jsonStableNoneNumberStrinfiy_(n.toJSON(),t);for(var u=Object.keys(n).sort(),l=u.length,r="",s=0;s<l;){var c=u[s],f=jsonStableNoneNumberStrinfiy_(n[c],!0);f!==void 0&&(s&&r!==""&&(r+=","),r+=JSON.stringify(c)+":"+f),s++}return"{"+r+"}"}switch(e){case"function":case"undefined":return t?void 0:null;case"number":return 0;default:return isFinite(n)?n:null}}function jsonStableNoneNumberStrinfiy(n){return String(jsonStableNoneNumberStrinfiy_(n,!1))}function verify(n){var t,e,r,o={};try{o=typeof n=="string"?JSON.parse(n):n}catch(m){return error_invalid_input()}if(typeof o!="object")return error_invalid_input();var s=currentHostname,u=Date.now(),l=new Date(typeof o.expire_at=="string"&&/^\d+$/.test(o.expire_at)?Number(o.expire_at):o.expire_at),c=Array.isArray(o.allow_hosts)?o.allow_hosts:[];if(s.length===0||isIPDomain(s)||BUILDIN_ALLOW_HOST.filter(function(m){return matchDomain(m,s)}).length>0){var f=String((t=o.certificate)!==null&&t!==void 0?t:"");if(f){var p=new X509;return p.readCertPEM(f),deepFreeze({issuer:p.getSubjectString(),expire:l,allowHosts:c})}return deepFreeze({issuer:"none",expire:l,allowHosts:c})}var d=String((e=o.certificate)!==null&&e!==void 0?e:"");if(!d)return error_invalid_certificate();var h=new X509;h.readCertPEM(d);var g=String((r=o._signature)!==null&&r!==void 0?r:"");if(!g)return error_invalid_signature();var A=jsonStableNoneNumberStrinfiy(ObjectOmit(o,["_signature"]));return verifyMessage(A,g,h)===!1?error_invalid_signature():u<l.getTime()?BUILDIN_ALLOW_HOST.concat(c).filter(function(m){return matchDomain(m,s)}).length===0?error_host_not_allowed(s):deepFreeze({issuer:h.getSubjectString(),expire:l,allowHosts:c}):error_date_expired(l)}function verifyURL(n,t){var e=hostnameFromURL(n);return currentHostname.length!==0&&!isIPDomain(currentHostname)&&BUILDIN_ALLOW_HOST.filter(function(r){return matchDomain(r,currentHostname)}).length===0&&!isIPDomain(e)&&BUILDIN_ALLOW_HOST.concat(t).filter(function(r){return matchDomain(r,e)}).length===0?error_host_not_allowed(e):n}var PANO_TEXTURE_SCALE=new THREE__namespace.Vector3(1,1,1),FACE_ORDER$1=["right","left","up","down","front","back"];function relativeURL(n,t){if(!isAbsoluteURL(n))return n;if(n.indexOf(t)===0)return n.slice(t.length);var e=t.replace(/^https\:/,"http:");if(n.indexOf(e)===0)return n.slice(e.length);var r=t.replace(/^http\:/,"https:");return n.indexOf(r)===0?n.slice(r.length):(console.warn("".concat(n," is not start with base_url(").concat(t,").")),n)}function panoURL(n,t,e){return!isAbsoluteURL(n)&&typeof t=="string"&&t.length>0&&(n=pathJoin(t,String(e),n)),n}function getTileLevel(n){for(var t=10;t>=0;t--){var e=512*Math.pow(2,t);if(e<=n)return t}return null}function sortTile(n){n=n.slice().sort(function(u,l){return u.level-l.level});for(var t=[],e=0,r=n;e<r.length;e++){var o=r[e];if(t.length===0){t.push(o);continue}var s=t[t.length-1];if(o.level>s.level){t.push(o);continue}if(o.size>s.size){t[t.length-1]=o;continue}}return t}function parse(n,t){for(var e,r,o,s,u,l,c,f,p,d,h,g,A,m,E=[],v=null,y=0,b=[].concat(n);y<b.length;y++){var _=b[y];if("getURL"in _)v={allowHosts:_.allowHosts,expire:_.expire,issuer:_.issuer},E.push(workToJson(_));else{var T=typeof _=="string"?JSON.parse(_):jsonClone(_),S=verify(T);if(S instanceof Error)return S;v===null&&(v=S),E.push(T)}}if(v===null)return new Error("Empty");defineProperty(t,"issuer",{configurable:!1,writable:!1,value:v.issuer}),defineProperty(t,"expire",{configurable:!1,writable:!1,value:Object.freeze(v.expire)}),defineProperty(t,"allowHosts",{configurable:!1,writable:!1,value:Object.freeze(v.allowHosts)});var R=E.reduce(function(U,z){return jsonMerge(U,z)});defineProperty(t,"name",{configurable:!1,writable:!1,value:String((e=R.name)!==null&&e!==void 0?e:"Unknown")}),defineProperty(t,"workCode",{writable:!0,value:String(R.resource_code||R.basic_code||R.vr_code||R.code||R.project_id||R.work_code||R.workCode||createUuid())}),defineProperty(t,"baseURL",{writable:!0,value:(function(){var U,z=(U=R.base_url)!==null&&U!==void 0?U:"";return z&&z[z.length-1]!=="/"&&(z+="/"),z})()});var w=void 0;R.model&&(w={},defineProperty(w,"work",{enumerable:!1,configurable:!1,writable:!1,value:t}),typeof R.model=="object"&&(defineProperty(w,"work",{enumerable:!1,configurable:!1,writable:!1,value:t}),defineProperty(w,"file",{configurable:!1,writable:!1,value:(function(){var U=R.model.file_url;if(U)return relativeURL(U,t.baseURL)})()}),defineProperty(w,"textureBase",{configurable:!1,writable:!1,value:(function(){var U=R.model.material_base_url;return U&&(U=relativeURL(U,t.baseURL)),U})()}),defineProperty(w,"textures",{configurable:!1,writable:!1,value:(function(){var U=void 0;return Array.isArray(R.model.material_textures)&&(U=R.model.material_textures.slice(),Object.freeze(U)),U})()}),defineProperty(w,"layers",{configurable:!1,writable:!1,value:(function(){var U,z,q,j=[];if(Array.isArray(R.model.layers))for(var K=0,Y=R.model.layers;K<Y.length;K++){var X=Y[K];if(X&&X.tileset_url){var Q={};defineProperty(Q,"work",{enumerable:!1,configurable:!1,writable:!1,value:t}),defineProperty(Q,"name",{configurable:!1,writable:!1,value:(U=X.name)!==null&&U!==void 0?U:""}),defineProperty(Q,"type",{configurable:!1,writable:!1,value:(z=X.type)!==null&&z!==void 0?z:"mesh"}),defineProperty(Q,"upAxis",{configurable:!1,writable:!1,value:(q=X.up_axis)!==null&&q!==void 0?q:"Z"}),defineProperty(Q,"tileset",{configurable:!1,writable:!1,value:relativeURL(X.tileset_url,t.baseURL)}),j.push(Q)}}if(typeof R.model.tiles=="object"){var X=R.model.tiles;if(X&&X.tileset_url){var Q={};defineProperty(Q,"work",{enumerable:!1,configurable:!1,writable:!1,value:t}),defineProperty(Q,"name",{configurable:!1,writable:!1,value:"lod"}),defineProperty(Q,"type",{configurable:!1,writable:!1,value:"mesh"}),defineProperty(Q,"upAxis",{configurable:!1,writable:!1,value:"-Y"}),defineProperty(Q,"tileset",{configurable:!1,writable:!1,value:relativeURL(X.tileset_url,t.baseURL)}),j.push(Q)}}return Object.freeze(j)})()}))),defineProperty(t,"model",{configurable:!1,writable:!1,value:w});var M=[];if(Array.isArray(R.observers)&&R.panorama&&Array.isArray(R.panorama.list||R.panorama.info))for(var B=R.observers,C=(r=R.panorama.list||R.panorama.info)!==null&&r!==void 0?r:[],P=(f=(l=(s=(o=R.panorama)===null||o===void 0?void 0:o.pano_high_cube_base_url)!==null&&s!==void 0?s:(u=R.panorama)===null||u===void 0?void 0:u.pano_cube_base_url)!==null&&l!==void 0?l:(c=R.panorama)===null||c===void 0?void 0:c.base_url)!==null&&f!==void 0?f:"",F=Math.min(B.length,C.length),L=function(U){var z=B[U],q=C[U],j={};defineProperty(j,"work",{enumerable:!1,configurable:!1,writable:!1,value:t}),defineProperty(j,"index",{configurable:!1,writable:!1,value:U}),defineProperty(j,"panoIndex",{configurable:!1,writable:!1,value:U}),defineProperty(j,"floorIndex",{configurable:!1,writable:!1,value:(p=z.floor_index)!==null&&p!==void 0?p:z.floor}),defineProperty(j,"derivedId",{configurable:!1,writable:!1,value:z.derived_id}),defineProperty(j,"derivedIdStr",{configurable:!1,writable:!1,value:z.derived_id_str}),defineProperty(j,"active",{configurable:!1,writable:!1,value:z.active!==!1&&q.active!==!1}),defineProperty(j,"loadable",{configurable:!1,writable:!1,value:(h=(d=z.active)!==null&&d!==void 0?d:q.active)!==null&&h!==void 0?h:!1}),defineProperty(j,"position",{configurable:!1,writable:!1,value:Object.freeze(new THREE__namespace.Vector3().fromArray((g=z.position)!==null&&g!==void 0?g:[0,0,0]))}),defineProperty(j,"standingPosition",{configurable:!1,writable:!1,value:Object.freeze(new THREE__namespace.Vector3().fromArray((m=(A=z.standing_position)!==null&&A!==void 0?A:z.standingPosition)!==null&&m!==void 0?m:[0,0,0]))}),defineProperty(j,"quaternion",{configurable:!1,writable:!1,value:Object.freeze(new THREE__namespace.Quaternion().fromArray(z.quaternion?[z.quaternion.x,z.quaternion.y,z.quaternion.z,z.quaternion.w]:[0,0,0,1]))}),defineProperty(j,"matrix",{configurable:!1,writable:!1,value:Object.freeze(new THREE__namespace.Matrix4().compose(j.position,j.quaternion,PANO_TEXTURE_SCALE))}),defineProperty(j,"accessibleNodes",{configurable:!1,writable:!1,value:(function(){var K,Y,X=((Y=(K=z.accessible_nodes)!==null&&K!==void 0?K:z.accessibleNodes)!==null&&Y!==void 0?Y:[]).filter(function(W){return W<F});if(X.length===0)for(var Q=0;Q<F;Q++)Q!==U&&X.push(Q);return Object.freeze(X)})()}),defineProperty(j,"visibleNodes",{configurable:!1,writable:!1,value:(function(){var K,Y,X=((Y=(K=z.visible_nodes)!==null&&K!==void 0?K:z.visibleNodes)!==null&&Y!==void 0?Y:[]).filter(function(W){return W<F});if(X.length===0)for(var Q=0;Q<F;Q++)Q!==U&&X.push(Q);return Object.freeze(X)})()}),defineProperty(j,"images",{configurable:!1,writable:!1,value:(function(){var K={};defineProperty(K,"work",{enumerable:!1,configurable:!1,writable:!1,value:t});for(var Y=0,X=FACE_ORDER$1;Y<X.length;Y++){var Q=X[Y];defineProperty(K,Q,{configurable:!1,writable:!1,value:relativeURL(panoURL(q[Q],P,U),t.baseURL)})}return defineProperty(K,"sizeList",{configurable:!1,writable:!1,value:(function(){var W=getImageSizeFromURL(K[FACE_ORDER$1[0]]);if(W){if(q.size_list){var $=q.size_list.slice().sort(function(oe,de){return oe-de});return Object.freeze($)}else if(q.tiles){for(var $=[W],ie=q.tiles.slice().sort(function(de,me){return de-me}),ee=0,ne=ie;ee<ne.length;ee++){var te=ne[ee],pe=512*Math.pow(2,te);pe>W&&$.push(pe)}return Object.freeze($)}}return Object.freeze([])})()}),defineProperty(K,"tiles",{configurable:!1,writable:!1,value:(function(){var W=getImageSizeFromURL(K.front);if(W){var $=K.sizeList.slice();if($[0]){var ie=getTileLevel($[0]);if(ie)for(var ee=ie-1;ee>=0;ee--)$.unshift(512*Math.pow(2,ee))}if(!($.length<=0)){for(var ne=[],te=0,pe=$;te<pe.length;te++){var oe=pe[te],de=getTileLevel(oe);if(typeof de=="number"){var me={};if(defineProperty(me,"work",{enumerable:!1,configurable:!1,writable:!1,value:t}),defineProperty(me,"level",{configurable:!1,writable:!1,value:de}),oe>W){defineProperty(me,"size",{configurable:!1,writable:!1,value:oe}),defineProperty(me,"scale",{configurable:!1,writable:!1,value:1});for(var be=0,_e=FACE_ORDER$1;be<_e.length;be++){var le=_e[be];defineProperty(me,le,{configurable:!1,writable:!1,value:replaceImageSize(K[le],oe)})}}else{defineProperty(me,"size",{configurable:!1,writable:!1,value:W}),defineProperty(me,"scale",{configurable:!1,writable:!1,value:oe/W});for(var fe=0,re=FACE_ORDER$1;fe<re.length;fe++){var le=re[fe];defineProperty(me,le,{configurable:!1,writable:!1,value:K[le]})}}ne.push(me)}}return ne=sortTile(ne),Object.freeze(ne)}}})()}),K})()}),defineProperty(j,"video",{configurable:!1,writable:!1,value:(function(){var K=void 0;return q.video&&(K={},defineProperty(K,"work",{enumerable:!1,configurable:!1,writable:!1,value:t}),defineProperty(K,"source",{configurable:!1,writable:!1,value:q.video.source}),defineProperty(K,"matrix",{configurable:!1,writable:!1,value:new THREE__namespace.Matrix4().fromArray(q.video.matrix)}),defineProperty(K,"size",{configurable:!1,writable:!1,value:new THREE__namespace.Vector2().fromArray(q.video.size)})),K})()}),M.push(j)},O=0;O<F;O++)L(O);defineProperty(t,"observers",{configurable:!1,writable:!1,value:Object.freeze(M)});var k={};if(defineProperty(k,"work",{enumerable:!1,configurable:!1,writable:!1,value:t}),R.initial){if(t.observers.length>0){var D=void 0;isNumber(R.initial.panoIndex)?D=R.initial.panoIndex:isNumber(R.initial.pano_index)?D=R.initial.pano_index:isNumber(R.initial.pano)&&(D=R.initial.pano),typeof D=="number"&&(D=clamp$1(D,0,t.observers.length-1),defineProperty(k,"panoIndex",{writable:!0,value:D}))}if(R.initial.mode==="Panorama"&&t.observers.length===0||R.initial.mode==="Floorplan"||R.initial.mode==="Topview"||R.initial.mode==="Model"||R.initial.mode==="Mapview"?defineProperty(k,"mode",{writable:!0,value:R.initial.mode}):typeof k.panoIndex=="number"?defineProperty(k,"mode",{writable:!0,value:"Panorama"}):defineProperty(k,"mode",{writable:!0,value:"Mapview"}),isNumber(R.initial.latitude)&&defineProperty(k,"latitude",{writable:!0,value:R.initial.latitude}),isNumber(R.initial.longitude)?defineProperty(k,"longitude",{writable:!0,value:R.initial.longitude}):isNumber(R.initial.heading)&&defineProperty(k,"longitude",{writable:!0,value:headingToLongitude(R.initial.heading)}),isNumber(R.initial.fov)&&defineProperty(k,"fov",{writable:!0,value:R.initial.fov}),isNumber(R.initial.distance)&&defineProperty(k,"distance",{writable:!0,value:R.initial.distance}),Array.isArray(R.initial.offset)){var J=R.initial.offset,G=[0,0,0].map(function(U,z){var q=Number(J[z]);return isNaN(q)||!isFinite(q)?0:q});defineProperty(k,"offset",{writable:!0,value:new THREE__namespace.Vector3().fromArray(G)})}else typeof R.initial.offset=="object"&&typeof R.initial.offset.x=="number"&&typeof R.initial.offset.y=="number"&&typeof R.initial.offset.z=="number"&&defineProperty(k,"offset",{writable:!0,value:new THREE__namespace.Vector3().fromArray([R.initial.offset.x,R.initial.offset.y,R.initial.offset.z])})}return defineProperty(t,"initial",{configurable:!1,writable:!1,value:k}),t}function parseNull(n,t){return defineProperty(t,"issuer",{configurable:!1,writable:!1,value:"null"}),defineProperty(t,"expire",{configurable:!1,writable:!1,value:Object.freeze(new Date)}),defineProperty(t,"allowHosts",{configurable:!1,writable:!1,value:Object.freeze(["*"])}),defineProperty(t,"name",{configurable:!1,writable:!1,value:"Null"}),defineProperty(t,"workCode",{value:createUuid()}),defineProperty(t,"baseURL",{value:"/"}),defineProperty(t,"model",{configurable:!1,writable:!1,value:void 0}),defineProperty(t,"observers",{configurable:!1,writable:!1,value:Object.freeze([])}),defineProperty(t,"initial",{configurable:!1,writable:!1,value:(function(){var e={};return defineProperty(e,"work",{enumerable:!1,configurable:!1,writable:!1,value:t}),defineProperty(e,"mode",{writable:!0,value:"Mapview"}),e})()}),t}function parsePano(n,t){var e,r;return defineProperty(t,"issuer",{configurable:!1,writable:!1,value:"null"}),defineProperty(t,"expire",{configurable:!1,writable:!1,value:Object.freeze(new Date)}),defineProperty(t,"allowHosts",{configurable:!1,writable:!1,value:Object.freeze(["*"])}),defineProperty(t,"name",{configurable:!1,writable:!1,value:String((e=n.name)!==null&&e!==void 0?e:"Unknown")}),defineProperty(t,"workCode",{writable:!0,value:(r=n.code)!==null&&r!==void 0?r:createUuid()}),defineProperty(t,"baseURL",{writable:!0,value:"/"}),defineProperty(t,"model",{configurable:!1,writable:!1,value:void 0}),defineProperty(t,"observers",{configurable:!1,writable:!1,value:(function(){var o={};return defineProperty(o,"work",{enumerable:!1,configurable:!1,writable:!1,value:t}),defineProperty(o,"index",{configurable:!1,writable:!1,value:0}),defineProperty(o,"panoIndex",{configurable:!1,writable:!1,value:0}),defineProperty(o,"floorIndex",{configurable:!1,writable:!1,value:0}),defineProperty(o,"derivedId",{configurable:!1,writable:!1,value:void 0}),defineProperty(o,"derivedIdStr",{configurable:!1,writable:!1,value:void 0}),defineProperty(o,"active",{configurable:!1,writable:!1,value:!0}),defineProperty(o,"loadable",{configurable:!1,writable:!1,value:!1}),defineProperty(o,"position",{configurable:!1,writable:!1,value:new THREE__namespace.Vector3(0,1.5,0)}),defineProperty(o,"standingPosition",{configurable:!1,writable:!1,value:new THREE__namespace.Vector3(0,0,0)}),defineProperty(o,"quaternion",{configurable:!1,writable:!1,value:new THREE__namespace.Quaternion(0,1,0,0)}),defineProperty(o,"matrix",{configurable:!1,writable:!1,value:new THREE__namespace.Matrix4().compose(o.position,o.quaternion,PANO_TEXTURE_SCALE)}),defineProperty(o,"accessibleNodes",{configurable:!1,writable:!1,value:Object.freeze([])}),defineProperty(o,"visibleNodes",{configurable:!1,writable:!1,value:Object.freeze([])}),defineProperty(o,"images",{configurable:!1,writable:!1,value:(function(){var s={};defineProperty(s,"work",{enumerable:!1,configurable:!1,writable:!1,value:t});for(var u=0,l=FACE_ORDER$1;u<l.length;u++){var c=l[u];defineProperty(s,c,{configurable:!1,writable:!1,value:n[c]})}return defineProperty(s,"sizeList",{configurable:!1,writable:!1,value:Object.freeze([n.size])}),defineProperty(s,"tiles",{configurable:!1,writable:!1,value:(function(){var f=getImageSizeFromURL(s.front);if(f){var p=s.sizeList.slice();if(p[0]){var d=getTileLevel(p[0]);if(d)for(var h=d-1;h>=0;h--)p.unshift(512*Math.pow(2,h))}if(!(p.length<=0)){for(var g=[],A=0,m=p;A<m.length;A++){var E=m[A],v=getTileLevel(E);if(typeof v=="number"){var y={};if(defineProperty(y,"work",{enumerable:!1,configurable:!1,writable:!1,value:t}),defineProperty(y,"level",{configurable:!1,writable:!1,value:v}),E>f){defineProperty(y,"size",{configurable:!1,writable:!1,value:E}),defineProperty(y,"scale",{configurable:!1,writable:!1,value:1});for(var b=0,_=FACE_ORDER$1;b<_.length;b++){var T=_[b];defineProperty(y,T,{configurable:!1,writable:!1,value:replaceImageSize(s[T],E)})}}else{defineProperty(y,"size",{configurable:!1,writable:!1,value:f}),defineProperty(y,"scale",{configurable:!1,writable:!1,value:E/f});for(var S=0,R=FACE_ORDER$1;S<R.length;S++){var T=R[S];defineProperty(y,T,{configurable:!1,writable:!1,value:s[T]})}}g.push(y)}}return g=sortTile(g),Object.freeze(g)}}})()}),s})()}),defineProperty(o,"video",{configurable:!1,writable:!1,value:void 0}),Object.freeze([o])})()}),defineProperty(t,"initial",{configurable:!1,writable:!1,value:(function(){var o={};return defineProperty(o,"work",{enumerable:!1,configurable:!1,writable:!1,value:t}),defineProperty(o,"mode",{writable:!0,value:"Panorama"}),defineProperty(o,"panoIndex",{writable:!0,value:0}),o})()}),t}var workVerifySet=new WeakSet,hrefAElement=typeof document!="undefined"?document.createElement("a"):{href:""},Work=(function(){function n(t,e){this.observerBox=new THREE__namespace.Box3,this.observerBox=new THREE__namespace.Box3,this.transform=new THREE__namespace.Matrix4,this.shortPath=!1,this.jsonp=!1;var r;if(t!==null?typeof t=="object"&&typeof t.size=="number"&&typeof t.up=="string"&&typeof t.down=="string"&&typeof t.right=="string"&&typeof t.left=="string"&&typeof t.front=="string"&&typeof t.back=="string"?r=parsePano(t,this):r=parse(t,this):r=parseNull(t,this),r instanceof Error)throw new Error("[PARSE FAILED]: "+r.message+`
1027
1027
  Error work input:
1028
1028
  `+JSON.stringify(t));workVerifySet.add(this);for(var o=0,s=this.observers;o<s.length;o++){var u=s[o];this.observerBox.expandByPoint(u.position),this.observerBox.expandByPoint(u.standingPosition)}e.transform&&(Array.isArray(e.transform)?this.transform.fromArray(e.transform):this.transform.copy(e.transform)),typeof e.jsonp=="boolean"&&(this.jsonp=e.jsonp),typeof e.shortPath=="boolean"&&(this.shortPath=e.shortPath),e.workCode&&(typeof e.workCode=="string"?this.workCode=e.workCode:typeof e.workCode=="function"&&(this.workCode=e.workCode(t)));{var l=this;this.options={get transform(){return l.transform}},this.raw={get works(){return[JSON.stringify(workToJson(l))]}}}}return n.prototype.getURL=function(t){var e;if(!isAbsoluteURL(t)){if(this.jsonp===!0){t=t.replace(/([\?\#].*)?$/i,"");var r=sha256("".concat(t)).slice(0,7);t="".concat(t,".").concat(r,".jsonp")}if(this.shortPath===!0){var o=t.replace(t,"").split("."),s=(e=o.shift())!==null&&e!==void 0?e:"",u=o.join(".");t=sha256(s)+(u?"."+u:"")}t=pathJoin(this.baseURL,t)}return hrefAElement.href=t,t=hrefAElement.href,t},n.prototype.verifyURL=function(t){return typeof verifyURL(this.getURL(t),this.allowHosts)=="string"},n.prototype.toJSON=function(){return workToJson(this)},n.parse=parseWork,n})();function parseWork(n,t){typeof n=="string"&&n.trim()[0]==="{"&&(n=JSON.parse(n));try{return new Work(n,t!=null?t:{})}catch(e){throw console.log(e),new Error("[PARSE FAILED]: "+e.message+`
1029
1029
  Error work input:
@@ -1455,7 +1455,7 @@ void main() {
1455
1455
  vec3 panoToVertex = normalize(vFinalPosition.xyz);
1456
1456
  gl_FragColor = textureCube(map, vec3(FLIP_CUBE_MAP * panoToVertex.x, panoToVertex.yz));
1457
1457
  }
1458
- `,BoudningMaterial=(function(n){__extends(t,n);function t(){var e=n.call(this,{defines:{},uniforms:{map:{value:null}},vertexShader:BOUNDING_MATERIAL_VERTEX_SHADER,fragmentShader:BOUNDING_MATERIAL_FRAGMENT_SHADER,transparent:!1})||this;return defineProperty(e,"map",{get:function(){return this.uniforms.map.value},set:function(r){this.uniforms.map.value=r}}),e}return t})(THREE__namespace.ShaderMaterial),BoundingMesh=(function(n){__extends(t,n);function t(){var e=n.call(this,boundinghGeometry,new BoudningMaterial)||this;return e.disposed=!1,e.frustumCulled=!1,e.renderOrder=9999,e}return t.prototype.update=function(e,r){if(this.disposed){this.material.map=null,this.material.visible=!1;return}this.material.map=r,this.material.visible=r!==null},t.prototype.dispose=function(){this.disposed=!0,this.material.dispose()},t})(THREE__namespace.Mesh),Tiling=(function(){function n(){this.forceRenderWhenNextUpdate=!0,this.disposed=!1,this.level=0,this.pedding=0,this.maxRequest=1,this.appearDuration=.5,this.maxCacheTile=48,this.imageOptions={},this.boundingMesh=new BoundingMesh,this.boundingMesh.frustumCulled=!1,this.textureLoader=new TextureLoader,this.observer=null,this.tileTree=createTileCubeTree(0),this.tileMeshes=new Map,this.frustum=new THREE__namespace.Frustum,this.scene=new THREE__namespace.Scene,this.camera=new THREE__namespace.PerspectiveCamera(90,1,.1,100),this.scene.add(this.boundingMesh),this.renderTarget=new THREE__namespace.WebGLRenderTarget(1,1,{depthBuffer:!0,stencilBuffer:!1,generateMipmaps:!1,magFilter:THREE__namespace.NearestFilter,minFilter:THREE__namespace.NearestFilter,wrapS:THREE__namespace.ClampToEdgeWrapping,wrapT:THREE__namespace.ClampToEdgeWrapping})}return n.prototype.dispose=function(){this.setObserver(null),this.renderTarget.dispose(),this.boundingMesh.dispose(),this.disposed=!0},n.prototype.cleanup=function(){var t=this;this.tileMeshes.forEach(function(e){e.dispose(),t.scene.remove(e)}),this.tileMeshes.clear(),this.forceRenderWhenNextUpdate=!0},n.prototype.setObserver=function(t){var e,r,o,s;if(!this.disposed&&this.observer!==t){this.cleanup(),this.observer=t;var u=(s=(o=(r=(e=this.observer)===null||e===void 0?void 0:e.images.tiles)===null||r===void 0?void 0:r.slice().sort(function(l,c){return c.level-l.level})[0])===null||o===void 0?void 0:o.level)!==null&&s!==void 0?s:0;this.tileTree=createTileCubeTree(u)}},n.prototype.update=function(t){var e=this,r=this.forceRenderWhenNextUpdate;if(this.disposed)return r;var o=t.time,s=t.resolution,u=t.pixelRatio,l=t.renderer,c=t.cameraMatrix,f=t.cameraProjectionMatrix,p=t.panoMap,d=t.panoMatrix,h=t.panoZoom,g=t.minLevel,A=t.level;if(this.boundingMesh.update(o,p),this.observer===null)return(this.renderTarget.width!==1||this.renderTarget.height!==1)&&(this.renderTarget.setSize(1,1),r=!0),!1;this.level=clamp$1(A,0,this.tileTree.maxLevel);var m=s.width*u,E=s.height*u;(this.renderTarget.width!==m||this.renderTarget.height!==E)&&this.renderTarget.setSize(m,E),this.scene.matrix.equals(d)||(this.scene.matrix.copy(d),this.scene.matrixWorld.copy(this.scene.matrix),this.scene.matrix.decompose(this.scene.position,this.scene.quaternion,this.scene.scale),this.scene.matrixAutoUpdate=!1,r=!0);var v=scratchCameraQuaternion.setFromRotationMatrix(c),y=scratchCameraMatrix.compose(this.scene.position,v,this.scene.scale);this.camera.matrix.equals(y)||(this.camera.matrix.copy(y),this.camera.matrixWorld.copy(this.camera.matrix),this.camera.position.copy(this.scene.position),this.camera.quaternion.copy(v),this.camera.scale.copy(this.scene.scale),r=!0);var b=scratchCameraProjectMatrix.copy(f);b.elements[0]*=h,b.elements[5]*=h,this.camera.projectionMatrix.equals(b)||(this.camera.projectionMatrix.copy(b),this.camera.projectionMatrixInverse.getInverse(this.camera.projectionMatrix),r=!0),scratchSceneQuaternionInverse.copy(this.scene.quaternion).inverse(),scratchSceneMatrixInverse.makeRotationFromQuaternion(scratchSceneQuaternionInverse),scratchFrustumMatrix.copy(this.camera.matrix),scratchFrustumMatrix.setPosition(0,0,0),scratchFrustumMatrix.premultiply(scratchSceneMatrixInverse),scratchFrustumMatrixInverse.getInverse(scratchFrustumMatrix),scratchFrustumProjectMatrix.multiplyMatrices(this.camera.projectionMatrix,scratchFrustumMatrixInverse),this.frustum.setFromProjectionMatrix(scratchFrustumProjectMatrix);var _=this.frustum.planes[5].normal,T=[];A>=g&&traverseTileCubeNode(this.tileTree,function(Q){if(!(Q.level<g)){if(Q.level>A||!e.frustum.intersectsBox(Q.box))return!1;T.push(Q)}});var S=new WeakMap;T.sort(function(Q,W){if(Q.level!==W.level)return Q.level-W.level;var $=S.get(Q);$===void 0&&($=Q.box.getCenter(scratchSortVector3).angleTo(_),S.set(Q,$));var ie=S.get(W);return ie===void 0&&(ie=W.box.getCenter(scratchSortVector3).angleTo(_),S.set(W,ie)),$-ie});var R=new WeakSet,w=this.observer.images.tiles;if(w)for(var M=function(Q){var W=w.find(function(le){return le.level===Q.level});if(!W)return"continue";R.add(Q);var $=B.tileMeshes.get(Q);if($){$.appearDuration=B.appearDuration;var ie=$.updateTime(o);return ie&&(r=!0),"continue"}if(B.pedding>=B.maxRequest)return"continue";var ee=Math.pow(2,Q.level)*Q.position.y,ne=Math.pow(2,Q.level)*Q.position.x,te=panoStringify({panoIndex:B.observer.panoIndex,workCode:B.observer.work.workCode}),pe="".concat(te,".").concat(Q.face,".").concat(Q.level,".").concat(ee,".").concat(ne),oe=W.work.getURL(W[Q.face]),de=W.size,me=B.imageOptions.transform,be=__assign(__assign({},pick(B.imageOptions,["format","sharpen","mappings"])),{key:"pano_tile.".concat(pe),size:W.scale>=1?void 0:de*Q.size*W.scale,cut:Q.size===1?void 0:[de*Q.position.x,de*Q.position.y,de*Q.size,de*Q.size]});Q.level===1&&W.scale>=.5&&(be.format==="jpg"||/\.jpg$/.test(oe))&&(be.size=void 0,be.quality||(be.quality=70)),Q.size===1&&console.warn("tile: ".concat(be.key," should not appear.")),B.pedding++;var _e=B.textureLoader.loadTexture(oe,{imageURL:{transform:me,options:be},minFilter:THREE__namespace.LinearFilter,magFilter:THREE__namespace.LinearFilter,generateMipmaps:!1,fetcher:getFetcher(B.observer.work)}).then(function(le){return le.body});_e.then(function(le){return initTexture(le,l)}).then(function(le){return e.pedding--,le},function(le){return e.pedding--,Promise.reject(le)}),$=new TileMesh(Q,_e),$.name="tiling:tile-".concat(pe),$.visible=!1,$.appearDuration=B.appearDuration,B.tileMeshes.set(Q,$),B.scene.add($),$.updateTime(o),r=!0},B=this,C=0,P=T;C<P.length;C++){var F=P[C];M(F)}var L=[],O=[];this.tileMeshes.forEach(function(Q,W){R.has(W)?L.push(Q):O.push(Q);var $=W.level>=g&&W.level<=A;Q.visible!==$&&(Q.visible=$,r=!0)});for(var k=O.sort(function(Q,W){return W.activeTime-Q.activeTime}).slice(Math.max(0,this.maxCacheTile-L.length)),D=0,J=k;D<J.length;D++){var G=J[D];this.tileMeshes.delete(G.node),this.scene.remove(G),G.dispose(),r=!0}if(r){var U=l.getRenderTarget();scratchPrevClearColor$1.copy(l.getClearColor());var z=l.getClearAlpha(),q=l.autoClear,j=l.autoClearColor,K=l.autoClearDepth,Y=l.autoClearStencil,X=l.clippingPlanes;l.autoClear=!0,l.autoClearColor=!0,l.autoClearDepth=!0,l.autoClearStencil=!0,l.clippingPlanes=clippingPlanes,l.setRenderTarget(this.renderTarget),l.setClearColor(clearColor$1,clearAlpha),l.render(this.scene,this.camera),l.setRenderTarget(U),l.setClearColor(scratchPrevClearColor$1,z),l.autoClear=q,l.autoClearColor=j,l.autoClearDepth=K,l.autoClearStencil=Y,l.clippingPlanes=X}return this.forceRenderWhenNextUpdate=!1,r},n})(),ROTATE_Y_PI_MATRIX=new THREE__namespace.Matrix4().makeRotationAxis(new THREE__namespace.Vector3(0,1,0),Math.PI),vertices$1=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]),indices=new Uint32Array([0,4,1,1,4,5,1,5,2,2,5,6,2,6,3,3,6,7,3,7,0,0,7,4,3,0,2,2,0,1,4,7,5,5,7,6]),sharedGeometry$1=new THREE__namespace.BufferGeometry;sharedGeometry$1.setAttribute("position",new THREE__namespace.BufferAttribute(vertices$1,3));sharedGeometry$1.setIndex(new THREE__namespace.BufferAttribute(indices,1));sharedGeometry$1.applyMatrix4(new THREE__namespace.Matrix4().makeScale(-1,1,1));var PANO_VIDEO_MATERIAL_VERTEX_SHADER=`
1458
+ `,BoudningMaterial=(function(n){__extends(t,n);function t(){var e=n.call(this,{defines:{},uniforms:{map:{value:null}},vertexShader:BOUNDING_MATERIAL_VERTEX_SHADER,fragmentShader:BOUNDING_MATERIAL_FRAGMENT_SHADER,transparent:!1})||this;return defineProperty(e,"map",{get:function(){return this.uniforms.map.value},set:function(r){this.uniforms.map.value=r}}),e}return t})(THREE__namespace.ShaderMaterial),BoundingMesh=(function(n){__extends(t,n);function t(){var e=n.call(this,boundinghGeometry,new BoudningMaterial)||this;return e.disposed=!1,e.frustumCulled=!1,e.renderOrder=9999,e}return t.prototype.update=function(e,r){if(this.disposed){this.material.map=null,this.material.visible=!1;return}this.material.map=r,this.material.visible=r!==null},t.prototype.dispose=function(){this.disposed=!0,this.material.dispose()},t})(THREE__namespace.Mesh),Tiling=(function(){function n(){this.forceRenderWhenNextUpdate=!0,this.disposed=!1,this.level=0,this.pedding=0,this.maxRequest=1,this.appearDuration=.5,this.maxCacheTile=48,this.imageOptions={},this.boundingMesh=new BoundingMesh,this.boundingMesh.frustumCulled=!1,this.textureLoader=new TextureLoader,this.observer=null,this.tileTree=createTileCubeTree(0),this.tileMeshes=new Map,this.frustum=new THREE__namespace.Frustum,this.scene=new THREE__namespace.Scene,this.camera=new THREE__namespace.PerspectiveCamera(90,1,.1,100),this.scene.add(this.boundingMesh),this.renderTarget=new THREE__namespace.WebGLRenderTarget(1,1,{depthBuffer:!0,stencilBuffer:!1,generateMipmaps:!1,magFilter:THREE__namespace.LinearFilter,minFilter:THREE__namespace.LinearFilter,wrapS:THREE__namespace.ClampToEdgeWrapping,wrapT:THREE__namespace.ClampToEdgeWrapping})}return n.prototype.dispose=function(){this.setObserver(null),this.renderTarget.dispose(),this.boundingMesh.dispose(),this.disposed=!0},n.prototype.cleanup=function(){var t=this;this.tileMeshes.forEach(function(e){e.dispose(),t.scene.remove(e)}),this.tileMeshes.clear(),this.forceRenderWhenNextUpdate=!0},n.prototype.setObserver=function(t){var e,r,o,s;if(!this.disposed&&this.observer!==t){this.cleanup(),this.observer=t;var u=(s=(o=(r=(e=this.observer)===null||e===void 0?void 0:e.images.tiles)===null||r===void 0?void 0:r.slice().sort(function(l,c){return c.level-l.level})[0])===null||o===void 0?void 0:o.level)!==null&&s!==void 0?s:0;this.tileTree=createTileCubeTree(u)}},n.prototype.update=function(t){var e=this,r=this.forceRenderWhenNextUpdate;if(this.disposed)return r;var o=t.time,s=t.resolution,u=t.pixelRatio,l=t.renderer,c=t.cameraMatrix,f=t.cameraProjectionMatrix,p=t.panoMap,d=t.panoMatrix,h=t.panoZoom,g=t.minLevel,A=t.level;if(this.boundingMesh.update(o,p),this.observer===null)return(this.renderTarget.width!==1||this.renderTarget.height!==1)&&(this.renderTarget.setSize(1,1),r=!0),!1;this.level=clamp$1(A,0,this.tileTree.maxLevel);var m=s.width*u,E=s.height*u;(this.renderTarget.width!==m||this.renderTarget.height!==E)&&this.renderTarget.setSize(m,E),this.scene.matrix.equals(d)||(this.scene.matrix.copy(d),this.scene.matrixWorld.copy(this.scene.matrix),this.scene.matrix.decompose(this.scene.position,this.scene.quaternion,this.scene.scale),this.scene.matrixAutoUpdate=!1,r=!0);var v=scratchCameraQuaternion.setFromRotationMatrix(c),y=scratchCameraMatrix.compose(this.scene.position,v,this.scene.scale);this.camera.matrix.equals(y)||(this.camera.matrix.copy(y),this.camera.matrixWorld.copy(this.camera.matrix),this.camera.position.copy(this.scene.position),this.camera.quaternion.copy(v),this.camera.scale.copy(this.scene.scale),r=!0);var b=scratchCameraProjectMatrix.copy(f);b.elements[0]*=h,b.elements[5]*=h,this.camera.projectionMatrix.equals(b)||(this.camera.projectionMatrix.copy(b),this.camera.projectionMatrixInverse.getInverse(this.camera.projectionMatrix),r=!0),scratchSceneQuaternionInverse.copy(this.scene.quaternion).inverse(),scratchSceneMatrixInverse.makeRotationFromQuaternion(scratchSceneQuaternionInverse),scratchFrustumMatrix.copy(this.camera.matrix),scratchFrustumMatrix.setPosition(0,0,0),scratchFrustumMatrix.premultiply(scratchSceneMatrixInverse),scratchFrustumMatrixInverse.getInverse(scratchFrustumMatrix),scratchFrustumProjectMatrix.multiplyMatrices(this.camera.projectionMatrix,scratchFrustumMatrixInverse),this.frustum.setFromProjectionMatrix(scratchFrustumProjectMatrix);var _=this.frustum.planes[5].normal,T=[];A>=g&&traverseTileCubeNode(this.tileTree,function(Q){if(!(Q.level<g)){if(Q.level>A||!e.frustum.intersectsBox(Q.box))return!1;T.push(Q)}});var S=new WeakMap;T.sort(function(Q,W){if(Q.level!==W.level)return Q.level-W.level;var $=S.get(Q);$===void 0&&($=Q.box.getCenter(scratchSortVector3).angleTo(_),S.set(Q,$));var ie=S.get(W);return ie===void 0&&(ie=W.box.getCenter(scratchSortVector3).angleTo(_),S.set(W,ie)),$-ie});var R=new WeakSet,w=this.observer.images.tiles;if(w)for(var M=function(Q){var W=w.find(function(le){return le.level===Q.level});if(!W)return"continue";R.add(Q);var $=B.tileMeshes.get(Q);if($){$.appearDuration=B.appearDuration;var ie=$.updateTime(o);return ie&&(r=!0),"continue"}if(B.pedding>=B.maxRequest)return"continue";var ee=Math.pow(2,Q.level)*Q.position.y,ne=Math.pow(2,Q.level)*Q.position.x,te=panoStringify({panoIndex:B.observer.panoIndex,workCode:B.observer.work.workCode}),pe="".concat(te,".").concat(Q.face,".").concat(Q.level,".").concat(ee,".").concat(ne),oe=W.work.getURL(W[Q.face]),de=W.size,me=B.imageOptions.transform,be=__assign(__assign({},pick(B.imageOptions,["format","sharpen","mappings"])),{key:"pano_tile.".concat(pe),size:W.scale>=1?void 0:de*Q.size*W.scale,cut:Q.size===1?void 0:[de*Q.position.x,de*Q.position.y,de*Q.size,de*Q.size]});Q.level===1&&W.scale>=.5&&(be.format==="jpg"||/\.jpg$/.test(oe))&&(be.size=void 0,be.quality||(be.quality=70)),Q.size===1&&console.warn("tile: ".concat(be.key," should not appear.")),B.pedding++;var _e=B.textureLoader.loadTexture(oe,{imageURL:{transform:me,options:be},minFilter:THREE__namespace.LinearFilter,magFilter:THREE__namespace.LinearFilter,generateMipmaps:!1,fetcher:getFetcher(B.observer.work)}).then(function(le){return le.body});_e.then(function(le){return initTexture(le,l)}).then(function(le){return e.pedding--,le},function(le){return e.pedding--,Promise.reject(le)}),$=new TileMesh(Q,_e),$.name="tiling:tile-".concat(pe),$.visible=!1,$.appearDuration=B.appearDuration,B.tileMeshes.set(Q,$),B.scene.add($),$.updateTime(o),r=!0},B=this,C=0,P=T;C<P.length;C++){var F=P[C];M(F)}var L=[],O=[];this.tileMeshes.forEach(function(Q,W){R.has(W)?L.push(Q):O.push(Q);var $=W.level>=g&&W.level<=A;Q.visible!==$&&(Q.visible=$,r=!0)});for(var k=O.sort(function(Q,W){return W.activeTime-Q.activeTime}).slice(Math.max(0,this.maxCacheTile-L.length)),D=0,J=k;D<J.length;D++){var G=J[D];this.tileMeshes.delete(G.node),this.scene.remove(G),G.dispose(),r=!0}if(r){var U=l.getRenderTarget();scratchPrevClearColor$1.copy(l.getClearColor());var z=l.getClearAlpha(),q=l.autoClear,j=l.autoClearColor,K=l.autoClearDepth,Y=l.autoClearStencil,X=l.clippingPlanes;l.autoClear=!0,l.autoClearColor=!0,l.autoClearDepth=!0,l.autoClearStencil=!0,l.clippingPlanes=clippingPlanes,l.setRenderTarget(this.renderTarget),l.setClearColor(clearColor$1,clearAlpha),l.render(this.scene,this.camera),l.setRenderTarget(U),l.setClearColor(scratchPrevClearColor$1,z),l.autoClear=q,l.autoClearColor=j,l.autoClearDepth=K,l.autoClearStencil=Y,l.clippingPlanes=X}return this.forceRenderWhenNextUpdate=!1,r},n})(),ROTATE_Y_PI_MATRIX=new THREE__namespace.Matrix4().makeRotationAxis(new THREE__namespace.Vector3(0,1,0),Math.PI),vertices$1=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]),indices=new Uint32Array([0,4,1,1,4,5,1,5,2,2,5,6,2,6,3,3,6,7,3,7,0,0,7,4,3,0,2,2,0,1,4,7,5,5,7,6]),sharedGeometry$1=new THREE__namespace.BufferGeometry;sharedGeometry$1.setAttribute("position",new THREE__namespace.BufferAttribute(vertices$1,3));sharedGeometry$1.setIndex(new THREE__namespace.BufferAttribute(indices,1));sharedGeometry$1.applyMatrix4(new THREE__namespace.Matrix4().makeScale(-1,1,1));var PANO_VIDEO_MATERIAL_VERTEX_SHADER=`
1459
1459
 
1460
1460
  #if defined(USE_PANO_VIDEO)
1461
1461
  varying vec3 worldPosition;
@@ -2130,7 +2130,7 @@ void main() {
2130
2130
  #include <premultiplied_alpha_fragment>
2131
2131
 
2132
2132
  }
2133
- `},LineMaterial=(function(n){__extends(t,n);function t(e){var r=n.call(this,{uniforms:THREE__namespace.UniformsUtils.clone(lineShader.uniforms),vertexShader:lineShader.vertexShader,fragmentShader:lineShader.fragmentShader,clipping:!0})||this;return r.type="LineMaterial",r.dashed=!1,Object.defineProperties(r,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(o){this.uniforms.diffuse.value=o}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(o){this.uniforms.linewidth.value=o}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(o){this.uniforms.dashScale.value=o}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(o){this.uniforms.dashSize.value=o}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(o){this.uniforms.gapSize.value=o}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(o){this.uniforms.opacity.value=o}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(o){this.uniforms.resolution.value.copy(o)}}}),r.setValues(e),r}return t})(THREE__namespace.ShaderMaterial);Object.assign(LineMaterial.prototype,{isLineMaterial:!0});var LineSegments2=(function(n){__extends(t,n);function t(e,r){var o=n.call(this)||this;return o.type="LineSegments2",o.geometry=e!==void 0?e:new LineSegmentsGeometry,o.material=r!==void 0?r:new LineMaterial({color:Math.random()*16777215}),o}return t.prototype.computeLineDistances=function(){for(var e=this.geometry,r=e.attributes.instanceStart,o=e.attributes.instanceEnd,s=new Float32Array(2*r.count),u=new THREE__namespace.Vector3,l=new THREE__namespace.Vector3,c=0,f=0,p=r.count;c<p;c++,f+=2)u.fromBufferAttribute(r,c),l.fromBufferAttribute(o,c),s[f]=f===0?0:s[f-1],s[f+1]=s[f]+u.distanceTo(l);var d=new THREE__namespace.InstancedInterleavedBuffer(s,2,1);return e.setAttribute("instanceDistanceStart",new THREE__namespace.InterleavedBufferAttribute(d,1,0)),e.setAttribute("instanceDistanceEnd",new THREE__namespace.InterleavedBufferAttribute(d,1,1)),this},t.prototype.raycast=function(e,r){e.camera===null&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2.');var o=e.ray,s=e.camera,u=s.projectionMatrix,l=this.geometry,c=this.material,f=c.resolution,p=c.linewidth,d=l.attributes.instanceStart,h=l.attributes.instanceEnd,g=new THREE__namespace.Vector4,A=new THREE__namespace.Vector4,m=new THREE__namespace.Vector4,E=new THREE__namespace.Vector3,v=new THREE__namespace.Matrix4,y=new THREE__namespace.Line3,b=new THREE__namespace.Vector3;o.at(1,m),m.w=1,m.applyMatrix4(s.matrixWorldInverse),m.applyMatrix4(u),m.multiplyScalar(1/m.w),m.x*=f.x/2,m.y*=f.y/2,m.z=0,E.copy(m);var _=this.matrixWorld;v.multiplyMatrices(s.matrixWorldInverse,_);for(var T=0,S=d.count;T<S;T++){g.fromBufferAttribute(d,T),A.fromBufferAttribute(h,T),g.w=1,A.w=1,g.applyMatrix4(v),A.applyMatrix4(v),g.applyMatrix4(u),A.applyMatrix4(u),g.multiplyScalar(1/g.w),A.multiplyScalar(1/A.w);var R=g.z<-1&&A.z<-1,w=g.z>1&&A.z>1;if(!(R||w)){g.x*=f.x/2,g.y*=f.y/2,A.x*=f.x/2,A.y*=f.y/2,y.start.copy(g),y.start.z=0,y.end.copy(A),y.end.z=0;var M=y.closestPointToPointParameter(E,!0);y.at(M,b);var B=THREE__namespace.MathUtils.lerp(g.z,A.z,M),C=B>=-1&&B<=1,P=E.distanceTo(b)<p*.5;if(C&&P){y.start.fromBufferAttribute(d,T),y.end.fromBufferAttribute(h,T),y.start.applyMatrix4(_),y.end.applyMatrix4(_);var F=new THREE__namespace.Vector3,L=new THREE__namespace.Vector3;o.distanceSqToSegment(y.start,y.end,L,F),r.push({point:L,pointOnLine:F,distance:o.origin.distanceTo(L),object:this,faceIndex:T})}}}},t})(THREE__namespace.Mesh);Object.assign(LineSegments2.prototype,{isLineSegments2:!0});var Line2=(function(n){__extends(t,n);function t(e,r){var o=n.call(this,e,r)||this;return o.type="Line2",o}return t})(LineSegments2);Object.assign(Line2.prototype,{isLine2:!0});var LineGeometry=(function(n){__extends(t,n);function t(){var e=n.call(this)||this;return e.type="LineGeometry",e}return t.prototype.setPositions=function(e){for(var r=e.length-3,o=new Float32Array(2*r),s=0;s<r;s+=3)o[2*s]=e[s],o[2*s+1]=e[s+1],o[2*s+2]=e[s+2],o[2*s+3]=e[s+3],o[2*s+4]=e[s+4],o[2*s+5]=e[s+5];return n.prototype.setPositions.call(this,o),this},t.prototype.setColors=function(e){for(var r=e.length-3,o=new Float32Array(2*r),s=0;s<r;s+=3)o[2*s]=e[s],o[2*s+1]=e[s+1],o[2*s+2]=e[s+2],o[2*s+3]=e[s+3],o[2*s+4]=e[s+4],o[2*s+5]=e[s+5];return n.prototype.setColors.call(this,o),this},t.prototype.fromLine=function(e){var r=e.geometry;if(r instanceof THREE__namespace.Geometry){var o=new THREE__namespace.BufferGeometry().fromGeometry(r);this.setPositions(o.attributes.position.array)}else r instanceof THREE__namespace.BufferGeometry&&this.setPositions(r.attributes.position.array);return this},t.prototype.copy=function(){return this},t})(LineSegmentsGeometry);Object.assign(LineGeometry.prototype,{isLineGeometry:!0});var circleImageURL="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sHDgwCEMBJZu0AAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAABM5JREFUWMO1V0tPG2cUPZ4Hxh6DazIOrjFNqJs0FIMqWFgWQkatsmvVbtggKlSVRVf5AWz4AWz4AUSKEChll19QJYSXkECuhFxsHjEhxCYm+DWGMZ5HF72DJq4bAzFXurI0M/I5997v3u9cC65vTJVn2lX/xHINQOYSBLTLEuIuCWw4Z3IGAEvf6ASmVHjNzHCXBG4A0AjACsAOwEbO0nsFQBnAGYASAIl+ZRMR7SolMEdsByD09fV5R0ZGgg8ePPjW5/N1iqLYpuu6RZblciKR2I9Go69evnwZnZ+fjwI4IS8AKBIRzeQfJWCANwKwh0KhtrGxsYehUOin1tbW+zzP23ietzY2NnIAoGmaLsuyUiqVyvl8XtrY2NiamZn589mzZxsAUgCOAeQAnFI2tI+VxIjaAeDzoaGh7xYWFuZOTk6OZVk+12uYqqq6JEnn0Wg0OT4+/geAXwGEAdwDIFJQXC1wO4DWR48e/RCPxxclSSroVzRFUbSDg4P848ePFwH8DuAhkWih83TRQWxFOXgAwvDwcOfo6OhvXV1d39tsNtuVBwTDWBwOh1UUxVsMw1hXVlbSdCgNV43uYSvrHg6H24aHh38eHBz85TrgF9FYLHA4HLzH43FvbW2d7u/vG+dANp8FpqIlbd3d3V8Fg8EfBUFw4BONZVmL3+9vHhkZCQL4AoAHgJPK8G+yzC0XDofdoVAo5PP5vkadTBAEtr+/39ff3x8gAp/RPOEqx2qjx+NpvXv3bk9DQ0NDvQgwDIOWlhZrMBj8kgi0UJdxRgYMArzL5XJ7vd57qLPZ7Xamp6fnNgBXtQxcjFuHw+Hyer3t9SYgCAITCAScAJoBNNEY/08GOFVVrfVMv7kMNDntFD1vjIAPrlRN0xjckOm6biFQ3jwNPwDMZrOnqVTqfb3Bi8Wivru7W/VCYkwPlKOjo0IikXh7EwQikYgE4Nw0CfXKDCipVCoTj8df3QABbW1tLUc6oUgkFPMkVACUNjc337148eKvw8PDbJ2jP1taWkoCyNDVXDSECmNSK4qiKNLq6urW8+fPI/UicHx8rD59+jSVy+WOAKSJhKENwFItLtoxk8mwsixzHR0dHe3t7c5PAU+n09rs7OzJkydPYqVSaQfANoDXALIk31S2smU1TWMPDg7K5XKZ7+3t9TudTut1U7+wsFCcmJiIpdPpbQBxADsAknQWymYCOukBHYCuKApisdhpMpnURFEU79y503TVyKenpzOTk5M7e3t7MQKPV0Zv1gNm+awB0MvlshqLxfLb29uyJElWURSbXC4XXyvqxcXFs6mpqeTc3Nzu3t7e3wQcA7BPZ8Cov1pNlJplmQtAG8MwHV6v95tAINA5MDBwPxAIuLu6upr8fr/VAN3c3JQjkcjZ+vp6fnl5+d2bN29SuVzuNYAEpf01CdRChUL+X1VskHACuA3Ay3Fcu9vt7nA6nZ7m5uYWQRCaNE3jVVW15PP580KhIGUymWw2m00DOAJwSP4WwPtq4LX2Ao6USxNlQyS/RcQcdLGwlNIz6vEMAaZpNzCk2Pll94LK/cDYimxERiBwG10sxjgvEZBE0UpE6vxj+0Ct5bTaXthgEhRmja8QWNkkPGsuIpfdjpkK+cZUWTC0KredVmtD/gdlSl6EG4AMvQAAAABJRU5ErkJggg==",DEFAULT_COLOR=14467195,POINT_SIZE=8,DEFAULT_LINEWIDTH=2,DEFAULT_DASHSCALE=20,sharedCircleTexture=null,FiveLine=(function(n){__extends(t,n);function t(e,r){e===void 0&&(e=new THREE__namespace.Vector3),r===void 0&&(r=new THREE__namespace.Vector3);var o=n.call(this)||this;o.type="FiveLine",o.needsRender=!0;var s=new LineGeometry,u=new LineMaterial({color:DEFAULT_COLOR,linewidth:DEFAULT_LINEWIDTH,dashScale:DEFAULT_DASHSCALE,dashed:!1});o.line=new Line2(s,u);var l=new THREE__namespace.BufferGeometry,c=new THREE__namespace.PointsMaterial({color:DEFAULT_COLOR,size:POINT_SIZE,map:sharedCircleTexture||(sharedCircleTexture=new THREE__namespace.TextureLoader().load(circleImageURL)),sizeAttenuation:!1,transparent:!0});return o.points=new THREE__namespace.Points(l,c),o.points.renderOrder=11,o.points.frustumCulled=!1,o.setPoints(e,r),o.add(o.line,o.points),o}return Object.defineProperty(t,"version",{get:function(){return"6.6.0-alpha.5"},enumerable:!1,configurable:!0}),t.prototype.setPoints=function(e,r){var o=[].concat(e.toArray(),r.toArray());this.points.geometry.setAttribute("position",new THREE__namespace.BufferAttribute(new Float32Array(o),3)),this.line.geometry.setPositions(o),this.line.computeLineDistances(),this.needsRender=!0},t.prototype.getPoints=function(){var e=this.points.geometry.attributes.position.array;return[new THREE__namespace.Vector3(e[0],e[1],e[2]),new THREE__namespace.Vector3(e[3],e[4],e[5])]},t.prototype.setMaterial=function(e){var r=this.line.material;for(var o in e)if(e.hasOwnProperty(o)){var s=e[o];o==="dashed"?(r.dashed=s,s?r.defines.USE_DASH="":delete r.defines.USE_DASH,r.needsUpdate=!0):r[o]=e[o]}this.needsRender=!0},t.prototype.setResolution=function(e,r){var o=this.line.material.resolution;(o.x!==e||o.y!==r)&&(o.set(e,r),this.needsRender=!0)},t})(THREE__namespace.Object3D);Object.assign(FiveLine.prototype,{isFiveLine:!0});var Constants={ComponentState:Object.freeze({DEFAULT:"default",TOUCHED:"touched",PRESSED:"pressed"}),ComponentProperty:Object.freeze({BUTTON:"button",X_AXIS:"xAxis",Y_AXIS:"yAxis",STATE:"state"}),ComponentType:Object.freeze({TRIGGER:"trigger",SQUEEZE:"squeeze",TOUCHPAD:"touchpad",THUMBSTICK:"thumbstick",BUTTON:"button"}),ButtonTouchThreshold:.05,AxisTouchThreshold:.1,VisualResponseProperty:Object.freeze({TRANSFORM:"transform",VISIBILITY:"visibility"})};function fetchJsonFile(n){return __awaiter(this,void 0,void 0,function(){var t;return __generator(this,function(e){switch(e.label){case 0:return[4,fetch(n)];case 1:if(t=e.sent(),t.ok)return[2,t.json()];throw new Error(t.statusText)}})})}function fetchProfilesList(n){return __awaiter(this,void 0,void 0,function(){var t,e;return __generator(this,function(r){switch(r.label){case 0:if(!n)throw new Error("No basePath supplied");return t="profilesList.json",[4,fetchJsonFile("".concat(n,"/").concat(t))];case 1:return e=r.sent(),[2,e]}})})}function fetchProfile(n,t){return __awaiter(this,arguments,void 0,function(e,r,o,s){var u,l,c,f,p,d;return o===void 0&&(o=null),s===void 0&&(s=!0),__generator(this,function(h){switch(h.label){case 0:if(!e)throw new Error("No xrInputSource supplied");if(!r)throw new Error("No basePath supplied");return[4,fetchProfilesList(r)];case 1:if(u=h.sent(),e.profiles.some(function(g){var A=u[g];return A&&(l={profileId:g,profilePath:"".concat(r,"/").concat(A.path),deprecated:!!A.deprecated}),!!l}),!l){if(!o)throw new Error("No matching profile name found");if(c=u[o],!c)throw new Error('No matching profile name found and default profile "'.concat(o,'" missing.'));l={profileId:o,profilePath:"".concat(r,"/").concat(c.path),deprecated:!!c.deprecated}}return[4,fetchJsonFile(l.profilePath)];case 2:if(f=h.sent(),s){if(d=void 0,d=f.layouts[e.handedness],!d)throw new Error("No matching handedness, ".concat(e.handedness,", in profile ").concat(l.profileId));d.assetPath&&(p=l.profilePath.replace("profile.json",d.assetPath))}return[2,{profile:f,assetPath:p}]}})})}var defaultComponentValues={xAxis:0,yAxis:0,button:0,state:Constants.ComponentState.DEFAULT};function normalizeAxes(n,t){n===void 0&&(n=0),t===void 0&&(t=0);var e=n,r=t,o=Math.sqrt(n*n+t*t);if(o>1){var s=Math.atan2(t,n);e=Math.cos(s),r=Math.sin(s)}var u={normalizedXAxis:e*.5+.5,normalizedYAxis:r*.5+.5};return u}var VisualResponse=(function(){function n(t){this.componentProperty=t.componentProperty,this.states=t.states,this.valueNodeName=t.valueNodeName,this.valueNodeProperty=t.valueNodeProperty,this.valueNodeProperty===Constants.VisualResponseProperty.TRANSFORM&&(this.minNodeName=t.minNodeName,this.maxNodeName=t.maxNodeName),this.value=0,this.updateFromComponent(defaultComponentValues)}return n.prototype.updateFromComponent=function(t){var e=t.xAxis,r=t.yAxis,o=t.button,s=t.state,u=normalizeAxes(e,r),l=u.normalizedXAxis,c=u.normalizedYAxis;switch(this.componentProperty){case Constants.ComponentProperty.X_AXIS:this.value=this.states.includes(s)?l:.5;break;case Constants.ComponentProperty.Y_AXIS:this.value=this.states.includes(s)?c:.5;break;case Constants.ComponentProperty.BUTTON:this.value=this.states.includes(s)?o:0;break;case Constants.ComponentProperty.STATE:this.valueNodeProperty===Constants.VisualResponseProperty.VISIBILITY?this.value=this.states.includes(s):this.value=this.states.includes(s)?1:0;break;default:throw new Error("Unexpected visualResponse componentProperty ".concat(this.componentProperty))}},n})(),Component=(function(){function n(t,e){var r=this;if(!t||!e||!e.visualResponses||!e.gamepadIndices||Object.keys(e.gamepadIndices).length===0)throw new Error("Invalid arguments supplied");this.id=t,this.type=e.type,this.rootNodeName=e.rootNodeName,this.touchPointNodeName=e.touchPointNodeName,this.visualResponses={},Object.keys(e.visualResponses).forEach(function(o){var s=new VisualResponse(e.visualResponses[o]);r.visualResponses[o]=s}),this.gamepadIndices=Object.assign({},e.gamepadIndices),this.values={state:Constants.ComponentState.DEFAULT,button:this.gamepadIndices.button!==void 0?0:void 0,xAxis:this.gamepadIndices.xAxis!==void 0?0:void 0,yAxis:this.gamepadIndices.yAxis!==void 0?0:void 0}}return Object.defineProperty(n.prototype,"data",{get:function(){var t=__assign({id:this.id},this.values);return t},enumerable:!1,configurable:!0}),n.prototype.updateFromGamepad=function(t){var e=this;if(this.values.state=Constants.ComponentState.DEFAULT,this.gamepadIndices.button!==void 0&&t.buttons.length>this.gamepadIndices.button){var r=t.buttons[this.gamepadIndices.button];this.values.button=r.value,this.values.button=this.values.button<0?0:this.values.button,this.values.button=this.values.button>1?1:this.values.button,r.pressed||this.values.button===1?this.values.state=Constants.ComponentState.PRESSED:(r.touched||this.values.button>Constants.ButtonTouchThreshold)&&(this.values.state=Constants.ComponentState.TOUCHED)}this.gamepadIndices.xAxis!==void 0&&t.axes.length>this.gamepadIndices.xAxis&&(this.values.xAxis=t.axes[this.gamepadIndices.xAxis],this.values.xAxis=this.values.xAxis<-1?-1:this.values.xAxis,this.values.xAxis=this.values.xAxis>1?1:this.values.xAxis,this.values.state===Constants.ComponentState.DEFAULT&&Math.abs(this.values.xAxis)>Constants.AxisTouchThreshold&&(this.values.state=Constants.ComponentState.TOUCHED)),this.gamepadIndices.yAxis!==void 0&&t.axes.length>this.gamepadIndices.yAxis&&(this.values.yAxis=t.axes[this.gamepadIndices.yAxis],this.values.yAxis=this.values.yAxis<-1?-1:this.values.yAxis,this.values.yAxis=this.values.yAxis>1?1:this.values.yAxis,this.values.state===Constants.ComponentState.DEFAULT&&Math.abs(this.values.yAxis)>Constants.AxisTouchThreshold&&(this.values.state=Constants.ComponentState.TOUCHED)),Object.values(this.visualResponses).forEach(function(o){o.updateFromComponent(e.values)})},n})(),MotionController=(function(){function n(t,e,r){var o=this;if(!t)throw new Error("No xrInputSource supplied");if(!e)throw new Error("No profile supplied");this.xrInputSource=t,this.assetUrl=r,this.id=e.profileId,this.layoutDescription=e.layouts[t.handedness],this.components={},Object.keys(this.layoutDescription.components).forEach(function(s){var u=o.layoutDescription.components[s];o.components[s]=new Component(s,u)}),this.updateFromGamepad()}return Object.defineProperty(n.prototype,"gripSpace",{get:function(){return this.xrInputSource.gripSpace},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"targetRaySpace",{get:function(){return this.xrInputSource.targetRaySpace},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"data",{get:function(){var t=[];return Object.values(this.components).forEach(function(e){t.push(e.data)}),t},enumerable:!1,configurable:!0}),n.prototype.updateFromGamepad=function(){var t=this;Object.values(this.components).forEach(function(e){e.updateFromGamepad(t.xrInputSource.gamepad)})},n})(),DEFAULT_PROFILES_PATH="https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles",DEFAULT_PROFILE="generic-trigger",XRControllerModel=(function(n){__extends(t,n);function t(){var e=n.call(this)||this;return e.motionController=null,e.envMap=null,e}return t.prototype.setEnvironmentMap=function(e){var r=this;return this.envMap==e?this:(this.envMap=e,this.traverse(function(o){o instanceof THREE__namespace.Mesh&&o.isMesh&&(o.material.envMap=r.envMap,o.material.needsUpdate=!0)}),this)},t.prototype.updateMatrixWorld=function(e){n.prototype.updateMatrixWorld.call(this,e),this.motionController&&(this.motionController.updateFromGamepad(),Object.values(this.motionController.components).forEach(function(r){Object.values(r.visualResponses).forEach(function(o){var s=o.valueNode,u=o.minNode,l=o.maxNode,c=o.value,f=o.valueNodeProperty;s&&(f===Constants.VisualResponseProperty.VISIBILITY?s.visible=c:f===Constants.VisualResponseProperty.TRANSFORM&&(s.quaternion.copy(u.quaternion).slerp(l.quaternion,c),s.position.lerpVectors(u.position,l.position,c)))})}))},t})(THREE.Object3D);function findNodes(n,t){Object.values(n.components).forEach(function(e){var r=e.type,o=e.touchPointNodeName,s=e.visualResponses;if(r===Constants.ComponentType.TOUCHPAD)if(e.touchPointNode=t.getObjectByName(o),e.touchPointNode){var u=new THREE.SphereGeometry(.001),l=new THREE.MeshBasicMaterial({color:255}),c=new THREE.Mesh(u,l);e.touchPointNode.add(c)}else console.warn("Could not find touch dot, ".concat(e.touchPointNodeName,", in touchpad component ").concat(e.id));Object.values(s).forEach(function(f){var p=f.valueNodeName,d=f.minNodeName,h=f.maxNodeName,g=f.valueNodeProperty;if(g===Constants.VisualResponseProperty.TRANSFORM){if(f.minNode=t.getObjectByName(d),f.maxNode=t.getObjectByName(h),!f.minNode){console.warn("Could not find ".concat(d," in the model"));return}if(!f.maxNode){console.warn("Could not find ".concat(h," in the model"));return}}f.valueNode=t.getObjectByName(p),f.valueNode||console.warn("Could not find ".concat(p," in the model"))})})}function addAssetSceneToControllerModel(n,t){findNodes(n.motionController,t),n.envMap&&t.traverse(function(e){e instanceof THREE__namespace.Mesh&&e.isMesh&&(e.material.envMap=n.envMap,e.material.needsUpdate=!0)}),n.add(t)}var XRControllerModelFactory=(function(){function n(t){t===void 0&&(t=null),this.gltfLoader=t,this.path=DEFAULT_PROFILES_PATH,this._assetCache={}}return n.prototype.createControllerModel=function(t){var e=this,r=new XRControllerModel,o=null;return t.addEventListener("connected",function(s){var u=s.data;u.targetRayMode!=="tracked-pointer"||!u.gamepad||fetchProfile(u,e.path,DEFAULT_PROFILE).then(function(l){var c=l.profile,f=l.assetPath;r.motionController=new MotionController(u,c,f);var p=e._assetCache[r.motionController.assetUrl];if(p)o=p.scene.clone(),addAssetSceneToControllerModel(r,o);else{if(!e.gltfLoader)throw new Error("GLTFLoader not set.");e.gltfLoader.load(r.motionController.assetUrl,function(d){e._assetCache[r.motionController.assetUrl]=d,o=d.scene.clone(),addAssetSceneToControllerModel(r,o)})}}).catch(function(l){console.warn(l)})}),t.addEventListener("disconnected",function(){r.motionController=null,r.remove(o),o=null}),r},n})(),defaultXRPanoramaControllerInitArgs=__assign({},omit(defaultPanoramaControllerCustomInitArgs,["maxLatitude","minLatitude"]));function mapPanoResource(n,t){return n}var CONTROLLER_EVNET_DELTA_TIME=300,scratchRaycaster=new THREE__namespace.Raycaster,scratchVector3=new THREE__namespace.Vector3,XRPanoramaController=(function(n){__extends(t,n);function t(e){var r=n.call(this,e)||this;r.xrManager=new XRManager(r.renderer,r.renderer.getContext(),{onSessionStart:function(c){r.emit("xr.session.start",createEvent("xr.session.start",{session:c,machineType:r.xrManager.machineType}))},onSessionEnd:function(){r.emit("xr.session.end",createEvent("xr.session.end",{session:null,machineType:r.xrManager.machineType}))}}),r.xrControllerRay={left:new THREE__namespace.Raycaster,right:new THREE__namespace.Raycaster},r.xrControllerRay.left.params.Points={threshold:.1},r.xrControllerRay.left.firstHitOnly=!0,r.xrControllerRay.left.floorIndex=-1,r.xrControllerRay.right.params.Points={threshold:.1},r.xrControllerRay.right.firstHitOnly=!0,r.xrControllerRay.right.floorIndex=-1,r.gazeRay=null,r.pointerLines={left:new FiveLine,right:new FiveLine},r.pointerLines.left.visible=!1,r.pointerLines.right.visible=!0,r.pointerLines.left.setMaterial({color:new THREE__namespace.Vector3(1,1,1)}),r.pointerLines.left.points.material.depthTest=!1,r.pointerLines.right.setMaterial({color:new THREE__namespace.Vector3(1,1,1)}),r.pointerLines.right.points.material.depthTest=!1,r.controllerWrappers=[new THREE__namespace.Group,new THREE__namespace.Group];var o=r.xrManager.getController(0);r.controllerWrappers[0].add(o);var s=r.xrManager.getController(1);r.controllerWrappers[1].add(s);var u=new XRControllerModelFactory;u.gltfLoader={load:function(c,f){internalFetcher.ajax(c,{responseType:"arraybuffer"}).then(function(p){var d;return parseGltf(p.body,{resourcePath:c.slice(0,c.lastIndexOf("/")+1),search:(d=c.split("?")[1])!==null&&d!==void 0?d:"",fetcher:internalFetcher})}).then(function(p){return f(p)})}},(r.xrManager.machineType==="Oculus"||r.xrManager.machineType==="Pico")&&r.scene.add(r.pointerLines.left,r.pointerLines.right,r.controllerWrappers[0],r.controllerWrappers[1]),r.panoResources={},r.panoResources[r.locationMotion.keyframes[0].key=r.locationMotion.keyframes[1].key=createUuid()]={panoId:panoStringify(r.currentPano),leftPanoPicture:null,position:r.camera.pose.offset.clone(),effect:"fade",fixCameraTransform:new THREE__namespace.Matrix4},r.parallaxCameraMatrixs=[];var l=AnimationFrameLoop.shared.getContext();return l?(r.on("xr.session.end",function(){r.scene.remove(r.pointerLines.left,r.pointerLines.right)}),r.xrManager.setSession(l),r.on("xr.session.start",function(){var c=r.xrManager.getControllerGrip(0);c.add(u.createControllerModel(c)),r.controllerWrappers[0].add(c);var f=r.xrManager.getControllerGrip(1);f.add(u.createControllerModel(f)),r.controllerWrappers[1].add(f)}),r.xrHandleState={LeftAxesUp:{touchStartTime:0,touchStart:!1},LeftAxesDown:{touchStartTime:0,touchStart:!1},LeftAxesLeft:{touchStartTime:0,touchStart:!1},LeftAxesRight:{touchStartTime:0,touchStart:!1},LeftTrigger:{touchStartTime:0,touchStart:!1},LeftPinch:{touchStartTime:0,touchStart:!1},RightAxesUp:{touchStartTime:0,touchStart:!1},RightAxesDown:{touchStartTime:0,touchStart:!1},RightAxesLeft:{touchStartTime:0,touchStart:!1},RightAxesRight:{touchStartTime:0,touchStart:!1},RightTrigger:{touchStartTime:0,touchStart:!1},RightPinch:{touchStartTime:0,touchStart:!1},Y:{touchStartTime:0,touchStart:!1},X:{touchStartTime:0,touchStart:!1},A:{touchStartTime:0,touchStart:!1},B:{touchStartTime:0,touchStart:!1}},r.xrManager.machineType==="VP"&&r.initHandEvent(),r):(console.error("获取session失败,请退出重试"),r)}return t.parseArgs=function(e){if(e instanceof t)return e;var r=__assign(__assign({},e),{maxLatitude:Math.PI/2,minLatitude:-Math.PI/2});return n.parseArgs.call(this,r)},t.initAnimationEndState=function(e){var r=this.parseArgs(e),o=n.initAnimationEndState.call(this,r);return __assign(__assign({},o),{mode:"XRPanorama"})},t.prototype.updateConfiguration=function(e){return n.prototype.updateConfiguration.call(this,__assign(__assign({},e),{maxLatitude:Math.PI/2,minLatitude:-Math.PI/2}))},t.prototype.moveToPano=function(e,r,o){var s=this,u,l,c=(u=r.effect)!==null&&u!==void 0?u:"fade";this.userAction=o,this.stopMomentumMovement();var f=panoStringify(e),p=this.works.getObserver(e);if(!p)throw new Error("Invalid PanoIndex");getImageSizeFromURL(p.images.up),this.imageOptions.size;var d=this.imageOptions.transform,h=function(R,w){return mapPanoResource(applyImageURLOptions(R,d,w))},g=__assign({key:"pano.".concat(f)},pick(this.imageOptions,["format","size","quality"])),A={right:p.images.work.getURL(p.images.right),left:p.images.work.getURL(p.images.left),up:p.images.work.getURL(p.images.up),down:p.images.work.getURL(p.images.down),front:p.images.work.getURL(p.images.front),back:p.images.work.getURL(p.images.back)},m="pano:"+jsonHash([A,g,d]);if(this.pendingTextureTask){if(this.pendingTextureTask.hash===m)return;var E=this.pendingTextureTask.panoId;(l=this.panoMeshes.get(E))===null||l===void 0||l.setProgress(0),this.emit("pano.texture.abort",createEvent("pano.texture.abort",{error:null,progress:0,meta:null,pano:e}))}var v=this.modelScene.parameter.resolveValue(),y=v.pano0,b=v.pano1,_;if((y==null?void 0:y.map.name)===m?_=y:(b==null?void 0:b.map.name)===m&&(_=b),_){var T={panoId:f,effect:c,leftPanoPicture:{panoId:_.panoId,map:_.map,mapSize:_.mapSize,matrix:p.matrix.clone().premultiply(p.work.transform),zoom:1},position:p.position.clone().applyMatrix4(p.work.transform),fixCameraTransform:new THREE__namespace.Matrix4};this.doMoveToPano(e,T,r);return}var S="move-to-pano-"+f;this.pending.add(S),this.pendingTextureTask={panoId:f,hash:m,onLoad:function(R){var w;s.pending.delete(S);var M=R.body;if(s.destroyed)M.dispose();else{M.name=m;var B=Array.isArray(M.image)?M.image[0]:M.image,C=(w=B==null?void 0:B.width)!==null&&w!==void 0?w:2048,P={panoId:f,effect:c,leftPanoPicture:{panoId:f,map:M,mapSize:C,matrix:p.matrix.clone(),zoom:1},position:p.position.clone(),fixCameraTransform:new THREE__namespace.Matrix4};s.doMoveToPano(e,P,r)}},onError:function(R){s.pending.delete(S);var w=__assign(__assign(__assign({},e),{mode:s.mode}),clonePose(s.camera.pose));s.emit("pano.error",createEvent("pano.error",{error:R,userAction:s.userAction,options:r,prevPano:s.currentPano,progress:0,state:w})),s.emit("pano.cancel",createEvent("pano.cancel",{error:null,userAction:s.userAction,options:r,prevPano:s.currentPano,progress:0,state:w})),r.moveCancelCallback&&r.moveCancelCallback()}},this.textureLoader.loadCubeTexture(A,{imageURL:{transform:h,options:g},format:THREE__namespace.RGBAFormat,fetcher:getFetcher(p.work)},void 0,void 0,function(R){var w,M;((w=s.pendingTextureTask)===null||w===void 0?void 0:w.hash)===m&&((M=s.panoMeshes.get(f))===null||M===void 0||M.setProgress(R)),s.emit("pano.texture.progress",createEvent("pano.texture.progress",{error:null,progress:R,meta:null,pano:e}))},this.renderer).then(function(R){var w,M;((w=s.pendingTextureTask)===null||w===void 0?void 0:w.hash)===m?(s.pendingTextureTask.onLoad(R),(M=s.panoMeshes.get(f))===null||M===void 0||M.setProgress(0),delete s.pendingTextureTask,s.emit("pano.texture.success",createEvent("pano.texture.success",{error:null,progress:1,meta:R.meta,pano:e}))):R.body.dispose()}).catch(function(R){var w,M;((w=s.pendingTextureTask)===null||w===void 0?void 0:w.hash)===m&&(s.pendingTextureTask.onError(R),(M=s.panoMeshes.get(f))===null||M===void 0||M.setProgress(0),delete s.pendingTextureTask,s.emit("pano.texture.error",createEvent("pano.texture.error",{error:R,progress:0,meta:null,pano:e})),s.emit("error",R))}),this.emit("pano.texture.load",createEvent("pano.texture.load",{error:null,progress:0,meta:null,pano:e}))},t.prototype.doMoveToPano=function(e,r,o){var s=this,u,l,c,f,p,d,h,g,A,m;o===void 0&&(o={});var E=now(),v=createUuid();this.panoResources[v]=r;var y=1,b,_,T;if(this.locationMotion.ended){var S=this.locationMotion.getKeyFrameSegment(E);S[0];var R=S[1],w=this.locationMotion.value,M=this.panoResourceFromLocationMotionKeyframe(R).position,B=r.position;b=Math.max(M.distanceTo(B),y),_=[{key:R.key,progress:0,value:__assign(__assign({},w),{count:0})},{key:v,progress:1,value:{distance:0,count:1}}],T=0}else{var C=this.locationMotion.getKeyFrameSegment(E),P=C[0],R=C[1],w=this.locationMotion.value,F=this.panoResourceFromLocationMotionKeyframe(P).position,M=this.panoResourceFromLocationMotionKeyframe(R).position,B=r.position,L=R.value.count-w.count,O=Math.max(F.distanceTo(M),y)*L,k=Math.max(M.distanceTo(B),y);b=O+k,_=[{key:P.key,progress:0,value:__assign({},w)},{key:R.key,progress:O/b,value:R.value},{key:v,progress:1,value:{count:R.value.count+1,distance:0}}];var D=this.locationMotionKeyframesLength(this.locationMotion.keyframes),J=this.locationMotionKeyframesLength(_);T=this.locationMotion.getProgressVelocity(E)*D/J}var G=r.effect==="instant"?0:this.calculateMovingDuration(o.duration,r.effect==="fly"?b:0),U={longitude:o.longitude,latitude:o.latitude,fov:o.fov},z=__assign(__assign({},e),{mode:this.mode,longitude:(u=U.longitude)!==null&&u!==void 0?u:this.camera.pose.longitude,latitude:(l=U.latitude)!==null&&l!==void 0?l:this.camera.pose.latitude,fov:(c=U.fov)!==null&&c!==void 0?c:this.camera.pose.fov,offset:r.position.clone(),distance:0}),q=this.currentPano;if(this.emit("pano.moveTo",createEvent("pano.moveTo",{options:o,prevPano:q,progress:0,state:z,userAction:this.userAction,error:null})),o.moveStartCallback&&o.moveStartCallback(z),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=noop,this.videoTexture.needsUpdate=!0),this.panoVideo.setMaterial(null),r.effect==="fly")this.cameraMotion.set(U,G).catch(noop);else{var j=coordinatesToVector({longitude:this.cameraMotion.value.longitude,latitude:this.cameraMotion.value.latitude}),K=coordinatesToVector({longitude:(f=U.longitude)!==null&&f!==void 0?f:this.cameraMotion.value.longitude,latitude:(p=U.latitude)!==null&&p!==void 0?p:this.cameraMotion.value.latitude}),Y=new THREE__namespace.Object3D;Y.lookAt(j);var X=new THREE__namespace.Matrix4().makeRotationFromQuaternion(Y.quaternion);Y.lookAt(K);var Q=new THREE__namespace.Matrix4().makeRotationFromQuaternion(Y.quaternion),W=new THREE__namespace.Matrix4().getInverse(X).premultiply(Q),$=this.cameraMotion.value.fov,ie=(d=U.fov)!==null&&d!==void 0?d:this.cameraMotion.value.fov,ee=1;r.effect==="zoomin"?ee=1.5:r.effect==="zoomout"&&(ee=.4);for(var ne=ie*ee,te=0;te<_.length-1;te++){var pe=_[te].key;if(pe){var oe=this.panoResources[pe];oe&&(oe.fixCameraTransform.copy(W),oe.leftPanoPicture&&(oe.leftPanoPicture.zoom=Math.tan(ne/2/180*Math.PI)/Math.tan($/2/180*Math.PI)))}}this.cameraMotion.setKeyframes([{progress:0,value:{longitude:this.cameraMotion.value.longitude,latitude:this.cameraMotion.value.latitude,fov:this.cameraMotion.value.fov}},{progress:0,value:{longitude:(h=U.longitude)!==null&&h!==void 0?h:this.cameraMotion.value.longitude,latitude:(g=U.latitude)!==null&&g!==void 0?g:this.cameraMotion.value.latitude,fov:ne}},{progress:1,value:{longitude:(A=U.longitude)!==null&&A!==void 0?A:this.cameraMotion.value.longitude,latitude:(m=U.latitude)!==null&&m!==void 0?m:this.cameraMotion.value.latitude,fov:ie}}],G).catch(noop)}var de=this.locationMotion.setKeyframes(_,G,T);de.then(function(){for(var me=0,be=s.modelScene.children;me<be.length;me++){var _e=be[me];_e instanceof Model&&_e.show()}var le=__assign(__assign({},e),{mode:s.mode,longitude:s.camera.pose.longitude,latitude:s.camera.pose.latitude,fov:s.camera.pose.fov,offset:s.camera.pose.offset.clone(),distance:0});s.emit("pano.arrived",createEvent("pano.arrived",{options:o,prevPano:q,progress:1,state:le,userAction:s.userAction,error:null})),o.moveEndCallback&&o.moveEndCallback(le);var fe=s.works.getObserver(s.currentPano);if(fe&&fe.video&&s.videoTexture&&s.videoTexture.image instanceof HTMLVideoElement){var re={map:s.videoTexture,size:fe.video.size.clone(),matrix:fe.video.matrix.clone(),panoMatrix:fe.matrix.clone().premultiply(fe.work.transform),alpha:1},ue=createUuid(),ve=s.videoTexture.image;ve.setAttribute("uuid",ue),canplayVideo().then(function(ye){ye&&fe.video&&ve.getAttribute("uuid")===ue&&(ve.oncanplay=function(){ve.oncanplay=noop,ve.play()},ve.ontimeupdate=function(){ve.currentTime>.5&&(ve.ontimeupdate=noop,s.panoVideo.setMaterial(re))},ve.src=fe.video.source)}).catch((function(){ve.removeAttribute("uuid")}))}},function(){s.emit("pano.cancel",createEvent("pano.cancel",{options:o,prevPano:q,progress:0,state:z,userAction:s.userAction,error:null})),o.moveCancelCallback&&o.moveCancelCallback()})},t.prototype.checkSelectedPano=function(e){var r=this,o;this.stopMomentumMovement(),this.camera.getDirection(new THREE__namespace.Vector3).setY(0);var s=null,u=this.works.getObserver(this.currentPano);if(!u)return null;var l=u.work.observers,c=u.accessibleNodes.filter(function(T){if(T===r.currentPano.panoIndex&&u.work.workCode===r.currentPano.workCode)return!1;var S=l[T];if(!S)return!1;var R=scratchVector3.copy(S.position).applyMatrix4(S.work.transform);return R.distanceTo(r.camera.position)>r.maxAccessibleDistance?!1:S.loadable||S.active}),f=this.modelScene.intersectRaycaster(e)[0];if(f){var p=arrayMin(c,function(T){var S=l[T];if(!S)return 1/0;var R=scratchVector3.copy(S.standingPosition).applyMatrix4(S.work.transform);return R.distanceTo(f.point)},!0),d=p[0],h=p[1];typeof d=="number"&&h<this.panoTapTriggerRadius&&(s=(o=l[d])!==null&&o!==void 0?o:null)}if(isNil(s)){var g=this.getForwardObserverOrNot(this.xrManager.cameraVR,e);g&&(s=g)}for(var A=0,m=this.locationMotion.keyframes;A<m.length;A++){var E=m[A],v=this.panoResourceFromLocationMotionKeyframe(E);if(!(E.progress<this.locationMotion.progress)&&s){var y=panoStringify({panoIndex:s.panoIndex,workCode:s.work.workCode});if(v.panoId===y){s=null;break}}}if(isNil(s))return this.locationMotion.ended===!0&&this.cameraBounce(),null;if(!s.active){var y=panoStringify({panoIndex:s.panoIndex,workCode:s.work.workCode}),b=this.panoMeshes.get(y);b&&(b.setDisabled(!1),b.setLoading(!0))}var _={workCode:s.work.workCode,panoIndex:s.panoIndex,mode:this.mode,longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov,distance:0,offset:s?s.position.clone():new THREE__namespace.Vector3};return this.emit("pano.select",createEvent("pano.select",{prevPano:this.currentPano,state:_,userAction:!0,options:{},progress:0,error:null})),s&&s.active?(this.emit("pano.request",createEvent("pano.request",{userAction:!0,prevPano:this.currentPano,progress:0,state:_,options:{},error:null})),{workCode:s.work.workCode,panoIndex:s.panoIndex}):null},t.prototype.destroy=function(){n.prototype.destroy.call(this)},t.prototype.isReady=function(){return!1},t.prototype.updateCamera=function(e,r,o){return Promise.resolve()},t.prototype.updateCameraWithKeyframes=function(e,r,o){return Promise.resolve()},t.prototype.updateTime=function(e,r){for(var o=this,s,u,l,c,f,p,d,h,g,A=[],m=2;m<arguments.length;m++)A[m-2]=arguments[m];this.userAction=!0;var E={},v={},y=this.locationMotion.keyframes[0],b=this.locationMotion.keyframes[this.locationMotion.keyframes.length-1],_=this.locationMotion.getKeyFrameSegment(e),T=_[0],S=_[1],R=this.panoResourceFromLocationMotionKeyframe(T),w=this.panoResourceFromLocationMotionKeyframe(S),M=this.panoResourceFromLocationMotionKeyframe(y),B=this.panoResourceFromLocationMotionKeyframe(b),C=!1;if(this.cameraMotion.ended===!1&&(this.cameraMotion.update(e),v.fov=this.cameraMotion.value.fov),this.modelAlphaMotion.ended===!1&&(this.modelAlphaMotion.update(e),E.modelAlpha=this.modelAlphaMotion.value.modelAlpha),this.perspToOrthoMotion.ended===!1&&(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(clamp$1(this.perspToOrthoMotion.value.perspToOrtho,0,1))),this.locationMotion.ended===!1){this.locationMotion.update(e);var P=this.locationMotion.getKeyFrameSegment(e);P[0];var F=P[1],L=new THREE__namespace.Vector3().copy(R.position),O=new THREE__namespace.Vector3().copy(w.position),k=this.locationMotion.value.count-F.value.count+1;if(E.progress=k,w.leftPanoPicture&&(k<1?R.leftPanoPicture&&(E.pano0=R.leftPanoPicture):E.pano0=w.leftPanoPicture,E.pano1=w.leftPanoPicture),w.effect==="montage"?E.transition="BLACK":w.effect==="spread"?E.transition="SPREAD":E.transition="FADE",(w.effect==="zoomin"||w.effect==="zoomout")&&(E.progress=Math.pow(k,3)),k<1&&w.effect!=="fly"){if(E.pano0&&R.leftPanoPicture){var D={panoId:E.pano0.panoId,map:E.pano0.map,mapSize:E.pano0.mapSize,zoom:E.pano0.zoom,matrix:R.leftPanoPicture.matrix.clone().setPosition(w.position)},J=this.panoPictureObserverMap.get(E.pano0);J&&this.panoPictureObserverMap.set(D,J),E.pano0=D}L.copy(O),C=!0}v.distance=this.locationMotion.value.distance,v.offset=new THREE__namespace.Vector3(L.x+(O.x-L.x)*k,L.y+(O.y-L.y)*k,L.z+(O.z-L.z)*k);for(var G=[],U=[],z=0,q=this.locationMotion.keyframes;z<q.length;z++){var j=q[z],K=j.key,Y=j.progress;K!==void 0&&(G.push(K),Y>this.locationMotion.progress&&U.push(K))}for(var X=0,Q=Object.keys(this.panoResources);X<Q.length;X++){var W=Q[X];if(!(U.indexOf(W)>=0)){var $=this.panoResources[W];if($.leftPanoPicture){var ie=$.leftPanoPicture.map;if(ie){if(ie===((s=E.pano0)===null||s===void 0?void 0:s.map)||ie===((u=E.pano1)===null||u===void 0?void 0:u.map))continue;ie.dispose(),$.leftPanoPicture=null}}G.indexOf(W)>=0||delete this.panoResources[W]}}var ee=panoParse(w.panoId);ee!==this.currentPano&&(this.currentPano=ee,this.accessibleObserverFloorCheckCount=0),this.emit("pano.moving",createEvent("pano.moving",{userAction:this.userAction,prevPano:panoParse(M.panoId),state:__assign(__assign(__assign(__assign({},panoParse(B.panoId)),{mode:this.mode}),clonePose(this.camera.pose)),v),options:{},progress:this.locationMotion.progress,error:null}))}this.camera.setFromPose(v),this.xrManager.cameraVR.projectionMatrix.copy(this.camera.projectionMatrix),this.xrManager.cameraVR.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),this.xrManager.cameraVR.matrix.copy(this.camera.matrix),this.xrManager.cameraVR.position.copy(this.camera.position),this.xrManager.cameraVR.quaternion.copy(this.camera.quaternion),this.xrManager.cameraVR.scale.copy(this.camera.scale),this.xrManager.cameraVR.matrixAutoUpdate=!1,this.xrManager.cameraVR.matrixWorld.copy(this.camera.matrixWorld);var ne=A,te=ne[1],pe=new THREE__namespace.Vector3(0,0,0),oe=new THREE__namespace.Vector2().copy(this.camera.resolution);if(te&&this.xrManager.session&&this.xrManager.referenceSpace&&this.xrManager.session.renderState.baseLayer){var de=this.xrManager.cameraVR,me=this.xrManager.referenceSpace,be=this.xrManager.session.renderState.baseLayer,_e=te.getViewerPose(me),le=(l=_e==null?void 0:_e.views)!==null&&l!==void 0?l:[];this.renderer.setFramebuffer(be.framebuffer);for(var fe=0;fe<le.length;fe++){var re=le[fe],ue=de.cameras[fe],ve=be.getViewport(re);ve&&(ue.projectionMatrix.fromArray(re.projectionMatrix),ue.projectionMatrixInverse.getInverse(ue.projectionMatrix),ue.matrix.fromArray(re.transform.matrix),ue.matrix.setPosition(this.camera.position),ue.matrix.decompose(ue.position,ue.quaternion,ue.scale),ue.matrixWorld.copy(ue.matrix),ue.matrixWorldInverse.getInverse(ue.matrixWorld),ue.matrixAutoUpdate=!1,pe.copy(ue.position),ue.viewport.set(ve.x,ve.y,ve.width,ve.height),oe.set(ve.width,ve.height))}if(this.xrManager.setProjectionFromUnion(this.xrManager.cameraVR,this.xrManager.cameraL,this.xrManager.cameraR),this.camera.quaternion.copy(this.xrManager.cameraVR.quaternion),this.camera.scale.copy(this.xrManager.cameraVR.scale),this.camera.matrix.compose(this.camera.position,this.camera.quaternion,this.camera.scale),this.camera.computePose((c=v.distance)!==null&&c!==void 0?c:this.camera.pose.distance),this.xrManager.session&&this.xrManager.session.inputSources){for(var fe=0;fe<this.xrManager.session.inputSources.length;fe++)if(this.xrManager.session.inputSources[fe]&&this.xrManager.session.inputSources[fe].targetRayMode==="transient-pointer"){var ye=te.getPose(this.xrManager.session.inputSources[fe].targetRaySpace,me);if(ye){var De=ye.transform.orientation,Je=new THREE__namespace.Quaternion(De.x,De.y,De.z,De.w),$e=new THREE__namespace.Vector3(0,0,-1).applyQuaternion(Je),Ue=new THREE__namespace.Raycaster(this.camera.position,$e);this.gazeRay=Ue}}}if(this.xrManager.machineType==="Oculus"||this.xrManager.machineType==="Pico"){for(var he=this.xrManager.session.inputSources,Ye=function(ce){var Se=Ee.xrManager.controllers[ce],Ce=he[ce];if(!Ce)return"continue";Se&&Se.update(Ce,te,me);var Be=Ee.xrManager.getController(ce),Tt=new THREE__namespace.Vector3(0,1.2,0),Xe=Be.position.clone().add(pe).sub(Tt);Ce.handedness==="left"?Ee.xrControllerRay.left.set(Xe,new THREE__namespace.Vector3(0,0,-1).applyEuler(Be.rotation)):Ce.handedness==="right"&&Ee.xrControllerRay.right.set(Xe,new THREE__namespace.Vector3(0,0,-1).applyEuler(Be.rotation)),Ee.controllerWrappers[ce].position.copy(new THREE__namespace.Vector3(0,0,0).add(pe).sub(Tt));var st=Ee.modelScene.intersectRaycaster(Ee.xrControllerRay.right);if(st.length===0){var Bt=Ee.works.getResolvedObserver(Ee.currentPano);st=Ee.xrControllerRay.right.intersectObject(Ee.boundingMesh,!0).map(function(ae){var Ae,Ne=(Ae=Bt==null?void 0:Bt.floorIndex)!==null&&Ae!==void 0?Ae:0;return __assign({floorIndex:Ne,floor:Ne},ae)})}if(st.length>=1&&st[0].face)if(Ce.handedness==="right"){var Ht=Ee.xrControllerRay.right.intersectObject(Ee.xrCustomObjectsScene,!0),Ot=st[0].face.normal,Lt=Ot.clone(),I=st[0].point.clone();Ee.intersectMesh.position.copy(I);var H=I.clone().add(Lt);if(Ee.intersectMesh.lookAt(H),Math.abs(Ot.y)>.99){var N=Ee.camera.position.clone().sub(I);Ee.intersectMesh.rotation.z=-Math.atan2(N.z,N.x)}Ee.intersectMesh.visible=!0,Ee.needsRender=!0,Ht.length>0?(Ee.pointerLines.right.setPoints(Xe,Ht[0].point),Ee.pointerLines.right.points.visible=!0,Ee.intersectMesh.visible=!1):(Ee.pointerLines.right.points.visible=!1,Ee.pointerLines.right.setPoints(Xe,st[0].point));var V=st[0],Z=createEvent("intersect.update",{raycaster:(f=Ee.xrControllerRay.right)!==null&&f!==void 0?f:null,intersection:V!=null?V:null,object:Ee.intersectMesh});if(Ee.emit("intersect.update",Z),Z.defaultPrevented)return Ee.hideIntersectMesh(),{value:void 0}}else Ee.pointerLines.left.setPoints(Xe,st[0].point)},Ee=this,fe=0;fe<he.length;fe++){var Oe=Ye(fe);if(typeof Oe=="object")return Oe.value}this.updateControllerHelper(he,e,r)}}else te||console.error("xrFrame丢失,请重试"),this.xrManager.session||console.error("session丢失,请重试"),this.xrManager.session&&!this.xrManager.session.renderState.baseLayer&&console.error("no layer found");isEmptyObject(E)===!1&&this.modelScene.parameter.set(E),this.emit("camera.update",createEvent("camera.update",{userAction:this.userAction,state:__assign(__assign(__assign({},this.currentPano),{mode:this.mode}),clonePose(this.camera.pose))}));var Fe=this.works.getResolvedObserver(this.currentPano),tt=this.locationMotion.ended?this.getForwardObserverOrNot(this.xrManager.cameraVR):null,rt=this.works.getObserver(R.panoId),Le=this.works.getObserver(w.panoId);if(this.adjustPanoCircleMeshPositionBasedOnModel&&this.helper.visible&&Fe){for(var Ie=[],He=Fe.work.observers,ge=0,we=Fe.accessibleNodes;ge<we.length;ge++){var Pe=we[ge],J=He[Pe];J&&Ie.push(J)}var je=new Map;if(Ie.sort(function(ce,Se){var Ce=je.get(ce);typeof Ce=="undefined"&&(Ce=ce.standingPosition.distanceTo(Fe.standingPosition),je.set(ce,Ce));var Be=je.get(ce);return typeof Be=="undefined"&&(Be=Se.standingPosition.distanceTo(Fe.standingPosition),je.set(Se,Be)),Ce-Be}),Ie.length){this.accessibleObserverFloorCheckCount=this.accessibleObserverFloorCheckCount%Ie.length;var Ve=Ie[this.accessibleObserverFloorCheckCount],Ze=this.modelScene.models.find(function(ce){return ce.work===(Ve==null?void 0:Ve.work)});if(Ve&&Ze&&Ze.visible){var gt=.3,Qe=.05,At=.005,Re=Ve.standingPosition.clone().applyMatrix4(Ve.work.transform),qe=panoStringify({panoIndex:Ve.panoIndex,workCode:Ve.work.workCode}),ft=adjustPanoCircleMeshVectors.map(function(ce){scratchRaycaster.ray.origin.copy(Re),scratchRaycaster.ray.origin.add(scratchVector3.copy(ce).setY(gt)),scratchRaycaster.ray.direction.set(0,-1,0),scratchRaycaster.firstHitOnly=!0,scratchRaycaster.floorIndex=-1;var Se=Ze.intersectRaycaster(scratchRaycaster)[0];return Se&&Se.distance-At<=gt?new THREE__namespace.Vector3().copy(Re).setY(Se.point.y+At):Re});ft.sort(function(ce,Se){return Se.y-ce.y});var dt=ft[Math.floor(ft.length/2)],Ge=ft.filter(function(ce){return ce.distanceTo(dt)<=Qe})[0];if(Ge){var nt=new THREE__namespace.Vector4(Re.x,Re.y,Re.z,Ge.y-Re.y),ct=this.adjustPanoCircleMeshPositionFix.get(qe);ct&&!nt.equals(ct)&&(this.needsRender=!0),this.adjustPanoCircleMeshPositionFix.set(qe,nt)}}this.accessibleObserverFloorCheckCount++}}var se=new Map;if(rt)for(var Te=0,Me=rt.accessibleNodes;Te<Me.length;Te++){var Pe=Me[Te],J=rt.work.observers[Pe];if(J){var qe=panoStringify({panoIndex:J.panoIndex,workCode:J.work.workCode});se.set(qe,J)}}if(Le)for(var xe=0,ze=Le.accessibleNodes;xe<ze.length;xe++){var Pe=ze[xe],J=Le.work.observers[Pe];if(J){var qe=panoStringify({panoIndex:J.panoIndex,workCode:J.work.workCode});se.set(qe,J)}}if(this.panoMeshes.forEach(function(ce,Se){var Ce=se.get(Se);if(Ce){ce.position.copy(Ce.standingPosition).applyMatrix4(Ce.work.transform);var Be=o.adjustPanoCircleMeshPositionFix.get(Se);Be&&(scratchVector3.set(Be.x,Be.y,Be.z),scratchVector3.equals(ce.position)&&(ce.position.y+=Be.w)),ce.scale.setScalar(1.2),se.delete(Se)}else o.helper.remove(ce),ce.dispose(),o.panoMeshes.delete(Se)}),se.forEach(function(ce,Se){var Ce=o.panoCircleMeshCreator(panoParse(Se));Ce.position.copy(ce.standingPosition).applyMatrix4(ce.work.transform);var Be=o.adjustPanoCircleMeshPositionFix.get(Se);Be&&(scratchVector3.set(Be.x,Be.y,Be.z),scratchVector3.equals(Ce.position)&&(Ce.position.y+=Be.w)),Ce.scale.setScalar(1.2),o.panoMeshes.set(Se,Ce),o.helper.add(Ce),se.delete(Se)}),this.camera.pose.distance>.1||C)this.panoMeshes.forEach(function(ce){ce.setOpacity(0),ce.setCurrent(!1),ce.updateTime&&ce.updateTime(e,r),ce.visible=!1});else if(Fe){var at=Fe.work.observers,yt=arrayMin(Fe.accessibleNodes,function(ce){var Se=at[ce];return Se?Fe.standingPosition.distanceTo(Se.standingPosition):1/0},!0),ht=yt[1];ht=clamp$1(ht,2.5,1/0);var Ct=Fe.visibleNodes.concat(Fe.panoIndex).map(function(ce){return panoStringify({panoIndex:ce,workCode:Fe.work.workCode})}),Mt=this.camera.getDirection(new THREE__namespace.Vector3);this.panoMeshes.forEach(function(ce,Se){var Ce=o.works.getObserver(Se);if(Ct.indexOf(Se)===-1)ce.setCurrent(!1),ce.setOpacity(0);else if(!Ce)ce.setCurrent(!1),ce.setOpacity(0);else if(!Ce.loadable&&!Ce.active)ce.setCurrent(!1),ce.setOpacity(0);else{var Be=ce.position.clone().setY(o.camera.position.y).distanceTo(o.camera.position);ce.setCurrent(!ce.loading&&ce.progress===0&&tt!==null&&panoStringify({panoIndex:tt.panoIndex,workCode:tt.work.workCode})===Se),ce.setOpacity(Be<.01?0:clamp$1(ht/Be*1.2,.65,.98));var Tt=o.camera.position.clone().setY(ce.position.y),Xe=new THREE__namespace.Vector3().copy(ce.position).sub(Tt).normalize();if(Se===panoStringify(o.currentPano)){var st=clamp$1((.5-Tt.distanceTo(ce.position))/.5,0,1);Xe.multiplyScalar(1-st).add(Mt.clone().multiplyScalar(st))}Xe.length()>0&&ce.quaternion.setFromEuler(new THREE__namespace.Euler(0,Math.atan2(Xe.x,Xe.z),0))}ce.updateTime&&ce.updateTime(e,r)})}{var k=(p=this.modelScene.parameter.progress)!==null&&p!==void 0?p:1,It=Math.round(k),it=this.modelScene.parameter.pano0,pt=this.modelScene.parameter.pano1,Et=It===0?it:pt,J=void 0;if(Et&&(J=this.works.getObserver(Et.panoId),J||(J=this.panoPictureObserverMap.get(Et))),this.tiling.appearDuration=this.tileAppearDuration,this.tiling.maxRequest=k<=.6?0:this.tileMaxRequest,this.tiling.imageOptions=this.imageOptions,!J||!Et||this.tileLevelForFov===!1){this.tiling.setObserver(null);var Rt={renderer:this.renderer,resolution:oe,pixelRatio:1,time:this.camera.time,cameraMatrix:this.xrManager.cameraVR.matrixWorld,cameraProjectionMatrix:this.xrManager.cameraVR.projectionMatrix,panoMap:null,panoMatrix:new THREE__namespace.Matrix4,panoZoom:1,minLevel:0,level:0};this.tiling.update(Rt),this.modelScene.parameter.set("refinedScreen",null)}else{var ot=getImageSizeLevel(Et.mapSize),wt=ot+1,bt=4;this.tiling.setObserver(J);var Rt={renderer:this.renderer,resolution:oe,pixelRatio:1,time:this.camera.time,cameraMatrix:this.xrManager.cameraVR.matrixWorld,cameraProjectionMatrix:this.xrManager.cameraVR.projectionMatrix,panoMap:Et.map,panoMatrix:Et.matrix,panoZoom:Et.zoom,minLevel:wt,level:bt},vt=this.tiling.update(Rt),St={map:this.tiling.renderTarget.texture,matrixInverse:this.tiling.camera.matrixWorldInverse,projectionMatrix:this.tiling.camera.projectionMatrix,pano:It,opacity:(it==null?void 0:it.panoId)===(pt==null?void 0:pt.panoId)?1:easeInQuart(Math.abs(((d=this.modelScene.parameter.progress)!==null&&d!==void 0?d:0)-.5)*2)},Ke=this.modelScene.parameter.refinedScreen;(vt||St.pano!==(Ke==null?void 0:Ke.pano)||St.opacity!==(Ke==null?void 0:Ke.opacity))&&this.modelScene.parameter.set("refinedScreen",St)}}this.panoVideo.object.position.copy(this.camera.position),this.panoVideo.updateTime(e);{var mt=w.effect,Ft=this.modelScene.parameter,it=Ft.pano0,pt=Ft.pano1;if(it&&pt&&it!==pt&&mt==="fly"&&this.flyEffectUseDepthBuffer){if(((h=this.modelScene.parameter.pano0Depth)===null||h===void 0?void 0:h.panoId)!==it.panoId||((g=this.modelScene.parameter.pano1Depth)===null||g===void 0?void 0:g.panoId)!==pt.panoId){var Pt=500,lt=512;this.pano0DepthCubeRenderTarget?this.pano0DepthCubeRenderTarget.width!==lt&&this.pano0DepthCubeRenderTarget.setSize(lt,lt):this.pano0DepthCubeRenderTarget=new THREE__namespace.WebGLCubeRenderTarget(lt,{minFilter:THREE__namespace.NearestFilter,magFilter:THREE__namespace.NearestFilter,generateMipmaps:!1}),this.pano1DepthCubeRenderTarget?this.pano1DepthCubeRenderTarget.width!==lt&&this.pano1DepthCubeRenderTarget.setSize(lt,lt):this.pano1DepthCubeRenderTarget=new THREE__namespace.WebGLCubeRenderTarget(lt,{minFilter:THREE__namespace.NearestFilter,magFilter:THREE__namespace.NearestFilter,generateMipmaps:!1});var We=new THREE__namespace.CubeCamera(this.camera.near,this.camera.far,this.pano0DepthCubeRenderTarget);We.matrix.copy(it.matrix),We.matrixWorld.copy(We.matrix),We.matrixAutoUpdate=!1,renderDepthCube(this.renderer,this.modelScene,We,Pt);var _t=new THREE__namespace.CubeCamera(this.camera.near,this.camera.far,this.pano1DepthCubeRenderTarget);_t.matrix.copy(pt.matrix),_t.matrixWorld.copy(_t.matrix),_t.matrixAutoUpdate=!1,renderDepthCube(this.renderer,this.modelScene,_t,Pt),this.modelScene.parameter.set({pano0Depth:{panoId:it.panoId,map:this.pano0DepthCubeRenderTarget.texture,mapSize:this.pano0DepthCubeRenderTarget.width,maxDepth:Pt},pano1Depth:{panoId:pt.panoId,map:this.pano1DepthCubeRenderTarget.texture,mapSize:this.pano1DepthCubeRenderTarget.width,maxDepth:Pt}})}}else this.modelScene.parameter.set({pano0Depth:null,pano1Depth:null}),this.flyEffectUseDepthBuffer||(this.pano0DepthCubeRenderTarget&&(this.pano0DepthCubeRenderTarget.dispose(),this.pano0DepthCubeRenderTarget=void 0),this.pano1DepthCubeRenderTarget&&(this.pano1DepthCubeRenderTarget.dispose(),this.pano1DepthCubeRenderTarget=void 0))}},t.prototype.render=function(){this.renderer.setScissorTest(!1);var e=this.xrManager.cameraVR;this.renderer.render(this.modelScene,e),this.renderer.autoClearColor=!1,this.renderer.autoClearDepth=!1,this.renderer.render(this.scene,e),this.renderer.autoClearColor=!0,this.renderer.autoClearDepth=!0},t.prototype.onPanGesture=function(){},t.prototype.onTapGesture=function(){},t.prototype.onPinchGesture=function(){},t.prototype.onMouseMove=function(){},t.prototype.onMouseOut=function(){},t.prototype.panoResourceFromLocationMotionKeyframe=function(e){return this.panoResources[e.key]},t.prototype.updateControllerHelper=function(e,r,o){var s=this.xrControllerRay.left,u=this.xrControllerRay.right;if(!(!e||e.length===0)){for(var l={buttons:{X:!1,Y:!1,LeftTrigger:!1,LeftPinch:!1,A:!1,B:!1,RightTrigger:!1,RightPinch:!1}},c=0;c<e.length;c++){var f=e[c].handedness,p=e[c].gamepad;switch(f){case"left":p.axes&&(this.emitHandleEvent(p.axes[2]===-1,"LeftAxesLeft",r),this.emitHandleEvent(p.axes[2]===1,"LeftAxesRight",r),this.emitHandleEvent(p.axes[3]===-1,"LeftAxesUp",r),this.emitHandleEvent(p.axes[3]===1,"LeftAxesDown",r)),p!=null&&p.buttons&&(p.buttons[4]&&this.emitHandleEvent(p.buttons[4].pressed,"X",r),p.buttons[5]&&this.emitHandleEvent(p.buttons[5].pressed,"Y",r),p.buttons[0]&&this.emitHandleEvent(p.buttons[0].pressed,"LeftTrigger",r),p.buttons[1]&&this.emitHandleEvent(p.buttons[1].pressed,"LeftPinch",r));var d={raycaster:s,axes:{up:p.axes&&p.axes[3]<0?Math.abs(p.axes[3]):0,down:p.axes&&p.axes[3]<0?0:Math.abs(p.axes[3]),left:p.axes&&p.axes[2]<0?Math.abs(p.axes[2]):0,right:p.axes&&p.axes[2]<0?0:Math.abs(p.axes[2])},deltaTime:o};l.buttons.X=p.buttons&&p.buttons[4]?p.buttons[4].pressed:!1,l.buttons.Y=p.buttons&&p.buttons[5]?p==null?void 0:p.buttons[5].pressed:!1,l.buttons.LeftTrigger=p.buttons&&p.buttons[0]?p==null?void 0:p.buttons[0].pressed:!1,l.buttons.LeftPinch=p.buttons&&p.buttons[1]?p==null?void 0:p.buttons[1].pressed:!1,l.left=d;break;case"right":p.axes&&(this.emitHandleEvent(p.axes[2]===-1,"RightAxesLeft",r),this.emitHandleEvent(p.axes[2]===1,"RightAxesRight",r),this.emitHandleEvent(p.axes[3]===-1,"RightAxesUp",r),this.emitHandleEvent(p.axes[3]===1,"RightAxesDown",r)),p.buttons&&(p.buttons[4]&&this.emitHandleEvent(p.buttons[4].pressed,"A",r),p.buttons[5]&&this.emitHandleEvent(p.buttons[5].pressed,"B",r),p.buttons[0]&&this.emitHandleEvent(p.buttons[0].pressed,"RightTrigger",r),p.buttons[1]&&this.emitHandleEvent(p.buttons[1].pressed,"RightPinch",r));var h={raycaster:u,axes:{up:p.axes&&p.axes[3]<0?Math.abs(p.axes[3]):0,down:p.axes&&p.axes[3]<0?0:Math.abs(p.axes[3]),left:p.axes&&p.axes[2]<0?Math.abs(p.axes[2]):0,right:p.axes&&p.axes[2]<0?0:Math.abs(p.axes[2])},deltaTime:o};l.right=h,l.buttons.A=p.buttons&&p.buttons[4]?p==null?void 0:p.buttons[4].pressed:!1,l.buttons.B=p.buttons&&p.buttons[5]?p==null?void 0:p.buttons[5].pressed:!1,l.buttons.RightTrigger=p.buttons&&p.buttons[0]?p==null?void 0:p.buttons[0].pressed:!1,l.buttons.RightPinch=p.buttons&&p.buttons[1]?p==null?void 0:p.buttons[1].pressed:!1;break}}this.emit("xr.controller.update",createEvent("xr.controller.update",l))}},t.prototype.emitHandleEvent=function(e,r,o){var s=this.xrControllerRay.left,u=this.xrControllerRay.right;if(e)if(this.xrHandleState[r].touchStart===!1)this.xrHandleState[r].touchStartTime=o,this.xrHandleState[r].touchStart=!0,this.emit("xr.gesture.buttonDown",createEvent("xr.gesture.buttonDown",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!1,isFirst:!0,controllers:{raycaster:{leftRay:s,rightRay:u}}}));else{var l=o-this.xrHandleState[r].touchStartTime;l>CONTROLLER_EVNET_DELTA_TIME&&this.emit("xr.gesture.press",createEvent("xr.gesture.tap",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!0,isFirst:!0,controllers:{raycaster:{leftRay:s,rightRay:u}}}))}else if(this.xrHandleState[r].touchStart===!0){this.emit("xr.gesture.buttonUp",createEvent("xr.gesture.buttonUp",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!0,isFirst:!1,controllers:{raycaster:{leftRay:s,rightRay:u}}}));var l=o-this.xrHandleState[r].touchStartTime;if(l<=CONTROLLER_EVNET_DELTA_TIME){var c=createEvent("xr.gesture.tap",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!0,isFirst:!1,controllers:{raycaster:{leftRay:s,rightRay:u}}}),f=this.emit("xr.gesture.tap",c);!f&&!c.defaultPrevented&&r==="RightTrigger"&&this.checkSelectedPano(this.xrControllerRay.right)}this.xrHandleState[r].touchStart=!1,this.xrHandleState[r].touchStartTime=0}},t.prototype.initHandEvent=function(){var e=this;if(!this.xrManager.session)throw new Error("初始化失败");this.xrManager.session.addEventListener("select",function(r){e.gazeRay&&e.checkSelectedPano(e.gazeRay)})},t})(PanoramaController),Controllers={Floorplan:FloorplanController,Topview:TopviewController,Panorama:PanoramaController,VRPanorama:VRPanoramaController,Model:ModelController,Mapview:MapviewController,XRPanorama:XRPanoramaController},controllersDefaultInitArgs={Floorplan:defaultFloorplanControllerCustomInitArgs,Topview:defaultTopviewControllerCustomInitArgs,Panorama:defaultPanoramaControllerCustomInitArgs,VRPanorama:defaultVRPanoramaControllerCustomInitArgs,Model:defaultModelControllerCustomInitArgs,Mapview:defaultMapviewControllerCustomInitArgs,XRPanorama:defaultXRPanoramaControllerInitArgs},PROXY_CONTROLLER_EVENT_NAMES=["gesture.pan","gesture.tap","gesture.dbltap","gesture.press","gesture.pinch","gesture.mousewheel","gesture.mousemove","gesture.momentum","initAnimation.start","initAnimation.end","camera.update","intersect.update","pano.select","pano.moveTo","pano.moving","pano.arrived","pano.cancel","pano.error","pano.texture.load","pano.texture.progress","pano.texture.success","pano.texture.error","pano.texture.abort","xr.session.start","xr.session.end","xr.gesture.tap","xr.gesture.press","xr.gesture.buttonUp","xr.gesture.buttonDown","xr.controller.update"];function initLegacyEvent(n){n.on("initAnimation.start",function(t){n.emit("initAnimationWillStart",t.state.panoIndex,t.state,t.userAction)}),n.on("initAnimation.end",function(t){n.emit("initAnimationEnded",t.state.panoIndex,t.state,t.userAction)}),n.on("gesture.pan",function(t){var e=!1;e=n.emit("wantsGesture","pan",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsPanGesture",t.state,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","pan",t.pointers,t.isFinal),n.emit("panGesture",t.state,t.isFinal))}),n.on("gesture.tap",function(t){var e=!1;e=n.emit("wantsGesture","tap",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsTapGesture",t.center.raycaster,t.center.coords,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","tap",t.pointers,t.isFinal),n.emit("tapGesture",t.center.raycaster,t.center.coords,t.isFinal))}),n.on("gesture.dbltap",function(t){var e=!1;e=n.emit("wantsGesture","dbltap",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsDblTapGesture",t.center.raycaster,t.center.coords,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","dbltap",t.pointers,t.isFinal),n.emit("dblTapGesture",t.center.raycaster,t.center.coords,t.isFinal))}),n.on("gesture.press",function(t){var e=!1;e=n.emit("wantsGesture","press",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsPressGesture",t.center.raycaster,t.center.coords,t.center.delta,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","press",t.pointers,t.isFinal),n.emit("pressGesture",t.center.raycaster,t.center.coords,t.center.delta,t.isFinal))}),n.on("gesture.pinch",function(t){var e=!1;e=n.emit("wantsGesture","pinch",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsPinchGesture",t.scale,t.state.fov,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","pinch",t.pointers,t.isFinal),n.emit("pinchGesture",t.scale,t.state.fov,t.isFinal))}),n.on("gesture.mousewheel",function(t){var e=!1;e=n.emit("wantsGesture","mouseWheel",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsMouseWheel",t.center.delta,t.state.fov,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","mouseWheel",t.pointers,t.isFinal),n.emit("mouseWheel",t.center.delta,t.state.fov,t.isFinal))}),n.on("gesture.mousemove",function(t){var e=!1;e=n.emit("wantsGesture","mouseMove",t.pointers,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","mouseMove",t.pointers,t.isFinal),e=n.emit("wantsChangeCameraFov",t.state.fov),e&&t.preventDefault())}),n.on("gesture.momentum",function(t){var e=!1;e=n.emit("wantsInteriaPan",t.state),e&&t.preventDefault(),t.defaultPrevented||n.emit("interiaPan",t.state,t.isFinal)}),n.on("camera.update",function(t){n.emit("cameraFovUpdate",t.state.fov,t.userAction),n.emit("cameraDirectionUpdate",t.state,t.userAction);var e=coordinatesToVector(t.state);e.setLength(t.state.distance);var r=t.state.offset.clone().sub(e);n.emit("cameraPositionUpdate",r,t.userAction),n.emit("cameraUpdate",t.state,t.userAction)}),n.on("intersect.update",function(t){if(t.intersection){var e=!1;e=n.emit("wantsShowIntersectionOnModel",t.raycaster),e&&t.preventDefault(),t.defaultPrevented||n.emit("intersectionOnModelUpdate",t.intersection,t.object)}else n.emit("intersectionHidden")}),n.on("pano.request",function(t){var e=n.emit("wantsMoveToPano",t.state.panoIndex,t.options,t.userAction);e||(e=n.emit("wantsToMoveToPano",t.state.panoIndex,t.options,t.userAction)),e&&t.preventDefault(),t.defaultPrevented||n.emit("panoWillLoad",t.state.panoIndex)}),n.on("pano.select",function(t){n.emit("panoSelected",t.state.panoIndex)}),n.on("pano.moveTo",function(t){n.emit("panoLoaded",t.state.panoIndex),n.emit("moveToPano",t.state.panoIndex,t.userAction),n.emit("panoWillArrive",t.state.panoIndex,t.state,t.userAction)}),n.on("pano.moving",function(t){n.emit("movingToPano",t.state.panoIndex,t.prevPano.panoIndex,t.progress)}),n.on("pano.arrived",function(t){n.emit("panoArrived",t.state.panoIndex,t.state,t.userAction)}),n.on("pano.cancel",function(t){n.emit("moveToPanoCanceled",t.state.panoIndex)}),n.on("pano.error",function(t){n.emit("panoLoadError",t.error,t.state.panoIndex)}),n.on("pano.texture.load",function(t){n.emit("textureStartLoad",t.pano.panoIndex)}),n.on("pano.texture.success",function(t){n.emit("textureLoaded",t.pano.panoIndex,t.meta)}),n.on("pano.texture.error",function(t){n.emit("textureError",t.error,t.pano.panoIndex)}),n.on("pano.texture.abort",function(t){n.emit("textureAbort",t.pano.panoIndex)}),n.on("pano.texture.progress",function(t){n.emit("textureLoading",t.progress,t.pano.panoIndex)}),n.on("xr.session.start",function(t){n.emit("webXRSessionStart")}),n.on("xr.session.end",function(t){n.emit("webXRSessionEnd")}),n.on("xr.gesture.tap",function(t){n.emit("webXRControllerEvent","tap",t.buttons,{raycaster:t.controllers.raycaster})}),n.on("xr.gesture.press",function(t){n.emit("webXRControllerEvent","press",t.buttons,{raycaster:t.controllers.raycaster})}),n.on("xr.gesture.buttonUp",function(t){n.emit("webXRControllerEvent","buttonUp",t.buttons,{raycaster:t.controllers.raycaster})}),n.on("xr.gesture.buttonDown",function(t){n.emit("webXRControllerEvent","buttonDown",t.buttons,{raycaster:t.controllers.raycaster})}),n.on("xr.controller.update",function(t){n.emit("webXRControllerRayUpdate",{leftRay:t.left?t.left.raycaster:void 0,rightRay:t.right?t.right.raycaster:void 0}),t.left&&n.emit("webXRAxesUpdate","left",{raycaster:{leftRay:t.left?t.left.raycaster:void 0,rightRay:t.right?t.right.raycaster:void 0},axesState:{up:t.left.axes.up,down:t.left.axes.down,left:t.left.axes.left,right:t.left.axes.right},deltaTime:t.left.deltaTime}),t.right&&n.emit("webXRAxesUpdate","right",{raycaster:{leftRay:t.left?t.left.raycaster:void 0,rightRay:t.right?t.right.raycaster:void 0},axesState:{up:t.right.axes.up,down:t.right.axes.down,left:t.right.axes.left,right:t.right.axes.right},deltaTime:t.right.deltaTime})}),n.on("works.request",function(t){n.emit("willLoad",t.input,t.works[0],t.state)}),n.on("works.load",function(t){n.emit("load",t.input,t.works[0],t.state)}),n.on("works.ready",function(t){n.emit("loaded",t.input,t.works[0])}),n.on("state.change",function(t){n.emit("stateChange",t.state,t.userAction)}),n.on("currentState.change",function(t){n.emit("currentStateChange",t.state,t.userAction)}),n.on("state.set",function(t){n.emit("setState",t.state)}),n.on("state.synced",function(t){n.emit("stateSynced",t.state)}),n.on("model.request",function(t){n.emit("modelWillLoad",t.work.model)}),n.on("model.error",function(t){n.emit("modelLoadError",t.error,t.model)}),n.on("model.load",function(t){n.emit("modelLoaded",t.model)}),n.on("model.changeShownFloor",function(t){n.emit("modelShownFloorChange",t.model.shownFloor,t.model.floorLength)}),n.on("render",function(t){n.emit("renderFrame",t.needsRender)}),n.on("mode.change.request",function(t){n.emit("wantsChangeMode",t.mode,t.prevMode)}),n.on("mode.change",function(t){n.emit("modeChange",t.mode,t.prevMode,t.state.panoIndex,t.state,t.userAction)}),n.on("helpers.visible",function(t){n.emit("helpersVisibleChange",t.object.visible)}),n.on("network.resource",function(t){n.emit("network",t.source,t.requestType,t.requestState,t.detail)})}function generateDefaultVideoElement(){if(typeof window!="undefined"){var n=document.createElement("video");n.loop=!0,n.autoplay=!0,n.playsInline=!0,n.muted=!0,n.crossOrigin="";var t=function(){document.removeEventListener("touchstart",t,!1),document.removeEventListener("mousedown",t,!1),n.muted=!1};return document.addEventListener("touchstart",t,!1),document.addEventListener("mousedown",t,!1),n}else return{}}function initLights(){var n=new THREE__namespace.Group;n.name="internalLights";{var t=new THREE__namespace.DirectionalLight(16777215,.1);t.name="direction0",t.position.copy(new THREE__namespace.Vector3(0,1,0)),n.add(t)}{var t=new THREE__namespace.DirectionalLight(16777215,.1);t.name="direction1",t.position.copy(new THREE__namespace.Vector3(-1,-1,-1)),n.add(t)}{var t=new THREE__namespace.DirectionalLight(16777215,.3);t.name="direction2",t.position.copy(new THREE__namespace.Vector3(1,1,1)),n.add(t)}{var t=new THREE__namespace.AmbientLight(16777215,.6);t.name="ambient0",n.add(t)}return n}function parseKeyValue(n){for(var t,e,r={},o=n.split(/(\;|\,)/),s=0,u=o;s<u.length;s++){var l=u[s],c=l.split("="),f=(t=c[0])===null||t===void 0?void 0:t.trim(),p=(e=c[1])===null||e===void 0?void 0:e.trim();f&&p&&(r[f]=p)}return r}function getViewportScale(){var n;if(typeof document!="undefined")for(var t=document.getElementsByTagName("meta"),e=0;e<t.length;e++){var r=t[e];if(r.getAttribute("name")==="viewport"){var o=parseKeyValue((n=r.getAttribute("content"))!==null&&n!==void 0?n:""),s=Number(o["initial-scale"]);if(!isNaN(s))return s}}return 1}const textureURL="data:image/png;base64,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";var imageSize=[351,63],imageOffset=[20,20],vertices=new Float32Array([-.5,-.5,0,.5,-.5,0,-.5,.5,0,.5,.5,0]),uvs=new Float32Array([0,0,1,0,0,1,1,1]),index=new Uint8Array([0,1,2,1,3,2]),geometry$4=new THREE__namespace.BufferGeometry;geometry$4.setAttribute("position",new THREE__namespace.BufferAttribute(vertices,3));geometry$4.setAttribute("uv",new THREE__namespace.BufferAttribute(uvs,2));geometry$4.setIndex(new THREE__namespace.BufferAttribute(index,1));var material=new THREE__namespace.MeshBasicMaterial({transparent:!0,depthTest:!1,depthWrite:!1,stencilWrite:!1,fog:!1}),mesh$4=new THREE__namespace.Mesh(geometry$4,material);mesh$4.matrixAutoUpdate=!1;var scene$2=new THREE__namespace.Scene;scene$2.add(mesh$4);scene$2.matrixAutoUpdate=!1;var camera$2=new THREE__namespace.OrthographicCamera(-.5,.5,.5,-.5,.1,1);camera$2.position.set(0,0,.5);camera$2.lookAt(0,0,0);camera$2.updateMatrixWorld(!0);camera$2.matrixAutoUpdate=!1;var prevViewport=new THREE__namespace.Vector4,prevScissor=new THREE__namespace.Vector4;function renderPoweredByRealsee(n){if(material.map){var r=n.getViewport(prevViewport),o=n.getScissor(prevScissor),s=n.getScissorTest(),u=n.autoClear,l=o.x+imageOffset[0]/3,c=o.y+imageOffset[1]/3,f=imageSize[0]/3,p=imageSize[1]/3;n.setViewport(l,c,f,p),n.setScissor(l,c,f,p),n.setScissorTest(!0),n.autoClear=!1,n.render(scene$2,camera$2),n.setViewport(r),n.setScissor(o),n.setScissorTest(s),n.autoClear=u}else{var t=new THREE__namespace.Texture,e=new Image;e.onload=function(){t.image=e,t.wrapS=THREE__namespace.ClampToEdgeWrapping,t.wrapT=THREE__namespace.ClampToEdgeWrapping,t.minFilter=THREE__namespace.LinearFilter,t.needsUpdate=!0,t.generateMipmaps=!1,material.needsUpdate=!0,e.onload=noop},e.src=textureURL,material.map=t}}var FRAGMENT$2=`
2133
+ `},LineMaterial=(function(n){__extends(t,n);function t(e){var r=n.call(this,{uniforms:THREE__namespace.UniformsUtils.clone(lineShader.uniforms),vertexShader:lineShader.vertexShader,fragmentShader:lineShader.fragmentShader,clipping:!0})||this;return r.type="LineMaterial",r.dashed=!1,Object.defineProperties(r,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(o){this.uniforms.diffuse.value=o}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(o){this.uniforms.linewidth.value=o}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(o){this.uniforms.dashScale.value=o}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(o){this.uniforms.dashSize.value=o}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(o){this.uniforms.gapSize.value=o}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(o){this.uniforms.opacity.value=o}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(o){this.uniforms.resolution.value.copy(o)}}}),r.setValues(e),r}return t})(THREE__namespace.ShaderMaterial);Object.assign(LineMaterial.prototype,{isLineMaterial:!0});var LineSegments2=(function(n){__extends(t,n);function t(e,r){var o=n.call(this)||this;return o.type="LineSegments2",o.geometry=e!==void 0?e:new LineSegmentsGeometry,o.material=r!==void 0?r:new LineMaterial({color:Math.random()*16777215}),o}return t.prototype.computeLineDistances=function(){for(var e=this.geometry,r=e.attributes.instanceStart,o=e.attributes.instanceEnd,s=new Float32Array(2*r.count),u=new THREE__namespace.Vector3,l=new THREE__namespace.Vector3,c=0,f=0,p=r.count;c<p;c++,f+=2)u.fromBufferAttribute(r,c),l.fromBufferAttribute(o,c),s[f]=f===0?0:s[f-1],s[f+1]=s[f]+u.distanceTo(l);var d=new THREE__namespace.InstancedInterleavedBuffer(s,2,1);return e.setAttribute("instanceDistanceStart",new THREE__namespace.InterleavedBufferAttribute(d,1,0)),e.setAttribute("instanceDistanceEnd",new THREE__namespace.InterleavedBufferAttribute(d,1,1)),this},t.prototype.raycast=function(e,r){e.camera===null&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2.');var o=e.ray,s=e.camera,u=s.projectionMatrix,l=this.geometry,c=this.material,f=c.resolution,p=c.linewidth,d=l.attributes.instanceStart,h=l.attributes.instanceEnd,g=new THREE__namespace.Vector4,A=new THREE__namespace.Vector4,m=new THREE__namespace.Vector4,E=new THREE__namespace.Vector3,v=new THREE__namespace.Matrix4,y=new THREE__namespace.Line3,b=new THREE__namespace.Vector3;o.at(1,m),m.w=1,m.applyMatrix4(s.matrixWorldInverse),m.applyMatrix4(u),m.multiplyScalar(1/m.w),m.x*=f.x/2,m.y*=f.y/2,m.z=0,E.copy(m);var _=this.matrixWorld;v.multiplyMatrices(s.matrixWorldInverse,_);for(var T=0,S=d.count;T<S;T++){g.fromBufferAttribute(d,T),A.fromBufferAttribute(h,T),g.w=1,A.w=1,g.applyMatrix4(v),A.applyMatrix4(v),g.applyMatrix4(u),A.applyMatrix4(u),g.multiplyScalar(1/g.w),A.multiplyScalar(1/A.w);var R=g.z<-1&&A.z<-1,w=g.z>1&&A.z>1;if(!(R||w)){g.x*=f.x/2,g.y*=f.y/2,A.x*=f.x/2,A.y*=f.y/2,y.start.copy(g),y.start.z=0,y.end.copy(A),y.end.z=0;var M=y.closestPointToPointParameter(E,!0);y.at(M,b);var B=THREE__namespace.MathUtils.lerp(g.z,A.z,M),C=B>=-1&&B<=1,P=E.distanceTo(b)<p*.5;if(C&&P){y.start.fromBufferAttribute(d,T),y.end.fromBufferAttribute(h,T),y.start.applyMatrix4(_),y.end.applyMatrix4(_);var F=new THREE__namespace.Vector3,L=new THREE__namespace.Vector3;o.distanceSqToSegment(y.start,y.end,L,F),r.push({point:L,pointOnLine:F,distance:o.origin.distanceTo(L),object:this,faceIndex:T})}}}},t})(THREE__namespace.Mesh);Object.assign(LineSegments2.prototype,{isLineSegments2:!0});var Line2=(function(n){__extends(t,n);function t(e,r){var o=n.call(this,e,r)||this;return o.type="Line2",o}return t})(LineSegments2);Object.assign(Line2.prototype,{isLine2:!0});var LineGeometry=(function(n){__extends(t,n);function t(){var e=n.call(this)||this;return e.type="LineGeometry",e}return t.prototype.setPositions=function(e){for(var r=e.length-3,o=new Float32Array(2*r),s=0;s<r;s+=3)o[2*s]=e[s],o[2*s+1]=e[s+1],o[2*s+2]=e[s+2],o[2*s+3]=e[s+3],o[2*s+4]=e[s+4],o[2*s+5]=e[s+5];return n.prototype.setPositions.call(this,o),this},t.prototype.setColors=function(e){for(var r=e.length-3,o=new Float32Array(2*r),s=0;s<r;s+=3)o[2*s]=e[s],o[2*s+1]=e[s+1],o[2*s+2]=e[s+2],o[2*s+3]=e[s+3],o[2*s+4]=e[s+4],o[2*s+5]=e[s+5];return n.prototype.setColors.call(this,o),this},t.prototype.fromLine=function(e){var r=e.geometry;if(r instanceof THREE__namespace.Geometry){var o=new THREE__namespace.BufferGeometry().fromGeometry(r);this.setPositions(o.attributes.position.array)}else r instanceof THREE__namespace.BufferGeometry&&this.setPositions(r.attributes.position.array);return this},t.prototype.copy=function(){return this},t})(LineSegmentsGeometry);Object.assign(LineGeometry.prototype,{isLineGeometry:!0});var circleImageURL="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sHDgwCEMBJZu0AAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAABM5JREFUWMO1V0tPG2cUPZ4Hxh6DazIOrjFNqJs0FIMqWFgWQkatsmvVbtggKlSVRVf5AWz4AWz4AUSKEChll19QJYSXkECuhFxsHjEhxCYm+DWGMZ5HF72DJq4bAzFXurI0M/I5997v3u9cC65vTJVn2lX/xHINQOYSBLTLEuIuCWw4Z3IGAEvf6ASmVHjNzHCXBG4A0AjACsAOwEbO0nsFQBnAGYASAIl+ZRMR7SolMEdsByD09fV5R0ZGgg8ePPjW5/N1iqLYpuu6RZblciKR2I9Go69evnwZnZ+fjwI4IS8AKBIRzeQfJWCANwKwh0KhtrGxsYehUOin1tbW+zzP23ietzY2NnIAoGmaLsuyUiqVyvl8XtrY2NiamZn589mzZxsAUgCOAeQAnFI2tI+VxIjaAeDzoaGh7xYWFuZOTk6OZVk+12uYqqq6JEnn0Wg0OT4+/geAXwGEAdwDIFJQXC1wO4DWR48e/RCPxxclSSroVzRFUbSDg4P848ePFwH8DuAhkWih83TRQWxFOXgAwvDwcOfo6OhvXV1d39tsNtuVBwTDWBwOh1UUxVsMw1hXVlbSdCgNV43uYSvrHg6H24aHh38eHBz85TrgF9FYLHA4HLzH43FvbW2d7u/vG+dANp8FpqIlbd3d3V8Fg8EfBUFw4BONZVmL3+9vHhkZCQL4AoAHgJPK8G+yzC0XDofdoVAo5PP5vkadTBAEtr+/39ff3x8gAp/RPOEqx2qjx+NpvXv3bk9DQ0NDvQgwDIOWlhZrMBj8kgi0UJdxRgYMArzL5XJ7vd57qLPZ7Xamp6fnNgBXtQxcjFuHw+Hyer3t9SYgCAITCAScAJoBNNEY/08GOFVVrfVMv7kMNDntFD1vjIAPrlRN0xjckOm6biFQ3jwNPwDMZrOnqVTqfb3Bi8Wivru7W/VCYkwPlKOjo0IikXh7EwQikYgE4Nw0CfXKDCipVCoTj8df3QABbW1tLUc6oUgkFPMkVACUNjc337148eKvw8PDbJ2jP1taWkoCyNDVXDSECmNSK4qiKNLq6urW8+fPI/UicHx8rD59+jSVy+WOAKSJhKENwFItLtoxk8mwsixzHR0dHe3t7c5PAU+n09rs7OzJkydPYqVSaQfANoDXALIk31S2smU1TWMPDg7K5XKZ7+3t9TudTut1U7+wsFCcmJiIpdPpbQBxADsAknQWymYCOukBHYCuKApisdhpMpnURFEU79y503TVyKenpzOTk5M7e3t7MQKPV0Zv1gNm+awB0MvlshqLxfLb29uyJElWURSbXC4XXyvqxcXFs6mpqeTc3Nzu3t7e3wQcA7BPZ8Cov1pNlJplmQtAG8MwHV6v95tAINA5MDBwPxAIuLu6upr8fr/VAN3c3JQjkcjZ+vp6fnl5+d2bN29SuVzuNYAEpf01CdRChUL+X1VskHACuA3Ay3Fcu9vt7nA6nZ7m5uYWQRCaNE3jVVW15PP580KhIGUymWw2m00DOAJwSP4WwPtq4LX2Ao6USxNlQyS/RcQcdLGwlNIz6vEMAaZpNzCk2Pll94LK/cDYimxERiBwG10sxjgvEZBE0UpE6vxj+0Ct5bTaXthgEhRmja8QWNkkPGsuIpfdjpkK+cZUWTC0KredVmtD/gdlSl6EG4AMvQAAAABJRU5ErkJggg==",DEFAULT_COLOR=14467195,POINT_SIZE=8,DEFAULT_LINEWIDTH=2,DEFAULT_DASHSCALE=20,sharedCircleTexture=null,FiveLine=(function(n){__extends(t,n);function t(e,r){e===void 0&&(e=new THREE__namespace.Vector3),r===void 0&&(r=new THREE__namespace.Vector3);var o=n.call(this)||this;o.type="FiveLine",o.needsRender=!0;var s=new LineGeometry,u=new LineMaterial({color:DEFAULT_COLOR,linewidth:DEFAULT_LINEWIDTH,dashScale:DEFAULT_DASHSCALE,dashed:!1});o.line=new Line2(s,u);var l=new THREE__namespace.BufferGeometry,c=new THREE__namespace.PointsMaterial({color:DEFAULT_COLOR,size:POINT_SIZE,map:sharedCircleTexture||(sharedCircleTexture=new THREE__namespace.TextureLoader().load(circleImageURL)),sizeAttenuation:!1,transparent:!0});return o.points=new THREE__namespace.Points(l,c),o.points.renderOrder=11,o.points.frustumCulled=!1,o.setPoints(e,r),o.add(o.line,o.points),o}return Object.defineProperty(t,"version",{get:function(){return"6.6.0-alpha.6"},enumerable:!1,configurable:!0}),t.prototype.setPoints=function(e,r){var o=[].concat(e.toArray(),r.toArray());this.points.geometry.setAttribute("position",new THREE__namespace.BufferAttribute(new Float32Array(o),3)),this.line.geometry.setPositions(o),this.line.computeLineDistances(),this.needsRender=!0},t.prototype.getPoints=function(){var e=this.points.geometry.attributes.position.array;return[new THREE__namespace.Vector3(e[0],e[1],e[2]),new THREE__namespace.Vector3(e[3],e[4],e[5])]},t.prototype.setMaterial=function(e){var r=this.line.material;for(var o in e)if(e.hasOwnProperty(o)){var s=e[o];o==="dashed"?(r.dashed=s,s?r.defines.USE_DASH="":delete r.defines.USE_DASH,r.needsUpdate=!0):r[o]=e[o]}this.needsRender=!0},t.prototype.setResolution=function(e,r){var o=this.line.material.resolution;(o.x!==e||o.y!==r)&&(o.set(e,r),this.needsRender=!0)},t})(THREE__namespace.Object3D);Object.assign(FiveLine.prototype,{isFiveLine:!0});var Constants={ComponentState:Object.freeze({DEFAULT:"default",TOUCHED:"touched",PRESSED:"pressed"}),ComponentProperty:Object.freeze({BUTTON:"button",X_AXIS:"xAxis",Y_AXIS:"yAxis",STATE:"state"}),ComponentType:Object.freeze({TRIGGER:"trigger",SQUEEZE:"squeeze",TOUCHPAD:"touchpad",THUMBSTICK:"thumbstick",BUTTON:"button"}),ButtonTouchThreshold:.05,AxisTouchThreshold:.1,VisualResponseProperty:Object.freeze({TRANSFORM:"transform",VISIBILITY:"visibility"})};function fetchJsonFile(n){return __awaiter(this,void 0,void 0,function(){var t;return __generator(this,function(e){switch(e.label){case 0:return[4,fetch(n)];case 1:if(t=e.sent(),t.ok)return[2,t.json()];throw new Error(t.statusText)}})})}function fetchProfilesList(n){return __awaiter(this,void 0,void 0,function(){var t,e;return __generator(this,function(r){switch(r.label){case 0:if(!n)throw new Error("No basePath supplied");return t="profilesList.json",[4,fetchJsonFile("".concat(n,"/").concat(t))];case 1:return e=r.sent(),[2,e]}})})}function fetchProfile(n,t){return __awaiter(this,arguments,void 0,function(e,r,o,s){var u,l,c,f,p,d;return o===void 0&&(o=null),s===void 0&&(s=!0),__generator(this,function(h){switch(h.label){case 0:if(!e)throw new Error("No xrInputSource supplied");if(!r)throw new Error("No basePath supplied");return[4,fetchProfilesList(r)];case 1:if(u=h.sent(),e.profiles.some(function(g){var A=u[g];return A&&(l={profileId:g,profilePath:"".concat(r,"/").concat(A.path),deprecated:!!A.deprecated}),!!l}),!l){if(!o)throw new Error("No matching profile name found");if(c=u[o],!c)throw new Error('No matching profile name found and default profile "'.concat(o,'" missing.'));l={profileId:o,profilePath:"".concat(r,"/").concat(c.path),deprecated:!!c.deprecated}}return[4,fetchJsonFile(l.profilePath)];case 2:if(f=h.sent(),s){if(d=void 0,d=f.layouts[e.handedness],!d)throw new Error("No matching handedness, ".concat(e.handedness,", in profile ").concat(l.profileId));d.assetPath&&(p=l.profilePath.replace("profile.json",d.assetPath))}return[2,{profile:f,assetPath:p}]}})})}var defaultComponentValues={xAxis:0,yAxis:0,button:0,state:Constants.ComponentState.DEFAULT};function normalizeAxes(n,t){n===void 0&&(n=0),t===void 0&&(t=0);var e=n,r=t,o=Math.sqrt(n*n+t*t);if(o>1){var s=Math.atan2(t,n);e=Math.cos(s),r=Math.sin(s)}var u={normalizedXAxis:e*.5+.5,normalizedYAxis:r*.5+.5};return u}var VisualResponse=(function(){function n(t){this.componentProperty=t.componentProperty,this.states=t.states,this.valueNodeName=t.valueNodeName,this.valueNodeProperty=t.valueNodeProperty,this.valueNodeProperty===Constants.VisualResponseProperty.TRANSFORM&&(this.minNodeName=t.minNodeName,this.maxNodeName=t.maxNodeName),this.value=0,this.updateFromComponent(defaultComponentValues)}return n.prototype.updateFromComponent=function(t){var e=t.xAxis,r=t.yAxis,o=t.button,s=t.state,u=normalizeAxes(e,r),l=u.normalizedXAxis,c=u.normalizedYAxis;switch(this.componentProperty){case Constants.ComponentProperty.X_AXIS:this.value=this.states.includes(s)?l:.5;break;case Constants.ComponentProperty.Y_AXIS:this.value=this.states.includes(s)?c:.5;break;case Constants.ComponentProperty.BUTTON:this.value=this.states.includes(s)?o:0;break;case Constants.ComponentProperty.STATE:this.valueNodeProperty===Constants.VisualResponseProperty.VISIBILITY?this.value=this.states.includes(s):this.value=this.states.includes(s)?1:0;break;default:throw new Error("Unexpected visualResponse componentProperty ".concat(this.componentProperty))}},n})(),Component=(function(){function n(t,e){var r=this;if(!t||!e||!e.visualResponses||!e.gamepadIndices||Object.keys(e.gamepadIndices).length===0)throw new Error("Invalid arguments supplied");this.id=t,this.type=e.type,this.rootNodeName=e.rootNodeName,this.touchPointNodeName=e.touchPointNodeName,this.visualResponses={},Object.keys(e.visualResponses).forEach(function(o){var s=new VisualResponse(e.visualResponses[o]);r.visualResponses[o]=s}),this.gamepadIndices=Object.assign({},e.gamepadIndices),this.values={state:Constants.ComponentState.DEFAULT,button:this.gamepadIndices.button!==void 0?0:void 0,xAxis:this.gamepadIndices.xAxis!==void 0?0:void 0,yAxis:this.gamepadIndices.yAxis!==void 0?0:void 0}}return Object.defineProperty(n.prototype,"data",{get:function(){var t=__assign({id:this.id},this.values);return t},enumerable:!1,configurable:!0}),n.prototype.updateFromGamepad=function(t){var e=this;if(this.values.state=Constants.ComponentState.DEFAULT,this.gamepadIndices.button!==void 0&&t.buttons.length>this.gamepadIndices.button){var r=t.buttons[this.gamepadIndices.button];this.values.button=r.value,this.values.button=this.values.button<0?0:this.values.button,this.values.button=this.values.button>1?1:this.values.button,r.pressed||this.values.button===1?this.values.state=Constants.ComponentState.PRESSED:(r.touched||this.values.button>Constants.ButtonTouchThreshold)&&(this.values.state=Constants.ComponentState.TOUCHED)}this.gamepadIndices.xAxis!==void 0&&t.axes.length>this.gamepadIndices.xAxis&&(this.values.xAxis=t.axes[this.gamepadIndices.xAxis],this.values.xAxis=this.values.xAxis<-1?-1:this.values.xAxis,this.values.xAxis=this.values.xAxis>1?1:this.values.xAxis,this.values.state===Constants.ComponentState.DEFAULT&&Math.abs(this.values.xAxis)>Constants.AxisTouchThreshold&&(this.values.state=Constants.ComponentState.TOUCHED)),this.gamepadIndices.yAxis!==void 0&&t.axes.length>this.gamepadIndices.yAxis&&(this.values.yAxis=t.axes[this.gamepadIndices.yAxis],this.values.yAxis=this.values.yAxis<-1?-1:this.values.yAxis,this.values.yAxis=this.values.yAxis>1?1:this.values.yAxis,this.values.state===Constants.ComponentState.DEFAULT&&Math.abs(this.values.yAxis)>Constants.AxisTouchThreshold&&(this.values.state=Constants.ComponentState.TOUCHED)),Object.values(this.visualResponses).forEach(function(o){o.updateFromComponent(e.values)})},n})(),MotionController=(function(){function n(t,e,r){var o=this;if(!t)throw new Error("No xrInputSource supplied");if(!e)throw new Error("No profile supplied");this.xrInputSource=t,this.assetUrl=r,this.id=e.profileId,this.layoutDescription=e.layouts[t.handedness],this.components={},Object.keys(this.layoutDescription.components).forEach(function(s){var u=o.layoutDescription.components[s];o.components[s]=new Component(s,u)}),this.updateFromGamepad()}return Object.defineProperty(n.prototype,"gripSpace",{get:function(){return this.xrInputSource.gripSpace},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"targetRaySpace",{get:function(){return this.xrInputSource.targetRaySpace},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"data",{get:function(){var t=[];return Object.values(this.components).forEach(function(e){t.push(e.data)}),t},enumerable:!1,configurable:!0}),n.prototype.updateFromGamepad=function(){var t=this;Object.values(this.components).forEach(function(e){e.updateFromGamepad(t.xrInputSource.gamepad)})},n})(),DEFAULT_PROFILES_PATH="https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles",DEFAULT_PROFILE="generic-trigger",XRControllerModel=(function(n){__extends(t,n);function t(){var e=n.call(this)||this;return e.motionController=null,e.envMap=null,e}return t.prototype.setEnvironmentMap=function(e){var r=this;return this.envMap==e?this:(this.envMap=e,this.traverse(function(o){o instanceof THREE__namespace.Mesh&&o.isMesh&&(o.material.envMap=r.envMap,o.material.needsUpdate=!0)}),this)},t.prototype.updateMatrixWorld=function(e){n.prototype.updateMatrixWorld.call(this,e),this.motionController&&(this.motionController.updateFromGamepad(),Object.values(this.motionController.components).forEach(function(r){Object.values(r.visualResponses).forEach(function(o){var s=o.valueNode,u=o.minNode,l=o.maxNode,c=o.value,f=o.valueNodeProperty;s&&(f===Constants.VisualResponseProperty.VISIBILITY?s.visible=c:f===Constants.VisualResponseProperty.TRANSFORM&&(s.quaternion.copy(u.quaternion).slerp(l.quaternion,c),s.position.lerpVectors(u.position,l.position,c)))})}))},t})(THREE.Object3D);function findNodes(n,t){Object.values(n.components).forEach(function(e){var r=e.type,o=e.touchPointNodeName,s=e.visualResponses;if(r===Constants.ComponentType.TOUCHPAD)if(e.touchPointNode=t.getObjectByName(o),e.touchPointNode){var u=new THREE.SphereGeometry(.001),l=new THREE.MeshBasicMaterial({color:255}),c=new THREE.Mesh(u,l);e.touchPointNode.add(c)}else console.warn("Could not find touch dot, ".concat(e.touchPointNodeName,", in touchpad component ").concat(e.id));Object.values(s).forEach(function(f){var p=f.valueNodeName,d=f.minNodeName,h=f.maxNodeName,g=f.valueNodeProperty;if(g===Constants.VisualResponseProperty.TRANSFORM){if(f.minNode=t.getObjectByName(d),f.maxNode=t.getObjectByName(h),!f.minNode){console.warn("Could not find ".concat(d," in the model"));return}if(!f.maxNode){console.warn("Could not find ".concat(h," in the model"));return}}f.valueNode=t.getObjectByName(p),f.valueNode||console.warn("Could not find ".concat(p," in the model"))})})}function addAssetSceneToControllerModel(n,t){findNodes(n.motionController,t),n.envMap&&t.traverse(function(e){e instanceof THREE__namespace.Mesh&&e.isMesh&&(e.material.envMap=n.envMap,e.material.needsUpdate=!0)}),n.add(t)}var XRControllerModelFactory=(function(){function n(t){t===void 0&&(t=null),this.gltfLoader=t,this.path=DEFAULT_PROFILES_PATH,this._assetCache={}}return n.prototype.createControllerModel=function(t){var e=this,r=new XRControllerModel,o=null;return t.addEventListener("connected",function(s){var u=s.data;u.targetRayMode!=="tracked-pointer"||!u.gamepad||fetchProfile(u,e.path,DEFAULT_PROFILE).then(function(l){var c=l.profile,f=l.assetPath;r.motionController=new MotionController(u,c,f);var p=e._assetCache[r.motionController.assetUrl];if(p)o=p.scene.clone(),addAssetSceneToControllerModel(r,o);else{if(!e.gltfLoader)throw new Error("GLTFLoader not set.");e.gltfLoader.load(r.motionController.assetUrl,function(d){e._assetCache[r.motionController.assetUrl]=d,o=d.scene.clone(),addAssetSceneToControllerModel(r,o)})}}).catch(function(l){console.warn(l)})}),t.addEventListener("disconnected",function(){r.motionController=null,r.remove(o),o=null}),r},n})(),defaultXRPanoramaControllerInitArgs=__assign({},omit(defaultPanoramaControllerCustomInitArgs,["maxLatitude","minLatitude"]));function mapPanoResource(n,t){return n}var CONTROLLER_EVNET_DELTA_TIME=300,scratchRaycaster=new THREE__namespace.Raycaster,scratchVector3=new THREE__namespace.Vector3,XRPanoramaController=(function(n){__extends(t,n);function t(e){var r=n.call(this,e)||this;r.xrManager=new XRManager(r.renderer,r.renderer.getContext(),{onSessionStart:function(c){r.emit("xr.session.start",createEvent("xr.session.start",{session:c,machineType:r.xrManager.machineType}))},onSessionEnd:function(){r.emit("xr.session.end",createEvent("xr.session.end",{session:null,machineType:r.xrManager.machineType}))}}),r.xrControllerRay={left:new THREE__namespace.Raycaster,right:new THREE__namespace.Raycaster},r.xrControllerRay.left.params.Points={threshold:.1},r.xrControllerRay.left.firstHitOnly=!0,r.xrControllerRay.left.floorIndex=-1,r.xrControllerRay.right.params.Points={threshold:.1},r.xrControllerRay.right.firstHitOnly=!0,r.xrControllerRay.right.floorIndex=-1,r.gazeRay=null,r.pointerLines={left:new FiveLine,right:new FiveLine},r.pointerLines.left.visible=!1,r.pointerLines.right.visible=!0,r.pointerLines.left.setMaterial({color:new THREE__namespace.Vector3(1,1,1)}),r.pointerLines.left.points.material.depthTest=!1,r.pointerLines.right.setMaterial({color:new THREE__namespace.Vector3(1,1,1)}),r.pointerLines.right.points.material.depthTest=!1,r.controllerWrappers=[new THREE__namespace.Group,new THREE__namespace.Group];var o=r.xrManager.getController(0);r.controllerWrappers[0].add(o);var s=r.xrManager.getController(1);r.controllerWrappers[1].add(s);var u=new XRControllerModelFactory;u.gltfLoader={load:function(c,f){internalFetcher.ajax(c,{responseType:"arraybuffer"}).then(function(p){var d;return parseGltf(p.body,{resourcePath:c.slice(0,c.lastIndexOf("/")+1),search:(d=c.split("?")[1])!==null&&d!==void 0?d:"",fetcher:internalFetcher})}).then(function(p){return f(p)})}},(r.xrManager.machineType==="Oculus"||r.xrManager.machineType==="Pico")&&r.scene.add(r.pointerLines.left,r.pointerLines.right,r.controllerWrappers[0],r.controllerWrappers[1]),r.panoResources={},r.panoResources[r.locationMotion.keyframes[0].key=r.locationMotion.keyframes[1].key=createUuid()]={panoId:panoStringify(r.currentPano),leftPanoPicture:null,position:r.camera.pose.offset.clone(),effect:"fade",fixCameraTransform:new THREE__namespace.Matrix4},r.parallaxCameraMatrixs=[];var l=AnimationFrameLoop.shared.getContext();return l?(r.on("xr.session.end",function(){r.scene.remove(r.pointerLines.left,r.pointerLines.right)}),r.xrManager.setSession(l),r.on("xr.session.start",function(){var c=r.xrManager.getControllerGrip(0);c.add(u.createControllerModel(c)),r.controllerWrappers[0].add(c);var f=r.xrManager.getControllerGrip(1);f.add(u.createControllerModel(f)),r.controllerWrappers[1].add(f)}),r.xrHandleState={LeftAxesUp:{touchStartTime:0,touchStart:!1},LeftAxesDown:{touchStartTime:0,touchStart:!1},LeftAxesLeft:{touchStartTime:0,touchStart:!1},LeftAxesRight:{touchStartTime:0,touchStart:!1},LeftTrigger:{touchStartTime:0,touchStart:!1},LeftPinch:{touchStartTime:0,touchStart:!1},RightAxesUp:{touchStartTime:0,touchStart:!1},RightAxesDown:{touchStartTime:0,touchStart:!1},RightAxesLeft:{touchStartTime:0,touchStart:!1},RightAxesRight:{touchStartTime:0,touchStart:!1},RightTrigger:{touchStartTime:0,touchStart:!1},RightPinch:{touchStartTime:0,touchStart:!1},Y:{touchStartTime:0,touchStart:!1},X:{touchStartTime:0,touchStart:!1},A:{touchStartTime:0,touchStart:!1},B:{touchStartTime:0,touchStart:!1}},r.xrManager.machineType==="VP"&&r.initHandEvent(),r):(console.error("获取session失败,请退出重试"),r)}return t.parseArgs=function(e){if(e instanceof t)return e;var r=__assign(__assign({},e),{maxLatitude:Math.PI/2,minLatitude:-Math.PI/2});return n.parseArgs.call(this,r)},t.initAnimationEndState=function(e){var r=this.parseArgs(e),o=n.initAnimationEndState.call(this,r);return __assign(__assign({},o),{mode:"XRPanorama"})},t.prototype.updateConfiguration=function(e){return n.prototype.updateConfiguration.call(this,__assign(__assign({},e),{maxLatitude:Math.PI/2,minLatitude:-Math.PI/2}))},t.prototype.moveToPano=function(e,r,o){var s=this,u,l,c=(u=r.effect)!==null&&u!==void 0?u:"fade";this.userAction=o,this.stopMomentumMovement();var f=panoStringify(e),p=this.works.getObserver(e);if(!p)throw new Error("Invalid PanoIndex");getImageSizeFromURL(p.images.up),this.imageOptions.size;var d=this.imageOptions.transform,h=function(R,w){return mapPanoResource(applyImageURLOptions(R,d,w))},g=__assign({key:"pano.".concat(f)},pick(this.imageOptions,["format","size","quality"])),A={right:p.images.work.getURL(p.images.right),left:p.images.work.getURL(p.images.left),up:p.images.work.getURL(p.images.up),down:p.images.work.getURL(p.images.down),front:p.images.work.getURL(p.images.front),back:p.images.work.getURL(p.images.back)},m="pano:"+jsonHash([A,g,d]);if(this.pendingTextureTask){if(this.pendingTextureTask.hash===m)return;var E=this.pendingTextureTask.panoId;(l=this.panoMeshes.get(E))===null||l===void 0||l.setProgress(0),this.emit("pano.texture.abort",createEvent("pano.texture.abort",{error:null,progress:0,meta:null,pano:e}))}var v=this.modelScene.parameter.resolveValue(),y=v.pano0,b=v.pano1,_;if((y==null?void 0:y.map.name)===m?_=y:(b==null?void 0:b.map.name)===m&&(_=b),_){var T={panoId:f,effect:c,leftPanoPicture:{panoId:_.panoId,map:_.map,mapSize:_.mapSize,matrix:p.matrix.clone().premultiply(p.work.transform),zoom:1},position:p.position.clone().applyMatrix4(p.work.transform),fixCameraTransform:new THREE__namespace.Matrix4};this.doMoveToPano(e,T,r);return}var S="move-to-pano-"+f;this.pending.add(S),this.pendingTextureTask={panoId:f,hash:m,onLoad:function(R){var w;s.pending.delete(S);var M=R.body;if(s.destroyed)M.dispose();else{M.name=m;var B=Array.isArray(M.image)?M.image[0]:M.image,C=(w=B==null?void 0:B.width)!==null&&w!==void 0?w:2048,P={panoId:f,effect:c,leftPanoPicture:{panoId:f,map:M,mapSize:C,matrix:p.matrix.clone(),zoom:1},position:p.position.clone(),fixCameraTransform:new THREE__namespace.Matrix4};s.doMoveToPano(e,P,r)}},onError:function(R){s.pending.delete(S);var w=__assign(__assign(__assign({},e),{mode:s.mode}),clonePose(s.camera.pose));s.emit("pano.error",createEvent("pano.error",{error:R,userAction:s.userAction,options:r,prevPano:s.currentPano,progress:0,state:w})),s.emit("pano.cancel",createEvent("pano.cancel",{error:null,userAction:s.userAction,options:r,prevPano:s.currentPano,progress:0,state:w})),r.moveCancelCallback&&r.moveCancelCallback()}},this.textureLoader.loadCubeTexture(A,{imageURL:{transform:h,options:g},format:THREE__namespace.RGBAFormat,fetcher:getFetcher(p.work)},void 0,void 0,function(R){var w,M;((w=s.pendingTextureTask)===null||w===void 0?void 0:w.hash)===m&&((M=s.panoMeshes.get(f))===null||M===void 0||M.setProgress(R)),s.emit("pano.texture.progress",createEvent("pano.texture.progress",{error:null,progress:R,meta:null,pano:e}))},this.renderer).then(function(R){var w,M;((w=s.pendingTextureTask)===null||w===void 0?void 0:w.hash)===m?(s.pendingTextureTask.onLoad(R),(M=s.panoMeshes.get(f))===null||M===void 0||M.setProgress(0),delete s.pendingTextureTask,s.emit("pano.texture.success",createEvent("pano.texture.success",{error:null,progress:1,meta:R.meta,pano:e}))):R.body.dispose()}).catch(function(R){var w,M;((w=s.pendingTextureTask)===null||w===void 0?void 0:w.hash)===m&&(s.pendingTextureTask.onError(R),(M=s.panoMeshes.get(f))===null||M===void 0||M.setProgress(0),delete s.pendingTextureTask,s.emit("pano.texture.error",createEvent("pano.texture.error",{error:R,progress:0,meta:null,pano:e})),s.emit("error",R))}),this.emit("pano.texture.load",createEvent("pano.texture.load",{error:null,progress:0,meta:null,pano:e}))},t.prototype.doMoveToPano=function(e,r,o){var s=this,u,l,c,f,p,d,h,g,A,m;o===void 0&&(o={});var E=now(),v=createUuid();this.panoResources[v]=r;var y=1,b,_,T;if(this.locationMotion.ended){var S=this.locationMotion.getKeyFrameSegment(E);S[0];var R=S[1],w=this.locationMotion.value,M=this.panoResourceFromLocationMotionKeyframe(R).position,B=r.position;b=Math.max(M.distanceTo(B),y),_=[{key:R.key,progress:0,value:__assign(__assign({},w),{count:0})},{key:v,progress:1,value:{distance:0,count:1}}],T=0}else{var C=this.locationMotion.getKeyFrameSegment(E),P=C[0],R=C[1],w=this.locationMotion.value,F=this.panoResourceFromLocationMotionKeyframe(P).position,M=this.panoResourceFromLocationMotionKeyframe(R).position,B=r.position,L=R.value.count-w.count,O=Math.max(F.distanceTo(M),y)*L,k=Math.max(M.distanceTo(B),y);b=O+k,_=[{key:P.key,progress:0,value:__assign({},w)},{key:R.key,progress:O/b,value:R.value},{key:v,progress:1,value:{count:R.value.count+1,distance:0}}];var D=this.locationMotionKeyframesLength(this.locationMotion.keyframes),J=this.locationMotionKeyframesLength(_);T=this.locationMotion.getProgressVelocity(E)*D/J}var G=r.effect==="instant"?0:this.calculateMovingDuration(o.duration,r.effect==="fly"?b:0),U={longitude:o.longitude,latitude:o.latitude,fov:o.fov},z=__assign(__assign({},e),{mode:this.mode,longitude:(u=U.longitude)!==null&&u!==void 0?u:this.camera.pose.longitude,latitude:(l=U.latitude)!==null&&l!==void 0?l:this.camera.pose.latitude,fov:(c=U.fov)!==null&&c!==void 0?c:this.camera.pose.fov,offset:r.position.clone(),distance:0}),q=this.currentPano;if(this.emit("pano.moveTo",createEvent("pano.moveTo",{options:o,prevPano:q,progress:0,state:z,userAction:this.userAction,error:null})),o.moveStartCallback&&o.moveStartCallback(z),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=noop,this.videoTexture.needsUpdate=!0),this.panoVideo.setMaterial(null),r.effect==="fly")this.cameraMotion.set(U,G).catch(noop);else{var j=coordinatesToVector({longitude:this.cameraMotion.value.longitude,latitude:this.cameraMotion.value.latitude}),K=coordinatesToVector({longitude:(f=U.longitude)!==null&&f!==void 0?f:this.cameraMotion.value.longitude,latitude:(p=U.latitude)!==null&&p!==void 0?p:this.cameraMotion.value.latitude}),Y=new THREE__namespace.Object3D;Y.lookAt(j);var X=new THREE__namespace.Matrix4().makeRotationFromQuaternion(Y.quaternion);Y.lookAt(K);var Q=new THREE__namespace.Matrix4().makeRotationFromQuaternion(Y.quaternion),W=new THREE__namespace.Matrix4().getInverse(X).premultiply(Q),$=this.cameraMotion.value.fov,ie=(d=U.fov)!==null&&d!==void 0?d:this.cameraMotion.value.fov,ee=1;r.effect==="zoomin"?ee=1.5:r.effect==="zoomout"&&(ee=.4);for(var ne=ie*ee,te=0;te<_.length-1;te++){var pe=_[te].key;if(pe){var oe=this.panoResources[pe];oe&&(oe.fixCameraTransform.copy(W),oe.leftPanoPicture&&(oe.leftPanoPicture.zoom=Math.tan(ne/2/180*Math.PI)/Math.tan($/2/180*Math.PI)))}}this.cameraMotion.setKeyframes([{progress:0,value:{longitude:this.cameraMotion.value.longitude,latitude:this.cameraMotion.value.latitude,fov:this.cameraMotion.value.fov}},{progress:0,value:{longitude:(h=U.longitude)!==null&&h!==void 0?h:this.cameraMotion.value.longitude,latitude:(g=U.latitude)!==null&&g!==void 0?g:this.cameraMotion.value.latitude,fov:ne}},{progress:1,value:{longitude:(A=U.longitude)!==null&&A!==void 0?A:this.cameraMotion.value.longitude,latitude:(m=U.latitude)!==null&&m!==void 0?m:this.cameraMotion.value.latitude,fov:ie}}],G).catch(noop)}var de=this.locationMotion.setKeyframes(_,G,T);de.then(function(){for(var me=0,be=s.modelScene.children;me<be.length;me++){var _e=be[me];_e instanceof Model&&_e.show()}var le=__assign(__assign({},e),{mode:s.mode,longitude:s.camera.pose.longitude,latitude:s.camera.pose.latitude,fov:s.camera.pose.fov,offset:s.camera.pose.offset.clone(),distance:0});s.emit("pano.arrived",createEvent("pano.arrived",{options:o,prevPano:q,progress:1,state:le,userAction:s.userAction,error:null})),o.moveEndCallback&&o.moveEndCallback(le);var fe=s.works.getObserver(s.currentPano);if(fe&&fe.video&&s.videoTexture&&s.videoTexture.image instanceof HTMLVideoElement){var re={map:s.videoTexture,size:fe.video.size.clone(),matrix:fe.video.matrix.clone(),panoMatrix:fe.matrix.clone().premultiply(fe.work.transform),alpha:1},ue=createUuid(),ve=s.videoTexture.image;ve.setAttribute("uuid",ue),canplayVideo().then(function(ye){ye&&fe.video&&ve.getAttribute("uuid")===ue&&(ve.oncanplay=function(){ve.oncanplay=noop,ve.play()},ve.ontimeupdate=function(){ve.currentTime>.5&&(ve.ontimeupdate=noop,s.panoVideo.setMaterial(re))},ve.src=fe.video.source)}).catch((function(){ve.removeAttribute("uuid")}))}},function(){s.emit("pano.cancel",createEvent("pano.cancel",{options:o,prevPano:q,progress:0,state:z,userAction:s.userAction,error:null})),o.moveCancelCallback&&o.moveCancelCallback()})},t.prototype.checkSelectedPano=function(e){var r=this,o;this.stopMomentumMovement(),this.camera.getDirection(new THREE__namespace.Vector3).setY(0);var s=null,u=this.works.getObserver(this.currentPano);if(!u)return null;var l=u.work.observers,c=u.accessibleNodes.filter(function(T){if(T===r.currentPano.panoIndex&&u.work.workCode===r.currentPano.workCode)return!1;var S=l[T];if(!S)return!1;var R=scratchVector3.copy(S.position).applyMatrix4(S.work.transform);return R.distanceTo(r.camera.position)>r.maxAccessibleDistance?!1:S.loadable||S.active}),f=this.modelScene.intersectRaycaster(e)[0];if(f){var p=arrayMin(c,function(T){var S=l[T];if(!S)return 1/0;var R=scratchVector3.copy(S.standingPosition).applyMatrix4(S.work.transform);return R.distanceTo(f.point)},!0),d=p[0],h=p[1];typeof d=="number"&&h<this.panoTapTriggerRadius&&(s=(o=l[d])!==null&&o!==void 0?o:null)}if(isNil(s)){var g=this.getForwardObserverOrNot(this.xrManager.cameraVR,e);g&&(s=g)}for(var A=0,m=this.locationMotion.keyframes;A<m.length;A++){var E=m[A],v=this.panoResourceFromLocationMotionKeyframe(E);if(!(E.progress<this.locationMotion.progress)&&s){var y=panoStringify({panoIndex:s.panoIndex,workCode:s.work.workCode});if(v.panoId===y){s=null;break}}}if(isNil(s))return this.locationMotion.ended===!0&&this.cameraBounce(),null;if(!s.active){var y=panoStringify({panoIndex:s.panoIndex,workCode:s.work.workCode}),b=this.panoMeshes.get(y);b&&(b.setDisabled(!1),b.setLoading(!0))}var _={workCode:s.work.workCode,panoIndex:s.panoIndex,mode:this.mode,longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov,distance:0,offset:s?s.position.clone():new THREE__namespace.Vector3};return this.emit("pano.select",createEvent("pano.select",{prevPano:this.currentPano,state:_,userAction:!0,options:{},progress:0,error:null})),s&&s.active?(this.emit("pano.request",createEvent("pano.request",{userAction:!0,prevPano:this.currentPano,progress:0,state:_,options:{},error:null})),{workCode:s.work.workCode,panoIndex:s.panoIndex}):null},t.prototype.destroy=function(){n.prototype.destroy.call(this)},t.prototype.isReady=function(){return!1},t.prototype.updateCamera=function(e,r,o){return Promise.resolve()},t.prototype.updateCameraWithKeyframes=function(e,r,o){return Promise.resolve()},t.prototype.updateTime=function(e,r){for(var o=this,s,u,l,c,f,p,d,h,g,A=[],m=2;m<arguments.length;m++)A[m-2]=arguments[m];this.userAction=!0;var E={},v={},y=this.locationMotion.keyframes[0],b=this.locationMotion.keyframes[this.locationMotion.keyframes.length-1],_=this.locationMotion.getKeyFrameSegment(e),T=_[0],S=_[1],R=this.panoResourceFromLocationMotionKeyframe(T),w=this.panoResourceFromLocationMotionKeyframe(S),M=this.panoResourceFromLocationMotionKeyframe(y),B=this.panoResourceFromLocationMotionKeyframe(b),C=!1;if(this.cameraMotion.ended===!1&&(this.cameraMotion.update(e),v.fov=this.cameraMotion.value.fov),this.modelAlphaMotion.ended===!1&&(this.modelAlphaMotion.update(e),E.modelAlpha=this.modelAlphaMotion.value.modelAlpha),this.perspToOrthoMotion.ended===!1&&(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(clamp$1(this.perspToOrthoMotion.value.perspToOrtho,0,1))),this.locationMotion.ended===!1){this.locationMotion.update(e);var P=this.locationMotion.getKeyFrameSegment(e);P[0];var F=P[1],L=new THREE__namespace.Vector3().copy(R.position),O=new THREE__namespace.Vector3().copy(w.position),k=this.locationMotion.value.count-F.value.count+1;if(E.progress=k,w.leftPanoPicture&&(k<1?R.leftPanoPicture&&(E.pano0=R.leftPanoPicture):E.pano0=w.leftPanoPicture,E.pano1=w.leftPanoPicture),w.effect==="montage"?E.transition="BLACK":w.effect==="spread"?E.transition="SPREAD":E.transition="FADE",(w.effect==="zoomin"||w.effect==="zoomout")&&(E.progress=Math.pow(k,3)),k<1&&w.effect!=="fly"){if(E.pano0&&R.leftPanoPicture){var D={panoId:E.pano0.panoId,map:E.pano0.map,mapSize:E.pano0.mapSize,zoom:E.pano0.zoom,matrix:R.leftPanoPicture.matrix.clone().setPosition(w.position)},J=this.panoPictureObserverMap.get(E.pano0);J&&this.panoPictureObserverMap.set(D,J),E.pano0=D}L.copy(O),C=!0}v.distance=this.locationMotion.value.distance,v.offset=new THREE__namespace.Vector3(L.x+(O.x-L.x)*k,L.y+(O.y-L.y)*k,L.z+(O.z-L.z)*k);for(var G=[],U=[],z=0,q=this.locationMotion.keyframes;z<q.length;z++){var j=q[z],K=j.key,Y=j.progress;K!==void 0&&(G.push(K),Y>this.locationMotion.progress&&U.push(K))}for(var X=0,Q=Object.keys(this.panoResources);X<Q.length;X++){var W=Q[X];if(!(U.indexOf(W)>=0)){var $=this.panoResources[W];if($.leftPanoPicture){var ie=$.leftPanoPicture.map;if(ie){if(ie===((s=E.pano0)===null||s===void 0?void 0:s.map)||ie===((u=E.pano1)===null||u===void 0?void 0:u.map))continue;ie.dispose(),$.leftPanoPicture=null}}G.indexOf(W)>=0||delete this.panoResources[W]}}var ee=panoParse(w.panoId);ee!==this.currentPano&&(this.currentPano=ee,this.accessibleObserverFloorCheckCount=0),this.emit("pano.moving",createEvent("pano.moving",{userAction:this.userAction,prevPano:panoParse(M.panoId),state:__assign(__assign(__assign(__assign({},panoParse(B.panoId)),{mode:this.mode}),clonePose(this.camera.pose)),v),options:{},progress:this.locationMotion.progress,error:null}))}this.camera.setFromPose(v),this.xrManager.cameraVR.projectionMatrix.copy(this.camera.projectionMatrix),this.xrManager.cameraVR.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),this.xrManager.cameraVR.matrix.copy(this.camera.matrix),this.xrManager.cameraVR.position.copy(this.camera.position),this.xrManager.cameraVR.quaternion.copy(this.camera.quaternion),this.xrManager.cameraVR.scale.copy(this.camera.scale),this.xrManager.cameraVR.matrixAutoUpdate=!1,this.xrManager.cameraVR.matrixWorld.copy(this.camera.matrixWorld);var ne=A,te=ne[1],pe=new THREE__namespace.Vector3(0,0,0),oe=new THREE__namespace.Vector2().copy(this.camera.resolution);if(te&&this.xrManager.session&&this.xrManager.referenceSpace&&this.xrManager.session.renderState.baseLayer){var de=this.xrManager.cameraVR,me=this.xrManager.referenceSpace,be=this.xrManager.session.renderState.baseLayer,_e=te.getViewerPose(me),le=(l=_e==null?void 0:_e.views)!==null&&l!==void 0?l:[];this.renderer.setFramebuffer(be.framebuffer);for(var fe=0;fe<le.length;fe++){var re=le[fe],ue=de.cameras[fe],ve=be.getViewport(re);ve&&(ue.projectionMatrix.fromArray(re.projectionMatrix),ue.projectionMatrixInverse.getInverse(ue.projectionMatrix),ue.matrix.fromArray(re.transform.matrix),ue.matrix.setPosition(this.camera.position),ue.matrix.decompose(ue.position,ue.quaternion,ue.scale),ue.matrixWorld.copy(ue.matrix),ue.matrixWorldInverse.getInverse(ue.matrixWorld),ue.matrixAutoUpdate=!1,pe.copy(ue.position),ue.viewport.set(ve.x,ve.y,ve.width,ve.height),oe.set(ve.width,ve.height))}if(this.xrManager.setProjectionFromUnion(this.xrManager.cameraVR,this.xrManager.cameraL,this.xrManager.cameraR),this.camera.quaternion.copy(this.xrManager.cameraVR.quaternion),this.camera.scale.copy(this.xrManager.cameraVR.scale),this.camera.matrix.compose(this.camera.position,this.camera.quaternion,this.camera.scale),this.camera.computePose((c=v.distance)!==null&&c!==void 0?c:this.camera.pose.distance),this.xrManager.session&&this.xrManager.session.inputSources){for(var fe=0;fe<this.xrManager.session.inputSources.length;fe++)if(this.xrManager.session.inputSources[fe]&&this.xrManager.session.inputSources[fe].targetRayMode==="transient-pointer"){var ye=te.getPose(this.xrManager.session.inputSources[fe].targetRaySpace,me);if(ye){var De=ye.transform.orientation,Je=new THREE__namespace.Quaternion(De.x,De.y,De.z,De.w),$e=new THREE__namespace.Vector3(0,0,-1).applyQuaternion(Je),Ue=new THREE__namespace.Raycaster(this.camera.position,$e);this.gazeRay=Ue}}}if(this.xrManager.machineType==="Oculus"||this.xrManager.machineType==="Pico"){for(var he=this.xrManager.session.inputSources,Ye=function(ce){var Se=Ee.xrManager.controllers[ce],Ce=he[ce];if(!Ce)return"continue";Se&&Se.update(Ce,te,me);var Be=Ee.xrManager.getController(ce),Tt=new THREE__namespace.Vector3(0,1.2,0),Xe=Be.position.clone().add(pe).sub(Tt);Ce.handedness==="left"?Ee.xrControllerRay.left.set(Xe,new THREE__namespace.Vector3(0,0,-1).applyEuler(Be.rotation)):Ce.handedness==="right"&&Ee.xrControllerRay.right.set(Xe,new THREE__namespace.Vector3(0,0,-1).applyEuler(Be.rotation)),Ee.controllerWrappers[ce].position.copy(new THREE__namespace.Vector3(0,0,0).add(pe).sub(Tt));var st=Ee.modelScene.intersectRaycaster(Ee.xrControllerRay.right);if(st.length===0){var Bt=Ee.works.getResolvedObserver(Ee.currentPano);st=Ee.xrControllerRay.right.intersectObject(Ee.boundingMesh,!0).map(function(ae){var Ae,Ne=(Ae=Bt==null?void 0:Bt.floorIndex)!==null&&Ae!==void 0?Ae:0;return __assign({floorIndex:Ne,floor:Ne},ae)})}if(st.length>=1&&st[0].face)if(Ce.handedness==="right"){var Ht=Ee.xrControllerRay.right.intersectObject(Ee.xrCustomObjectsScene,!0),Ot=st[0].face.normal,Lt=Ot.clone(),I=st[0].point.clone();Ee.intersectMesh.position.copy(I);var H=I.clone().add(Lt);if(Ee.intersectMesh.lookAt(H),Math.abs(Ot.y)>.99){var N=Ee.camera.position.clone().sub(I);Ee.intersectMesh.rotation.z=-Math.atan2(N.z,N.x)}Ee.intersectMesh.visible=!0,Ee.needsRender=!0,Ht.length>0?(Ee.pointerLines.right.setPoints(Xe,Ht[0].point),Ee.pointerLines.right.points.visible=!0,Ee.intersectMesh.visible=!1):(Ee.pointerLines.right.points.visible=!1,Ee.pointerLines.right.setPoints(Xe,st[0].point));var V=st[0],Z=createEvent("intersect.update",{raycaster:(f=Ee.xrControllerRay.right)!==null&&f!==void 0?f:null,intersection:V!=null?V:null,object:Ee.intersectMesh});if(Ee.emit("intersect.update",Z),Z.defaultPrevented)return Ee.hideIntersectMesh(),{value:void 0}}else Ee.pointerLines.left.setPoints(Xe,st[0].point)},Ee=this,fe=0;fe<he.length;fe++){var Oe=Ye(fe);if(typeof Oe=="object")return Oe.value}this.updateControllerHelper(he,e,r)}}else te||console.error("xrFrame丢失,请重试"),this.xrManager.session||console.error("session丢失,请重试"),this.xrManager.session&&!this.xrManager.session.renderState.baseLayer&&console.error("no layer found");isEmptyObject(E)===!1&&this.modelScene.parameter.set(E),this.emit("camera.update",createEvent("camera.update",{userAction:this.userAction,state:__assign(__assign(__assign({},this.currentPano),{mode:this.mode}),clonePose(this.camera.pose))}));var Fe=this.works.getResolvedObserver(this.currentPano),tt=this.locationMotion.ended?this.getForwardObserverOrNot(this.xrManager.cameraVR):null,rt=this.works.getObserver(R.panoId),Le=this.works.getObserver(w.panoId);if(this.adjustPanoCircleMeshPositionBasedOnModel&&this.helper.visible&&Fe){for(var Ie=[],He=Fe.work.observers,ge=0,we=Fe.accessibleNodes;ge<we.length;ge++){var Pe=we[ge],J=He[Pe];J&&Ie.push(J)}var je=new Map;if(Ie.sort(function(ce,Se){var Ce=je.get(ce);typeof Ce=="undefined"&&(Ce=ce.standingPosition.distanceTo(Fe.standingPosition),je.set(ce,Ce));var Be=je.get(ce);return typeof Be=="undefined"&&(Be=Se.standingPosition.distanceTo(Fe.standingPosition),je.set(Se,Be)),Ce-Be}),Ie.length){this.accessibleObserverFloorCheckCount=this.accessibleObserverFloorCheckCount%Ie.length;var Ve=Ie[this.accessibleObserverFloorCheckCount],Ze=this.modelScene.models.find(function(ce){return ce.work===(Ve==null?void 0:Ve.work)});if(Ve&&Ze&&Ze.visible){var gt=.3,Qe=.05,At=.005,Re=Ve.standingPosition.clone().applyMatrix4(Ve.work.transform),qe=panoStringify({panoIndex:Ve.panoIndex,workCode:Ve.work.workCode}),ft=adjustPanoCircleMeshVectors.map(function(ce){scratchRaycaster.ray.origin.copy(Re),scratchRaycaster.ray.origin.add(scratchVector3.copy(ce).setY(gt)),scratchRaycaster.ray.direction.set(0,-1,0),scratchRaycaster.firstHitOnly=!0,scratchRaycaster.floorIndex=-1;var Se=Ze.intersectRaycaster(scratchRaycaster)[0];return Se&&Se.distance-At<=gt?new THREE__namespace.Vector3().copy(Re).setY(Se.point.y+At):Re});ft.sort(function(ce,Se){return Se.y-ce.y});var dt=ft[Math.floor(ft.length/2)],Ge=ft.filter(function(ce){return ce.distanceTo(dt)<=Qe})[0];if(Ge){var nt=new THREE__namespace.Vector4(Re.x,Re.y,Re.z,Ge.y-Re.y),ct=this.adjustPanoCircleMeshPositionFix.get(qe);ct&&!nt.equals(ct)&&(this.needsRender=!0),this.adjustPanoCircleMeshPositionFix.set(qe,nt)}}this.accessibleObserverFloorCheckCount++}}var se=new Map;if(rt)for(var Te=0,Me=rt.accessibleNodes;Te<Me.length;Te++){var Pe=Me[Te],J=rt.work.observers[Pe];if(J){var qe=panoStringify({panoIndex:J.panoIndex,workCode:J.work.workCode});se.set(qe,J)}}if(Le)for(var xe=0,ze=Le.accessibleNodes;xe<ze.length;xe++){var Pe=ze[xe],J=Le.work.observers[Pe];if(J){var qe=panoStringify({panoIndex:J.panoIndex,workCode:J.work.workCode});se.set(qe,J)}}if(this.panoMeshes.forEach(function(ce,Se){var Ce=se.get(Se);if(Ce){ce.position.copy(Ce.standingPosition).applyMatrix4(Ce.work.transform);var Be=o.adjustPanoCircleMeshPositionFix.get(Se);Be&&(scratchVector3.set(Be.x,Be.y,Be.z),scratchVector3.equals(ce.position)&&(ce.position.y+=Be.w)),ce.scale.setScalar(1.2),se.delete(Se)}else o.helper.remove(ce),ce.dispose(),o.panoMeshes.delete(Se)}),se.forEach(function(ce,Se){var Ce=o.panoCircleMeshCreator(panoParse(Se));Ce.position.copy(ce.standingPosition).applyMatrix4(ce.work.transform);var Be=o.adjustPanoCircleMeshPositionFix.get(Se);Be&&(scratchVector3.set(Be.x,Be.y,Be.z),scratchVector3.equals(Ce.position)&&(Ce.position.y+=Be.w)),Ce.scale.setScalar(1.2),o.panoMeshes.set(Se,Ce),o.helper.add(Ce),se.delete(Se)}),this.camera.pose.distance>.1||C)this.panoMeshes.forEach(function(ce){ce.setOpacity(0),ce.setCurrent(!1),ce.updateTime&&ce.updateTime(e,r),ce.visible=!1});else if(Fe){var at=Fe.work.observers,yt=arrayMin(Fe.accessibleNodes,function(ce){var Se=at[ce];return Se?Fe.standingPosition.distanceTo(Se.standingPosition):1/0},!0),ht=yt[1];ht=clamp$1(ht,2.5,1/0);var Ct=Fe.visibleNodes.concat(Fe.panoIndex).map(function(ce){return panoStringify({panoIndex:ce,workCode:Fe.work.workCode})}),Mt=this.camera.getDirection(new THREE__namespace.Vector3);this.panoMeshes.forEach(function(ce,Se){var Ce=o.works.getObserver(Se);if(Ct.indexOf(Se)===-1)ce.setCurrent(!1),ce.setOpacity(0);else if(!Ce)ce.setCurrent(!1),ce.setOpacity(0);else if(!Ce.loadable&&!Ce.active)ce.setCurrent(!1),ce.setOpacity(0);else{var Be=ce.position.clone().setY(o.camera.position.y).distanceTo(o.camera.position);ce.setCurrent(!ce.loading&&ce.progress===0&&tt!==null&&panoStringify({panoIndex:tt.panoIndex,workCode:tt.work.workCode})===Se),ce.setOpacity(Be<.01?0:clamp$1(ht/Be*1.2,.65,.98));var Tt=o.camera.position.clone().setY(ce.position.y),Xe=new THREE__namespace.Vector3().copy(ce.position).sub(Tt).normalize();if(Se===panoStringify(o.currentPano)){var st=clamp$1((.5-Tt.distanceTo(ce.position))/.5,0,1);Xe.multiplyScalar(1-st).add(Mt.clone().multiplyScalar(st))}Xe.length()>0&&ce.quaternion.setFromEuler(new THREE__namespace.Euler(0,Math.atan2(Xe.x,Xe.z),0))}ce.updateTime&&ce.updateTime(e,r)})}{var k=(p=this.modelScene.parameter.progress)!==null&&p!==void 0?p:1,It=Math.round(k),it=this.modelScene.parameter.pano0,pt=this.modelScene.parameter.pano1,Et=It===0?it:pt,J=void 0;if(Et&&(J=this.works.getObserver(Et.panoId),J||(J=this.panoPictureObserverMap.get(Et))),this.tiling.appearDuration=this.tileAppearDuration,this.tiling.maxRequest=k<=.6?0:this.tileMaxRequest,this.tiling.imageOptions=this.imageOptions,!J||!Et||this.tileLevelForFov===!1){this.tiling.setObserver(null);var Rt={renderer:this.renderer,resolution:oe,pixelRatio:1,time:this.camera.time,cameraMatrix:this.xrManager.cameraVR.matrixWorld,cameraProjectionMatrix:this.xrManager.cameraVR.projectionMatrix,panoMap:null,panoMatrix:new THREE__namespace.Matrix4,panoZoom:1,minLevel:0,level:0};this.tiling.update(Rt),this.modelScene.parameter.set("refinedScreen",null)}else{var ot=getImageSizeLevel(Et.mapSize),wt=ot+1,bt=4;this.tiling.setObserver(J);var Rt={renderer:this.renderer,resolution:oe,pixelRatio:1,time:this.camera.time,cameraMatrix:this.xrManager.cameraVR.matrixWorld,cameraProjectionMatrix:this.xrManager.cameraVR.projectionMatrix,panoMap:Et.map,panoMatrix:Et.matrix,panoZoom:Et.zoom,minLevel:wt,level:bt},vt=this.tiling.update(Rt),St={map:this.tiling.renderTarget.texture,matrixInverse:this.tiling.camera.matrixWorldInverse,projectionMatrix:this.tiling.camera.projectionMatrix,pano:It,opacity:(it==null?void 0:it.panoId)===(pt==null?void 0:pt.panoId)?1:easeInQuart(Math.abs(((d=this.modelScene.parameter.progress)!==null&&d!==void 0?d:0)-.5)*2)},Ke=this.modelScene.parameter.refinedScreen;(vt||St.pano!==(Ke==null?void 0:Ke.pano)||St.opacity!==(Ke==null?void 0:Ke.opacity))&&this.modelScene.parameter.set("refinedScreen",St)}}this.panoVideo.object.position.copy(this.camera.position),this.panoVideo.updateTime(e);{var mt=w.effect,Ft=this.modelScene.parameter,it=Ft.pano0,pt=Ft.pano1;if(it&&pt&&it!==pt&&mt==="fly"&&this.flyEffectUseDepthBuffer){if(((h=this.modelScene.parameter.pano0Depth)===null||h===void 0?void 0:h.panoId)!==it.panoId||((g=this.modelScene.parameter.pano1Depth)===null||g===void 0?void 0:g.panoId)!==pt.panoId){var Pt=500,lt=512;this.pano0DepthCubeRenderTarget?this.pano0DepthCubeRenderTarget.width!==lt&&this.pano0DepthCubeRenderTarget.setSize(lt,lt):this.pano0DepthCubeRenderTarget=new THREE__namespace.WebGLCubeRenderTarget(lt,{minFilter:THREE__namespace.NearestFilter,magFilter:THREE__namespace.NearestFilter,generateMipmaps:!1}),this.pano1DepthCubeRenderTarget?this.pano1DepthCubeRenderTarget.width!==lt&&this.pano1DepthCubeRenderTarget.setSize(lt,lt):this.pano1DepthCubeRenderTarget=new THREE__namespace.WebGLCubeRenderTarget(lt,{minFilter:THREE__namespace.NearestFilter,magFilter:THREE__namespace.NearestFilter,generateMipmaps:!1});var We=new THREE__namespace.CubeCamera(this.camera.near,this.camera.far,this.pano0DepthCubeRenderTarget);We.matrix.copy(it.matrix),We.matrixWorld.copy(We.matrix),We.matrixAutoUpdate=!1,renderDepthCube(this.renderer,this.modelScene,We,Pt);var _t=new THREE__namespace.CubeCamera(this.camera.near,this.camera.far,this.pano1DepthCubeRenderTarget);_t.matrix.copy(pt.matrix),_t.matrixWorld.copy(_t.matrix),_t.matrixAutoUpdate=!1,renderDepthCube(this.renderer,this.modelScene,_t,Pt),this.modelScene.parameter.set({pano0Depth:{panoId:it.panoId,map:this.pano0DepthCubeRenderTarget.texture,mapSize:this.pano0DepthCubeRenderTarget.width,maxDepth:Pt},pano1Depth:{panoId:pt.panoId,map:this.pano1DepthCubeRenderTarget.texture,mapSize:this.pano1DepthCubeRenderTarget.width,maxDepth:Pt}})}}else this.modelScene.parameter.set({pano0Depth:null,pano1Depth:null}),this.flyEffectUseDepthBuffer||(this.pano0DepthCubeRenderTarget&&(this.pano0DepthCubeRenderTarget.dispose(),this.pano0DepthCubeRenderTarget=void 0),this.pano1DepthCubeRenderTarget&&(this.pano1DepthCubeRenderTarget.dispose(),this.pano1DepthCubeRenderTarget=void 0))}},t.prototype.render=function(){this.renderer.setScissorTest(!1);var e=this.xrManager.cameraVR;this.renderer.render(this.modelScene,e),this.renderer.autoClearColor=!1,this.renderer.autoClearDepth=!1,this.renderer.render(this.scene,e),this.renderer.autoClearColor=!0,this.renderer.autoClearDepth=!0},t.prototype.onPanGesture=function(){},t.prototype.onTapGesture=function(){},t.prototype.onPinchGesture=function(){},t.prototype.onMouseMove=function(){},t.prototype.onMouseOut=function(){},t.prototype.panoResourceFromLocationMotionKeyframe=function(e){return this.panoResources[e.key]},t.prototype.updateControllerHelper=function(e,r,o){var s=this.xrControllerRay.left,u=this.xrControllerRay.right;if(!(!e||e.length===0)){for(var l={buttons:{X:!1,Y:!1,LeftTrigger:!1,LeftPinch:!1,A:!1,B:!1,RightTrigger:!1,RightPinch:!1}},c=0;c<e.length;c++){var f=e[c].handedness,p=e[c].gamepad;switch(f){case"left":p.axes&&(this.emitHandleEvent(p.axes[2]===-1,"LeftAxesLeft",r),this.emitHandleEvent(p.axes[2]===1,"LeftAxesRight",r),this.emitHandleEvent(p.axes[3]===-1,"LeftAxesUp",r),this.emitHandleEvent(p.axes[3]===1,"LeftAxesDown",r)),p!=null&&p.buttons&&(p.buttons[4]&&this.emitHandleEvent(p.buttons[4].pressed,"X",r),p.buttons[5]&&this.emitHandleEvent(p.buttons[5].pressed,"Y",r),p.buttons[0]&&this.emitHandleEvent(p.buttons[0].pressed,"LeftTrigger",r),p.buttons[1]&&this.emitHandleEvent(p.buttons[1].pressed,"LeftPinch",r));var d={raycaster:s,axes:{up:p.axes&&p.axes[3]<0?Math.abs(p.axes[3]):0,down:p.axes&&p.axes[3]<0?0:Math.abs(p.axes[3]),left:p.axes&&p.axes[2]<0?Math.abs(p.axes[2]):0,right:p.axes&&p.axes[2]<0?0:Math.abs(p.axes[2])},deltaTime:o};l.buttons.X=p.buttons&&p.buttons[4]?p.buttons[4].pressed:!1,l.buttons.Y=p.buttons&&p.buttons[5]?p==null?void 0:p.buttons[5].pressed:!1,l.buttons.LeftTrigger=p.buttons&&p.buttons[0]?p==null?void 0:p.buttons[0].pressed:!1,l.buttons.LeftPinch=p.buttons&&p.buttons[1]?p==null?void 0:p.buttons[1].pressed:!1,l.left=d;break;case"right":p.axes&&(this.emitHandleEvent(p.axes[2]===-1,"RightAxesLeft",r),this.emitHandleEvent(p.axes[2]===1,"RightAxesRight",r),this.emitHandleEvent(p.axes[3]===-1,"RightAxesUp",r),this.emitHandleEvent(p.axes[3]===1,"RightAxesDown",r)),p.buttons&&(p.buttons[4]&&this.emitHandleEvent(p.buttons[4].pressed,"A",r),p.buttons[5]&&this.emitHandleEvent(p.buttons[5].pressed,"B",r),p.buttons[0]&&this.emitHandleEvent(p.buttons[0].pressed,"RightTrigger",r),p.buttons[1]&&this.emitHandleEvent(p.buttons[1].pressed,"RightPinch",r));var h={raycaster:u,axes:{up:p.axes&&p.axes[3]<0?Math.abs(p.axes[3]):0,down:p.axes&&p.axes[3]<0?0:Math.abs(p.axes[3]),left:p.axes&&p.axes[2]<0?Math.abs(p.axes[2]):0,right:p.axes&&p.axes[2]<0?0:Math.abs(p.axes[2])},deltaTime:o};l.right=h,l.buttons.A=p.buttons&&p.buttons[4]?p==null?void 0:p.buttons[4].pressed:!1,l.buttons.B=p.buttons&&p.buttons[5]?p==null?void 0:p.buttons[5].pressed:!1,l.buttons.RightTrigger=p.buttons&&p.buttons[0]?p==null?void 0:p.buttons[0].pressed:!1,l.buttons.RightPinch=p.buttons&&p.buttons[1]?p==null?void 0:p.buttons[1].pressed:!1;break}}this.emit("xr.controller.update",createEvent("xr.controller.update",l))}},t.prototype.emitHandleEvent=function(e,r,o){var s=this.xrControllerRay.left,u=this.xrControllerRay.right;if(e)if(this.xrHandleState[r].touchStart===!1)this.xrHandleState[r].touchStartTime=o,this.xrHandleState[r].touchStart=!0,this.emit("xr.gesture.buttonDown",createEvent("xr.gesture.buttonDown",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!1,isFirst:!0,controllers:{raycaster:{leftRay:s,rightRay:u}}}));else{var l=o-this.xrHandleState[r].touchStartTime;l>CONTROLLER_EVNET_DELTA_TIME&&this.emit("xr.gesture.press",createEvent("xr.gesture.tap",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!0,isFirst:!0,controllers:{raycaster:{leftRay:s,rightRay:u}}}))}else if(this.xrHandleState[r].touchStart===!0){this.emit("xr.gesture.buttonUp",createEvent("xr.gesture.buttonUp",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!0,isFirst:!1,controllers:{raycaster:{leftRay:s,rightRay:u}}}));var l=o-this.xrHandleState[r].touchStartTime;if(l<=CONTROLLER_EVNET_DELTA_TIME){var c=createEvent("xr.gesture.tap",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!0,isFirst:!1,controllers:{raycaster:{leftRay:s,rightRay:u}}}),f=this.emit("xr.gesture.tap",c);!f&&!c.defaultPrevented&&r==="RightTrigger"&&this.checkSelectedPano(this.xrControllerRay.right)}this.xrHandleState[r].touchStart=!1,this.xrHandleState[r].touchStartTime=0}},t.prototype.initHandEvent=function(){var e=this;if(!this.xrManager.session)throw new Error("初始化失败");this.xrManager.session.addEventListener("select",function(r){e.gazeRay&&e.checkSelectedPano(e.gazeRay)})},t})(PanoramaController),Controllers={Floorplan:FloorplanController,Topview:TopviewController,Panorama:PanoramaController,VRPanorama:VRPanoramaController,Model:ModelController,Mapview:MapviewController,XRPanorama:XRPanoramaController},controllersDefaultInitArgs={Floorplan:defaultFloorplanControllerCustomInitArgs,Topview:defaultTopviewControllerCustomInitArgs,Panorama:defaultPanoramaControllerCustomInitArgs,VRPanorama:defaultVRPanoramaControllerCustomInitArgs,Model:defaultModelControllerCustomInitArgs,Mapview:defaultMapviewControllerCustomInitArgs,XRPanorama:defaultXRPanoramaControllerInitArgs},PROXY_CONTROLLER_EVENT_NAMES=["gesture.pan","gesture.tap","gesture.dbltap","gesture.press","gesture.pinch","gesture.mousewheel","gesture.mousemove","gesture.momentum","initAnimation.start","initAnimation.end","camera.update","intersect.update","pano.select","pano.moveTo","pano.moving","pano.arrived","pano.cancel","pano.error","pano.texture.load","pano.texture.progress","pano.texture.success","pano.texture.error","pano.texture.abort","xr.session.start","xr.session.end","xr.gesture.tap","xr.gesture.press","xr.gesture.buttonUp","xr.gesture.buttonDown","xr.controller.update"];function initLegacyEvent(n){n.on("initAnimation.start",function(t){n.emit("initAnimationWillStart",t.state.panoIndex,t.state,t.userAction)}),n.on("initAnimation.end",function(t){n.emit("initAnimationEnded",t.state.panoIndex,t.state,t.userAction)}),n.on("gesture.pan",function(t){var e=!1;e=n.emit("wantsGesture","pan",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsPanGesture",t.state,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","pan",t.pointers,t.isFinal),n.emit("panGesture",t.state,t.isFinal))}),n.on("gesture.tap",function(t){var e=!1;e=n.emit("wantsGesture","tap",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsTapGesture",t.center.raycaster,t.center.coords,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","tap",t.pointers,t.isFinal),n.emit("tapGesture",t.center.raycaster,t.center.coords,t.isFinal))}),n.on("gesture.dbltap",function(t){var e=!1;e=n.emit("wantsGesture","dbltap",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsDblTapGesture",t.center.raycaster,t.center.coords,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","dbltap",t.pointers,t.isFinal),n.emit("dblTapGesture",t.center.raycaster,t.center.coords,t.isFinal))}),n.on("gesture.press",function(t){var e=!1;e=n.emit("wantsGesture","press",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsPressGesture",t.center.raycaster,t.center.coords,t.center.delta,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","press",t.pointers,t.isFinal),n.emit("pressGesture",t.center.raycaster,t.center.coords,t.center.delta,t.isFinal))}),n.on("gesture.pinch",function(t){var e=!1;e=n.emit("wantsGesture","pinch",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsPinchGesture",t.scale,t.state.fov,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","pinch",t.pointers,t.isFinal),n.emit("pinchGesture",t.scale,t.state.fov,t.isFinal))}),n.on("gesture.mousewheel",function(t){var e=!1;e=n.emit("wantsGesture","mouseWheel",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsMouseWheel",t.center.delta,t.state.fov,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","mouseWheel",t.pointers,t.isFinal),n.emit("mouseWheel",t.center.delta,t.state.fov,t.isFinal))}),n.on("gesture.mousemove",function(t){var e=!1;e=n.emit("wantsGesture","mouseMove",t.pointers,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","mouseMove",t.pointers,t.isFinal),e=n.emit("wantsChangeCameraFov",t.state.fov),e&&t.preventDefault())}),n.on("gesture.momentum",function(t){var e=!1;e=n.emit("wantsInteriaPan",t.state),e&&t.preventDefault(),t.defaultPrevented||n.emit("interiaPan",t.state,t.isFinal)}),n.on("camera.update",function(t){n.emit("cameraFovUpdate",t.state.fov,t.userAction),n.emit("cameraDirectionUpdate",t.state,t.userAction);var e=coordinatesToVector(t.state);e.setLength(t.state.distance);var r=t.state.offset.clone().sub(e);n.emit("cameraPositionUpdate",r,t.userAction),n.emit("cameraUpdate",t.state,t.userAction)}),n.on("intersect.update",function(t){if(t.intersection){var e=!1;e=n.emit("wantsShowIntersectionOnModel",t.raycaster),e&&t.preventDefault(),t.defaultPrevented||n.emit("intersectionOnModelUpdate",t.intersection,t.object)}else n.emit("intersectionHidden")}),n.on("pano.request",function(t){var e=n.emit("wantsMoveToPano",t.state.panoIndex,t.options,t.userAction);e||(e=n.emit("wantsToMoveToPano",t.state.panoIndex,t.options,t.userAction)),e&&t.preventDefault(),t.defaultPrevented||n.emit("panoWillLoad",t.state.panoIndex)}),n.on("pano.select",function(t){n.emit("panoSelected",t.state.panoIndex)}),n.on("pano.moveTo",function(t){n.emit("panoLoaded",t.state.panoIndex),n.emit("moveToPano",t.state.panoIndex,t.userAction),n.emit("panoWillArrive",t.state.panoIndex,t.state,t.userAction)}),n.on("pano.moving",function(t){n.emit("movingToPano",t.state.panoIndex,t.prevPano.panoIndex,t.progress)}),n.on("pano.arrived",function(t){n.emit("panoArrived",t.state.panoIndex,t.state,t.userAction)}),n.on("pano.cancel",function(t){n.emit("moveToPanoCanceled",t.state.panoIndex)}),n.on("pano.error",function(t){n.emit("panoLoadError",t.error,t.state.panoIndex)}),n.on("pano.texture.load",function(t){n.emit("textureStartLoad",t.pano.panoIndex)}),n.on("pano.texture.success",function(t){n.emit("textureLoaded",t.pano.panoIndex,t.meta)}),n.on("pano.texture.error",function(t){n.emit("textureError",t.error,t.pano.panoIndex)}),n.on("pano.texture.abort",function(t){n.emit("textureAbort",t.pano.panoIndex)}),n.on("pano.texture.progress",function(t){n.emit("textureLoading",t.progress,t.pano.panoIndex)}),n.on("xr.session.start",function(t){n.emit("webXRSessionStart")}),n.on("xr.session.end",function(t){n.emit("webXRSessionEnd")}),n.on("xr.gesture.tap",function(t){n.emit("webXRControllerEvent","tap",t.buttons,{raycaster:t.controllers.raycaster})}),n.on("xr.gesture.press",function(t){n.emit("webXRControllerEvent","press",t.buttons,{raycaster:t.controllers.raycaster})}),n.on("xr.gesture.buttonUp",function(t){n.emit("webXRControllerEvent","buttonUp",t.buttons,{raycaster:t.controllers.raycaster})}),n.on("xr.gesture.buttonDown",function(t){n.emit("webXRControllerEvent","buttonDown",t.buttons,{raycaster:t.controllers.raycaster})}),n.on("xr.controller.update",function(t){n.emit("webXRControllerRayUpdate",{leftRay:t.left?t.left.raycaster:void 0,rightRay:t.right?t.right.raycaster:void 0}),t.left&&n.emit("webXRAxesUpdate","left",{raycaster:{leftRay:t.left?t.left.raycaster:void 0,rightRay:t.right?t.right.raycaster:void 0},axesState:{up:t.left.axes.up,down:t.left.axes.down,left:t.left.axes.left,right:t.left.axes.right},deltaTime:t.left.deltaTime}),t.right&&n.emit("webXRAxesUpdate","right",{raycaster:{leftRay:t.left?t.left.raycaster:void 0,rightRay:t.right?t.right.raycaster:void 0},axesState:{up:t.right.axes.up,down:t.right.axes.down,left:t.right.axes.left,right:t.right.axes.right},deltaTime:t.right.deltaTime})}),n.on("works.request",function(t){n.emit("willLoad",t.input,t.works[0],t.state)}),n.on("works.load",function(t){n.emit("load",t.input,t.works[0],t.state)}),n.on("works.ready",function(t){n.emit("loaded",t.input,t.works[0])}),n.on("state.change",function(t){n.emit("stateChange",t.state,t.userAction)}),n.on("currentState.change",function(t){n.emit("currentStateChange",t.state,t.userAction)}),n.on("state.set",function(t){n.emit("setState",t.state)}),n.on("state.synced",function(t){n.emit("stateSynced",t.state)}),n.on("model.request",function(t){n.emit("modelWillLoad",t.work.model)}),n.on("model.error",function(t){n.emit("modelLoadError",t.error,t.model)}),n.on("model.load",function(t){n.emit("modelLoaded",t.model)}),n.on("model.changeShownFloor",function(t){n.emit("modelShownFloorChange",t.model.shownFloor,t.model.floorLength)}),n.on("render",function(t){n.emit("renderFrame",t.needsRender)}),n.on("mode.change.request",function(t){n.emit("wantsChangeMode",t.mode,t.prevMode)}),n.on("mode.change",function(t){n.emit("modeChange",t.mode,t.prevMode,t.state.panoIndex,t.state,t.userAction)}),n.on("helpers.visible",function(t){n.emit("helpersVisibleChange",t.object.visible)}),n.on("network.resource",function(t){n.emit("network",t.source,t.requestType,t.requestState,t.detail)})}function generateDefaultVideoElement(){if(typeof window!="undefined"){var n=document.createElement("video");n.loop=!0,n.autoplay=!0,n.playsInline=!0,n.muted=!0,n.crossOrigin="";var t=function(){document.removeEventListener("touchstart",t,!1),document.removeEventListener("mousedown",t,!1),n.muted=!1};return document.addEventListener("touchstart",t,!1),document.addEventListener("mousedown",t,!1),n}else return{}}function initLights(){var n=new THREE__namespace.Group;n.name="internalLights";{var t=new THREE__namespace.DirectionalLight(16777215,.1);t.name="direction0",t.position.copy(new THREE__namespace.Vector3(0,1,0)),n.add(t)}{var t=new THREE__namespace.DirectionalLight(16777215,.1);t.name="direction1",t.position.copy(new THREE__namespace.Vector3(-1,-1,-1)),n.add(t)}{var t=new THREE__namespace.DirectionalLight(16777215,.3);t.name="direction2",t.position.copy(new THREE__namespace.Vector3(1,1,1)),n.add(t)}{var t=new THREE__namespace.AmbientLight(16777215,.6);t.name="ambient0",n.add(t)}return n}function parseKeyValue(n){for(var t,e,r={},o=n.split(/(\;|\,)/),s=0,u=o;s<u.length;s++){var l=u[s],c=l.split("="),f=(t=c[0])===null||t===void 0?void 0:t.trim(),p=(e=c[1])===null||e===void 0?void 0:e.trim();f&&p&&(r[f]=p)}return r}function getViewportScale(){var n;if(typeof document!="undefined")for(var t=document.getElementsByTagName("meta"),e=0;e<t.length;e++){var r=t[e];if(r.getAttribute("name")==="viewport"){var o=parseKeyValue((n=r.getAttribute("content"))!==null&&n!==void 0?n:""),s=Number(o["initial-scale"]);if(!isNaN(s))return s}}return 1}const textureURL="data:image/png;base64,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";var imageSize=[351,63],imageOffset=[20,20],vertices=new Float32Array([-.5,-.5,0,.5,-.5,0,-.5,.5,0,.5,.5,0]),uvs=new Float32Array([0,0,1,0,0,1,1,1]),index=new Uint8Array([0,1,2,1,3,2]),geometry$4=new THREE__namespace.BufferGeometry;geometry$4.setAttribute("position",new THREE__namespace.BufferAttribute(vertices,3));geometry$4.setAttribute("uv",new THREE__namespace.BufferAttribute(uvs,2));geometry$4.setIndex(new THREE__namespace.BufferAttribute(index,1));var material=new THREE__namespace.MeshBasicMaterial({transparent:!0,depthTest:!1,depthWrite:!1,stencilWrite:!1,fog:!1}),mesh$4=new THREE__namespace.Mesh(geometry$4,material);mesh$4.matrixAutoUpdate=!1;var scene$2=new THREE__namespace.Scene;scene$2.add(mesh$4);scene$2.matrixAutoUpdate=!1;var camera$2=new THREE__namespace.OrthographicCamera(-.5,.5,.5,-.5,.1,1);camera$2.position.set(0,0,.5);camera$2.lookAt(0,0,0);camera$2.updateMatrixWorld(!0);camera$2.matrixAutoUpdate=!1;var prevViewport=new THREE__namespace.Vector4,prevScissor=new THREE__namespace.Vector4;function renderPoweredByRealsee(n){if(material.map){var r=n.getViewport(prevViewport),o=n.getScissor(prevScissor),s=n.getScissorTest(),u=n.autoClear,l=o.x+imageOffset[0]/3,c=o.y+imageOffset[1]/3,f=imageSize[0]/3,p=imageSize[1]/3;n.setViewport(l,c,f,p),n.setScissor(l,c,f,p),n.setScissorTest(!0),n.autoClear=!1,n.render(scene$2,camera$2),n.setViewport(r),n.setScissor(o),n.setScissorTest(s),n.autoClear=u}else{var t=new THREE__namespace.Texture,e=new Image;e.onload=function(){t.image=e,t.wrapS=THREE__namespace.ClampToEdgeWrapping,t.wrapT=THREE__namespace.ClampToEdgeWrapping,t.minFilter=THREE__namespace.LinearFilter,t.needsUpdate=!0,t.generateMipmaps=!1,material.needsUpdate=!0,e.onload=noop},e.src=textureURL,material.map=t}}var FRAGMENT$2=`
2134
2134
  precision mediump float;
2135
2135
  precision mediump int;
2136
2136
  uniform sampler2D depthBuffer;
@@ -2246,4 +2246,4 @@ void main() {
2246
2246
  rgb = clamp(lumCompressed * rgb, 0.0, 1.0);
2247
2247
  gl_FragColor = mix(inputColor, vec4(rgb, alpha), progress * 0.9);
2248
2248
  }
2249
- `})||this;return r.material.transparent=!0,r}return Object.defineProperty(t.prototype,"luminanceAdaptiveBuffer",{get:function(){return this.material.uniforms.luminanceAdaptiveBuffer.value},set:function(e){this.material.uniforms.luminanceAdaptiveBuffer.value=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"progress",{get:function(){return this.material.uniforms.progress.value},set:function(e){this.material.uniforms.progress.value=e},enumerable:!1,configurable:!0}),t})(Pass),LuminanceAdaptiveEffect=(function(n){__extends(t,n);function t(e,r,o,s){var u=n.call(this,e,r,o,s)||this;return u.enableTime=now(),u.renderer=e,u.valuePass=new ValuePass(u.renderer),u.luminancePass=new LuminancePass(u.renderer,Math.sqrt(1/3)),u.nextStepPass=new NextStepPass(u.renderer,.01),u.luminanceAdaptivePass=new LuminanceAdaptivePass(u.renderer),u}return t.prototype.render=function(e){this.renderer.setRenderTarget(e[0]),this.renderer.render(this.scene,this.camera),this.enableTime===null&&(this.enableTime=now()),this.luminanceTargetBuffer||(this.luminanceTargetBuffer=new THREE__namespace.WebGLRenderTarget(128,128,{minFilter:THREE__namespace.LinearMipmapLinearFilter,magFilter:THREE__namespace.LinearFilter,encoding:this.renderer.outputEncoding,stencilBuffer:!1,depthBuffer:!1,format:THREE__namespace.RGBAFormat,generateMipmaps:!0}),this.nextStepPass.targetBuffer=this.luminanceTargetBuffer.texture),this.luminancePass.render(e[0],this.luminanceTargetBuffer),this.luminancePrevBuffer||(this.luminancePrevBuffer=new THREE__namespace.WebGLRenderTarget(1,1,{minFilter:THREE__namespace.NearestFilter,magFilter:THREE__namespace.NearestFilter,type:THREE__namespace.HalfFloatType,encoding:this.renderer.outputEncoding,stencilBuffer:!1,depthBuffer:!1}),this.valuePass.render(new THREE__namespace.Vector3(.5,.5,.5),this.luminancePrevBuffer)),this.luminanceNextBuffer||(this.luminanceNextBuffer=new THREE__namespace.WebGLRenderTarget(1,1,{minFilter:THREE__namespace.NearestFilter,magFilter:THREE__namespace.NearestFilter,type:THREE__namespace.HalfFloatType,encoding:this.renderer.outputEncoding,stencilBuffer:!1,depthBuffer:!1}),this.valuePass.render(new THREE__namespace.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((now()-this.enableTime)/100,1),this.luminanceAdaptivePass.render(e[0],e[1])},t.prototype.dispose=function(){var e,r,o;(e=this.luminanceTargetBuffer)===null||e===void 0||e.dispose(),(r=this.luminancePrevBuffer)===null||r===void 0||r.dispose(),(o=this.luminanceNextBuffer)===null||o===void 0||o.dispose(),this.copyPass.dispose(),this.luminancePass.dispose(),this.nextStepPass.dispose(),this.luminanceAdaptivePass.dispose()},t})(Effect),sharedV2=new THREE__namespace.Vector2,LuminanceRenderer=(function(n){__extends(t,n);function t(e){var r,o,s=n.call(this,e)||this;s.type="default",s.luminanceAdaptiveEffect=new LuminanceAdaptiveEffect(s.renderer,s.modelScene,s.camera,s.modelScene);var u=s.renderer.getDrawingBufferSize(sharedV2);return s.screenBuffers=[new THREE__namespace.WebGLRenderTarget(u.x,u.y,{generateMipmaps:!1,encoding:(o=(r=s.renderer)===null||r===void 0?void 0:r.outputEncoding)!==null&&o!==void 0?o:THREE__namespace.sRGBEncoding}),s.enableFragDepth?s.modelRenderTarget:null],s}return t.prototype.render=function(e){var r=this.renderer.getRenderTarget();this.enableFragDepth?(e&&(this.luminanceAdaptiveEffect.enable=!0,this.luminanceAdaptiveEffect.render(this.screenBuffers)),this.depthCopyPass.render(this.modelRenderTarget.depthTexture,r),this.renderer.autoClearDepth=!1,this.renderer.autoClearColor=!0,this.copyPass.render(this.modelRenderTarget,r),this.renderer.setRenderTarget(r),this.renderer.autoClearColor=!1,this.renderer.autoClearDepth=!1,this.renderer.render(this.scene,this.camera),this.renderer.autoClearColor=!0,this.renderer.autoClearDepth=!0):(this.luminanceAdaptiveEffect.enable=!0,this.luminanceAdaptiveEffect.render(this.screenBuffers),this.renderer.autoClearColor=!1,this.renderer.autoClearDepth=!1,this.renderer.render(this.scene,this.camera),this.renderer.autoClearColor=!0,this.renderer.autoClearDepth=!0),this.modelScene.needsRender=!0},t})(BaseRenderer),DEFAULT_MODE_CHANGE_DURATION=800,DEFAULT_CAMERA_FOV=90,DEFAULT_REQUEST_PROXY=function(n){return n.replace("//vrlab-public.ljcdn.com/","//vr-public.realsee-cdn.cn/").replace("//vrlab-image4.ljcdn.com/","//vr-image-4.realsee-cdn.cn/").replace("//vrlab-image3.ljcdn.com/","//vr-image-3.realsee-cdn.cn/").replace("//vrlab-image2.ljcdn.com/","//vr-image-2.realsee-cdn.cn/").replace("//vrlab-image1.ljcdn.com/","//vr-image-1.realsee-cdn.cn/")},scratchSphere=new THREE__namespace.Sphere,scratchViewport=new THREE__namespace.Vector4,scratchScissor=new THREE__namespace.Vector4,scratchClearColor=new THREE__namespace.Color,scratchRenderSize=new THREE__namespace.Vector2,worksMap=new WeakMap,emptyWorks=createWorks([parseWork(null)]),Five=(function(n){__extends(t,n);function t(e){e===void 0&&(e={});var r,o,s,u,l,c,f,p,d,h,g,A,m=n.call(this)||this;if(m.ident=createUuid(),typeof window!="undefined"&&(__FIVE_DEBUG__.instances[m.ident]=m),m.renderSwitch01=0,m.currentUpdateArgs={time:now(),args:[]},m.currentMode="Panorama",m.pano={workCode:"",panoIndex:0},m.needsRender=!1,m.modelSceneNeedsRender=!1,m.onlyRenderIfNeeds=(r=e.onlyRenderIfNeeds)!==null&&r!==void 0?r:!0,m.imageOptions=__assign({},(o=e.imageOptions)!==null&&o!==void 0?o:{}),m.textureOptions=__assign({},(s=e.textureOptions)!==null&&s!==void 0?s:{}),m.poweredByRealsee=(u=e.poweredByRealsee)!==null&&u!==void 0?u:!0,m.backgroundColor=new THREE__namespace.Color((l=e.backgroundColor)!==null&&l!==void 0?l:1579548),m.backgroundAlpha=(c=e.backgroundAlpha)!==null&&c!==void 0?c:1,m.extraElements=[],m.controllerInits={Panorama:Object.assign({},e.panorama),Model:Object.assign({},e.model),Floorplan:Object.assign({},e.floorplan),Topview:Object.assign({},e.topview),Mapview:Object.assign({},e.mapview),VRPanorama:Object.assign({},e.vrPanorama),XRPanorama:Object.assign({},e.xrPanorama)},m.fps={testCount:0,testTime:now()},m.modeChangeDuration=(f=e.modeChangeDuration)!==null&&f!==void 0?f:DEFAULT_MODE_CHANGE_DURATION,m.enableWheel=(p=e.enableWheel)!==null&&p!==void 0?p:!0,typeof window!="undefined")if("renderer"in e)e.renderer instanceof InternalWebGLRenderer&&m.throwError(new Error("cannot render a internal renderer")),m.renderer=e.renderer;else try{m.renderer=new InternalWebGLRenderer({preserveDrawingBuffer:e.preserveDrawingBuffer,antialias:e.antialias,webgl2:e.webgl2,logarithmicDepthBuffer:e.logarithmicDepthBuffer,precision:e.precision,powerPreference:e.powerPreference});var E=getViewportScale();m.renderer.setPixelRatio(E===1?window.devicePixelRatio:1),m.renderer.setSize(512,512),m.renderer.setClearColor(m.backgroundColor,m.backgroundAlpha)}catch(F){F instanceof Error&&m.throwError(F)}m.getPixelsRenderTarget=new THREE__namespace.WebGLRenderTarget(1,1,{encoding:(h=(d=m.renderer)===null||d===void 0?void 0:d.outputEncoding)!==null&&h!==void 0?h:THREE__namespace.sRGBEncoding,generateMipmaps:!1}),m.viewport=Object.assign({left:0,bottom:0,width:1,height:1},e.viewport),m.camera=new Camera(DEFAULT_CAMERA_FOV),m.scene=new Scene,m.xrCustomObjectsScene=new THREE__namespace.Scene,m.scene.add(m.xrCustomObjectsScene),m.scene.matrixAutoUpdate=!1,m.loadWorkTask=Promise.resolve(),m.requestProxy=(g=e.requestProxy)!==null&&g!==void 0?g:DEFAULT_REQUEST_PROXY,m.networkSubscribe=new NetworkSubscribe,m.networkSubscribe.on("network",function(F,L,O,k){var D;m.emit("network.resource",createEvent("network.resource",{source:F,requestType:L,requestState:O,detail:k})),(D=m.analysis)===null||D===void 0||D.network(m.works,F,L,O,k)}),m.boundingMesh=new BoundingMesh$1,m.boundingMesh.name="bounding",m.readyCallbacks=[],m.syncingState=!1,m.helperGroup=new THREE__namespace.Group,m.helperGroup.name="helper",m.helperGroup.matrixAutoUpdate=!1,m.scene.add(m.helperGroup);var v=new Model(emptyWorks[0]);worksMap.set(m,emptyWorks),m.modelScene=new ModelScene,m.modelScene.add(v),m.modelScene.add(m.boundingMesh),defineProperty(v,"loaded",{get:function(){return!1},set:function(F){}}),m.videoTexture=new THREE__namespace.VideoTexture(e.videoInstance||generateDefaultVideoElement());var y=initLights();m.scene.add(y);var b=new THREE__namespace.Group;defineProperty(b,"children",{get:function(){return y.children},set:function(F){y.children=F}}),defineProperty(b,"visible",{get:function(){return y.visible},set:function(F){y.visible=F}}),defineProperty(b,"name",{get:function(){return y.name},set:function(F){y.name=F}}),m.modelScene.add(b),m.state={mode:m.currentMode,workCode:m.pano.workCode,panoIndex:m.pano.panoIndex,longitude:m.camera.pose.longitude,latitude:m.camera.pose.latitude,fov:m.camera.pose.fov,offset:m.camera.pose.offset.clone(),distance:m.camera.pose.distance},m.stateSynced=!1,m.destroyed=!1,m.paused=!0,typeof window!="undefined"&&(e.play!==!1&&m.play(),m.stopAnimationLoop=AnimationFrameLoop.shared.add(function(F,L){for(var O=[],k=2;k<arguments.length;k++)O[k-2]=arguments[k];m.updateTime.apply(m,__spreadArray([F,L],O,!1))},!1,0,10));var _=function(){typeof document!="undefined"&&document.fullscreenElement===null&&m.currentMode==="VRPanorama"&&m.controller.emit("vr.requestExit",createEvent("vr.requestExit",{}))},T=function(){m.needsRender=!0,m.modelSceneNeedsRender=!0};if(typeof document!="undefined"&&document.addEventListener("fullscreenchange",_,!1),m.renderer&&m.renderer.domElement.addEventListener("webglcontextrestored",T,!1),m.removeEventListeners=function(){typeof document!="undefined"&&document.removeEventListener("fullscreenchange",_,!1),m.renderer&&m.renderer.domElement.removeEventListener("webglcontextrestored",T,!1)},m.plugins={},e.plugins&&e.plugins.length)for(var S=0,R=e.plugins;S<R.length;S++){var w=R[S];if(typeof w=="function")w(m);else if(Array.isArray(w)){var M=w[0],B=w[1],C=w[2];if(typeof M=="function"){var P=M(m,C);typeof B=="string"&&(m.plugins[B]?m.throwError(new Error("plugin name ".concat(B," is exists."))):m.plugins[B]=P)}}}return m.meshReplaceMaterialMap=new Map,m.meshOriginMaterialMap=new Map,initLegacyEvent(m),m.enableLayeringRendering=(A=e.enableLayeringRendering)!==null&&A!==void 0?A:!1,m._buildInRendererType="default",m._builtinRenderer=null,m}return Object.defineProperty(t,"version",{get:function(){return"6.6.0-alpha.5"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"dracoPath",{get:function(){return draco.decoderPath},set:function(e){draco.setDecoderPath(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t,"ktx2Path",{get:function(){return ktx2.transcoderPath},set:function(e){ktx2.setTranscoderPath(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"panoIndex",{get:function(){return this.pano.panoIndex},enumerable:!1,configurable:!0}),t.prototype.dispose=function(){var e,r;if(this.destroyed!==!0){delete __FIVE_DEBUG__.instances[this.ident],this.emit("dispose"),this.destroyed=!0,this.pause(),this.stopAnimationLoop&&(this.stopAnimationLoop(),delete this.stopAnimationLoop),(e=this.renderer)===null||e===void 0||e.setAnimationLoop(null),this.off(),this.networkSubscribe.off(),this.controller&&(this.controller.destroy(),this.controller=void 0);var o=this.getElement();o&&o.parentNode&&o.parentNode.removeChild(o);var s=this.modelScene.parameter;s.pano0&&s.pano0.map.dispose(),s.pano1&&s.pano1.map!==((r=s.pano0)===null||r===void 0?void 0:r.map)&&s.pano1.map.dispose(),s.reset("pano0","pano1");for(var u=0,l=this.modelScene.children;u<l.length;u++){var c=l[u];c.dispose&&c.dispose(),this.modelScene.remove(c)}this.meshReplaceMaterialMap.forEach(function(f){f.dispose()}),this.meshOriginMaterialMap.forEach(function(f){f.dispose()}),this.renderer instanceof InternalWebGLRenderer&&this.renderer.forceContextLoss&&this.renderer.forceContextLoss()}},t.prototype.setViewport=function(e){Object.assign(this.viewport,e),this.needsRender=!0,this.modelSceneNeedsRender=!0},Object.defineProperty(t.prototype,"helperVisible",{get:function(){return this.helperGroup.visible},set:function(e){this.helperGroup.visible!==e&&(this.helperGroup.visible=e,this.emit("helpers.visible",createEvent("helpers.visible",{object:this.helperGroup})),this.needsRender=!0)},enumerable:!1,configurable:!0}),t.prototype.getBuiltinRenderer=function(e){var r=this._builtinRenderer;if((r==null?void 0:r.type)!==this._buildInRendererType)switch(r&&r.dispose(),this._buildInRendererType){case"default":this._builtinRenderer=new DefaultRenderer({renderer:e,camera:this.camera,scene:this.scene,modelScene:this.modelScene,enableLayeringRendering:this.enableLayeringRendering});break;case"edl":this._builtinRenderer=new EDLRenderer({renderer:e,camera:this.camera,scene:this.scene,modelScene:this.modelScene,enableLayeringRendering:this.enableLayeringRendering});break;case"hq":this._builtinRenderer=new HQRenderer({renderer:e,camera:this.camera,scene:this.scene,modelScene:this.modelScene,enableLayeringRendering:this.enableLayeringRendering});break;case"luminance":this._builtinRenderer=new LuminanceRenderer({renderer:e,camera:this.camera,scene:this.scene,modelScene:this.modelScene,enableLayeringRendering:this.enableLayeringRendering});break}return this._builtinRenderer},Object.defineProperty(t.prototype,"renderEffect",{get:function(){return this._buildInRendererType},set:function(e){this._buildInRendererType=e,this.modelSceneNeedsRender=!0},enumerable:!1,configurable:!0}),t.prototype.updateConfiguration=function(e,r){r===void 0&&(r=!0);var o=!1;if(e.panorama&&(Object.assign(this.controllerInits.Panorama,omitUndefinedFields(e.panorama)),this.currentMode==="Panorama"&&(o=!0)),e.model&&(Object.assign(this.controllerInits.Model,omitUndefinedFields(e.model)),this.currentMode==="Model"&&(o=!0)),e.floorplan&&(Object.assign(this.controllerInits.Floorplan,omitUndefinedFields(e.floorplan)),this.currentMode==="Floorplan"&&(o=!0)),e.topview&&(Object.assign(this.controllerInits.Topview,omitUndefinedFields(e.topview)),this.currentMode==="Topview"&&(o=!0)),e.mapview&&(Object.assign(this.controllerInits.Mapview,omitUndefinedFields(e.mapview)),this.currentMode==="Mapview"&&(o=!0)),e.vrPanorama&&(Object.assign(this.controllerInits.VRPanorama,omitUndefinedFields(e.vrPanorama)),this.currentMode==="VRPanorama"&&(o=!0)),e.imageOptions&&(Object.assign(this.imageOptions,e.imageOptions),(this.currentMode==="Panorama"||this.currentMode==="VRPanorama")&&(o=!0)),e.textureOptions&&Object.assign(this.textureOptions,e.textureOptions),r&&o&&this.controller&&this.currentMode){var s=this.controller.updateConfiguration(this.controllerInits[this.currentMode]);s||this.changeMode(this.currentMode,this.getCurrentState(),0,!1,!0)}},t.prototype.appendTo=function(e,r){if(r===void 0&&(r={}),!!this.renderer){if(!(this.renderer instanceof InternalWebGLRenderer)){this.throwError(new Error("cannot call appendTo method when render a external renderer"));return}var o=this.getElement();if(o){e.appendChild(o),this.refresh(r);var s=window.getComputedStyle(e).position;s!=="relative"&&s!=="absolute"&&s!=="fixed"&&s!=="sticky"&&(e.style.position="relative")}}},t.prototype.refresh=function(e,r){if(e===void 0&&(e={}),!!this.renderer){var o=this.getElement();if(o){var s=o.parentNode;if(s&&s.nodeName){var u=e.width,l=u===void 0?s.offsetWidth:u,c=e.height,f=c===void 0?s.offsetHeight:c;this.renderer instanceof InternalWebGLRenderer&&(r&&this.renderer.setPixelRatio(r),this.renderer.setSize(l,f))}var p=new THREE__namespace.Vector2;this.renderer.getDrawingBufferSize(p),this.needsRender=!0,this.modelSceneNeedsRender=!0;var d=now(),h=d-this.currentUpdateArgs.time,g=this.currentUpdateArgs.args;this.updateTime(d,h,g)}}},t.prototype.addExtraElement=function(e){var r=this;return this.extraElements.indexOf(e)===-1&&(this.extraElements.push(e),this.controller&&this.controller.bindExtraElement(e)),function(){return r.removeExtraElement(e)}},t.prototype.removeExtraElement=function(e){var r=this.extraElements.indexOf(e);r!==-1&&(this.extraElements.splice(r,1),this.controller&&this.controller.unbindExtraElement(e))},t.prototype.getSize=function(e){if(!this.renderer)throw new Error("renderer is not initialized");return this.renderer.getSize(e),e.x*=this.viewport.width,e.y*=this.viewport.height,e},t.prototype.getDrawingBufferSize=function(e){if(!this.renderer)throw new Error("renderer is not initialized");return this.renderer.getDrawingBufferSize(e),e.x*=this.viewport.width,e.y*=this.viewport.height,e},t.prototype.updateCamera=function(e,r,o){if(o===void 0&&(o=!0),!this.controller)throw new Error("controller is not initialized.");return this.controller.updateCamera(e,r,o)},t.prototype.updateCameraWithKeyframes=function(e,r,o){if(o===void 0&&(o=!0),!this.controller)throw new Error("controller is not initialized.");return this.controller.updateCameraWithKeyframes(e,r,o)},Object.defineProperty(t.prototype,"works",{get:function(){var e=worksMap.get(this);return e||emptyWorks},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"work",{get:function(){return this.works[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"observers",{get:function(){return this.work.observers},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"models",{get:function(){return this.modelScene.models},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"model",{get:function(){return this.modelScene.models[0]},enumerable:!1,configurable:!0}),t.prototype.load=function(e,r,o,s){var u=this;if(s===void 0&&(s=!0),!this.renderer)throw new Error("renderer is not initialized");var l=this.loadWorkTask.then(function(){return isPromise(e)?e.then(function(c){return u.load_(c,r,o,s)}):u.load_(e,r,o,s)});return this.loadWorkTask=l.catch(function(c){u.throwError(c)}),l},t.prototype.load_=function(e,r,o,s){var u=this,l,c,f,p,d,h,g,A,m,E;s===void 0&&(s=!0);var v={};typeof o=="number"?v.duration=o:typeof o=="object"&&Object.assign(v,o),this.works===emptyWorks&&(v.duration===void 0&&(v.duration=0),v.effect===void 0&&(v.effect="instant"));var y=[];if(Array.isArray(e))for(var b=0,_=e;b<_.length;b++){var T=_[b];T instanceof Work?y.push(T):typeof T!="string"&&"work"in T?y.push(parseWork(T.work,T)):y.push(parseWork(T))}else e instanceof Work?y.push(e):y.push(parseWork(e));for(var S=createWorks(y),R=function(Q){var W=w,$=new Fetcher({get networkSubscribe(){return W.networkSubscribe},requestProxy:function(ie){return Promise.resolve(ie).then(function(ee){return W.requestProxy(ee)}).then(function(ee){return verifyURL(ee,Q.allowHosts)}).then(function(ee){if(ee instanceof Error)throw ee;return ee})}});registerFetcher(Q,$)},w=this,M=0,B=S;M<B.length;M++){var C=B[M];R(C)}r===void 0&&(r="inherit"),r==="inherit"&&this.works===emptyWorks&&(r="initial");var P=S.initial,F=P.work.observers[0],L=F?{workCode:F.work.workCode,panoIndex:F.panoIndex}:{workCode:P.work.workCode,panoIndex:0},O=(l=P.mode)!==null&&l!==void 0?l:F?"Panorama":"Mapview",k={};if(r==="inherit"){O=this.currentMode;var D=(f=(c=S[0])===null||c===void 0?void 0:c.observers)===null||f===void 0?void 0:f[this.panoIndex];D?L={workCode:D.work.workCode,panoIndex:D.panoIndex}:typeof S.initial.panoIndex=="number"?L={workCode:S.initial.work.workCode,panoIndex:S.initial.panoIndex}:(O==="Panorama"||O==="VRPanorama"||O==="XRPanorama")&&(O="Mapview"),k={longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov,distance:void 0,offset:void 0}}else if(r==="initial")typeof P.panoIndex=="number"&&(L={workCode:P.work.workCode,panoIndex:P.panoIndex}),P.mode&&(O=P.mode),k={longitude:P.longitude,latitude:P.latitude,fov:P.fov,distance:P.distance,offset:(p=P.offset)===null||p===void 0?void 0:p.clone()};else{if(O=(d=r.mode)!==null&&d!==void 0?d:this.currentMode,typeof r.panoIndex=="number"){var D=S.getObserver({workCode:(g=(h=r.workCode)!==null&&h!==void 0?h:P.work.workCode)!==null&&g!==void 0?g:"",panoIndex:r.panoIndex});D&&(L={workCode:D.work.workCode,panoIndex:D.panoIndex})}k={longitude:r.longitude,latitude:r.latitude,fov:r.fov,distance:r.distance,offset:r.offset}}var J=__assign(__assign(__assign({},L),{mode:O}),k),G=this.getCurrentState(),U=(A=v.duration)!==null&&A!==void 0?A:this.modeChangeDuration;(O==="Floorplan"||O==="Topview"||O==="Mapview")&&this.currentMode===O&&(U=0);var z="fly";(O==="Panorama"||O==="VRPanorama"||O==="XRPanorama")&&this.currentMode===O&&(z=(m=v.effect)!==null&&m!==void 0?m:"fade"),this.emit("works.request",createEvent("works.request",{input:e,works:S,state:J,userAction:s}));var q=function(){u.pano=L;var Q=__assign(__assign({initial:{state:J,currentState:G,duration:U,effect:z,userAction:s}},u.commonParams()),u.controllerInits[O]),W=Controllers[O].initAnimationEndState(Q);if(u.controller&&u.currentMode===O)u.controller.updateWork(S,W,{effect:z,duration:U},s)===!1&&(u.controller.destroy(),u.controller=u.applyController(O,Q));else{var $=u.currentMode;if(u.controller)u.controller.destroy();else{var ie=Controllers[O].initAnimationEndState(Q);u.camera.setFromPose(ie),u.emit("camera.update",createEvent("camera.update",{state:u.getCurrentState(),userAction:s}))}u.controller=u.applyController(O,Q);var ee=createEvent("mode.change",{prevMode:$,mode:O,state:W,userAction:s});try{u.emit("mode.change",ee)}catch(ne){console.error(ne)}}u.updateTime(u.currentUpdateArgs.time,0,u.currentUpdateArgs.args)};worksMap.set(this,S);var j=Promise.resolve();if(O===t.Mode.Floorplan||O===t.Mode.Topview||O===t.Mode.Mapview||O===t.Mode.Model){this.modelScene.loaded===!1&&(this.camera.setFromPose(J),assignPose(this.state,this.camera.pose)),this.controller||(this.currentMode=O);var K=this.loadModels(S,v);j=Promise.all(K.map(function(Q){return Q.loadedReady})).then(function(){u.needsRender=!0,u.modelSceneNeedsRender=!0,q(),u.emit("camera.update",createEvent("camera.update",{state:u.getCurrentState(),userAction:s}))})}else{q();var Y=!1;this.modelScene.autoRefine=!1;var X=function(){u.works===S&&Y===!1&&(u.needsRender=!0,u.modelSceneNeedsRender=!0,u.emit("camera.update",createEvent("camera.update",{state:u.getCurrentState(),userAction:s})),Y=!0,u.modelScene.autoRefine=!0)},K=this.loadModels(S,v);j=Promise.all(K.map(function(W){return W.initReady})).then(noop),this.controller.once("pano.arrived",X),this.controller.once("pano.cancel",X),setTimeout(X,((E=v.duration)!==null&&E!==void 0?E:this.modeChangeDuration)+1e3)}return this.emit("works.load",createEvent("works.load",{input:e,state:this.getCurrentState(),userAction:s,works:S})),j.then(function(){return u.ready()}).then(function(){var Q;u.emit("works.ready",createEvent("works.ready",{input:e,state:u.getCurrentState(),userAction:s,works:S})),(Q=u.analysis)===null||Q===void 0||Q.work(S)})},t.prototype.reset=function(){var e=this,r=this.loadWorkTask.then(function(){return e.reset_()});return this.loadWorkTask=r.catch(function(o){e.throwError(o)}),r},t.prototype.reset_=function(){var e=this;return new Promise(function(r){var o;e.controller&&(e.controller.destroy(),e.controller=void 0);var s=e.modelScene.parameter;s.pano0&&s.pano0.map.dispose(),s.pano1&&s.pano1.map!==((o=s.pano0)===null||o===void 0?void 0:o.map)&&s.pano1.map.dispose(),s.set({pano0:null,pano1:null,modelAlpha:1}),e.renderer&&e.modelScene.update(e.renderer,e.camera);for(var u=0,l=e.modelScene.children;u<l.length;u++){var c=l[u];c instanceof Model&&(c.dispose(),e.modelScene.remove(c))}e.needsRender=!0,e.modelSceneNeedsRender=!0,worksMap.delete(e);var f=parseWork(null),p=new Model(f);p.work=f,worksMap.set(e,createWorks([f])),e.currentMode="Mapview",e.pano={workCode:"",panoIndex:0},e.camera.setFromPose({distance:0,fov:DEFAULT_CAMERA_FOV,longitude:0,latitude:0,offset:new THREE__namespace.Vector3(0,0,0)}),e.state={mode:e.currentMode,workCode:e.pano.workCode,panoIndex:e.pano.panoIndex,longitude:e.camera.pose.longitude,latitude:e.camera.pose.latitude,fov:e.camera.pose.fov,offset:e.camera.pose.offset.clone(),distance:e.camera.pose.distance},e.camera.needsRender=!1,e.needsRender=!1,e.modelSceneNeedsRender=!1,r()})},t.prototype.changeMode=function(e,r,o,s,u){var l=this;return r===void 0&&(r={}),s===void 0&&(s=!0),u===void 0&&(u=!1),new Promise(function(c,f){var p,d,h,g;if(!l.renderer)throw new Error("renderer is not initialized.");r=__assign({},r);var A=0;l.controller&&(typeof o=="number"?A=o:A=(p=o==null?void 0:o.duration)!==null&&p!==void 0?p:l.modeChangeDuration);var m="fly";l.controller&&typeof o=="object"&&o.effect&&(m=o.effect);var E=typeof r.panoIndex=="number"?{workCode:(g=(d=r.workCode)!==null&&d!==void 0?d:(h=l.work)===null||h===void 0?void 0:h.workCode)!==null&&g!==void 0?g:"",panoIndex:r.panoIndex}:l.pano;if(!t.Mode.hasOwnProperty(e)){var v=new Error('mode "'.concat(e,'" is not existed'));l.throwError(v),f(v);return}if((e===t.Mode.Panorama||e===t.Mode.VRPanorama||e===t.Mode.XRPanorama)&&!l.works.getObserver(E)){var v=new Error("PanoId ".concat(panoStringify(E)," not existed."));l.throwError(v),f(v);return}(e===t.Mode.Floorplan||e===t.Mode.Topview||e===t.Mode.Mapview||e===t.Mode.Model)&&(l.modelScene.loaded||(A=0));var y=l.controller,b=l.currentMode,_=function(){if(l.controller&&l.controller.stopMomentumMovement(),l.controller&&u===!1&&b===e)e===t.Mode.Panorama||e===t.Mode.Model||e===t.Mode.VRPanorama||e===t.Mode.XRPanorama?!panoEqual(l.pano,E)&&"moveToPano"in l.controller&&typeof l.controller.moveToPano=="function"?l.controller.moveToPano(E,__assign({duration:A},r),s):l.controller.updateCamera(r,A,s).catch(noop):(panoEqual(l.pano,E)||(l.pano=E),l.controller.updateCamera(r,A,s).catch(noop));else{var S=__assign(__assign({},r),E),R=__assign(__assign({initial:{state:S,currentState:l.getCurrentState(),duration:A,effect:m,userAction:s}},l.commonParams()),l.controllerInits[e]),w=Controllers[e].initAnimationEndState(R),M=createEvent("mode.change.request",{prevMode:l.currentMode,mode:e,state:w,userAction:s});if(l.emit("mode.change.request",M),!M.defaultPrevented){y&&y.destroy(),l.controller=l.applyController(e,R);var B=createEvent("mode.change",{prevMode:l.currentMode,mode:e,state:w,userAction:s});l.emit("mode.change",B)}}c()};if(e===t.Mode.VRPanorama)l.requestFullscreen(),requestDeviceOrientationPermission().then(function(){return _()}).catch(function(S){S instanceof Error&&(l.exitFullscreen(),l.throwError(S),f(S))});else if(e===t.Mode.XRPanorama){var T=AnimationFrameLoop.shared.getContext();T?T.end():requestXRSessionPermission().then(function(S){AnimationFrameLoop.shared.setContext(S),_()}).catch(function(S){S instanceof Error&&(l.throwError(S),f(S))})}else _()})},t.prototype.getPixels=function(e,r,o,s,u,l,c){if(!this.renderer)throw new Error("renderer is not initialized.");var f=this.renderer.getPixelRatio(),p=this.renderer.getRenderTarget(),d=this.renderer.getSize(new THREE__namespace.Vector2),h=0,g=0,A=1,m=1,E,v,y,b,_;typeof e=="number"?(h=e,typeof r=="number"&&(g=r),typeof o=="number"&&(A=o),typeof s=="number"&&(m=s),E=u,v=l,_=c):(h=e.x,g=e.y,A=e.width,m=e.height,E=e.pixelRatio,v=e.flipY,y=e.helperVisible,b=e.skipPanorama,_=e.buffer),h=Math.ceil(h),g=Math.ceil(g),A=Math.ceil(A),m=Math.ceil(m),E=Math.ceil(E!=null?E:f),v=v!=null?v:!1;var T=this.helperVisible,S=this.modelScene.parameter.modelAlpha;this.helperVisible=y!=null?y:this.helperVisible,b&&(this.controller instanceof Controllers.Panorama||this.controller instanceof Controllers.VRPanorama||this.controller instanceof Controllers.XRPanorama)&&b===!0&&this.modelScene.parameter.set("modelAlpha",1),this.modelScene.update(this.renderer,this.camera);var R=this.getPixelsRenderTarget;R.setSize(A*E,m*E),this.renderer.setRenderTarget(R),this.camera.pixelRatio=E,this.camera.resolution.set(A,m),this.camera.setViewOffset(d.width,d.height,h,d.height-g-m,A,m),this.scene.update(this.renderer,this.camera),this.render(),this.helperVisible=T,S===void 0?this.modelScene.parameter.reset("modelAlpha"):this.modelScene.parameter.set("modelAlpha",S),this.renderer.setRenderTarget(p),this.camera.clearViewOffset(),this.camera.pixelRatio=f,this.getSize(this.camera.resolution),this.camera.aspect=this.camera.resolution.width/this.camera.resolution.height,this.modelScene.update(this.renderer,this.camera),this.scene.update(this.renderer,this.camera);var w=A*E,M=m*E,B=w*M,C=B*4;if(_){if(_.length!==C)throw new Error("buffer length is not equals pixels ".concat(C))}else _=new Uint8Array(C);if(this.renderer.readRenderTargetPixels(R,0,0,A*E,m*E,_),v)for(var P=B/2,F=0,L=0,O=0,k=0;L<P;L++)for(k=(M-Math.floor(L/w)-1)*w+L%w,O=0;O<4;O++)F=_[L*4+O],_[L*4+O]=_[k*4+O],_[k*4+O]=F;return _},t.prototype.getElement=function(){var e;return(e=this.renderer)===null||e===void 0?void 0:e.domElement},t.prototype.render=function(e){var r=this.renderer;if(r){var o=r.getRenderTarget(),s=r.autoClear,u=r.autoClearColor,l=r.autoClearDepth,c=r.autoClearStencil,f=scratchClearColor.copy(r.getClearColor()),p=r.getClearAlpha(),d=r.getViewport(scratchViewport),h=r.getScissor(scratchScissor),g=r.getScissorTest(),A=r.getSize(scratchRenderSize),m=r.getPixelRatio(),E=Math.floor(A.x*this.viewport.left),v=Math.floor(A.y*this.viewport.bottom),y=Math.floor(A.x*this.viewport.width),b=Math.floor(A.y*this.viewport.height);r.setClearColor(this.backgroundColor,this.backgroundAlpha),r.setViewport(E,v,y,b),r.setScissor(E,v,y,b);var _=this.viewport.bottom!==0||this.viewport.left!==0||this.viewport.width!==1||this.viewport.height!==1;r.setScissorTest(_);var T=this.scene.background;this.modelScene.background=this.camera.isOrthographicCamera?null:T,this.modelScene.environment=this.scene.environment,this.scene.background=null;var S=this.getBuiltinRenderer(r);S.setSize(A.x,A.y,m),this.controller?this.controller.render(S,this.onlyRenderIfNeeds?this.modelSceneNeedsRender:!0):S.render(this.onlyRenderIfNeeds?this.modelSceneNeedsRender:!0),this.scene.background=T,this.modelScene.background=null,this.modelScene.environment=null,this.poweredByRealsee&&this.currentMode!=="VRPanorama"&&this.currentMode!=="XRPanorama"&&r.getRenderTarget()!==this.getPixelsRenderTarget&&renderPoweredByRealsee(r),r.setRenderTarget(o),r.autoClear=s,r.autoClearColor=u,r.autoClearDepth=l,r.autoClearStencil=c,r.setClearColor(f,p),r.setViewport(d),r.setScissor(h),r.setScissorTest(g),e&&AnimationFrameLoop.shared.add(e,!0)}},t.prototype.updateTime=function(e,r){for(var o,s=this,u=[],l=2;l<arguments.length;l++)u[l-2]=arguments[l];if(this.currentUpdateArgs={time:e,args:u},!this.destroyed){if(this.renderer&&ktx2.detectSupport(this.renderer),this.syncingState=this.syncState(e,r),this.controller&&(o=this.controller).updateTime.apply(o,__spreadArray([e,r],u,!1)),this.renderer&&(this.camera.pixelRatio=this.renderer.getPixelRatio(),this.getSize(this.camera.resolution),this.camera.aspect=this.camera.resolution.width/this.camera.resolution.height),this.camera.autoNearFar){var c=this.modelScene.boundingBox.getBoundingSphere(scratchSphere),f=c.radius*2;c.containsPoint(this.camera.position)||(f=this.camera.position.distanceTo(c.center)+c.radius),f=clamp$1(f,800,5e4),this.camera.far!==f&&(this.camera.far=f);var p=f/1e4;p=clamp$1(p,.03,.1),this.camera.near!==p&&(this.camera.near=p)}if(this.camera.controllerMode=this.currentMode,this.camera.updateTime(e),this.renderer){var d=this.modelScene.loaded,h=this.modelScene.refined;if(this.modelScene.loaded){for(var g=[],A=0,m=this.modelScene.children;A<m.length;A++){var E=m[A];E instanceof Model&&E.outdated&&g.push(E)}for(var v=0,y=g;v<y.length;v++){var b=y[v];this.modelScene.remove(b),b.dispose()}if(g.length>0)for(var _=0,T=this.modelScene.children;_<T.length;_++){var E=T[_];E instanceof Model&&(E.visible=!0,this.modelSceneNeedsRender=!0)}}this.modelScene.update(this.renderer,this.camera),d===!1&&this.modelScene.loaded===!0&&(this.controller&&this.controller.updateModel(this.modelScene),AnimationFrameLoop.shared.add(function(){s.emit("models.load",createEvent("models.load",{modelScene:s.modelScene}))},!0,0,10)),h===!1&&this.modelScene.refined===!0&&AnimationFrameLoop.shared.add(function(){s.emit("models.refined",createEvent("models.refined",{modelScene:s.modelScene}))},!0,0,10)}this.renderer&&this.scene.update(this.renderer,this.camera),this.syncingState=!1,this.controller&&(this.controller.needsRender===!0&&(this.controller.needsRender=!1,this.needsRender=!0),this.controller.modelSceneNeedsRender===!0&&(this.controller.modelSceneNeedsRender=!1,this.modelSceneNeedsRender=!0)),this.camera.needsRender===!0&&(this.camera.needsRender=!1,this.needsRender=!0,this.modelSceneNeedsRender=!0),this.modelScene.needsRender===!0&&(this.modelScene.needsRender=!1,this.needsRender=!0,this.modelSceneNeedsRender=!0),this.scene.needsRender===!0&&(this.scene.needsRender=!1,this.needsRender=!0),this.onlyRenderIfNeeds!==!0&&(this.needsRender=!0,this.modelSceneNeedsRender=!0),this.modelSceneNeedsRender===!0&&(this.needsRender=!0);var S=this.camera.resolution.width*this.camera.pixelRatio*this.camera.resolution.height*this.camera.pixelRatio;S>4096*2048?this.renderSwitch01=this.renderSwitch01^1:this.renderSwitch01=0,this.renderSwitch01!==0&&(this.needsRender=!1),this.paused===!0&&(this.needsRender=!1);var R=createEvent("render.prepare",{needsRender:this.needsRender});this.emit("render.prepare",R),R.defaultPrevented&&(this.needsRender=!1),this.renderer&&this.needsRender&&this.render(),this.emit("render",createEvent("render",{needsRender:this.needsRender})),this.needsRender=!1,this.modelSceneNeedsRender=!1,this.hasListener("fps")&&(this.fps.testTime&&e-this.fps.testTime<1e3?this.fps.testCount++:(this.emit("fps",this.fps.testCount),this.fps.testTime=e,this.fps.testCount=0))}},t.prototype.pause=function(){this.paused=!0,this.renderer&&this.renderer instanceof InternalWebGLRenderer&&this.renderer.clear(!0,!0,!0)},t.prototype.play=function(){this.needsRender=!0,this.modelSceneNeedsRender=!0,this.paused=!1},t.prototype.moveToPano=function(e,r,o){r===void 0&&(r={}),o===void 0&&(o=!0);var s=this,u=s.controller,l=s.renderer;if(!u)return this.throwError(new Error("controller is not initialized.")),Promise.resolve();if(!l)return this.throwError(new Error("renderer is not initialized.")),Promise.resolve();var c=this.works.getObserver(e);if(!c)return this.throwError(new Error("pano ".concat(JSON.stringify(e)," not existed."))),Promise.resolve();var f={workCode:c.work.workCode,panoIndex:c.panoIndex};return"moveToPano"in u&&typeof u.moveToPano=="function"?u.moveToPano(f,r,o):c&&(this.pano=f,this.once("initAnimation.start",function(p){r.moveStartCallback&&r.moveStartCallback(p.state)}),this.once("initAnimation.end",function(p){r.moveEndCallback&&r.moveEndCallback(p.state)}),this.changeMode(t.Mode.Panorama,r,{effect:r.effect},o)),this.ready()},t.prototype.preloadPano=function(e,r){var o=this;r===void 0&&(r=noop);var s=this.works.getObserver(e);if(!s)return Promise.reject(new Error("Pano ".concat(JSON.stringify(e)," never found")));var u=["right","left","up","down","front","back"],l=now();return Promise.all(u.map(function(c){var f=panoStringify({panoIndex:s.panoIndex,workCode:s.work.workCode}),p=__assign({key:"pano.".concat(f,".").concat(c)},pick(o.imageOptions,["size","format","quality","mappings"])),d=s.images[c],h=o.imageOptions.transform?o.imageOptions.transform(d,p):imageURL(d,p);return getFetcher(s.work).preload(h)})).then(function(){var c=now()-l;return r(c),c})},t.prototype.project2d=function(e,r){if(r===void 0&&(r=!1),!this.renderer)return null;if(r){var o=this.camera.position,s=e.clone().sub(o),u=new THREE__namespace.Raycaster(o,s.clone().normalize());u.params.Points={threshold:.1};var l=this.modelScene.intersectRaycaster(u)[0];if(l&&l.distance+.01<s.length())return null}var c=e.clone().project(this.camera);if(Math.abs(c.z)>1)return null;var f=this.renderer.getSize(new THREE__namespace.Vector2),p=f.x*this.viewport.width,d=f.y*this.viewport.height,h=f.x*this.viewport.left+(c.x+1)/2*p,g=f.y*(1-this.viewport.bottom-this.viewport.height)+(-c.y+1)/2*d;return new THREE__namespace.Vector2(h,g)},t.prototype.getCurrentState=function(){return __assign(__assign({},this.camera.copyPose()),{mode:this.currentMode,workCode:this.pano.workCode,panoIndex:this.pano.panoIndex})},t.prototype.setState=function(e,r,o){var s,u,l,c,f,p,d,h,g,A;r===void 0&&(r=!1),o===void 0&&(o=!0),e=Object.assign({},e),e.offset&&!(e instanceof THREE__namespace.Vector3)&&(e.offset=new THREE__namespace.Vector3(e.offset.x,e.offset.y,e.offset.z));var m;if(typeof e.panoIndex=="number")if(e.workCode)m={workCode:e.workCode,panoIndex:e.panoIndex};else{var E=(u=(s=this.work)===null||s===void 0?void 0:s.workCode)!==null&&u!==void 0?u:"",v=this.state.workCode;this.works.filter(function(P){return P.workCode===v}).length>0&&(E=v),m={workCode:E,panoIndex:e.panoIndex}}var y=(l=e.mode)!==null&&l!==void 0?l:this.state.mode,b,_,T,S,R;if(this.controller&&this.controller.stopMomentumMovement(),this.state.mode!==y){if(y==="VRPanorama"){this.changeMode("VRPanorama",void 0,void 0,!0);return}var w={workCode:m==null?void 0:m.workCode,panoIndex:m==null?void 0:m.panoIndex};typeof e.longitude=="number"&&(w.longitude=e.longitude),typeof e.latitude=="number"&&(w.latitude=e.latitude),typeof e.fov=="number"&&(w.fov=e.fov),typeof e.distance=="number"&&(w.distance=e.distance),e.offset instanceof THREE__namespace.Vector3&&(w.offset=e.offset);var M=__assign(__assign({initial:{state:w,currentState:this.getCurrentState(),duration:this.modeChangeDuration,effect:"fly",userAction:!1}},this.commonParams()),this.controllerInits[y]),B=Controllers[y].initAnimationEndState(M);b=B.longitude,_=B.latitude,T=B.fov,S=B.offset,R=B.distance}else b=(c=e.longitude)!==null&&c!==void 0?c:this.state.longitude,_=(f=e.latitude)!==null&&f!==void 0?f:this.state.latitude,T=(p=e.fov)!==null&&p!==void 0?p:this.state.fov,S=(d=e.offset)!==null&&d!==void 0?d:this.state.offset,R=(h=e.distance)!==null&&h!==void 0?h:this.state.distance;var C={workCode:(m!=null?m:this.pano).workCode,panoIndex:(m!=null?m:this.pano).panoIndex,mode:y,longitude:b,latitude:_,fov:T,offset:S,distance:R};this.emit("state.set",createEvent("state.set",{userAction:o,state:C})),stateEqual(this.state,C)||(this.controller&&C.mode==="VRPanorama"&&C.mode!==this.state.mode?(assignState(this.state,C),this.changeMode("VRPanorama")):this.controller&&C.mode==="XRPanorama"&&C.mode!==this.state.mode?(assignState(this.state,C),this.changeMode("XRPanorama")):(assignState(this.state,C),this.controller&&o&&(this.controller.userAction=!1),r&&this.state.mode===C.mode&&(this.syncingState=this.syncState(now(),0,r),this.syncingState&&((g=this.controller)===null||g===void 0||g.updateTime(now(),0),this.syncingState=!1)),this.emit("state.change",createEvent("state.change",{userAction:o,state:this.state})),(A=this.analysis)===null||A===void 0||A.state(this.works,this.state)))},t.prototype.syncState=function(e,r,o){o===void 0&&(o=!1);var s=this.stateSynced;if(this.stateSynced=!1,!this.controller)return!1;if(this.state.mode!==this.currentMode){var u={mode:this.state.mode,workCode:this.state.workCode,panoIndex:this.state.panoIndex,longitude:this.state.longitude,latitude:this.state.latitude,fov:this.state.fov,offset:this.state.offset,distance:this.state.distance};return this.changeMode(this.state.mode,u,this.modeChangeDuration,this.controller.userAction),!0}if(!this.controller.isReady())return!1;if(this.controller instanceof Controllers.Model){if(notSimilarVector3(this.camera.pose.offset,this.state.offset)){var l={longitude:this.state.longitude,latitude:this.state.latitude,fov:this.state.fov,offset:this.state.offset};return this.controller.moveToPosition(this.state.offset,__assign(__assign({},l),{duration:o?0:void 0}),!1),!0}}else{var c={workCode:this.state.workCode,panoIndex:this.state.panoIndex};if(!panoEqual(c,this.pano)&&"moveToPano"in this.controller&&typeof this.controller.moveToPano=="function"){var l={longitude:this.state.longitude,latitude:this.state.latitude,fov:this.state.fov,offset:this.state.offset,distance:this.state.distance};return this.controller.moveToPano(c,l,!1),!0}}if(this.controller instanceof Controllers.Floorplan||this.controller instanceof Controllers.Topview||this.controller instanceof Controllers.Mapview){var f=1,p=.2,d=.2,h=Math.PI/45,g=o?this.state.fov:stepNumber(this.camera.pose.fov,this.state.fov,f),A=Math.abs(this.camera.pose.distance-this.state.distance),m=A>d*15?A/15:p,E=o?this.state.distance:stepNumber(this.camera.pose.distance,this.state.distance,m),v=this.camera.pose.offset.distanceTo(this.state.offset),y=v>d*15?v/15:d,b=o?new THREE__namespace.Vector3().copy(this.state.offset):stepVector(this.camera.pose.offset,this.state.offset,y),_=o?{longitude:this.state.longitude,latitude:this.state.latitude}:stepCoordinates({longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude},{longitude:this.state.longitude,latitude:this.state.latitude},h),T=_.longitude,S=_.latitude;if(notSimilarValue(g,this.camera.pose.fov)||notSimilarVector3(b,this.camera.pose.offset)||notSimilarValue(E,this.camera.pose.distance)||notSimilarValue(T,this.camera.pose.longitude,Math.PI*2)||notSimilarValue(S,this.camera.pose.latitude)){var R={x:b.x,y:b.y,z:b.z},w={fov:g};return Object.assign(R,{distance:E}),Object.assign(w,{longitude:T,latitude:S}),this.controller.stopMomentumMovement(),this.controller.cameraMotion.set(w,0).catch(noop),this.controller.locationMotion.set(R,0).catch(noop),!0}}else{var M=1,B=Math.PI/45,g=o?this.state.fov:stepNumber(this.camera.pose.fov,this.state.fov,M),C=o?{longitude:this.state.longitude,latitude:this.state.latitude}:stepCoordinates({longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude},{longitude:this.state.longitude,latitude:this.state.latitude},B),T=C.longitude,S=C.latitude,E=this.state.distance,b=new THREE__namespace.Vector3().copy(this.state.offset);if(notSimilarValue(E,this.camera.pose.distance)&&(this.state.distance=this.camera.pose.distance),notSimilarVector3(b,this.camera.pose.offset)&&(this.state.offset=this.camera.pose.offset.clone()),notSimilarValue(T,this.camera.pose.longitude,Math.PI*2)||notSimilarValue(S,this.camera.pose.latitude)||notSimilarValue(g,this.camera.pose.fov))return this.controller.stopMomentumMovement(),this.controller.cameraMotion.set({longitude:T,latitude:S,fov:g},0).catch(noop),!0}if(this.stateSynced=!0,s===!1&&this.emit("state.synced",createEvent("state.synced",{userAction:!1,state:this.state})),this.readyCallbacks.length&&this.stateSynced){var P=this.currentMode,F=P===t.Mode.Floorplan||P===t.Mode.Topview||P===t.Mode.Mapview||P===t.Mode.Model;if(!F||this.modelScene.loaded){var L=this.readyCallbacks.slice();this.readyCallbacks.length=0;for(var O=0,k=L;O<k.length;O++){var D=k[O];this.controller instanceof Controllers.Panorama&&D.tile===!0&&!this.controller.isTileReady()?this.readyCallbacks.push(D):D()}}}return!1},t.prototype.ready=function(e){var r=this;return e===void 0&&(e={}),new Promise(function(o){var s;r.readyCallbacks.push(Object.assign(o,{tile:(s=e.tile)!==null&&s!==void 0?s:!1}))}).then(function(){return r.model.initReady})},t.prototype.requestFullscreen=function(){var e;if(isMobile){var r=(e=this.getElement())===null||e===void 0?void 0:e.parentNode;r&&"requestFullscreen"in r&&typeof document!="undefined"&&document.fullscreenElement===null&&r.requestFullscreen()}},t.prototype.exitFullscreen=function(){typeof document!="undefined"&&document.fullscreenElement&&"exitFullscreen"in document&&document.exitFullscreen()},t.prototype.throwError=function(e){this.hasListener("error")?this.emit("error",e):console.error(e)},t.prototype.loadModels=function(e,r){for(var o=this,s,u,l,c,f,p,d=new Map,h=!1,g=[],A=0,m=this.modelScene.children;A<m.length;A++){var E=m[A];E instanceof Model&&(E.outdated=!0,d.set(E.work.workCode,E),h=!0)}for(var v=function(_){var T=e[_],S=T.workCode&&d.get(T.workCode);if(S)S.work=T,S.outdated=!1,d.delete(T.workCode),g.push(S);else{var R=(l=(u=(s=r.model)===null||s===void 0?void 0:s.textureOptions)!==null&&u!==void 0?u:r.textureOptions)!==null&&l!==void 0?l:y.textureOptions,w=(f=(c=r.model)===null||c===void 0?void 0:c["3d-tiles"])!==null&&f!==void 0?f:r["3d-tiles"],M=new Model(T,{light:(p=r.model)===null||p===void 0?void 0:p.light,textureOptions:R});M.initReady.then(function(){if(w)if(typeof w=="function")for(var B=0,C=M.viewLayers;B<C.length;B++){var P=C[B],F=w(P,M,_);F&&(F.viewerRequestVolume&&(P.viewerRequestVolume=makeBoundingVolume(F.viewerRequestVolume)),P.parameter.set(omit(F,["showLayers"])),F.showLayers===!1?P.visible=!1:Array.isArray(F.showLayers)&&(P.visible=F.showLayers.includes(P.name)))}else for(var L=0,O=M.viewLayers;L<O.length;L++){var P=O[L];w.viewerRequestVolume&&(P.viewerRequestVolume=makeBoundingVolume(w.viewerRequestVolume)),P.parameter.set(omit(w,["showLayers"])),w.showLayers===!1?P.visible=!1:Array.isArray(w.showLayers)&&(P.visible=w.showLayers.includes(P.name))}}),g.push(M),h&&(M.visible=!1),y.modelScene.add(M),M.addEventListener("load",function(B){AnimationFrameLoop.shared.add(function(){o.emit("model.load",createEvent("model.load",{work:T,model:M,error:null}))},!0)}),M.addEventListener("changeShownFloor",function(B){o.emit("model.changeShownFloor",createEvent("model.changeShownFloor",{work:T,model:M,error:null}))}),M.addEventListener("error",function(B){var C=B.error;o.emit("model.error",createEvent("model.error",{work:T,model:M,error:C})),o.throwError(C)}),y.emit("model.request",createEvent("model.request",{work:T,model:M,error:null}))}},y=this,b=0;b<e.length;b++)v(b);return this.modelScene.loaded=!1,this.modelScene.refined=!1,g},t.prototype.commonParams=function(){return{ident:this.ident,scene:this.scene,xrCustomObjectsScene:this.xrCustomObjectsScene,helper:this.helperGroup,boundingMesh:this.boundingMesh,camera:this.camera,renderer:this.renderer,viewport:this.viewport,element:this.getElement(),works:this.works,imageOptions:this.imageOptions,enableWheel:this.enableWheel,extraElements:this.extraElements,videoTexture:this.videoTexture,modelScene:this.modelScene}},t.prototype.applyController=function(e,r){var o=this;if(!this.renderer)throw new Error("renderer is not initialized.");var s=Controllers[e];this.currentMode=e;for(var u=new s(r),l=function(g){u.on(g,function(){for(var A=[],m=0;m<arguments.length;m++)A[m]=arguments[m];var E=o.emit.apply(o,__spreadArray([g],A,!1));if(E)return!1})},c=0,f=PROXY_CONTROLLER_EVENT_NAMES;c<f.length;c++){var p=f[c];l(p)}{var d=Controllers[e].initAnimationEndState(r),h=r.initial.userAction;stateEqual(this.state,d)||(assignState(this.state,d),this.emit("state.change",createEvent("state.change",{userAction:h,state:this.state}))),this.emit("currentState.change",createEvent("currentState.change",{userAction:h,state:this.getCurrentState()}))}return u.on("camera.update",function(g){var A;if(o.controller){var m=o.controller.getTargetState();g.userAction&&o.syncingState===!1&&o.state.mode===m.mode&&!stateEqual(o.state,m)&&(assignState(o.state,m),o.emit("state.change",createEvent("state.change",{userAction:g.userAction,state:o.state})),(A=o.analysis)===null||A===void 0||A.state(o.works,o.state))}o.emit("currentState.change",createEvent("currentState.change",{userAction:g.userAction,state:o.getCurrentState()}))}),u.on("initAnimation.start",function(g){var A,m=g.state,E=g.userAction;E&&o.state.mode===m.mode&&!stateEqual(o.state,m)&&(assignState(o.state,m),o.emit("state.change",createEvent("state.change",{userAction:E,state:o.state})),(A=o.analysis)===null||A===void 0||A.state(o.works,o.state))}),u.on("initAnimation.end",function(g){var A,m=g.state,E=g.userAction;o.pano={workCode:m.workCode,panoIndex:m.panoIndex},E&&o.state.mode===m.mode&&!stateEqual(o.state,m)&&(assignState(o.state,m),o.emit("state.change",createEvent("state.change",{userAction:E,state:o.state})),(A=o.analysis)===null||A===void 0||A.state(o.works,o.state))}),u.on("pano.moveTo",function(g){var A,m=g.state,E=g.userAction;o.pano={workCode:m.workCode,panoIndex:m.panoIndex},E&&o.state.mode===m.mode&&!stateEqual(o.state,m)&&(assignState(o.state,m),o.emit("state.change",createEvent("state.change",{userAction:E,state:o.state})),(A=o.analysis)===null||A===void 0||A.state(o.works,o.state))}),u.on("pano.arrived",function(g){var A,m=g.state,E=g.userAction;o.pano={workCode:m.workCode,panoIndex:m.panoIndex},E&&o.state.mode===m.mode&&!stateEqual(o.state,m)&&(assignState(o.state,m),o.emit("state.change",createEvent("state.change",{userAction:E,state:o.state})),(A=o.analysis)===null||A===void 0||A.state(o.works,o.state))}),u.on("pano.cancel",function(g){var A,m=g.state,E=g.userAction;E&&o.state.mode===m.mode&&!stateEqual(o.state,m)&&(assignState(o.state,m),o.emit("state.change",createEvent("state.change",{userAction:E,state:o.state})),(A=o.analysis)===null||A===void 0||A.state(o.works,o.state))}),u.on("pano.moveTo",function(g){var A=g.userAction;o.emit("currentState.change",createEvent("currentState.change",{userAction:A,state:o.getCurrentState()}))}),u.on("pano.request",function(g){o.emit("pano.request",g),g.defaultPrevented||o.moveToPano(g.state,g.options,g.userAction)}),u.on("vr.requestExit",function(){o.currentMode===t.Mode.VRPanorama&&(o.exitFullscreen(),o.changeMode(t.Mode.Panorama))}),u.on("error",function(g){return o.throwError(g)}),u},t.prototype.removeEventListeners=function(){},Object.defineProperty(t.prototype,"internalLightsEnabled",{get:function(){var e=this.scene.children.find(function(r){return r.name==="internalLights"});return e?e.visible:!1},set:function(e){var r=this.scene.children.find(function(o){return o.name==="internalLights"});r&&(r.visible=e),r=this.modelScene.children.find(function(o){return o.name==="internalLights"}),r&&(r.visible=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"scissor",{get:function(){return this.viewport},enumerable:!1,configurable:!0}),t.prototype.setScissor=function(e){return this.setViewport(e)},t.prototype.getPose=function(){var e=this.camera.copyPose(),r=e.longitude,o=e.latitude,s=e.fov,u=e.offset,l=e.distance;return{longitude:r,latitude:o,fov:s,offset:u.clone(),distance:l}},t.prototype.getLongitudeAndLatitude=function(){var e=this.getPose(),r=e.longitude,o=e.latitude;return{longitude:r,latitude:o}},t.prototype.getOffset=function(){return this.getPose().offset},t.prototype.getCameraLocal=function(){if(this.pano.workCode&&this.controller&&this.works){var e=this.works.getObserver(this.pano);if(e){var r=new THREE__namespace.Object3D;return r.matrix.copy(e.matrix).premultiply(e.work.transform),r.matrix.decompose(r.position,r.quaternion,r.scale),r.matrixAutoUpdate=!1,cameraWorldToLocal(this.camera,r)}}return null},Object.defineProperty(t.prototype,"enableIOSEDR",{get:function(){return!1},set:function(e){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"enableEDL",{get:function(){return this.renderEffect==="edl"},set:function(e){this.renderEffect=e?"edl":"default"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"enableHQ",{get:function(){return this.renderEffect==="hq"},set:function(e){this.renderEffect=e?"hq":"default"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"enablePostProcessing",{get:function(){return!1},set:function(e){},enumerable:!1,configurable:!0}),t.Mode={Panorama:"Panorama",Model:"Model",Floorplan:"Floorplan",Topview:"Topview",Mapview:"Mapview",VRPanorama:"VRPanorama",XRPanorama:"XRPanorama"},t})(Subscribe),__FIVE_DEBUG__={instances:{},constructor:Five};typeof window!="undefined"&&Object.assign(window,{__FIVE_DEBUG__});var XRButton=(function(){function n(){}return n.createButton=function(t){var e=document.createElement("button");function r(){e.style.display="",e.style.cursor="pointer",e.style.left="calc(50% - 50px)",e.style.width="100px",e.textContent="ENTER VR",e.onmouseenter=function(){e.style.opacity="1.0"},e.onmouseleave=function(){e.style.opacity="0.5"},e.onclick=function(){t&&t()}}function o(){e.style.display="",e.style.cursor="auto",e.style.left="calc(50% - 75px)",e.style.width="150px",e.onmouseenter=null,e.onmouseleave=null,e.onclick=null}function s(){o(),e.textContent="VR NOT SUPPORTED"}function u(c){c.style.position="absolute",c.style.bottom="20px",c.style.padding="12px 6px",c.style.border="1px solid #fff",c.style.borderRadius="4px",c.style.background="rgba(0,0,0,0.1)",c.style.color="#fff",c.style.font="normal 13px sans-serif",c.style.textAlign="center",c.style.opacity="0.5",c.style.outline="none",c.style.zIndex="999"}if("xr"in navigator)return e.id="VRButton",e.style.display="none",u(e),navigator.xr.isSessionSupported("immersive-vr").then(function(c){c?r():s()}),e;var l=document.createElement("a");return window.isSecureContext===!1?(l.href=document.location.href.replace(/^http:/,"https:"),l.innerHTML="WEBXR NEEDS HTTPS"):(l.href="https://immersiveweb.dev/",l.innerHTML="WEBXR NOT AVAILABLE"),l.style.left="calc(50% - 90px)",l.style.width="180px",l.style.textDecoration="none",u(l),l},n})();exports.AnimationFrameLoop=AnimationFrameLoop;exports.Camera=Camera;exports.CustomShader=PBMCustomShader;exports.Fetcher=Fetcher;exports.Five=Five;exports.InternalWebGLRenderer=InternalWebGLRenderer;exports.Model=Model;exports.ModelScene=ModelScene;exports.Motion=Motion;exports.NetworkSubscribe=NetworkSubscribe;exports.PBMContainer=PBMContainer;exports.PBMCustomShader=PBMCustomShader;exports.PBMGroup=PBMGroup;exports.PBMMesh=PBMMesh;exports.PBMMeshMaterial=PBMMeshMaterial;exports.PBMPointCloud=PBMPointCloud;exports.PBMPointCloudMaterial=PBMPointCloudMaterial;exports.PBMSkinnedMesh=PBMSkinnedMesh;exports.PROXY_CONTROLLER_EVENT_NAMES=PROXY_CONTROLLER_EVENT_NAMES;exports.PanoCircleMesh=PanoCircleMesh;exports.PanoCircleMeshCustom=PanoCircleMeshCustom;exports.PanoCircleMeshSolid=PanoCircleMeshSolid;exports.Parameter=Parameter;exports.Scene=Scene;exports.Subscribe=Subscribe;exports.TextureLoader=TextureLoader;exports.Tile=Tile;exports.Tile3DModel=Tile3D;exports.TileCache=TileCache;exports.TileNode=TileNode;exports.TileRequestScheduler=TileRequestScheduler;exports.Tileset=Tileset;exports.Trajectory=Trajectory;exports.TrajectoryNode=TrajectoryNode;exports.Work=Work;exports.WorkResolvedObserver=WorkResolvedObserver;exports.XRButton=XRButton;exports.controllersDefaultInitArgs=controllersDefaultInitArgs;exports.coordinatesToVector=coordinatesToVector;exports.createDebugBoundingMesh=createDebugBoundingMesh;exports.createWorks=createWorks;exports.defaultImageURLTransform=imageURL;exports.draco=draco;exports.getViewportScale=getViewportScale;exports.headingToLongitude=headingToLongitude;exports.imageSupport=imageSupport;exports.isBoundingVolume=isBoundingVolume;exports.isPanoId=isPanoId;exports.ktx2=ktx2;exports.loadAt3d=loadAt3d;exports.loadB3dm=loadB3dm;exports.loadDome=loadDome;exports.loadDomez=loadDomez;exports.loadFbx=loadFbx;exports.loadGltf=loadGltf;exports.loadPbm=loadPbm;exports.loadPly=loadPly;exports.loadPnts=loadPnts;exports.loadX3p=loadX3p;exports.longitudeToHeading=longitudeToHeading;exports.makeBoundingVolume=makeBoundingVolume;exports.panoEqual=panoEqual;exports.panoParse=panoParse;exports.panoStringify=panoStringify;exports.parseWork=parseWork;exports.vectorToCoordinates=vectorToCoordinates;exports.workToJson=workToJson;
2249
+ `})||this;return r.material.transparent=!0,r}return Object.defineProperty(t.prototype,"luminanceAdaptiveBuffer",{get:function(){return this.material.uniforms.luminanceAdaptiveBuffer.value},set:function(e){this.material.uniforms.luminanceAdaptiveBuffer.value=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"progress",{get:function(){return this.material.uniforms.progress.value},set:function(e){this.material.uniforms.progress.value=e},enumerable:!1,configurable:!0}),t})(Pass),LuminanceAdaptiveEffect=(function(n){__extends(t,n);function t(e,r,o,s){var u=n.call(this,e,r,o,s)||this;return u.enableTime=now(),u.renderer=e,u.valuePass=new ValuePass(u.renderer),u.luminancePass=new LuminancePass(u.renderer,Math.sqrt(1/3)),u.nextStepPass=new NextStepPass(u.renderer,.01),u.luminanceAdaptivePass=new LuminanceAdaptivePass(u.renderer),u}return t.prototype.render=function(e){this.renderer.setRenderTarget(e[0]),this.renderer.render(this.scene,this.camera),this.enableTime===null&&(this.enableTime=now()),this.luminanceTargetBuffer||(this.luminanceTargetBuffer=new THREE__namespace.WebGLRenderTarget(128,128,{minFilter:THREE__namespace.LinearMipmapLinearFilter,magFilter:THREE__namespace.LinearFilter,encoding:this.renderer.outputEncoding,stencilBuffer:!1,depthBuffer:!1,format:THREE__namespace.RGBAFormat,generateMipmaps:!0}),this.nextStepPass.targetBuffer=this.luminanceTargetBuffer.texture),this.luminancePass.render(e[0],this.luminanceTargetBuffer),this.luminancePrevBuffer||(this.luminancePrevBuffer=new THREE__namespace.WebGLRenderTarget(1,1,{minFilter:THREE__namespace.NearestFilter,magFilter:THREE__namespace.NearestFilter,type:THREE__namespace.HalfFloatType,encoding:this.renderer.outputEncoding,stencilBuffer:!1,depthBuffer:!1}),this.valuePass.render(new THREE__namespace.Vector3(.5,.5,.5),this.luminancePrevBuffer)),this.luminanceNextBuffer||(this.luminanceNextBuffer=new THREE__namespace.WebGLRenderTarget(1,1,{minFilter:THREE__namespace.NearestFilter,magFilter:THREE__namespace.NearestFilter,type:THREE__namespace.HalfFloatType,encoding:this.renderer.outputEncoding,stencilBuffer:!1,depthBuffer:!1}),this.valuePass.render(new THREE__namespace.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((now()-this.enableTime)/100,1),this.luminanceAdaptivePass.render(e[0],e[1])},t.prototype.dispose=function(){var e,r,o;(e=this.luminanceTargetBuffer)===null||e===void 0||e.dispose(),(r=this.luminancePrevBuffer)===null||r===void 0||r.dispose(),(o=this.luminanceNextBuffer)===null||o===void 0||o.dispose(),this.copyPass.dispose(),this.luminancePass.dispose(),this.nextStepPass.dispose(),this.luminanceAdaptivePass.dispose()},t})(Effect),sharedV2=new THREE__namespace.Vector2,LuminanceRenderer=(function(n){__extends(t,n);function t(e){var r,o,s=n.call(this,e)||this;s.type="default",s.luminanceAdaptiveEffect=new LuminanceAdaptiveEffect(s.renderer,s.modelScene,s.camera,s.modelScene);var u=s.renderer.getDrawingBufferSize(sharedV2);return s.screenBuffers=[new THREE__namespace.WebGLRenderTarget(u.x,u.y,{generateMipmaps:!1,encoding:(o=(r=s.renderer)===null||r===void 0?void 0:r.outputEncoding)!==null&&o!==void 0?o:THREE__namespace.sRGBEncoding}),s.enableFragDepth?s.modelRenderTarget:null],s}return t.prototype.render=function(e){var r=this.renderer.getRenderTarget();this.enableFragDepth?(e&&(this.luminanceAdaptiveEffect.enable=!0,this.luminanceAdaptiveEffect.render(this.screenBuffers)),this.depthCopyPass.render(this.modelRenderTarget.depthTexture,r),this.renderer.autoClearDepth=!1,this.renderer.autoClearColor=!0,this.copyPass.render(this.modelRenderTarget,r),this.renderer.setRenderTarget(r),this.renderer.autoClearColor=!1,this.renderer.autoClearDepth=!1,this.renderer.render(this.scene,this.camera),this.renderer.autoClearColor=!0,this.renderer.autoClearDepth=!0):(this.luminanceAdaptiveEffect.enable=!0,this.luminanceAdaptiveEffect.render(this.screenBuffers),this.renderer.autoClearColor=!1,this.renderer.autoClearDepth=!1,this.renderer.render(this.scene,this.camera),this.renderer.autoClearColor=!0,this.renderer.autoClearDepth=!0),this.modelScene.needsRender=!0},t})(BaseRenderer),DEFAULT_MODE_CHANGE_DURATION=800,DEFAULT_CAMERA_FOV=90,DEFAULT_REQUEST_PROXY=function(n){return n.replace("//vrlab-public.ljcdn.com/","//vr-public.realsee-cdn.cn/").replace("//vrlab-image4.ljcdn.com/","//vr-image-4.realsee-cdn.cn/").replace("//vrlab-image3.ljcdn.com/","//vr-image-3.realsee-cdn.cn/").replace("//vrlab-image2.ljcdn.com/","//vr-image-2.realsee-cdn.cn/").replace("//vrlab-image1.ljcdn.com/","//vr-image-1.realsee-cdn.cn/")},scratchSphere=new THREE__namespace.Sphere,scratchViewport=new THREE__namespace.Vector4,scratchScissor=new THREE__namespace.Vector4,scratchClearColor=new THREE__namespace.Color,scratchRenderSize=new THREE__namespace.Vector2,worksMap=new WeakMap,emptyWorks=createWorks([parseWork(null)]),Five=(function(n){__extends(t,n);function t(e){e===void 0&&(e={});var r,o,s,u,l,c,f,p,d,h,g,A,m=n.call(this)||this;if(m.ident=createUuid(),typeof window!="undefined"&&(__FIVE_DEBUG__.instances[m.ident]=m),m.renderSwitch01=0,m.currentUpdateArgs={time:now(),args:[]},m.currentMode="Panorama",m.pano={workCode:"",panoIndex:0},m.needsRender=!1,m.modelSceneNeedsRender=!1,m.onlyRenderIfNeeds=(r=e.onlyRenderIfNeeds)!==null&&r!==void 0?r:!0,m.imageOptions=__assign({},(o=e.imageOptions)!==null&&o!==void 0?o:{}),m.textureOptions=__assign({},(s=e.textureOptions)!==null&&s!==void 0?s:{}),m.poweredByRealsee=(u=e.poweredByRealsee)!==null&&u!==void 0?u:!0,m.backgroundColor=new THREE__namespace.Color((l=e.backgroundColor)!==null&&l!==void 0?l:1579548),m.backgroundAlpha=(c=e.backgroundAlpha)!==null&&c!==void 0?c:1,m.extraElements=[],m.controllerInits={Panorama:Object.assign({},e.panorama),Model:Object.assign({},e.model),Floorplan:Object.assign({},e.floorplan),Topview:Object.assign({},e.topview),Mapview:Object.assign({},e.mapview),VRPanorama:Object.assign({},e.vrPanorama),XRPanorama:Object.assign({},e.xrPanorama)},m.fps={testCount:0,testTime:now()},m.modeChangeDuration=(f=e.modeChangeDuration)!==null&&f!==void 0?f:DEFAULT_MODE_CHANGE_DURATION,m.enableWheel=(p=e.enableWheel)!==null&&p!==void 0?p:!0,typeof window!="undefined")if("renderer"in e)e.renderer instanceof InternalWebGLRenderer&&m.throwError(new Error("cannot render a internal renderer")),m.renderer=e.renderer;else try{m.renderer=new InternalWebGLRenderer({preserveDrawingBuffer:e.preserveDrawingBuffer,antialias:e.antialias,webgl2:e.webgl2,logarithmicDepthBuffer:e.logarithmicDepthBuffer,precision:e.precision,powerPreference:e.powerPreference});var E=getViewportScale();m.renderer.setPixelRatio(E===1?window.devicePixelRatio:1),m.renderer.setSize(512,512),m.renderer.setClearColor(m.backgroundColor,m.backgroundAlpha)}catch(F){F instanceof Error&&m.throwError(F)}m.getPixelsRenderTarget=new THREE__namespace.WebGLRenderTarget(1,1,{encoding:(h=(d=m.renderer)===null||d===void 0?void 0:d.outputEncoding)!==null&&h!==void 0?h:THREE__namespace.sRGBEncoding,generateMipmaps:!1}),m.viewport=Object.assign({left:0,bottom:0,width:1,height:1},e.viewport),m.camera=new Camera(DEFAULT_CAMERA_FOV),m.scene=new Scene,m.xrCustomObjectsScene=new THREE__namespace.Scene,m.scene.add(m.xrCustomObjectsScene),m.scene.matrixAutoUpdate=!1,m.loadWorkTask=Promise.resolve(),m.requestProxy=(g=e.requestProxy)!==null&&g!==void 0?g:DEFAULT_REQUEST_PROXY,m.networkSubscribe=new NetworkSubscribe,m.networkSubscribe.on("network",function(F,L,O,k){var D;m.emit("network.resource",createEvent("network.resource",{source:F,requestType:L,requestState:O,detail:k})),(D=m.analysis)===null||D===void 0||D.network(m.works,F,L,O,k)}),m.boundingMesh=new BoundingMesh$1,m.boundingMesh.name="bounding",m.readyCallbacks=[],m.syncingState=!1,m.helperGroup=new THREE__namespace.Group,m.helperGroup.name="helper",m.helperGroup.matrixAutoUpdate=!1,m.scene.add(m.helperGroup);var v=new Model(emptyWorks[0]);worksMap.set(m,emptyWorks),m.modelScene=new ModelScene,m.modelScene.add(v),m.modelScene.add(m.boundingMesh),defineProperty(v,"loaded",{get:function(){return!1},set:function(F){}}),m.videoTexture=new THREE__namespace.VideoTexture(e.videoInstance||generateDefaultVideoElement());var y=initLights();m.scene.add(y);var b=new THREE__namespace.Group;defineProperty(b,"children",{get:function(){return y.children},set:function(F){y.children=F}}),defineProperty(b,"visible",{get:function(){return y.visible},set:function(F){y.visible=F}}),defineProperty(b,"name",{get:function(){return y.name},set:function(F){y.name=F}}),m.modelScene.add(b),m.state={mode:m.currentMode,workCode:m.pano.workCode,panoIndex:m.pano.panoIndex,longitude:m.camera.pose.longitude,latitude:m.camera.pose.latitude,fov:m.camera.pose.fov,offset:m.camera.pose.offset.clone(),distance:m.camera.pose.distance},m.stateSynced=!1,m.destroyed=!1,m.paused=!0,typeof window!="undefined"&&(e.play!==!1&&m.play(),m.stopAnimationLoop=AnimationFrameLoop.shared.add(function(F,L){for(var O=[],k=2;k<arguments.length;k++)O[k-2]=arguments[k];m.updateTime.apply(m,__spreadArray([F,L],O,!1))},!1,0,10));var _=function(){typeof document!="undefined"&&document.fullscreenElement===null&&m.currentMode==="VRPanorama"&&m.controller.emit("vr.requestExit",createEvent("vr.requestExit",{}))},T=function(){m.needsRender=!0,m.modelSceneNeedsRender=!0};if(typeof document!="undefined"&&document.addEventListener("fullscreenchange",_,!1),m.renderer&&m.renderer.domElement.addEventListener("webglcontextrestored",T,!1),m.removeEventListeners=function(){typeof document!="undefined"&&document.removeEventListener("fullscreenchange",_,!1),m.renderer&&m.renderer.domElement.removeEventListener("webglcontextrestored",T,!1)},m.plugins={},e.plugins&&e.plugins.length)for(var S=0,R=e.plugins;S<R.length;S++){var w=R[S];if(typeof w=="function")w(m);else if(Array.isArray(w)){var M=w[0],B=w[1],C=w[2];if(typeof M=="function"){var P=M(m,C);typeof B=="string"&&(m.plugins[B]?m.throwError(new Error("plugin name ".concat(B," is exists."))):m.plugins[B]=P)}}}return m.meshReplaceMaterialMap=new Map,m.meshOriginMaterialMap=new Map,initLegacyEvent(m),m.enableLayeringRendering=(A=e.enableLayeringRendering)!==null&&A!==void 0?A:!1,m._buildInRendererType="default",m._builtinRenderer=null,m}return Object.defineProperty(t,"version",{get:function(){return"6.6.0-alpha.6"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"dracoPath",{get:function(){return draco.decoderPath},set:function(e){draco.setDecoderPath(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t,"ktx2Path",{get:function(){return ktx2.transcoderPath},set:function(e){ktx2.setTranscoderPath(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"panoIndex",{get:function(){return this.pano.panoIndex},enumerable:!1,configurable:!0}),t.prototype.dispose=function(){var e,r;if(this.destroyed!==!0){delete __FIVE_DEBUG__.instances[this.ident],this.emit("dispose"),this.destroyed=!0,this.pause(),this.stopAnimationLoop&&(this.stopAnimationLoop(),delete this.stopAnimationLoop),(e=this.renderer)===null||e===void 0||e.setAnimationLoop(null),this.off(),this.networkSubscribe.off(),this.controller&&(this.controller.destroy(),this.controller=void 0);var o=this.getElement();o&&o.parentNode&&o.parentNode.removeChild(o);var s=this.modelScene.parameter;s.pano0&&s.pano0.map.dispose(),s.pano1&&s.pano1.map!==((r=s.pano0)===null||r===void 0?void 0:r.map)&&s.pano1.map.dispose(),s.reset("pano0","pano1");for(var u=0,l=this.modelScene.children;u<l.length;u++){var c=l[u];c.dispose&&c.dispose(),this.modelScene.remove(c)}this.meshReplaceMaterialMap.forEach(function(f){f.dispose()}),this.meshOriginMaterialMap.forEach(function(f){f.dispose()}),this.renderer instanceof InternalWebGLRenderer&&this.renderer.forceContextLoss&&this.renderer.forceContextLoss()}},t.prototype.setViewport=function(e){Object.assign(this.viewport,e),this.needsRender=!0,this.modelSceneNeedsRender=!0},Object.defineProperty(t.prototype,"helperVisible",{get:function(){return this.helperGroup.visible},set:function(e){this.helperGroup.visible!==e&&(this.helperGroup.visible=e,this.emit("helpers.visible",createEvent("helpers.visible",{object:this.helperGroup})),this.needsRender=!0)},enumerable:!1,configurable:!0}),t.prototype.getBuiltinRenderer=function(e){var r=this._builtinRenderer;if((r==null?void 0:r.type)!==this._buildInRendererType)switch(r&&r.dispose(),this._buildInRendererType){case"default":this._builtinRenderer=new DefaultRenderer({renderer:e,camera:this.camera,scene:this.scene,modelScene:this.modelScene,enableLayeringRendering:this.enableLayeringRendering});break;case"edl":this._builtinRenderer=new EDLRenderer({renderer:e,camera:this.camera,scene:this.scene,modelScene:this.modelScene,enableLayeringRendering:this.enableLayeringRendering});break;case"hq":this._builtinRenderer=new HQRenderer({renderer:e,camera:this.camera,scene:this.scene,modelScene:this.modelScene,enableLayeringRendering:this.enableLayeringRendering});break;case"luminance":this._builtinRenderer=new LuminanceRenderer({renderer:e,camera:this.camera,scene:this.scene,modelScene:this.modelScene,enableLayeringRendering:this.enableLayeringRendering});break}return this._builtinRenderer},Object.defineProperty(t.prototype,"renderEffect",{get:function(){return this._buildInRendererType},set:function(e){this._buildInRendererType=e,this.modelSceneNeedsRender=!0},enumerable:!1,configurable:!0}),t.prototype.updateConfiguration=function(e,r){r===void 0&&(r=!0);var o=!1;if(e.panorama&&(Object.assign(this.controllerInits.Panorama,omitUndefinedFields(e.panorama)),this.currentMode==="Panorama"&&(o=!0)),e.model&&(Object.assign(this.controllerInits.Model,omitUndefinedFields(e.model)),this.currentMode==="Model"&&(o=!0)),e.floorplan&&(Object.assign(this.controllerInits.Floorplan,omitUndefinedFields(e.floorplan)),this.currentMode==="Floorplan"&&(o=!0)),e.topview&&(Object.assign(this.controllerInits.Topview,omitUndefinedFields(e.topview)),this.currentMode==="Topview"&&(o=!0)),e.mapview&&(Object.assign(this.controllerInits.Mapview,omitUndefinedFields(e.mapview)),this.currentMode==="Mapview"&&(o=!0)),e.vrPanorama&&(Object.assign(this.controllerInits.VRPanorama,omitUndefinedFields(e.vrPanorama)),this.currentMode==="VRPanorama"&&(o=!0)),e.imageOptions&&(Object.assign(this.imageOptions,e.imageOptions),(this.currentMode==="Panorama"||this.currentMode==="VRPanorama")&&(o=!0)),e.textureOptions&&Object.assign(this.textureOptions,e.textureOptions),r&&o&&this.controller&&this.currentMode){var s=this.controller.updateConfiguration(this.controllerInits[this.currentMode]);s||this.changeMode(this.currentMode,this.getCurrentState(),0,!1,!0)}},t.prototype.appendTo=function(e,r){if(r===void 0&&(r={}),!!this.renderer){if(!(this.renderer instanceof InternalWebGLRenderer)){this.throwError(new Error("cannot call appendTo method when render a external renderer"));return}var o=this.getElement();if(o){e.appendChild(o),this.refresh(r);var s=window.getComputedStyle(e).position;s!=="relative"&&s!=="absolute"&&s!=="fixed"&&s!=="sticky"&&(e.style.position="relative")}}},t.prototype.refresh=function(e,r){if(e===void 0&&(e={}),!!this.renderer){var o=this.getElement();if(o){var s=o.parentNode;if(s&&s.nodeName){var u=e.width,l=u===void 0?s.offsetWidth:u,c=e.height,f=c===void 0?s.offsetHeight:c;this.renderer instanceof InternalWebGLRenderer&&(r&&this.renderer.setPixelRatio(r),this.renderer.setSize(l,f))}var p=new THREE__namespace.Vector2;this.renderer.getDrawingBufferSize(p),this.needsRender=!0,this.modelSceneNeedsRender=!0;var d=now(),h=d-this.currentUpdateArgs.time,g=this.currentUpdateArgs.args;this.updateTime(d,h,g)}}},t.prototype.addExtraElement=function(e){var r=this;return this.extraElements.indexOf(e)===-1&&(this.extraElements.push(e),this.controller&&this.controller.bindExtraElement(e)),function(){return r.removeExtraElement(e)}},t.prototype.removeExtraElement=function(e){var r=this.extraElements.indexOf(e);r!==-1&&(this.extraElements.splice(r,1),this.controller&&this.controller.unbindExtraElement(e))},t.prototype.getSize=function(e){if(!this.renderer)throw new Error("renderer is not initialized");return this.renderer.getSize(e),e.x*=this.viewport.width,e.y*=this.viewport.height,e},t.prototype.getDrawingBufferSize=function(e){if(!this.renderer)throw new Error("renderer is not initialized");return this.renderer.getDrawingBufferSize(e),e.x*=this.viewport.width,e.y*=this.viewport.height,e},t.prototype.updateCamera=function(e,r,o){if(o===void 0&&(o=!0),!this.controller)throw new Error("controller is not initialized.");return this.controller.updateCamera(e,r,o)},t.prototype.updateCameraWithKeyframes=function(e,r,o){if(o===void 0&&(o=!0),!this.controller)throw new Error("controller is not initialized.");return this.controller.updateCameraWithKeyframes(e,r,o)},Object.defineProperty(t.prototype,"works",{get:function(){var e=worksMap.get(this);return e||emptyWorks},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"work",{get:function(){return this.works[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"observers",{get:function(){return this.work.observers},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"models",{get:function(){return this.modelScene.models},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"model",{get:function(){return this.modelScene.models[0]},enumerable:!1,configurable:!0}),t.prototype.load=function(e,r,o,s){var u=this;if(s===void 0&&(s=!0),!this.renderer)throw new Error("renderer is not initialized");var l=this.loadWorkTask.then(function(){return isPromise(e)?e.then(function(c){return u.load_(c,r,o,s)}):u.load_(e,r,o,s)});return this.loadWorkTask=l.catch(function(c){u.throwError(c)}),l},t.prototype.load_=function(e,r,o,s){var u=this,l,c,f,p,d,h,g,A,m,E;s===void 0&&(s=!0);var v={};typeof o=="number"?v.duration=o:typeof o=="object"&&Object.assign(v,o),this.works===emptyWorks&&(v.duration===void 0&&(v.duration=0),v.effect===void 0&&(v.effect="instant"));var y=[];if(Array.isArray(e))for(var b=0,_=e;b<_.length;b++){var T=_[b];T instanceof Work?y.push(T):typeof T!="string"&&"work"in T?y.push(parseWork(T.work,T)):y.push(parseWork(T))}else e instanceof Work?y.push(e):y.push(parseWork(e));for(var S=createWorks(y),R=function(Q){var W=w,$=new Fetcher({get networkSubscribe(){return W.networkSubscribe},requestProxy:function(ie){return Promise.resolve(ie).then(function(ee){return W.requestProxy(ee)}).then(function(ee){return verifyURL(ee,Q.allowHosts)}).then(function(ee){if(ee instanceof Error)throw ee;return ee})}});registerFetcher(Q,$)},w=this,M=0,B=S;M<B.length;M++){var C=B[M];R(C)}r===void 0&&(r="inherit"),r==="inherit"&&this.works===emptyWorks&&(r="initial");var P=S.initial,F=P.work.observers[0],L=F?{workCode:F.work.workCode,panoIndex:F.panoIndex}:{workCode:P.work.workCode,panoIndex:0},O=(l=P.mode)!==null&&l!==void 0?l:F?"Panorama":"Mapview",k={};if(r==="inherit"){O=this.currentMode;var D=(f=(c=S[0])===null||c===void 0?void 0:c.observers)===null||f===void 0?void 0:f[this.panoIndex];D?L={workCode:D.work.workCode,panoIndex:D.panoIndex}:typeof S.initial.panoIndex=="number"?L={workCode:S.initial.work.workCode,panoIndex:S.initial.panoIndex}:(O==="Panorama"||O==="VRPanorama"||O==="XRPanorama")&&(O="Mapview"),k={longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov,distance:void 0,offset:void 0}}else if(r==="initial")typeof P.panoIndex=="number"&&(L={workCode:P.work.workCode,panoIndex:P.panoIndex}),P.mode&&(O=P.mode),k={longitude:P.longitude,latitude:P.latitude,fov:P.fov,distance:P.distance,offset:(p=P.offset)===null||p===void 0?void 0:p.clone()};else{if(O=(d=r.mode)!==null&&d!==void 0?d:this.currentMode,typeof r.panoIndex=="number"){var D=S.getObserver({workCode:(g=(h=r.workCode)!==null&&h!==void 0?h:P.work.workCode)!==null&&g!==void 0?g:"",panoIndex:r.panoIndex});D&&(L={workCode:D.work.workCode,panoIndex:D.panoIndex})}k={longitude:r.longitude,latitude:r.latitude,fov:r.fov,distance:r.distance,offset:r.offset}}var J=__assign(__assign(__assign({},L),{mode:O}),k),G=this.getCurrentState(),U=(A=v.duration)!==null&&A!==void 0?A:this.modeChangeDuration;(O==="Floorplan"||O==="Topview"||O==="Mapview")&&this.currentMode===O&&(U=0);var z="fly";(O==="Panorama"||O==="VRPanorama"||O==="XRPanorama")&&this.currentMode===O&&(z=(m=v.effect)!==null&&m!==void 0?m:"fade"),this.emit("works.request",createEvent("works.request",{input:e,works:S,state:J,userAction:s}));var q=function(){u.pano=L;var Q=__assign(__assign({initial:{state:J,currentState:G,duration:U,effect:z,userAction:s}},u.commonParams()),u.controllerInits[O]),W=Controllers[O].initAnimationEndState(Q);if(u.controller&&u.currentMode===O)u.controller.updateWork(S,W,{effect:z,duration:U},s)===!1&&(u.controller.destroy(),u.controller=u.applyController(O,Q));else{var $=u.currentMode;if(u.controller)u.controller.destroy();else{var ie=Controllers[O].initAnimationEndState(Q);u.camera.setFromPose(ie),u.emit("camera.update",createEvent("camera.update",{state:u.getCurrentState(),userAction:s}))}u.controller=u.applyController(O,Q);var ee=createEvent("mode.change",{prevMode:$,mode:O,state:W,userAction:s});try{u.emit("mode.change",ee)}catch(ne){console.error(ne)}}u.updateTime(u.currentUpdateArgs.time,0,u.currentUpdateArgs.args)};worksMap.set(this,S);var j=Promise.resolve();if(O===t.Mode.Floorplan||O===t.Mode.Topview||O===t.Mode.Mapview||O===t.Mode.Model){this.modelScene.loaded===!1&&(this.camera.setFromPose(J),assignPose(this.state,this.camera.pose)),this.controller||(this.currentMode=O);var K=this.loadModels(S,v);j=Promise.all(K.map(function(Q){return Q.loadedReady})).then(function(){u.needsRender=!0,u.modelSceneNeedsRender=!0,q(),u.emit("camera.update",createEvent("camera.update",{state:u.getCurrentState(),userAction:s}))})}else{q();var Y=!1;this.modelScene.autoRefine=!1;var X=function(){u.works===S&&Y===!1&&(u.needsRender=!0,u.modelSceneNeedsRender=!0,u.emit("camera.update",createEvent("camera.update",{state:u.getCurrentState(),userAction:s})),Y=!0,u.modelScene.autoRefine=!0)},K=this.loadModels(S,v);j=Promise.all(K.map(function(W){return W.initReady})).then(noop),this.controller.once("pano.arrived",X),this.controller.once("pano.cancel",X),setTimeout(X,((E=v.duration)!==null&&E!==void 0?E:this.modeChangeDuration)+1e3)}return this.emit("works.load",createEvent("works.load",{input:e,state:this.getCurrentState(),userAction:s,works:S})),j.then(function(){return u.ready()}).then(function(){var Q;u.emit("works.ready",createEvent("works.ready",{input:e,state:u.getCurrentState(),userAction:s,works:S})),(Q=u.analysis)===null||Q===void 0||Q.work(S)})},t.prototype.reset=function(){var e=this,r=this.loadWorkTask.then(function(){return e.reset_()});return this.loadWorkTask=r.catch(function(o){e.throwError(o)}),r},t.prototype.reset_=function(){var e=this;return new Promise(function(r){var o;e.controller&&(e.controller.destroy(),e.controller=void 0);var s=e.modelScene.parameter;s.pano0&&s.pano0.map.dispose(),s.pano1&&s.pano1.map!==((o=s.pano0)===null||o===void 0?void 0:o.map)&&s.pano1.map.dispose(),s.set({pano0:null,pano1:null,modelAlpha:1}),e.renderer&&e.modelScene.update(e.renderer,e.camera);for(var u=0,l=e.modelScene.children;u<l.length;u++){var c=l[u];c instanceof Model&&(c.dispose(),e.modelScene.remove(c))}e.needsRender=!0,e.modelSceneNeedsRender=!0,worksMap.delete(e);var f=parseWork(null),p=new Model(f);p.work=f,worksMap.set(e,createWorks([f])),e.currentMode="Mapview",e.pano={workCode:"",panoIndex:0},e.camera.setFromPose({distance:0,fov:DEFAULT_CAMERA_FOV,longitude:0,latitude:0,offset:new THREE__namespace.Vector3(0,0,0)}),e.state={mode:e.currentMode,workCode:e.pano.workCode,panoIndex:e.pano.panoIndex,longitude:e.camera.pose.longitude,latitude:e.camera.pose.latitude,fov:e.camera.pose.fov,offset:e.camera.pose.offset.clone(),distance:e.camera.pose.distance},e.camera.needsRender=!1,e.needsRender=!1,e.modelSceneNeedsRender=!1,r()})},t.prototype.changeMode=function(e,r,o,s,u){var l=this;return r===void 0&&(r={}),s===void 0&&(s=!0),u===void 0&&(u=!1),new Promise(function(c,f){var p,d,h,g;if(!l.renderer)throw new Error("renderer is not initialized.");r=__assign({},r);var A=0;l.controller&&(typeof o=="number"?A=o:A=(p=o==null?void 0:o.duration)!==null&&p!==void 0?p:l.modeChangeDuration);var m="fly";l.controller&&typeof o=="object"&&o.effect&&(m=o.effect);var E=typeof r.panoIndex=="number"?{workCode:(g=(d=r.workCode)!==null&&d!==void 0?d:(h=l.work)===null||h===void 0?void 0:h.workCode)!==null&&g!==void 0?g:"",panoIndex:r.panoIndex}:l.pano;if(!t.Mode.hasOwnProperty(e)){var v=new Error('mode "'.concat(e,'" is not existed'));l.throwError(v),f(v);return}if((e===t.Mode.Panorama||e===t.Mode.VRPanorama||e===t.Mode.XRPanorama)&&!l.works.getObserver(E)){var v=new Error("PanoId ".concat(panoStringify(E)," not existed."));l.throwError(v),f(v);return}(e===t.Mode.Floorplan||e===t.Mode.Topview||e===t.Mode.Mapview||e===t.Mode.Model)&&(l.modelScene.loaded||(A=0));var y=l.controller,b=l.currentMode,_=function(){if(l.controller&&l.controller.stopMomentumMovement(),l.controller&&u===!1&&b===e)e===t.Mode.Panorama||e===t.Mode.Model||e===t.Mode.VRPanorama||e===t.Mode.XRPanorama?!panoEqual(l.pano,E)&&"moveToPano"in l.controller&&typeof l.controller.moveToPano=="function"?l.controller.moveToPano(E,__assign({duration:A},r),s):l.controller.updateCamera(r,A,s).catch(noop):(panoEqual(l.pano,E)||(l.pano=E),l.controller.updateCamera(r,A,s).catch(noop));else{var S=__assign(__assign({},r),E),R=__assign(__assign({initial:{state:S,currentState:l.getCurrentState(),duration:A,effect:m,userAction:s}},l.commonParams()),l.controllerInits[e]),w=Controllers[e].initAnimationEndState(R),M=createEvent("mode.change.request",{prevMode:l.currentMode,mode:e,state:w,userAction:s});if(l.emit("mode.change.request",M),!M.defaultPrevented){y&&y.destroy(),l.controller=l.applyController(e,R);var B=createEvent("mode.change",{prevMode:l.currentMode,mode:e,state:w,userAction:s});l.emit("mode.change",B)}}c()};if(e===t.Mode.VRPanorama)l.requestFullscreen(),requestDeviceOrientationPermission().then(function(){return _()}).catch(function(S){S instanceof Error&&(l.exitFullscreen(),l.throwError(S),f(S))});else if(e===t.Mode.XRPanorama){var T=AnimationFrameLoop.shared.getContext();T?T.end():requestXRSessionPermission().then(function(S){AnimationFrameLoop.shared.setContext(S),_()}).catch(function(S){S instanceof Error&&(l.throwError(S),f(S))})}else _()})},t.prototype.getPixels=function(e,r,o,s,u,l,c){if(!this.renderer)throw new Error("renderer is not initialized.");var f=this.renderer.getPixelRatio(),p=this.renderer.getRenderTarget(),d=this.renderer.getSize(new THREE__namespace.Vector2),h=0,g=0,A=1,m=1,E,v,y,b,_;typeof e=="number"?(h=e,typeof r=="number"&&(g=r),typeof o=="number"&&(A=o),typeof s=="number"&&(m=s),E=u,v=l,_=c):(h=e.x,g=e.y,A=e.width,m=e.height,E=e.pixelRatio,v=e.flipY,y=e.helperVisible,b=e.skipPanorama,_=e.buffer),h=Math.ceil(h),g=Math.ceil(g),A=Math.ceil(A),m=Math.ceil(m),E=Math.ceil(E!=null?E:f),v=v!=null?v:!1;var T=this.helperVisible,S=this.modelScene.parameter.modelAlpha;this.helperVisible=y!=null?y:this.helperVisible,b&&(this.controller instanceof Controllers.Panorama||this.controller instanceof Controllers.VRPanorama||this.controller instanceof Controllers.XRPanorama)&&b===!0&&this.modelScene.parameter.set("modelAlpha",1),this.modelScene.update(this.renderer,this.camera);var R=this.getPixelsRenderTarget;R.setSize(A*E,m*E),this.renderer.setRenderTarget(R),this.camera.pixelRatio=E,this.camera.resolution.set(A,m),this.camera.setViewOffset(d.width,d.height,h,d.height-g-m,A,m),this.scene.update(this.renderer,this.camera),this.render(),this.helperVisible=T,S===void 0?this.modelScene.parameter.reset("modelAlpha"):this.modelScene.parameter.set("modelAlpha",S),this.renderer.setRenderTarget(p),this.camera.clearViewOffset(),this.camera.pixelRatio=f,this.getSize(this.camera.resolution),this.camera.aspect=this.camera.resolution.width/this.camera.resolution.height,this.modelScene.update(this.renderer,this.camera),this.scene.update(this.renderer,this.camera);var w=A*E,M=m*E,B=w*M,C=B*4;if(_){if(_.length!==C)throw new Error("buffer length is not equals pixels ".concat(C))}else _=new Uint8Array(C);if(this.renderer.readRenderTargetPixels(R,0,0,A*E,m*E,_),v)for(var P=B/2,F=0,L=0,O=0,k=0;L<P;L++)for(k=(M-Math.floor(L/w)-1)*w+L%w,O=0;O<4;O++)F=_[L*4+O],_[L*4+O]=_[k*4+O],_[k*4+O]=F;return _},t.prototype.getElement=function(){var e;return(e=this.renderer)===null||e===void 0?void 0:e.domElement},t.prototype.render=function(e){var r=this.renderer;if(r){var o=r.getRenderTarget(),s=r.autoClear,u=r.autoClearColor,l=r.autoClearDepth,c=r.autoClearStencil,f=scratchClearColor.copy(r.getClearColor()),p=r.getClearAlpha(),d=r.getViewport(scratchViewport),h=r.getScissor(scratchScissor),g=r.getScissorTest(),A=r.getSize(scratchRenderSize),m=r.getPixelRatio(),E=Math.floor(A.x*this.viewport.left),v=Math.floor(A.y*this.viewport.bottom),y=Math.floor(A.x*this.viewport.width),b=Math.floor(A.y*this.viewport.height);r.setClearColor(this.backgroundColor,this.backgroundAlpha),r.setViewport(E,v,y,b),r.setScissor(E,v,y,b);var _=this.viewport.bottom!==0||this.viewport.left!==0||this.viewport.width!==1||this.viewport.height!==1;r.setScissorTest(_);var T=this.scene.background;this.modelScene.background=this.camera.isOrthographicCamera?null:T,this.modelScene.environment=this.scene.environment,this.scene.background=null;var S=this.getBuiltinRenderer(r);S.setSize(A.x,A.y,m),this.controller?this.controller.render(S,this.onlyRenderIfNeeds?this.modelSceneNeedsRender:!0):S.render(this.onlyRenderIfNeeds?this.modelSceneNeedsRender:!0),this.scene.background=T,this.modelScene.background=null,this.modelScene.environment=null,this.poweredByRealsee&&this.currentMode!=="VRPanorama"&&this.currentMode!=="XRPanorama"&&r.getRenderTarget()!==this.getPixelsRenderTarget&&renderPoweredByRealsee(r),r.setRenderTarget(o),r.autoClear=s,r.autoClearColor=u,r.autoClearDepth=l,r.autoClearStencil=c,r.setClearColor(f,p),r.setViewport(d),r.setScissor(h),r.setScissorTest(g),e&&AnimationFrameLoop.shared.add(e,!0)}},t.prototype.updateTime=function(e,r){for(var o,s=this,u=[],l=2;l<arguments.length;l++)u[l-2]=arguments[l];if(this.currentUpdateArgs={time:e,args:u},!this.destroyed){if(this.renderer&&ktx2.detectSupport(this.renderer),this.syncingState=this.syncState(e,r),this.controller&&(o=this.controller).updateTime.apply(o,__spreadArray([e,r],u,!1)),this.renderer&&(this.camera.pixelRatio=this.renderer.getPixelRatio(),this.getSize(this.camera.resolution),this.camera.aspect=this.camera.resolution.width/this.camera.resolution.height),this.camera.autoNearFar){var c=this.modelScene.boundingBox.getBoundingSphere(scratchSphere),f=c.radius*2;c.containsPoint(this.camera.position)||(f=this.camera.position.distanceTo(c.center)+c.radius),f=clamp$1(f,800,5e4),this.camera.far!==f&&(this.camera.far=f);var p=f/1e4;p=clamp$1(p,.03,.1),this.camera.near!==p&&(this.camera.near=p)}if(this.camera.controllerMode=this.currentMode,this.camera.updateTime(e),this.renderer){var d=this.modelScene.loaded,h=this.modelScene.refined;if(this.modelScene.loaded){for(var g=[],A=0,m=this.modelScene.children;A<m.length;A++){var E=m[A];E instanceof Model&&E.outdated&&g.push(E)}for(var v=0,y=g;v<y.length;v++){var b=y[v];this.modelScene.remove(b),b.dispose()}if(g.length>0)for(var _=0,T=this.modelScene.children;_<T.length;_++){var E=T[_];E instanceof Model&&(E.visible=!0,this.modelSceneNeedsRender=!0)}}this.modelScene.update(this.renderer,this.camera),d===!1&&this.modelScene.loaded===!0&&(this.controller&&this.controller.updateModel(this.modelScene),AnimationFrameLoop.shared.add(function(){s.emit("models.load",createEvent("models.load",{modelScene:s.modelScene}))},!0,0,10)),h===!1&&this.modelScene.refined===!0&&AnimationFrameLoop.shared.add(function(){s.emit("models.refined",createEvent("models.refined",{modelScene:s.modelScene}))},!0,0,10)}this.renderer&&this.scene.update(this.renderer,this.camera),this.syncingState=!1,this.controller&&(this.controller.needsRender===!0&&(this.controller.needsRender=!1,this.needsRender=!0),this.controller.modelSceneNeedsRender===!0&&(this.controller.modelSceneNeedsRender=!1,this.modelSceneNeedsRender=!0)),this.camera.needsRender===!0&&(this.camera.needsRender=!1,this.needsRender=!0,this.modelSceneNeedsRender=!0),this.modelScene.needsRender===!0&&(this.modelScene.needsRender=!1,this.needsRender=!0,this.modelSceneNeedsRender=!0),this.scene.needsRender===!0&&(this.scene.needsRender=!1,this.needsRender=!0),this.onlyRenderIfNeeds!==!0&&(this.needsRender=!0,this.modelSceneNeedsRender=!0),this.modelSceneNeedsRender===!0&&(this.needsRender=!0);var S=this.camera.resolution.width*this.camera.pixelRatio*this.camera.resolution.height*this.camera.pixelRatio;S>4096*2048?this.renderSwitch01=this.renderSwitch01^1:this.renderSwitch01=0,this.renderSwitch01!==0&&(this.needsRender=!1),this.paused===!0&&(this.needsRender=!1);var R=createEvent("render.prepare",{needsRender:this.needsRender});this.emit("render.prepare",R),R.defaultPrevented&&(this.needsRender=!1),this.renderer&&this.needsRender&&this.render(),this.emit("render",createEvent("render",{needsRender:this.needsRender})),this.needsRender=!1,this.modelSceneNeedsRender=!1,this.hasListener("fps")&&(this.fps.testTime&&e-this.fps.testTime<1e3?this.fps.testCount++:(this.emit("fps",this.fps.testCount),this.fps.testTime=e,this.fps.testCount=0))}},t.prototype.pause=function(){this.paused=!0,this.renderer&&this.renderer instanceof InternalWebGLRenderer&&this.renderer.clear(!0,!0,!0)},t.prototype.play=function(){this.needsRender=!0,this.modelSceneNeedsRender=!0,this.paused=!1},t.prototype.moveToPano=function(e,r,o){r===void 0&&(r={}),o===void 0&&(o=!0);var s=this,u=s.controller,l=s.renderer;if(!u)return this.throwError(new Error("controller is not initialized.")),Promise.resolve();if(!l)return this.throwError(new Error("renderer is not initialized.")),Promise.resolve();var c=this.works.getObserver(e);if(!c)return this.throwError(new Error("pano ".concat(JSON.stringify(e)," not existed."))),Promise.resolve();var f={workCode:c.work.workCode,panoIndex:c.panoIndex};return"moveToPano"in u&&typeof u.moveToPano=="function"?u.moveToPano(f,r,o):c&&(this.pano=f,this.once("initAnimation.start",function(p){r.moveStartCallback&&r.moveStartCallback(p.state)}),this.once("initAnimation.end",function(p){r.moveEndCallback&&r.moveEndCallback(p.state)}),this.changeMode(t.Mode.Panorama,r,{effect:r.effect},o)),this.ready()},t.prototype.preloadPano=function(e,r){var o=this;r===void 0&&(r=noop);var s=this.works.getObserver(e);if(!s)return Promise.reject(new Error("Pano ".concat(JSON.stringify(e)," never found")));var u=["right","left","up","down","front","back"],l=now();return Promise.all(u.map(function(c){var f=panoStringify({panoIndex:s.panoIndex,workCode:s.work.workCode}),p=__assign({key:"pano.".concat(f,".").concat(c)},pick(o.imageOptions,["size","format","quality","mappings"])),d=s.images[c],h=o.imageOptions.transform?o.imageOptions.transform(d,p):imageURL(d,p);return getFetcher(s.work).preload(h)})).then(function(){var c=now()-l;return r(c),c})},t.prototype.project2d=function(e,r){if(r===void 0&&(r=!1),!this.renderer)return null;if(r){var o=this.camera.position,s=e.clone().sub(o),u=new THREE__namespace.Raycaster(o,s.clone().normalize());u.params.Points={threshold:.1};var l=this.modelScene.intersectRaycaster(u)[0];if(l&&l.distance+.01<s.length())return null}var c=e.clone().project(this.camera);if(Math.abs(c.z)>1)return null;var f=this.renderer.getSize(new THREE__namespace.Vector2),p=f.x*this.viewport.width,d=f.y*this.viewport.height,h=f.x*this.viewport.left+(c.x+1)/2*p,g=f.y*(1-this.viewport.bottom-this.viewport.height)+(-c.y+1)/2*d;return new THREE__namespace.Vector2(h,g)},t.prototype.getCurrentState=function(){return __assign(__assign({},this.camera.copyPose()),{mode:this.currentMode,workCode:this.pano.workCode,panoIndex:this.pano.panoIndex})},t.prototype.setState=function(e,r,o){var s,u,l,c,f,p,d,h,g,A;r===void 0&&(r=!1),o===void 0&&(o=!0),e=Object.assign({},e),e.offset&&!(e instanceof THREE__namespace.Vector3)&&(e.offset=new THREE__namespace.Vector3(e.offset.x,e.offset.y,e.offset.z));var m;if(typeof e.panoIndex=="number")if(e.workCode)m={workCode:e.workCode,panoIndex:e.panoIndex};else{var E=(u=(s=this.work)===null||s===void 0?void 0:s.workCode)!==null&&u!==void 0?u:"",v=this.state.workCode;this.works.filter(function(P){return P.workCode===v}).length>0&&(E=v),m={workCode:E,panoIndex:e.panoIndex}}var y=(l=e.mode)!==null&&l!==void 0?l:this.state.mode,b,_,T,S,R;if(this.controller&&this.controller.stopMomentumMovement(),this.state.mode!==y){if(y==="VRPanorama"){this.changeMode("VRPanorama",void 0,void 0,!0);return}var w={workCode:m==null?void 0:m.workCode,panoIndex:m==null?void 0:m.panoIndex};typeof e.longitude=="number"&&(w.longitude=e.longitude),typeof e.latitude=="number"&&(w.latitude=e.latitude),typeof e.fov=="number"&&(w.fov=e.fov),typeof e.distance=="number"&&(w.distance=e.distance),e.offset instanceof THREE__namespace.Vector3&&(w.offset=e.offset);var M=__assign(__assign({initial:{state:w,currentState:this.getCurrentState(),duration:this.modeChangeDuration,effect:"fly",userAction:!1}},this.commonParams()),this.controllerInits[y]),B=Controllers[y].initAnimationEndState(M);b=B.longitude,_=B.latitude,T=B.fov,S=B.offset,R=B.distance}else b=(c=e.longitude)!==null&&c!==void 0?c:this.state.longitude,_=(f=e.latitude)!==null&&f!==void 0?f:this.state.latitude,T=(p=e.fov)!==null&&p!==void 0?p:this.state.fov,S=(d=e.offset)!==null&&d!==void 0?d:this.state.offset,R=(h=e.distance)!==null&&h!==void 0?h:this.state.distance;var C={workCode:(m!=null?m:this.pano).workCode,panoIndex:(m!=null?m:this.pano).panoIndex,mode:y,longitude:b,latitude:_,fov:T,offset:S,distance:R};this.emit("state.set",createEvent("state.set",{userAction:o,state:C})),stateEqual(this.state,C)||(this.controller&&C.mode==="VRPanorama"&&C.mode!==this.state.mode?(assignState(this.state,C),this.changeMode("VRPanorama")):this.controller&&C.mode==="XRPanorama"&&C.mode!==this.state.mode?(assignState(this.state,C),this.changeMode("XRPanorama")):(assignState(this.state,C),this.controller&&o&&(this.controller.userAction=!1),r&&this.state.mode===C.mode&&(this.syncingState=this.syncState(now(),0,r),this.syncingState&&((g=this.controller)===null||g===void 0||g.updateTime(now(),0),this.syncingState=!1)),this.emit("state.change",createEvent("state.change",{userAction:o,state:this.state})),(A=this.analysis)===null||A===void 0||A.state(this.works,this.state)))},t.prototype.syncState=function(e,r,o){o===void 0&&(o=!1);var s=this.stateSynced;if(this.stateSynced=!1,!this.controller)return!1;if(this.state.mode!==this.currentMode){var u={mode:this.state.mode,workCode:this.state.workCode,panoIndex:this.state.panoIndex,longitude:this.state.longitude,latitude:this.state.latitude,fov:this.state.fov,offset:this.state.offset,distance:this.state.distance};return this.changeMode(this.state.mode,u,this.modeChangeDuration,this.controller.userAction),!0}if(!this.controller.isReady())return!1;if(this.controller instanceof Controllers.Model){if(notSimilarVector3(this.camera.pose.offset,this.state.offset)){var l={longitude:this.state.longitude,latitude:this.state.latitude,fov:this.state.fov,offset:this.state.offset};return this.controller.moveToPosition(this.state.offset,__assign(__assign({},l),{duration:o?0:void 0}),!1),!0}}else{var c={workCode:this.state.workCode,panoIndex:this.state.panoIndex};if(!panoEqual(c,this.pano)&&"moveToPano"in this.controller&&typeof this.controller.moveToPano=="function"){var l={longitude:this.state.longitude,latitude:this.state.latitude,fov:this.state.fov,offset:this.state.offset,distance:this.state.distance};return this.controller.moveToPano(c,l,!1),!0}}if(this.controller instanceof Controllers.Floorplan||this.controller instanceof Controllers.Topview||this.controller instanceof Controllers.Mapview){var f=1,p=.2,d=.2,h=Math.PI/45,g=o?this.state.fov:stepNumber(this.camera.pose.fov,this.state.fov,f),A=Math.abs(this.camera.pose.distance-this.state.distance),m=A>d*15?A/15:p,E=o?this.state.distance:stepNumber(this.camera.pose.distance,this.state.distance,m),v=this.camera.pose.offset.distanceTo(this.state.offset),y=v>d*15?v/15:d,b=o?new THREE__namespace.Vector3().copy(this.state.offset):stepVector(this.camera.pose.offset,this.state.offset,y),_=o?{longitude:this.state.longitude,latitude:this.state.latitude}:stepCoordinates({longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude},{longitude:this.state.longitude,latitude:this.state.latitude},h),T=_.longitude,S=_.latitude;if(notSimilarValue(g,this.camera.pose.fov)||notSimilarVector3(b,this.camera.pose.offset)||notSimilarValue(E,this.camera.pose.distance)||notSimilarValue(T,this.camera.pose.longitude,Math.PI*2)||notSimilarValue(S,this.camera.pose.latitude)){var R={x:b.x,y:b.y,z:b.z},w={fov:g};return Object.assign(R,{distance:E}),Object.assign(w,{longitude:T,latitude:S}),this.controller.stopMomentumMovement(),this.controller.cameraMotion.set(w,0).catch(noop),this.controller.locationMotion.set(R,0).catch(noop),!0}}else{var M=1,B=Math.PI/45,g=o?this.state.fov:stepNumber(this.camera.pose.fov,this.state.fov,M),C=o?{longitude:this.state.longitude,latitude:this.state.latitude}:stepCoordinates({longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude},{longitude:this.state.longitude,latitude:this.state.latitude},B),T=C.longitude,S=C.latitude,E=this.state.distance,b=new THREE__namespace.Vector3().copy(this.state.offset);if(notSimilarValue(E,this.camera.pose.distance)&&(this.state.distance=this.camera.pose.distance),notSimilarVector3(b,this.camera.pose.offset)&&(this.state.offset=this.camera.pose.offset.clone()),notSimilarValue(T,this.camera.pose.longitude,Math.PI*2)||notSimilarValue(S,this.camera.pose.latitude)||notSimilarValue(g,this.camera.pose.fov))return this.controller.stopMomentumMovement(),this.controller.cameraMotion.set({longitude:T,latitude:S,fov:g},0).catch(noop),!0}if(this.stateSynced=!0,s===!1&&this.emit("state.synced",createEvent("state.synced",{userAction:!1,state:this.state})),this.readyCallbacks.length&&this.stateSynced){var P=this.currentMode,F=P===t.Mode.Floorplan||P===t.Mode.Topview||P===t.Mode.Mapview||P===t.Mode.Model;if(!F||this.modelScene.loaded){var L=this.readyCallbacks.slice();this.readyCallbacks.length=0;for(var O=0,k=L;O<k.length;O++){var D=k[O];this.controller instanceof Controllers.Panorama&&D.tile===!0&&!this.controller.isTileReady()?this.readyCallbacks.push(D):D()}}}return!1},t.prototype.ready=function(e){var r=this;return e===void 0&&(e={}),new Promise(function(o){var s;r.readyCallbacks.push(Object.assign(o,{tile:(s=e.tile)!==null&&s!==void 0?s:!1}))}).then(function(){return r.model.initReady})},t.prototype.requestFullscreen=function(){var e;if(isMobile){var r=(e=this.getElement())===null||e===void 0?void 0:e.parentNode;r&&"requestFullscreen"in r&&typeof document!="undefined"&&document.fullscreenElement===null&&r.requestFullscreen()}},t.prototype.exitFullscreen=function(){typeof document!="undefined"&&document.fullscreenElement&&"exitFullscreen"in document&&document.exitFullscreen()},t.prototype.throwError=function(e){this.hasListener("error")?this.emit("error",e):console.error(e)},t.prototype.loadModels=function(e,r){for(var o=this,s,u,l,c,f,p,d=new Map,h=!1,g=[],A=0,m=this.modelScene.children;A<m.length;A++){var E=m[A];E instanceof Model&&(E.outdated=!0,d.set(E.work.workCode,E),h=!0)}for(var v=function(_){var T=e[_],S=T.workCode&&d.get(T.workCode);if(S)S.work=T,S.outdated=!1,d.delete(T.workCode),g.push(S);else{var R=(l=(u=(s=r.model)===null||s===void 0?void 0:s.textureOptions)!==null&&u!==void 0?u:r.textureOptions)!==null&&l!==void 0?l:y.textureOptions,w=(f=(c=r.model)===null||c===void 0?void 0:c["3d-tiles"])!==null&&f!==void 0?f:r["3d-tiles"],M=new Model(T,{light:(p=r.model)===null||p===void 0?void 0:p.light,textureOptions:R});M.initReady.then(function(){if(w)if(typeof w=="function")for(var B=0,C=M.viewLayers;B<C.length;B++){var P=C[B],F=w(P,M,_);F&&(F.viewerRequestVolume&&(P.viewerRequestVolume=makeBoundingVolume(F.viewerRequestVolume)),P.parameter.set(omit(F,["showLayers"])),F.showLayers===!1?P.visible=!1:Array.isArray(F.showLayers)&&(P.visible=F.showLayers.includes(P.name)))}else for(var L=0,O=M.viewLayers;L<O.length;L++){var P=O[L];w.viewerRequestVolume&&(P.viewerRequestVolume=makeBoundingVolume(w.viewerRequestVolume)),P.parameter.set(omit(w,["showLayers"])),w.showLayers===!1?P.visible=!1:Array.isArray(w.showLayers)&&(P.visible=w.showLayers.includes(P.name))}}),g.push(M),h&&(M.visible=!1),y.modelScene.add(M),M.addEventListener("load",function(B){AnimationFrameLoop.shared.add(function(){o.emit("model.load",createEvent("model.load",{work:T,model:M,error:null}))},!0)}),M.addEventListener("changeShownFloor",function(B){o.emit("model.changeShownFloor",createEvent("model.changeShownFloor",{work:T,model:M,error:null}))}),M.addEventListener("error",function(B){var C=B.error;o.emit("model.error",createEvent("model.error",{work:T,model:M,error:C})),o.throwError(C)}),y.emit("model.request",createEvent("model.request",{work:T,model:M,error:null}))}},y=this,b=0;b<e.length;b++)v(b);return this.modelScene.loaded=!1,this.modelScene.refined=!1,g},t.prototype.commonParams=function(){return{ident:this.ident,scene:this.scene,xrCustomObjectsScene:this.xrCustomObjectsScene,helper:this.helperGroup,boundingMesh:this.boundingMesh,camera:this.camera,renderer:this.renderer,viewport:this.viewport,element:this.getElement(),works:this.works,imageOptions:this.imageOptions,enableWheel:this.enableWheel,extraElements:this.extraElements,videoTexture:this.videoTexture,modelScene:this.modelScene}},t.prototype.applyController=function(e,r){var o=this;if(!this.renderer)throw new Error("renderer is not initialized.");var s=Controllers[e];this.currentMode=e;for(var u=new s(r),l=function(g){u.on(g,function(){for(var A=[],m=0;m<arguments.length;m++)A[m]=arguments[m];var E=o.emit.apply(o,__spreadArray([g],A,!1));if(E)return!1})},c=0,f=PROXY_CONTROLLER_EVENT_NAMES;c<f.length;c++){var p=f[c];l(p)}{var d=Controllers[e].initAnimationEndState(r),h=r.initial.userAction;stateEqual(this.state,d)||(assignState(this.state,d),this.emit("state.change",createEvent("state.change",{userAction:h,state:this.state}))),this.emit("currentState.change",createEvent("currentState.change",{userAction:h,state:this.getCurrentState()}))}return u.on("camera.update",function(g){var A;if(o.controller){var m=o.controller.getTargetState();g.userAction&&o.syncingState===!1&&o.state.mode===m.mode&&!stateEqual(o.state,m)&&(assignState(o.state,m),o.emit("state.change",createEvent("state.change",{userAction:g.userAction,state:o.state})),(A=o.analysis)===null||A===void 0||A.state(o.works,o.state))}o.emit("currentState.change",createEvent("currentState.change",{userAction:g.userAction,state:o.getCurrentState()}))}),u.on("initAnimation.start",function(g){var A,m=g.state,E=g.userAction;E&&o.state.mode===m.mode&&!stateEqual(o.state,m)&&(assignState(o.state,m),o.emit("state.change",createEvent("state.change",{userAction:E,state:o.state})),(A=o.analysis)===null||A===void 0||A.state(o.works,o.state))}),u.on("initAnimation.end",function(g){var A,m=g.state,E=g.userAction;o.pano={workCode:m.workCode,panoIndex:m.panoIndex},E&&o.state.mode===m.mode&&!stateEqual(o.state,m)&&(assignState(o.state,m),o.emit("state.change",createEvent("state.change",{userAction:E,state:o.state})),(A=o.analysis)===null||A===void 0||A.state(o.works,o.state))}),u.on("pano.moveTo",function(g){var A,m=g.state,E=g.userAction;o.pano={workCode:m.workCode,panoIndex:m.panoIndex},E&&o.state.mode===m.mode&&!stateEqual(o.state,m)&&(assignState(o.state,m),o.emit("state.change",createEvent("state.change",{userAction:E,state:o.state})),(A=o.analysis)===null||A===void 0||A.state(o.works,o.state))}),u.on("pano.arrived",function(g){var A,m=g.state,E=g.userAction;o.pano={workCode:m.workCode,panoIndex:m.panoIndex},E&&o.state.mode===m.mode&&!stateEqual(o.state,m)&&(assignState(o.state,m),o.emit("state.change",createEvent("state.change",{userAction:E,state:o.state})),(A=o.analysis)===null||A===void 0||A.state(o.works,o.state))}),u.on("pano.cancel",function(g){var A,m=g.state,E=g.userAction;E&&o.state.mode===m.mode&&!stateEqual(o.state,m)&&(assignState(o.state,m),o.emit("state.change",createEvent("state.change",{userAction:E,state:o.state})),(A=o.analysis)===null||A===void 0||A.state(o.works,o.state))}),u.on("pano.moveTo",function(g){var A=g.userAction;o.emit("currentState.change",createEvent("currentState.change",{userAction:A,state:o.getCurrentState()}))}),u.on("pano.request",function(g){o.emit("pano.request",g),g.defaultPrevented||o.moveToPano(g.state,g.options,g.userAction)}),u.on("vr.requestExit",function(){o.currentMode===t.Mode.VRPanorama&&(o.exitFullscreen(),o.changeMode(t.Mode.Panorama))}),u.on("error",function(g){return o.throwError(g)}),u},t.prototype.removeEventListeners=function(){},Object.defineProperty(t.prototype,"internalLightsEnabled",{get:function(){var e=this.scene.children.find(function(r){return r.name==="internalLights"});return e?e.visible:!1},set:function(e){var r=this.scene.children.find(function(o){return o.name==="internalLights"});r&&(r.visible=e),r=this.modelScene.children.find(function(o){return o.name==="internalLights"}),r&&(r.visible=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"scissor",{get:function(){return this.viewport},enumerable:!1,configurable:!0}),t.prototype.setScissor=function(e){return this.setViewport(e)},t.prototype.getPose=function(){var e=this.camera.copyPose(),r=e.longitude,o=e.latitude,s=e.fov,u=e.offset,l=e.distance;return{longitude:r,latitude:o,fov:s,offset:u.clone(),distance:l}},t.prototype.getLongitudeAndLatitude=function(){var e=this.getPose(),r=e.longitude,o=e.latitude;return{longitude:r,latitude:o}},t.prototype.getOffset=function(){return this.getPose().offset},t.prototype.getCameraLocal=function(){if(this.pano.workCode&&this.controller&&this.works){var e=this.works.getObserver(this.pano);if(e){var r=new THREE__namespace.Object3D;return r.matrix.copy(e.matrix).premultiply(e.work.transform),r.matrix.decompose(r.position,r.quaternion,r.scale),r.matrixAutoUpdate=!1,cameraWorldToLocal(this.camera,r)}}return null},Object.defineProperty(t.prototype,"enableIOSEDR",{get:function(){return!1},set:function(e){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"enableEDL",{get:function(){return this.renderEffect==="edl"},set:function(e){this.renderEffect=e?"edl":"default"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"enableHQ",{get:function(){return this.renderEffect==="hq"},set:function(e){this.renderEffect=e?"hq":"default"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"enablePostProcessing",{get:function(){return!1},set:function(e){},enumerable:!1,configurable:!0}),t.Mode={Panorama:"Panorama",Model:"Model",Floorplan:"Floorplan",Topview:"Topview",Mapview:"Mapview",VRPanorama:"VRPanorama",XRPanorama:"XRPanorama"},t})(Subscribe),__FIVE_DEBUG__={instances:{},constructor:Five};typeof window!="undefined"&&Object.assign(window,{__FIVE_DEBUG__});var XRButton=(function(){function n(){}return n.createButton=function(t){var e=document.createElement("button");function r(){e.style.display="",e.style.cursor="pointer",e.style.left="calc(50% - 50px)",e.style.width="100px",e.textContent="ENTER VR",e.onmouseenter=function(){e.style.opacity="1.0"},e.onmouseleave=function(){e.style.opacity="0.5"},e.onclick=function(){t&&t()}}function o(){e.style.display="",e.style.cursor="auto",e.style.left="calc(50% - 75px)",e.style.width="150px",e.onmouseenter=null,e.onmouseleave=null,e.onclick=null}function s(){o(),e.textContent="VR NOT SUPPORTED"}function u(c){c.style.position="absolute",c.style.bottom="20px",c.style.padding="12px 6px",c.style.border="1px solid #fff",c.style.borderRadius="4px",c.style.background="rgba(0,0,0,0.1)",c.style.color="#fff",c.style.font="normal 13px sans-serif",c.style.textAlign="center",c.style.opacity="0.5",c.style.outline="none",c.style.zIndex="999"}if("xr"in navigator)return e.id="VRButton",e.style.display="none",u(e),navigator.xr.isSessionSupported("immersive-vr").then(function(c){c?r():s()}),e;var l=document.createElement("a");return window.isSecureContext===!1?(l.href=document.location.href.replace(/^http:/,"https:"),l.innerHTML="WEBXR NEEDS HTTPS"):(l.href="https://immersiveweb.dev/",l.innerHTML="WEBXR NOT AVAILABLE"),l.style.left="calc(50% - 90px)",l.style.width="180px",l.style.textDecoration="none",u(l),l},n})();exports.AnimationFrameLoop=AnimationFrameLoop;exports.Camera=Camera;exports.CustomShader=PBMCustomShader;exports.Fetcher=Fetcher;exports.Five=Five;exports.InternalWebGLRenderer=InternalWebGLRenderer;exports.Model=Model;exports.ModelScene=ModelScene;exports.Motion=Motion;exports.NetworkSubscribe=NetworkSubscribe;exports.PBMContainer=PBMContainer;exports.PBMCustomShader=PBMCustomShader;exports.PBMGroup=PBMGroup;exports.PBMMesh=PBMMesh;exports.PBMMeshMaterial=PBMMeshMaterial;exports.PBMPointCloud=PBMPointCloud;exports.PBMPointCloudMaterial=PBMPointCloudMaterial;exports.PBMSkinnedMesh=PBMSkinnedMesh;exports.PROXY_CONTROLLER_EVENT_NAMES=PROXY_CONTROLLER_EVENT_NAMES;exports.PanoCircleMesh=PanoCircleMesh;exports.PanoCircleMeshCustom=PanoCircleMeshCustom;exports.PanoCircleMeshSolid=PanoCircleMeshSolid;exports.Parameter=Parameter;exports.Scene=Scene;exports.Subscribe=Subscribe;exports.TextureLoader=TextureLoader;exports.Tile=Tile;exports.Tile3DModel=Tile3D;exports.TileCache=TileCache;exports.TileNode=TileNode;exports.TileRequestScheduler=TileRequestScheduler;exports.Tileset=Tileset;exports.Trajectory=Trajectory;exports.TrajectoryNode=TrajectoryNode;exports.Work=Work;exports.WorkResolvedObserver=WorkResolvedObserver;exports.XRButton=XRButton;exports.controllersDefaultInitArgs=controllersDefaultInitArgs;exports.coordinatesToVector=coordinatesToVector;exports.createDebugBoundingMesh=createDebugBoundingMesh;exports.createWorks=createWorks;exports.defaultImageURLTransform=imageURL;exports.draco=draco;exports.getViewportScale=getViewportScale;exports.headingToLongitude=headingToLongitude;exports.imageSupport=imageSupport;exports.isBoundingVolume=isBoundingVolume;exports.isPanoId=isPanoId;exports.ktx2=ktx2;exports.loadAt3d=loadAt3d;exports.loadB3dm=loadB3dm;exports.loadDome=loadDome;exports.loadDomez=loadDomez;exports.loadFbx=loadFbx;exports.loadGltf=loadGltf;exports.loadPbm=loadPbm;exports.loadPly=loadPly;exports.loadPnts=loadPnts;exports.loadX3p=loadX3p;exports.longitudeToHeading=longitudeToHeading;exports.makeBoundingVolume=makeBoundingVolume;exports.panoEqual=panoEqual;exports.panoParse=panoParse;exports.panoStringify=panoStringify;exports.parseWork=parseWork;exports.vectorToCoordinates=vectorToCoordinates;exports.workToJson=workToJson;