@realsee/five 6.8.7 → 6.8.9
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.
- package/ai_guides/README.md +2 -0
- package/ai_guides/features/flowing-fireworks-3d-pass.md +296 -0
- package/ai_guides/features/flowing-light-3d-pass.md +1 -0
- package/ai_guides/features/postprocessing.md +3 -1
- package/docs/assets/hierarchy.js +1 -1
- package/docs/assets/navigation.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/five.AdaptiveLuminancePass.html +1 -1
- package/docs/classes/five.BoundingMesh.html +1 -1
- package/docs/classes/five.Camera.html +1 -1
- package/docs/classes/five.EyeDomeLightingPass.html +1 -1
- package/docs/classes/five.Five.html +1 -1
- package/docs/classes/five.FivePass.html +1 -1
- package/docs/classes/five.FlowingLight2DPass.html +2 -2
- package/docs/classes/five.FlowingLight3DPass.html +2 -2
- package/docs/classes/five.GaussianBlurPass.html +1 -1
- package/docs/classes/five.InternalWebGLRenderer.html +1 -1
- package/docs/classes/five.Model.html +1 -1
- package/docs/classes/five.ModelScene.html +1 -1
- package/docs/classes/five.NetworkSubscribe.html +1 -1
- package/docs/classes/five.PBMContainer.html +1 -1
- package/docs/classes/five.PBMCustomShader.html +1 -1
- package/docs/classes/five.PBMGSObject.html +1 -1
- package/docs/classes/five.PBMGroup.html +1 -1
- package/docs/classes/five.PBMMesh.html +1 -1
- package/docs/classes/five.PBMMeshMaterial.html +1 -1
- package/docs/classes/five.PBMPanoFilter.html +1 -1
- package/docs/classes/five.PBMPointCloud.html +1 -1
- package/docs/classes/five.PBMPointCloudMaterial.html +1 -1
- package/docs/classes/five.PBMSkinnedMesh.html +1 -1
- package/docs/classes/five.PBMUpdateable.html +1 -1
- package/docs/classes/five.PanoCircleMesh.html +1 -1
- package/docs/classes/five.PanoCircleMeshCustom.html +1 -1
- package/docs/classes/five.PanoCircleMeshSolid.html +1 -1
- package/docs/classes/five.Parameter.html +1 -1
- package/docs/classes/five.Scene.html +1 -1
- package/docs/classes/five.Subscribe.html +1 -1
- package/docs/classes/five.TextureLoader.html +1 -1
- package/docs/classes/five.Tile3D.html +1 -1
- package/docs/classes/five.TileNode.html +1 -1
- package/docs/classes/five.TrajectoryNode.html +1 -1
- package/docs/classes/five.WorkResolvedObserver.html +1 -1
- package/docs/classes/gltf-loader.DDSLoader.html +1 -1
- package/docs/classes/gltf-loader.DRACOLoader.html +1 -1
- package/docs/classes/gltf-loader.GLTFLoader.html +1 -1
- package/docs/classes/gltf-loader.GLTFObject.html +1 -1
- package/docs/classes/gltf-loader.THREEGLTFLoader.html +1 -1
- package/docs/classes/line.Line.html +1 -1
- package/docs/classes/line.LineGeometry.html +1 -1
- package/docs/classes/line.LineMaterial.html +1 -1
- package/docs/classes/line.LineSegmentsGeometry.html +1 -1
- package/docs/classes/line.THREE_Line2.html +1 -1
- package/docs/classes/line.THREE_LineSegments2.html +1 -1
- package/docs/classes/plugins.BasePlugin.Controller.html +1 -1
- package/docs/classes/plugins.CSS2DObject.html +1 -1
- package/docs/classes/plugins.CSS3DObject.html +1 -1
- package/docs/classes/plugins.CSS3DSprite.html +1 -1
- package/docs/classes/plugins.InstancedPrefabBufferGeometry.html +1 -1
- package/docs/classes/plugins.Object3DHelperController.html +1 -1
- package/docs/classes/plugins.PointBufferGeometry.html +1 -1
- package/docs/classes/plugins.PrefabBufferGeometry.html +1 -1
- package/docs/classes/plugins.RoundedBoxGeometry.html +1 -1
- package/docs/classes/sticker.Sticker.html +1 -1
- package/docs/classes/vfx.Airflow.html +1 -1
- package/docs/classes/vfx.Flame.html +1 -1
- package/docs/classes/vfx.Particle.html +1 -1
- package/docs/classes/vfx.ParticleGPU.html +1 -1
- package/docs/classes/vfx.SpotLight.html +1 -1
- package/docs/documents/README.html +6 -0
- package/docs/documents/features_flowing-fireworks-3d-pass.html +242 -0
- package/docs/documents/features_flowing-light-3d-pass.html +1 -0
- package/docs/documents/features_postprocessing.html +3 -1
- package/docs/functions/plugins.calculatePath2DLength.html +1 -0
- package/docs/functions/plugins.calculatePath3DLength.html +1 -0
- package/docs/hierarchy.html +1 -1
- package/docs/index.html +6 -0
- package/docs/interfaces/five.AddableObject.html +1 -1
- package/docs/interfaces/five.AjaxOptions.html +1 -1
- package/docs/interfaces/five.BaseEvent.html +1 -1
- package/docs/interfaces/five.BaseExtendableEvent.html +1 -1
- package/docs/interfaces/five.EventCallback.html +1 -1
- package/docs/interfaces/five.GestureEvent.html +1 -1
- package/docs/interfaces/five.ImageOptions.html +1 -1
- package/docs/interfaces/five.IntersectEvent.html +1 -1
- package/docs/interfaces/five.IntersectMesh.html +1 -1
- package/docs/interfaces/five.IntersectMeshInterface.html +1 -1
- package/docs/interfaces/five.Intersection.html +1 -1
- package/docs/interfaces/five.LooseWorkWithExtrinsics.html +1 -1
- package/docs/interfaces/five.ModeChangeEvent.html +1 -1
- package/docs/interfaces/five.ModelControllerCustomInitArgs.html +1 -1
- package/docs/interfaces/five.ModelEvent.html +1 -1
- package/docs/interfaces/five.ModelSceneEvent.html +1 -1
- package/docs/interfaces/five.ModelTileEvent.html +1 -1
- package/docs/interfaces/five.MovePanoOptions.html +1 -1
- package/docs/interfaces/five.NetworkAbortError.html +1 -1
- package/docs/interfaces/five.NetworkFirbiddenError.html +1 -1
- package/docs/interfaces/five.NetworkOptions.html +1 -1
- package/docs/interfaces/five.NetworkProxyError.html +1 -1
- package/docs/interfaces/five.NetworkResourceEvent.html +1 -1
- package/docs/interfaces/five.NetworkResponseError.html +1 -1
- package/docs/interfaces/five.NetworkTimeoutError.html +1 -1
- package/docs/interfaces/five.ObjectEvent.html +1 -1
- package/docs/interfaces/five.PBMMaterial.html +1 -1
- package/docs/interfaces/five.PBMMeshMaterialParameters.html +1 -1
- package/docs/interfaces/five.PBMPointCloudMaterialParameters.html +1 -1
- package/docs/interfaces/five.PanoCircleMeshInterface.html +1 -1
- package/docs/interfaces/five.PanoEvent.html +1 -1
- package/docs/interfaces/five.PanoPrepareEvent.html +1 -1
- package/docs/interfaces/five.PanoTextureEvent.html +1 -1
- package/docs/interfaces/five.PanoramaControllerCustomInitArgs.html +1 -1
- package/docs/interfaces/five.PanoramaLikeControllerCustomInitArgs.html +1 -1
- package/docs/interfaces/five.ParameterMaterialValue.html +1 -1
- package/docs/interfaces/five.ParameterTilesetValue.html +1 -1
- package/docs/interfaces/five.ParameterValue.html +1 -1
- package/docs/interfaces/five.Pose.html +1 -1
- package/docs/interfaces/five.RenderEvent.html +1 -1
- package/docs/interfaces/five.ResolvedParameterValue.html +1 -1
- package/docs/interfaces/five.State.html +1 -1
- package/docs/interfaces/five.StateEvent.html +1 -1
- package/docs/interfaces/five.TextureOptions.html +1 -1
- package/docs/interfaces/five.TopviewControllerCustomInitArgs.html +1 -1
- package/docs/interfaces/five.VRPanoramaControllerCustomInitArgs.html +1 -1
- package/docs/interfaces/five.ViewLayer.html +1 -1
- package/docs/interfaces/five.WorkCubeImage.html +1 -1
- package/docs/interfaces/five.WorkImage.html +1 -1
- package/docs/interfaces/five.WorkObserver.html +1 -1
- package/docs/interfaces/five.WorkObserverProto.html +1 -1
- package/docs/interfaces/five.WorkTile.html +1 -1
- package/docs/interfaces/five.WorksEvent.html +1 -1
- package/docs/interfaces/five.XRControllerEvent.html +1 -1
- package/docs/interfaces/five.XRGestureEvent.html +1 -1
- package/docs/interfaces/five.XRPanoramaControllerCustomInitArgs.html +1 -1
- package/docs/interfaces/five.XRSessionEvent.html +1 -1
- package/docs/interfaces/plugins.BackgroundPluginController.html +1 -1
- package/docs/interfaces/plugins.BackgroundPluginType.EventMap.html +1 -1
- package/docs/interfaces/plugins.BasePlugin.State.html +1 -1
- package/docs/interfaces/plugins.CSS2DPluginController.html +1 -1
- package/docs/interfaces/plugins.CSS2DPluginType.EventMap.html +1 -1
- package/docs/interfaces/plugins.CSS2DPluginType.State.html +1 -1
- package/docs/interfaces/plugins.CSS3DPluginController.html +1 -1
- package/docs/interfaces/plugins.CSS3DPluginType.EventMap.html +1 -1
- package/docs/interfaces/plugins.CSS3DPluginType.State.html +1 -1
- package/docs/interfaces/plugins.DynamicPathLinePluginController.html +1 -1
- package/docs/interfaces/plugins.DynamicPathLinePluginType.EventMap.html +1 -1
- package/docs/interfaces/plugins.DynamicPathLinePluginType.State.html +1 -1
- package/docs/interfaces/plugins.GaussianSplattingEntranceAnimationController.html +1 -1
- package/docs/interfaces/plugins.GaussianSplattingEntranceAnimationPluginType.EventMap.html +1 -1
- package/docs/interfaces/plugins.GaussianSplattingEntranceAnimationPluginType.State.html +1 -1
- package/docs/interfaces/plugins.ItemMaskController.html +1 -1
- package/docs/interfaces/plugins.ItemMaskPluginType.EventMap.html +1 -1
- package/docs/interfaces/plugins.ItemMaskPluginType.State.html +1 -1
- package/docs/interfaces/plugins.Object3DHelperPluginType.BaseController.html +1 -1
- package/docs/interfaces/plugins.Object3DHelperPluginType.BaseHelper.html +1 -1
- package/docs/interfaces/plugins.Object3DHelperPluginType.BoundingBoxController.html +1 -1
- package/docs/interfaces/plugins.Object3DHelperPluginType.MoveController.html +1 -1
- package/docs/interfaces/plugins.Object3DHelperPluginType.MoveHelperAbstract.html +1 -1
- package/docs/interfaces/plugins.Object3DHelperPluginType.RotateController.html +1 -1
- package/docs/interfaces/plugins.Object3DHelperPluginType.RotateHelperAbstract.html +1 -1
- package/docs/interfaces/plugins.OrientationPluginController.html +1 -1
- package/docs/interfaces/plugins.OrientationPluginType.EventMap.html +1 -1
- package/docs/interfaces/plugins.OrientationPluginType.State.html +1 -1
- package/docs/interfaces/plugins.PanoAnimeController.html +1 -1
- package/docs/interfaces/plugins.PanoAnimePluginType.EventMap.html +1 -1
- package/docs/interfaces/plugins.PanoAnimePluginType.State.html +1 -1
- package/docs/interfaces/plugins.PluginTemplateType.EventMap.html +1 -1
- package/docs/interfaces/plugins.PluginTemplateType.State.html +1 -1
- package/docs/interfaces/plugins.TrajectoryController.html +9 -9
- package/docs/interfaces/react.FiveInjectionTypes.html +1 -1
- package/docs/interfaces/react.UseFivePluginOptions.html +1 -1
- package/docs/interfaces/react.UseFivePluginOptionsWithCreate.html +1 -1
- package/docs/modules/five.html +1 -1
- package/docs/modules/plugins.html +1 -1
- package/docs/modules.html +1 -1
- package/docs/types/five.FlowingLight2DPassLine.html +10 -0
- package/docs/types/five.FlowingLight3DPassLine.html +10 -0
- package/docs/types/five.ParseOptions.html +1 -1
- package/docs/types/plugins.BasePlugin.EventMap.html +1 -1
- package/five/index.js +48 -48
- package/five/index.mjs +23 -23
- package/five/renderer/index.d.ts +1 -1
- package/five/renderer/postprocessing/index.d.ts +3 -2
- package/five/renderer/postprocessing/passes/flowing-fireworks-3d-pass.d.ts +74 -0
- package/five/renderer/postprocessing/passes/flowing-light-2d-pass.d.ts +4 -5
- package/five/renderer/postprocessing/passes/flowing-light-3d-pass.d.ts +4 -5
- package/gltf-loader/index.js +3 -3
- package/gltf-loader/index.mjs +3 -3
- package/line/index.js +3 -3
- package/line/index.mjs +3 -3
- package/llms.txt +2 -0
- package/package.json +1 -1
- package/plugins/index.d.ts +1 -0
- package/plugins/index.js +4 -4
- package/plugins/index.mjs +26 -14
- package/plugins/utils/math.d.ts +2 -0
- package/react/index.js +2 -2
- package/react/index.mjs +2 -2
- package/shader-lib/index.js +2 -2
- package/shader-lib/index.mjs +2 -2
- package/sticker/index.js +3 -3
- package/sticker/index.mjs +3 -3
- package/umd/five-gltf-loader.js +3 -3
- package/umd/five-line.js +3 -3
- package/umd/five-plugins.js +4 -4
- package/umd/five-react.js +2 -2
- package/umd/five-shader-lib.js +2 -2
- package/umd/five-sticker.js +3 -3
- package/umd/five-vfx.js +2 -2
- package/umd/five-vue.js +2 -2
- package/umd/five.js +48 -48
- package/vfx/index.js +2 -2
- package/vfx/index.mjs +2 -2
- package/vue/index.js +2 -2
- package/vue/index.mjs +2 -2
- package/work-downloader/index.js +2 -2
- package/work-downloader/index.mjs +2 -2
package/umd/five.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
* @realsee/five
|
|
4
|
-
* Generated: 2026/
|
|
5
|
-
* Version: 6.8.
|
|
4
|
+
* Generated: 2026/7/7
|
|
5
|
+
* Version: 6.8.9
|
|
6
6
|
* Terms:
|
|
7
7
|
* Realsee SDK License Agreement
|
|
8
8
|
* Update: July 28, 2021
|
|
@@ -316,7 +316,7 @@
|
|
|
316
316
|
`)),e.fragmentShader=e.fragmentShader.replace(/MAIN_MODEL_COLOR/g,s.map(e=>e.fragment.mainModelColor).filter(e=>!!e).join(`
|
|
317
317
|
`)),e.fragmentShader=e.fragmentShader.replace(/MAIN_PANO_COLOR/g,s.map(e=>e.fragment.mainPanoColor).filter(e=>!!e).join(`
|
|
318
318
|
`));let c=String(this.clippers.length);e.vertexShader=e.vertexShader.replace(/NUM_CLIPPERS/g,c),e.fragmentShader=e.fragmentShader.replace(/NUM_CLIPPERS/g,c);for(let t of s)t.onBeforeCompile&&t.onBeforeCompile(e,r)};let r=``;this.onBeforeRender=(e,o,s,c,l,u)=>{let d=this.shaderType;s instanceof Camera?(n.pixelRatio.value=s.pixelRatio,n.resolution.value.copy(s.resolution)):(n.pixelRatio.value=e.getPixelRatio(),e.getViewport(scratchViewport$4),n.resolution.value.set(scratchViewport$4.width,scratchViewport$4.height));let f=this.transparent===!1&&this.blending===three.NormalBlending;t.USE_OPAQUE!==f&&(t.USE_OPAQUE=f,this.needsUpdate=!0);let p=this.customShaders.filter(e=>e.type.includes(d)).map(e=>`${e.id}:${e.version}`).join(`|`);r!==p&&(r=p,this.needsUpdate=!0)},Object.defineProperty(this,`uniform`,{configurable:!1,enumerable:!1,writable:!1,value:n}),defineProperty(this,`isPBMPointCloudMaterial`,{configurable:!1,writable:!1,value:!0}),defineProperty(this,`isShaderMaterial`,{configurable:!1,writable:!1,value:!0}),defineProperty(this,`opacity`,{get(){return n.opacity.value},set(e){n.opacity.value=e}}),defineProperty(this,`vertexMarks`,{get(){return!!t.USE_VERTEX_MARK},set(e){t.USE_VERTEX_MARK!==e&&(t.USE_VERTEX_MARK=e,this.needsUpdate=!0)}}),defineProperty(this,`pointScale`,{get(){return n.pointScale.value},set(e){n.pointScale.value=e}}),defineProperty(this,`pointMinPixel`,{get(){return n.pointMinPixel.value},set(e){n.pointMinPixel.value=e}}),defineProperty(this,`pointMaxPixel`,{get(){return n.pointMinPixel.value},set(e){n.pointMaxPixel.value=e}}),defineProperty(this,`pointSize`,{get(){return this.defines.USE_POINT_SIZE_ATTENUATION===!0?`ATTENUATION`:`FIXED`},set(e){let t=e===`ATTENUATION`;this.defines.USE_POINT_SIZE_ATTENUATION!==t&&(this.defines.USE_POINT_SIZE_ATTENUATION=t,this.needsUpdate=!0)}}),defineProperty(this,`pointShape`,{get(){return this.defines.USE_POINT_SHAPE_CIRCLE===!0?`CIRCLE`:`SQUARE`},set(e){let t=e===`CIRCLE`;this.defines.USE_POINT_SHAPE_CIRCLE!==t&&(this.defines.USE_POINT_SHAPE_CIRCLE=t,this.needsUpdate=!0)}}),defineProperty(this,`pointBack`,{get(){return this.defines.USE_POINT_BACK_HIDDEN===!0?`HIDDEN`:this.defines.USE_POINT_BACK_DARK===!0?`DARK`:`VISIBLE`},set(e){let t=e===`HIDDEN`,n=e===`DARK`;this.defines.USE_POINT_BACK_HIDDEN!==t&&(this.defines.USE_POINT_BACK_HIDDEN=t,this.needsUpdate=!0),this.defines.USE_POINT_BACK_DARK!==n&&(this.defines.USE_POINT_BACK_DARK=n,this.needsUpdate=!0)}}),defineProperty(this,`modelAlpha`,{get(){return n.modelAlpha.value},set(e){n.modelAlpha.value=e}}),defineProperty(this,`colorStyle`,{get(){return t.USE_COLOR_CONSTANT?`CONSTANT`:t.USE_COLOR_ALTITUDE?`ALTITUDE`:`RGB`},set(e){let n=e===`CONSTANT`,r=e===`ALTITUDE`;t.USE_COLOR_CONSTANT!==n&&(t.USE_COLOR_CONSTANT=n,this.needsUpdate=!0),t.USE_COLOR_ALTITUDE!==r&&(t.USE_COLOR_ALTITUDE=r,this.needsUpdate=!0)}}),defineProperty(this,`constantColor`,{get(){return n.constantColor.value},set(e){n.constantColor.value=e}}),defineProperty(this,`floorIndex`,{get(){return n.floorIndex.value},set(e){n.floorIndex.value=e}}),defineProperty(this,`shownFloorIndex`,{get(){return n.shownFloorIndex.value},set(e){n.shownFloorIndex.value=e}}),defineProperty(this,`floorStyle`,{get(){return t.USE_FLOOR_STYLE_VISIBILITY?`VISIBILITY`:`OPACITY`},set(e){let n=e===`VISIBILITY`;t.USE_FLOOR_STYLE_VISIBILITY!==n&&(t.USE_FLOOR_STYLE_VISIBILITY=n,this.needsUpdate=!0)}}),defineProperty(this,`gradientTexture`,{get(){return n.gradientTexture.value},set(e){n.gradientTexture.value=e}}),defineProperty(this,`brightness`,{get(){return n.brightness.value},set(e){n.brightness.value=e}});let o=[];defineProperty(this,`clippers`,{get(){return o},set(e){o!==e&&(o=e,n.clippers.value=o.map(e=>{let t=typeof e.floorIndex==`number`?e.floorIndex:-1;return{matrixInverse:new three.Matrix4().getInverse(e.clippingBoxMatrix),floorIndex:t}}),this.needsUpdate=!0)}}),defineProperty(this,`colorSaturation`,{get(){return n.colorSaturation.value},set(e){n.colorSaturation.value=e;let r=n.colorSaturation.value!==0||n.colorBrightness.value!==0||n.outlineGain.value!==0||n.distanceGain.value!==0;t.USE_COLOR_ADJUSTMENT!==r&&(t.USE_COLOR_ADJUSTMENT=r,this.needsUpdate=!0)}}),defineProperty(this,`colorBrightness`,{get(){return n.colorBrightness.value},set(e){n.colorBrightness.value=e;let r=n.colorSaturation.value!==0||n.colorBrightness.value!==0||n.outlineGain.value!==0||n.distanceGain.value!==0;t.USE_COLOR_ADJUSTMENT!==r&&(t.USE_COLOR_ADJUSTMENT=r,this.needsUpdate=!0)}}),defineProperty(this,`outlineGain`,{get(){return n.outlineGain.value},set(e){n.outlineGain.value=e;let r=n.colorSaturation.value!==0||n.colorBrightness.value!==0||n.outlineGain.value!==0||n.distanceGain.value!==0;t.USE_COLOR_ADJUSTMENT!==r&&(t.USE_COLOR_ADJUSTMENT=r,this.needsUpdate=!0)}}),defineProperty(this,`distanceGain`,{get(){return n.distanceGain.value},set(e){n.distanceGain.value=e;let r=n.colorSaturation.value!==0||n.colorBrightness.value!==0||n.outlineGain.value!==0||n.distanceGain.value!==0;t.USE_COLOR_ADJUSTMENT!==r&&(t.USE_COLOR_ADJUSTMENT=r,this.needsUpdate=!0)}}),defineProperty(this,`useHQWeight`,{get(){return t.USE_HQ_WEIGHT},set(e){e!==t.USE_HQ_WEIGHT&&(t.USE_HQ_WEIGHT=e,this.needsUpdate=!0)}}),defineProperty(this,`useHQDepth`,{get(){return t.USE_HQ_DEPTH},set(e){e!==t.USE_HQ_DEPTH&&(t.USE_HQ_DEPTH=e,this.needsUpdate=!0)}}),defineProperty(this,`modelBoundingMin`,{get(){return n.modelBoundingMin.value},set(e){n.modelBoundingMin.value=e}}),defineProperty(this,`modelBoundingMax`,{get(){return n.modelBoundingMax.value},set(e){n.modelBoundingMax.value=e}}),typeof e==`object`&&this.setValues(e),toFastProperties(this)}copy(e){return super.copy(e),this.pointScale=e.pointScale,this.pointMinPixel=e.pointMinPixel,this.pointMaxPixel=e.pointMaxPixel,this.customShaders=e.customShaders,this.modelAlpha=e.modelAlpha,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.useHQWeight=e.useHQWeight,this.useHQDepth=e.useHQDepth,this.modelBoundingMin.copy(e.modelBoundingMin),this.modelBoundingMax.copy(e.modelBoundingMax),this}clone(){let e=this.constructor;return new e().copy(this)}refreshUniforms(){}},PBMPointCloud=class extends three.Points{constructor(e,t){super(e,t),this.onBeforeRender=(e,t,n,r,o,s)=>{o instanceof PBMPointCloudMaterial&&o.onBeforeRender&&o.onBeforeRender(e,t,n,r,this,s)}}},gradient_png_data_url_default=`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 getValueKeys(e){return Object.keys(e)}function valueEqual(e,t){return e==t}function arrayValueEqual(e,t){if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}return e===t}function vector3Equal(e,t){return e instanceof three.Vector3&&t instanceof three.Vector3?e.equals(t):e===t}function box3Equal(e,t){return e instanceof three.Box3&&t instanceof three.Box3?e.equals(t):e===t}var parameterValueEqualFn={customShaders:arrayValueEqual,castShadow:valueEqual,receiveShadow:valueEqual,vertexMarks:valueEqual,pano0:valueEqual,pano1:valueEqual,pano0Depth:valueEqual,pano1Depth:valueEqual,panoFilter:valueEqual,refinedScreen:valueEqual,modelAlpha:valueEqual,progress:valueEqual,transition:valueEqual,opacity:valueEqual,floorStyle:valueEqual,colorStyle:valueEqual,constantColor:vector3Equal,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:box3Equal,gaussianSplattingSHDegree:valueEqual,enableGaussianSplattingInitAnimation:valueEqual,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,memoryAdjustedScreenSpaceError:valueEqual,cacheCameras:arrayValueEqual},defaultGradientTexture=(()=>{let e;return e=typeof document<`u`?new three.TextureLoader().load(gradient_png_data_url_default):new three.Texture,e.minFilter=three.NearestFilter,e.magFilter=three.NearestFilter,e.wrapS=three.RepeatWrapping,e.wrapT=three.RepeatWrapping,e})(),defineConstantColor=Object.freeze(new three.Vector3(.6,.6,.6)),defineClippers=Object.freeze([]),defineBoundingBox=Object.freeze(new three.Box3),defineCustomShaders=Object.freeze([]),defineCacheCameras=Object.freeze([]),undefinedValue={customShaders:void 0,castShadow:void 0,receiveShadow:void 0,vertexMarks:void 0,pano0:void 0,pano1:void 0,pano0Depth:void 0,pano1Depth:void 0,panoFilter:void 0,refinedScreen:void 0,floorStyle:void 0,colorStyle:void 0,constantColor:void 0,shownFloorIndex:void 0,modelAlpha:void 0,opacity:void 0,progress:void 0,transition:void 0,clippers:void 0,brightness:void 0,useHQWeight:void 0,useHQDepth:void 0,pointSize:void 0,pointBack:void 0,pointShape:void 0,pointScale:void 0,pointMaxPixel:void 0,pointMinPixel:void 0,pointAppearAnimation:void 0,gradientTexture:void 0,colorSaturation:void 0,colorBrightness:void 0,outlineGain:void 0,distanceGain:void 0,useAddBlend:void 0,boundingBox:void 0,gaussianSplattingSHDegree:void 0,enableGaussianSplattingInitAnimation:void 0,minLevelOfDetail:void 0,maxLevelOfDetail:void 0,minGeometricError:void 0,maxGeometricError:void 0,panoramaMinGeometricError:void 0,skipLevelOfDetail:void 0,mostDetail:void 0,loadSiblings:void 0,cameraCulling:void 0,maxMemoryUsage:void 0,maxRequests:void 0,requestOrder:void 0,maxScreenSpaceError:void 0,memoryAdjustedScreenSpaceError:void 0,cacheCameras:void 0},defaultValue={versionNumber:0,customShaders:defineCustomShaders,castShadow:!1,receiveShadow:!1,vertexMarks:!0,pano0:null,pano1:null,pano0Depth:null,pano1Depth:null,panoFilter:null,refinedScreen:null,floorStyle:`OPACITY`,colorStyle:`RGB`,constantColor:defineConstantColor,shownFloorIndex:-1,modelAlpha:1,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,gaussianSplattingSHDegree:0,enableGaussianSplattingInitAnimation:!1,minLevelOfDetail:0,maxLevelOfDetail:20,minGeometricError:0,maxGeometricError:1e4,panoramaMinGeometricError:.04,skipLevelOfDetail:!1,mostDetail:!1,loadSiblings:!1,cameraCulling:!0,maxMemoryUsage:64,maxRequests:6,requestOrder:`SCREEN_SPACE_ERROR`,maxScreenSpaceError:4,memoryAdjustedScreenSpaceError:!1,cacheCameras:defineCacheCameras},parameterVersionSequence=defaultValue.versionNumber,parameterKeys=getValueKeys(undefinedValue);function createUndefindValue(e={}){return Object.assign(e,undefinedValue)}function createDefaultValue(e={}){return Object.assign(e,defaultValue)}function assignValue(e,t,n){let r=parameterValueEqualFn[t];if(!r)return!1;Array.isArray(n)&&(n=n.slice());let o=e[t];return r(o,n)?!1:(e[t]=n,!0)}var Parameter=class e{static createDefault(){return createDefaultValue()}static resolveValueTo(t,...n){let r=createDefaultValue(t);for(let t of n){let n=t instanceof e?t.versionNumber:++parameterVersionSequence;r.versionNumber=r.versionNumber*31+n|0;for(let e of parameterKeys)t[e]!==void 0&&assignValue(r,e,t[e])}return r}static resolveValue(...t){if(typeof t[0]==`string`){let e=t.shift(),n=t,r=defaultValue[e];for(let t of n)t[e]!==void 0&&(r=t[e]);return r}else{let n=t;return e.resolveValueTo({},...n)}}constructor(e){this.id=createUuid$1(),this.versionNumber=++parameterVersionSequence,this.unbind=new Map,this.value=createUndefindValue(),e&&this.copy(e);for(let e of parameterKeys)Object.defineProperty(this,e,{get(){return this.value[e]}});toFastProperties(this)}resolveValue(...t){return e.resolveValue(...t,this)}assignValue(e,t){let n=this.unbind.get(e);n&&(this.unbind.delete(e),n());let r=assignValue(this.value,e,t),o=this.value[e];if(o instanceof PBMUpdateable){let t=o.on(`update`,()=>{this.versionNumber=++parameterVersionSequence});this.unbind.set(e,t)}return r}set(e,t){let n=!1;if(typeof e==`string`)t!==void 0&&this.assignValue(e,t)&&(n=!0);else{let t=e;for(let e of parameterKeys)t[e]!==void 0&&this.assignValue(e,t[e])&&(n=!0)}return n&&(this.versionNumber=++parameterVersionSequence),this}reset(...e){let t=!1;for(let n of e)this.assignValue(n,void 0)&&(t=!0);return t&&(this.versionNumber=++parameterVersionSequence),this}resetAll(){return this.reset(...parameterKeys)}copy(e){let t=!0;for(let n of parameterKeys)this.assignValue(n,e[n])&&(t=!0);return t&&(this.versionNumber=++parameterVersionSequence),this}},PBMContainer=class extends three.Group{constructor(){super(...arguments),this.parameter=new Parameter,this.needsRender=!0}get materialParameters(){return this.parameter.resolveValue()}get pbmMaterialParametersVersion(){return String(this.parameter.resolveValue().versionNumber)}setMaterial(e){this.parameter.set(e),this.update(),this.needsRender=!0}getMaterial(){return this.parameter.resolveValue()}update(){let e=this.parameter.resolveValue();this.traverse(t=>{t instanceof PBMMesh||t instanceof PBMSkinnedMesh?updatePBMMesh$1(t,e):t instanceof PBMPointCloud&&updatePBMPointCloud$1(t,e)})}};function updatePBMMesh$1(e,t){let n=e.material;e.castShadow=t.castShadow,e.receiveShadow=t.receiveShadow;for(let e of n)e.customShaders=t.customShaders,e.pano0=t.pano0,e.pano1=t.pano1,e.pano0Depth=t.pano0Depth,e.pano1Depth=t.pano1Depth,e.refinedScreen=t.refinedScreen,e.modelAlpha=t.modelAlpha,e.progress=t.progress,e.transition=t.transition,e.opacity=t.opacity,e.floorStyle=t.floorStyle,e.constantColor=t.constantColor,e.shownFloorIndex=t.shownFloorIndex,e.clippers=t.clippers,e.brightness=t.brightness,e.useHQWeight=t.useHQWeight,e.useHQDepth=t.useHQDepth,e.colorSaturation=t.colorSaturation,e.colorBrightness=t.colorBrightness,e.gradientTexture=t.gradientTexture,e.shaderType===`none`?(e.transparent=!0,e.blending=three.NormalBlending,e.blendDst=three.OneMinusSrcAlphaFactor,e.blendEquation=three.AddEquation,e.blendSrcAlpha=null,e.blendDstAlpha=null,e.blendEquationAlpha=null,e.depthWrite=!1,e.depthTest=!0):(e.transparent=e.alphaMode===`BLEND`,e.blending=three.NormalBlending,e.blendDst=three.OneMinusSrcAlphaFactor,e.blendEquation=three.AddEquation,e.blendSrcAlpha=null,e.blendDstAlpha=null,e.blendEquationAlpha=null,e.depthWrite=!0,e.depthTest=!0,t.useAddBlend&&(e.depthWrite=!1,e.depthTest=!1,e.blending=three.AdditiveBlending),e.shownFloorIndex>-1&&e.shownFloorIndex!==e.floorIndex&&(e.transparent=!0),e.opacity<1&&(e.transparent=!0),e.alphaMap&&(e.transparent=!0),e.brightness<1&&(e.transparent=!0),t.useAddBlend&&(e.depthWrite=!1,e.depthTest=!1,e.blending=three.AdditiveBlending))}function updatePBMPointCloud$1(e,t){let n=[e.material];e.castShadow=t.castShadow,e.receiveShadow=t.receiveShadow;for(let e of n)e.customShaders=t.customShaders,e.pointScale=t.pointScale,e.pointMinPixel=t.pointMinPixel,e.pointMaxPixel=t.pointMaxPixel,e.pointSize=t.pointSize,e.pointShape=t.pointShape,e.pointBack=t.pointBack,e.modelAlpha=t.modelAlpha,e.opacity=t.opacity,e.floorStyle=t.floorStyle,e.constantColor=t.constantColor,e.shownFloorIndex=t.shownFloorIndex,e.clippers=t.clippers,e.brightness=t.brightness,e.useHQWeight=t.useHQWeight,e.useHQDepth=t.useHQDepth,e.colorSaturation=t.colorSaturation,e.colorBrightness=t.colorBrightness,e.outlineGain=t.outlineGain,e.distanceGain=t.distanceGain,e.gradientTexture=t.gradientTexture,e.transparent=!1,e.blending=three.NormalBlending,e.blendDst=three.OneMinusSrcAlphaFactor,e.blendEquation=three.AddEquation,e.blendSrcAlpha=null,e.blendDstAlpha=null,e.blendEquationAlpha=null,e.depthWrite=!0,e.depthTest=!0,e.shownFloorIndex>-1&&(e.transparent=e.shownFloorIndex!==e.floorIndex),e.modelAlpha<1&&(e.transparent=!0),e.opacity<1&&(e.transparent=!0),e.brightness<1&&(e.transparent=!0),t.useAddBlend&&(e.depthWrite=!1,e.depthTest=!1,e.blending=three.AdditiveBlending),e.useHQWeight&&(e.depthWrite=!1,e.blending=three.CustomBlending,e.blendSrc=three.SrcAlphaFactor,e.blendSrcAlpha=three.SrcAlphaFactor,e.blendDst=three.OneFactor,e.blendDstAlpha=three.OneFactor)}var PBMGaussianSplattingObject=class e extends three.Points{get positions(){let e=this.geometry.getAttribute(`position`);return e?e.array:new Float32Array}get rotations(){let e=this.geometry.getAttribute(`rotation`);return e?e.array:new Float32Array}get scales(){let e=this.geometry.getAttribute(`scale`);return e?e.array:new Float32Array}get colors(){let e=this.geometry.getAttribute(`color`);return e?e.array:new Uint8Array}get selection(){let e=this.geometry.getAttribute(`selection`);return e?e.array:new Uint8Array}get sh1(){let e=this.geometry.getAttribute(`sh1`);return e?e.array:void 0}get sh2(){let e=this.geometry.getAttribute(`sh2`);return e?e.array:void 0}get sh3(){let e=this.geometry.getAttribute(`sh3`);return e?e.array:void 0}constructor(e){var t;let n=new three.BufferGeometry;super(n),this.transformChanged=!1,this.selectedChanged=!1,this.transferDetached=!1,this.maxSHDegree=0,this.usedSHDegree=0,this.initAnimationEnabled=!1,this.gsViewLayerKey=``,this.gsClippers=[],this._selected=!1,this.material.visible=!1,this.numPoints=e?e.numPoints:0,this.maxSHDegree=(t=e==null?void 0:e.shDegree)==null?0:t,this.usedSHDegree=0,e&&e.positions?n.setAttribute(`position`,new three.BufferAttribute(e.positions,3)):n.setAttribute(`position`,new three.BufferAttribute(new Float32Array,3)),e&&e.rotations?n.setAttribute(`rotation`,new three.BufferAttribute(e.rotations,4)):n.setAttribute(`rotation`,new three.BufferAttribute(new Float32Array,4)),e&&e.scales?n.setAttribute(`scale`,new three.BufferAttribute(e.scales,3)):n.setAttribute(`scale`,new three.BufferAttribute(new Float32Array,3)),e&&e.colors?n.setAttribute(`color`,new three.BufferAttribute(e.colors,4,!0)):n.setAttribute(`color`,new three.BufferAttribute(new Uint8Array,4,!0));let r=new Uint8Array(this.numPoints);if(n.setAttribute(`selection`,new three.BufferAttribute(r,1)),e!=null&&e.sh1&&n.setAttribute(`sh1`,new three.BufferAttribute(e.sh1,9)),e!=null&&e.sh2&&n.setAttribute(`sh2`,new three.BufferAttribute(e.sh2,15)),e!=null&&e.sh3&&n.setAttribute(`sh3`,new three.BufferAttribute(e.sh3,21)),this._boundingBox=new three.Box3(new three.Vector3(1/0,1/0,1/0),new three.Vector3(-1/0,-1/0,-1/0)),e&&e.positions)for(let t=0;t<this.numPoints;t++)this._boundingBox.expandByPoint(new three.Vector3(e.positions[3*t],e.positions[3*t+1],e.positions[3*t+2]));this.matrixAutoUpdate=!1,this.lastMatrixWorld=null}serialize(){let t=new Uint8Array(this.numPoints*e.RowLength),n=new Float32Array(t.buffer),r=new Uint8Array(t.buffer),o=this.positions,s=this.colors,c=this.scales,l=this.rotations;for(let e=0;e<this.numPoints;e++)n[8*e+0]=o[3*e+0],n[8*e+1]=o[3*e+1],n[8*e+2]=o[3*e+2],r[32*e+24+0]=s[4*e+0],r[32*e+24+1]=s[4*e+1],r[32*e+24+2]=s[4*e+2],r[32*e+24+3]=s[4*e+3],n[8*e+3+0]=c[3*e+0],n[8*e+3+1]=c[3*e+1],n[8*e+3+2]=c[3*e+2],r[32*e+28+0]=l[4*e+0]*128+128&255,r[32*e+28+1]=l[4*e+1]*128+128&255,r[32*e+28+2]=l[4*e+2]*128+128&255,r[32*e+28+3]=l[4*e+3]*128+128&255;return t}reattach(e,t,n,r,o){let s=new Float32Array(e),c=new Float32Array(t),l=new Float32Array(n),u=new Uint8Array(r),d=new Uint8Array(o);this.geometry.setAttribute(`position`,new three.BufferAttribute(s,3)),this.geometry.setAttribute(`rotation`,new three.BufferAttribute(c,4)),this.geometry.setAttribute(`scale`,new three.BufferAttribute(l,3)),this.geometry.setAttribute(`color`,new three.BufferAttribute(u,4,!0)),this.geometry.setAttribute(`selection`,new three.BufferAttribute(d,1)),this.transferDetached=!1}get selected(){return this._selected}set selected(e){this._selected!==e&&(this._selected=e,this.selectedChanged=!0)}get boundingBox(){let e=new three.Vector3;this._boundingBox.getCenter(e),e.add(this.position);let t=new three.Vector3;this._boundingBox.getSize(t),t.multiply(this.scale);let n=new three.Vector3;return n.copy(t).multiplyScalar(.5),new three.Box3(e.clone().sub(n),e.clone().add(n))}dispose(){}raycast(e,t){var n,r;let o=this.matrixWorld,s=(r=(n=e.params.Points)==null?void 0:n.threshold)==null?0:r;if(this._boundingBox.isEmpty())return;let c=new three.Vector3;this._boundingBox.getCenter(c);let l=new three.Vector3;this._boundingBox.getSize(l);let u=Math.max(l.x,l.y,l.z)*.5,d=new three.Sphere(c,u);if(d.applyMatrix4(o),d.radius+=s,e.ray.intersectsSphere(d)===!1)return;let f=new three.Matrix4;f.getInverse(o);let p=new three.Ray;p.copy(e.ray).applyMatrix4(f);let m=s/((this.scale.x+this.scale.y+this.scale.z)/3),h=m*m,g=this.geometry.getAttribute(`position`);if(!g)return;let _=g.array,v=this.numPoints;for(let n=0;n<v;n++){let r=new three.Vector3(_[n*3],_[n*3+1],_[n*3+2]),s=p.distanceSqToPoint(r);if(s<h){let c=new three.Vector3;p.closestPointToPoint(r,c),c.applyMatrix4(o);let l=e.ray.origin.distanceTo(c);if(l<e.near||l>e.far)continue;t.push({distance:l,distanceToRay:Math.sqrt(s),point:c,index:n,face:null,object:this})}}}};PBMGaussianSplattingObject.RowLength=32;var ROTATE_X_MATRIX$2=new three.Matrix4().fromArray([1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1]),ROTATE_X_MATRIX_INVERSE$2=new three.Matrix4().getInverse(ROTATE_X_MATRIX$2);function noop(...e){}var JSONP_REGEXPS=[/\.([0-9a-z]+)\.jsonp([\?\#].*)?$/i,/jsonp_([0-9a-z]+)([\?\#].*)?$/i],locationHref=typeof location<`u`?location.href:``,locationIsHttps=/^https\:/.test(locationHref),NetworkProxyError=class extends Error{constructor(e,t,n){super(`[NETWORK]: request proxy error(type: ${t}, reason: ${n}): ${e}`)}},NetworkResponseError=class extends Error{constructor(e,t,n){super(`[NETWORK]: response error(type: ${t}, status: ${n}): ${e}`),this.httpStatus=n}},NetworkTimeoutError=class extends Error{constructor(e,t,n){super(`[NETWORK]: request timeout(type: ${t}, timeout: ${n}ms): ${e}`)}};function parseHeaders(e){if(!e)return{};let t={},n=e.trim().split(`
|
|
319
|
-
`);for(let e=0;e<n.length;e++){let r=n[e],o=r.indexOf(`:`),s=r.slice(0,o).trim().toLowerCase(),c=r.slice(o+1).trim();c&&(t[s]?t[s]+=`, `+c:t[s]=c)}return t}function matchJsonpFunctionName(e){for(let t of JSONP_REGEXPS){let n=e.match(t);if(n)return`jsonp_`+n[1]}return null}function isJsonp(e){return matchJsonpFunctionName(e)!==null}var NetworkSubscribe=class extends Subscribe{};function ajax(e,t={},n=noop,r=noop,o=noop){let s=now(),c=e;return Promise.resolve().then(()=>t.requestProxy?t.requestProxy(e):e).then(e=>locationIsHttps&&/^http\:/.test(e)?(console.warn(`The page at '${locationHref}' was loaded over HTTPS, but requested an insecure element '${e}'. This request was automatically upgraded to HTTPS`),e.replace(/^http\:/,`https:`)):e).catch(n=>{var r;matchJsonpFunctionName(e);let o=new NetworkProxyError(c,`XMLHttpRequest`,n&&n.message?String(n.message):String(n));return(r=t.networkSubscribe)==null||r.emit(`network`,e,`XMLHttpRequest`,`forbidden`,o.message),Promise.reject(o)}).then(e=>new Promise((l,u)=>{let d=matchJsonpFunctionName(e);if(d){let o=window,f=null,p=!1,m=document.createElement(`script`);o[d]=h=>{var g,_;let v=now(),y=v-s;if(delete o[d],m.parentNode&&m.parentNode.removeChild(m),f!==null&&(window.clearTimeout(f),f=null),p===!0)return;if(h.indexOf(`data:`)!==0){let n=new NetworkResponseError(e,`XMLHttpRequest`,500);r(n),u(n),(g=t.networkSubscribe)==null||g.emit(`network`,e,`XMLHttpRequest`,`error`,n.message);return}let b=h.split(`,`),S=(b[0].match(/:(.*?);/)||[])[1],C=b[1];if(t.responseType===`arraybuffer`||t.responseType===`blob`){let e=atob(b[1]),n=e.length,r=new Uint8Array(n);for(let t=0;t<n;t++)r[t]=e.charCodeAt(t);C=t.responseType===`arraybuffer`?r.buffer:new Blob([r],{type:S})}let w={body:C,meta:{origin:c,source:e,requestTime:s,responseTime:v,costs:y,headers:{}}};n(w),l(w),(_=t.networkSubscribe)==null||_.emit(`network`,e,`XMLHttpRequest`,`ok`,JSON.stringify(w.meta)),p=!0},m.src=e,document.body.appendChild(m),typeof t.timeout==`number`&&(f=window.setTimeout(()=>{var n;if(f=null,p!==!0){p=!0;let o=new NetworkTimeoutError(e,`XMLHttpRequest`,t.timeout||NaN);r(o),u(o),(n=t.networkSubscribe)==null||n.emit(`network`,e,`XMLHttpRequest`,`timeout`,o.message)}},t.timeout))}else{let d=!1,f=new XMLHttpRequest,p=()=>{f&&(f.removeEventListener(`timeout`,m,!1),f.removeEventListener(`progress`,h,!1),f.removeEventListener(`load`,g,!1),f.removeEventListener(`error`,_,!1)),f=null,p=noop},m=function(){var n;if(d===!0)return;d=!0,p();let o=new NetworkTimeoutError(e,`XMLHttpRequest`,t.timeout||NaN);r(o),u(o),(n=t.networkSubscribe)==null||n.emit(`network`,e,`XMLHttpRequest`,`timeout`,o.message)},h=function(e){d!==!0&&e.lengthComputable&&(e.total<=0||o(e.loaded/e.total,e.loaded,e.total))},g=function(r){var o;if(d===!0)return;let u=this.status;if(u===0||u>=200&&u<400){d=!0,p();let u=now(),f=u-s,m=parseHeaders(this.getAllResponseHeaders()),h=r.total,g={body:this.response,meta:{origin:c,source:e,requestTime:s,responseTime:u,costs:f,headers:m,size:h}};n(g),l(g),(o=t.networkSubscribe)==null||o.emit(`network`,e,`XMLHttpRequest`,`ok`,JSON.stringify(g.meta))}else _.call(this)},_=function(){var n;if(d===!0)return;d=!0,p();let o=new NetworkResponseError(e,`XMLHttpRequest`,this.status);r(o),u(o),(n=t.networkSubscribe)==null||n.emit(`network`,e,`XMLHttpRequest`,`error`,o.message)};f.addEventListener(`timeout`,m,!1),f.addEventListener(`progress`,h,!1),f.addEventListener(`load`,g,!1),f.addEventListener(`error`,_,!1),t.responseType&&(f.responseType=t.responseType),typeof t.timeout==`number`&&(f.timeout=t.timeout),f.open(`GET`,e,!0),f.send(null)}}))}var preloadCache={};function preload(e,t={}){let n=now(),r=e;return Promise.resolve().then(()=>t.requestProxy?t.requestProxy(e):e).then(e=>locationIsHttps&&/^http\:/.test(e)?(console.warn(`The page at '${locationHref}' was loaded over HTTPS, but requested an insecure element '${e}'. This request was automatically upgraded to HTTPS`),e.replace(/^http\:/,`https:`)):e).catch(n=>{var o;let s=new NetworkProxyError(r,`Link`,n&&n.message?String(n.message):String(n));return(o=t.networkSubscribe)==null||o.emit(`network`,e,`Link`,`forbidden`,s.message),Promise.reject(s)}).then(e=>e in preloadCache?preloadCache[e]:preloadCache[e]=new Promise((o,s)=>{let c=document.head||document.getElementsByTagName(`head`)[0],l=document.createElement(`link`),u=!1,d=null;l.onload=s=>{var c;if(d!==null&&(clearTimeout(d),d=null),u===!0)return;u=!0,o(),l.onerror=noop,l.onload=noop;let f=now(),p={origin:r,source:e,requestTime:n,responseTime:f,costs:f-n,headers:{}};(c=t.networkSubscribe)==null||c.emit(`network`,e,`Link`,`preload`,JSON.stringify(p))},l.onerror=n=>{var r;if(d!==null&&(clearTimeout(d),d=null),u===!0)return;u=!0,delete preloadCache[e],c&&l.parentNode===c&&c.removeChild(l);let o=new NetworkResponseError(e,`Link`,0);s(o),l.onerror=noop,l.onload=noop,(r=t.networkSubscribe)==null||r.emit(`network`,e,`Link`,`error`,o.message)},typeof t.timeout==`number`&&(d=window.setTimeout(()=>{var s;if(d=null,u===!0)return;u=!0,o(),l.onerror=noop,l.onload=noop;let c=now(),f={origin:r,source:e,requestTime:n,responseTime:c,costs:c-n,headers:{}};(s=t.networkSubscribe)==null||s.emit(`network`,e,`Link`,`timeout`,JSON.stringify(f))},t.timeout)),l.rel=l.relList&&l.relList.supports(`prefetch`)?`prefetch`:`preload`,l.as=`fetch`,l.crossOrigin=``,l.fetchPriority=`high`,l.href=e,c&&c.appendChild(l)}))}function loadImage(e,t={},n=noop,r=noop,o=noop,s){let c=now(),l=e;return Promise.resolve().then(()=>t.requestProxy?t.requestProxy(e):e).then(e=>locationIsHttps&&/^http\:/.test(e)?(console.warn(`The page at '${locationHref}' was loaded over HTTPS, but requested an insecure element '${e}'. This request was automatically upgraded to HTTPS`),e.replace(/^http\:/,`https:`)):e).catch(n=>{var r;let o=new NetworkProxyError(l,`Image`,n&&n.message?String(n.message):String(n));return(r=t.networkSubscribe)==null||r.emit(`network`,e,`Image`,`forbidden`,o.message),Promise.reject(o)}).then(e=>isJsonp(e)?ajax(e,{responseType:`blob`,networkSubscribe:t.networkSubscribe}).then(e=>URL.createObjectURL(e.body)):e).then(e=>new Promise((u,d)=>{let f=s==null?new Image:s,p=!1,m=null;typeof t.timeout==`number`&&(m=window.setTimeout(()=>{var n;if(f.onload=noop,f.onerror=noop,m=null,p===!0)return;p=!0;let o=new NetworkTimeoutError(e,`Image`,t.timeout);r(o),d(o),(n=t.networkSubscribe)==null||n.emit(`network`,e,`Image`,`timeout`,o.message)},t.timeout)),f.onload=()=>{var r;if(f.onload=noop,f.onerror=noop,m!==null&&(clearTimeout(m),m=null),p===!0)return;let s=now(),d={headers:{},origin:l,source:e,requestTime:c,responseTime:s,costs:s-c};p=!0;let h={body:f,meta:d};o(1),n(h),u(h),(r=t.networkSubscribe)==null||r.emit(`network`,e,`Image`,`ok`,JSON.stringify(h.meta))},f.onerror=()=>{var n;if(f.onload=noop,f.onerror=noop,m!==null&&(clearTimeout(m),m=null),p===!0)return;p=!0;let o=new NetworkResponseError(e,`Image`,0);r(o),d(o),(n=t.networkSubscribe)==null||n.emit(`network`,e,`Image`,`ok`,o.message)},o(0),f.src=e}))}var Fetcher=class{constructor(e={}){this.options=e}ajax(e,t={},n=noop,r=noop,o=noop){var s;let c=this.options;return ajax(e,{responseType:t.responseType,timeout:(s=t.timeout)==null?c.timeout:s,get requestProxy(){var e;return(e=t.requestProxy)==null?c.requestProxy:e},get networkSubscribe(){var e;return(e=t.networkSubscribe)==null?c.networkSubscribe:e}},n,r,o)}loadImage(e,t={},n=noop,r=noop,o=noop,s){var c;let l=this.options;return loadImage(e,{timeout:(c=t.timeout)==null?l.timeout:c,get requestProxy(){var e;return(e=t.requestProxy)==null?l.requestProxy:e},get networkSubscribe(){var e;return(e=t.networkSubscribe)==null?l.networkSubscribe:e}},n,r,o,s)}preload(e,t={}){var n;let r=this.options;return preload(e,{timeout:(n=t.timeout)==null?r.timeout:n,get requestProxy(){var e;return(e=t.requestProxy)==null?r.requestProxy:e},get networkSubscribe(){var e;return(e=t.networkSubscribe)==null?r.networkSubscribe:e}})}},internalFetcher=new Fetcher;function pick(e,t){let n={};for(let r of t)r in e&&(n[r]=e[r]);return n}function omit(e,t){let n={},r=new Set(t);for(let t of Object.keys(e))r.has(t)||(n[t]=e[t]);return n}function omitUndefinedFields(e){let t={};for(let n in e){let r=e[n];r!==void 0&&(t[n]=r)}return t}var hrefAElement=typeof document<`u`?document.createElement(`a`):{href:``};function isAbsoluteURL(e){return e.indexOf(`/`)===0||/^[0-9a-z]+\:/i.test(e)}function getFullURL(e){if(typeof URL<`u`&&typeof location<`u`)return new URL(e,location.href).href;{hrefAElement.href=e;let t=hrefAElement.href;return hrefAElement.href=``,t}}function pathJoin(...e){let t=[];e=e.map(e=>(e==null?``:e).trim()).filter(e=>e.length>0&&!/^\/+$/.test(e));for(let n=0;n<e.length;n++){let r=n===0,o=n===e.length-1,s=e[n];r||(s=s.replace(/^\.\//,``).replace(/^\/+/,``)),o||(s=s.replace(/\/+$/,``)),t.push(s)}return t.join(`/`)}function appendSearch(e,t=``){if((t[0]===`?`||t[0]===`&`)&&(t=t.slice(1)),!t)return e;let n=e.indexOf(`#`),r=``;return n>=0&&(r=e.slice(n),e=e.slice(0,n)),(e[e.length-1]===`?`||e[e.length-1]===`&`)&&(e=e.slice(0,-1)),e.indexOf(`?`)>=0?`${e}&${t}${r}`:`${e}?${t}${r}`}function normalizeURL(e){var t;let n=/^(http\:|https\:|file\:)?\/\/[^/]/.exec(e);if(!n)return e;let r=n[1]||``,o=e.slice(r.length+2),s=o.indexOf(`#`);s>=0&&(e.slice(s),o=e.slice(0,s));let c=o.indexOf(`?`);c>=0&&(e.slice(c),o=e.slice(0,c));let l=o.split(`/`),u=l.shift(),d=(t=l.pop())==null?``:t,f=[];for(let e of l)if(!(e===``||e===`.`)){if(e===`..`){f.pop();continue}f.push(e)}return r+`//`+u+`/`+f.join(`/`)+`/`+d}function getExtname(e){let t=/([0-9a-z\.\_\-]+)([\?\#].*)?$/i.exec(e);if(t){let e=String(t[1]).trim().split(`.`).slice(1).reverse()[0];if(e)return`.`+e}return``}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(e){return new Promise(t=>{if(typeof Image>`u`){t(!1);return}let n=new Image,r=setTimeout(()=>{n.onload=n.onerror=()=>{},clearTimeout(r),t(!1)},100);n.onload=n.onerror=()=>{n.onload=n.onerror=()=>{},clearTimeout(r),t(n.height===2)},n.src=e})}var imageSupportCache=null;function imageSupport(){return imageSupportCache||(imageSupportCache=Promise.all([checkImage(webp),checkImage(avif),checkImage(heif)]).then(e=>({webp:e[0],avif:e[1],heif:e[2]})))}var _a$4,supportAvif=!1,supportWebp=!1,supportHeif=!1;imageSupport().then(e=>{supportAvif=e.avif,supportWebp=e.webp,supportHeif=e.heif});var IMAGE_FORMATS=[`jpg`,`jpeg`,`png`,`heif`,`heic`,`webp`,`avif`];function isImageExt(e){return IMAGE_FORMATS.indexOf(e)>=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(e){let t=e.match(URL_DOMAIN_REGEX);return t===null?null:t[1]}function replaceDomain(e,t,n){var r,o;let s=(o=(r=t[n])==null?t[t.length-1]:r)==null?e:o;return e.replace(URL_DOMAIN_REGEX,(e,t)=>e.slice(0,e.length-t.length)+s)}function route(e,t,n){let[r,...o]=t.split(`.`);if(r===`texture`)return replaceDomain(e,n.texture,0);if(r===`pano`){let[t,r]=o;switch(r){case`front`:case`left`:case`up`:return replaceDomain(e,n.pano,0);case`down`:case`right`:case`back`:return replaceDomain(e,n.pano,1);default:break}}else if(r===`pano_tile`){let[t,r,s,c,l]=o,u=Math.pow(2,Number(s))*Number(c)+Number(l);if(!isNaN(u))return replaceDomain(e,n.tile,u%2)}else if(r===`model`){let[t]=o,r=Number(t);if(!isNaN(r))return replaceDomain(e,n.model,r%2)}return replaceDomain(e,n.default,0)}var tencentCloudImageProcesser=(e,t)=>{let n=e.split(`?`)[0],r=n.split(`.`).pop();if(r===`jpeg`&&(r=`jpg`),r===`heif`&&(r=`heic`),r&&!isImageExt(r))return e;let o=[],{format:s,cut:c,quality:l,size:u,sharpen:d,forceUseExifOrientation:f}=t;if(s===`jpeg`&&(s=`jpg`),s===`heif`&&(s=`heic`),(!supportAvif&&(s==null?r:s)===`avif`||!supportWebp&&(s==null?r:s)===`webp`||!supportHeif&&(s==null?r:s)===`heic`)&&(s=`jpg`),s!==void 0&&s!==r&&o.push(`format/${s}`),c!==void 0&&o.push(`cut/${c[2]}x${c[3]}x${c[0]}x${c[1]}`),l!==void 0){let e=s==null?r:s;e&&[`jpg`,`webp`,`heic`,`avif`].indexOf(e)>=0&&o.push(`quality/${l}`)}if(u!==void 0){let t=e.match(/\/cube_(\d+)\//);(t?Number(t[1]):NaN)!==Number(u)&&o.push(`thumbnail/${u}x`)}d!==void 0&&o.push(`sharpen/${d}`),f===!0&&o.push(`auto-orient`);let p=``;return o.length&&(p=`?imageMogr2/`+o.join(`/`)),n+p},aliyunOOSImageProcesser=(e,t)=>{let n=e.split(`?`)[0],r=n.split(`.`).pop();if(r===`jpeg`&&(r=`jpg`),r===`heif`&&(r=`heic`),r&&!isImageExt(r))return e;let o=[],{format:s,cut:c,quality:l,size:u,sharpen:d}=t;if(s===`jpeg`&&(s=`jpg`),s===`heif`&&(s=`heic`),(!supportAvif&&(s==null?r:s)===`avif`||!supportWebp&&(s==null?r:s)===`webp`||!supportHeif&&(s==null?r:s)===`heic`)&&(s=`jpg`),s!==void 0&&s!==r&&o.push(`format,${s}`),c!==void 0){let[e,t,n,r]=c;o.push(`crop,x_${e},y_${t},w_${n},h_${r},g_nw`)}if(l!==void 0&&l!==100){let e=s==null?r:s;e&&[`jpg`,`webp`,`heic`,`avif`].indexOf(e)>=0&&o.push(`quality,Q_${l}`)}u&&u!==2048&&o.push(`resize,w_${u}`),d!==void 0&&o.push(`sharpen,${d}`);let f=``;return o.length&&(f=`?x-oss-process=image/`+o.join(`/`)),n+f},MAX_SAFE_INTEGER=9007199254740991;function formatNumber(e){let t=Math.round(e);return Math.abs(t-e)<.001?t:Math.floor(e)}function formatOptions(e){return e=Object.assign({},e),e.size!==void 0&&(e.size=formatNumber(clamp$1(e.size,0,MAX_SAFE_INTEGER))),e.quality!==void 0&&(e.quality=formatNumber(clamp$1(e.quality,0,100))),e.cut!==void 0&&(e.cut=[formatNumber(clamp$1(e.cut[0],0,MAX_SAFE_INTEGER)),formatNumber(clamp$1(e.cut[1],0,MAX_SAFE_INTEGER)),formatNumber(clamp$1(e.cut[2],0,MAX_SAFE_INTEGER)),formatNumber(clamp$1(e.cut[3],0,MAX_SAFE_INTEGER))]),e.sharpen!==void 0&&(e.sharpen=formatNumber(clamp$1(e.sharpen,0,MAX_SAFE_INTEGER))),e}function imageURL(e,t){let n=Object.assign(Object.assign({},DEFAULT_IMAGE_URL_MAPPINGS),t.mappings),r=getDomain(e);if(r===null)return e;t=formatOptions(t);let o=n[r];return o?(e=route(e,t.key,o),/\.basis(\?|$)/.test(e)&&(e=e.replace(/\.basis(\?|$)/,`.jpg$1`)),o.type===`tencentCloud`?tencentCloudImageProcesser(e,t):o.type===`aliyun`?aliyunOOSImageProcesser(e,t):e):e}function applyImageURLOptions(e,t=imageURL,n){let r=t(e,n);if(r===e&&n.cut)throw Error(`ImageURL: cut option not applied.`);return r}var IMAGE_SIZE_REG=/\/cube_(\d+)\//;function getImageSizeFromURL(e){let t=e.match(IMAGE_SIZE_REG);return t?Number(t[1]):null}function replaceImageSize(e,t){return e.replace(IMAGE_SIZE_REG,`/cube_${t}/`)}var log2=(_a$4=Math.log2)==null?(e=>Math.log(e)*Math.LOG2E):_a$4;function getImageSizeLevel(e){return Math.floor(Math.max(log2(e/512),0))}var windowSTOContext=(()=>{let e=now();return{requestAnimationFrame(t){let n=now(),r=clamp$1(16+(n-e),16,33),o=setTimeout(function(){t(dateNowToDomHighResTimeStamp(n+r))},r);return e=n+r,o},cancelAnimationFrame:e=>clearTimeout(e)}})(),windowRAFContext=typeof requestAnimationFrame==`function`&&typeof cancelAnimationFrame==`function`?{requestAnimationFrame:e=>requestAnimationFrame(e),cancelAnimationFrame:e=>cancelAnimationFrame(e)}:windowSTOContext,DEFAULT_ORDER=5,deviceFrameTime=16,AnimationFrameLoop=class e{static get shared(){return this.sharedInstance||(this.sharedInstance=new e),this.sharedInstance}static getFrameTime(){return deviceFrameTime}constructor(){this.loopType=`raf`,this.frames=[],this.isAnimating=!1,this.context=null;let e=now();this.loop=(...t)=>{if(this.isAnimating===!1)return;let n=now(),r=Math.max(n-e,0);e=n,deviceFrameTime=r;let o=this.frames.slice();for(let e=0;e<o.length;e++){let s=o[e];if(s.delay>0){--s.delay;continue}try{s.callback(n,r,...t)}catch(e){console.error(e)}s.calls++}for(let e=this.frames.length-1;e>=0;e--){let t=this.frames[e];t.once&&t.calls>0&&this.frames.splice(e,1)}this.requestId=this.requestAnimationFrame(this.loop)},this.start()}start(){this.isAnimating!==!0&&(this.isAnimating=!0,this.requestId=this.requestAnimationFrame(this.loop))}stop(){this.isAnimating=!1,this.cancelAnimationFrame(this.requestId)}setContext(e){e!==this.context&&(this.stop(),this.context=e,this.start())}getContext(){return this.context}setLoopType(e){e!==this.loopType&&(this.stop(),this.loopType=e,this.start())}getLoopType(){return this.loopType}requestAnimationFrame(e){let t;if(this.context?t=this.context:this.loopType===`raf`?t=windowRAFContext:this.loopType===`sto`&&(t=windowSTOContext),t)return t.requestAnimationFrame(e)}cancelAnimationFrame(e){let t;this.context?t=this.context:this.loopType===`raf`?t=windowRAFContext:this.loopType===`sto`&&(t=windowSTOContext),t&&t.cancelAnimationFrame(e)}remove(e){let t=this.frames.indexOf(e);t>=0&&this.frames.splice(t,1)}add(e,t=!1,n=0,r=DEFAULT_ORDER){let o={callback:e,once:t,delay:n,order:r,calls:0},s=this.frames.length;for(;--s>=0;)if(this.frames[s].order<=r){this.frames.splice(s+1,0,o);break}return s<0&&this.frames.unshift(o),()=>this.remove(o)}clear(){this.frames.length=0}},browserSupportsImageBitmapApi=typeof createImageBitmap<`u`&&typeof ImageBitmap<`u`,_useNativeImageBitmap=!1;function useNativeImageBitmap(e){_useNativeImageBitmap=e}function canUseNativeImageBitmap(){return _useNativeImageBitmap===!1?!1:browserSupportsImageBitmapApi}function createImageBitmapLikeImage(e={}){let t=e.onClose;return Object.assign(document.createElementNS(`http://www.w3.org/1999/xhtml`,`img`),{crossOrigin:``,close(){t&&t.call(this),this.onerror=this.onload=this.close=noop,this.removeAttribute(`src`),t=void 0}})}function createImageBitmapLike(e){if(canUseNativeImageBitmap())return createImageBitmap(e);{let t=URL.createObjectURL(e),n=function(){this.src===t&&URL.revokeObjectURL(t)};return new Promise((e,r)=>{let o=createImageBitmapLikeImage({onClose:n});o.onload=()=>{o.src===t&&URL.revokeObjectURL(t),o.onload=o.onerror=noop,AnimationFrameLoop.shared.add(()=>{e(o)},!0)},o.onerror=()=>{let e=o.src;o.onload=o.onerror=noop,o.close(),r(Error(`image load error: ${e}`))},o.decoding=`async`,o.src=t})}}var canvasPool=[];function createCanvas(e,t){let n=canvasPool.pop();if(n)return n.width=e,n.height=t,n;let r=Object.assign(document.createElementNS(`http://www.w3.org/1999/xhtml`,`canvas`),{close:()=>{r.close=noop,canvasPool.push(r)}});return r}function imageBitmapToTexture(e,t){if(t&&(e.width>t.width||e.height>t.height)){let n=createCanvas(Math.min(e.width,t.width),Math.min(e.height,t.height)),r=n.getContext(`2d`);r.clearRect(0,0,n.width,n.height),r.drawImage(e,0,0,n.width,n.height),e.close();let o=new three.Texture(n);o.needsUpdate=!0,o.flipY=!0;let s=o.dispose;return o.dispose=function(){n.close(),s.call(o),o.dispose=s},o}else{let t=new three.Texture(e);t.needsUpdate=!0,typeof ImageBitmap<`u`&&e instanceof ImageBitmap?t.flipY=!1:t.flipY=!0,t.flipY===!1&&(t.repeat.y*=-1,t.offset.y+=1,t.updateMatrix());let n=t.dispose;return t.dispose=function(){this.image&&this.image.close(),n.call(t),t.dispose=n},t}}function imageBitmapsToCubeTexture(e){let t=new three.CubeTexture(e);t.needsUpdate=!0,t.flipY=!1;let n=t.dispose;return t.dispose=function(){if(Array.isArray(this.images))for(let e of this.images)e.close();n.call(t),t.dispose=n},t}var FACE_ORDER$2=[`right`,`left`,`up`,`down`,`front`,`back`],TextureLoader=class{loadTexture(e,t,n=noop,r=noop,o=noop,s){var c,l,u,d,f,p,m;let h={};if(t.flipY!==void 0&&(h.flipY=t.flipY),t.format!==void 0)h.format=t.format;else{let t=getExtname(e);(t===`.jpg`||t===`.jpeg`)&&(h.format=three.RGBFormat)}t.encoding!==void 0&&(h.encoding=t.encoding),h.generateMipmaps=(c=t.generateMipmaps)==null?!1:c,h.minFilter=(l=t.minFilter)==null?three.LinearFilter:l,h.magFilter=(u=t.magFilter)==null?three.LinearFilter:u;let g=(f=(d=t.imageURL)==null?void 0:d.options)==null?{key:`unknown`}:f;if(e=applyImageURLOptions(e,(p=t.imageURL)==null?void 0:p.transform,g),(m=t.viaAjax)==null?canUseNativeImageBitmap:m){let s=null;return t.fetcher.ajax(e,{timeout:t.timeout,responseType:`blob`},void 0,void 0,o).then(e=>createImageBitmapLike(e.body)).then(e=>imageBitmapToTexture(e,t.maxSize)).then(e=>(Object.assign(e,h),e)).then(e=>{let t={meta:null,body:e};return n(t),t}).catch(e=>(r(e),Promise.reject(e)))}else{let s=null,c;return Promise.resolve().then(()=>createImageBitmapLikeImage()).then(n=>(c=n,t.fetcher.loadImage(e,{timeout:t.timeout},void 0,void 0,o,n))).then(e=>(s=e.meta,imageBitmapToTexture(e.body,t.maxSize))).then(e=>(Object.assign(e,h),e)).then(e=>{let t={meta:s,body:e};return n(t),t}).catch(e=>(c&&c.close(),r(e),Promise.reject(e)))}}loadCubeTexture(e,t,n=noop,r=noop,o=noop,s){var c,l,u,d,f,p,m;let h={};if(t.format!==void 0)h.format=t.format;else{let t=!0;for(let n of FACE_ORDER$2){let r=getExtname(e[n]);if(r!==`.jpg`&&r!==`.jpeg`){t=!1;break}}t&&(h.format=three.RGBFormat)}h.generateMipmaps=(c=t.generateMipmaps)==null?!1:c,h.minFilter=(l=t.minFilter)==null?three.LinearFilter:l,h.magFilter=(u=t.magFilter)==null?three.LinearFilter:u;let g=[e[FACE_ORDER$2[0]],e[FACE_ORDER$2[1]],e[FACE_ORDER$2[2]],e[FACE_ORDER$2[3]],e[FACE_ORDER$2[4]],e[FACE_ORDER$2[5]]],_=[],v=[0,0,0,0,0,0],y=[];for(let e=0;e<6;e++){let n=(f=(d=t.imageURL)==null?void 0:d.options)==null?{key:`unknown`}:f,r=applyImageURLOptions(g[e],(p=t.imageURL)==null?void 0:p.transform,Object.assign(Object.assign({},n),{key:n.key+`.`+FACE_ORDER$2[e]})),s=t=>{v[e]=t,o(v.reduce((e,t)=>e+t,0)/6)};if((m=t.viaAjax)!=null&&m){let n=t.fetcher.ajax(r,{timeout:t.timeout,responseType:`blob`},void 0,void 0,s).then(t=>(y[e]=t.meta,createImageBitmapLike(t.body)));_.push(n)}else{let n,o=Promise.resolve().then(()=>createImageBitmapLikeImage()).then(e=>(n=e,t.fetcher.loadImage(r,{timeout:t.timeout},void 0,void 0,s,e))).then(t=>(y[e]=t.meta,t.body)).catch(e=>(n&&n.close(),Promise.reject(e)));_.push(o)}}return Promise.all(_).then(e=>imageBitmapsToCubeTexture(e)).then(e=>(Object.assign(e,Object.assign({encoding:three.sRGBEncoding},h)),e)).then(e=>{let t={body:e,meta:y};return n(t),t}).catch(e=>{for(let e of _)e.then(e=>e.close()).catch(noop);return r(e),Promise.reject(e)})}},require_aspromise=__commonJSMin(((e,t)=>{t.exports=n;function n(e,t){for(var n=Array(arguments.length-1),r=0,o=2,s=!0;o<arguments.length;)n[r++]=arguments[o++];return new Promise(function(o,c){n[r]=function(e){if(s)if(s=!1,e)c(e);else{for(var t=Array(arguments.length-1),n=0;n<t.length;)t[n++]=arguments[n];o.apply(null,t)}};try{e.apply(t||null,n)}catch(e){s&&(s=!1,c(e))}})}})),require_base64=__commonJSMin((e=>{var t=e;t.length=function(e){var t=e.length;if(!t)return 0;for(var n=0;--t%4>1&&e.charAt(t)===`=`;)++n;return Math.ceil(e.length*3)/4-n};for(var n=Array(64),r=Array(123),o=0;o<64;)r[n[o]=o<26?o+65:o<52?o+71:o<62?o-4:o-59|43]=o++;t.encode=function(e,t,r){for(var o=null,s=[],c=0,l=0,u;t<r;){var d=e[t++];switch(l){case 0:s[c++]=n[d>>2],u=(d&3)<<4,l=1;break;case 1:s[c++]=n[u|d>>4],u=(d&15)<<2,l=2;break;case 2:s[c++]=n[u|d>>6],s[c++]=n[d&63],l=0;break}c>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,s)),c=0)}return l&&(s[c++]=n[u],s[c++]=61,l===1&&(s[c++]=61)),o?(c&&o.push(String.fromCharCode.apply(String,s.slice(0,c))),o.join(``)):String.fromCharCode.apply(String,s.slice(0,c))};var s=`invalid encoding`;t.decode=function(e,t,n){for(var o=n,c=0,l,u=0;u<e.length;){var d=e.charCodeAt(u++);if(d===61&&c>1)break;if((d=r[d])===void 0)throw Error(s);switch(c){case 0:l=d,c=1;break;case 1:t[n++]=l<<2|(d&48)>>4,l=d,c=2;break;case 2:t[n++]=(l&15)<<4|(d&60)>>2,l=d,c=3;break;case 3:t[n++]=(l&3)<<6|d,c=0;break}}if(c===1)throw Error(s);return n-o},t.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}})),require_eventemitter=__commonJSMin(((e,t)=>{t.exports=n;function n(){this._listeners={}}n.prototype.on=function(e,t,n){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:n||this}),this},n.prototype.off=function(e,t){if(e===void 0)this._listeners={};else if(t===void 0)this._listeners[e]=[];else for(var n=this._listeners[e],r=0;r<n.length;)n[r].fn===t?n.splice(r,1):++r;return this},n.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var n=[],r=1;r<arguments.length;)n.push(arguments[r++]);for(r=0;r<t.length;)t[r].fn.apply(t[r++].ctx,n)}return this}})),require_float=__commonJSMin(((e,t)=>{t.exports=n(n);function n(e){return typeof Float32Array<`u`?(function(){var t=new Float32Array([-0]),n=new Uint8Array(t.buffer),r=n[3]===128;function o(e,r,o){t[0]=e,r[o]=n[0],r[o+1]=n[1],r[o+2]=n[2],r[o+3]=n[3]}function s(e,r,o){t[0]=e,r[o]=n[3],r[o+1]=n[2],r[o+2]=n[1],r[o+3]=n[0]}e.writeFloatLE=r?o:s,e.writeFloatBE=r?s:o;function c(e,r){return n[0]=e[r],n[1]=e[r+1],n[2]=e[r+2],n[3]=e[r+3],t[0]}function l(e,r){return n[3]=e[r],n[2]=e[r+1],n[1]=e[r+2],n[0]=e[r+3],t[0]}e.readFloatLE=r?c:l,e.readFloatBE=r?l:c})():(function(){function t(e,t,n,r){var o=+(t<0);if(o&&(t=-t),t===0)e(1/t>0?0:2147483648,n,r);else if(isNaN(t))e(2143289344,n,r);else if(t>34028234663852886e22)e((o<<31|2139095040)>>>0,n,r);else if(t<11754943508222875e-54)e((o<<31|Math.round(t/1401298464324817e-60))>>>0,n,r);else{var s=Math.floor(Math.log(t)/Math.LN2),c=Math.round(t*Math.pow(2,-s)*8388608)&8388607;e((o<<31|s+127<<23|c)>>>0,n,r)}}e.writeFloatLE=t.bind(null,r),e.writeFloatBE=t.bind(null,o);function n(e,t,n){var r=e(t,n),o=(r>>31)*2+1,s=r>>>23&255,c=r&8388607;return s===255?c?NaN:o*(1/0):s===0?o*1401298464324817e-60*c:o*Math.pow(2,s-150)*(c+8388608)}e.readFloatLE=n.bind(null,s),e.readFloatBE=n.bind(null,c)})(),typeof Float64Array<`u`?(function(){var t=new Float64Array([-0]),n=new Uint8Array(t.buffer),r=n[7]===128;function o(e,r,o){t[0]=e,r[o]=n[0],r[o+1]=n[1],r[o+2]=n[2],r[o+3]=n[3],r[o+4]=n[4],r[o+5]=n[5],r[o+6]=n[6],r[o+7]=n[7]}function s(e,r,o){t[0]=e,r[o]=n[7],r[o+1]=n[6],r[o+2]=n[5],r[o+3]=n[4],r[o+4]=n[3],r[o+5]=n[2],r[o+6]=n[1],r[o+7]=n[0]}e.writeDoubleLE=r?o:s,e.writeDoubleBE=r?s:o;function c(e,r){return n[0]=e[r],n[1]=e[r+1],n[2]=e[r+2],n[3]=e[r+3],n[4]=e[r+4],n[5]=e[r+5],n[6]=e[r+6],n[7]=e[r+7],t[0]}function l(e,r){return n[7]=e[r],n[6]=e[r+1],n[5]=e[r+2],n[4]=e[r+3],n[3]=e[r+4],n[2]=e[r+5],n[1]=e[r+6],n[0]=e[r+7],t[0]}e.readDoubleLE=r?c:l,e.readDoubleBE=r?l:c})():(function(){function t(e,t,n,r,o,s){var c=+(r<0);if(c&&(r=-r),r===0)e(0,o,s+t),e(1/r>0?0:2147483648,o,s+n);else if(isNaN(r))e(0,o,s+t),e(2146959360,o,s+n);else if(r>17976931348623157e292)e(0,o,s+t),e((c<<31|2146435072)>>>0,o,s+n);else{var l;if(r<22250738585072014e-324)l=r/5e-324,e(l>>>0,o,s+t),e((c<<31|l/4294967296)>>>0,o,s+n);else{var u=Math.floor(Math.log(r)/Math.LN2);u===1024&&(u=1023),l=r*Math.pow(2,-u),e(l*4503599627370496>>>0,o,s+t),e((c<<31|u+1023<<20|l*1048576&1048575)>>>0,o,s+n)}}}e.writeDoubleLE=t.bind(null,r,0,4),e.writeDoubleBE=t.bind(null,o,4,0);function n(e,t,n,r,o){var s=e(r,o+t),c=e(r,o+n),l=(c>>31)*2+1,u=c>>>20&2047,d=4294967296*(c&1048575)+s;return u===2047?d?NaN:l*(1/0):u===0?l*5e-324*d:l*Math.pow(2,u-1075)*(d+4503599627370496)}e.readDoubleLE=n.bind(null,s,0,4),e.readDoubleBE=n.bind(null,c,4,0)})(),e}function r(e,t,n){t[n]=e&255,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}function o(e,t,n){t[n]=e>>>24,t[n+1]=e>>>16&255,t[n+2]=e>>>8&255,t[n+3]=e&255}function s(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function c(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}})),require_inquire=__commonJSMin(((exports,module)=>{module.exports=inquire;function inquire(moduleName){try{var mod=eval(`quire`.replace(/^/,`re`))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}})),require_utf8=__commonJSMin((e=>{var t=e;t.length=function(e){for(var t=0,n=0,r=0;r<e.length;++r)n=e.charCodeAt(r),n<128?t+=1:n<2048?t+=2:(n&64512)==55296&&(e.charCodeAt(r+1)&64512)==56320?(++r,t+=4):t+=3;return t},t.read=function(e,t,n){if(n-t<1)return``;for(var r=null,o=[],s=0,c;t<n;)c=e[t++],c<128?o[s++]=c:c>191&&c<224?o[s++]=(c&31)<<6|e[t++]&63:c>239&&c<365?(c=((c&7)<<18|(e[t++]&63)<<12|(e[t++]&63)<<6|e[t++]&63)-65536,o[s++]=55296+(c>>10),o[s++]=56320+(c&1023)):o[s++]=(c&15)<<12|(e[t++]&63)<<6|e[t++]&63,s>8191&&((r||(r=[])).push(String.fromCharCode.apply(String,o)),s=0);return r?(s&&r.push(String.fromCharCode.apply(String,o.slice(0,s))),r.join(``)):String.fromCharCode.apply(String,o.slice(0,s))},t.write=function(e,t,n){for(var r=n,o,s,c=0;c<e.length;++c)o=e.charCodeAt(c),o<128?t[n++]=o:o<2048?(t[n++]=o>>6|192,t[n++]=o&63|128):(o&64512)==55296&&((s=e.charCodeAt(c+1))&64512)==56320?(o=65536+((o&1023)<<10)+(s&1023),++c,t[n++]=o>>18|240,t[n++]=o>>12&63|128,t[n++]=o>>6&63|128,t[n++]=o&63|128):(t[n++]=o>>12|224,t[n++]=o>>6&63|128,t[n++]=o&63|128);return n-r}})),require_pool=__commonJSMin(((e,t)=>{t.exports=n;function n(e,t,n){var r=n||8192,o=r>>>1,s=null,c=r;return function(n){if(n<1||n>o)return e(n);c+n>r&&(s=e(r),c=0);var l=t.call(s,c,c+=n);return c&7&&(c=(c|7)+1),l}}})),require_longbits=__commonJSMin(((e,t)=>{t.exports=r;var n=require_minimal$1();function r(e,t){this.lo=e>>>0,this.hi=t>>>0}var o=r.zero=new r(0,0);o.toNumber=function(){return 0},o.zzEncode=o.zzDecode=function(){return this},o.length=function(){return 1};var s=r.zeroHash=`\0\0\0\0\0\0\0\0`;r.fromNumber=function(e){if(e===0)return o;var t=e<0;t&&(e=-e);var n=e>>>0,s=(e-n)/4294967296>>>0;return t&&(s=~s>>>0,n=~n>>>0,++n>4294967295&&(n=0,++s>4294967295&&(s=0))),new r(n,s)},r.from=function(e){if(typeof e==`number`)return r.fromNumber(e);if(n.isString(e))if(n.Long)e=n.Long.fromString(e);else return r.fromNumber(parseInt(e,10));return e.low||e.high?new r(e.low>>>0,e.high>>>0):o},r.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=~this.lo+1>>>0,n=~this.hi>>>0;return t||(n=n+1>>>0),-(t+n*4294967296)}return this.lo+this.hi*4294967296},r.prototype.toLong=function(e){return n.Long?new n.Long(this.lo|0,this.hi|0,!!e):{low:this.lo|0,high:this.hi|0,unsigned:!!e}};var c=String.prototype.charCodeAt;r.fromHash=function(e){return e===s?o:new r((c.call(e,0)|c.call(e,1)<<8|c.call(e,2)<<16|c.call(e,3)<<24)>>>0,(c.call(e,4)|c.call(e,5)<<8|c.call(e,6)<<16|c.call(e,7)<<24)>>>0)},r.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)},r.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},r.prototype.zzDecode=function(){var e=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},r.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return n===0?t===0?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:n<128?9:10}})),require_minimal$1=__commonJSMin((e=>{var t=e;t.asPromise=require_aspromise(),t.base64=require_base64(),t.EventEmitter=require_eventemitter(),t.float=require_float(),t.inquire=require_inquire(),t.utf8=require_utf8(),t.pool=require_pool(),t.LongBits=require_longbits(),t.isNode=!!(typeof global<`u`&&global&&global.process&&global.process.versions&&global.process.versions.node),t.global=t.isNode&&global||typeof window<`u`&&window||typeof self<`u`&&self||e,t.emptyArray=Object.freeze?Object.freeze([]):[],t.emptyObject=Object.freeze?Object.freeze({}):{},t.isInteger=Number.isInteger||function(e){return typeof e==`number`&&isFinite(e)&&Math.floor(e)===e},t.isString=function(e){return typeof e==`string`||e instanceof String},t.isObject=function(e){return e&&typeof e==`object`},t.isset=t.isSet=function(e,t){var n=e[t];return n!=null&&e.hasOwnProperty(t)?typeof n!=`object`||(Array.isArray(n)?n.length:Object.keys(n).length)>0:!1},t.Buffer=(function(){try{var e=t.inquire(`buffer`).Buffer;return e.prototype.utf8Write?e:null}catch(e){return null}})(),t._Buffer_from=null,t._Buffer_allocUnsafe=null,t.newBuffer=function(e){return typeof e==`number`?t.Buffer?t._Buffer_allocUnsafe(e):new t.Array(e):t.Buffer?t._Buffer_from(e):typeof Uint8Array>`u`?e:new Uint8Array(e)},t.Array=typeof Uint8Array<`u`?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(e){return e?t.LongBits.from(e).toHash():t.LongBits.zeroHash},t.longFromHash=function(e,n){var r=t.LongBits.fromHash(e);return t.Long?t.Long.fromBits(r.lo,r.hi,n):r.toNumber(!!n)};function n(e,t,n){for(var r=Object.keys(t),o=0;o<r.length;++o)(e[r[o]]===void 0||!n)&&(e[r[o]]=t[r[o]]);return e}t.merge=n,t.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)};function r(e){function t(e,r){if(!(this instanceof t))return new t(e,r);Object.defineProperty(this,`message`,{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,`stack`,{value:Error().stack||``}),r&&n(this,r)}return t.prototype=Object.create(Error.prototype,{constructor:{value:t,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return e},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+`: `+this.message},writable:!0,enumerable:!1,configurable:!0}}),t}t.newError=r,t.ProtocolError=r(`ProtocolError`),t.oneOfGetter=function(e){for(var t={},n=0;n<e.length;++n)t[e[n]]=1;return function(){for(var e=Object.keys(this),n=e.length-1;n>-1;--n)if(t[e[n]]===1&&this[e[n]]!==void 0&&this[e[n]]!==null)return e[n]}},t.oneOfSetter=function(e){return function(t){for(var n=0;n<e.length;++n)e[n]!==t&&delete this[e[n]]}},t.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},t._configure=function(){var e=t.Buffer;if(!e){t._Buffer_from=t._Buffer_allocUnsafe=null;return}t._Buffer_from=e.from!==Uint8Array.from&&e.from||function(t,n){return new e(t,n)},t._Buffer_allocUnsafe=e.allocUnsafe||function(t){return new e(t)}}})),require_writer=__commonJSMin(((e,t)=>{t.exports=f;var n=require_minimal$1(),r,o=n.LongBits,s=n.base64,c=n.utf8;function l(e,t,n){this.fn=e,this.len=t,this.next=void 0,this.val=n}function u(){}function d(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function f(){this.len=0,this.head=new l(u,0,0),this.tail=this.head,this.states=null}var p=function(){return n.Buffer?function(){return(f.create=function(){return new r})()}:function(){return new f}};f.create=p(),f.alloc=function(e){return new n.Array(e)},n.Array!==Array&&(f.alloc=n.pool(f.alloc,n.Array.prototype.subarray)),f.prototype._push=function(e,t,n){return this.tail=this.tail.next=new l(e,t,n),this.len+=t,this};function m(e,t,n){t[n]=e&255}function h(e,t,n){for(;e>127;)t[n++]=e&127|128,e>>>=7;t[n]=e}function g(e,t){this.len=e,this.next=void 0,this.val=t}g.prototype=Object.create(l.prototype),g.prototype.fn=h,f.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new g((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},f.prototype.int32=function(e){return e<0?this._push(_,10,o.fromNumber(e)):this.uint32(e)},f.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)};function _(e,t,n){for(;e.hi;)t[n++]=e.lo&127|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[n++]=e.lo&127|128,e.lo>>>=7;t[n++]=e.lo}f.prototype.uint64=function(e){var t=o.from(e);return this._push(_,t.length(),t)},f.prototype.int64=f.prototype.uint64,f.prototype.sint64=function(e){var t=o.from(e).zzEncode();return this._push(_,t.length(),t)},f.prototype.bool=function(e){return this._push(m,1,+!!e)};function v(e,t,n){t[n]=e&255,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}f.prototype.fixed32=function(e){return this._push(v,4,e>>>0)},f.prototype.sfixed32=f.prototype.fixed32,f.prototype.fixed64=function(e){var t=o.from(e);return this._push(v,4,t.lo)._push(v,4,t.hi)},f.prototype.sfixed64=f.prototype.fixed64,f.prototype.float=function(e){return this._push(n.float.writeFloatLE,4,e)},f.prototype.double=function(e){return this._push(n.float.writeDoubleLE,8,e)};var y=n.Array.prototype.set?function(e,t,n){t.set(e,n)}:function(e,t,n){for(var r=0;r<e.length;++r)t[n+r]=e[r]};f.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this._push(m,1,0);if(n.isString(e)){var r=f.alloc(t=s.length(e));s.decode(e,r,0),e=r}return this.uint32(t)._push(y,t,e)},f.prototype.string=function(e){var t=c.length(e);return t?this.uint32(t)._push(c.write,t,e):this._push(m,1,0)},f.prototype.fork=function(){return this.states=new d(this),this.head=this.tail=new l(u,0,0),this.len=0,this},f.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 l(u,0,0),this.len=0),this},f.prototype.ldelim=function(){var e=this.head,t=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=e.next,this.tail=t,this.len+=n),this},f.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),n=0;e;)e.fn(e.val,t,n),n+=e.len,e=e.next;return t},f._configure=function(e){r=e,f.create=p(),r._configure()}})),require_writer_buffer=__commonJSMin(((e,t)=>{t.exports=o;var n=require_writer();(o.prototype=Object.create(n.prototype)).constructor=o;var r=require_minimal$1();function o(){n.call(this)}o._configure=function(){o.alloc=r._Buffer_allocUnsafe,o.writeBytesBuffer=r.Buffer&&r.Buffer.prototype instanceof Uint8Array&&r.Buffer.prototype.set.name===`set`?function(e,t,n){t.set(e,n)}:function(e,t,n){if(e.copy)e.copy(t,n,0,e.length);else for(var r=0;r<e.length;)t[n++]=e[r++]}},o.prototype.bytes=function(e){r.isString(e)&&(e=r._Buffer_from(e,`base64`));var t=e.length>>>0;return this.uint32(t),t&&this._push(o.writeBytesBuffer,t,e),this};function s(e,t,n){e.length<40?r.utf8.write(e,t,n):t.utf8Write?t.utf8Write(e,n):t.write(e,n)}o.prototype.string=function(e){var t=r.Buffer.byteLength(e);return this.uint32(t),t&&this._push(s,t,e),this},o._configure()})),require_reader=__commonJSMin(((e,t)=>{t.exports=l;var n=require_minimal$1(),r,o=n.LongBits,s=n.utf8;function c(e,t){return RangeError(`index out of range: `+e.pos+` + `+(t||1)+` > `+e.len)}function l(e){this.buf=e,this.pos=0,this.len=e.length}var u=typeof Uint8Array<`u`?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new l(e);throw Error(`illegal buffer`)}:function(e){if(Array.isArray(e))return new l(e);throw Error(`illegal buffer`)},d=function(){return n.Buffer?function(e){return(l.create=function(e){return n.Buffer.isBuffer(e)?new r(e):u(e)})(e)}:u};l.create=d(),l.prototype._slice=n.Array.prototype.subarray||n.Array.prototype.slice,l.prototype.uint32=(function(){var e=4294967295;return function(){if(e=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(e=(e|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return e;if((this.pos+=5)>this.len)throw this.pos=this.len,c(this,10);return e}})(),l.prototype.int32=function(){return this.uint32()|0},l.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(e&1)|0};function f(){var e=new o(0,0),t=0;if(this.len-this.pos>4){for(;t<4;++t)if(e.lo=(e.lo|(this.buf[this.pos]&127)<<t*7)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(this.buf[this.pos]&127)<<28)>>>0,e.hi=(e.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return e;t=0}else{for(;t<3;++t){if(this.pos>=this.len)throw c(this);if(e.lo=(e.lo|(this.buf[this.pos]&127)<<t*7)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(this.buf[this.pos++]&127)<<t*7)>>>0,e}if(this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(this.buf[this.pos]&127)<<t*7+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw c(this);if(e.hi=(e.hi|(this.buf[this.pos]&127)<<t*7+3)>>>0,this.buf[this.pos++]<128)return e}throw Error(`invalid varint encoding`)}l.prototype.bool=function(){return this.uint32()!==0};function p(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}l.prototype.fixed32=function(){if(this.pos+4>this.len)throw c(this,4);return p(this.buf,this.pos+=4)},l.prototype.sfixed32=function(){if(this.pos+4>this.len)throw c(this,4);return p(this.buf,this.pos+=4)|0};function m(){if(this.pos+8>this.len)throw c(this,8);return new o(p(this.buf,this.pos+=4),p(this.buf,this.pos+=4))}l.prototype.float=function(){if(this.pos+4>this.len)throw c(this,4);var e=n.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},l.prototype.double=function(){if(this.pos+8>this.len)throw c(this,4);var e=n.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},l.prototype.bytes=function(){var e=this.uint32(),t=this.pos,r=this.pos+e;if(r>this.len)throw c(this,e);if(this.pos+=e,Array.isArray(this.buf))return this.buf.slice(t,r);if(t===r){var o=n.Buffer;return o?o.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,t,r)},l.prototype.string=function(){var e=this.bytes();return s.read(e,0,e.length)},l.prototype.skip=function(e){if(typeof e==`number`){if(this.pos+e>this.len)throw c(this,e);this.pos+=e}else do if(this.pos>=this.len)throw c(this);while(this.buf[this.pos++]&128);return this},l.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(e=this.uint32()&7)!=4;)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error(`invalid wire type `+e+` at offset `+this.pos)}return this},l._configure=function(e){r=e,l.create=d(),r._configure();var t=n.Long?`toLong`:`toNumber`;n.merge(l.prototype,{int64:function(){return f.call(this)[t](!1)},uint64:function(){return f.call(this)[t](!0)},sint64:function(){return f.call(this).zzDecode()[t](!1)},fixed64:function(){return m.call(this)[t](!0)},sfixed64:function(){return m.call(this)[t](!1)}})}})),require_reader_buffer=__commonJSMin(((e,t)=>{t.exports=o;var n=require_reader();(o.prototype=Object.create(n.prototype)).constructor=o;var r=require_minimal$1();function o(e){n.call(this,e)}o._configure=function(){r.Buffer&&(o.prototype._slice=r.Buffer.prototype.slice)},o.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString(`utf-8`,this.pos,this.pos=Math.min(this.pos+e,this.len))},o._configure()})),require_service=__commonJSMin(((e,t)=>{t.exports=r;var n=require_minimal$1();(r.prototype=Object.create(n.EventEmitter.prototype)).constructor=r;function r(e,t,r){if(typeof e!=`function`)throw TypeError(`rpcImpl must be a function`);n.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=!!t,this.responseDelimited=!!r}r.prototype.rpcCall=function e(t,r,o,s,c){if(!s)throw TypeError(`request must be specified`);var l=this;if(!c)return n.asPromise(e,l,t,r,o,s);if(!l.rpcImpl){setTimeout(function(){c(Error(`already ended`))},0);return}try{return l.rpcImpl(t,r[l.requestDelimited?`encodeDelimited`:`encode`](s).finish(),function(e,n){if(e)return l.emit(`error`,e,t),c(e);if(n===null){l.end(!0);return}if(!(n instanceof o))try{n=o[l.responseDelimited?`decodeDelimited`:`decode`](n)}catch(e){return l.emit(`error`,e,t),c(e)}return l.emit(`data`,n,t),c(null,n)})}catch(e){l.emit(`error`,e,t),setTimeout(function(){c(e)},0);return}},r.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit(`end`).off()),this}})),require_rpc=__commonJSMin((e=>{var t=e;t.Service=require_service()})),require_roots=__commonJSMin(((e,t)=>{t.exports={}})),require_index_minimal=__commonJSMin((e=>{var t=e;t.build=`minimal`,t.Writer=require_writer(),t.BufferWriter=require_writer_buffer(),t.Reader=require_reader(),t.BufferReader=require_reader_buffer(),t.util=require_minimal$1(),t.rpc=require_rpc(),t.roots=require_roots(),t.configure=n;function n(){t.util._configure(),t.Writer._configure(t.BufferWriter),t.Reader._configure(t.BufferReader)}n()})),require_minimal=__commonJSMin(((e,t)=>{t.exports=require_index_minimal()})),import_minimal=__toESM(require_minimal(),1),$Reader$1=import_minimal.Reader,$util$1=import_minimal.util,$root$1=import_minimal.roots[`@REALSEE/FIVE:five/model/loaders/protobuf/pbm.proto`]||(import_minimal.roots[`@REALSEE/FIVE:five/model/loaders/protobuf/pbm.proto`]={}),Model$2=$root$1.Model=(()=>{function e(e){if(this.chunks=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)e[t[n]]!=null&&(this[t[n]]=e[t[n]])}return e.prototype.chunks=$util$1.emptyArray,e.prototype.createAt=$util$1.Long?$util$1.Long.fromBits(0,0,!0):0,e.prototype.description=``,e.decode=function(e,t,n){e instanceof $Reader$1||(e=$Reader$1.create(e));let r=t===void 0?e.len:e.pos+t,o=new $root$1.Model;for(;e.pos<r;){let t=e.uint32();if(t===n)break;switch(t>>>3){case 1:o.chunks&&o.chunks.length||(o.chunks=[]),o.chunks.push($root$1.Chunk.decode(e,e.uint32()));break;case 2:o.createAt=e.uint64();break;case 3:o.description=e.string();break;default:e.skipType(t&7);break}}return o},e.getTypeUrl=function(e){return e===void 0&&(e=`type.googleapis.com`),e+`/Model`},e})(),Chunk$1=$root$1.Chunk=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)e[t[n]]!=null&&(this[t[n]]=e[t[n]])}return e.prototype.vertices=null,e.prototype.faces=null,e.prototype.name=``,e.prototype.texture=``,e.decode=function(e,t,n){e instanceof $Reader$1||(e=$Reader$1.create(e));let r=t===void 0?e.len:e.pos+t,o=new $root$1.Chunk;for(;e.pos<r;){let t=e.uint32();if(t===n)break;switch(t>>>3){case 1:o.vertices=$root$1.Vertices.decode(e,e.uint32());break;case 2:o.faces=$root$1.Faces.decode(e,e.uint32());break;case 3:o.name=e.string();break;case 4:o.texture=e.string();break;default:e.skipType(t&7);break}}if(!o.hasOwnProperty(`vertices`))throw $util$1.ProtocolError(`missing required 'vertices'`,{instance:o});if(!o.hasOwnProperty(`faces`))throw $util$1.ProtocolError(`missing required 'faces'`,{instance:o});if(!o.hasOwnProperty(`name`))throw $util$1.ProtocolError(`missing required 'name'`,{instance:o});return o},e.getTypeUrl=function(e){return e===void 0&&(e=`type.googleapis.com`),e+`/Chunk`},e})(),Vertices=$root$1.Vertices=(()=>{function e(e){if(this.xyz=[],this.uvs=[],this.marks=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)e[t[n]]!=null&&(this[t[n]]=e[t[n]])}return e.prototype.xyz=$util$1.emptyArray,e.prototype.uvs=$util$1.emptyArray,e.prototype.marks=$util$1.emptyArray,e.decode=function(e,t,n){e instanceof $Reader$1||(e=$Reader$1.create(e));let r=t===void 0?e.len:e.pos+t,o=new $root$1.Vertices;for(;e.pos<r;){let t=e.uint32();if(t===n)break;switch(t>>>3){case 1:if(o.xyz&&o.xyz.length||(o.xyz=[]),(t&7)==2){let t=e.uint32()+e.pos;for(;e.pos<t;)o.xyz.push(e.float())}else o.xyz.push(e.float());break;case 2:if(o.uvs&&o.uvs.length||(o.uvs=[]),(t&7)==2){let t=e.uint32()+e.pos;for(;e.pos<t;)o.uvs.push(e.float())}else o.uvs.push(e.float());break;case 3:if(o.marks&&o.marks.length||(o.marks=[]),(t&7)==2){let t=e.uint32()+e.pos;for(;e.pos<t;)o.marks.push(e.int32())}else o.marks.push(e.int32());break;default:e.skipType(t&7);break}}return o},e.getTypeUrl=function(e){return e===void 0&&(e=`type.googleapis.com`),e+`/Vertices`},e})(),Faces=$root$1.Faces=(()=>{function e(e){if(this.indices=[],this.normals=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)e[t[n]]!=null&&(this[t[n]]=e[t[n]])}return e.prototype.indices=$util$1.emptyArray,e.prototype.normals=$util$1.emptyArray,e.decode=function(e,t,n){e instanceof $Reader$1||(e=$Reader$1.create(e));let r=t===void 0?e.len:e.pos+t,o=new $root$1.Faces;for(;e.pos<r;){let t=e.uint32();if(t===n)break;switch(t>>>3){case 1:if(o.indices&&o.indices.length||(o.indices=[]),(t&7)==2){let t=e.uint32()+e.pos;for(;e.pos<t;)o.indices.push(e.uint32())}else o.indices.push(e.uint32());break;case 2:if(o.normals&&o.normals.length||(o.normals=[]),(t&7)==2){let t=e.uint32()+e.pos;for(;e.pos<t;)o.normals.push(e.float())}else o.normals.push(e.float());break;default:e.skipType(t&7);break}}return o},e.getTypeUrl=function(e){return e===void 0&&(e=`type.googleapis.com`),e+`/Faces`},e})(),VertexMark=$root$1.VertexMark=(()=>{let e={},t=Object.create(e);return t[e[0]=`VERTEX_MARK_UNSPECIFIED`]=0,t[e[1]=`VERTEX_MARK_ROOF`]=1,t})();function fixNumber(e){return isNaN(e)||!isFinite(e)?0:e}function getGeometryMemoryUsed(e){let t=0;if(e instanceof three.BufferGeometry){for(let n in e.attributes){let r=e.getAttribute(n),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)}let n=e.getIndex();if(n){let e=4;`BYTES_PER_ELEMENT`in n.array&&typeof n.array.BYTES_PER_ELEMENT==`number`&&(e=n.array.BYTES_PER_ELEMENT),t+=fixNumber(n.count*n.itemSize*e)}}else e instanceof three.Geometry&&(t+=fixNumber(e.faces.length*3*3*4),t+=fixNumber(e.faceVertexUvs.length*3*2*4));return t}function getPBMGSObjectMemoryUsed(e){let t=[e.positions,e.rotations,e.scales,e.colors,e.sh1,e.sh2,e.sh3],n=0;for(let e of t){if(!e)continue;let t=4;`BYTES_PER_ELEMENT`in e&&typeof e.BYTES_PER_ELEMENT==`number`&&(t=e.BYTES_PER_ELEMENT);let r=e.length*t;isNaN(r)||!isFinite(r)||(n+=r)}return n}function makeComputeBlockRectSizeFunction(e,t,n){return function(r,o,s){return((r+e-1)/e|0)*((o+t-1)/t|0)*n*s}}function makeComputePaddedRectSizeFunction(e,t,n){return function(r,o,s){return(Math.max(r,e)*Math.max(o,t)/n|0)*s}}var compressedTextureFunctions=new Map([[three.RGB_S3TC_DXT1_Format,makeComputeBlockRectSizeFunction(4,4,8)],[three.RGBA_S3TC_DXT1_Format,makeComputeBlockRectSizeFunction(4,4,8)],[three.RGBA_S3TC_DXT3_Format,makeComputeBlockRectSizeFunction(4,4,16)],[three.RGBA_S3TC_DXT5_Format,makeComputeBlockRectSizeFunction(4,4,16)],[three.RGB_ETC1_Format,makeComputeBlockRectSizeFunction(4,4,8)],[three.RGB_PVRTC_4BPPV1_Format,makeComputePaddedRectSizeFunction(8,8,2)],[three.RGBA_PVRTC_4BPPV1_Format,makeComputePaddedRectSizeFunction(8,8,2)],[three.RGB_PVRTC_2BPPV1_Format,makeComputePaddedRectSizeFunction(16,8,4)],[three.RGBA_PVRTC_2BPPV1_Format,makeComputePaddedRectSizeFunction(16,8,4)],[three.RGB_ETC2_Format,makeComputeBlockRectSizeFunction(4,4,8)],[three.RGBA_ETC2_EAC_Format,makeComputeBlockRectSizeFunction(4,4,16)],[three.RGBA_ASTC_4x4_Format,makeComputeBlockRectSizeFunction(4,4,16)],[three.SRGB8_ALPHA8_ASTC_4x4_Format,makeComputeBlockRectSizeFunction(4,4,16)],[three.RGBA_ASTC_5x4_Format,makeComputeBlockRectSizeFunction(5,4,16)],[three.SRGB8_ALPHA8_ASTC_5x4_Format,makeComputeBlockRectSizeFunction(5,4,16)],[three.RGBA_ASTC_5x5_Format,makeComputeBlockRectSizeFunction(5,5,16)],[three.SRGB8_ALPHA8_ASTC_5x5_Format,makeComputeBlockRectSizeFunction(5,5,16)],[three.RGBA_ASTC_6x5_Format,makeComputeBlockRectSizeFunction(6,5,16)],[three.SRGB8_ALPHA8_ASTC_6x5_Format,makeComputeBlockRectSizeFunction(6,5,16)],[three.RGBA_ASTC_6x6_Format,makeComputeBlockRectSizeFunction(6,6,16)],[three.SRGB8_ALPHA8_ASTC_6x6_Format,makeComputeBlockRectSizeFunction(6,6,16)],[three.RGBA_ASTC_8x5_Format,makeComputeBlockRectSizeFunction(8,5,16)],[three.SRGB8_ALPHA8_ASTC_8x5_Format,makeComputeBlockRectSizeFunction(8,5,16)],[three.RGBA_ASTC_8x6_Format,makeComputeBlockRectSizeFunction(8,6,16)],[three.SRGB8_ALPHA8_ASTC_8x6_Format,makeComputeBlockRectSizeFunction(8,6,16)],[three.RGBA_ASTC_8x8_Format,makeComputeBlockRectSizeFunction(8,8,16)],[three.SRGB8_ALPHA8_ASTC_8x8_Format,makeComputeBlockRectSizeFunction(8,8,16)],[three.RGBA_ASTC_10x5_Format,makeComputeBlockRectSizeFunction(10,5,16)],[three.SRGB8_ALPHA8_ASTC_10x5_Format,makeComputeBlockRectSizeFunction(10,5,16)],[three.RGBA_ASTC_10x6_Format,makeComputeBlockRectSizeFunction(10,6,16)],[three.SRGB8_ALPHA8_ASTC_10x6_Format,makeComputeBlockRectSizeFunction(10,6,16)],[three.RGBA_ASTC_10x8_Format,makeComputeBlockRectSizeFunction(10,8,16)],[three.SRGB8_ALPHA8_ASTC_10x8_Format,makeComputeBlockRectSizeFunction(10,8,16)],[three.RGBA_ASTC_10x10_Format,makeComputeBlockRectSizeFunction(10,10,16)],[three.SRGB8_ALPHA8_ASTC_10x10_Format,makeComputeBlockRectSizeFunction(10,10,16)],[three.RGBA_ASTC_12x10_Format,makeComputeBlockRectSizeFunction(12,10,16)],[three.SRGB8_ALPHA8_ASTC_12x10_Format,makeComputeBlockRectSizeFunction(12,10,16)],[three.RGBA_ASTC_12x12_Format,makeComputeBlockRectSizeFunction(12,12,16)],[three.SRGB8_ALPHA8_ASTC_12x12_Format,makeComputeBlockRectSizeFunction(12,12,16)],[three.RGBA_BPTC_Format,makeComputeBlockRectSizeFunction(4,4,16)]]);function getTextureMemoryUsed(e){let t=0,n=1;(e.generateMipmaps===!0||e.mipmaps&&e.mipmaps.length>1)&&(n=1.33);let r=e instanceof three.CompressedTexture?compressedTextureFunctions.get(e.format):void 0,o=[].concat(e.image);for(let e of o)if(e)if(e instanceof three.Texture)t+=getTextureMemoryUsed(e);else{let{width:o=1,height:s=1,depth:c=1}=e;r?t+=fixNumber(r(o,s,c)*n):t+=fixNumber(o*s*c*4*n)}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`.split(`.`);function getMaterialMemoryUsed(e){let t=0;if(textureSet.clear(),e instanceof three.ShaderMaterial)for(let n in e.uniforms){let r=e.uniforms[n],o=r&&r.value&&r.value instanceof three.Texture?r.value:void 0;o instanceof three.Texture&&(textureSet.has(o)||(t=getTextureMemoryUsed(o),textureSet.add(o)))}else for(let n of textureNames){let r=e[n];r instanceof three.Texture&&(textureSet.has(r)||(t=getTextureMemoryUsed(r),textureSet.add(r)))}return textureSet.clear(),t}var sceneSet=new Set;function getMemoryUsage(e){let t=0;return sceneSet.clear(),e.traverse(e=>{if(e instanceof PBMGaussianSplattingObject&&(t+=getPBMGSObjectMemoryUsed(e)),e instanceof three.Mesh||e instanceof three.Line||e instanceof three.Points){let n=e.geometry;(n instanceof three.BufferGeometry||n instanceof three.Geometry)&&(sceneSet.has(n)||(t+=getGeometryMemoryUsed(n),sceneSet.add(n)));let r=[].concat(e.material);for(let e of r)e instanceof three.Material&&(sceneSet.has(e)||(t+=getMaterialMemoryUsed(e),sceneSet.add(e)))}}),sceneSet.clear(),t}function guessTextureBaseUriFromFileUrl(e){let t=e.lastIndexOf(`/`);return t>=0?e.slice(0,t+1).replace(/\/(model)(\/|$)/,(e,t,n)=>`/materials`+n):``}function loadPbm(e,t={}){var n,r,o,s,c,l,u;let d=(n=t.upAxis)==null?`Z`:n,f=(r=t.light)==null?!1:r,p=(o=t.fetcher)==null?internalFetcher:o,m=(s=t.onDownloadProgress)==null?noop:s,h=(c=t.textureBaseUri)==null?guessTextureBaseUriFromFileUrl(e):c,g=t.textureBaseUri===void 0?[]:((l=t.textureArray)==null?[]:l).slice(),_=autoRestImageOptionsByTextureLength((u=t.textureOptions)==null?{}:u,g.length),v=new Map;for(let e of g){let t=isAbsoluteURL(e)?e:pathJoin(h,e);v.set(t,loadTexture$1(t,_,p))}let y={byteLength:0};return Promise.resolve().then(()=>p.ajax(e,{responseType:`arraybuffer`},void 0,void 0,m)).then(e=>{y.byteLength=e.body.byteLength;let t=new Uint8Array(e.body);return Model$2.decode(t)}).then(e=>parse$4(e,f,h,g,_,v,p)).then(t=>{v.clear();let n=new three.Group;n.name=e;for(let e of t.objects)n.add(e);return d===`Y`&&n.applyMatrix4(ROTATE_X_MATRIX_INVERSE$2),{type:`pbm`,modelUpAxis:`Z`,upAxis:d,uri:e,byteLength:y.byteLength,memoryUsage:getMemoryUsage(n),scene:n,textures:t.textures,animations:[],dispose:()=>t.dispose()}})}function parseFloorName(e){let t=e.match(/(group|floor)-?(\d+)/);return t?parseInt(t[2],10):0}function parseChunkName(e){let t=e.match(/(chunk)-?(\d+)/);return t?parseInt(t[2],10):0}function parseSubName(e){let t=e.match(/(sub)-?(\d+)/);return t?parseInt(t[2],10):0}function chunkOrder(e){let t=parseFloorName(e.name),n=parseChunkName(e.name),r=parseSubName(e.name);return t*1e6+n*1e3+r}function parsePBMModel(e){var t,n,r;let o=typeof e.createAt==`number`?e.createAt:0,s=(t=e.description)==null?``:t,c=[],l=!0,u=!0;for(let t of e.chunks)if(!t.vertices.marks||t.vertices.marks.length===0){u=!1;break}for(let t of e.chunks)if(!t.faces.normals||t.faces.normals.length===0){l=!1;break}let d=e.chunks.sort((e,t)=>chunkOrder(e)-chunkOrder(t)),f=[];for(let e of d){let t=parseFloorName(e.name);f[t]||(f[t]=[]),f[t].push(e)}for(let e=0;e<f.length;e++){let t=f[e];if(t)if(l){let r=0;for(let e=0;e<t.length;e++){let n=t[e];r+=n.faces.indices.length}let l=new Float32Array(r*3),d=new Float32Array(r*2),f=new Float32Array(r*3),p=u?new Float32Array(r):void 0,m=[],h=[1/0,1/0,1/0,-1/0,-1/0,-1/0],g=0;for(let e=0;e<t.length;e++){let r=[1/0,1/0,1/0,-1/0,-1/0,-1/0],o=t[e],s=o.vertices.xyz,c=o.vertices.uvs,u=o.faces.indices,_=o.faces.normals,v=o.vertices.marks,y=u.length;for(let e=0;e<y;e++){let t=u[e],n=l[g*3+e*3]=s[t*3],o=l[g*3+e*3+1]=s[t*3+1],m=l[g*3+e*3+2]=s[t*3+2];p&&(p[g+e]=v[t]),d[g*2+e*2]=c[t*2],d[g*2+e*2+1]=c[t*2+1];let h=Math.floor(e/3)*3;f[g*3+e*3]=_[h],f[g*3+e*3+1]=_[h+1],f[g*3+e*3+2]=_[h+2],n<r[0]&&(r[0]=n),o<r[1]&&(r[1]=o),m<r[2]&&(r[2]=m),n>r[3]&&(r[3]=n),o>r[4]&&(r[4]=o),m>r[5]&&(r[5]=m)}r[0]<h[0]&&(h[0]=r[0]),r[1]<h[1]&&(h[1]=r[1]),r[2]<h[2]&&(h[2]=r[2]),r[3]>h[3]&&(h[3]=r[3]),r[4]>h[4]&&(h[4]=r[4]),r[5]>h[5]&&(h[5]=r[5]),m.push({materialIndex:e,name:o.name,chunkName:parseChunkName(o.name),start:g,count:o.faces.indices.length,texture:(n=o.texture)==null?void 0:n}),g+=y}let _={createAt:o,description:s,vertices:l,uvs:d,normals:f,masks:p,indices:null,floorIndex:e,groups:m,extents:h};c.push(_)}else{let n=0,l=0;for(let e=0;e<t.length;e++){let r=t[e];l+=r.vertices.xyz.length/3,n+=r.faces.indices.length}let d=new Float32Array(l*3),f=new Float32Array(l*2),p,m=new Float32Array(l),h=new Uint32Array(n),g=u?new Float32Array(n):void 0,_=[],v=[1/0,1/0,1/0,-1/0,-1/0,-1/0],y=0,b=0;for(let n=0;n<t.length;n++){let o=[1/0,1/0,1/0,-1/0,-1/0,-1/0],s=t[n],c=s.vertices.xyz,l=s.vertices.marks,u=s.vertices.uvs,p=s.faces.indices,S=c.length/3,C=p.length;for(let t=0;t<S;t++){let n=d[b*3+t*3]=c[t*3],r=d[b*3+t*3+1]=c[t*3+1],s=d[b*3+t*3+2]=c[t*3+2];g&&(g[b+t]=l[t]),f[b*2+t*2]=u[t*2],f[b*2+t*2+1]=u[t*2+1],m[b+t]=e,n<o[0]&&(o[0]=n),r<o[1]&&(o[1]=r),s<o[2]&&(o[2]=s),n>o[3]&&(o[3]=n),r>o[4]&&(o[4]=r),s>o[5]&&(o[5]=s)}o[0]<v[0]&&(v[0]=o[0]),o[1]<v[1]&&(v[1]=o[1]),o[2]<v[2]&&(v[2]=o[2]),o[3]>v[3]&&(v[3]=o[3]),o[4]>v[4]&&(v[4]=o[4]),o[5]>v[5]&&(v[5]=o[5]);for(let e=0;e<C;e++)h[y+e]=b+p[e];_.push({materialIndex:n,name:s.name,chunkName:parseChunkName(s.name),start:y,count:s.faces.indices.length,texture:(r=s.texture)==null?void 0:r}),b+=S,y+=C}let S={createAt:o,description:s,vertices:d,uvs:f,normals:void 0,masks:g,indices:h,floorIndex:e,groups:_,extents:v};c.push(S)}}return c}function loadTexture$1(e,t,n){let r=Object.assign({key:`texture.pbm`},pick(t,[`format`,`quality`,`size`,`sharpen`,`forceUseExifOrientation`,`mappings`]));return new TextureLoader().loadTexture(e,{imageURL:{transform:t.transform,options:r},encoding:three.sRGBEncoding,wrapS:three.ClampToEdgeWrapping,wrapT:three.ClampToEdgeWrapping,minFilter:three.LinearFilter,maxSize:typeof r.size==`number`?new three.Vector2(r.size,r.size):void 0,fetcher:n}).then(e=>{let t=e.body;return t.needsUpdate=!0,t})}function parse$4(e,t,n,r,o,s,c){let l=parsePBMModel(e),u=0,d=``,f=[],p={},m=new Set,h=0;for(let{createAt:e,description:o,vertices:s,masks:c,uvs:g,normals:_,indices:v,floorIndex:y,groups:b,extents:S}of l){let l=new three.Box3;l.min.x=S[0],l.min.y=S[1],l.min.z=S[2],l.max.x=S[3],l.max.y=S[4],l.max.z=S[5];let C=new three.BufferGeometry;C.setAttribute(`position`,new three.BufferAttribute(s,3)),C.setAttribute(`uv`,new three.BufferAttribute(g,2)),_&&C.setAttribute(`normal`,new three.BufferAttribute(_,3)),c&&C.setAttribute(`_feature_id_rsmask`,new three.BufferAttribute(c,1)),v&&C.setIndex(new three.BufferAttribute(v,1)),C.boundingBox=l,C.boundingSphere=l.getBoundingSphere(new three.Sphere);for(let e of b)C.addGroup(e.start,e.count,e.materialIndex);m.add(C);let w=[];for(let e of b){let o;if(e.texture){if(o=e.texture,r.length>0&&r.indexOf(e.texture)===-1){for(let t of r)if((isAbsoluteURL(t)?t:pathJoin(n,t)).slice(e.texture.length*-1)===e.texture){o=t;break}console.warn(`At3d/Pbm texture not matched. Use ends-guessing mode. ${e.texture} -> ${o}`)}isAbsoluteURL(o)||(o=pathJoin(n,o))}let s=new PBMMeshMaterial(t?`phong`:`basic`);s.floorIndex=y,C.attributes.normal===void 0&&(s.flatShading=!0),C.attributes._feature_id_rsmask&&(s.defines.USE_VERTEX_MARK=!0),w.push(s),o?(h++,p[o]?p[o].push(s):p[o]=[s]):s.color=new three.Color(16777215),m.add(s)}let T=new PBMMesh(C,w);T.name=`model_floor_`+y,T.userData.createAt=e,T.userData.description=o,T.matrix.compose(T.position,T.quaternion,T.scale),T.matrixAutoUpdate=!1,T.frustumCulled=!1,u=e,d=o,f.push(T)}o=autoRestImageOptionsByTextureLength(o,h);let g=[];for(let e of Object.keys(p)){let t;s&&(t=s.get(e)),t||(t=loadTexture$1(e,o,c),s&&s.set(e,t)),g.push(t.then(t=>{for(let n of p[e])n.map&&(m.delete(n.map),n.map.dispose()),n.map=t,m.add(t);return t}).catch(()=>{for(let t of p[e])t.map&&(m.delete(t.map),t.map.dispose()),t.map=null,t.color=new three.Color(16777215);return null}))}return Promise.all(g).then(e=>{let t=e.filter(e=>e instanceof three.Texture);return{createAt:u,description:d,objects:f,textures:t,dispose:()=>{m.forEach(e=>{e.dispose()}),m.clear()}}})}function autoRestImageOptionsByTextureLength(e,t){return e=Object.assign({},e),e.autoResize!==!1&&(t>96?e.size=Math.min(e.size||1/0,100):t>48?e.size=Math.min(e.size||1/0,200):t>24?e.size=Math.min(e.size||1/0,400):t>22?e.size=Math.min(e.size||1/0,800):t>5&&(e.size=Math.min(e.size||1/0,1024))),e}function createLZMA(){var e={};return e.OutWindow=function(){this._windowSize=0},e.OutWindow.prototype.create=function(e){(!this._buffer||this._windowSize!==e)&&(this._buffer=[]),this._windowSize=e,this._pos=0,this._streamPos=0},e.OutWindow.prototype.flush=function(){var e=this._pos-this._streamPos;if(e!==0){for(;e--;)this._stream.writeByte(this._buffer[this._streamPos++]);this._pos>=this._windowSize&&(this._pos=0),this._streamPos=this._pos}},e.OutWindow.prototype.releaseStream=function(){this.flush(),this._stream=null},e.OutWindow.prototype.setStream=function(e){this.releaseStream(),this._stream=e},e.OutWindow.prototype.init=function(e){e||(this._streamPos=0,this._pos=0)},e.OutWindow.prototype.copyBlock=function(e,t){var n=this._pos-e-1;for(n<0&&(n+=this._windowSize);t--;)n>=this._windowSize&&(n=0),this._buffer[this._pos++]=this._buffer[n++],this._pos>=this._windowSize&&this.flush()},e.OutWindow.prototype.putByte=function(e){this._buffer[this._pos++]=e,this._pos>=this._windowSize&&this.flush()},e.OutWindow.prototype.getByte=function(e){var t=this._pos-e-1;return t<0&&(t+=this._windowSize),this._buffer[t]},e.RangeDecoder=function(){},e.RangeDecoder.prototype.setStream=function(e){this._stream=e},e.RangeDecoder.prototype.releaseStream=function(){this._stream=null},e.RangeDecoder.prototype.init=function(){var e=5;for(this._code=0,this._range=-1;e--;)this._code=this._code<<8|this._stream.readByte()},e.RangeDecoder.prototype.decodeDirectBits=function(e){for(var t=0,n=e,r;n--;)this._range>>>=1,r=this._code-this._range>>>31,this._code-=this._range&r-1,t=t<<1|1-r,this._range&4278190080||(this._code=this._code<<8|this._stream.readByte(),this._range<<=8);return t},e.RangeDecoder.prototype.decodeBit=function(e,t){var n=e[t],r=(this._range>>>11)*n;return(this._code^2147483648)<(r^2147483648)?(this._range=r,e[t]+=2048-n>>>5,this._range&4278190080||(this._code=this._code<<8|this._stream.readByte(),this._range<<=8),0):(this._range-=r,this._code-=r,e[t]-=n>>>5,this._range&4278190080||(this._code=this._code<<8|this._stream.readByte(),this._range<<=8),1)},e.initBitModels=function(e,t){for(;t--;)e[t]=1024},e.BitTreeDecoder=function(e){this._models=[],this._numBitLevels=e},e.BitTreeDecoder.prototype.init=function(){e.initBitModels(this._models,1<<this._numBitLevels)},e.BitTreeDecoder.prototype.decode=function(e){for(var t=1,n=this._numBitLevels;n--;)t=t<<1|e.decodeBit(this._models,t);return t-(1<<this._numBitLevels)},e.BitTreeDecoder.prototype.reverseDecode=function(e){for(var t=1,n=0,r=0,o;r<this._numBitLevels;++r)o=e.decodeBit(this._models,t),t=t<<1|o,n|=o<<r;return n},e.reverseDecode2=function(e,t,n,r){for(var o=1,s=0,c=0,l;c<r;++c)l=n.decodeBit(e,t+o),o=o<<1|l,s|=l<<c;return s},e.LenDecoder=function(){this._choice=[],this._lowCoder=[],this._midCoder=[],this._highCoder=new e.BitTreeDecoder(8),this._numPosStates=0},e.LenDecoder.prototype.create=function(t){for(;this._numPosStates<t;++this._numPosStates)this._lowCoder[this._numPosStates]=new e.BitTreeDecoder(3),this._midCoder[this._numPosStates]=new e.BitTreeDecoder(3)},e.LenDecoder.prototype.init=function(){var t=this._numPosStates;for(e.initBitModels(this._choice,2);t--;)this._lowCoder[t].init(),this._midCoder[t].init();this._highCoder.init()},e.LenDecoder.prototype.decode=function(e,t){return e.decodeBit(this._choice,0)===0?this._lowCoder[t].decode(e):e.decodeBit(this._choice,1)===0?8+this._midCoder[t].decode(e):16+this._highCoder.decode(e)},e.Decoder2=function(){this._decoders=[]},e.Decoder2.prototype.init=function(){e.initBitModels(this._decoders,768)},e.Decoder2.prototype.decodeNormal=function(e){var t=1;do t=t<<1|e.decodeBit(this._decoders,t);while(t<256);return t&255},e.Decoder2.prototype.decodeWithMatchByte=function(e,t){var n=1,r,o;do if(r=t>>7&1,t<<=1,o=e.decodeBit(this._decoders,(1+r<<8)+n),n=n<<1|o,r!==o){for(;n<256;)n=n<<1|e.decodeBit(this._decoders,n);break}while(n<256);return n&255},e.LiteralDecoder=function(){},e.LiteralDecoder.prototype.create=function(t,n){var r;if(!(this._coders&&this._numPrevBits===n&&this._numPosBits===t))for(this._numPosBits=t,this._posMask=(1<<t)-1,this._numPrevBits=n,this._coders=[],r=1<<this._numPrevBits+this._numPosBits;r--;)this._coders[r]=new e.Decoder2},e.LiteralDecoder.prototype.init=function(){for(var e=1<<this._numPrevBits+this._numPosBits;e--;)this._coders[e].init()},e.LiteralDecoder.prototype.getDecoder=function(e,t){return this._coders[((e&this._posMask)<<this._numPrevBits)+((t&255)>>>8-this._numPrevBits)]},e.Decoder=function(){this._outWindow=new e.OutWindow,this._rangeDecoder=new e.RangeDecoder,this._isMatchDecoders=[],this._isRepDecoders=[],this._isRepG0Decoders=[],this._isRepG1Decoders=[],this._isRepG2Decoders=[],this._isRep0LongDecoders=[],this._posSlotDecoder=[],this._posDecoders=[],this._posAlignDecoder=new e.BitTreeDecoder(4),this._lenDecoder=new e.LenDecoder,this._repLenDecoder=new e.LenDecoder,this._literalDecoder=new e.LiteralDecoder,this._dictionarySize=-1,this._dictionarySizeCheck=-1,this._posSlotDecoder[0]=new e.BitTreeDecoder(6),this._posSlotDecoder[1]=new e.BitTreeDecoder(6),this._posSlotDecoder[2]=new e.BitTreeDecoder(6),this._posSlotDecoder[3]=new e.BitTreeDecoder(6)},e.Decoder.prototype.setDictionarySize=function(e){return e<0?!1:(this._dictionarySize!==e&&(this._dictionarySize=e,this._dictionarySizeCheck=Math.max(this._dictionarySize,1),this._outWindow.create(Math.max(this._dictionarySizeCheck,4096))),!0)},e.Decoder.prototype.setLcLpPb=function(e,t,n){var r=1<<n;return e>8||t>4||n>4?!1:(this._literalDecoder.create(t,e),this._lenDecoder.create(r),this._repLenDecoder.create(r),this._posStateMask=r-1,!0)},e.Decoder.prototype.init=function(){var t=4;for(this._outWindow.init(!1),e.initBitModels(this._isMatchDecoders,192),e.initBitModels(this._isRep0LongDecoders,192),e.initBitModels(this._isRepDecoders,12),e.initBitModels(this._isRepG0Decoders,12),e.initBitModels(this._isRepG1Decoders,12),e.initBitModels(this._isRepG2Decoders,12),e.initBitModels(this._posDecoders,114),this._literalDecoder.init();t--;)this._posSlotDecoder[t].init();this._lenDecoder.init(),this._repLenDecoder.init(),this._posAlignDecoder.init(),this._rangeDecoder.init()},e.Decoder.prototype.decode=function(t,n,r){var o=0,s=0,c=0,l=0,u=0,d=0,f=0,p,m,h,g,_,v;for(this._rangeDecoder.setStream(t),this._outWindow.setStream(n),this.init();r<0||d<r;)if(p=d&this._posStateMask,this._rangeDecoder.decodeBit(this._isMatchDecoders,(o<<4)+p)===0)m=this._literalDecoder.getDecoder(d++,f),f=o>=7?m.decodeWithMatchByte(this._rangeDecoder,this._outWindow.getByte(s)):m.decodeNormal(this._rangeDecoder),this._outWindow.putByte(f),o=o<4?0:o-(o<10?3:6);else{if(this._rangeDecoder.decodeBit(this._isRepDecoders,o)===1)h=0,this._rangeDecoder.decodeBit(this._isRepG0Decoders,o)===0?this._rangeDecoder.decodeBit(this._isRep0LongDecoders,(o<<4)+p)===0&&(o=o<7?9:11,h=1):(this._rangeDecoder.decodeBit(this._isRepG1Decoders,o)===0?g=c:(this._rangeDecoder.decodeBit(this._isRepG2Decoders,o)===0?g=l:(g=u,u=l),l=c),c=s,s=g),h===0&&(h=2+this._repLenDecoder.decode(this._rangeDecoder,p),o=o<7?8:11);else if(u=l,l=c,c=s,h=2+this._lenDecoder.decode(this._rangeDecoder,p),o=o<7?7:10,_=this._posSlotDecoder[h<=5?h-2:3].decode(this._rangeDecoder),_>=4){if(v=(_>>1)-1,s=(2|_&1)<<v,_<14)s+=e.reverseDecode2(this._posDecoders,s-_-1,this._rangeDecoder,v);else if(s+=this._rangeDecoder.decodeDirectBits(v-4)<<4,s+=this._posAlignDecoder.reverseDecode(this._rangeDecoder),s<0){if(s===-1)break;return!1}}else s=_;if(s>=d||s>=this._dictionarySizeCheck)return!1;this._outWindow.copyBlock(s,h),d+=h,f=this._outWindow.getByte(0)}return this._outWindow.flush(),this._outWindow.releaseStream(),this._rangeDecoder.releaseStream(),!0},e.Decoder.prototype.setDecoderProperties=function(e){var t,n,r,o,s;return e.size<5||(t=e.readByte(),n=t%9,t=~~(t/9),r=t%5,o=~~(t/5),!this.setLcLpPb(n,r,o))?!1:(s=e.readByte(),s|=e.readByte()<<8,s|=e.readByte()<<16,s+=e.readByte()*16777216,this.setDictionarySize(s))},e.decompress=function(t,n,r,o){var s=new e.Decoder;if(!s.setDecoderProperties(t))throw`Incorrect stream properties`;if(!s.decode(n,r,o))throw`Error in data stream`;return!0},e.decompressFile=function(t,n){var r=new e.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,n,o))throw`Error in data stream`;return!0},e}var LZMA=createLZMA();function createWASM(){function e(e){let t=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,n=new Uint8Array(256);for(let e=0;e<64;e++)n[`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`.charCodeAt(e)]=e;let r=e.length*.75,o=e.length,s,c=0,l,u,d,f;e[e.length-1]===`=`&&(r--,e[e.length-2]===`=`&&r--);let p=new ArrayBuffer(r),m=new Uint8Array(p);for(s=0;s<o;s+=4)l=n[e.charCodeAt(s)],u=n[e.charCodeAt(s+1)],d=n[e.charCodeAt(s+2)],f=n[e.charCodeAt(s+3)],m[c++]=l<<2|u>>4,m[c++]=(u&15)<<4|d>>2,m[c++]=(d&3)<<6|f&63;return p}return e(`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///wNLBEBBAEHAAEEXQSIQAAALIAEQAiICQQhqIAEQAyAARQRAQQwQASEACyAAQQA2AgAgAEEANgIEIABBADYCCCAAIAI2AgAgAEEANgIEIAAgATYCCCAACwoAQQwQASAAEA4LBgAgABAPCyoAIAEgACgCCE8EQEEAQcAAQSdBPxAAAAsgACgCBCABIAAoAgBqai0ACAssACABIAAoAghPBEBBAEHAA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EEBgaIAAoAkRBASQEEBgaIAAoAkgQGSAAKAJMEBkLyAwBA38DQCABQQNxIAIgAhsEQCAAIgRBAWohACABIgNBAWohASAEIAMtAAA6AAAgAkEBayECDAELCyAAQQNxRQRAA0AgAkEQTwRAIAAgASgCADYCACAAQQRqIAFBBGooAgA2AgAgAEEIaiABQQhqKAIANgIAIABBDGogAUEMaigCADYCACABQRBqIQEgAEEQaiEAIAJBEGshAgwBCwsgAkEIcQRAIAAgASgCADYCACAAQQRqIAFBBGooAgA2AgAgAUEIaiEBIABBCGohAAsgAkEEcQRAIAAgASgCADYCACABQQRqIQEgAEEEaiEACyACQQJxBEAgACABLwEAOwEAIAFBAmohASAAQQJqIQALIAJBAXEEQCAAIAEtAAA6AAALDwsgAkEgTwRAAkACQAJAIABBA3EiA0EBRwRAIANBAkYNASADQQNGDQIMAwsgASgCACEFIAAgASIDLQAAOgAAIABBAWoiASABIANBAWoiAS0AADoAAEEBaiIEQQFqIQAgAUEBaiIDQQFqIQEgBCADLQAAOgAAIAJBA2shAgNAIAJBEU8EQCAAIAFBAWooAgAiA0EIdCAFQRh2cjYCACAAQQRqIAFBBWooAgAiBUEIdCADQRh2cjYCACAAQQhqIAFBCWooAgAiA0EIdCAFQRh2cjYCACAAQQxqIAFBDWooAgAiBUEIdCADQRh2cjYCACABQRBqIQEgAEEQaiEAIAJBEGshAgwBCwsMAgsgASgCACEFIAAgAS0AADoAACAAQQFqIgRBAWohACABQQFqIgNBAWohASAEIAMtAAA6AAAgAkECayECA0AgAkESTwRAIAAgAUECaigCACIDQRB0IAVBEHZyNgIAIABBBGogAUEGaigCACIFQRB0IANBEHZyNgIAIABBCGogAUEKaigCACIDQRB0IAVBEHZyNgIAIABBDGogAUEOaigCACIFQRB0IANBEHZyNgIAIAFBEGohASAAQRBqIQAgAkEQayECDAELCwwBCyABKAIAIQUgACIEQQFqIQAgASIDQQFqIQEgBCADLQAAOgAAIAJBAWshAgNAIAJBE08EQCAAIAFBA2ooAgAiA0EYd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oAhwgBigCBCAGKAIAIAJBAWpqai0ACCACQQN0dHI2AhwgAkEBaiECDAELCyAEIAQoAhw2AhggBCgCGEGAIEkEQCAEQYAgNgIYC0EAIQJBACEFQQAhAwNAAkAgA0EITg0AIAYgA0EFahARQf8BcSIEQf8BRwRAQQEhBQsgBCADQQN0dCACciECIANBAWohAwwBCwsgACgCACAFRToAACAAKAIAKAIEIAE2AgAgACgCABAWAkAgACgCACAFIAIQICIBQQFGDQAgAUEDRwRAIAFBAkYEQCAFBEAgACgCACgCCCgCECACRw0DCwUMAgsLIAAoAgAoAgQtAAQaQQFBACAAKAIAKAIIKAIQIAAoAgAoAggoAgQQIQ8LQQBBAUEAQQAQIQsIACMDIAAQIgsWAEG4ASQAIwAkAUGAgIAIJAIQDCQDCwMAAQsLtwEEAEEICxcKAAAAdQBzAGUAIABzAHQAcgBpAGMAdABBIAsdDQAAAH4AbABpAGIALwBhAHIAcgBhAHkALgB0AHMAQcAACzkbAAAAfgBsAGkAYgAvAGkAbgB0AGUAcgBuAGEAbAAvAHQAeQBwAGUAZABhAHIAcgBhAHkALgB0AHMAQYABCzMYAAAAcwByAGMALwBsAHoAbQBhAC8AbAB6AG0AYQAtAGQAZQBjAG8AZABlAHIALgB0AHM=`)}function decodeLZMA(e,t,n){try{let r={data:t,offset:0,readByte(){return this.data[this.offset++]}},o=r.data.length,s={data:[],offset:0,writeByte(e){let t=Math.floor(this.offset/o);this.data[t]||(this.data[t]=new Uint8Array(o)),this.data[t][this.offset%o]=e,this.offset++}};e.decompressFile(r,s);let c=new Uint8Array(s.offset);for(let e=0;e<s.offset;e++)c[e]=s.data[Math.floor(e/o)][e%o];n(null,c)}catch(e){n(e)}}function decodeLZMAWithWASM(e,t,n){let r=24;try{let r=new WebAssembly.Memory({initial:16}),o=new WebAssembly.Module(e),s=new WebAssembly.Instance(o,{env:{memory:r,abort(){n(Error(`webAssembly abort`))}}}).exports,c=s.newU8Array(t.length);new Uint8Array(r.buffer,c+24,t.length).set(t);let l=s.decode(c),u=new Uint32Array(r.buffer,l,4),d=u[0],f=u[2],p=u[3];d?n(null,new Uint8Array(r.buffer,p+24,f).slice(0,f)):n(Error(`lzma deocder error`))}catch(e){n(e)}}var lzmaWorkerSource=`
|
|
319
|
+
`);for(let e=0;e<n.length;e++){let r=n[e],o=r.indexOf(`:`),s=r.slice(0,o).trim().toLowerCase(),c=r.slice(o+1).trim();c&&(t[s]?t[s]+=`, `+c:t[s]=c)}return t}function matchJsonpFunctionName(e){for(let t of JSONP_REGEXPS){let n=e.match(t);if(n)return`jsonp_`+n[1]}return null}function isJsonp(e){return matchJsonpFunctionName(e)!==null}var NetworkSubscribe=class extends Subscribe{};function ajax(e,t={},n=noop,r=noop,o=noop){let s=now(),c=e;return Promise.resolve().then(()=>t.requestProxy?t.requestProxy(e):e).then(e=>locationIsHttps&&/^http\:/.test(e)?(console.warn(`The page at '${locationHref}' was loaded over HTTPS, but requested an insecure element '${e}'. This request was automatically upgraded to HTTPS`),e.replace(/^http\:/,`https:`)):e).catch(n=>{var r;matchJsonpFunctionName(e);let o=new NetworkProxyError(c,`XMLHttpRequest`,n&&n.message?String(n.message):String(n));return(r=t.networkSubscribe)==null||r.emit(`network`,e,`XMLHttpRequest`,`forbidden`,o.message),Promise.reject(o)}).then(e=>new Promise((l,u)=>{let d=matchJsonpFunctionName(e);if(d){let o=window,f=null,p=!1,m=document.createElement(`script`);o[d]=h=>{var g,_;let v=now(),y=v-s;if(delete o[d],m.parentNode&&m.parentNode.removeChild(m),f!==null&&(window.clearTimeout(f),f=null),p===!0)return;if(h.indexOf(`data:`)!==0){let n=new NetworkResponseError(e,`XMLHttpRequest`,500);r(n),u(n),(g=t.networkSubscribe)==null||g.emit(`network`,e,`XMLHttpRequest`,`error`,n.message);return}let b=h.split(`,`),S=(b[0].match(/:(.*?);/)||[])[1],C=b[1];if(t.responseType===`arraybuffer`||t.responseType===`blob`){let e=atob(b[1]),n=e.length,r=new Uint8Array(n);for(let t=0;t<n;t++)r[t]=e.charCodeAt(t);C=t.responseType===`arraybuffer`?r.buffer:new Blob([r],{type:S})}let w={body:C,meta:{origin:c,source:e,requestTime:s,responseTime:v,costs:y,headers:{}}};n(w),l(w),(_=t.networkSubscribe)==null||_.emit(`network`,e,`XMLHttpRequest`,`ok`,JSON.stringify(w.meta)),p=!0},m.src=e,document.body.appendChild(m),typeof t.timeout==`number`&&(f=window.setTimeout(()=>{var n;if(f=null,p!==!0){p=!0;let o=new NetworkTimeoutError(e,`XMLHttpRequest`,t.timeout||NaN);r(o),u(o),(n=t.networkSubscribe)==null||n.emit(`network`,e,`XMLHttpRequest`,`timeout`,o.message)}},t.timeout))}else{let d=!1,f=new XMLHttpRequest,p=()=>{f&&(f.removeEventListener(`timeout`,m,!1),f.removeEventListener(`progress`,h,!1),f.removeEventListener(`load`,g,!1),f.removeEventListener(`error`,_,!1)),f=null,p=noop},m=function(){var n;if(d===!0)return;d=!0,p();let o=new NetworkTimeoutError(e,`XMLHttpRequest`,t.timeout||NaN);r(o),u(o),(n=t.networkSubscribe)==null||n.emit(`network`,e,`XMLHttpRequest`,`timeout`,o.message)},h=function(e){d!==!0&&e.lengthComputable&&(e.total<=0||o(e.loaded/e.total,e.loaded,e.total))},g=function(r){var o;if(d===!0)return;let u=this.status;if(u===0||u>=200&&u<400){d=!0,p();let u=now(),f=u-s,m=parseHeaders(this.getAllResponseHeaders()),h=r.total,g={body:this.response,meta:{origin:c,source:e,requestTime:s,responseTime:u,costs:f,headers:m,size:h}};n(g),l(g),(o=t.networkSubscribe)==null||o.emit(`network`,e,`XMLHttpRequest`,`ok`,JSON.stringify(g.meta))}else _.call(this)},_=function(){var n;if(d===!0)return;d=!0,p();let o=new NetworkResponseError(e,`XMLHttpRequest`,this.status);r(o),u(o),(n=t.networkSubscribe)==null||n.emit(`network`,e,`XMLHttpRequest`,`error`,o.message)};f.addEventListener(`timeout`,m,!1),f.addEventListener(`progress`,h,!1),f.addEventListener(`load`,g,!1),f.addEventListener(`error`,_,!1),t.responseType&&(f.responseType=t.responseType),typeof t.timeout==`number`&&(f.timeout=t.timeout),f.open(`GET`,e,!0),f.send(null)}}))}var preloadCache={};function preload(e,t={}){let n=now(),r=e;return Promise.resolve().then(()=>t.requestProxy?t.requestProxy(e):e).then(e=>locationIsHttps&&/^http\:/.test(e)?(console.warn(`The page at '${locationHref}' was loaded over HTTPS, but requested an insecure element '${e}'. This request was automatically upgraded to HTTPS`),e.replace(/^http\:/,`https:`)):e).catch(n=>{var o;let s=new NetworkProxyError(r,`Link`,n&&n.message?String(n.message):String(n));return(o=t.networkSubscribe)==null||o.emit(`network`,e,`Link`,`forbidden`,s.message),Promise.reject(s)}).then(e=>e in preloadCache?preloadCache[e]:preloadCache[e]=new Promise((o,s)=>{let c=document.head||document.getElementsByTagName(`head`)[0],l=document.createElement(`link`),u=!1,d=null;l.onload=s=>{var c;if(d!==null&&(clearTimeout(d),d=null),u===!0)return;u=!0,o(),l.onerror=noop,l.onload=noop;let f=now(),p={origin:r,source:e,requestTime:n,responseTime:f,costs:f-n,headers:{}};(c=t.networkSubscribe)==null||c.emit(`network`,e,`Link`,`preload`,JSON.stringify(p))},l.onerror=n=>{var r;if(d!==null&&(clearTimeout(d),d=null),u===!0)return;u=!0,delete preloadCache[e],c&&l.parentNode===c&&c.removeChild(l);let o=new NetworkResponseError(e,`Link`,0);s(o),l.onerror=noop,l.onload=noop,(r=t.networkSubscribe)==null||r.emit(`network`,e,`Link`,`error`,o.message)},typeof t.timeout==`number`&&(d=window.setTimeout(()=>{var s;if(d=null,u===!0)return;u=!0,o(),l.onerror=noop,l.onload=noop;let c=now(),f={origin:r,source:e,requestTime:n,responseTime:c,costs:c-n,headers:{}};(s=t.networkSubscribe)==null||s.emit(`network`,e,`Link`,`timeout`,JSON.stringify(f))},t.timeout)),l.rel=l.relList&&l.relList.supports(`prefetch`)?`prefetch`:`preload`,l.as=`fetch`,l.crossOrigin=``,l.fetchPriority=`high`,l.href=e,c&&c.appendChild(l)}))}function loadImage(e,t={},n=noop,r=noop,o=noop,s){let c=now(),l=e;return Promise.resolve().then(()=>t.requestProxy?t.requestProxy(e):e).then(e=>locationIsHttps&&/^http\:/.test(e)?(console.warn(`The page at '${locationHref}' was loaded over HTTPS, but requested an insecure element '${e}'. This request was automatically upgraded to HTTPS`),e.replace(/^http\:/,`https:`)):e).catch(n=>{var r;let o=new NetworkProxyError(l,`Image`,n&&n.message?String(n.message):String(n));return(r=t.networkSubscribe)==null||r.emit(`network`,e,`Image`,`forbidden`,o.message),Promise.reject(o)}).then(e=>isJsonp(e)?ajax(e,{responseType:`blob`,networkSubscribe:t.networkSubscribe}).then(e=>URL.createObjectURL(e.body)):e).then(e=>new Promise((u,d)=>{let f=s==null?new Image:s,p=!1,m=null;typeof t.timeout==`number`&&(m=window.setTimeout(()=>{var n;if(f.onload=noop,f.onerror=noop,m=null,p===!0)return;p=!0;let o=new NetworkTimeoutError(e,`Image`,t.timeout);r(o),d(o),(n=t.networkSubscribe)==null||n.emit(`network`,e,`Image`,`timeout`,o.message)},t.timeout)),f.onload=()=>{var r;if(f.onload=noop,f.onerror=noop,m!==null&&(clearTimeout(m),m=null),p===!0)return;let s=now(),d={headers:{},origin:l,source:e,requestTime:c,responseTime:s,costs:s-c};p=!0;let h={body:f,meta:d};o(1),n(h),u(h),(r=t.networkSubscribe)==null||r.emit(`network`,e,`Image`,`ok`,JSON.stringify(h.meta))},f.onerror=()=>{var n;if(f.onload=noop,f.onerror=noop,m!==null&&(clearTimeout(m),m=null),p===!0)return;p=!0;let o=new NetworkResponseError(e,`Image`,0);r(o),d(o),(n=t.networkSubscribe)==null||n.emit(`network`,e,`Image`,`ok`,o.message)},o(0),f.src=e}))}var Fetcher=class{constructor(e={}){this.options=e}ajax(e,t={},n=noop,r=noop,o=noop){var s;let c=this.options;return ajax(e,{responseType:t.responseType,timeout:(s=t.timeout)==null?c.timeout:s,get requestProxy(){var e;return(e=t.requestProxy)==null?c.requestProxy:e},get networkSubscribe(){var e;return(e=t.networkSubscribe)==null?c.networkSubscribe:e}},n,r,o)}loadImage(e,t={},n=noop,r=noop,o=noop,s){var c;let l=this.options;return loadImage(e,{timeout:(c=t.timeout)==null?l.timeout:c,get requestProxy(){var e;return(e=t.requestProxy)==null?l.requestProxy:e},get networkSubscribe(){var e;return(e=t.networkSubscribe)==null?l.networkSubscribe:e}},n,r,o,s)}preload(e,t={}){var n;let r=this.options;return preload(e,{timeout:(n=t.timeout)==null?r.timeout:n,get requestProxy(){var e;return(e=t.requestProxy)==null?r.requestProxy:e},get networkSubscribe(){var e;return(e=t.networkSubscribe)==null?r.networkSubscribe:e}})}},internalFetcher=new Fetcher;function pick(e,t){let n={};for(let r of t)r in e&&(n[r]=e[r]);return n}function omit(e,t){let n={},r=new Set(t);for(let t of Object.keys(e))r.has(t)||(n[t]=e[t]);return n}function omitUndefinedFields(e){let t={};for(let n in e){let r=e[n];r!==void 0&&(t[n]=r)}return t}var hrefAElement=typeof document<`u`?document.createElement(`a`):{href:``};function isAbsoluteURL(e){return e.indexOf(`/`)===0||/^[0-9a-z]+\:/i.test(e)}function getFullURL(e){if(typeof URL<`u`&&typeof location<`u`)return new URL(e,location.href).href;{hrefAElement.href=e;let t=hrefAElement.href;return hrefAElement.href=``,t}}function pathJoin(...e){let t=[];e=e.map(e=>(e==null?``:e).trim()).filter(e=>e.length>0&&!/^\/+$/.test(e));for(let n=0;n<e.length;n++){let r=n===0,o=n===e.length-1,s=e[n];r||(s=s.replace(/^\.\//,``).replace(/^\/+/,``)),o||(s=s.replace(/\/+$/,``)),t.push(s)}return t.join(`/`)}function appendSearch(e,t=``){if((t[0]===`?`||t[0]===`&`)&&(t=t.slice(1)),!t)return e;let n=e.indexOf(`#`),r=``;return n>=0&&(r=e.slice(n),e=e.slice(0,n)),(e[e.length-1]===`?`||e[e.length-1]===`&`)&&(e=e.slice(0,-1)),e.indexOf(`?`)>=0?`${e}&${t}${r}`:`${e}?${t}${r}`}function normalizeURL(e){var t;let n=/^(http\:|https\:|file\:)?\/\/[^/]/.exec(e);if(!n)return e;let r=n[1]||``,o=e.slice(r.length+2),s=o.indexOf(`#`);s>=0&&(e.slice(s),o=e.slice(0,s));let c=o.indexOf(`?`);c>=0&&(e.slice(c),o=e.slice(0,c));let l=o.split(`/`),u=l.shift(),d=(t=l.pop())==null?``:t,f=[];for(let e of l)if(!(e===``||e===`.`)){if(e===`..`){f.pop();continue}f.push(e)}return r+`//`+u+`/`+f.join(`/`)+`/`+d}function getExtname(e){let t=/([0-9a-z\.\_\-]+)([\?\#].*)?$/i.exec(e);if(t){let e=String(t[1]).trim().split(`.`).slice(1).reverse()[0];if(e)return`.`+e}return``}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(e){return new Promise(t=>{if(typeof Image>`u`){t(!1);return}let n=new Image,r=setTimeout(()=>{n.onload=n.onerror=()=>{},clearTimeout(r),t(!1)},100);n.onload=n.onerror=()=>{n.onload=n.onerror=()=>{},clearTimeout(r),t(n.height===2)},n.src=e})}var imageSupportCache=null;function imageSupport(){return imageSupportCache||(imageSupportCache=Promise.all([checkImage(webp),checkImage(avif),checkImage(heif)]).then(e=>({webp:e[0],avif:e[1],heif:e[2]})))}var _a$4,supportAvif=!1,supportWebp=!1,supportHeif=!1;imageSupport().then(e=>{supportAvif=e.avif,supportWebp=e.webp,supportHeif=e.heif});var IMAGE_FORMATS=[`jpg`,`jpeg`,`png`,`heif`,`heic`,`webp`,`avif`];function isImageExt(e){return IMAGE_FORMATS.indexOf(e)>=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(e){let t=e.match(URL_DOMAIN_REGEX);return t===null?null:t[1]}function replaceDomain(e,t,n){var r,o;let s=(o=(r=t[n])==null?t[t.length-1]:r)==null?e:o;return e.replace(URL_DOMAIN_REGEX,(e,t)=>e.slice(0,e.length-t.length)+s)}function route(e,t,n){let[r,...o]=t.split(`.`);if(r===`texture`)return replaceDomain(e,n.texture,0);if(r===`pano`){let[t,r]=o;switch(r){case`front`:case`left`:case`up`:return replaceDomain(e,n.pano,0);case`down`:case`right`:case`back`:return replaceDomain(e,n.pano,1);default:break}}else if(r===`pano_tile`){let[t,r,s,c,l]=o,u=Math.pow(2,Number(s))*Number(c)+Number(l);if(!isNaN(u))return replaceDomain(e,n.tile,u%2)}else if(r===`model`){let[t]=o,r=Number(t);if(!isNaN(r))return replaceDomain(e,n.model,r%2)}return replaceDomain(e,n.default,0)}var tencentCloudImageProcesser=(e,t)=>{let n=e.split(`?`)[0],r=n.split(`.`).pop();if(r===`jpeg`&&(r=`jpg`),r===`heif`&&(r=`heic`),r&&!isImageExt(r))return e;let o=[],{format:s,cut:c,quality:l,size:u,sharpen:d,forceUseExifOrientation:f}=t;if(s===`jpeg`&&(s=`jpg`),s===`heif`&&(s=`heic`),(!supportAvif&&(s==null?r:s)===`avif`||!supportWebp&&(s==null?r:s)===`webp`||!supportHeif&&(s==null?r:s)===`heic`)&&(s=`jpg`),s!==void 0&&s!==r&&o.push(`format/${s}`),c!==void 0&&o.push(`cut/${c[2]}x${c[3]}x${c[0]}x${c[1]}`),l!==void 0){let e=s==null?r:s;e&&[`jpg`,`webp`,`heic`,`avif`].indexOf(e)>=0&&o.push(`quality/${l}`)}if(u!==void 0){let t=e.match(/\/cube_(\d+)\//);(t?Number(t[1]):NaN)!==Number(u)&&o.push(`thumbnail/${u}x`)}d!==void 0&&o.push(`sharpen/${d}`),f===!0&&o.push(`auto-orient`);let p=``;return o.length&&(p=`?imageMogr2/`+o.join(`/`)),n+p},aliyunOOSImageProcesser=(e,t)=>{let n=e.split(`?`)[0],r=n.split(`.`).pop();if(r===`jpeg`&&(r=`jpg`),r===`heif`&&(r=`heic`),r&&!isImageExt(r))return e;let o=[],{format:s,cut:c,quality:l,size:u,sharpen:d}=t;if(s===`jpeg`&&(s=`jpg`),s===`heif`&&(s=`heic`),(!supportAvif&&(s==null?r:s)===`avif`||!supportWebp&&(s==null?r:s)===`webp`||!supportHeif&&(s==null?r:s)===`heic`)&&(s=`jpg`),s!==void 0&&s!==r&&o.push(`format,${s}`),c!==void 0){let[e,t,n,r]=c;o.push(`crop,x_${e},y_${t},w_${n},h_${r},g_nw`)}if(l!==void 0&&l!==100){let e=s==null?r:s;e&&[`jpg`,`webp`,`heic`,`avif`].indexOf(e)>=0&&o.push(`quality,Q_${l}`)}u&&u!==2048&&o.push(`resize,w_${u}`),d!==void 0&&o.push(`sharpen,${d}`);let f=``;return o.length&&(f=`?x-oss-process=image/`+o.join(`/`)),n+f},MAX_SAFE_INTEGER=9007199254740991;function formatNumber(e){let t=Math.round(e);return Math.abs(t-e)<.001?t:Math.floor(e)}function formatOptions(e){return e=Object.assign({},e),e.size!==void 0&&(e.size=formatNumber(clamp$1(e.size,0,MAX_SAFE_INTEGER))),e.quality!==void 0&&(e.quality=formatNumber(clamp$1(e.quality,0,100))),e.cut!==void 0&&(e.cut=[formatNumber(clamp$1(e.cut[0],0,MAX_SAFE_INTEGER)),formatNumber(clamp$1(e.cut[1],0,MAX_SAFE_INTEGER)),formatNumber(clamp$1(e.cut[2],0,MAX_SAFE_INTEGER)),formatNumber(clamp$1(e.cut[3],0,MAX_SAFE_INTEGER))]),e.sharpen!==void 0&&(e.sharpen=formatNumber(clamp$1(e.sharpen,0,MAX_SAFE_INTEGER))),e}function imageURL(e,t){let n=Object.assign(Object.assign({},DEFAULT_IMAGE_URL_MAPPINGS),t.mappings),r=getDomain(e);if(r===null)return e;t=formatOptions(t);let o=n[r];return o?(e=route(e,t.key,o),/\.basis(\?|$)/.test(e)&&(e=e.replace(/\.basis(\?|$)/,`.jpg$1`)),o.type===`tencentCloud`?tencentCloudImageProcesser(e,t):o.type===`aliyun`?aliyunOOSImageProcesser(e,t):e):e}function applyImageURLOptions(e,t=imageURL,n){let r=t(e,n);if(r===e&&n.cut)throw Error(`ImageURL: cut option not applied.`);return r}var IMAGE_SIZE_REG=/\/cube_(\d+)\//;function getImageSizeFromURL(e){let t=e.match(IMAGE_SIZE_REG);return t?Number(t[1]):null}function replaceImageSize(e,t){return e.replace(IMAGE_SIZE_REG,`/cube_${t}/`)}var log2=(_a$4=Math.log2)==null?(e=>Math.log(e)*Math.LOG2E):_a$4;function getImageSizeLevel(e){return Math.floor(Math.max(log2(e/512),0))}var windowSTOContext=(()=>{let e=now();return{requestAnimationFrame(t){let n=now(),r=clamp$1(16+(n-e),16,33),o=setTimeout(function(){t(dateNowToDomHighResTimeStamp(n+r))},r);return e=n+r,o},cancelAnimationFrame:e=>clearTimeout(e)}})(),windowRAFContext=typeof requestAnimationFrame==`function`&&typeof cancelAnimationFrame==`function`?{requestAnimationFrame:e=>requestAnimationFrame(e),cancelAnimationFrame:e=>cancelAnimationFrame(e)}:windowSTOContext,DEFAULT_ORDER=5,deviceFrameTime=16,AnimationFrameLoop=class e{static get shared(){return this.sharedInstance||(this.sharedInstance=new e),this.sharedInstance}static getFrameTime(){return deviceFrameTime}constructor(){this.loopType=`raf`,this.frames=[],this.isAnimating=!1,this.context=null;let e=now();this.loop=(...t)=>{if(this.isAnimating===!1)return;let n=now(),r=Math.max(n-e,0);e=n,deviceFrameTime=r;let o=this.frames.slice();for(let e=0;e<o.length;e++){let s=o[e];if(s.delay>0){--s.delay;continue}try{s.callback(n,r,...t)}catch(e){console.error(e)}s.calls++}for(let e=this.frames.length-1;e>=0;e--){let t=this.frames[e];t.once&&t.calls>0&&this.frames.splice(e,1)}this.requestId=this.requestAnimationFrame(this.loop)},this.start()}start(){this.isAnimating!==!0&&(this.isAnimating=!0,this.requestId=this.requestAnimationFrame(this.loop))}stop(){this.isAnimating=!1,this.cancelAnimationFrame(this.requestId)}setContext(e){e!==this.context&&(this.stop(),this.context=e,this.start())}getContext(){return this.context}setLoopType(e){e!==this.loopType&&(this.stop(),this.loopType=e,this.start())}getLoopType(){return this.loopType}requestAnimationFrame(e){let t;if(this.context?t=this.context:this.loopType===`raf`?t=windowRAFContext:this.loopType===`sto`&&(t=windowSTOContext),t)return t.requestAnimationFrame(e)}cancelAnimationFrame(e){let t;this.context?t=this.context:this.loopType===`raf`?t=windowRAFContext:this.loopType===`sto`&&(t=windowSTOContext),t&&t.cancelAnimationFrame(e)}remove(e){let t=this.frames.indexOf(e);t>=0&&this.frames.splice(t,1)}add(e,t=!1,n=0,r=DEFAULT_ORDER){let o={callback:e,once:t,delay:n,order:r,calls:0},s=this.frames.length;for(;--s>=0;)if(this.frames[s].order<=r){this.frames.splice(s+1,0,o);break}return s<0&&this.frames.unshift(o),()=>this.remove(o)}clear(){this.frames.length=0}},browserSupportsImageBitmapApi=typeof createImageBitmap<`u`&&typeof ImageBitmap<`u`,_useNativeImageBitmap=!1;function useNativeImageBitmap(e){_useNativeImageBitmap=e}function canUseNativeImageBitmap(){return _useNativeImageBitmap===!1?!1:browserSupportsImageBitmapApi}function createImageBitmapLikeImage(e={}){let t=e.onClose;return Object.assign(document.createElementNS(`http://www.w3.org/1999/xhtml`,`img`),{crossOrigin:``,close(){t&&t.call(this),this.onerror=this.onload=this.close=noop,this.removeAttribute(`src`),t=void 0}})}function createImageBitmapLike(e){if(canUseNativeImageBitmap())return createImageBitmap(e);{let t=URL.createObjectURL(e),n=function(){this.src===t&&URL.revokeObjectURL(t)};return new Promise((e,r)=>{let o=createImageBitmapLikeImage({onClose:n});o.onload=()=>{o.src===t&&URL.revokeObjectURL(t),o.onload=o.onerror=noop,AnimationFrameLoop.shared.add(()=>{e(o)},!0)},o.onerror=()=>{let e=o.src;o.onload=o.onerror=noop,o.close(),r(Error(`image load error: ${e}`))},o.decoding=`async`,o.src=t})}}var canvasPool=[];function createCanvas(e,t){let n=canvasPool.pop();if(n)return n.width=e,n.height=t,n;let r=Object.assign(document.createElementNS(`http://www.w3.org/1999/xhtml`,`canvas`),{close:()=>{r.close=noop,canvasPool.push(r)}});return r}function imageBitmapToTexture(e,t){if(t&&(e.width>t.width||e.height>t.height)){let n=createCanvas(Math.min(e.width,t.width),Math.min(e.height,t.height)),r=n.getContext(`2d`);r.clearRect(0,0,n.width,n.height),r.drawImage(e,0,0,n.width,n.height),e.close();let o=new three.Texture(n);o.needsUpdate=!0,o.flipY=!0;let s=o.dispose;return o.dispose=function(){n.close(),s.call(o),o.dispose=s},o}else{let t=new three.Texture(e);t.needsUpdate=!0,typeof ImageBitmap<`u`&&e instanceof ImageBitmap?t.flipY=!1:t.flipY=!0,t.flipY===!1&&(t.repeat.y*=-1,t.offset.y+=1,t.updateMatrix());let n=t.dispose;return t.dispose=function(){this.image&&this.image.close(),n.call(t),t.dispose=n},t}}function imageBitmapsToCubeTexture(e){let t=new three.CubeTexture(e);t.needsUpdate=!0,t.flipY=!1;let n=t.dispose;return t.dispose=function(){if(Array.isArray(this.images))for(let e of this.images)e.close();n.call(t),t.dispose=n},t}var FACE_ORDER$2=[`right`,`left`,`up`,`down`,`front`,`back`],TextureLoader=class{loadTexture(e,t,n=noop,r=noop,o=noop,s){var c,l,u,d,f,p,m;let h={};if(t.flipY!==void 0&&(h.flipY=t.flipY),t.format!==void 0)h.format=t.format;else{let t=getExtname(e);(t===`.jpg`||t===`.jpeg`)&&(h.format=three.RGBFormat)}t.encoding!==void 0&&(h.encoding=t.encoding),h.generateMipmaps=(c=t.generateMipmaps)==null?!1:c,h.minFilter=(l=t.minFilter)==null?three.LinearFilter:l,h.magFilter=(u=t.magFilter)==null?three.LinearFilter:u,t.wrapS&&(h.wrapS=t.wrapS),t.wrapT&&(h.wrapT=t.wrapT);let g=(f=(d=t.imageURL)==null?void 0:d.options)==null?{key:`unknown`}:f;if(e=applyImageURLOptions(e,(p=t.imageURL)==null?void 0:p.transform,g),(m=t.viaAjax)==null?canUseNativeImageBitmap:m){let s=null;return t.fetcher.ajax(e,{timeout:t.timeout,responseType:`blob`},void 0,void 0,o).then(e=>createImageBitmapLike(e.body)).then(e=>imageBitmapToTexture(e,t.maxSize)).then(e=>(Object.assign(e,h),e)).then(e=>{let t={meta:null,body:e};return n(t),t}).catch(e=>(r(e),Promise.reject(e)))}else{let s=null,c;return Promise.resolve().then(()=>createImageBitmapLikeImage()).then(n=>(c=n,t.fetcher.loadImage(e,{timeout:t.timeout},void 0,void 0,o,n))).then(e=>(s=e.meta,imageBitmapToTexture(e.body,t.maxSize))).then(e=>(Object.assign(e,h),e)).then(e=>{let t={meta:s,body:e};return n(t),t}).catch(e=>(c&&c.close(),r(e),Promise.reject(e)))}}loadCubeTexture(e,t,n=noop,r=noop,o=noop,s){var c,l,u,d,f,p,m;let h={};if(t.format!==void 0)h.format=t.format;else{let t=!0;for(let n of FACE_ORDER$2){let r=getExtname(e[n]);if(r!==`.jpg`&&r!==`.jpeg`){t=!1;break}}t&&(h.format=three.RGBFormat)}h.generateMipmaps=(c=t.generateMipmaps)==null?!1:c,h.minFilter=(l=t.minFilter)==null?three.LinearFilter:l,h.magFilter=(u=t.magFilter)==null?three.LinearFilter:u,t.wrapS&&(h.wrapS=t.wrapS),t.wrapT&&(h.wrapT=t.wrapT);let g=[e[FACE_ORDER$2[0]],e[FACE_ORDER$2[1]],e[FACE_ORDER$2[2]],e[FACE_ORDER$2[3]],e[FACE_ORDER$2[4]],e[FACE_ORDER$2[5]]],_=[],v=[0,0,0,0,0,0],y=[];for(let e=0;e<6;e++){let n=(f=(d=t.imageURL)==null?void 0:d.options)==null?{key:`unknown`}:f,r=applyImageURLOptions(g[e],(p=t.imageURL)==null?void 0:p.transform,Object.assign(Object.assign({},n),{key:n.key+`.`+FACE_ORDER$2[e]})),s=t=>{v[e]=t,o(v.reduce((e,t)=>e+t,0)/6)};if((m=t.viaAjax)!=null&&m){let n=t.fetcher.ajax(r,{timeout:t.timeout,responseType:`blob`},void 0,void 0,s).then(t=>(y[e]=t.meta,createImageBitmapLike(t.body)));_.push(n)}else{let n,o=Promise.resolve().then(()=>createImageBitmapLikeImage()).then(e=>(n=e,t.fetcher.loadImage(r,{timeout:t.timeout},void 0,void 0,s,e))).then(t=>(y[e]=t.meta,t.body)).catch(e=>(n&&n.close(),Promise.reject(e)));_.push(o)}}return Promise.all(_).then(e=>imageBitmapsToCubeTexture(e)).then(e=>(Object.assign(e,Object.assign({encoding:three.sRGBEncoding},h)),e)).then(e=>{let t={body:e,meta:y};return n(t),t}).catch(e=>{for(let e of _)e.then(e=>e.close()).catch(noop);return r(e),Promise.reject(e)})}},require_aspromise=__commonJSMin(((e,t)=>{t.exports=n;function n(e,t){for(var n=Array(arguments.length-1),r=0,o=2,s=!0;o<arguments.length;)n[r++]=arguments[o++];return new Promise(function(o,c){n[r]=function(e){if(s)if(s=!1,e)c(e);else{for(var t=Array(arguments.length-1),n=0;n<t.length;)t[n++]=arguments[n];o.apply(null,t)}};try{e.apply(t||null,n)}catch(e){s&&(s=!1,c(e))}})}})),require_base64=__commonJSMin((e=>{var t=e;t.length=function(e){var t=e.length;if(!t)return 0;for(var n=0;--t%4>1&&e.charAt(t)===`=`;)++n;return Math.ceil(e.length*3)/4-n};for(var n=Array(64),r=Array(123),o=0;o<64;)r[n[o]=o<26?o+65:o<52?o+71:o<62?o-4:o-59|43]=o++;t.encode=function(e,t,r){for(var o=null,s=[],c=0,l=0,u;t<r;){var d=e[t++];switch(l){case 0:s[c++]=n[d>>2],u=(d&3)<<4,l=1;break;case 1:s[c++]=n[u|d>>4],u=(d&15)<<2,l=2;break;case 2:s[c++]=n[u|d>>6],s[c++]=n[d&63],l=0;break}c>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,s)),c=0)}return l&&(s[c++]=n[u],s[c++]=61,l===1&&(s[c++]=61)),o?(c&&o.push(String.fromCharCode.apply(String,s.slice(0,c))),o.join(``)):String.fromCharCode.apply(String,s.slice(0,c))};var s=`invalid encoding`;t.decode=function(e,t,n){for(var o=n,c=0,l,u=0;u<e.length;){var d=e.charCodeAt(u++);if(d===61&&c>1)break;if((d=r[d])===void 0)throw Error(s);switch(c){case 0:l=d,c=1;break;case 1:t[n++]=l<<2|(d&48)>>4,l=d,c=2;break;case 2:t[n++]=(l&15)<<4|(d&60)>>2,l=d,c=3;break;case 3:t[n++]=(l&3)<<6|d,c=0;break}}if(c===1)throw Error(s);return n-o},t.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}})),require_eventemitter=__commonJSMin(((e,t)=>{t.exports=n;function n(){this._listeners={}}n.prototype.on=function(e,t,n){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:n||this}),this},n.prototype.off=function(e,t){if(e===void 0)this._listeners={};else if(t===void 0)this._listeners[e]=[];else for(var n=this._listeners[e],r=0;r<n.length;)n[r].fn===t?n.splice(r,1):++r;return this},n.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var n=[],r=1;r<arguments.length;)n.push(arguments[r++]);for(r=0;r<t.length;)t[r].fn.apply(t[r++].ctx,n)}return this}})),require_float=__commonJSMin(((e,t)=>{t.exports=n(n);function n(e){return typeof Float32Array<`u`?(function(){var t=new Float32Array([-0]),n=new Uint8Array(t.buffer),r=n[3]===128;function o(e,r,o){t[0]=e,r[o]=n[0],r[o+1]=n[1],r[o+2]=n[2],r[o+3]=n[3]}function s(e,r,o){t[0]=e,r[o]=n[3],r[o+1]=n[2],r[o+2]=n[1],r[o+3]=n[0]}e.writeFloatLE=r?o:s,e.writeFloatBE=r?s:o;function c(e,r){return n[0]=e[r],n[1]=e[r+1],n[2]=e[r+2],n[3]=e[r+3],t[0]}function l(e,r){return n[3]=e[r],n[2]=e[r+1],n[1]=e[r+2],n[0]=e[r+3],t[0]}e.readFloatLE=r?c:l,e.readFloatBE=r?l:c})():(function(){function t(e,t,n,r){var o=+(t<0);if(o&&(t=-t),t===0)e(1/t>0?0:2147483648,n,r);else if(isNaN(t))e(2143289344,n,r);else if(t>34028234663852886e22)e((o<<31|2139095040)>>>0,n,r);else if(t<11754943508222875e-54)e((o<<31|Math.round(t/1401298464324817e-60))>>>0,n,r);else{var s=Math.floor(Math.log(t)/Math.LN2),c=Math.round(t*Math.pow(2,-s)*8388608)&8388607;e((o<<31|s+127<<23|c)>>>0,n,r)}}e.writeFloatLE=t.bind(null,r),e.writeFloatBE=t.bind(null,o);function n(e,t,n){var r=e(t,n),o=(r>>31)*2+1,s=r>>>23&255,c=r&8388607;return s===255?c?NaN:o*(1/0):s===0?o*1401298464324817e-60*c:o*Math.pow(2,s-150)*(c+8388608)}e.readFloatLE=n.bind(null,s),e.readFloatBE=n.bind(null,c)})(),typeof Float64Array<`u`?(function(){var t=new Float64Array([-0]),n=new Uint8Array(t.buffer),r=n[7]===128;function o(e,r,o){t[0]=e,r[o]=n[0],r[o+1]=n[1],r[o+2]=n[2],r[o+3]=n[3],r[o+4]=n[4],r[o+5]=n[5],r[o+6]=n[6],r[o+7]=n[7]}function s(e,r,o){t[0]=e,r[o]=n[7],r[o+1]=n[6],r[o+2]=n[5],r[o+3]=n[4],r[o+4]=n[3],r[o+5]=n[2],r[o+6]=n[1],r[o+7]=n[0]}e.writeDoubleLE=r?o:s,e.writeDoubleBE=r?s:o;function c(e,r){return n[0]=e[r],n[1]=e[r+1],n[2]=e[r+2],n[3]=e[r+3],n[4]=e[r+4],n[5]=e[r+5],n[6]=e[r+6],n[7]=e[r+7],t[0]}function l(e,r){return n[7]=e[r],n[6]=e[r+1],n[5]=e[r+2],n[4]=e[r+3],n[3]=e[r+4],n[2]=e[r+5],n[1]=e[r+6],n[0]=e[r+7],t[0]}e.readDoubleLE=r?c:l,e.readDoubleBE=r?l:c})():(function(){function t(e,t,n,r,o,s){var c=+(r<0);if(c&&(r=-r),r===0)e(0,o,s+t),e(1/r>0?0:2147483648,o,s+n);else if(isNaN(r))e(0,o,s+t),e(2146959360,o,s+n);else if(r>17976931348623157e292)e(0,o,s+t),e((c<<31|2146435072)>>>0,o,s+n);else{var l;if(r<22250738585072014e-324)l=r/5e-324,e(l>>>0,o,s+t),e((c<<31|l/4294967296)>>>0,o,s+n);else{var u=Math.floor(Math.log(r)/Math.LN2);u===1024&&(u=1023),l=r*Math.pow(2,-u),e(l*4503599627370496>>>0,o,s+t),e((c<<31|u+1023<<20|l*1048576&1048575)>>>0,o,s+n)}}}e.writeDoubleLE=t.bind(null,r,0,4),e.writeDoubleBE=t.bind(null,o,4,0);function n(e,t,n,r,o){var s=e(r,o+t),c=e(r,o+n),l=(c>>31)*2+1,u=c>>>20&2047,d=4294967296*(c&1048575)+s;return u===2047?d?NaN:l*(1/0):u===0?l*5e-324*d:l*Math.pow(2,u-1075)*(d+4503599627370496)}e.readDoubleLE=n.bind(null,s,0,4),e.readDoubleBE=n.bind(null,c,4,0)})(),e}function r(e,t,n){t[n]=e&255,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}function o(e,t,n){t[n]=e>>>24,t[n+1]=e>>>16&255,t[n+2]=e>>>8&255,t[n+3]=e&255}function s(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function c(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}})),require_inquire=__commonJSMin(((exports,module)=>{module.exports=inquire;function inquire(moduleName){try{var mod=eval(`quire`.replace(/^/,`re`))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}})),require_utf8=__commonJSMin((e=>{var t=e;t.length=function(e){for(var t=0,n=0,r=0;r<e.length;++r)n=e.charCodeAt(r),n<128?t+=1:n<2048?t+=2:(n&64512)==55296&&(e.charCodeAt(r+1)&64512)==56320?(++r,t+=4):t+=3;return t},t.read=function(e,t,n){if(n-t<1)return``;for(var r=null,o=[],s=0,c;t<n;)c=e[t++],c<128?o[s++]=c:c>191&&c<224?o[s++]=(c&31)<<6|e[t++]&63:c>239&&c<365?(c=((c&7)<<18|(e[t++]&63)<<12|(e[t++]&63)<<6|e[t++]&63)-65536,o[s++]=55296+(c>>10),o[s++]=56320+(c&1023)):o[s++]=(c&15)<<12|(e[t++]&63)<<6|e[t++]&63,s>8191&&((r||(r=[])).push(String.fromCharCode.apply(String,o)),s=0);return r?(s&&r.push(String.fromCharCode.apply(String,o.slice(0,s))),r.join(``)):String.fromCharCode.apply(String,o.slice(0,s))},t.write=function(e,t,n){for(var r=n,o,s,c=0;c<e.length;++c)o=e.charCodeAt(c),o<128?t[n++]=o:o<2048?(t[n++]=o>>6|192,t[n++]=o&63|128):(o&64512)==55296&&((s=e.charCodeAt(c+1))&64512)==56320?(o=65536+((o&1023)<<10)+(s&1023),++c,t[n++]=o>>18|240,t[n++]=o>>12&63|128,t[n++]=o>>6&63|128,t[n++]=o&63|128):(t[n++]=o>>12|224,t[n++]=o>>6&63|128,t[n++]=o&63|128);return n-r}})),require_pool=__commonJSMin(((e,t)=>{t.exports=n;function n(e,t,n){var r=n||8192,o=r>>>1,s=null,c=r;return function(n){if(n<1||n>o)return e(n);c+n>r&&(s=e(r),c=0);var l=t.call(s,c,c+=n);return c&7&&(c=(c|7)+1),l}}})),require_longbits=__commonJSMin(((e,t)=>{t.exports=r;var n=require_minimal$1();function r(e,t){this.lo=e>>>0,this.hi=t>>>0}var o=r.zero=new r(0,0);o.toNumber=function(){return 0},o.zzEncode=o.zzDecode=function(){return this},o.length=function(){return 1};var s=r.zeroHash=`\0\0\0\0\0\0\0\0`;r.fromNumber=function(e){if(e===0)return o;var t=e<0;t&&(e=-e);var n=e>>>0,s=(e-n)/4294967296>>>0;return t&&(s=~s>>>0,n=~n>>>0,++n>4294967295&&(n=0,++s>4294967295&&(s=0))),new r(n,s)},r.from=function(e){if(typeof e==`number`)return r.fromNumber(e);if(n.isString(e))if(n.Long)e=n.Long.fromString(e);else return r.fromNumber(parseInt(e,10));return e.low||e.high?new r(e.low>>>0,e.high>>>0):o},r.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=~this.lo+1>>>0,n=~this.hi>>>0;return t||(n=n+1>>>0),-(t+n*4294967296)}return this.lo+this.hi*4294967296},r.prototype.toLong=function(e){return n.Long?new n.Long(this.lo|0,this.hi|0,!!e):{low:this.lo|0,high:this.hi|0,unsigned:!!e}};var c=String.prototype.charCodeAt;r.fromHash=function(e){return e===s?o:new r((c.call(e,0)|c.call(e,1)<<8|c.call(e,2)<<16|c.call(e,3)<<24)>>>0,(c.call(e,4)|c.call(e,5)<<8|c.call(e,6)<<16|c.call(e,7)<<24)>>>0)},r.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)},r.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},r.prototype.zzDecode=function(){var e=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},r.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return n===0?t===0?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:n<128?9:10}})),require_minimal$1=__commonJSMin((e=>{var t=e;t.asPromise=require_aspromise(),t.base64=require_base64(),t.EventEmitter=require_eventemitter(),t.float=require_float(),t.inquire=require_inquire(),t.utf8=require_utf8(),t.pool=require_pool(),t.LongBits=require_longbits(),t.isNode=!!(typeof global<`u`&&global&&global.process&&global.process.versions&&global.process.versions.node),t.global=t.isNode&&global||typeof window<`u`&&window||typeof self<`u`&&self||e,t.emptyArray=Object.freeze?Object.freeze([]):[],t.emptyObject=Object.freeze?Object.freeze({}):{},t.isInteger=Number.isInteger||function(e){return typeof e==`number`&&isFinite(e)&&Math.floor(e)===e},t.isString=function(e){return typeof e==`string`||e instanceof String},t.isObject=function(e){return e&&typeof e==`object`},t.isset=t.isSet=function(e,t){var n=e[t];return n!=null&&e.hasOwnProperty(t)?typeof n!=`object`||(Array.isArray(n)?n.length:Object.keys(n).length)>0:!1},t.Buffer=(function(){try{var e=t.inquire(`buffer`).Buffer;return e.prototype.utf8Write?e:null}catch(e){return null}})(),t._Buffer_from=null,t._Buffer_allocUnsafe=null,t.newBuffer=function(e){return typeof e==`number`?t.Buffer?t._Buffer_allocUnsafe(e):new t.Array(e):t.Buffer?t._Buffer_from(e):typeof Uint8Array>`u`?e:new Uint8Array(e)},t.Array=typeof Uint8Array<`u`?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(e){return e?t.LongBits.from(e).toHash():t.LongBits.zeroHash},t.longFromHash=function(e,n){var r=t.LongBits.fromHash(e);return t.Long?t.Long.fromBits(r.lo,r.hi,n):r.toNumber(!!n)};function n(e,t,n){for(var r=Object.keys(t),o=0;o<r.length;++o)(e[r[o]]===void 0||!n)&&(e[r[o]]=t[r[o]]);return e}t.merge=n,t.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)};function r(e){function t(e,r){if(!(this instanceof t))return new t(e,r);Object.defineProperty(this,`message`,{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,`stack`,{value:Error().stack||``}),r&&n(this,r)}return t.prototype=Object.create(Error.prototype,{constructor:{value:t,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return e},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+`: `+this.message},writable:!0,enumerable:!1,configurable:!0}}),t}t.newError=r,t.ProtocolError=r(`ProtocolError`),t.oneOfGetter=function(e){for(var t={},n=0;n<e.length;++n)t[e[n]]=1;return function(){for(var e=Object.keys(this),n=e.length-1;n>-1;--n)if(t[e[n]]===1&&this[e[n]]!==void 0&&this[e[n]]!==null)return e[n]}},t.oneOfSetter=function(e){return function(t){for(var n=0;n<e.length;++n)e[n]!==t&&delete this[e[n]]}},t.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},t._configure=function(){var e=t.Buffer;if(!e){t._Buffer_from=t._Buffer_allocUnsafe=null;return}t._Buffer_from=e.from!==Uint8Array.from&&e.from||function(t,n){return new e(t,n)},t._Buffer_allocUnsafe=e.allocUnsafe||function(t){return new e(t)}}})),require_writer=__commonJSMin(((e,t)=>{t.exports=f;var n=require_minimal$1(),r,o=n.LongBits,s=n.base64,c=n.utf8;function l(e,t,n){this.fn=e,this.len=t,this.next=void 0,this.val=n}function u(){}function d(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function f(){this.len=0,this.head=new l(u,0,0),this.tail=this.head,this.states=null}var p=function(){return n.Buffer?function(){return(f.create=function(){return new r})()}:function(){return new f}};f.create=p(),f.alloc=function(e){return new n.Array(e)},n.Array!==Array&&(f.alloc=n.pool(f.alloc,n.Array.prototype.subarray)),f.prototype._push=function(e,t,n){return this.tail=this.tail.next=new l(e,t,n),this.len+=t,this};function m(e,t,n){t[n]=e&255}function h(e,t,n){for(;e>127;)t[n++]=e&127|128,e>>>=7;t[n]=e}function g(e,t){this.len=e,this.next=void 0,this.val=t}g.prototype=Object.create(l.prototype),g.prototype.fn=h,f.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new g((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},f.prototype.int32=function(e){return e<0?this._push(_,10,o.fromNumber(e)):this.uint32(e)},f.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)};function _(e,t,n){for(;e.hi;)t[n++]=e.lo&127|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[n++]=e.lo&127|128,e.lo>>>=7;t[n++]=e.lo}f.prototype.uint64=function(e){var t=o.from(e);return this._push(_,t.length(),t)},f.prototype.int64=f.prototype.uint64,f.prototype.sint64=function(e){var t=o.from(e).zzEncode();return this._push(_,t.length(),t)},f.prototype.bool=function(e){return this._push(m,1,+!!e)};function v(e,t,n){t[n]=e&255,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}f.prototype.fixed32=function(e){return this._push(v,4,e>>>0)},f.prototype.sfixed32=f.prototype.fixed32,f.prototype.fixed64=function(e){var t=o.from(e);return this._push(v,4,t.lo)._push(v,4,t.hi)},f.prototype.sfixed64=f.prototype.fixed64,f.prototype.float=function(e){return this._push(n.float.writeFloatLE,4,e)},f.prototype.double=function(e){return this._push(n.float.writeDoubleLE,8,e)};var y=n.Array.prototype.set?function(e,t,n){t.set(e,n)}:function(e,t,n){for(var r=0;r<e.length;++r)t[n+r]=e[r]};f.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this._push(m,1,0);if(n.isString(e)){var r=f.alloc(t=s.length(e));s.decode(e,r,0),e=r}return this.uint32(t)._push(y,t,e)},f.prototype.string=function(e){var t=c.length(e);return t?this.uint32(t)._push(c.write,t,e):this._push(m,1,0)},f.prototype.fork=function(){return this.states=new d(this),this.head=this.tail=new l(u,0,0),this.len=0,this},f.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 l(u,0,0),this.len=0),this},f.prototype.ldelim=function(){var e=this.head,t=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=e.next,this.tail=t,this.len+=n),this},f.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),n=0;e;)e.fn(e.val,t,n),n+=e.len,e=e.next;return t},f._configure=function(e){r=e,f.create=p(),r._configure()}})),require_writer_buffer=__commonJSMin(((e,t)=>{t.exports=o;var n=require_writer();(o.prototype=Object.create(n.prototype)).constructor=o;var r=require_minimal$1();function o(){n.call(this)}o._configure=function(){o.alloc=r._Buffer_allocUnsafe,o.writeBytesBuffer=r.Buffer&&r.Buffer.prototype instanceof Uint8Array&&r.Buffer.prototype.set.name===`set`?function(e,t,n){t.set(e,n)}:function(e,t,n){if(e.copy)e.copy(t,n,0,e.length);else for(var r=0;r<e.length;)t[n++]=e[r++]}},o.prototype.bytes=function(e){r.isString(e)&&(e=r._Buffer_from(e,`base64`));var t=e.length>>>0;return this.uint32(t),t&&this._push(o.writeBytesBuffer,t,e),this};function s(e,t,n){e.length<40?r.utf8.write(e,t,n):t.utf8Write?t.utf8Write(e,n):t.write(e,n)}o.prototype.string=function(e){var t=r.Buffer.byteLength(e);return this.uint32(t),t&&this._push(s,t,e),this},o._configure()})),require_reader=__commonJSMin(((e,t)=>{t.exports=l;var n=require_minimal$1(),r,o=n.LongBits,s=n.utf8;function c(e,t){return RangeError(`index out of range: `+e.pos+` + `+(t||1)+` > `+e.len)}function l(e){this.buf=e,this.pos=0,this.len=e.length}var u=typeof Uint8Array<`u`?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new l(e);throw Error(`illegal buffer`)}:function(e){if(Array.isArray(e))return new l(e);throw Error(`illegal buffer`)},d=function(){return n.Buffer?function(e){return(l.create=function(e){return n.Buffer.isBuffer(e)?new r(e):u(e)})(e)}:u};l.create=d(),l.prototype._slice=n.Array.prototype.subarray||n.Array.prototype.slice,l.prototype.uint32=(function(){var e=4294967295;return function(){if(e=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(e=(e|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return e;if((this.pos+=5)>this.len)throw this.pos=this.len,c(this,10);return e}})(),l.prototype.int32=function(){return this.uint32()|0},l.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(e&1)|0};function f(){var e=new o(0,0),t=0;if(this.len-this.pos>4){for(;t<4;++t)if(e.lo=(e.lo|(this.buf[this.pos]&127)<<t*7)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(this.buf[this.pos]&127)<<28)>>>0,e.hi=(e.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return e;t=0}else{for(;t<3;++t){if(this.pos>=this.len)throw c(this);if(e.lo=(e.lo|(this.buf[this.pos]&127)<<t*7)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(this.buf[this.pos++]&127)<<t*7)>>>0,e}if(this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(this.buf[this.pos]&127)<<t*7+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw c(this);if(e.hi=(e.hi|(this.buf[this.pos]&127)<<t*7+3)>>>0,this.buf[this.pos++]<128)return e}throw Error(`invalid varint encoding`)}l.prototype.bool=function(){return this.uint32()!==0};function p(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}l.prototype.fixed32=function(){if(this.pos+4>this.len)throw c(this,4);return p(this.buf,this.pos+=4)},l.prototype.sfixed32=function(){if(this.pos+4>this.len)throw c(this,4);return p(this.buf,this.pos+=4)|0};function m(){if(this.pos+8>this.len)throw c(this,8);return new o(p(this.buf,this.pos+=4),p(this.buf,this.pos+=4))}l.prototype.float=function(){if(this.pos+4>this.len)throw c(this,4);var e=n.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},l.prototype.double=function(){if(this.pos+8>this.len)throw c(this,4);var e=n.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},l.prototype.bytes=function(){var e=this.uint32(),t=this.pos,r=this.pos+e;if(r>this.len)throw c(this,e);if(this.pos+=e,Array.isArray(this.buf))return this.buf.slice(t,r);if(t===r){var o=n.Buffer;return o?o.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,t,r)},l.prototype.string=function(){var e=this.bytes();return s.read(e,0,e.length)},l.prototype.skip=function(e){if(typeof e==`number`){if(this.pos+e>this.len)throw c(this,e);this.pos+=e}else do if(this.pos>=this.len)throw c(this);while(this.buf[this.pos++]&128);return this},l.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(e=this.uint32()&7)!=4;)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error(`invalid wire type `+e+` at offset `+this.pos)}return this},l._configure=function(e){r=e,l.create=d(),r._configure();var t=n.Long?`toLong`:`toNumber`;n.merge(l.prototype,{int64:function(){return f.call(this)[t](!1)},uint64:function(){return f.call(this)[t](!0)},sint64:function(){return f.call(this).zzDecode()[t](!1)},fixed64:function(){return m.call(this)[t](!0)},sfixed64:function(){return m.call(this)[t](!1)}})}})),require_reader_buffer=__commonJSMin(((e,t)=>{t.exports=o;var n=require_reader();(o.prototype=Object.create(n.prototype)).constructor=o;var r=require_minimal$1();function o(e){n.call(this,e)}o._configure=function(){r.Buffer&&(o.prototype._slice=r.Buffer.prototype.slice)},o.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString(`utf-8`,this.pos,this.pos=Math.min(this.pos+e,this.len))},o._configure()})),require_service=__commonJSMin(((e,t)=>{t.exports=r;var n=require_minimal$1();(r.prototype=Object.create(n.EventEmitter.prototype)).constructor=r;function r(e,t,r){if(typeof e!=`function`)throw TypeError(`rpcImpl must be a function`);n.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=!!t,this.responseDelimited=!!r}r.prototype.rpcCall=function e(t,r,o,s,c){if(!s)throw TypeError(`request must be specified`);var l=this;if(!c)return n.asPromise(e,l,t,r,o,s);if(!l.rpcImpl){setTimeout(function(){c(Error(`already ended`))},0);return}try{return l.rpcImpl(t,r[l.requestDelimited?`encodeDelimited`:`encode`](s).finish(),function(e,n){if(e)return l.emit(`error`,e,t),c(e);if(n===null){l.end(!0);return}if(!(n instanceof o))try{n=o[l.responseDelimited?`decodeDelimited`:`decode`](n)}catch(e){return l.emit(`error`,e,t),c(e)}return l.emit(`data`,n,t),c(null,n)})}catch(e){l.emit(`error`,e,t),setTimeout(function(){c(e)},0);return}},r.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit(`end`).off()),this}})),require_rpc=__commonJSMin((e=>{var t=e;t.Service=require_service()})),require_roots=__commonJSMin(((e,t)=>{t.exports={}})),require_index_minimal=__commonJSMin((e=>{var t=e;t.build=`minimal`,t.Writer=require_writer(),t.BufferWriter=require_writer_buffer(),t.Reader=require_reader(),t.BufferReader=require_reader_buffer(),t.util=require_minimal$1(),t.rpc=require_rpc(),t.roots=require_roots(),t.configure=n;function n(){t.util._configure(),t.Writer._configure(t.BufferWriter),t.Reader._configure(t.BufferReader)}n()})),require_minimal=__commonJSMin(((e,t)=>{t.exports=require_index_minimal()})),import_minimal=__toESM(require_minimal(),1),$Reader$1=import_minimal.Reader,$util$1=import_minimal.util,$root$1=import_minimal.roots[`@REALSEE/FIVE:five/model/loaders/protobuf/pbm.proto`]||(import_minimal.roots[`@REALSEE/FIVE:five/model/loaders/protobuf/pbm.proto`]={}),Model$2=$root$1.Model=(()=>{function e(e){if(this.chunks=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)e[t[n]]!=null&&(this[t[n]]=e[t[n]])}return e.prototype.chunks=$util$1.emptyArray,e.prototype.createAt=$util$1.Long?$util$1.Long.fromBits(0,0,!0):0,e.prototype.description=``,e.decode=function(e,t,n){e instanceof $Reader$1||(e=$Reader$1.create(e));let r=t===void 0?e.len:e.pos+t,o=new $root$1.Model;for(;e.pos<r;){let t=e.uint32();if(t===n)break;switch(t>>>3){case 1:o.chunks&&o.chunks.length||(o.chunks=[]),o.chunks.push($root$1.Chunk.decode(e,e.uint32()));break;case 2:o.createAt=e.uint64();break;case 3:o.description=e.string();break;default:e.skipType(t&7);break}}return o},e.getTypeUrl=function(e){return e===void 0&&(e=`type.googleapis.com`),e+`/Model`},e})(),Chunk$1=$root$1.Chunk=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)e[t[n]]!=null&&(this[t[n]]=e[t[n]])}return e.prototype.vertices=null,e.prototype.faces=null,e.prototype.name=``,e.prototype.texture=``,e.decode=function(e,t,n){e instanceof $Reader$1||(e=$Reader$1.create(e));let r=t===void 0?e.len:e.pos+t,o=new $root$1.Chunk;for(;e.pos<r;){let t=e.uint32();if(t===n)break;switch(t>>>3){case 1:o.vertices=$root$1.Vertices.decode(e,e.uint32());break;case 2:o.faces=$root$1.Faces.decode(e,e.uint32());break;case 3:o.name=e.string();break;case 4:o.texture=e.string();break;default:e.skipType(t&7);break}}if(!o.hasOwnProperty(`vertices`))throw $util$1.ProtocolError(`missing required 'vertices'`,{instance:o});if(!o.hasOwnProperty(`faces`))throw $util$1.ProtocolError(`missing required 'faces'`,{instance:o});if(!o.hasOwnProperty(`name`))throw $util$1.ProtocolError(`missing required 'name'`,{instance:o});return o},e.getTypeUrl=function(e){return e===void 0&&(e=`type.googleapis.com`),e+`/Chunk`},e})(),Vertices=$root$1.Vertices=(()=>{function e(e){if(this.xyz=[],this.uvs=[],this.marks=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)e[t[n]]!=null&&(this[t[n]]=e[t[n]])}return e.prototype.xyz=$util$1.emptyArray,e.prototype.uvs=$util$1.emptyArray,e.prototype.marks=$util$1.emptyArray,e.decode=function(e,t,n){e instanceof $Reader$1||(e=$Reader$1.create(e));let r=t===void 0?e.len:e.pos+t,o=new $root$1.Vertices;for(;e.pos<r;){let t=e.uint32();if(t===n)break;switch(t>>>3){case 1:if(o.xyz&&o.xyz.length||(o.xyz=[]),(t&7)==2){let t=e.uint32()+e.pos;for(;e.pos<t;)o.xyz.push(e.float())}else o.xyz.push(e.float());break;case 2:if(o.uvs&&o.uvs.length||(o.uvs=[]),(t&7)==2){let t=e.uint32()+e.pos;for(;e.pos<t;)o.uvs.push(e.float())}else o.uvs.push(e.float());break;case 3:if(o.marks&&o.marks.length||(o.marks=[]),(t&7)==2){let t=e.uint32()+e.pos;for(;e.pos<t;)o.marks.push(e.int32())}else o.marks.push(e.int32());break;default:e.skipType(t&7);break}}return o},e.getTypeUrl=function(e){return e===void 0&&(e=`type.googleapis.com`),e+`/Vertices`},e})(),Faces=$root$1.Faces=(()=>{function e(e){if(this.indices=[],this.normals=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)e[t[n]]!=null&&(this[t[n]]=e[t[n]])}return e.prototype.indices=$util$1.emptyArray,e.prototype.normals=$util$1.emptyArray,e.decode=function(e,t,n){e instanceof $Reader$1||(e=$Reader$1.create(e));let r=t===void 0?e.len:e.pos+t,o=new $root$1.Faces;for(;e.pos<r;){let t=e.uint32();if(t===n)break;switch(t>>>3){case 1:if(o.indices&&o.indices.length||(o.indices=[]),(t&7)==2){let t=e.uint32()+e.pos;for(;e.pos<t;)o.indices.push(e.uint32())}else o.indices.push(e.uint32());break;case 2:if(o.normals&&o.normals.length||(o.normals=[]),(t&7)==2){let t=e.uint32()+e.pos;for(;e.pos<t;)o.normals.push(e.float())}else o.normals.push(e.float());break;default:e.skipType(t&7);break}}return o},e.getTypeUrl=function(e){return e===void 0&&(e=`type.googleapis.com`),e+`/Faces`},e})(),VertexMark=$root$1.VertexMark=(()=>{let e={},t=Object.create(e);return t[e[0]=`VERTEX_MARK_UNSPECIFIED`]=0,t[e[1]=`VERTEX_MARK_ROOF`]=1,t})();function fixNumber(e){return isNaN(e)||!isFinite(e)?0:e}function getGeometryMemoryUsed(e){let t=0;if(e instanceof three.BufferGeometry){for(let n in e.attributes){let r=e.getAttribute(n),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)}let n=e.getIndex();if(n){let e=4;`BYTES_PER_ELEMENT`in n.array&&typeof n.array.BYTES_PER_ELEMENT==`number`&&(e=n.array.BYTES_PER_ELEMENT),t+=fixNumber(n.count*n.itemSize*e)}}else e instanceof three.Geometry&&(t+=fixNumber(e.faces.length*3*3*4),t+=fixNumber(e.faceVertexUvs.length*3*2*4));return t}function getPBMGSObjectMemoryUsed(e){let t=[e.positions,e.rotations,e.scales,e.colors,e.sh1,e.sh2,e.sh3],n=0;for(let e of t){if(!e)continue;let t=4;`BYTES_PER_ELEMENT`in e&&typeof e.BYTES_PER_ELEMENT==`number`&&(t=e.BYTES_PER_ELEMENT);let r=e.length*t;isNaN(r)||!isFinite(r)||(n+=r)}return n}function makeComputeBlockRectSizeFunction(e,t,n){return function(r,o,s){return((r+e-1)/e|0)*((o+t-1)/t|0)*n*s}}function makeComputePaddedRectSizeFunction(e,t,n){return function(r,o,s){return(Math.max(r,e)*Math.max(o,t)/n|0)*s}}var compressedTextureFunctions=new Map([[three.RGB_S3TC_DXT1_Format,makeComputeBlockRectSizeFunction(4,4,8)],[three.RGBA_S3TC_DXT1_Format,makeComputeBlockRectSizeFunction(4,4,8)],[three.RGBA_S3TC_DXT3_Format,makeComputeBlockRectSizeFunction(4,4,16)],[three.RGBA_S3TC_DXT5_Format,makeComputeBlockRectSizeFunction(4,4,16)],[three.RGB_ETC1_Format,makeComputeBlockRectSizeFunction(4,4,8)],[three.RGB_PVRTC_4BPPV1_Format,makeComputePaddedRectSizeFunction(8,8,2)],[three.RGBA_PVRTC_4BPPV1_Format,makeComputePaddedRectSizeFunction(8,8,2)],[three.RGB_PVRTC_2BPPV1_Format,makeComputePaddedRectSizeFunction(16,8,4)],[three.RGBA_PVRTC_2BPPV1_Format,makeComputePaddedRectSizeFunction(16,8,4)],[three.RGB_ETC2_Format,makeComputeBlockRectSizeFunction(4,4,8)],[three.RGBA_ETC2_EAC_Format,makeComputeBlockRectSizeFunction(4,4,16)],[three.RGBA_ASTC_4x4_Format,makeComputeBlockRectSizeFunction(4,4,16)],[three.SRGB8_ALPHA8_ASTC_4x4_Format,makeComputeBlockRectSizeFunction(4,4,16)],[three.RGBA_ASTC_5x4_Format,makeComputeBlockRectSizeFunction(5,4,16)],[three.SRGB8_ALPHA8_ASTC_5x4_Format,makeComputeBlockRectSizeFunction(5,4,16)],[three.RGBA_ASTC_5x5_Format,makeComputeBlockRectSizeFunction(5,5,16)],[three.SRGB8_ALPHA8_ASTC_5x5_Format,makeComputeBlockRectSizeFunction(5,5,16)],[three.RGBA_ASTC_6x5_Format,makeComputeBlockRectSizeFunction(6,5,16)],[three.SRGB8_ALPHA8_ASTC_6x5_Format,makeComputeBlockRectSizeFunction(6,5,16)],[three.RGBA_ASTC_6x6_Format,makeComputeBlockRectSizeFunction(6,6,16)],[three.SRGB8_ALPHA8_ASTC_6x6_Format,makeComputeBlockRectSizeFunction(6,6,16)],[three.RGBA_ASTC_8x5_Format,makeComputeBlockRectSizeFunction(8,5,16)],[three.SRGB8_ALPHA8_ASTC_8x5_Format,makeComputeBlockRectSizeFunction(8,5,16)],[three.RGBA_ASTC_8x6_Format,makeComputeBlockRectSizeFunction(8,6,16)],[three.SRGB8_ALPHA8_ASTC_8x6_Format,makeComputeBlockRectSizeFunction(8,6,16)],[three.RGBA_ASTC_8x8_Format,makeComputeBlockRectSizeFunction(8,8,16)],[three.SRGB8_ALPHA8_ASTC_8x8_Format,makeComputeBlockRectSizeFunction(8,8,16)],[three.RGBA_ASTC_10x5_Format,makeComputeBlockRectSizeFunction(10,5,16)],[three.SRGB8_ALPHA8_ASTC_10x5_Format,makeComputeBlockRectSizeFunction(10,5,16)],[three.RGBA_ASTC_10x6_Format,makeComputeBlockRectSizeFunction(10,6,16)],[three.SRGB8_ALPHA8_ASTC_10x6_Format,makeComputeBlockRectSizeFunction(10,6,16)],[three.RGBA_ASTC_10x8_Format,makeComputeBlockRectSizeFunction(10,8,16)],[three.SRGB8_ALPHA8_ASTC_10x8_Format,makeComputeBlockRectSizeFunction(10,8,16)],[three.RGBA_ASTC_10x10_Format,makeComputeBlockRectSizeFunction(10,10,16)],[three.SRGB8_ALPHA8_ASTC_10x10_Format,makeComputeBlockRectSizeFunction(10,10,16)],[three.RGBA_ASTC_12x10_Format,makeComputeBlockRectSizeFunction(12,10,16)],[three.SRGB8_ALPHA8_ASTC_12x10_Format,makeComputeBlockRectSizeFunction(12,10,16)],[three.RGBA_ASTC_12x12_Format,makeComputeBlockRectSizeFunction(12,12,16)],[three.SRGB8_ALPHA8_ASTC_12x12_Format,makeComputeBlockRectSizeFunction(12,12,16)],[three.RGBA_BPTC_Format,makeComputeBlockRectSizeFunction(4,4,16)]]);function getTextureMemoryUsed(e){let t=0,n=1;(e.generateMipmaps===!0||e.mipmaps&&e.mipmaps.length>1)&&(n=1.33);let r=e instanceof three.CompressedTexture?compressedTextureFunctions.get(e.format):void 0,o=[].concat(e.image);for(let e of o)if(e)if(e instanceof three.Texture)t+=getTextureMemoryUsed(e);else{let{width:o=1,height:s=1,depth:c=1}=e;r?t+=fixNumber(r(o,s,c)*n):t+=fixNumber(o*s*c*4*n)}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`.split(`.`);function getMaterialMemoryUsed(e){let t=0;if(textureSet.clear(),e instanceof three.ShaderMaterial)for(let n in e.uniforms){let r=e.uniforms[n],o=r&&r.value&&r.value instanceof three.Texture?r.value:void 0;o instanceof three.Texture&&(textureSet.has(o)||(t=getTextureMemoryUsed(o),textureSet.add(o)))}else for(let n of textureNames){let r=e[n];r instanceof three.Texture&&(textureSet.has(r)||(t=getTextureMemoryUsed(r),textureSet.add(r)))}return textureSet.clear(),t}var sceneSet=new Set;function getMemoryUsage(e){let t=0;return sceneSet.clear(),e.traverse(e=>{if(e instanceof PBMGaussianSplattingObject&&(t+=getPBMGSObjectMemoryUsed(e)),e instanceof three.Mesh||e instanceof three.Line||e instanceof three.Points){let n=e.geometry;(n instanceof three.BufferGeometry||n instanceof three.Geometry)&&(sceneSet.has(n)||(t+=getGeometryMemoryUsed(n),sceneSet.add(n)));let r=[].concat(e.material);for(let e of r)e instanceof three.Material&&(sceneSet.has(e)||(t+=getMaterialMemoryUsed(e),sceneSet.add(e)))}}),sceneSet.clear(),t}function guessTextureBaseUriFromFileUrl(e){let t=e.lastIndexOf(`/`);return t>=0?e.slice(0,t+1).replace(/\/(model)(\/|$)/,(e,t,n)=>`/materials`+n):``}function loadPbm(e,t={}){var n,r,o,s,c,l,u;let d=(n=t.upAxis)==null?`Z`:n,f=(r=t.light)==null?!1:r,p=(o=t.fetcher)==null?internalFetcher:o,m=(s=t.onDownloadProgress)==null?noop:s,h=(c=t.textureBaseUri)==null?guessTextureBaseUriFromFileUrl(e):c,g=t.textureBaseUri===void 0?[]:((l=t.textureArray)==null?[]:l).slice(),_=autoRestImageOptionsByTextureLength((u=t.textureOptions)==null?{}:u,g.length),v=new Map;for(let e of g){let t=isAbsoluteURL(e)?e:pathJoin(h,e);v.set(t,loadTexture$1(t,_,p))}let y={byteLength:0};return Promise.resolve().then(()=>p.ajax(e,{responseType:`arraybuffer`},void 0,void 0,m)).then(e=>{y.byteLength=e.body.byteLength;let t=new Uint8Array(e.body);return Model$2.decode(t)}).then(e=>parse$4(e,f,h,g,_,v,p)).then(t=>{v.clear();let n=new three.Group;n.name=e;for(let e of t.objects)n.add(e);return d===`Y`&&n.applyMatrix4(ROTATE_X_MATRIX_INVERSE$2),{type:`pbm`,modelUpAxis:`Z`,upAxis:d,uri:e,byteLength:y.byteLength,memoryUsage:getMemoryUsage(n),scene:n,textures:t.textures,animations:[],dispose:()=>t.dispose()}})}function parseFloorName(e){let t=e.match(/(group|floor)-?(\d+)/);return t?parseInt(t[2],10):0}function parseChunkName(e){let t=e.match(/(chunk)-?(\d+)/);return t?parseInt(t[2],10):0}function parseSubName(e){let t=e.match(/(sub)-?(\d+)/);return t?parseInt(t[2],10):0}function chunkOrder(e){let t=parseFloorName(e.name),n=parseChunkName(e.name),r=parseSubName(e.name);return t*1e6+n*1e3+r}function parsePBMModel(e){var t,n,r;let o=typeof e.createAt==`number`?e.createAt:0,s=(t=e.description)==null?``:t,c=[],l=!0,u=!0;for(let t of e.chunks)if(!t.vertices.marks||t.vertices.marks.length===0){u=!1;break}for(let t of e.chunks)if(!t.faces.normals||t.faces.normals.length===0){l=!1;break}let d=e.chunks.sort((e,t)=>chunkOrder(e)-chunkOrder(t)),f=[];for(let e of d){let t=parseFloorName(e.name);f[t]||(f[t]=[]),f[t].push(e)}for(let e=0;e<f.length;e++){let t=f[e];if(t)if(l){let r=0;for(let e=0;e<t.length;e++){let n=t[e];r+=n.faces.indices.length}let l=new Float32Array(r*3),d=new Float32Array(r*2),f=new Float32Array(r*3),p=u?new Float32Array(r):void 0,m=[],h=[1/0,1/0,1/0,-1/0,-1/0,-1/0],g=0;for(let e=0;e<t.length;e++){let r=[1/0,1/0,1/0,-1/0,-1/0,-1/0],o=t[e],s=o.vertices.xyz,c=o.vertices.uvs,u=o.faces.indices,_=o.faces.normals,v=o.vertices.marks,y=u.length;for(let e=0;e<y;e++){let t=u[e],n=l[g*3+e*3]=s[t*3],o=l[g*3+e*3+1]=s[t*3+1],m=l[g*3+e*3+2]=s[t*3+2];p&&(p[g+e]=v[t]),d[g*2+e*2]=c[t*2],d[g*2+e*2+1]=c[t*2+1];let h=Math.floor(e/3)*3;f[g*3+e*3]=_[h],f[g*3+e*3+1]=_[h+1],f[g*3+e*3+2]=_[h+2],n<r[0]&&(r[0]=n),o<r[1]&&(r[1]=o),m<r[2]&&(r[2]=m),n>r[3]&&(r[3]=n),o>r[4]&&(r[4]=o),m>r[5]&&(r[5]=m)}r[0]<h[0]&&(h[0]=r[0]),r[1]<h[1]&&(h[1]=r[1]),r[2]<h[2]&&(h[2]=r[2]),r[3]>h[3]&&(h[3]=r[3]),r[4]>h[4]&&(h[4]=r[4]),r[5]>h[5]&&(h[5]=r[5]),m.push({materialIndex:e,name:o.name,chunkName:parseChunkName(o.name),start:g,count:o.faces.indices.length,texture:(n=o.texture)==null?void 0:n}),g+=y}let _={createAt:o,description:s,vertices:l,uvs:d,normals:f,masks:p,indices:null,floorIndex:e,groups:m,extents:h};c.push(_)}else{let n=0,l=0;for(let e=0;e<t.length;e++){let r=t[e];l+=r.vertices.xyz.length/3,n+=r.faces.indices.length}let d=new Float32Array(l*3),f=new Float32Array(l*2),p,m=new Float32Array(l),h=new Uint32Array(n),g=u?new Float32Array(n):void 0,_=[],v=[1/0,1/0,1/0,-1/0,-1/0,-1/0],y=0,b=0;for(let n=0;n<t.length;n++){let o=[1/0,1/0,1/0,-1/0,-1/0,-1/0],s=t[n],c=s.vertices.xyz,l=s.vertices.marks,u=s.vertices.uvs,p=s.faces.indices,S=c.length/3,C=p.length;for(let t=0;t<S;t++){let n=d[b*3+t*3]=c[t*3],r=d[b*3+t*3+1]=c[t*3+1],s=d[b*3+t*3+2]=c[t*3+2];g&&(g[b+t]=l[t]),f[b*2+t*2]=u[t*2],f[b*2+t*2+1]=u[t*2+1],m[b+t]=e,n<o[0]&&(o[0]=n),r<o[1]&&(o[1]=r),s<o[2]&&(o[2]=s),n>o[3]&&(o[3]=n),r>o[4]&&(o[4]=r),s>o[5]&&(o[5]=s)}o[0]<v[0]&&(v[0]=o[0]),o[1]<v[1]&&(v[1]=o[1]),o[2]<v[2]&&(v[2]=o[2]),o[3]>v[3]&&(v[3]=o[3]),o[4]>v[4]&&(v[4]=o[4]),o[5]>v[5]&&(v[5]=o[5]);for(let e=0;e<C;e++)h[y+e]=b+p[e];_.push({materialIndex:n,name:s.name,chunkName:parseChunkName(s.name),start:y,count:s.faces.indices.length,texture:(r=s.texture)==null?void 0:r}),b+=S,y+=C}let S={createAt:o,description:s,vertices:d,uvs:f,normals:void 0,masks:g,indices:h,floorIndex:e,groups:_,extents:v};c.push(S)}}return c}function loadTexture$1(e,t,n){let r=Object.assign({key:`texture.pbm`},pick(t,[`format`,`quality`,`size`,`sharpen`,`forceUseExifOrientation`,`mappings`]));return new TextureLoader().loadTexture(e,{imageURL:{transform:t.transform,options:r},encoding:three.sRGBEncoding,wrapS:three.ClampToEdgeWrapping,wrapT:three.ClampToEdgeWrapping,minFilter:three.LinearFilter,maxSize:typeof r.size==`number`?new three.Vector2(r.size,r.size):void 0,fetcher:n}).then(e=>{let t=e.body;return t.needsUpdate=!0,t})}function parse$4(e,t,n,r,o,s,c){let l=parsePBMModel(e),u=0,d=``,f=[],p={},m=new Set,h=0;for(let{createAt:e,description:o,vertices:s,masks:c,uvs:g,normals:_,indices:v,floorIndex:y,groups:b,extents:S}of l){let l=new three.Box3;l.min.x=S[0],l.min.y=S[1],l.min.z=S[2],l.max.x=S[3],l.max.y=S[4],l.max.z=S[5];let C=new three.BufferGeometry;C.setAttribute(`position`,new three.BufferAttribute(s,3)),C.setAttribute(`uv`,new three.BufferAttribute(g,2)),_&&C.setAttribute(`normal`,new three.BufferAttribute(_,3)),c&&C.setAttribute(`_feature_id_rsmask`,new three.BufferAttribute(c,1)),v&&C.setIndex(new three.BufferAttribute(v,1)),C.boundingBox=l,C.boundingSphere=l.getBoundingSphere(new three.Sphere);for(let e of b)C.addGroup(e.start,e.count,e.materialIndex);m.add(C);let w=[];for(let e of b){let o;if(e.texture){if(o=e.texture,r.length>0&&r.indexOf(e.texture)===-1){for(let t of r)if((isAbsoluteURL(t)?t:pathJoin(n,t)).slice(e.texture.length*-1)===e.texture){o=t;break}console.warn(`At3d/Pbm texture not matched. Use ends-guessing mode. ${e.texture} -> ${o}`)}isAbsoluteURL(o)||(o=pathJoin(n,o))}let s=new PBMMeshMaterial(t?`phong`:`basic`);s.floorIndex=y,C.attributes.normal===void 0&&(s.flatShading=!0),C.attributes._feature_id_rsmask&&(s.defines.USE_VERTEX_MARK=!0),w.push(s),o?(h++,p[o]?p[o].push(s):p[o]=[s]):s.color=new three.Color(16777215),m.add(s)}let T=new PBMMesh(C,w);T.name=`model_floor_`+y,T.userData.createAt=e,T.userData.description=o,T.matrix.compose(T.position,T.quaternion,T.scale),T.matrixAutoUpdate=!1,T.frustumCulled=!1,u=e,d=o,f.push(T)}o=autoRestImageOptionsByTextureLength(o,h);let g=[];for(let e of Object.keys(p)){let t;s&&(t=s.get(e)),t||(t=loadTexture$1(e,o,c),s&&s.set(e,t)),g.push(t.then(t=>{for(let n of p[e])n.map&&(m.delete(n.map),n.map.dispose()),n.map=t,m.add(t);return t}).catch(()=>{for(let t of p[e])t.map&&(m.delete(t.map),t.map.dispose()),t.map=null,t.color=new three.Color(16777215);return null}))}return Promise.all(g).then(e=>{let t=e.filter(e=>e instanceof three.Texture);return{createAt:u,description:d,objects:f,textures:t,dispose:()=>{m.forEach(e=>{e.dispose()}),m.clear()}}})}function autoRestImageOptionsByTextureLength(e,t){return e=Object.assign({},e),e.autoResize!==!1&&(t>96?e.size=Math.min(e.size||1/0,100):t>48?e.size=Math.min(e.size||1/0,200):t>24?e.size=Math.min(e.size||1/0,400):t>22?e.size=Math.min(e.size||1/0,800):t>5&&(e.size=Math.min(e.size||1/0,1024))),e}function createLZMA(){var e={};return e.OutWindow=function(){this._windowSize=0},e.OutWindow.prototype.create=function(e){(!this._buffer||this._windowSize!==e)&&(this._buffer=[]),this._windowSize=e,this._pos=0,this._streamPos=0},e.OutWindow.prototype.flush=function(){var e=this._pos-this._streamPos;if(e!==0){for(;e--;)this._stream.writeByte(this._buffer[this._streamPos++]);this._pos>=this._windowSize&&(this._pos=0),this._streamPos=this._pos}},e.OutWindow.prototype.releaseStream=function(){this.flush(),this._stream=null},e.OutWindow.prototype.setStream=function(e){this.releaseStream(),this._stream=e},e.OutWindow.prototype.init=function(e){e||(this._streamPos=0,this._pos=0)},e.OutWindow.prototype.copyBlock=function(e,t){var n=this._pos-e-1;for(n<0&&(n+=this._windowSize);t--;)n>=this._windowSize&&(n=0),this._buffer[this._pos++]=this._buffer[n++],this._pos>=this._windowSize&&this.flush()},e.OutWindow.prototype.putByte=function(e){this._buffer[this._pos++]=e,this._pos>=this._windowSize&&this.flush()},e.OutWindow.prototype.getByte=function(e){var t=this._pos-e-1;return t<0&&(t+=this._windowSize),this._buffer[t]},e.RangeDecoder=function(){},e.RangeDecoder.prototype.setStream=function(e){this._stream=e},e.RangeDecoder.prototype.releaseStream=function(){this._stream=null},e.RangeDecoder.prototype.init=function(){var e=5;for(this._code=0,this._range=-1;e--;)this._code=this._code<<8|this._stream.readByte()},e.RangeDecoder.prototype.decodeDirectBits=function(e){for(var t=0,n=e,r;n--;)this._range>>>=1,r=this._code-this._range>>>31,this._code-=this._range&r-1,t=t<<1|1-r,this._range&4278190080||(this._code=this._code<<8|this._stream.readByte(),this._range<<=8);return t},e.RangeDecoder.prototype.decodeBit=function(e,t){var n=e[t],r=(this._range>>>11)*n;return(this._code^2147483648)<(r^2147483648)?(this._range=r,e[t]+=2048-n>>>5,this._range&4278190080||(this._code=this._code<<8|this._stream.readByte(),this._range<<=8),0):(this._range-=r,this._code-=r,e[t]-=n>>>5,this._range&4278190080||(this._code=this._code<<8|this._stream.readByte(),this._range<<=8),1)},e.initBitModels=function(e,t){for(;t--;)e[t]=1024},e.BitTreeDecoder=function(e){this._models=[],this._numBitLevels=e},e.BitTreeDecoder.prototype.init=function(){e.initBitModels(this._models,1<<this._numBitLevels)},e.BitTreeDecoder.prototype.decode=function(e){for(var t=1,n=this._numBitLevels;n--;)t=t<<1|e.decodeBit(this._models,t);return t-(1<<this._numBitLevels)},e.BitTreeDecoder.prototype.reverseDecode=function(e){for(var t=1,n=0,r=0,o;r<this._numBitLevels;++r)o=e.decodeBit(this._models,t),t=t<<1|o,n|=o<<r;return n},e.reverseDecode2=function(e,t,n,r){for(var o=1,s=0,c=0,l;c<r;++c)l=n.decodeBit(e,t+o),o=o<<1|l,s|=l<<c;return s},e.LenDecoder=function(){this._choice=[],this._lowCoder=[],this._midCoder=[],this._highCoder=new e.BitTreeDecoder(8),this._numPosStates=0},e.LenDecoder.prototype.create=function(t){for(;this._numPosStates<t;++this._numPosStates)this._lowCoder[this._numPosStates]=new e.BitTreeDecoder(3),this._midCoder[this._numPosStates]=new e.BitTreeDecoder(3)},e.LenDecoder.prototype.init=function(){var t=this._numPosStates;for(e.initBitModels(this._choice,2);t--;)this._lowCoder[t].init(),this._midCoder[t].init();this._highCoder.init()},e.LenDecoder.prototype.decode=function(e,t){return e.decodeBit(this._choice,0)===0?this._lowCoder[t].decode(e):e.decodeBit(this._choice,1)===0?8+this._midCoder[t].decode(e):16+this._highCoder.decode(e)},e.Decoder2=function(){this._decoders=[]},e.Decoder2.prototype.init=function(){e.initBitModels(this._decoders,768)},e.Decoder2.prototype.decodeNormal=function(e){var t=1;do t=t<<1|e.decodeBit(this._decoders,t);while(t<256);return t&255},e.Decoder2.prototype.decodeWithMatchByte=function(e,t){var n=1,r,o;do if(r=t>>7&1,t<<=1,o=e.decodeBit(this._decoders,(1+r<<8)+n),n=n<<1|o,r!==o){for(;n<256;)n=n<<1|e.decodeBit(this._decoders,n);break}while(n<256);return n&255},e.LiteralDecoder=function(){},e.LiteralDecoder.prototype.create=function(t,n){var r;if(!(this._coders&&this._numPrevBits===n&&this._numPosBits===t))for(this._numPosBits=t,this._posMask=(1<<t)-1,this._numPrevBits=n,this._coders=[],r=1<<this._numPrevBits+this._numPosBits;r--;)this._coders[r]=new e.Decoder2},e.LiteralDecoder.prototype.init=function(){for(var e=1<<this._numPrevBits+this._numPosBits;e--;)this._coders[e].init()},e.LiteralDecoder.prototype.getDecoder=function(e,t){return this._coders[((e&this._posMask)<<this._numPrevBits)+((t&255)>>>8-this._numPrevBits)]},e.Decoder=function(){this._outWindow=new e.OutWindow,this._rangeDecoder=new e.RangeDecoder,this._isMatchDecoders=[],this._isRepDecoders=[],this._isRepG0Decoders=[],this._isRepG1Decoders=[],this._isRepG2Decoders=[],this._isRep0LongDecoders=[],this._posSlotDecoder=[],this._posDecoders=[],this._posAlignDecoder=new e.BitTreeDecoder(4),this._lenDecoder=new e.LenDecoder,this._repLenDecoder=new e.LenDecoder,this._literalDecoder=new e.LiteralDecoder,this._dictionarySize=-1,this._dictionarySizeCheck=-1,this._posSlotDecoder[0]=new e.BitTreeDecoder(6),this._posSlotDecoder[1]=new e.BitTreeDecoder(6),this._posSlotDecoder[2]=new e.BitTreeDecoder(6),this._posSlotDecoder[3]=new e.BitTreeDecoder(6)},e.Decoder.prototype.setDictionarySize=function(e){return e<0?!1:(this._dictionarySize!==e&&(this._dictionarySize=e,this._dictionarySizeCheck=Math.max(this._dictionarySize,1),this._outWindow.create(Math.max(this._dictionarySizeCheck,4096))),!0)},e.Decoder.prototype.setLcLpPb=function(e,t,n){var r=1<<n;return e>8||t>4||n>4?!1:(this._literalDecoder.create(t,e),this._lenDecoder.create(r),this._repLenDecoder.create(r),this._posStateMask=r-1,!0)},e.Decoder.prototype.init=function(){var t=4;for(this._outWindow.init(!1),e.initBitModels(this._isMatchDecoders,192),e.initBitModels(this._isRep0LongDecoders,192),e.initBitModels(this._isRepDecoders,12),e.initBitModels(this._isRepG0Decoders,12),e.initBitModels(this._isRepG1Decoders,12),e.initBitModels(this._isRepG2Decoders,12),e.initBitModels(this._posDecoders,114),this._literalDecoder.init();t--;)this._posSlotDecoder[t].init();this._lenDecoder.init(),this._repLenDecoder.init(),this._posAlignDecoder.init(),this._rangeDecoder.init()},e.Decoder.prototype.decode=function(t,n,r){var o=0,s=0,c=0,l=0,u=0,d=0,f=0,p,m,h,g,_,v;for(this._rangeDecoder.setStream(t),this._outWindow.setStream(n),this.init();r<0||d<r;)if(p=d&this._posStateMask,this._rangeDecoder.decodeBit(this._isMatchDecoders,(o<<4)+p)===0)m=this._literalDecoder.getDecoder(d++,f),f=o>=7?m.decodeWithMatchByte(this._rangeDecoder,this._outWindow.getByte(s)):m.decodeNormal(this._rangeDecoder),this._outWindow.putByte(f),o=o<4?0:o-(o<10?3:6);else{if(this._rangeDecoder.decodeBit(this._isRepDecoders,o)===1)h=0,this._rangeDecoder.decodeBit(this._isRepG0Decoders,o)===0?this._rangeDecoder.decodeBit(this._isRep0LongDecoders,(o<<4)+p)===0&&(o=o<7?9:11,h=1):(this._rangeDecoder.decodeBit(this._isRepG1Decoders,o)===0?g=c:(this._rangeDecoder.decodeBit(this._isRepG2Decoders,o)===0?g=l:(g=u,u=l),l=c),c=s,s=g),h===0&&(h=2+this._repLenDecoder.decode(this._rangeDecoder,p),o=o<7?8:11);else if(u=l,l=c,c=s,h=2+this._lenDecoder.decode(this._rangeDecoder,p),o=o<7?7:10,_=this._posSlotDecoder[h<=5?h-2:3].decode(this._rangeDecoder),_>=4){if(v=(_>>1)-1,s=(2|_&1)<<v,_<14)s+=e.reverseDecode2(this._posDecoders,s-_-1,this._rangeDecoder,v);else if(s+=this._rangeDecoder.decodeDirectBits(v-4)<<4,s+=this._posAlignDecoder.reverseDecode(this._rangeDecoder),s<0){if(s===-1)break;return!1}}else s=_;if(s>=d||s>=this._dictionarySizeCheck)return!1;this._outWindow.copyBlock(s,h),d+=h,f=this._outWindow.getByte(0)}return this._outWindow.flush(),this._outWindow.releaseStream(),this._rangeDecoder.releaseStream(),!0},e.Decoder.prototype.setDecoderProperties=function(e){var t,n,r,o,s;return e.size<5||(t=e.readByte(),n=t%9,t=~~(t/9),r=t%5,o=~~(t/5),!this.setLcLpPb(n,r,o))?!1:(s=e.readByte(),s|=e.readByte()<<8,s|=e.readByte()<<16,s+=e.readByte()*16777216,this.setDictionarySize(s))},e.decompress=function(t,n,r,o){var s=new e.Decoder;if(!s.setDecoderProperties(t))throw`Incorrect stream properties`;if(!s.decode(n,r,o))throw`Error in data stream`;return!0},e.decompressFile=function(t,n){var r=new e.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,n,o))throw`Error in data stream`;return!0},e}var LZMA=createLZMA();function createWASM(){function e(e){let t=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,n=new Uint8Array(256);for(let e=0;e<64;e++)n[`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`.charCodeAt(e)]=e;let r=e.length*.75,o=e.length,s,c=0,l,u,d,f;e[e.length-1]===`=`&&(r--,e[e.length-2]===`=`&&r--);let p=new ArrayBuffer(r),m=new Uint8Array(p);for(s=0;s<o;s+=4)l=n[e.charCodeAt(s)],u=n[e.charCodeAt(s+1)],d=n[e.charCodeAt(s+2)],f=n[e.charCodeAt(s+3)],m[c++]=l<<2|u>>4,m[c++]=(u&15)<<4|d>>2,m[c++]=(d&3)<<6|f&63;return p}return e(`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///wNLBEBBAEHAAEEXQSIQAAALI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BEkEQCACIAEoAiQoAgAiAygCAEECdkkEfyACQQJ0IANqKAIIBQALKAIAQQEkBBAYGiACQQFqIQIMAQsLIAEoAigoAgBBASQEEBgaIAEoAixBASQEEBgaIAAoAjBBASQEEBgaIAAoAjRBASQEEBgaIAAoAjhBASQEEBgaIAAoAjxBASQEEBgaIAAoAkBBASQEEBgaIAAoAkRBASQEEBgaIAAoAkgQGSAAKAJMEBkLyAwBA38DQCABQQNxIAIgAhsEQCAAIgRBAWohACABIgNBAWohASAEIAMtAAA6AAAgAkEBayECDAELCyAAQQNxRQRAA0AgAkEQTwRAIAAgASgCADYCACAAQQRqIAFBBGooAgA2AgAgAEEIaiABQQhqKAIANgIAIABBDGogAUEMaigCADYCACABQRBqIQEgAEEQaiEAIAJBEGshAgwBCwsgAkEIcQRAIAAgASgCADYCACAAQQRqIAFBBGooAgA2AgAgAUEIaiEBIABBCGohAAsgAkEEcQRAIAAgASgCADYCACABQQRqIQEgAEEEaiEACyACQQJxBEAgACABLwEAOwEAIAFBAmohASAAQQJqIQALIAJBAXEEQCAAIAEtAAA6AAALDwsgAkEgTwRAAkACQAJAIABBA3EiA0EBRwRAIANBAkYNASADQQNGDQIMAwsgASgCACEFIAAgASIDLQAAOgAAIABBAWoiASABIANBAWoiAS0AADoAAEEBaiIEQQFqIQAgAUEBaiIDQQFqIQEgBCADLQAAOgAAIAJBA2shAgNAIAJBEU8EQCAAIAFBAWooAgAiA0EIdCAFQRh2cjYCACAAQQRqIAFBBWooAgAiBUEIdCADQRh2cjYCACAAQQhqIAFBCWooAgAiA0EIdCAFQRh2cjYCACAAQQxqIAFBDWooAgAiBUEIdCADQRh2cjYCACABQRBqIQEgAEEQaiEAIAJBEGshAgwBCwsMAgsgASgCACEFIAAgAS0AADoAACAAQQFqIgRBAWohACABQQFqIgNBAWohASAEIAMtAAA6AAAgAkECayECA0AgAkESTwRAIAAgAUECaigCACIDQRB0IAVBEHZyNgIAIABBBGogAUEGaigCACIFQRB0IANBEHZyNgIAI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AIAQQFqaiADQf8BcUEJcCIHOgAIIAIoAgQgAigCAGogA0H/AXFBCW4iAzoACCADQQVwIQUgAigCBCACKAIAQQJqaiADQQVuIgM6AAggAigCBCACKAIAQQNqaiAFOgAIIAQgBzYCDCAEIAM2AhAgBCAFOgAUIARBADYCHEEAIQIDQAJAIAJBBE8NACAEIAQoAhwgBigCBCAGKAIAIAJBAWpqai0ACCACQQN0dHI2AhwgAkEBaiECDAELCyAEIAQoAhw2AhggBCgCGEGAIEkEQCAEQYAgNgIYC0EAIQJBACEFQQAhAwNAAkAgA0EITg0AIAYgA0EFahARQf8BcSIEQf8BRwRAQQEhBQsgBCADQQN0dCACciECIANBAWohAwwBCwsgACgCACAFRToAACAAKAIAKAIEIAE2AgAgACgCABAWAkAgACgCACAFIAIQICIBQQFGDQAgAUEDRwRAIAFBAkYEQCAFBEAgACgCACgCCCgCECACRw0DCwUMAgsLIAAoAgAoAgQtAAQaQQFBACAAKAIAKAIIKAIQIAAoAgAoAggoAgQQIQ8LQQBBAUEAQQAQIQsIACMDIAAQIgsWAEG4ASQAIwAkAUGAgIAIJAIQDCQDCwMAAQsLtwEEAEEICxcKAAAAdQBzAGUAIABzAHQAcgBpAGMAdABBIAsdDQAAAH4AbABpAGIALwBhAHIAcgBhAHkALgB0AHMAQcAACzkbAAAAfgBsAGkAYgAvAGkAbgB0AGUAcgBuAGEAbAAvAHQAeQBwAGUAZABhAHIAcgBhAHkALgB0AHMAQYABCzMYAAAAcwByAGMALwBsAHoAbQBhAC8AbAB6AG0AYQAtAGQAZQBjAG8AZABlAHIALgB0AHM=`)}function decodeLZMA(e,t,n){try{let r={data:t,offset:0,readByte(){return this.data[this.offset++]}},o=r.data.length,s={data:[],offset:0,writeByte(e){let t=Math.floor(this.offset/o);this.data[t]||(this.data[t]=new Uint8Array(o)),this.data[t][this.offset%o]=e,this.offset++}};e.decompressFile(r,s);let c=new Uint8Array(s.offset);for(let e=0;e<s.offset;e++)c[e]=s.data[Math.floor(e/o)][e%o];n(null,c)}catch(e){n(e)}}function decodeLZMAWithWASM(e,t,n){let r=24;try{let r=new WebAssembly.Memory({initial:16}),o=new WebAssembly.Module(e),s=new WebAssembly.Instance(o,{env:{memory:r,abort(){n(Error(`webAssembly abort`))}}}).exports,c=s.newU8Array(t.length);new Uint8Array(r.buffer,c+24,t.length).set(t);let l=s.decode(c),u=new Uint32Array(r.buffer,l,4),d=u[0],f=u[2],p=u[3];d?n(null,new Uint8Array(r.buffer,p+24,f).slice(0,f)):n(Error(`lzma deocder error`))}catch(e){n(e)}}var lzmaWorkerSource=`
|
|
320
320
|
var decodeLZMA = (function() {
|
|
321
321
|
var LZMA = (${createLZMA.toString()})();
|
|
322
322
|
return function(data, callback) {
|
|
@@ -1303,7 +1303,7 @@ void main() {
|
|
|
1303
1303
|
vec3 color = base.rgb + line.rgb * line.a;
|
|
1304
1304
|
gl_FragColor = vec4(color, base.a);
|
|
1305
1305
|
}
|
|
1306
|
-
`,FlowingLight2DPass=class extends FivePass{constructor(e){super(),this.mesh=null,this.material=null,this.uTime=0,this.lines=[],this.uTime=0,this.camera=e,this.lineScene=new three.Scene,this.orthoCamera=new three.OrthographicCamera(-1,1,1,-1,0,1),this.lineRenderTarget=new three.WebGLRenderTarget(this.camera.resolution.x,this.camera.resolution.y,{minFilter:three.LinearFilter,magFilter:three.LinearFilter,format:three.RGBAFormat,encoding:three.sRGBEncoding}),this.blendMaterial=new three.ShaderMaterial({uniforms:{tDiffuse:{value:null},tLine:{value:this.lineRenderTarget.texture}},vertexShader:blendVertexShader$1,fragmentShader:blendFragmentShader$1,transparent:!1,depthTest:!1,depthWrite:!1}),this.blendQuad=new FullScreenQuad(this.blendMaterial);let t=this.enabled;Object.defineProperty(this,`enabled`,{get(){return t},set(e){t=e,t===!1&&(this.uTime=0)}})}toInternal(e){return e.map(e=>new three.Vector3(e.x,e.y,MARKER_Z))}toInternalLine(e){return Object.assign(Object.assign({},e),{points:this.toInternal(e.points)})}setLines(e){this.lines=e.map(e=>{var t;return Object.assign(Object.assign({},this.toInternalLine(e)),{id:e.id||createUuid(),startTime:(t=e.startTime)==null?this.uTime*1e3:t})}),this._rebuildMesh()}addLine(...e){let t=e.map(e=>{var t;return Object.assign(Object.assign({},this.toInternalLine(e)),{id:e.id||createUuid(),startTime:(t=e.startTime)==null?this.uTime*1e3:t})});return this.lines.push(...t),this._rebuildMesh(),t.map(e=>e.id)}removeLine(...e){let t=0;for(let n of e){let e=this.lines.findIndex(e=>e.id===n);if(e===-1){console.warn(`FlowingLight2DPass: Line with id "${n}" not found`);continue}this.lines.splice(e,1),t++}return t>0&&this._rebuildMesh(),t}setLine(e){let{id:t,points:n}=e,r=__rest(e,[`id`,`points`]),o=this.lines.findIndex(e=>e.id===t);if(o===-1){console.warn(`FlowingLight2DPass: Line with id "${t}" not found`);return}let s=this.lines[o],c=Object.assign({},r);n&&(c.points=this.toInternal(n));let l=Object.assign(Object.assign({},s),c),u=c.points&&c.points.length!==s.points.length;this.lines[o]=l,u?this._rebuildMesh():this._updateLineAttributes(o,l,s)}_updateLineAttributes(e,t,n){var r,o,s;if(!this.mesh||!this.material)return;let c=this.mesh.geometry,l=0;for(let t=0;t<e;t++)l+=Math.max(0,this.lines[t].points.length-1);let u=t.points.length-1;if(u<=0)return;let d=c.getAttribute(`instanceStart`),f=c.getAttribute(`instanceEnd`),p=c.getAttribute(`instanceColor`),m=c.getAttribute(`instanceData`),h=c.getAttribute(`instanceMeta`),g=0;for(let c=0;c<u;c++){let u=l+c,_=t.points[c],v=t.points[c+1],y=_.distanceTo(v);t.points!==n.points&&(d.setXYZ(u,_.x,_.y,_.z),f.setXYZ(u,v.x,v.y,v.z)),(t.color!==n.color||t.opacity!==n.opacity)&&p.setXYZW(u,t.color.r,t.color.g,t.color.b,(r=t.opacity)==null?1:r),(t.points!==n.points||t.lineWidth!==n.lineWidth)&&m.setXYZW(u,e,c,g,(o=t.lineWidth)==null?1:o),(t.totalLength!==n.totalLength||t.duration!==n.duration||t.tailLengthRatio!==n.tailLengthRatio)&&h.setXYZ(u,t.totalLength,(t.duration||1e3)/1e3,(s=t.tailLengthRatio)==null?.2:s),g+=y}t.points!==n.points&&(d.needsUpdate=!0,f.needsUpdate=!0,m.needsUpdate=!0),(t.color!==n.color||t.opacity!==n.opacity)&&(p.needsUpdate=!0),t.lineWidth!==n.lineWidth&&(m.needsUpdate=!0),(t.totalLength!==n.totalLength||t.duration!==n.duration||t.tailLengthRatio!==n.tailLengthRatio)&&(h.needsUpdate=!0)}_rebuildMesh(){if(this.dispose(),this.lines.length===0)return;let e=0;if(this.lines.forEach(t=>{e+=Math.max(0,t.points.length-1)}),e===0)return;let t=new three.PlaneBufferGeometry(1,20,1,1);t.rotateZ(Math.PI/2);let n=new Float32Array(e*3),r=new Float32Array(e*3),o=new Float32Array(e*4),s=new Float32Array(e*4),c=new Float32Array(e*3),l=new Float32Array(e),u=0;this.lines.forEach((e,t)=>{var d,f,p,m;let h=e.points.length-1;if(h<=0)return;let g=0;for(let _=0;_<h;_++){let h=e.points[_],v=e.points[_+1],y=h.distanceTo(v),b=u*3,S=u*4;n[b+0]=h.x,n[b+1]=h.y,n[b+2]=h.z,r[b+0]=v.x,r[b+1]=v.y,r[b+2]=v.z,o[S+0]=e.color.r,o[S+1]=e.color.g,o[S+2]=e.color.b,o[S+3]=(d=e.opacity)==null?1:d,s[S+0]=t,s[S+1]=_,s[S+2]=g,s[S+3]=(f=e.lineWidth)==null?1:f,c[b+0]=e.totalLength,c[b+1]=(e.duration||1e3)/1e3,c[b+2]=(p=e.tailLengthRatio)==null?.2:p,l[u]=((m=e.startTime)==null?0:m)/1e3,g+=y,u++}}),t.setAttribute(`instanceStart`,new three.InstancedBufferAttribute(n,3)),t.setAttribute(`instanceEnd`,new three.InstancedBufferAttribute(r,3)),t.setAttribute(`instanceColor`,new three.InstancedBufferAttribute(o,4)),t.setAttribute(`instanceData`,new three.InstancedBufferAttribute(s,4)),t.setAttribute(`instanceMeta`,new three.InstancedBufferAttribute(c,3)),t.setAttribute(`instanceStartTime`,new three.InstancedBufferAttribute(l,1)),this.material=new three.ShaderMaterial({uniforms:{uTime:{value:this.uTime},resolution:{value:new three.Vector2(this.camera.resolution.x,this.camera.resolution.y)},fiveProjectionMatrix:{value:this.camera.projectionMatrix},fiveViewMatrix:{value:this.camera.matrixWorldInverse}},vertexShader:instanceVertexShader$1,fragmentShader:instanceFragmentShader$1,transparent:!0,depthWrite:!1,side:three.DoubleSide}),this.mesh=new three.InstancedMesh(t,this.material,e),this.mesh.frustumCulled=!1,this.lineScene.add(this.mesh)}render(e,t,n,r,o){
|
|
1306
|
+
`,FlowingLight2DPass=class extends FivePass{constructor(e){super(),this.mesh=null,this.material=null,this.uTime=0,this.lines=[],this.uTime=0,this.camera=e,this.lineScene=new three.Scene,this.orthoCamera=new three.OrthographicCamera(-1,1,1,-1,0,1),this.lineRenderTarget=new three.WebGLRenderTarget(this.camera.resolution.x,this.camera.resolution.y,{minFilter:three.LinearFilter,magFilter:three.LinearFilter,format:three.RGBAFormat,encoding:three.sRGBEncoding}),this.blendMaterial=new three.ShaderMaterial({uniforms:{tDiffuse:{value:null},tLine:{value:this.lineRenderTarget.texture}},vertexShader:blendVertexShader$1,fragmentShader:blendFragmentShader$1,transparent:!1,depthTest:!1,depthWrite:!1}),this.blendQuad=new FullScreenQuad(this.blendMaterial);let t=this.enabled;Object.defineProperty(this,`enabled`,{get(){return t},set(e){t=e,t===!1&&(this.uTime=0)}})}toInternal(e){return e.map(e=>new three.Vector3(e.x,e.y,MARKER_Z))}toInternalLine(e){return Object.assign(Object.assign({},e),{points:this.toInternal(e.points)})}setLines(e){this.lines=e.map(e=>{var t;return Object.assign(Object.assign({},this.toInternalLine(e)),{id:e.id||createUuid(),startTime:(t=e.startTime)==null?this.uTime*1e3:t})}),this._rebuildMesh()}addLine(...e){let t=e.map(e=>{var t;return Object.assign(Object.assign({},this.toInternalLine(e)),{id:e.id||createUuid(),startTime:(t=e.startTime)==null?this.uTime*1e3:t})});return this.lines.push(...t),this._rebuildMesh(),t.map(e=>e.id)}removeLine(...e){let t=0;for(let n of e){let e=this.lines.findIndex(e=>e.id===n);if(e===-1){console.warn(`FlowingLight2DPass: Line with id "${n}" not found`);continue}this.lines.splice(e,1),t++}return t>0&&this._rebuildMesh(),t}setLine(e){let{id:t,points:n}=e,r=__rest(e,[`id`,`points`]),o=this.lines.findIndex(e=>e.id===t);if(o===-1){console.warn(`FlowingLight2DPass: Line with id "${t}" not found`);return}let s=this.lines[o],c=Object.assign({},r);n&&(c.points=this.toInternal(n));let l=Object.assign(Object.assign({},s),c),u=c.points&&c.points.length!==s.points.length;this.lines[o]=l,u?this._rebuildMesh():this._updateLineAttributes(o,l,s)}_updateLineAttributes(e,t,n){var r,o,s;if(!this.mesh||!this.material)return;let c=this.mesh.geometry,l=0;for(let t=0;t<e;t++)l+=Math.max(0,this.lines[t].points.length-1);let u=t.points.length-1;if(u<=0)return;let d=c.getAttribute(`instanceStart`),f=c.getAttribute(`instanceEnd`),p=c.getAttribute(`instanceColor`),m=c.getAttribute(`instanceData`),h=c.getAttribute(`instanceMeta`),g=0;for(let c=0;c<u;c++){let u=l+c,_=t.points[c],v=t.points[c+1],y=_.distanceTo(v);t.points!==n.points&&(d.setXYZ(u,_.x,_.y,_.z),f.setXYZ(u,v.x,v.y,v.z)),(t.color!==n.color||t.opacity!==n.opacity)&&p.setXYZW(u,t.color.r,t.color.g,t.color.b,(r=t.opacity)==null?1:r),(t.points!==n.points||t.lineWidth!==n.lineWidth)&&m.setXYZW(u,e,c,g,(o=t.lineWidth)==null?1:o),(t.totalLength!==n.totalLength||t.duration!==n.duration||t.tailLengthRatio!==n.tailLengthRatio)&&h.setXYZ(u,t.totalLength,(t.duration||1e3)/1e3,(s=t.tailLengthRatio)==null?.2:s),g+=y}t.points!==n.points&&(d.needsUpdate=!0,f.needsUpdate=!0,m.needsUpdate=!0),(t.color!==n.color||t.opacity!==n.opacity)&&(p.needsUpdate=!0),t.lineWidth!==n.lineWidth&&(m.needsUpdate=!0),(t.totalLength!==n.totalLength||t.duration!==n.duration||t.tailLengthRatio!==n.tailLengthRatio)&&(h.needsUpdate=!0)}_rebuildMesh(){if(this.dispose(),this.lines.length===0)return;let e=0;if(this.lines.forEach(t=>{e+=Math.max(0,t.points.length-1)}),e===0)return;let t=new three.PlaneBufferGeometry(1,20,1,1);t.rotateZ(Math.PI/2);let n=new Float32Array(e*3),r=new Float32Array(e*3),o=new Float32Array(e*4),s=new Float32Array(e*4),c=new Float32Array(e*3),l=new Float32Array(e),u=0;this.lines.forEach((e,t)=>{var d,f,p,m;let h=e.points.length-1;if(h<=0)return;let g=0;for(let _=0;_<h;_++){let h=e.points[_],v=e.points[_+1],y=h.distanceTo(v),b=u*3,S=u*4;n[b+0]=h.x,n[b+1]=h.y,n[b+2]=h.z,r[b+0]=v.x,r[b+1]=v.y,r[b+2]=v.z,o[S+0]=e.color.r,o[S+1]=e.color.g,o[S+2]=e.color.b,o[S+3]=(d=e.opacity)==null?1:d,s[S+0]=t,s[S+1]=_,s[S+2]=g,s[S+3]=(f=e.lineWidth)==null?1:f,c[b+0]=e.totalLength,c[b+1]=(e.duration||1e3)/1e3,c[b+2]=(p=e.tailLengthRatio)==null?.2:p,l[u]=((m=e.startTime)==null?0:m)/1e3,g+=y,u++}}),t.setAttribute(`instanceStart`,new three.InstancedBufferAttribute(n,3)),t.setAttribute(`instanceEnd`,new three.InstancedBufferAttribute(r,3)),t.setAttribute(`instanceColor`,new three.InstancedBufferAttribute(o,4)),t.setAttribute(`instanceData`,new three.InstancedBufferAttribute(s,4)),t.setAttribute(`instanceMeta`,new three.InstancedBufferAttribute(c,3)),t.setAttribute(`instanceStartTime`,new three.InstancedBufferAttribute(l,1)),this.material=new three.ShaderMaterial({uniforms:{uTime:{value:this.uTime},resolution:{value:new three.Vector2(this.camera.resolution.x,this.camera.resolution.y)},fiveProjectionMatrix:{value:this.camera.projectionMatrix},fiveViewMatrix:{value:this.camera.matrixWorldInverse}},vertexShader:instanceVertexShader$1,fragmentShader:instanceFragmentShader$1,transparent:!0,depthWrite:!1,side:three.DoubleSide}),this.mesh=new three.InstancedMesh(t,this.material,e),this.mesh.frustumCulled=!1,this.lineScene.add(this.mesh)}render(e,t,n,r,o){let s=!!(this.mesh&&this.material);s&&(this.uTime+=r);let c=n.width,l=n.height;(this.lineRenderTarget.width!==c||this.lineRenderTarget.height!==l)&&this.lineRenderTarget.setSize(c,l);let u=e.getRenderTarget(),d=e.getClearColor(),f=e.getClearAlpha();e.setRenderTarget(this.lineRenderTarget),e.setClearColor(0,0),e.clear(),s&&(this.material.uniforms.uTime.value=this.uTime,this.material.uniforms.resolution.value.set(c,l),this.material.uniforms.fiveProjectionMatrix.value=this.camera.projectionMatrix,this.material.uniforms.fiveViewMatrix.value=this.camera.matrixWorldInverse,e.render(this.lineScene,this.orthoCamera)),e.setRenderTarget(u),e.setClearColor(d,f),this.blendMaterial.uniforms.tDiffuse.value=n.texture,this.blendMaterial.uniforms.tLine.value=this.lineRenderTarget.texture;let p=this.renderToScreen?null:t;e.setRenderTarget(p),this.blendQuad.render(e)}dispose(){this.mesh&&(this.mesh.geometry.dispose(),this.lineScene.remove(this.mesh),this.mesh=null),this.material&&(this.material.dispose(),this.material=null),this.lineRenderTarget&&this.lineRenderTarget.dispose(),this.blendMaterial&&this.blendMaterial.dispose(),this.blendQuad&&this.blendQuad.dispose()}},instanceVertexShader=`
|
|
1307
1307
|
attribute vec3 instanceStart; // 线段起点
|
|
1308
1308
|
attribute vec3 instanceEnd; // 线段终点
|
|
1309
1309
|
attribute vec4 instanceColor; // 线段颜色 (rgb + opacity)
|
|
@@ -1331,11 +1331,11 @@ void main() {
|
|
|
1331
1331
|
void main() {
|
|
1332
1332
|
vUv = uv;
|
|
1333
1333
|
vColor = instanceColor;
|
|
1334
|
-
|
|
1334
|
+
|
|
1335
1335
|
// 计算线段的世界坐标
|
|
1336
1336
|
vec3 segmentStart = instanceStart;
|
|
1337
1337
|
vec3 segmentEnd = instanceEnd;
|
|
1338
|
-
|
|
1338
|
+
|
|
1339
1339
|
// 计算当前线段的信息
|
|
1340
1340
|
float totalLength = instanceMeta.x;
|
|
1341
1341
|
float duration = instanceMeta.y;
|
|
@@ -1343,32 +1343,32 @@ void main() {
|
|
|
1343
1343
|
float segmentLength = length(segmentEnd - segmentStart);
|
|
1344
1344
|
float accumulatedLength = instanceData.z;
|
|
1345
1345
|
float lineWidth = instanceData.w;
|
|
1346
|
-
|
|
1346
|
+
|
|
1347
1347
|
// 传递给 fragment shader 用于计算渐变
|
|
1348
1348
|
vSegmentLength = segmentLength;
|
|
1349
1349
|
vAccumulatedLength = accumulatedLength;
|
|
1350
1350
|
vTotalLength = totalLength;
|
|
1351
|
-
|
|
1351
|
+
|
|
1352
1352
|
// 计算相对时间(从线条开始时间算起)
|
|
1353
1353
|
float relativeTime = uTime - instanceStartTime;
|
|
1354
|
-
|
|
1354
|
+
|
|
1355
1355
|
// 计算流光的头部和尾部位置
|
|
1356
1356
|
float tailLengthWorld = totalLength * clamp(relativeTime / duration, 0.0, tailLengthRatio);
|
|
1357
1357
|
float headPosWorld = mod(relativeTime / duration, 1.0) * totalLength;
|
|
1358
1358
|
float tailPosWorld = headPosWorld - tailLengthWorld;
|
|
1359
1359
|
if (tailPosWorld < 0.0) tailPosWorld += totalLength;
|
|
1360
|
-
|
|
1360
|
+
|
|
1361
1361
|
vHeadPos = headPosWorld;
|
|
1362
1362
|
vTailPos = tailPosWorld;
|
|
1363
1363
|
vTailLength = tailLengthWorld;
|
|
1364
|
-
|
|
1364
|
+
|
|
1365
1365
|
// 传递 lineWidth 到 fragment shader
|
|
1366
1366
|
vLineWidth = lineWidth;
|
|
1367
|
-
|
|
1367
|
+
|
|
1368
1368
|
// 计算线段起点和终点的屏幕坐标(NDC)
|
|
1369
1369
|
vec4 clipStart = fiveProjectionMatrix * fiveViewMatrix * vec4(segmentStart, 1.0);
|
|
1370
1370
|
vec4 clipEnd = fiveProjectionMatrix * fiveViewMatrix * vec4(segmentEnd, 1.0);
|
|
1371
|
-
|
|
1371
|
+
|
|
1372
1372
|
// 处理端点在相机后面的情况:将线段裁剪到近平面
|
|
1373
1373
|
// 当 clip.w <= 0 时,点在相机后面,NDC 会翻转导致线段消失
|
|
1374
1374
|
float nearEps = 0.001;
|
|
@@ -1385,44 +1385,44 @@ void main() {
|
|
|
1385
1385
|
float t_clip = (nearEps - clipEnd.w) / (clipStart.w - clipEnd.w);
|
|
1386
1386
|
clipEnd = mix(clipEnd, clipStart, t_clip);
|
|
1387
1387
|
}
|
|
1388
|
-
|
|
1388
|
+
|
|
1389
1389
|
vec2 ndcStart = clipStart.xy / clipStart.w;
|
|
1390
1390
|
vec2 ndcEnd = clipEnd.xy / clipEnd.w;
|
|
1391
|
-
|
|
1391
|
+
|
|
1392
1392
|
vSegmentStartScreen = ndcStart;
|
|
1393
1393
|
vSegmentEndScreen = ndcEnd;
|
|
1394
|
-
|
|
1394
|
+
|
|
1395
1395
|
// 转换到屏幕空间(像素坐标)
|
|
1396
1396
|
vec2 screenStart = (ndcStart + 1.0) * 0.5 * resolution;
|
|
1397
1397
|
vec2 screenEnd = (ndcEnd + 1.0) * 0.5 * resolution;
|
|
1398
|
-
|
|
1398
|
+
|
|
1399
1399
|
vec2 dir = normalize(screenEnd - screenStart);
|
|
1400
1400
|
vec2 normal = vec2(-dir.y, dir.x);
|
|
1401
|
-
|
|
1401
|
+
|
|
1402
1402
|
// PlaneGeometry(1, 20) 旋转 90° 后:
|
|
1403
1403
|
// position.x 对应原来的 -Y(宽度方向,[-10, 10])
|
|
1404
1404
|
// position.y 对应原来的 X(长度方向,[-0.5, 0.5])
|
|
1405
1405
|
float t = position.y + 0.5; // 沿线段的位置 [0, 1]
|
|
1406
|
-
|
|
1406
|
+
|
|
1407
1407
|
// 动态扩展几何体边界:基于 lineWidth 确保光线不被裁剪,但限制扩展范围
|
|
1408
1408
|
// position.x 范围是 [-10, 10](PlaneGeometry 宽度 20)
|
|
1409
1409
|
float expandedWidth = lineWidth * (1.0 + abs(position.x) * 0.2);
|
|
1410
1410
|
vec2 offset = normal * position.x * expandedWidth;
|
|
1411
1411
|
vec2 screenPos = mix(screenStart, screenEnd, t) + offset;
|
|
1412
|
-
|
|
1412
|
+
|
|
1413
1413
|
// 转换回 NDC
|
|
1414
1414
|
vec2 ndc = (screenPos / resolution) * 2.0 - 1.0;
|
|
1415
|
-
|
|
1415
|
+
|
|
1416
1416
|
// 使用裁剪后的 clip 坐标插值深度,避免原始端点在相机后面导致 w < 0
|
|
1417
1417
|
vec4 clipPos = mix(clipStart, clipEnd, t);
|
|
1418
1418
|
// 确保 w 不为负(安全兜底)
|
|
1419
1419
|
if (clipPos.w < nearEps) clipPos.w = nearEps;
|
|
1420
|
-
|
|
1420
|
+
|
|
1421
1421
|
gl_Position = vec4(ndc * clipPos.w, clipPos.z, clipPos.w);
|
|
1422
1422
|
}
|
|
1423
1423
|
`,instanceFragmentShader=`
|
|
1424
1424
|
uniform vec2 resolution;
|
|
1425
|
-
|
|
1425
|
+
|
|
1426
1426
|
varying vec4 vColor;
|
|
1427
1427
|
varying vec2 vUv;
|
|
1428
1428
|
varying float vSegmentLength;
|
|
@@ -1443,7 +1443,7 @@ void main() {
|
|
|
1443
1443
|
float d = from - to;
|
|
1444
1444
|
return (d < 0.0) ? d + totalLength : d;
|
|
1445
1445
|
}
|
|
1446
|
-
|
|
1446
|
+
|
|
1447
1447
|
// 胶囊形距离场:线段 + 圆形端点(圆角线条)
|
|
1448
1448
|
float sdCapsule(vec2 p, vec2 a, vec2 b) {
|
|
1449
1449
|
vec2 pa = p - a;
|
|
@@ -1455,68 +1455,68 @@ void main() {
|
|
|
1455
1455
|
void main() {
|
|
1456
1456
|
// 获取当前片元的屏幕坐标(NDC)
|
|
1457
1457
|
vec2 uv = (gl_FragCoord.xy / resolution) * 2.0 - 1.0;
|
|
1458
|
-
|
|
1458
|
+
|
|
1459
1459
|
// 计算屏幕空间的方向和距离
|
|
1460
1460
|
vec2 screenDiff = vSegmentEndScreen - vSegmentStartScreen;
|
|
1461
1461
|
float screenDist = length(screenDiff);
|
|
1462
|
-
|
|
1462
|
+
|
|
1463
1463
|
if (screenDist < 1e-6) {
|
|
1464
1464
|
discard;
|
|
1465
1465
|
}
|
|
1466
|
-
|
|
1466
|
+
|
|
1467
1467
|
vec2 screenDir = screenDiff / screenDist;
|
|
1468
|
-
|
|
1468
|
+
|
|
1469
1469
|
// 将当前像素投影到线段上(与原逻辑一致)
|
|
1470
1470
|
float projRatio = clamp(dot(uv - vSegmentStartScreen, screenDir), 0.0, screenDist) / screenDist;
|
|
1471
|
-
|
|
1471
|
+
|
|
1472
1472
|
// 通过投影比例计算在世界空间路径上的位置
|
|
1473
1473
|
float projWorld = projRatio * vSegmentLength;
|
|
1474
1474
|
float posAlongPathWorld = vAccumulatedLength + projWorld;
|
|
1475
|
-
|
|
1475
|
+
|
|
1476
1476
|
// 检查是否在流光范围内(头尾之间)
|
|
1477
1477
|
if (!inSegment(posAlongPathWorld, vTailPos, vHeadPos)) {
|
|
1478
1478
|
discard;
|
|
1479
1479
|
}
|
|
1480
|
-
|
|
1480
|
+
|
|
1481
1481
|
// 计算渐变强度(与原逻辑一致)
|
|
1482
1482
|
float distAlong = pathDistance(posAlongPathWorld, vTailPos, vTotalLength);
|
|
1483
1483
|
float grad = clamp(distAlong / vTailLength, 0.0, 1.0);
|
|
1484
1484
|
|
|
1485
1485
|
vec2 aspect = vec2(resolution.x / resolution.y, 1.0);
|
|
1486
|
-
|
|
1486
|
+
|
|
1487
1487
|
// 使用胶囊形距离场(圆角线条)
|
|
1488
1488
|
float dScreen = sdCapsule(uv * aspect, vSegmentStartScreen * aspect, vSegmentEndScreen * aspect);
|
|
1489
|
-
|
|
1489
|
+
|
|
1490
1490
|
// 使用 lineWidth 控制视觉粗细
|
|
1491
1491
|
float baseDecay = 200.0 * (1.0 / vLineWidth);
|
|
1492
|
-
|
|
1492
|
+
|
|
1493
1493
|
// 核心光线 + 紧凑光晕,避免远距离散射产生噪点
|
|
1494
1494
|
float coreGlow = exp(-dScreen * baseDecay * 2.5);
|
|
1495
1495
|
float softGlow = exp(-dScreen * baseDecay * 1.2);
|
|
1496
1496
|
float rawGlow = coreGlow * 0.8 + softGlow * 0.2;
|
|
1497
|
-
|
|
1497
|
+
|
|
1498
1498
|
// 抗锯齿:用 fwidth 在像素边界做平滑过渡,消除远距离锯齿
|
|
1499
1499
|
// fwidth(dScreen) 表示距离场在相邻像素间的变化量
|
|
1500
1500
|
// 当变化量大(远距离/线段短)时,smoothstep 的过渡带更宽,边缘更柔和
|
|
1501
1501
|
float fw = fwidth(dScreen);
|
|
1502
1502
|
// 对 rawGlow 做亚像素平滑:glow 值在 [0, fw*3] 范围内从 0 过渡到自身
|
|
1503
1503
|
float aaGlow = rawGlow * smoothstep(0.0, fw * 3.0, rawGlow);
|
|
1504
|
-
|
|
1504
|
+
|
|
1505
1505
|
float glow = aaGlow * grad;
|
|
1506
|
-
|
|
1506
|
+
|
|
1507
1507
|
// 硬截断:距离过远的片元直接丢弃,避免大量微弱片元累积产生噪点
|
|
1508
1508
|
if (glow < 0.005) discard;
|
|
1509
|
-
|
|
1509
|
+
|
|
1510
1510
|
// 组合流光强度
|
|
1511
1511
|
float alpha = glow * vColor.a;
|
|
1512
|
-
|
|
1512
|
+
|
|
1513
1513
|
if (alpha < 0.01) discard;
|
|
1514
|
-
|
|
1514
|
+
|
|
1515
1515
|
gl_FragColor = vec4(vColor.rgb, alpha);
|
|
1516
1516
|
}
|
|
1517
1517
|
`,blendVertexShader=`
|
|
1518
1518
|
varying vec2 vUv;
|
|
1519
|
-
|
|
1519
|
+
|
|
1520
1520
|
void main() {
|
|
1521
1521
|
vUv = uv;
|
|
1522
1522
|
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
@@ -1524,19 +1524,19 @@ void main() {
|
|
|
1524
1524
|
`,blendFragmentShader=`
|
|
1525
1525
|
uniform sampler2D tDiffuse;
|
|
1526
1526
|
uniform sampler2D tLine;
|
|
1527
|
-
|
|
1527
|
+
|
|
1528
1528
|
varying vec2 vUv;
|
|
1529
|
-
|
|
1529
|
+
|
|
1530
1530
|
void main() {
|
|
1531
1531
|
vec4 base = texture2D(tDiffuse, vUv);
|
|
1532
1532
|
vec4 line = texture2D(tLine, vUv);
|
|
1533
|
-
|
|
1533
|
+
|
|
1534
1534
|
// 使用加法混合叠加流光效果
|
|
1535
1535
|
vec3 color = base.rgb + line.rgb * line.a;
|
|
1536
|
-
|
|
1536
|
+
|
|
1537
1537
|
gl_FragColor = vec4(color, base.a);
|
|
1538
1538
|
}
|
|
1539
|
-
`,FlowingLight3DPass=class extends FivePass{constructor(e){super(),this.mesh=null,this.material=null,this.uTime=0,this.lines=[],this.uTime=0,this.camera=e,this.lineScene=new three.Scene,this.orthoCamera=new three.OrthographicCamera(-1,1,1,-1,0,1),this.lineRenderTarget=new three.WebGLRenderTarget(this.camera.resolution.x,this.camera.resolution.y,{minFilter:three.LinearFilter,magFilter:three.LinearFilter,format:three.RGBAFormat,encoding:three.sRGBEncoding}),this.blendMaterial=new three.ShaderMaterial({uniforms:{tDiffuse:{value:null},tLine:{value:this.lineRenderTarget.texture}},vertexShader:blendVertexShader,fragmentShader:blendFragmentShader,transparent:!1,depthTest:!1,depthWrite:!1}),this.blendQuad=new FullScreenQuad(this.blendMaterial);let t=this.enabled;Object.defineProperty(this,`enabled`,{get(){return t},set(e){t=e,t===!1&&(this.uTime=0)}})}setLines(e){this.lines=e.map(e=>{var t;return Object.assign(Object.assign({},e),{id:e.id||createUuid(),startTime:(t=e.startTime)==null?this.uTime*1e3:t})}),this._rebuildMesh()}addLine(...e){let t=e.map(e=>{var t;return Object.assign(Object.assign({},e),{id:e.id||createUuid(),startTime:(t=e.startTime)==null?this.uTime*1e3:t})});return this.lines.push(...t),this._rebuildMesh(),t.map(e=>e.id)}removeLine(...e){let t=0;for(let n of e){let e=this.lines.findIndex(e=>e.id===n);if(e===-1){console.warn(`FlowingLight3DPass: Line with id "${n}" not found`);continue}this.lines.splice(e,1),t++}return t>0&&this._rebuildMesh(),t}setLine(e){let{id:t}=e,n=__rest(e,[`id`]),r=this.lines.findIndex(e=>e.id===t);if(r===-1){console.warn(`FlowingLight3DPass: Line with id "${t}" not found`);return}let o=this.lines[r],s=Object.assign(Object.assign({},o),n),c=n.points&&n.points.length!==o.points.length;this.lines[r]=s,c?this._rebuildMesh():this._updateLineAttributes(r,s,o)}_updateLineAttributes(e,t,n){var r,o,s;if(!this.mesh||!this.material)return;let c=this.mesh.geometry,l=0;for(let t=0;t<e;t++)l+=Math.max(0,this.lines[t].points.length-1);let u=t.points.length-1;if(u<=0)return;let d=c.getAttribute(`instanceStart`),f=c.getAttribute(`instanceEnd`),p=c.getAttribute(`instanceColor`),m=c.getAttribute(`instanceData`),h=c.getAttribute(`instanceMeta`),g=0;for(let c=0;c<u;c++){let u=l+c,_=t.points[c],v=t.points[c+1],y=_.distanceTo(v);t.points!==n.points&&(d.setXYZ(u,_.x,_.y,_.z),f.setXYZ(u,v.x,v.y,v.z)),(t.color!==n.color||t.opacity!==n.opacity)&&p.setXYZW(u,t.color.r,t.color.g,t.color.b,(r=t.opacity)==null?1:r),(t.points!==n.points||t.lineWidth!==n.lineWidth)&&m.setXYZW(u,e,c,g,(o=t.lineWidth)==null?1:o),(t.totalLength!==n.totalLength||t.duration!==n.duration||t.tailLengthRatio!==n.tailLengthRatio)&&h.setXYZ(u,t.totalLength,(t.duration||1e3)/1e3,(s=t.tailLengthRatio)==null?.2:s),g+=y}t.points!==n.points&&(d.needsUpdate=!0,f.needsUpdate=!0,m.needsUpdate=!0),(t.color!==n.color||t.opacity!==n.opacity)&&(p.needsUpdate=!0),t.lineWidth!==n.lineWidth&&(m.needsUpdate=!0),(t.totalLength!==n.totalLength||t.duration!==n.duration||t.tailLengthRatio!==n.tailLengthRatio)&&(h.needsUpdate=!0)}_rebuildMesh(){if(this.dispose(),this.lines.length===0)return;let e=0;if(this.lines.forEach(t=>{e+=Math.max(0,t.points.length-1)}),e===0)return;let t=new three.PlaneBufferGeometry(1,20,1,1);t.rotateZ(Math.PI/2);let n=new Float32Array(e*3),r=new Float32Array(e*3),o=new Float32Array(e*4),s=new Float32Array(e*4),c=new Float32Array(e*3),l=new Float32Array(e),u=0;this.lines.forEach((e,t)=>{var d,f,p,m;let h=e.points.length-1;if(h<=0)return;let g=0;for(let _=0;_<h;_++){let h=e.points[_],v=e.points[_+1],y=h.distanceTo(v),b=u*3,S=u*4;n[b+0]=h.x,n[b+1]=h.y,n[b+2]=h.z,r[b+0]=v.x,r[b+1]=v.y,r[b+2]=v.z,o[S+0]=e.color.r,o[S+1]=e.color.g,o[S+2]=e.color.b,o[S+3]=(d=e.opacity)==null?1:d,s[S+0]=t,s[S+1]=_,s[S+2]=g,s[S+3]=(f=e.lineWidth)==null?1:f,c[b+0]=e.totalLength,c[b+1]=(e.duration||1e3)/1e3,c[b+2]=(p=e.tailLengthRatio)==null?.2:p,l[u]=((m=e.startTime)==null?0:m)/1e3,g+=y,u++}}),t.setAttribute(`instanceStart`,new three.InstancedBufferAttribute(n,3)),t.setAttribute(`instanceEnd`,new three.InstancedBufferAttribute(r,3)),t.setAttribute(`instanceColor`,new three.InstancedBufferAttribute(o,4)),t.setAttribute(`instanceData`,new three.InstancedBufferAttribute(s,4)),t.setAttribute(`instanceMeta`,new three.InstancedBufferAttribute(c,3)),t.setAttribute(`instanceStartTime`,new three.InstancedBufferAttribute(l,1)),this.material=new three.ShaderMaterial({uniforms:{uTime:{value:this.uTime},resolution:{value:new three.Vector2(this.camera.resolution.x,this.camera.resolution.y)},fiveProjectionMatrix:{value:this.camera.projectionMatrix},fiveViewMatrix:{value:this.camera.matrixWorldInverse}},vertexShader:instanceVertexShader,fragmentShader:instanceFragmentShader,transparent:!0,depthWrite:!1,side:three.DoubleSide}),this.mesh=new three.InstancedMesh(t,this.material,e),this.mesh.frustumCulled=!1,this.lineScene.add(this.mesh)}render(e,t,n,r,o){
|
|
1539
|
+
`,FlowingLight3DPass=class extends FivePass{constructor(e){super(),this.mesh=null,this.material=null,this.uTime=0,this.lines=[],this.uTime=0,this.camera=e,this.lineScene=new three.Scene,this.orthoCamera=new three.OrthographicCamera(-1,1,1,-1,0,1),this.lineRenderTarget=new three.WebGLRenderTarget(this.camera.resolution.x,this.camera.resolution.y,{minFilter:three.LinearFilter,magFilter:three.LinearFilter,format:three.RGBAFormat,encoding:three.sRGBEncoding}),this.blendMaterial=new three.ShaderMaterial({uniforms:{tDiffuse:{value:null},tLine:{value:this.lineRenderTarget.texture}},vertexShader:blendVertexShader,fragmentShader:blendFragmentShader,transparent:!1,depthTest:!1,depthWrite:!1}),this.blendQuad=new FullScreenQuad(this.blendMaterial);let t=this.enabled;Object.defineProperty(this,`enabled`,{get(){return t},set(e){t=e,t===!1&&(this.uTime=0)}})}setLines(e){this.lines=e.map(e=>{var t;return Object.assign(Object.assign({},e),{id:e.id||createUuid(),startTime:(t=e.startTime)==null?this.uTime*1e3:t})}),this._rebuildMesh()}addLine(...e){let t=e.map(e=>{var t;return Object.assign(Object.assign({},e),{id:e.id||createUuid(),startTime:(t=e.startTime)==null?this.uTime*1e3:t})});return this.lines.push(...t),this._rebuildMesh(),t.map(e=>e.id)}removeLine(...e){let t=0;for(let n of e){let e=this.lines.findIndex(e=>e.id===n);if(e===-1){console.warn(`FlowingLight3DPass: Line with id "${n}" not found`);continue}this.lines.splice(e,1),t++}return t>0&&this._rebuildMesh(),t}setLine(e){let{id:t}=e,n=__rest(e,[`id`]),r=this.lines.findIndex(e=>e.id===t);if(r===-1){console.warn(`FlowingLight3DPass: Line with id "${t}" not found`);return}let o=this.lines[r],s=Object.assign(Object.assign({},o),n),c=n.points&&n.points.length!==o.points.length;this.lines[r]=s,c?this._rebuildMesh():this._updateLineAttributes(r,s,o)}_updateLineAttributes(e,t,n){var r,o,s;if(!this.mesh||!this.material)return;let c=this.mesh.geometry,l=0;for(let t=0;t<e;t++)l+=Math.max(0,this.lines[t].points.length-1);let u=t.points.length-1;if(u<=0)return;let d=c.getAttribute(`instanceStart`),f=c.getAttribute(`instanceEnd`),p=c.getAttribute(`instanceColor`),m=c.getAttribute(`instanceData`),h=c.getAttribute(`instanceMeta`),g=0;for(let c=0;c<u;c++){let u=l+c,_=t.points[c],v=t.points[c+1],y=_.distanceTo(v);t.points!==n.points&&(d.setXYZ(u,_.x,_.y,_.z),f.setXYZ(u,v.x,v.y,v.z)),(t.color!==n.color||t.opacity!==n.opacity)&&p.setXYZW(u,t.color.r,t.color.g,t.color.b,(r=t.opacity)==null?1:r),(t.points!==n.points||t.lineWidth!==n.lineWidth)&&m.setXYZW(u,e,c,g,(o=t.lineWidth)==null?1:o),(t.totalLength!==n.totalLength||t.duration!==n.duration||t.tailLengthRatio!==n.tailLengthRatio)&&h.setXYZ(u,t.totalLength,(t.duration||1e3)/1e3,(s=t.tailLengthRatio)==null?.2:s),g+=y}t.points!==n.points&&(d.needsUpdate=!0,f.needsUpdate=!0,m.needsUpdate=!0),(t.color!==n.color||t.opacity!==n.opacity)&&(p.needsUpdate=!0),t.lineWidth!==n.lineWidth&&(m.needsUpdate=!0),(t.totalLength!==n.totalLength||t.duration!==n.duration||t.tailLengthRatio!==n.tailLengthRatio)&&(h.needsUpdate=!0)}_rebuildMesh(){if(this.dispose(),this.lines.length===0)return;let e=0;if(this.lines.forEach(t=>{e+=Math.max(0,t.points.length-1)}),e===0)return;let t=new three.PlaneBufferGeometry(1,20,1,1);t.rotateZ(Math.PI/2);let n=new Float32Array(e*3),r=new Float32Array(e*3),o=new Float32Array(e*4),s=new Float32Array(e*4),c=new Float32Array(e*3),l=new Float32Array(e),u=0;this.lines.forEach((e,t)=>{var d,f,p,m;let h=e.points.length-1;if(h<=0)return;let g=0;for(let _=0;_<h;_++){let h=e.points[_],v=e.points[_+1],y=h.distanceTo(v),b=u*3,S=u*4;n[b+0]=h.x,n[b+1]=h.y,n[b+2]=h.z,r[b+0]=v.x,r[b+1]=v.y,r[b+2]=v.z,o[S+0]=e.color.r,o[S+1]=e.color.g,o[S+2]=e.color.b,o[S+3]=(d=e.opacity)==null?1:d,s[S+0]=t,s[S+1]=_,s[S+2]=g,s[S+3]=(f=e.lineWidth)==null?1:f,c[b+0]=e.totalLength,c[b+1]=(e.duration||1e3)/1e3,c[b+2]=(p=e.tailLengthRatio)==null?.2:p,l[u]=((m=e.startTime)==null?0:m)/1e3,g+=y,u++}}),t.setAttribute(`instanceStart`,new three.InstancedBufferAttribute(n,3)),t.setAttribute(`instanceEnd`,new three.InstancedBufferAttribute(r,3)),t.setAttribute(`instanceColor`,new three.InstancedBufferAttribute(o,4)),t.setAttribute(`instanceData`,new three.InstancedBufferAttribute(s,4)),t.setAttribute(`instanceMeta`,new three.InstancedBufferAttribute(c,3)),t.setAttribute(`instanceStartTime`,new three.InstancedBufferAttribute(l,1)),this.material=new three.ShaderMaterial({uniforms:{uTime:{value:this.uTime},resolution:{value:new three.Vector2(this.camera.resolution.x,this.camera.resolution.y)},fiveProjectionMatrix:{value:this.camera.projectionMatrix},fiveViewMatrix:{value:this.camera.matrixWorldInverse}},vertexShader:instanceVertexShader,fragmentShader:instanceFragmentShader,transparent:!0,depthWrite:!1,side:three.DoubleSide}),this.mesh=new three.InstancedMesh(t,this.material,e),this.mesh.frustumCulled=!1,this.lineScene.add(this.mesh)}render(e,t,n,r,o){let s=!!(this.mesh&&this.material);s&&(this.uTime+=r);let c=n.width,l=n.height;(this.lineRenderTarget.width!==c||this.lineRenderTarget.height!==l)&&this.lineRenderTarget.setSize(c,l);let u=e.getRenderTarget(),d=e.getClearColor(),f=e.getClearAlpha();e.setRenderTarget(this.lineRenderTarget),e.setClearColor(0,0),e.clear(),s&&(this.material.uniforms.uTime.value=this.uTime,this.material.uniforms.resolution.value.set(c,l),this.material.uniforms.fiveProjectionMatrix.value=this.camera.projectionMatrix,this.material.uniforms.fiveViewMatrix.value=this.camera.matrixWorldInverse,e.render(this.lineScene,this.orthoCamera)),e.setRenderTarget(u),e.setClearColor(d,f),this.blendMaterial.uniforms.tDiffuse.value=n.texture,this.blendMaterial.uniforms.tLine.value=this.lineRenderTarget.texture;let p=this.renderToScreen?null:t;e.setRenderTarget(p),this.blendQuad.render(e)}dispose(){this.mesh&&(this.mesh.geometry.dispose(),this.lineScene.remove(this.mesh),this.mesh=null),this.material&&(this.material.dispose(),this.material=null),this.lineRenderTarget&&this.lineRenderTarget.dispose(),this.blendMaterial&&this.blendMaterial.dispose(),this.blendQuad&&this.blendQuad.dispose()}},SceneRenderer=class{constructor(){this.name=`SceneRenderer`}clearBuffers(){}render(e,t,n,r,o,s){return o?(e.setRenderTarget(s),e.render(t,r),!0):!1}},scratchViewport$3=new three.Vector4,sampleMaterial=new three.ShaderMaterial({uniforms:{tDiffuse:{value:null},weight:{value:1}},vertexShader:`
|
|
1540
1540
|
varying vec2 vUv;
|
|
1541
1541
|
void main() {
|
|
1542
1542
|
vUv = uv;
|
|
@@ -2717,7 +2717,7 @@ void main() {
|
|
|
2717
2717
|
#include <premultiplied_alpha_fragment>
|
|
2718
2718
|
|
|
2719
2719
|
}
|
|
2720
|
-
`},LineMaterial=class extends three.ShaderMaterial{constructor(e){super({uniforms:three.UniformsUtils.clone(lineShader.uniforms),vertexShader:lineShader.vertexShader,fragmentShader:lineShader.fragmentShader,clipping:!0}),this.type=`LineMaterial`,this.dashed=!1,Object.defineProperties(this,{color:{enumerable:!0,get(){return this.uniforms.diffuse.value},set(e){this.uniforms.diffuse.value=e}},linewidth:{enumerable:!0,get(){return this.uniforms.linewidth.value},set(e){this.uniforms.linewidth.value=e}},dashScale:{enumerable:!0,get(){return this.uniforms.dashScale.value},set(e){this.uniforms.dashScale.value=e}},dashSize:{enumerable:!0,get(){return this.uniforms.dashSize.value},set(e){this.uniforms.dashSize.value=e}},gapSize:{enumerable:!0,get(){return this.uniforms.gapSize.value},set(e){this.uniforms.gapSize.value=e}},opacity:{enumerable:!0,get(){return this.uniforms.opacity.value},set(e){this.uniforms.opacity.value=e}},resolution:{enumerable:!0,get(){return this.uniforms.resolution.value},set(e){this.uniforms.resolution.value.copy(e)}}}),this.setValues(e)}};Object.assign(LineMaterial.prototype,{isLineMaterial:!0});var LineSegments2=class extends three.Mesh{constructor(e,t){super(),this.type=`LineSegments2`,this.geometry=e===void 0?new LineSegmentsGeometry:e,this.material=t===void 0?new LineMaterial({color:Math.random()*16777215}):t}computeLineDistances(){let e=this.geometry,t=e.attributes.instanceStart,n=e.attributes.instanceEnd,r=new Float32Array(2*t.count),o=new three.Vector3,s=new three.Vector3;for(var c=0,l=0,u=t.count;c<u;c++,l+=2)o.fromBufferAttribute(t,c),s.fromBufferAttribute(n,c),r[l]=l===0?0:r[l-1],r[l+1]=r[l]+o.distanceTo(s);let d=new three.InstancedInterleavedBuffer(r,2,1);return e.setAttribute(`instanceDistanceStart`,new three.InterleavedBufferAttribute(d,1,0)),e.setAttribute(`instanceDistanceEnd`,new three.InterleavedBufferAttribute(d,1,1)),this}raycast(e,t){e.camera===null&&console.error(`LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2.`);let n=e.ray,r=e.camera,o=r.projectionMatrix,s=this.geometry,c=this.material,l=c.resolution,u=c.linewidth,d=s.attributes.instanceStart,f=s.attributes.instanceEnd,p=new three.Vector4,m=new three.Vector4,h=new three.Vector4,g=new three.Vector3,_=new three.Matrix4,v=new three.Line3,y=new three.Vector3;n.at(1,h),h.w=1,h.applyMatrix4(r.matrixWorldInverse),h.applyMatrix4(o),h.multiplyScalar(1/h.w),h.x*=l.x/2,h.y*=l.y/2,h.z=0,g.copy(h);let b=this.matrixWorld;_.multiplyMatrices(r.matrixWorldInverse,b);for(var S=0,C=d.count;S<C;S++){p.fromBufferAttribute(d,S),m.fromBufferAttribute(f,S),p.w=1,m.w=1,p.applyMatrix4(_),m.applyMatrix4(_),p.applyMatrix4(o),m.applyMatrix4(o),p.multiplyScalar(1/p.w),m.multiplyScalar(1/m.w);var w=p.z<-1&&m.z<-1,T=p.z>1&&m.z>1;if(w||T)continue;p.x*=l.x/2,p.y*=l.y/2,m.x*=l.x/2,m.y*=l.y/2,v.start.copy(p),v.start.z=0,v.end.copy(m),v.end.z=0;let e=v.closestPointToPointParameter(g,!0);v.at(e,y);let r=three.MathUtils.lerp(p.z,m.z,e),s=r>=-1&&r<=1;var E=g.distanceTo(y)<u*.5;if(s&&E){v.start.fromBufferAttribute(d,S),v.end.fromBufferAttribute(f,S),v.start.applyMatrix4(b),v.end.applyMatrix4(b);var D=new three.Vector3,O=new three.Vector3;n.distanceSqToSegment(v.start,v.end,O,D),t.push({point:O,pointOnLine:D,distance:n.origin.distanceTo(O),object:this,faceIndex:S})}}}};Object.assign(LineSegments2.prototype,{isLineSegments2:!0});var Line2=class extends LineSegments2{constructor(e,t){super(e,t),this.type=`Line2`}};Object.assign(Line2.prototype,{isLine2:!0});var LineGeometry=class extends LineSegmentsGeometry{constructor(){super(),this.type=`LineGeometry`}setPositions(e){let t=e.length-3,n=new Float32Array(2*t);for(let r=0;r<t;r+=3)n[2*r]=e[r],n[2*r+1]=e[r+1],n[2*r+2]=e[r+2],n[2*r+3]=e[r+3],n[2*r+4]=e[r+4],n[2*r+5]=e[r+5];return super.setPositions(n),this}setColors(e){let t=e.length-3,n=new Float32Array(2*t);for(let r=0;r<t;r+=3)n[2*r]=e[r],n[2*r+1]=e[r+1],n[2*r+2]=e[r+2],n[2*r+3]=e[r+3],n[2*r+4]=e[r+4],n[2*r+5]=e[r+5];return super.setColors(n),this}fromLine(e){let t=e.geometry;if(t instanceof three.Geometry){let e=new three.BufferGeometry().fromGeometry(t);this.setPositions(e.attributes.position.array)}else t instanceof three.BufferGeometry&&this.setPositions(t.attributes.position.array);return this}copy(){return this}};Object.assign(LineGeometry.prototype,{isLineGeometry:!0});var circleImageURL=`data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sHDgwCEMBJZu0A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koCyNDVXDSECmNSK4qiKNLq6urW8+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=class extends three.Object3D{static get version(){return`6.8.7`}constructor(e=new three.Vector3,t=new three.Vector3){super(),this.type=`FiveLine`,this.needsRender=!0;let n=new LineGeometry,r=new LineMaterial({color:DEFAULT_COLOR,linewidth:DEFAULT_LINEWIDTH,dashScale:DEFAULT_DASHSCALE,dashed:!1});this.line=new Line2(n,r);let o=new three.BufferGeometry,s=new three.PointsMaterial({color:DEFAULT_COLOR,size:POINT_SIZE,map:sharedCircleTexture||(sharedCircleTexture=new three.TextureLoader().load(`data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAAZiS0dEAAAAAAAA+U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fXKDCipVCoTj8df3QABbW1tLUc6oUgkFPMkVACUNjc337148eKvw8PDbJ2jP1taWkoCyNDVXDSECmNSK4qiKNLq6urW8+fPI/UicHx8rD59+jSVy+WOAKSJhKENwFItLtoxk8mwsixzHR0dHe3t7c5PAU+n09rs7OzJkydPYqVSaQfANoDXALIk31S2smU1TWMPDg7K5XKZ7+3t9TudTut1U7+wsFCcmJiIpdPpbQBxADsAknQWymYCOukBHYCuKApisdhpMpnURFEU79y503TVyKenpzOTk5M7e3t7MQKPV0Zv1gNm+awB0MvlshqLxfLb29uyJElWURSbXC4XXyvqxcXFs6mpqeTc3Nzu3t7e3wQcA7BPZ8Cov1pNlJplmQtAG8MwHV6v95tAINA5MDBwPxAIuLu6upr8fr/VAN3c3JQjkcjZ+vp6fnl5+d2bN29SuVzuNYAEpf01CdRChUL+X1VskHACuA3Ay3Fcu9vt7nA6nZ7m5uYWQRCaNE3jVVW15PP580KhIGUymWw2m00DOAJwSP4WwPtq4LX2Ao6USxNlQyS/RcQcdLGwlNIz6vEMAaZpNzCk2Pll94LK/cDYimxERiBwG10sxjgvEZBE0UpE6vxj+0Ct5bTaXthgEhRmja8QWNkkPGsuIpfdjpkK+cZUWTC0KredVmtD/gdlSl6EG4AMvQAAAABJRU5ErkJggg==`)),sizeAttenuation:!1,transparent:!0});this.points=new three.Points(o,s),this.points.renderOrder=11,this.points.frustumCulled=!1,this.setPoints(e,t),this.add(this.line,this.points)}setPoints(e,t){let n=[].concat(e.toArray(),t.toArray());this.points.geometry.setAttribute(`position`,new three.BufferAttribute(new Float32Array(n),3)),this.line.geometry.setPositions(n),this.line.computeLineDistances(),this.needsRender=!0}getPoints(){let e=this.points.geometry.attributes.position.array;return[new three.Vector3(e[0],e[1],e[2]),new three.Vector3(e[3],e[4],e[5])]}setMaterial(e){let t=this.line.material;for(let n in e){if(!e.hasOwnProperty(n))continue;let r=e[n];n===`dashed`?(t.dashed=r,r?t.defines.USE_DASH=``:delete t.defines.USE_DASH,t.needsUpdate=!0):t[n]=e[n]}this.needsRender=!0}setResolution(e,t){let n=this.line.material.resolution;(n.x!==e||n.y!==t)&&(n.set(e,t),this.needsRender=!0)}};Object.assign(FiveLine.prototype,{isFiveLine:!0});var Constants={Handedness:Object.freeze({NONE:`none`,LEFT:`left`,RIGHT:`right`}),ComponentState:Object.freeze({DEFAULT:`default`,TOUCHED:`touched`,PRESSED:`pressed`}),ComponentProperty:Object.freeze({BUTTON:`button`,X_AXIS:`xAxis`,Y_AXIS:`yAxis`,STATE:`state`}),ComponentType:Object.freeze({TRIGGER:`trigger`,SQUEEZE:`squeeze`,TOUCHPAD:`touchpad`,THUMBSTICK:`thumbstick`,BUTTON:`button`}),ButtonTouchThreshold:.05,AxisTouchThreshold:.1,VisualResponseProperty:Object.freeze({TRANSFORM:`transform`,VISIBILITY:`visibility`})};function fetchJsonFile(e){return __awaiter(this,void 0,void 0,function*(){let t=yield fetch(e);if(t.ok)return t.json();throw Error(t.statusText)})}function fetchProfilesList(e){return __awaiter(this,void 0,void 0,function*(){if(!e)throw Error(`No basePath supplied`);return yield fetchJsonFile(`${e}/profilesList.json`)})}function fetchProfile(e,t){return __awaiter(this,arguments,void 0,function*(e,t,n=null,r=!0){if(!e)throw Error(`No xrInputSource supplied`);if(!t)throw Error(`No basePath supplied`);let o=yield fetchProfilesList(t),s;if(e.profiles.some(e=>{let n=o[e];return n&&(s={profileId:e,profilePath:`${t}/${n.path}`,deprecated:!!n.deprecated}),!!s}),!s){if(!n)throw Error(`No matching profile name found`);let e=o[n];if(!e)throw Error(`No matching profile name found and default profile "${n}" missing.`);s={profileId:n,profilePath:`${t}/${e.path}`,deprecated:!!e.deprecated}}let c=yield fetchJsonFile(s.profilePath),l;if(r){let t;if(t=c.layouts[e.handedness],!t)throw Error(`No matching handedness, ${e.handedness}, in profile ${s.profileId}`);t.assetPath&&(l=s.profilePath.replace(`profile.json`,t.assetPath))}return{profile:c,assetPath:l}})}var defaultComponentValues={xAxis:0,yAxis:0,button:0,state:Constants.ComponentState.DEFAULT};function normalizeAxes(e=0,t=0){let n=e,r=t;if(Math.sqrt(e*e+t*t)>1){let o=Math.atan2(t,e);n=Math.cos(o),r=Math.sin(o)}return{normalizedXAxis:n*.5+.5,normalizedYAxis:r*.5+.5}}var VisualResponse=class{constructor(e){this.componentProperty=e.componentProperty,this.states=e.states,this.valueNodeName=e.valueNodeName,this.valueNodeProperty=e.valueNodeProperty,this.valueNodeProperty===Constants.VisualResponseProperty.TRANSFORM&&(this.minNodeName=e.minNodeName,this.maxNodeName=e.maxNodeName),this.value=0,this.updateFromComponent(defaultComponentValues)}updateFromComponent({xAxis:e,yAxis:t,button:n,state:r}){let{normalizedXAxis:o,normalizedYAxis:s}=normalizeAxes(e,t);switch(this.componentProperty){case Constants.ComponentProperty.X_AXIS:this.value=this.states.includes(r)?o:.5;break;case Constants.ComponentProperty.Y_AXIS:this.value=this.states.includes(r)?s:.5;break;case Constants.ComponentProperty.BUTTON:this.value=this.states.includes(r)?n:0;break;case Constants.ComponentProperty.STATE:this.valueNodeProperty===Constants.VisualResponseProperty.VISIBILITY?this.value=this.states.includes(r):this.value=+!!this.states.includes(r);break;default:throw Error(`Unexpected visualResponse componentProperty ${this.componentProperty}`)}}},Component=class{constructor(e,t){if(!e||!t||!t.visualResponses||!t.gamepadIndices||Object.keys(t.gamepadIndices).length===0)throw Error(`Invalid arguments supplied`);this.id=e,this.type=t.type,this.rootNodeName=t.rootNodeName,this.touchPointNodeName=t.touchPointNodeName,this.visualResponses={},Object.keys(t.visualResponses).forEach(e=>{let n=new VisualResponse(t.visualResponses[e]);this.visualResponses[e]=n}),this.gamepadIndices=Object.assign({},t.gamepadIndices),this.values={state:Constants.ComponentState.DEFAULT,button:this.gamepadIndices.button===void 0?void 0:0,xAxis:this.gamepadIndices.xAxis===void 0?void 0:0,yAxis:this.gamepadIndices.yAxis===void 0?void 0:0}}get data(){return Object.assign({id:this.id},this.values)}updateFromGamepad(e){if(this.values.state=Constants.ComponentState.DEFAULT,this.gamepadIndices.button!==void 0&&e.buttons.length>this.gamepadIndices.button){let t=e.buttons[this.gamepadIndices.button];this.values.button=t.value,this.values.button=this.values.button<0?0:this.values.button,this.values.button=this.values.button>1?1:this.values.button,t.pressed||this.values.button===1?this.values.state=Constants.ComponentState.PRESSED:(t.touched||this.values.button>Constants.ButtonTouchThreshold)&&(this.values.state=Constants.ComponentState.TOUCHED)}this.gamepadIndices.xAxis!==void 0&&e.axes.length>this.gamepadIndices.xAxis&&(this.values.xAxis=e.axes[this.gamepadIndices.xAxis],this.values.xAxis=this.values.xAxis<-1?-1:this.values.xAxis,this.values.xAxis=this.values.xAxis>1?1:this.values.xAxis,this.values.state===Constants.ComponentState.DEFAULT&&Math.abs(this.values.xAxis)>Constants.AxisTouchThreshold&&(this.values.state=Constants.ComponentState.TOUCHED)),this.gamepadIndices.yAxis!==void 0&&e.axes.length>this.gamepadIndices.yAxis&&(this.values.yAxis=e.axes[this.gamepadIndices.yAxis],this.values.yAxis=this.values.yAxis<-1?-1:this.values.yAxis,this.values.yAxis=this.values.yAxis>1?1:this.values.yAxis,this.values.state===Constants.ComponentState.DEFAULT&&Math.abs(this.values.yAxis)>Constants.AxisTouchThreshold&&(this.values.state=Constants.ComponentState.TOUCHED)),Object.values(this.visualResponses).forEach(e=>{e.updateFromComponent(this.values)})}},MotionController=class{constructor(e,t,n){if(!e)throw Error(`No xrInputSource supplied`);if(!t)throw Error(`No profile supplied`);this.xrInputSource=e,this.assetUrl=n,this.id=t.profileId,this.layoutDescription=t.layouts[e.handedness],this.components={},Object.keys(this.layoutDescription.components).forEach(e=>{let t=this.layoutDescription.components[e];this.components[e]=new Component(e,t)}),this.updateFromGamepad()}get gripSpace(){return this.xrInputSource.gripSpace}get targetRaySpace(){return this.xrInputSource.targetRaySpace}get data(){let e=[];return Object.values(this.components).forEach(t=>{e.push(t.data)}),e}updateFromGamepad(){Object.values(this.components).forEach(e=>{e.updateFromGamepad(this.xrInputSource.gamepad)})}},DEFAULT_PROFILES_PATH=`https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles`,DEFAULT_PROFILE=`generic-trigger`,XRControllerModel=class extends three.Object3D{constructor(){super(),this.motionController=null,this.envMap=null}setEnvironmentMap(e){return this.envMap==e?this:(this.envMap=e,this.traverse(e=>{e instanceof three.Mesh&&e.isMesh&&(e.material.envMap=this.envMap,e.material.needsUpdate=!0)}),this)}updateMatrixWorld(e){super.updateMatrixWorld(e),this.motionController&&(this.motionController.updateFromGamepad(),Object.values(this.motionController.components).forEach(e=>{Object.values(e.visualResponses).forEach(e=>{let{valueNode:t,minNode:n,maxNode:r,value:o,valueNodeProperty:s}=e;t&&(s===Constants.VisualResponseProperty.VISIBILITY?t.visible=o:s===Constants.VisualResponseProperty.TRANSFORM&&(t.quaternion.copy(n.quaternion).slerp(r.quaternion,o),t.position.lerpVectors(n.position,r.position,o)))})}))}};function findNodes(e,t){Object.values(e.components).forEach(e=>{let{type:n,touchPointNodeName:r,visualResponses:o}=e;if(n===Constants.ComponentType.TOUCHPAD)if(e.touchPointNode=t.getObjectByName(r),e.touchPointNode){let t=new three.Mesh(new three.SphereGeometry(.001),new three.MeshBasicMaterial({color:255}));e.touchPointNode.add(t)}else console.warn(`Could not find touch dot, ${e.touchPointNodeName}, in touchpad component ${e.id}`);Object.values(o).forEach(e=>{let{valueNodeName:n,minNodeName:r,maxNodeName:o,valueNodeProperty:s}=e;if(s===Constants.VisualResponseProperty.TRANSFORM){if(e.minNode=t.getObjectByName(r),e.maxNode=t.getObjectByName(o),!e.minNode){console.warn(`Could not find ${r} in the model`);return}if(!e.maxNode){console.warn(`Could not find ${o} in the model`);return}}e.valueNode=t.getObjectByName(n),e.valueNode||console.warn(`Could not find ${n} in the model`)})})}function addAssetSceneToControllerModel(e,t){findNodes(e.motionController,t),e.envMap&&t.traverse(t=>{t instanceof three.Mesh&&t.isMesh&&(t.material.envMap=e.envMap,t.material.needsUpdate=!0)}),e.add(t)}var XRControllerModelFactory=class{constructor(e=null){this.gltfLoader=e,this.path=DEFAULT_PROFILES_PATH,this._assetCache={}}createControllerModel(e){let t=new XRControllerModel,n=null;return e.addEventListener(`connected`,e=>{let r=e.data;r.targetRayMode!==`tracked-pointer`||!r.gamepad||fetchProfile(r,this.path,DEFAULT_PROFILE).then(({profile:e,assetPath:o})=>{t.motionController=new MotionController(r,e,o);let s=this._assetCache[t.motionController.assetUrl];if(s)n=s.scene.clone(),addAssetSceneToControllerModel(t,n);else{if(!this.gltfLoader)throw Error(`GLTFLoader not set.`);this.gltfLoader.load(t.motionController.assetUrl,e=>{this._assetCache[t.motionController.assetUrl]=e,n=e.scene.clone(),addAssetSceneToControllerModel(t,n)})}}).catch(e=>{console.warn(e)})}),e.addEventListener(`disconnected`,()=>{t.motionController=null,t.remove(n),n=null}),t}},defaultEffect=`fade`,defaultXRPanoramaControllerInitArgs=Object.assign({},omit(defaultPanoramaControllerCustomInitArgs,[`maxLatitude`,`minLatitude`]));function mapPanoResource(e,t){if(!t)return e;let n=e.match(/\d+_[a-z].png/);return e.substring(0,n.index)+t+`/`+e.substring(n.index)}var CONTROLLER_EVNET_DELTA_TIME=300,scratchRaycaster=new three.Raycaster,scratchVector3=new three.Vector3,XRPanoramaController=class e extends PanoramaController{static parseArgs(t){if(t instanceof e)return t;let n=Object.assign(Object.assign({},t),{maxLatitude:Math.PI/2,minLatitude:-Math.PI/2});return super.parseArgs(n)}static initAnimationEndState(e){let t=this.parseArgs(e),n=super.initAnimationEndState(t);return Object.assign(Object.assign({},n),{mode:`XRPanorama`})}constructor(e){super(e),this.xrManager=new XRManager(this.renderer,this.renderer.getContext(),{onSessionStart:e=>{this.emit(`xr.session.start`,createEvent(`xr.session.start`,{session:e,machineType:this.xrManager.machineType}))},onSessionEnd:()=>{this.emit(`xr.session.end`,createEvent(`xr.session.end`,{session:null,machineType:this.xrManager.machineType}))}}),this.xrControllerRay={left:new three.Raycaster,right:new three.Raycaster},this.xrControllerRay.left.params.Points={threshold:.1},this.xrControllerRay.left.firstHitOnly=!0,this.xrControllerRay.left.floorIndex=-1,this.xrControllerRay.right.params.Points={threshold:.1},this.xrControllerRay.right.firstHitOnly=!0,this.xrControllerRay.right.floorIndex=-1,this.gazeRay=null,this.pointerLines={left:new FiveLine,right:new FiveLine},this.pointerLines.left.visible=!1,this.pointerLines.right.visible=!0,this.pointerLines.left.setMaterial({color:new three.Vector3(1,1,1)}),this.pointerLines.left.points.material.depthTest=!1,this.pointerLines.right.setMaterial({color:new three.Vector3(1,1,1)}),this.pointerLines.right.points.material.depthTest=!1,this.controllerWrappers=[new three.Group,new three.Group];let t=this.xrManager.getController(0);this.controllerWrappers[0].add(t);let n=this.xrManager.getController(1);this.controllerWrappers[1].add(n);let r=new XRControllerModelFactory;r.gltfLoader={load(e,t){internalFetcher.ajax(e,{responseType:`arraybuffer`}).then(t=>{var n;return parseGltf(t.body,{resourcePath:e.slice(0,e.lastIndexOf(`/`)+1),search:(n=e.split(`?`)[1])==null?``:n,fetcher:internalFetcher})}).then(e=>t(e))}},(this.xrManager.machineType===`Oculus`||this.xrManager.machineType===`Pico`)&&this.scene.add(this.pointerLines.left,this.pointerLines.right,this.controllerWrappers[0],this.controllerWrappers[1]),this.panoResources={},this.panoResources[this.locationMotion.keyframes[0].key=this.locationMotion.keyframes[1].key=createUuid$1()]={panoId:panoStringify(this.currentPano),leftPanoPicture:null,position:this.camera.pose.offset.clone(),effect:defaultEffect,effectEasing:defaultEffectEase,fixCameraTransform:new three.Matrix4},this.parallaxCameraMatrixs=[];let o=AnimationFrameLoop.shared.getContext();if(!o){console.error(`获取session失败,请退出重试`);return}this.on(`xr.session.end`,()=>{this.scene.remove(this.pointerLines.left,this.pointerLines.right)}),this.xrManager.setSession(o),this.on(`xr.session.start`,()=>{let e=this.xrManager.getControllerGrip(0);e.add(r.createControllerModel(e)),this.controllerWrappers[0].add(e);let t=this.xrManager.getControllerGrip(1);t.add(r.createControllerModel(t)),this.controllerWrappers[1].add(t)}),this.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}},this.xrManager.machineType===`VP`&&this.initHandEvent()}updateConfiguration(e){return super.updateConfiguration(Object.assign(Object.assign({},e),{maxLatitude:Math.PI/2,minLatitude:-Math.PI/2}))}moveToPano(e,t,n){var r,o,s;this.userAction=n,this.stopMomentumMovement();let c=panoStringify(e),l=this.works.getObserver(e);if(!l)throw Error(`Invalid PanoIndex`);let u=getImageSizeFromURL(l.images.up),d=this.imageOptions.size;d===void 0&&l&&u&&(d=Number(u)),d===void 0&&(d=2048);let f=this.imageOptions.transform,p=(e,t)=>mapPanoResource(applyImageURLOptions(e,f,t)),m=Object.assign({key:`pano.${c}`},pick(this.imageOptions,[`format`,`size`,`quality`])),h={right:l.images.work.getURL(l.images.right),left:l.images.work.getURL(l.images.left),up:l.images.work.getURL(l.images.up),down:l.images.work.getURL(l.images.down),front:l.images.work.getURL(l.images.front),back:l.images.work.getURL(l.images.back)},g=`pano:`+jsonHash([h,m,f]);if(this.pendingPanoTask){if(this.pendingPanoTask.hash===g)return;{let t=this.pendingPanoTask.panoId;(r=this.panoMeshes.get(t))==null||r.setProgress(0),this.emit(`pano.texture.abort`,createEvent(`pano.texture.abort`,{error:null,progress:0,meta:null,pano:e}))}}let _=`move-to-pano-`+c;this.pending.add(_);let v=createExtendableEvent(`pano.prepare`,{options:t,prevMode:this.mode,prevPano:this.currentPano,pano:e});if(this.emit(`pano.prepare`,v),v.defaultPrevented){this.pending.delete(_);return}v.options!==t&&Object.assign(t,v.options);let y=this.modelScene.parameter,b;y.pano0&&y.pano0.map.name===g?b=y.pano0:y.pano1&&y.pano1.map.name===g&&(b=y.pano1);let S=(o=t.effect)==null?defaultEffect:o,C=(s=t.effectEasing)==null?defaultEffectEase:s;if(b){let n={panoId:c,effect:S,effectEasing:C,leftPanoPicture:{panoId:b.panoId,map:b.map,mapHistogram:b.mapHistogram,mapSize:b.mapSize,matrix:l.matrix.clone().premultiply(l.work.transform),zoom:1},position:l.position.clone().applyMatrix4(l.work.transform),fixCameraTransform:new three.Matrix4};n.leftPanoPicture&&this.panoPictureObserverMap.set(n.leftPanoPicture,l),this.pendingPanoTask=void 0,Promise.resolve().then(()=>waitForExtendableEvent(v)).catch(e=>{let t=toError(e);return this.emit(`error`,t),t}).then(r=>{var o,s;if(!(r instanceof Error))this.pending.delete(_),this.pendingPanoTask=void 0,(o=this.panoMeshes.get(c))==null||o.setProgress(0),this.doMoveToPano(e,n,t);else{let e=null;r instanceof Error&&(e||(e=r));let n=Object.assign(Object.assign(Object.assign({},this.currentPano),{mode:this.mode}),clonePose(this.camera.pose));this.emit(`pano.cancel`,createEvent(`pano.cancel`,{error:null,userAction:this.userAction,options:t,prevPano:this.currentPano,pano:{panoIndex:l.panoIndex,workCode:l.work.workCode},progress:0,state:n})),t.moveCancelCallback&&t.moveCancelCallback(),this.emit(`pano.error`,createEvent(`pano.error`,{error:e,userAction:this.userAction,options:t,prevPano:this.currentPano,pano:{panoIndex:l.panoIndex,workCode:l.work.workCode},progress:0,state:n})),e instanceof Error&&e.message&&this.emit(`error`,e),this.pending.delete(_),this.pendingPanoTask=void 0,(s=this.panoMeshes.get(c))==null||s.setProgress(0)}});return}let w=this.panoMeshes.get(c);w&&w.tap&&w.tap(),this.pendingPanoTask={panoId:c,hash:g,onLoad:n=>{var r;let o=n.body;if(this.destroyed)o.dispose();else{o.name=g;let n=Array.isArray(o.image)?o.image[0]:o.image,s=(r=n==null?void 0:n.width)==null?2048:r,u=new Histogram().formPixels(getRgbaDataFromCubeTexture(this.renderer,o,!0,sharedHistogramRgbaData).data),d={panoId:c,effect:S,effectEasing:C,leftPanoPicture:{panoId:c,map:o,mapSize:s,mapHistogram:new three.Vector4().fromArray(u.toArray()),matrix:l.matrix.clone(),zoom:1},position:l.position.clone(),fixCameraTransform:new three.Matrix4};d.leftPanoPicture&&this.panoPictureObserverMap.set(d.leftPanoPicture,l),this.doMoveToPano(e,d,t)}},onError:e=>{let n=Object.assign(Object.assign(Object.assign({},this.currentPano),{mode:this.mode}),clonePose(this.camera.pose));this.emit(`pano.cancel`,createEvent(`pano.cancel`,{error:null,userAction:this.userAction,options:t,prevPano:this.currentPano,pano:{panoIndex:l.panoIndex,workCode:l.work.workCode},progress:0,state:n})),this.emit(`pano.error`,createEvent(`pano.error`,{error:e,userAction:this.userAction,options:t,prevPano:this.currentPano,pano:{panoIndex:l.panoIndex,workCode:l.work.workCode},progress:0,state:n})),e instanceof Error&&e.message&&this.emit(`error`,e),t.moveCancelCallback&&t.moveCancelCallback()}},Promise.all([Promise.resolve().then(()=>{this.emit(`pano.texture.load`,createEvent(`pano.texture.load`,{error:null,progress:0,meta:null,pano:e}))}).then(()=>this.textureLoader.loadCubeTexture(h,{imageURL:{transform:p,options:m},format:three.RGBFormat,viaAjax:!0,fetcher:getFetcher(this.fiveId,l.work)},void 0,void 0,t=>{var n,r;this.emit(`pano.texture.progress`,createEvent(`pano.texture.progress`,{error:null,progress:t,meta:null,pano:e})),((n=this.pendingPanoTask)==null?void 0:n.hash)===g&&((r=this.panoMeshes.get(c))==null||r.setProgress(t))},this.renderer)).catch(t=>{let n=toError(t);return this.emit(`pano.texture.error`,createEvent(`pano.texture.error`,{error:n,progress:0,meta:null,pano:e})),n}),Promise.resolve().then(()=>waitForExtendableEvent(v)).catch(e=>toError(e))]).then(([t,n])=>{var r,o,s,l;if(!(t instanceof Error)&&!(n instanceof Error))this.pending.delete(_),((r=this.pendingPanoTask)==null?void 0:r.hash)===g?(this.pendingPanoTask.onLoad(t),this.pendingPanoTask=void 0,(o=this.panoMeshes.get(c))==null||o.setProgress(0)):t.body.dispose(),this.emit(`pano.texture.success`,createEvent(`pano.texture.success`,{error:null,progress:1,meta:t.meta,pano:e}));else{let e=null;t instanceof Error?e||(e=t):t.body.dispose(),n instanceof Error&&(e||(e=n)),this.pending.delete(_),((s=this.pendingPanoTask)==null?void 0:s.hash)===g&&(this.pendingPanoTask.onError(e),this.pendingPanoTask=void 0,(l=this.panoMeshes.get(c))==null||l.setProgress(0))}})}doMoveToPano(e,t,n={}){var r,o,s,c,l,u,d,f,p,m;let h=now(),g=createUuid$1();this.panoResources[g]=t;let _=1,v,y,b;if(this.locationMotion.ended){let[e,n]=this.locationMotion.getKeyFrameSegment(h),r=this.locationMotion.value,o=this.panoResourceFromLocationMotionKeyframe(n).position,s=t.position;v=Math.max(o.distanceTo(s),1),y=[{key:n.key,progress:0,value:Object.assign(Object.assign({},r),{count:0})},{key:g,progress:1,value:{distance:0,count:1}}],b=0}else{let[e,n]=this.locationMotion.getKeyFrameSegment(h),r=this.locationMotion.value,o=this.panoResourceFromLocationMotionKeyframe(e).position,s=this.panoResourceFromLocationMotionKeyframe(n).position,c=t.position,l=n.value.count-r.count,u=Math.max(o.distanceTo(s),1)*l;v=u+Math.max(s.distanceTo(c),1),y=[{key:e.key,progress:0,value:Object.assign({},r)},{key:n.key,progress:u/v,value:n.value},{key:g,progress:1,value:{count:n.value.count+1,distance:0}}];let d=this.locationMotionKeyframesLength(this.locationMotion.keyframes),f=this.locationMotionKeyframesLength(y);b=this.locationMotion.getProgressVelocity(h)*d/f}let S=t.effect===`instant`?0:this.calculateMovingDuration(n.duration,t.effect===`fly`||t.effect===`model`?v:0),C={longitude:n.longitude,latitude:n.latitude,fov:n.fov},w=Object.assign(Object.assign({},e),{mode:this.mode,longitude:(r=C.longitude)==null?this.camera.pose.longitude:r,latitude:(o=C.latitude)==null?this.camera.pose.latitude:o,fov:(s=C.fov)==null?this.camera.pose.fov:s,offset:t.position.clone(),distance:0}),T=this.currentPano;if(this.emit(`pano.moveTo`,createEvent(`pano.moveTo`,{options:n,prevPano:T,pano:{panoIndex:w.panoIndex,workCode:w.workCode},progress:0,state:w,userAction:this.userAction,error:null})),n.moveStartCallback&&n.moveStartCallback(w),this.perspToOrthoMotion.set({perspToOrtho:0},S).catch(noop),this.modelAlphaMotion.setKeyframes([{progress:0,value:Object.assign({},this.modelAlphaMotion.value)},{progress:.6,value:Object.assign({},this.modelAlphaMotion.value)},{progress:1,value:{modelAlpha:0}}],S).catch(noop),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),t.effect===`fly`||t.effect===`model`)this.cameraMotion.set(C,S).catch(noop);else{let e=coordinatesToVector({longitude:this.cameraMotion.value.longitude,latitude:this.cameraMotion.value.latitude}),n=coordinatesToVector({longitude:(c=C.longitude)==null?this.cameraMotion.value.longitude:c,latitude:(l=C.latitude)==null?this.cameraMotion.value.latitude:l}),r=new three.Object3D;r.lookAt(e);let o=new three.Matrix4().makeRotationFromQuaternion(r.quaternion);r.lookAt(n);let s=new three.Matrix4().makeRotationFromQuaternion(r.quaternion),h=new three.Matrix4().getInverse(o).premultiply(s),g=this.cameraMotion.value.fov,_=(u=C.fov)==null?this.cameraMotion.value.fov:u,v=1;t.effect===`zoomin`?v=1.5:t.effect===`zoomout`&&(v=.4);let b=_*v;for(let e=0;e<y.length-1;e++){let t=y[e].key;if(t){let e=this.panoResources[t];e&&(e.fixCameraTransform.copy(h),e.leftPanoPicture&&(e.leftPanoPicture.zoom=Math.tan(b/2/180*Math.PI)/Math.tan(g/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:(d=C.longitude)==null?this.cameraMotion.value.longitude:d,latitude:(f=C.latitude)==null?this.cameraMotion.value.latitude:f,fov:b}},{progress:1,value:{longitude:(p=C.longitude)==null?this.cameraMotion.value.longitude:p,latitude:(m=C.latitude)==null?this.cameraMotion.value.latitude:m,fov:_}}],S).catch(noop)}this.locationMotion.setKeyframes(y,S,b).then(()=>{for(let e of this.modelScene.children)e instanceof Model&&e.show();let t=Object.assign(Object.assign({},e),{mode:this.mode,longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov,offset:this.camera.pose.offset.clone(),distance:0});this.emit(`pano.arrived`,createEvent(`pano.arrived`,{options:n,prevPano:T,pano:{panoIndex:t.panoIndex,workCode:t.workCode},progress:1,state:t,userAction:this.userAction,error:null})),n.moveEndCallback&&n.moveEndCallback(t);let r=this.works.getObserver(this.currentPano);if(r&&r.images.video&&this.videoTexture&&this.videoTexture.image instanceof HTMLVideoElement){let e={map:this.videoTexture,size:r.images.video.size.clone(),matrix:r.images.video.matrix.clone(),panoMatrix:r.matrix.clone().premultiply(r.work.transform),alpha:1},t=createUuid$1(),n=this.videoTexture.image;n.setAttribute(`uuid`,t),canplayVideo().then(o=>{o&&r.images.video&&n.getAttribute(`uuid`)===t&&(n.oncanplay=()=>{n.oncanplay=noop,n.play()},n.ontimeupdate=()=>{n.currentTime>.5&&(n.ontimeupdate=noop,this.panoVideo.setMaterial(e))},n.src=r.images.video.source)}).catch((()=>{n.removeAttribute(`uuid`)}))}},()=>{let e=Object.assign(Object.assign(Object.assign({},this.currentPano),{mode:this.mode}),clonePose(this.camera.pose));this.emit(`pano.cancel`,createEvent(`pano.cancel`,{options:n,prevPano:T,pano:{panoIndex:e.panoIndex,workCode:e.workCode},progress:0,state:e,userAction:this.userAction,error:null})),n.moveCancelCallback&&n.moveCancelCallback()})}checkSelectedPano(e){var t;this.stopMomentumMovement(),this.camera.getDirection(new three.Vector3).setY(0);let n=null,r=this.works.getObserver(this.currentPano);if(!r)return null;let o=r.work.observers,s=r.accessibleNodes.filter(e=>{if(e===this.currentPano.panoIndex&&r.work.workCode===this.currentPano.workCode)return!1;let t=o[e];return!t||scratchVector3.copy(t.position).applyMatrix4(t.work.transform).distanceTo(this.camera.position)>this.maxAccessibleDistance?!1:t.loadable||t.active}),[c]=this.modelScene.intersectRaycaster(e);if(c){let[e,r]=arrayMin(s,e=>{let t=o[e];return t?scratchVector3.copy(t.standingPosition).applyMatrix4(t.work.transform).distanceTo(c.point):1/0},!0);typeof e==`number`&&r<this.panoTapTriggerRadius&&(n=(t=o[e])==null?null:t)}if(isNil(n)){let t=this.getForwardObserverOrNot(this.xrManager.cameraVR,e);t&&(n=t)}for(let e of this.locationMotion.keyframes){let t=this.panoResourceFromLocationMotionKeyframe(e);if(!(e.progress<this.locationMotion.progress)&&n){let e=panoStringify({panoIndex:n.panoIndex,workCode:n.work.workCode});if(t.panoId===e){n=null;break}}}if(isNil(n))return this.locationMotion.ended===!0&&this.cameraBounce(),null;if(!n.active){let e=panoStringify({panoIndex:n.panoIndex,workCode:n.work.workCode}),t=this.panoMeshes.get(e);t&&(t.setDisabled(!1),t.setLoading(!0))}let l={workCode:n.work.workCode,panoIndex:n.panoIndex,mode:this.mode,longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov,distance:0,offset:n?n.position.clone():new three.Vector3};return this.emit(`pano.select`,createEvent(`pano.select`,{prevPano:this.currentPano,pano:{panoIndex:l.panoIndex,workCode:l.workCode},state:l,userAction:!0,options:{},progress:0,error:null})),n&&n.active?(this.emit(`pano.request`,createEvent(`pano.request`,{userAction:!0,prevPano:this.currentPano,pano:{panoIndex:l.panoIndex,workCode:l.workCode},progress:0,state:l,options:{},error:null})),{workCode:n.work.workCode,panoIndex:n.panoIndex}):null}destroy(){super.destroy()}isReady(){return!1}updateCamera(e,t,n){return Promise.resolve()}updateCameraWithKeyframes(e,t,n){return Promise.resolve()}updateTime(e,t,...n){var r,o,s,c,l,u,d,f,p;this.userAction=!0;let m={},h={},g=this.camera.getDirection(new three.Vector3),_=this.locationMotion.keyframes[0],v=this.locationMotion.keyframes[this.locationMotion.keyframes.length-1],[y,b]=this.locationMotion.getKeyFrameSegment(e),S=this.panoResourceFromLocationMotionKeyframe(y),C=this.panoResourceFromLocationMotionKeyframe(b),w=this.panoResourceFromLocationMotionKeyframe(_),T=this.panoResourceFromLocationMotionKeyframe(v),E=!1;if(this.cameraMotion.ended===!1&&(this.cameraMotion.update(e),h.fov=this.cameraMotion.value.fov),this.modelAlphaMotion.ended===!1&&(this.modelAlphaMotion.update(e),m.modelAlpha=this.modelAlphaMotion.value.modelAlpha),this.perspToOrthoMotion.ended===!1&&(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(clamp$1(this.perspToOrthoMotion.value.perspToOrtho,0,1))),this.locationMotion.ended===!1){this.locationMotion.update(e);let t=this.locationMotion.value.count-b.value.count+1,n=new three.Vector3().copy(S.position),s=new three.Vector3().copy(C.position);if(m.progress=t,t>=.01&&t<=.99&&(m.progress=clamp$1(C.effectEasing(t),.01,.99)),C.leftPanoPicture&&(t<1?S.leftPanoPicture&&(m.pano0=S.leftPanoPicture):m.pano0=C.leftPanoPicture,m.pano1=C.leftPanoPicture),C.effect===`montage`?m.transition=`BLACK`:C.effect===`spread`?m.transition=`SPREAD`:m.transition=`FADE`,C.effect===`zoomin`||C.effect===`zoomout`?m.progress=Math.pow(t,3):C.effect===`model`&&this.camera.pose.distance<.01&&(m.modelAlpha=1-Math.pow(clamp$1(Math.abs(t-.5)*2,0,1),4)),t<1&&C.effect!==`fly`){if(m.pano0&&S.leftPanoPicture){let e={panoId:m.pano0.panoId,map:m.pano0.map,mapHistogram:m.pano0.mapHistogram,mapSize:m.pano0.mapSize,zoom:m.pano0.zoom,matrix:S.leftPanoPicture.matrix.clone().setPosition(C.position)},t=this.panoPictureObserverMap.get(m.pano0);t&&this.panoPictureObserverMap.set(e,t),m.pano0=e}n.copy(s),E=!0}h.distance=this.locationMotion.value.distance,h.offset=new three.Vector3(n.x+(s.x-n.x)*t,n.y+(s.y-n.y)*t,n.z+(s.z-n.z)*t);let c=[],l=[];for(let e of this.locationMotion.keyframes){let{key:t,progress:n}=e;t!==void 0&&(c.push(t),n>this.locationMotion.progress&&l.push(t))}for(let e of Object.keys(this.panoResources)){if(l.indexOf(e)>=0)continue;let t=this.panoResources[e];if(t.leftPanoPicture){let e=t.leftPanoPicture.map;if(e){if(e===((r=m.pano0)==null?void 0:r.map)||e===((o=m.pano1)==null?void 0:o.map))continue;e.dispose(),t.leftPanoPicture=null}}c.indexOf(e)>=0||delete this.panoResources[e]}let u=panoParse(C.panoId);u!==this.currentPano&&(this.currentPano=u,this.accessibleObserverFloorCheckCount=0),this.emit(`pano.moving`,createEvent(`pano.moving`,{userAction:this.userAction,prevPano:panoParse(w.panoId),pano:panoParse(T.panoId),state:Object.assign(Object.assign(Object.assign(Object.assign({},panoParse(T.panoId)),{mode:this.mode}),clonePose(this.camera.pose)),h),options:{},progress:this.locationMotion.progress,error:null}))}this.camera.setFromPose(h),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);let[D,O]=n,k=new three.Vector3(0,0,0),A=new three.Vector2().copy(this.camera.resolution);if(O&&this.xrManager.session&&this.xrManager.referenceSpace&&this.xrManager.session.renderState.baseLayer){let n=this.xrManager.cameraVR,r=this.xrManager.referenceSpace,o=this.xrManager.session.renderState.baseLayer,u=O.getViewerPose(r),d=(s=u==null?void 0:u.views)==null?[]:s;for(let e=0;e<d.length;e++){let t=d[e],r=n.cameras[e],s=o.getViewport(t);s&&(r.projectionMatrix.fromArray(t.projectionMatrix),r.projectionMatrixInverse.getInverse(r.projectionMatrix),r.matrix.fromArray(t.transform.matrix),r.matrix.setPosition(this.camera.position),r.matrix.decompose(r.position,r.quaternion,r.scale),r.matrixWorld.copy(r.matrix),r.matrixWorldInverse.getInverse(r.matrixWorld),r.matrixAutoUpdate=!1,k.copy(r.position),r.viewport.set(s.x,s.y,s.width,s.height),A.set(s.width,s.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=h.distance)==null?this.camera.pose.distance:c),this.xrManager.session.inputSources){for(let e=0;e<this.xrManager.session.inputSources.length;e++)if(this.xrManager.session.inputSources[e]&&this.xrManager.session.inputSources[e].targetRayMode===`transient-pointer`){let t=O.getPose(this.xrManager.session.inputSources[e].targetRaySpace,r);if(t){let e=t.transform.orientation,n=new three.Quaternion(e.x,e.y,e.z,e.w),r=new three.Vector3(0,0,-1).applyQuaternion(n),o=new three.Raycaster(this.camera.position,r);this.gazeRay=o}}}if(this.xrManager.machineType===`Oculus`||this.xrManager.machineType===`Pico`){let n=this.xrManager.session.inputSources;for(let e=0;e<n.length;e++){let t=this.xrManager.controllers[e],o=n[e];if(!o)continue;t&&t.update(o,O,r);let s=this.xrManager.getController(e),c=new three.Vector3(0,1.2,0),u=s.position.clone().add(k).sub(c);o.handedness===`left`?this.xrControllerRay.left.set(u,new three.Vector3(0,0,-1).applyEuler(s.rotation)):o.handedness===`right`&&this.xrControllerRay.right.set(u,new three.Vector3(0,0,-1).applyEuler(s.rotation)),this.controllerWrappers[e].position.copy(new three.Vector3(0,0,0).add(k).sub(c));let d=this.modelScene.intersectRaycaster(this.xrControllerRay.right);if(d.length===0){let e=this.works.getResolvedObserver(this.currentPano);d=this.xrControllerRay.right.intersectObject(this.modelScene.boundingMesh,!0).map(t=>{var n;let r=(n=e==null?void 0:e.floorIndex)==null?0:n;return Object.assign({floorIndex:r,floor:r},t)})}if(d.length>=1&&d[0].face)if(o.handedness===`right`){let e=this.xrControllerRay.right.intersectObject(this.xrCustomObjectsScene,!0),t=d[0].face.normal,n=t.clone(),r=d[0].point.clone();this.intersectMesh.position.copy(r);let o=r.clone().add(n);if(this.intersectMesh.lookAt(o),Math.abs(t.y)>.99){let e=this.camera.position.clone().sub(r);this.intersectMesh.rotation.z=-Math.atan2(e.z,e.x)}this.intersectMesh.visible=!0,this.needsRender=!0,e.length>0?(this.pointerLines.right.setPoints(u,e[0].point),this.pointerLines.right.points.visible=!0,this.intersectMesh.visible=!1):(this.pointerLines.right.points.visible=!1,this.pointerLines.right.setPoints(u,d[0].point));let s=d[0],c=createEvent(`intersect.update`,{raycaster:(l=this.xrControllerRay.right)==null?null:l,intersection:s==null?null:s,object:this.intersectMesh});if(this.emit(`intersect.update`,c),c.defaultPrevented){this.hideIntersectMesh();return}}else this.pointerLines.left.setPoints(u,d[0].point)}this.updateControllerHelper(n,e,t)}}else O||console.error(`xrFrame丢失,请重试`),this.xrManager.session||console.error(`session丢失,请重试`),this.xrManager.session&&!this.xrManager.session.renderState.baseLayer&&console.error(`no layer found`);isEmptyObject(m)===!1&&this.modelScene.parameter.set(m),this.emit(`camera.update`,createEvent(`camera.update`,{userAction:this.userAction,state:Object.assign(Object.assign(Object.assign({},this.currentPano),{mode:this.mode}),clonePose(this.camera.pose))}));let j=this.works.getResolvedObserver(this.currentPano),M=this.locationMotion.ended?this.getForwardObserverOrNot(this.xrManager.cameraVR):null,N=this.works.getObserver(S.panoId),P=this.works.getObserver(C.panoId);if(this.adjustPanoCircleMeshPositionBasedOnModel&&this.helper.visible&&j){let e=[],t=j.work.observers;for(let n of j.accessibleNodes){let r=t[n];r&&e.push(r)}let n=new Map;if(e.sort((e,t)=>{let r=n.get(e);r===void 0&&(r=e.standingPosition.distanceTo(j.standingPosition),n.set(e,r));let o=n.get(e);return o===void 0&&(o=t.standingPosition.distanceTo(j.standingPosition),n.set(t,o)),r-o}),e.length){this.accessibleObserverFloorCheckCount%=e.length;let t=e[this.accessibleObserverFloorCheckCount],n=this.modelScene.models.find(e=>e.work===(t==null?void 0:t.work));if(t&&n&&n.visible){let e=.3,r=.05,o=.005,s=t.standingPosition.clone().applyMatrix4(t.work.transform),c=panoStringify({panoIndex:t.panoIndex,workCode:t.work.workCode}),l=adjustPanoCircleMeshVectors.map(t=>{scratchRaycaster.ray.origin.copy(s),scratchRaycaster.ray.origin.add(scratchVector3.copy(t).setY(e)),scratchRaycaster.ray.direction.set(0,-1,0),scratchRaycaster.firstHitOnly=!0,scratchRaycaster.floorIndex=-1;let[r]=n.intersectRaycaster(scratchRaycaster);return r&&r.distance-o<=e?new three.Vector3().copy(s).setY(r.point.y+o):s});l.sort((e,t)=>t.y-e.y);let u=l[Math.floor(l.length/2)],[d]=l.filter(e=>e.distanceTo(u)<=.05);if(d){let e=new three.Vector4(s.x,s.y,s.z,d.y-s.y),t=this.adjustPanoCircleMeshPositionFix.get(c);t&&!e.equals(t)&&(this.needsRender=!0),this.adjustPanoCircleMeshPositionFix.set(c,e)}}this.accessibleObserverFloorCheckCount++}}let F=new Map;if(N)for(let e of N.accessibleNodes){let t=N.work.observers[e];if(t){let e=panoStringify({panoIndex:t.panoIndex,workCode:t.work.workCode});F.set(e,t)}}if(P)for(let e of P.accessibleNodes){let t=P.work.observers[e];if(t){let e=panoStringify({panoIndex:t.panoIndex,workCode:t.work.workCode});F.set(e,t)}}if(this.panoMeshes.forEach((e,t)=>{F.get(t)?F.delete(t):(this.helper.remove(e),e.dispose(),this.panoMeshes.delete(t))}),F.forEach((e,t)=>{let n=this.panoCircleMeshCreator(e,{aerialObserverMinHeight:this.aerialObserverMinHeight});this.panoMeshes.set(t,n),this.helper.add(n),F.delete(t)}),this.panoMeshes.forEach((e,t)=>{let n=this.works.getObserver(t);if(n){let r=n.position.distanceTo(n.standingPosition)>this.aerialObserverMinHeight;if(r)e.position.copy(n.position).applyMatrix4(n.work.transform),e.scale.setScalar(18);else{e.position.copy(n.standingPosition).applyMatrix4(n.work.transform);let t=this.adjustPanoCircleMeshPositionFix.get(n.panoId);t&&(scratchVector3.set(t.x,t.y,t.z),scratchVector3.equals(e.position)&&(e.position.y+=t.w)),e.scale.setScalar(1.2)}let o=this.camera.position.clone().setY(e.position.y),s=new three.Vector3().copy(e.position).sub(o).normalize();if(t===panoStringify(this.currentPano)){let t=clamp$1((.5-o.distanceTo(e.position))/.5,0,1);s.multiplyScalar(1-t).add(g.clone().multiplyScalar(t))}if(s.length()>0){let t=r?-Math.PI/2:0,n=Math.atan2(s.x,s.z);e.quaternion.setFromEuler(new three.Euler(t,n,0,`YXZ`))}}else e.visible=!1}),this.camera.pose.distance>.1||E)this.panoMeshes.forEach(n=>{n.setOpacity(0),n.setCurrent(!1),n.updateTime&&n.updateTime(e,t),n.visible=!1});else if(j){let n=j.work.observers,[,r]=arrayMin(j.accessibleNodes,e=>{let t=n[e];return!t||!t.active?1/0:j.standingPosition.distanceTo(t.standingPosition)},!0);r=clamp$1(r,2.5,1/0);let o=j.accessibleNodes.concat(j.panoIndex).map(e=>panoStringify({panoIndex:e,workCode:j.work.workCode}));this.panoMeshes.forEach((n,s)=>{let c=this.works.getObserver(s),l=!1,u=1;if(o.indexOf(s)===-1)l=!1,u=0;else if(!c)l=!1,u=0;else if(!c.loadable&&!c.active)l=!1,u=0;else{let e=n.position.clone().project(this.camera);l=Math.abs(e.x)<1&&Math.abs(e.y)<1&&Math.abs(e.z)<1&&!n.loading&&n.progress===0&&M!==null&&panoStringify({panoIndex:M.panoIndex,workCode:M.work.workCode})===s;let t=n.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);u=t<.01?0:clamp$1(r/t,.1,.85)}c&&c===P&&c.position.distanceTo(c.standingPosition)>this.aerialObserverMinHeight&&n.position.distanceTo(this.camera.position)<35&&(u=0),this.modelScene.parameter.resolveValue(`modelAlpha`)>0&&(u=0),n.setCurrent(l),n.setOpacity(u),n.updateTime&&n.updateTime(e,t)})}{let e=(u=this.modelScene.parameter.progress)==null?1:u,t=Math.round(e),n=this.modelScene.parameter.pano0,r=this.modelScene.parameter.pano1,o=t===0?n:r,s;if(o&&(s=this.works.getObserver(o.panoId),s||(s=this.panoPictureObserverMap.get(o))),this.tiling.appearDuration=this.tileAppearDuration,this.tiling.maxRequest=e<(canUseNativeImageBitmap()?.6:.99)?0:this.tileMaxRequest,this.tiling.imageOptions=this.imageOptions,!s||!o||this.tileLevelForFov===!1||this.camera.perspToOrtho.x>0){this.tiling.setObserver(null);let e={renderer:this.renderer,resolution:A,pixelRatio:1,time:this.camera.time,cameraMatrix:this.xrManager.cameraVR.matrixWorld,cameraProjectionMatrix:this.xrManager.cameraVR.projectionMatrix,panoMap:null,panoMatrix:new three.Matrix4,panoZoom:1,minLevel:0,level:0};this.tiling.update(e),this.modelScene.parameter.set(`refinedScreen`,null)}else{let e=getImageSizeLevel(o.mapSize)+1,c=4;this.tiling.setObserver(s);let l={renderer:this.renderer,resolution:A,pixelRatio:1,time:this.camera.time,cameraMatrix:this.xrManager.cameraVR.matrixWorld,cameraProjectionMatrix:this.xrManager.cameraVR.projectionMatrix,panoMap:o.map,panoMatrix:o.matrix,panoZoom:o.zoom,minLevel:e,level:4},u=this.tiling.update(l),f={map:this.tiling.renderTarget.texture,matrixInverse:this.tiling.camera.matrixWorldInverse,projectionMatrix:this.tiling.camera.projectionMatrix,pano:t,opacity:(n==null?void 0:n.panoId)===(r==null?void 0:r.panoId)?1:easeInQuart(Math.abs(((d=this.modelScene.parameter.progress)==null?0:d)-.5)*2)},p=this.modelScene.parameter.refinedScreen;(u||f.pano!==(p==null?void 0:p.pano)||f.opacity!==(p==null?void 0:p.opacity))&&this.modelScene.parameter.set(`refinedScreen`,f)}}if(this.panoVideo.object.position.copy(this.camera.position),this.panoVideo.updateTime(e),this.intersectMesh&&this.intersectMesh.parent&&j&&j.position.y-j.standingPosition.y>10){let e=clamp$1(this.camera.position.distanceTo(this.intersectMesh.position)*(2*Math.tan(.5*this.camera.fov/180*Math.PI))/5,.5);this.intersectMesh.scale.setScalar(e)}else this.intersectMesh.scale.setScalar(1);{let e=C.effect,{pano0:t,pano1:n}=this.modelScene.parameter;if(t&&n&&t!==n&&(e===`fly`||e===`model`)&&this.flyEffectUseDepthBuffer){if(((f=this.modelScene.parameter.pano0Depth)==null?void 0:f.panoId)!==t.panoId||((p=this.modelScene.parameter.pano1Depth)==null?void 0:p.panoId)!==n.panoId){let e=500,r=512;this.pano0DepthCubeRenderTarget?this.pano0DepthCubeRenderTarget.width!==512&&this.pano0DepthCubeRenderTarget.setSize(512,512):this.pano0DepthCubeRenderTarget=new three.WebGLCubeRenderTarget(512,{minFilter:three.NearestFilter,magFilter:three.NearestFilter,generateMipmaps:!1}),this.pano1DepthCubeRenderTarget?this.pano1DepthCubeRenderTarget.width!==512&&this.pano1DepthCubeRenderTarget.setSize(512,512):this.pano1DepthCubeRenderTarget=new three.WebGLCubeRenderTarget(512,{minFilter:three.NearestFilter,magFilter:three.NearestFilter,generateMipmaps:!1});let o=new three.CubeCamera(this.camera.near,this.camera.far,this.pano0DepthCubeRenderTarget);o.matrix.copy(t.matrix),o.matrixWorld.copy(o.matrix),o.matrixAutoUpdate=!1,renderDepthCube(this.renderer,this.modelScene,o,500);let s=new three.CubeCamera(this.camera.near,this.camera.far,this.pano1DepthCubeRenderTarget);s.matrix.copy(n.matrix),s.matrixWorld.copy(s.matrix),s.matrixAutoUpdate=!1,renderDepthCube(this.renderer,this.modelScene,s,500),this.modelScene.parameter.set({pano0Depth:{panoId:t.panoId,map:this.pano0DepthCubeRenderTarget.texture,mapSize:this.pano0DepthCubeRenderTarget.width,maxDepth:500},pano1Depth:{panoId:n.panoId,map:this.pano1DepthCubeRenderTarget.texture,mapSize:this.pano1DepthCubeRenderTarget.width,maxDepth:500}})}}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))}}render(){if(this.xrManager.session&&this.xrManager.session.renderState.baseLayer){let e=this.xrManager.session.renderState.baseLayer;return this.renderer.setRenderTarget(null),this.renderer.setScissorTest(!1),this.renderer.setFramebuffer(e.framebuffer),this.renderer.render(this.scene,this.xrManager.cameraVR),this.renderer.setFramebuffer(null),!0}return!1}onPanGesture(){}onTapGesture(){}onPinchGesture(){}onMouseMove(){}onMouseOut(){}panoResourceFromLocationMotionKeyframe(e){return this.panoResources[e.key]}updateControllerHelper(e,t,n){let r=this.xrControllerRay.left,o=this.xrControllerRay.right;if(!e||e.length===0)return;let s={buttons:{X:!1,Y:!1,LeftTrigger:!1,LeftPinch:!1,A:!1,B:!1,RightTrigger:!1,RightPinch:!1}};for(let c=0;c<e.length;c++){let l=e[c].handedness,u=e[c].gamepad;switch(l){case`left`:u.axes&&(this.emitHandleEvent(u.axes[2]===-1,`LeftAxesLeft`,t),this.emitHandleEvent(u.axes[2]===1,`LeftAxesRight`,t),this.emitHandleEvent(u.axes[3]===-1,`LeftAxesUp`,t),this.emitHandleEvent(u.axes[3]===1,`LeftAxesDown`,t)),u!=null&&u.buttons&&(u.buttons[4]&&this.emitHandleEvent(u.buttons[4].pressed,`X`,t),u.buttons[5]&&this.emitHandleEvent(u.buttons[5].pressed,`Y`,t),u.buttons[0]&&this.emitHandleEvent(u.buttons[0].pressed,`LeftTrigger`,t),u.buttons[1]&&this.emitHandleEvent(u.buttons[1].pressed,`LeftPinch`,t));let e={raycaster:r,axes:{up:u.axes&&u.axes[3]<0?Math.abs(u.axes[3]):0,down:u.axes&&u.axes[3]<0?0:Math.abs(u.axes[3]),left:u.axes&&u.axes[2]<0?Math.abs(u.axes[2]):0,right:u.axes&&u.axes[2]<0?0:Math.abs(u.axes[2])},deltaTime:n};s.buttons.X=u.buttons&&u.buttons[4]?u.buttons[4].pressed:!1,s.buttons.Y=u.buttons&&u.buttons[5]?u==null?void 0:u.buttons[5].pressed:!1,s.buttons.LeftTrigger=u.buttons&&u.buttons[0]?u==null?void 0:u.buttons[0].pressed:!1,s.buttons.LeftPinch=u.buttons&&u.buttons[1]?u==null?void 0:u.buttons[1].pressed:!1,s.left=e;break;case`right`:u.axes&&(this.emitHandleEvent(u.axes[2]===-1,`RightAxesLeft`,t),this.emitHandleEvent(u.axes[2]===1,`RightAxesRight`,t),this.emitHandleEvent(u.axes[3]===-1,`RightAxesUp`,t),this.emitHandleEvent(u.axes[3]===1,`RightAxesDown`,t)),u.buttons&&(u.buttons[4]&&this.emitHandleEvent(u.buttons[4].pressed,`A`,t),u.buttons[5]&&this.emitHandleEvent(u.buttons[5].pressed,`B`,t),u.buttons[0]&&this.emitHandleEvent(u.buttons[0].pressed,`RightTrigger`,t),u.buttons[1]&&this.emitHandleEvent(u.buttons[1].pressed,`RightPinch`,t)),s.right={raycaster:o,axes:{up:u.axes&&u.axes[3]<0?Math.abs(u.axes[3]):0,down:u.axes&&u.axes[3]<0?0:Math.abs(u.axes[3]),left:u.axes&&u.axes[2]<0?Math.abs(u.axes[2]):0,right:u.axes&&u.axes[2]<0?0:Math.abs(u.axes[2])},deltaTime:n},s.buttons.A=u.buttons&&u.buttons[4]?u==null?void 0:u.buttons[4].pressed:!1,s.buttons.B=u.buttons&&u.buttons[5]?u==null?void 0:u.buttons[5].pressed:!1,s.buttons.RightTrigger=u.buttons&&u.buttons[0]?u==null?void 0:u.buttons[0].pressed:!1,s.buttons.RightPinch=u.buttons&&u.buttons[1]?u==null?void 0:u.buttons[1].pressed:!1;break;default:break}}this.emit(`xr.controller.update`,createEvent(`xr.controller.update`,s))}emitHandleEvent(e,t,n){let r=this.xrControllerRay.left,o=this.xrControllerRay.right;if(e)this.xrHandleState[t].touchStart===!1?(this.xrHandleState[t].touchStartTime=n,this.xrHandleState[t].touchStart=!0,this.emit(`xr.gesture.buttonDown`,createEvent(`xr.gesture.buttonDown`,{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:t,isFinal:!1,isFirst:!0,controllers:{raycaster:{leftRay:r,rightRay:o}}}))):n-this.xrHandleState[t].touchStartTime>CONTROLLER_EVNET_DELTA_TIME&&this.emit(`xr.gesture.press`,createEvent(`xr.gesture.tap`,{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:t,isFinal:!0,isFirst:!0,controllers:{raycaster:{leftRay:r,rightRay:o}}}));else if(this.xrHandleState[t].touchStart===!0){if(this.emit(`xr.gesture.buttonUp`,createEvent(`xr.gesture.buttonUp`,{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:t,isFinal:!0,isFirst:!1,controllers:{raycaster:{leftRay:r,rightRay:o}}})),n-this.xrHandleState[t].touchStartTime<=CONTROLLER_EVNET_DELTA_TIME){let e=createEvent(`xr.gesture.tap`,{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:t,isFinal:!0,isFirst:!1,controllers:{raycaster:{leftRay:r,rightRay:o}}});!this.emit(`xr.gesture.tap`,e)&&!e.defaultPrevented&&t===`RightTrigger`&&this.checkSelectedPano(this.xrControllerRay.right)}this.xrHandleState[t].touchStart=!1,this.xrHandleState[t].touchStartTime=0}}initHandEvent(){if(!this.xrManager.session)throw Error(`初始化失败`);this.xrManager.session.addEventListener(`select`,e=>{this.gazeRay&&this.checkSelectedPano(this.gazeRay)})}},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,gesture.fire,initAnimation.start,initAnimation.end,camera.update,intersect.update,pano.select,pano.moveTo,pano.moving,pano.arrived,pano.cancel,pano.error,pano.prepare,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`.split(`,`);function initLegacyEvent(e){e.on(`initAnimation.start`,t=>{e.emit(`initAnimationWillStart`,t.state.panoIndex,t.state,t.userAction)}),e.on(`initAnimation.end`,t=>{e.emit(`initAnimationEnded`,t.state.panoIndex,t.state,t.userAction)}),e.on(`gesture.pan`,t=>{let n=!1;n=e.emit(`wantsGesture`,`pan`,t.pointers,t.isFinal),n&&t.preventDefault(),n=e.emit(`wantsPanGesture`,t.state,t.isFinal),n&&t.preventDefault(),t.defaultPrevented||(e.emit(`gesture`,`pan`,t.pointers,t.isFinal),e.emit(`panGesture`,t.state,t.isFinal))}),e.on(`gesture.tap`,t=>{let n=!1;n=e.emit(`wantsGesture`,`tap`,t.pointers,t.isFinal),n&&t.preventDefault(),n=e.emit(`wantsTapGesture`,t.center.raycaster,t.center.coords,t.isFinal),n&&t.preventDefault(),t.defaultPrevented||(e.emit(`gesture`,`tap`,t.pointers,t.isFinal),e.emit(`tapGesture`,t.center.raycaster,t.center.coords,t.isFinal))}),e.on(`gesture.dbltap`,t=>{let n=!1;n=e.emit(`wantsGesture`,`dbltap`,t.pointers,t.isFinal),n&&t.preventDefault(),n=e.emit(`wantsDblTapGesture`,t.center.raycaster,t.center.coords,t.isFinal),n&&t.preventDefault(),t.defaultPrevented||(e.emit(`gesture`,`dbltap`,t.pointers,t.isFinal),e.emit(`dblTapGesture`,t.center.raycaster,t.center.coords,t.isFinal))}),e.on(`gesture.press`,t=>{let n=!1;n=e.emit(`wantsGesture`,`press`,t.pointers,t.isFinal),n&&t.preventDefault(),n=e.emit(`wantsPressGesture`,t.center.raycaster,t.center.coords,t.center.delta,t.isFinal),n&&t.preventDefault(),t.defaultPrevented||(e.emit(`gesture`,`press`,t.pointers,t.isFinal),e.emit(`pressGesture`,t.center.raycaster,t.center.coords,t.center.delta,t.isFinal))}),e.on(`gesture.pinch`,t=>{let n=!1;n=e.emit(`wantsGesture`,`pinch`,t.pointers,t.isFinal),n&&t.preventDefault(),n=e.emit(`wantsPinchGesture`,t.scale,t.state.fov,t.isFinal),n&&t.preventDefault(),t.defaultPrevented||(e.emit(`gesture`,`pinch`,t.pointers,t.isFinal),e.emit(`pinchGesture`,t.scale,t.state.fov,t.isFinal))}),e.on(`gesture.mousewheel`,t=>{let n=!1;n=e.emit(`wantsGesture`,`mouseWheel`,t.pointers,t.isFinal),n&&t.preventDefault(),n=e.emit(`wantsMouseWheel`,t.center.delta,t.state.fov,t.isFinal),n&&t.preventDefault(),t.defaultPrevented||(e.emit(`gesture`,`mouseWheel`,t.pointers,t.isFinal),e.emit(`mouseWheel`,t.center.delta,t.state.fov,t.isFinal))}),e.on(`gesture.mousemove`,t=>{let n=!1;n=e.emit(`wantsGesture`,`mouseMove`,t.pointers,t.isFinal),n&&t.preventDefault(),t.defaultPrevented||(e.emit(`gesture`,`mouseMove`,t.pointers,t.isFinal),n=e.emit(`wantsChangeCameraFov`,t.state.fov),n&&t.preventDefault())}),e.on(`gesture.momentum`,t=>{let n=!1;n=e.emit(`wantsInteriaPan`,t.state),n&&t.preventDefault(),t.defaultPrevented||e.emit(`interiaPan`,t.state,t.isFinal)}),e.on(`camera.update`,t=>{e.emit(`cameraFovUpdate`,t.state.fov,t.userAction),e.emit(`cameraDirectionUpdate`,t.state,t.userAction);let n=coordinatesToVector(t.state);n.setLength(t.state.distance);let r=t.state.offset.clone().sub(n);e.emit(`cameraPositionUpdate`,r,t.userAction),e.emit(`cameraUpdate`,t.state,t.userAction)}),e.on(`intersect.update`,t=>{if(t.intersection){let n=!1;n=e.emit(`wantsShowIntersectionOnModel`,t.raycaster),n&&t.preventDefault(),t.defaultPrevented||e.emit(`intersectionOnModelUpdate`,t.intersection,t.object)}else e.emit(`intersectionHidden`)}),e.on(`pano.request`,t=>{let n=e.emit(`wantsMoveToPano`,t.state.panoIndex,t.options,t.userAction);n||(n=e.emit(`wantsToMoveToPano`,t.state.panoIndex,t.options,t.userAction)),n&&t.preventDefault(),t.defaultPrevented||e.emit(`panoWillLoad`,t.state.panoIndex)}),e.on(`pano.select`,t=>{e.emit(`panoSelected`,t.state.panoIndex)}),e.on(`pano.moveTo`,t=>{e.emit(`panoLoaded`,t.state.panoIndex),e.emit(`moveToPano`,t.state.panoIndex,t.userAction),e.emit(`panoWillArrive`,t.state.panoIndex,t.state,t.userAction)}),e.on(`pano.moving`,t=>{e.emit(`movingToPano`,t.state.panoIndex,t.prevPano.panoIndex,t.progress)}),e.on(`pano.arrived`,t=>{e.emit(`panoArrived`,t.state.panoIndex,t.state,t.userAction)}),e.on(`pano.cancel`,t=>{e.emit(`moveToPanoCanceled`,t.state.panoIndex)}),e.on(`pano.error`,t=>{e.emit(`panoLoadError`,t.error,t.state.panoIndex)}),e.on(`pano.texture.load`,t=>{e.emit(`textureStartLoad`,t.pano.panoIndex)}),e.on(`pano.texture.success`,t=>{e.emit(`textureLoaded`,t.pano.panoIndex,t.meta)}),e.on(`pano.texture.error`,t=>{e.emit(`textureError`,t.error,t.pano.panoIndex)}),e.on(`pano.texture.abort`,t=>{e.emit(`textureAbort`,t.pano.panoIndex)}),e.on(`pano.texture.progress`,t=>{e.emit(`textureLoading`,t.progress,t.pano.panoIndex)}),e.on(`xr.session.start`,t=>{e.emit(`webXRSessionStart`)}),e.on(`xr.session.end`,t=>{e.emit(`webXRSessionEnd`)}),e.on(`xr.gesture.tap`,t=>{e.emit(`webXRControllerEvent`,`tap`,t.buttons,{raycaster:t.controllers.raycaster})}),e.on(`xr.gesture.press`,t=>{e.emit(`webXRControllerEvent`,`press`,t.buttons,{raycaster:t.controllers.raycaster})}),e.on(`xr.gesture.buttonUp`,t=>{e.emit(`webXRControllerEvent`,`buttonUp`,t.buttons,{raycaster:t.controllers.raycaster})}),e.on(`xr.gesture.buttonDown`,t=>{e.emit(`webXRControllerEvent`,`buttonDown`,t.buttons,{raycaster:t.controllers.raycaster})}),e.on(`xr.controller.update`,t=>{e.emit(`webXRControllerRayUpdate`,{leftRay:t.left?t.left.raycaster:void 0,rightRay:t.right?t.right.raycaster:void 0}),t.left&&e.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&&e.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})}),e.on(`works.request`,t=>{e.emit(`willLoad`,t.input,t.works[0],e.getCurrentState())}),e.on(`works.load`,t=>{e.emit(`load`,t.input,t.works[0],e.getCurrentState())}),e.on(`works.ready`,t=>{e.emit(`loaded`,t.input,t.works[0])}),e.on(`state.change`,t=>{e.emit(`stateChange`,t.state,t.userAction)}),e.on(`currentState.change`,t=>{e.emit(`currentStateChange`,t.state,t.userAction)}),e.on(`state.set`,t=>{e.emit(`setState`,t.state)}),e.on(`state.synced`,t=>{e.emit(`stateSynced`,t.state)}),e.on(`model.request`,t=>{e.emit(`modelWillLoad`,t.work.model)}),e.on(`model.error`,t=>{e.emit(`modelLoadError`,t.error,t.model)}),e.on(`model.load`,t=>{e.emit(`modelLoaded`,t.model)}),e.on(`model.changeShownFloor`,t=>{e.emit(`modelShownFloorChange`,t.model.shownFloor,t.model.floorLength)}),e.on(`render`,t=>{e.emit(`renderFrame`,t.needsRender)}),e.on(`mode.change.request`,t=>{e.emit(`wantsChangeMode`,t.mode,t.prevMode)}),e.on(`mode.change`,t=>{e.emit(`modeChange`,t.mode,t.prevMode,t.state.panoIndex,t.state,t.userAction)}),e.on(`helpers.visible`,t=>{e.emit(`helpersVisibleChange`,t.object.visible)}),e.on(`network.resource`,t=>{e.emit(`network`,t.source,t.requestType,t.requestState,t.detail)})}function generateDefaultVideoElement(){if(typeof window<`u`){let e=document.createElement(`video`);e.loop=!0,e.autoplay=!0,e.playsInline=!0,e.muted=!0,e.crossOrigin=``;let t=()=>{document.removeEventListener(`touchstart`,t,!1),document.removeEventListener(`mousedown`,t,!1),e.muted=!1};return document.addEventListener(`touchstart`,t,!1),document.addEventListener(`mousedown`,t,!1),e}else return{}}function initLights(){let e=new three.Group;e.name=`internalLights`;{let t=new three.DirectionalLight(16777215,.1);t.name=`direction0`,t.position.copy(new three.Vector3(0,1,0)),e.add(t)}{let t=new three.DirectionalLight(16777215,.1);t.name=`direction1`,t.position.copy(new three.Vector3(-1,-1,-1)),e.add(t)}{let t=new three.DirectionalLight(16777215,.3);t.name=`direction2`,t.position.copy(new three.Vector3(1,1,1)),e.add(t)}{let t=new three.AmbientLight(16777215,.6);t.name=`ambient0`,e.add(t)}return e}function parseKeyValue(e){var t,n;let r={},o=e.split(/(\;|\,)/);for(let e of o){let o=e.split(`=`),s=(t=o[0])==null?void 0:t.trim(),c=(n=o[1])==null?void 0:n.trim();s&&c&&(r[s]=c)}return r}function getViewportScale(){var e;if(typeof document<`u`){let t=document.getElementsByTagName(`meta`);for(let n=0;n<t.length;n++){let r=t[n];if(r.getAttribute(`name`)===`viewport`){let t=parseKeyValue((e=r.getAttribute(`content`))==null?``:e),n=Number(t[`initial-scale`]);if(!isNaN(n))return n}}}return 1}var realsee_png_data_url_default=`data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAV8AAAA/CAQAAADtPwPkAAAR+0lEQVR4AezYg3LEQACH8d1cbdu23Q5qG9G47z/TN/h6tn2b/H+TUTLc7yjcOXV46OUAnUs6EbUp022ZBXc1NhoZYYd7fjDRvdcHAwrlK2QBVJ4sgoqONmY45RUT23sZ6H42F2hK5CtkMbjhZlDmUUcvq1zyieUVyjbE4I1GBfItwxG56YaUZTQwyh4P6NgJ4YYYvCuQb5kOyI03pORjiqe4Lwpq5pt1vJqfUwKWJVbSMYfppYconG+maNNQOWBZuwHTzicGel75NtFOkxr5apmV8cikcko0DrDQs863AeGl0cE0+1xy573m0/wf0cEKW6H7BWtggiMG8sy3oHRDpJMw4NWb6am/bv9znkqEzjd61t5oo5clTrjhwevO75EJRBKSRt745Z16ZEjcM73sccZplBPm8PyTcxZAkSRdHm/acJ0Z3JZhHB0BxqDHgWFZFmm0ZbCw87twI/zc3e/Cz93vPneXtU/WdQS3oTviXdY/q5PsJKfoGuQjZuO/0in1qsj85cuXrxqeAOJpGqdJOqrUutgVl2Qb0BWqp/RE8AWWVB7t2KrIzY2Wx2fWKl7yfswgxqj8lYummYa3hfwF9MuQRmbfQE4ocPDjtUWQ6Tq1M2w7gC2EcrMGtWS6xlpGKEDDcb1vUQ25zT4lrC2s0dU4gFPppKkbeIYr7NMpqjStuFg5rNU9epGyt8PXyfX4DE1bKLhR/1XPxwJhp5DAV67T9ZPwFdovhBMIGUYoRBN4wim6S3eoXVEHXdLgmwY0x6BQnO4xPJ0Ar5OVxhQF0L9UslRM4yaQQfQImnBegi8vhY2A1k6YLlrj61TwDdNQnIISwiPvpD7TwYQTssZXK47vg8y9Gp2nxRcATkozOEmdCeObSt3IIo+xf/00IDRKAaZ89PBTkHqpkA5LagKeNZKlIhqX8RcQ95GHtdY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6kX8tV+ozqAs+uYCSmO2w+jd4zGNeUYL4nqZxeN5WKVgooSAClmEaYhqhdit89QC7niSbCEM2sdkBuHYxQg9ri5ZjkuhI6DMP+J7cTvEtokEx0aPscyddoFJKpSZqV7G1GTxcpmEthpnw5058c6GfwqpwzGOtGjXSJI3FLYhc+O+jSr9aGhPWQlRshS8AticLX7wnsgbXxt6gsWCpRBa0vRGQM8oB9dhmP3QAwFX4c079dJNq6Qi5xbuyTmpPSJ1Ur4UtF7GoTtmUL3zxaWqMU8P/k3cXSQ1EQRjHGdzdHTa4u7tzBs7CedhykNwF2/5jq56iU11db6Lv2yTj8hs3JoiU9sZZp5/62J5v1z9NjrDHaSbnbFMf52sHrDUVaidDxNG0o9+uLjfosfdb3jT5d5j757riJgst9NIZQ2Pn+ySZll80vjI6Wz/hQJG4vPG0L/H6poQch/dW3vL3B0u8jl0HvVj5PvHCElEF8DUAFikVYTcvmfBdDzQlvvMXSV5lP5zrXj/fJ54zuWaeeuoqkW8AwCIaqeTZKkmYrpPwR2eqN9X72W7EG57vU67OBeuMV8KXLUzv93UTTj42tvaFS++GVsc5JRyLSLJ8nzO555hFBmiSRCqMr4GwrcmGkib5xSvcwmzFK6e8s7DMa2xH4YZdZumSOwsVzFeBWdr37tpIhOpSwXqONNgZq/2KgvBt54znHN1HzlljTO4oVD5fb+prNIJXQNL1ofDKQisbPLJDv3jNSLq9OkYBEIihKIj3v7S1TRQCX5Kdl1ZQlol7LF+E++fwirfiq2sf4cTXxc6hzxffPuLEeqSWrPGWMF58TWr5viyJAP5/4EV4KePiaSE8eNRgjDy8/tyRW+FZjhS+2tlovNJovtJovNJ0uhK6Wo64SDdxEbM//KesjwAAAABJRU5ErkJggg==`,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=new three.BufferGeometry;geometry.setAttribute(`position`,new three.BufferAttribute(vertices,3)),geometry.setAttribute(`uv`,new three.BufferAttribute(uvs,2)),geometry.setIndex(new three.BufferAttribute(index,1));var material=new three.MeshBasicMaterial({transparent:!0,depthTest:!1,depthWrite:!1,stencilWrite:!1,fog:!1}),mesh=new three.Mesh(geometry,material);mesh.matrixAutoUpdate=!1;var scene=new three.Scene;scene.add(mesh),scene.matrixAutoUpdate=!1;var camera=new three.OrthographicCamera(-.5,.5,.5,-.5,.1,1);camera.position.set(0,0,.5),camera.lookAt(0,0,0),camera.updateMatrixWorld(!0),camera.matrixAutoUpdate=!1;var prevViewport=new three.Vector4,prevScissor=new three.Vector4;function renderPoweredByRealsee(e){if(material.map){let t=e.getViewport(prevViewport),n=e.getScissor(prevScissor),r=e.getScissorTest(),o=e.autoClear,s=n.x+imageOffset[0]/3,c=n.y+imageOffset[1]/3,l=imageSize[0]/3,u=imageSize[1]/3;e.setViewport(s,c,l,u),e.setScissor(s,c,l,u),e.setScissorTest(!0),e.autoClear=!1,e.render(scene,camera),e.setViewport(t),e.setScissor(n),e.setScissorTest(r),e.autoClear=o}else{let e=new three.Texture,t=new Image;t.onload=()=>{e.image=t,e.wrapS=three.ClampToEdgeWrapping,e.wrapT=three.ClampToEdgeWrapping,e.minFilter=three.LinearFilter,e.needsUpdate=!0,e.generateMipmaps=!1,material.needsUpdate=!0,t.onload=noop},t.src=realsee_png_data_url_default,material.map=e}}var jsContent$1='(function(){function e(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||(n=Promise))(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})}function t(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function n(e){return function(){var n=this,r=arguments;return new Promise(function(i,a){var o=e.apply(n,r);function s(e){t(o,i,a,s,c,`next`,e)}function c(e){t(o,i,a,s,c,`throw`,e)}s(void 0)})}}function r(){return i.apply(this,arguments)}function i(){return i=n(function*(e={}){var t,r=e,i=!1,a=!0,o=self.location.href;if(i||a){try{new URL(`.`,o).href}catch(e){}(function(){var e=n(function*(e){var t=yield fetch(e,{credentials:`same-origin`});if(t.ok)return t.arrayBuffer();throw Error(t.status+` : `+t.url)});return function(t){return e.apply(this,arguments)}})()}console.log.bind(console),console.error.bind(console);var s=!1;function c(e){for(var t=0,n=e.length,r=new Uint8Array(n),i;t<n;++t)i=e.charCodeAt(t),r[t]=~i>>8&i;return r}var l,u,d=!1;function f(){var e=N.buffer;new Int8Array(e),new Int16Array(e),r.HEAPU8=u=new Uint8Array(e),new Uint16Array(e),new Int32Array(e),r.HEAPU32=new Uint32Array(e),r.HEAPF32=new Float32Array(e),new Float64Array(e),new BigInt64Array(e),new BigUint64Array(e)}function p(){if(r.preRun)for(typeof r.preRun==`function`&&(r.preRun=[r.preRun]);r.preRun.length;)E(r.preRun.shift());S(T)}function m(){d=!0,L.c()}function h(){if(r.postRun)for(typeof r.postRun==`function`&&(r.postRun=[r.postRun]);r.postRun.length;)w(r.postRun.shift());S(C)}var g;function _(){return c(`\\0asm\\0\\0\\00\\b\\`\\`}}\\`|}\\`}\\`||\\`\\v\\0\\`\\0\\`\\0\\0\\x07aa\\0\\0\\r\\0\\0\\x07\\x07\\bAÀ¤\\v\\x07b\\0c\\0\\rd\\0\ne\\0\\ff\\0\\v\\f\núT\\rO| \\0 \\0¢"\\0 \\0 \\0¢"¢ \\0DiPîàBù>¢D\'èÀV¿\\xA0¢ DB:áSU¥?¢ \\0D^\\fýÿÿß¿¢D\\0\\0\\0\\0\\0\\0ð?\\xA0\\xA0\\xA0¶\\vT~@AÀ (\\0" \\0B\\x07|Bøÿÿÿ|"BÿÿÿÿX@ §"\\0?\\0AtM\\r \\0\\0\\r\\vAÄ A06\\0A\\vAÀ \\x006\\0 \\vK| \\0 \\0 \\0¢"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ê\\0ÅY\\0ú+\\0ÓÁÅ\\0ÅÏ\\0ÛZ®\\0GÅ\\0
Cb\\0!;\\0,y\\0a\\0*L{\\0,\\0C¿\\0&\\0x<\\0¨Ää\\0åÛ{\\0Ä:Â\\0&ôê\\0÷g\\0\\r¿\\0e£+\\0=±\\0½|\\v\\0¤QÜ\\0\'Ýc\\0iáÝ\\0\\0¨)\\0hÎ(\\0 í´\\0D \\0NÊ\\0pc\\0~|#\\0¹2\\0§õ\\0Vç\\0!ñ\\b\\0µ*\\0o~M\\0¥Q\\0µù«\\0ßÖ\\0Ýa\\06\\0Ä:\\0¢¡\\0rím\\x009z\\0¸©\\0k2\\\\\\0F\'[\\0\\x004í\\0Ò\\0w\\0üôU\\0YM\\0àq\\0A \\v=@û!ù?\\0\\0\\0\\0-Dt>\\0\\0\\0Fø<\\0\\0\\0\\`QÌx;\\0\\0\\0\\x1Bð9\\0\\0\\0@ %z8\\0\\0\\0"ã6\\0\\0\\0\\0ói5\\0AÀ \\v@`)}function v(e){return e}function y(e,t){var n,r=v(e);return n=new WebAssembly.Module(r),[new WebAssembly.Instance(n,t),n]}function b(){return{a:F}}function x(){function e(e,t){return L=e.exports,P(L),f(),L}var t=b();return r.instantiateWasm?new Promise((n,i)=>{r.instantiateWasm(t,(t,r)=>{n(e(t,r))})}):(g!=null||(g=_()),e(y(g,t)[0]))}for(var S=e=>{for(;e.length>0;)e.shift()(r)},C=[],w=e=>C.push(e),T=[],E=e=>T.push(e),D=()=>2147483648,O=(e,t)=>Math.ceil(e/t)*t,k=e=>{var t=(e-N.buffer.byteLength+65535)/65536|0;try{return N.grow(t),f(),1}catch(e){}},A=e=>{var t=u.length;e>>>=0;var n=D();if(e>n)return!1;for(var r=1;r<=4;r*=2){var i=t*(1+.2/r);if(i=Math.min(i,e+100663296),k(Math.min(n,O(Math.max(e,i),65536))))return!0}return!1},j=new Uint8Array(123),M=25;M>=0;--M)j[48+M]=52+M,j[65+M]=M,j[97+M]=26+M;if(j[43]=62,j[47]=63,r.noExitRuntime&&r.noExitRuntime,r.print&&r.print,r.printErr&&r.printErr,r.wasmBinary&&r.wasmBinary,r.arguments&&r.arguments,r.thisProgram&&r.thisProgram,r.preInit)for(typeof r.preInit==`function`&&(r.preInit=[r.preInit]);r.preInit.length>0;)r.preInit.shift()();var N;function P(e){r._pack=e.d,r._malloc=e.e,r._free=e.f,N=e.b,e.__indirect_function_table}var F={a:A};function I(){p();function e(){var e;r.calledRun=!0,!s&&(m(),l==null||l(r),(e=r.onRuntimeInitialized)==null||e.call(r),h())}r.setStatus?(r.setStatus(`Running...`),setTimeout(()=>{setTimeout(()=>r.setStatus(``),1),e()},1)):e()}var L=x();return I(),t=d?r:new Promise((e,t)=>{l=e}),t}),i.apply(this,arguments)}let a;function o(){return e(this,void 0,void 0,function*(){a=yield r()})}let s=0,c=[],l=!1,u=!1,d,f,p,m,h,g,_,v,y,b=t=>e(void 0,void 0,void 0,function*(){for(;u;)yield new Promise(e=>setTimeout(e,0));a||(u=!0,yield o(),u=!1);let e=Math.pow(2,Math.ceil(Math.log2(t.vertexCount)));e>s&&(s>0&&(a._free(d),a._free(f),a._free(p),a._free(m),a._free(h),a._free(g),a._free(_),a._free(v),a._free(y)),s=e,d=a._malloc(3*s*4),f=a._malloc(4*s*4),p=a._malloc(3*s*4),m=a._malloc(4*s),h=a._malloc(s),g=a._malloc(8*s*4),_=a._malloc(3*s*4),v=a._malloc(4*s*4),y=a._malloc(3*s*4)),a.HEAPF32.set(t.positions,d/4),a.HEAPF32.set(t.rotations,f/4),a.HEAPF32.set(t.scales,p/4),a.HEAPU8.set(t.colors,m),a.HEAPU8.set(t.selection,h),a._pack(t.selected,t.vertexCount,d,f,p,m,h,g,_,v,y);let n=new Uint32Array(a.HEAPU32.buffer,g,t.vertexCount*8),r=new Uint32Array(n.slice().buffer),i=new Float32Array(a.HEAPF32.buffer,_,t.vertexCount*3),c=new Float32Array(i.slice().buffer),b=new Float32Array(a.HEAPF32.buffer,v,t.vertexCount*4),x=new Float32Array(b.slice().buffer),S=new Float32Array(a.HEAPF32.buffer,y,t.vertexCount*3),C={data:r,worldPositions:c,worldRotations:x,worldScales:new Float32Array(S.slice().buffer),offset:t.offset,vertexCount:t.vertexCount,positions:t.positions.buffer,rotations:t.rotations.buffer,scales:t.scales.buffer,colors:t.colors.buffer,selection:t.selection.buffer};self.postMessage({response:C},[C.data.buffer,C.worldPositions.buffer,C.worldRotations.buffer,C.worldScales.buffer,C.positions,C.rotations,C.scales,C.colors,C.selection]),l=!1}),x=()=>{c.length!==0&&(l||(l=!0,b(c.shift()),setTimeout(()=>{l=!1,x()},0)))};self.onmessage=e=>new Promise((t,n)=>{if(e.data.splat){let n=e.data.splat;for(let e=0;e<c.length;e++)if(c[e].offset===n.offset){c[e]=n,t(!0);return}c.push(n),x(),t(!0)}})})();',blob$1=typeof self<`u`&&self.Blob&&new Blob([`(self.URL || self.webkitURL).revokeObjectURL(self.location.href);`,jsContent$1],{type:`text/javascript;charset=utf-8`});function WorkerWrapper$1(e){let t;try{if(t=blob$1&&(self.URL||self.webkitURL).createObjectURL(blob$1),!t)throw``;let n=new Worker(t,{name:e==null?void 0:e.name});return n.addEventListener(`error`,()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),n}catch(t){return new Worker(`data:text/javascript;charset=utf-8,`+encodeURIComponent(jsContent$1),{name:e==null?void 0:e.name})}}function asyncGeneratorStep(e,t,n,r,o,s,c){try{var l=e[s](c),u=l.value}catch(e){n(e);return}l.done?t(u):Promise.resolve(u).then(r,o)}function _asyncToGenerator(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var s=e.apply(t,n);function c(e){asyncGeneratorStep(s,r,o,c,l,`next`,e)}function l(e){asyncGeneratorStep(s,r,o,c,l,`throw`,e)}c(void 0)})}}function createDataModule(){return _createDataModule.apply(this,arguments)}function _createDataModule(){return _createDataModule=_asyncToGenerator(function*(e={}){var t,n=e,r=!1,o=!0,s=`/five.js`;if(r||o){try{new URL(`.`,s).href}catch(e){}(function(){var e=_asyncToGenerator(function*(e){var t=yield fetch(e,{credentials:`same-origin`});if(t.ok)return t.arrayBuffer();throw Error(t.status+` : `+t.url)});return function(t){return e.apply(this,arguments)}})()}console.log.bind(console),console.error.bind(console);var c=!1;function l(e){for(var t=0,n=e.length,r=new Uint8Array(n),o;t<n;++t)o=e.charCodeAt(t),r[t]=~o>>8&o;return r}var u,d,f=!1;function p(){var e=F.buffer;new Int8Array(e),new Int16Array(e),n.HEAPU8=d=new Uint8Array(e),new Uint16Array(e),new Int32Array(e),n.HEAPU32=new Uint32Array(e),n.HEAPF32=new Float32Array(e),new Float64Array(e),new BigInt64Array(e),new BigUint64Array(e)}function m(){if(n.preRun)for(typeof n.preRun==`function`&&(n.preRun=[n.preRun]);n.preRun.length;)O(n.preRun.shift());w(D)}function h(){f=!0,z.c()}function g(){if(n.postRun)for(typeof n.postRun==`function`&&(n.postRun=[n.postRun]);n.postRun.length;)E(n.postRun.shift());w(T)}var _;function v(){return l(`\0asm\0\0\00\b\`\`}}\`|}\`}\`||\`\v\0\`\0\`\0\0\x07aa\0\0\r\0\0\x07\x07\bAÀ¤\v\x07b\0c\0\rd\0
|
|
2720
|
+
`},LineMaterial=class extends three.ShaderMaterial{constructor(e){super({uniforms:three.UniformsUtils.clone(lineShader.uniforms),vertexShader:lineShader.vertexShader,fragmentShader:lineShader.fragmentShader,clipping:!0}),this.type=`LineMaterial`,this.dashed=!1,Object.defineProperties(this,{color:{enumerable:!0,get(){return this.uniforms.diffuse.value},set(e){this.uniforms.diffuse.value=e}},linewidth:{enumerable:!0,get(){return this.uniforms.linewidth.value},set(e){this.uniforms.linewidth.value=e}},dashScale:{enumerable:!0,get(){return this.uniforms.dashScale.value},set(e){this.uniforms.dashScale.value=e}},dashSize:{enumerable:!0,get(){return this.uniforms.dashSize.value},set(e){this.uniforms.dashSize.value=e}},gapSize:{enumerable:!0,get(){return this.uniforms.gapSize.value},set(e){this.uniforms.gapSize.value=e}},opacity:{enumerable:!0,get(){return this.uniforms.opacity.value},set(e){this.uniforms.opacity.value=e}},resolution:{enumerable:!0,get(){return this.uniforms.resolution.value},set(e){this.uniforms.resolution.value.copy(e)}}}),this.setValues(e)}};Object.assign(LineMaterial.prototype,{isLineMaterial:!0});var LineSegments2=class extends three.Mesh{constructor(e,t){super(),this.type=`LineSegments2`,this.geometry=e===void 0?new LineSegmentsGeometry:e,this.material=t===void 0?new LineMaterial({color:Math.random()*16777215}):t}computeLineDistances(){let e=this.geometry,t=e.attributes.instanceStart,n=e.attributes.instanceEnd,r=new Float32Array(2*t.count),o=new three.Vector3,s=new three.Vector3;for(var c=0,l=0,u=t.count;c<u;c++,l+=2)o.fromBufferAttribute(t,c),s.fromBufferAttribute(n,c),r[l]=l===0?0:r[l-1],r[l+1]=r[l]+o.distanceTo(s);let d=new three.InstancedInterleavedBuffer(r,2,1);return e.setAttribute(`instanceDistanceStart`,new three.InterleavedBufferAttribute(d,1,0)),e.setAttribute(`instanceDistanceEnd`,new three.InterleavedBufferAttribute(d,1,1)),this}raycast(e,t){e.camera===null&&console.error(`LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2.`);let n=e.ray,r=e.camera,o=r.projectionMatrix,s=this.geometry,c=this.material,l=c.resolution,u=c.linewidth,d=s.attributes.instanceStart,f=s.attributes.instanceEnd,p=new three.Vector4,m=new three.Vector4,h=new three.Vector4,g=new three.Vector3,_=new three.Matrix4,v=new three.Line3,y=new three.Vector3;n.at(1,h),h.w=1,h.applyMatrix4(r.matrixWorldInverse),h.applyMatrix4(o),h.multiplyScalar(1/h.w),h.x*=l.x/2,h.y*=l.y/2,h.z=0,g.copy(h);let b=this.matrixWorld;_.multiplyMatrices(r.matrixWorldInverse,b);for(var S=0,C=d.count;S<C;S++){p.fromBufferAttribute(d,S),m.fromBufferAttribute(f,S),p.w=1,m.w=1,p.applyMatrix4(_),m.applyMatrix4(_),p.applyMatrix4(o),m.applyMatrix4(o),p.multiplyScalar(1/p.w),m.multiplyScalar(1/m.w);var w=p.z<-1&&m.z<-1,T=p.z>1&&m.z>1;if(w||T)continue;p.x*=l.x/2,p.y*=l.y/2,m.x*=l.x/2,m.y*=l.y/2,v.start.copy(p),v.start.z=0,v.end.copy(m),v.end.z=0;let e=v.closestPointToPointParameter(g,!0);v.at(e,y);let r=three.MathUtils.lerp(p.z,m.z,e),s=r>=-1&&r<=1;var E=g.distanceTo(y)<u*.5;if(s&&E){v.start.fromBufferAttribute(d,S),v.end.fromBufferAttribute(f,S),v.start.applyMatrix4(b),v.end.applyMatrix4(b);var D=new three.Vector3,O=new three.Vector3;n.distanceSqToSegment(v.start,v.end,O,D),t.push({point:O,pointOnLine:D,distance:n.origin.distanceTo(O),object:this,faceIndex:S})}}}};Object.assign(LineSegments2.prototype,{isLineSegments2:!0});var Line2=class extends LineSegments2{constructor(e,t){super(e,t),this.type=`Line2`}};Object.assign(Line2.prototype,{isLine2:!0});var LineGeometry=class extends LineSegmentsGeometry{constructor(){super(),this.type=`LineGeometry`}setPositions(e){let t=e.length-3,n=new Float32Array(2*t);for(let r=0;r<t;r+=3)n[2*r]=e[r],n[2*r+1]=e[r+1],n[2*r+2]=e[r+2],n[2*r+3]=e[r+3],n[2*r+4]=e[r+4],n[2*r+5]=e[r+5];return super.setPositions(n),this}setColors(e){let t=e.length-3,n=new Float32Array(2*t);for(let r=0;r<t;r+=3)n[2*r]=e[r],n[2*r+1]=e[r+1],n[2*r+2]=e[r+2],n[2*r+3]=e[r+3],n[2*r+4]=e[r+4],n[2*r+5]=e[r+5];return super.setColors(n),this}fromLine(e){let t=e.geometry;if(t instanceof three.Geometry){let e=new three.BufferGeometry().fromGeometry(t);this.setPositions(e.attributes.position.array)}else t instanceof three.BufferGeometry&&this.setPositions(t.attributes.position.array);return this}copy(){return this}};Object.assign(LineGeometry.prototype,{isLineGeometry:!0});var circleImageURL=`data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAAZiS0dEAAAAA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Nw0CfXKDCipVCoTj8df3QABbW1tLUc6oUgkFPMkVACUNjc337148eKvw8PDbJ2jP1taWkoCyNDVXDSECmNSK4qiKNLq6urW8+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=class extends three.Object3D{static get version(){return`6.8.9`}constructor(e=new three.Vector3,t=new three.Vector3){super(),this.type=`FiveLine`,this.needsRender=!0;let n=new LineGeometry,r=new LineMaterial({color:DEFAULT_COLOR,linewidth:DEFAULT_LINEWIDTH,dashScale:DEFAULT_DASHSCALE,dashed:!1});this.line=new Line2(n,r);let o=new three.BufferGeometry,s=new three.PointsMaterial({color:DEFAULT_COLOR,size:POINT_SIZE,map:sharedCircleTexture||(sharedCircleTexture=new three.TextureLoader().load(`data:image/png;base64,iVBORw0KGgoAAAANS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3jwNPwDMZrOnqVTqfb3Bi8Wivru7W/VCYkwPlKOjo0IikXh7EwQikYgE4Nw0CfXKDCipVCoTj8df3QABbW1tLUc6oUgkFPMkVACUNjc337148eKvw8PDbJ2jP1taWkoCyNDVXDSECmNSK4qiKNLq6urW8+fPI/UicHx8rD59+jSVy+WOAKSJhKENwFItLtoxk8mwsixzHR0dHe3t7c5PAU+n09rs7OzJkydPYqVSaQfANoDXALIk31S2smU1TWMPDg7K5XKZ7+3t9TudTut1U7+wsFCcmJiIpdPpbQBxADsAknQWymYCOukBHYCuKApisdhpMpnURFEU79y503TVyKenpzOTk5M7e3t7MQKPV0Zv1gNm+awB0MvlshqLxfLb29uyJElWURSbXC4XXyvqxcXFs6mpqeTc3Nzu3t7e3wQcA7BPZ8Cov1pNlJplmQtAG8MwHV6v95tAINA5MDBwPxAIuLu6upr8fr/VAN3c3JQjkcjZ+vp6fnl5+d2bN29SuVzuNYAEpf01CdRChUL+X1VskHACuA3Ay3Fcu9vt7nA6nZ7m5uYWQRCaNE3jVVW15PP580KhIGUymWw2m00DOAJwSP4WwPtq4LX2Ao6USxNlQyS/RcQcdLGwlNIz6vEMAaZpNzCk2Pll94LK/cDYimxERiBwG10sxjgvEZBE0UpE6vxj+0Ct5bTaXthgEhRmja8QWNkkPGsuIpfdjpkK+cZUWTC0KredVmtD/gdlSl6EG4AMvQAAAABJRU5ErkJggg==`)),sizeAttenuation:!1,transparent:!0});this.points=new three.Points(o,s),this.points.renderOrder=11,this.points.frustumCulled=!1,this.setPoints(e,t),this.add(this.line,this.points)}setPoints(e,t){let n=[].concat(e.toArray(),t.toArray());this.points.geometry.setAttribute(`position`,new three.BufferAttribute(new Float32Array(n),3)),this.line.geometry.setPositions(n),this.line.computeLineDistances(),this.needsRender=!0}getPoints(){let e=this.points.geometry.attributes.position.array;return[new three.Vector3(e[0],e[1],e[2]),new three.Vector3(e[3],e[4],e[5])]}setMaterial(e){let t=this.line.material;for(let n in e){if(!e.hasOwnProperty(n))continue;let r=e[n];n===`dashed`?(t.dashed=r,r?t.defines.USE_DASH=``:delete t.defines.USE_DASH,t.needsUpdate=!0):t[n]=e[n]}this.needsRender=!0}setResolution(e,t){let n=this.line.material.resolution;(n.x!==e||n.y!==t)&&(n.set(e,t),this.needsRender=!0)}};Object.assign(FiveLine.prototype,{isFiveLine:!0});var Constants={Handedness:Object.freeze({NONE:`none`,LEFT:`left`,RIGHT:`right`}),ComponentState:Object.freeze({DEFAULT:`default`,TOUCHED:`touched`,PRESSED:`pressed`}),ComponentProperty:Object.freeze({BUTTON:`button`,X_AXIS:`xAxis`,Y_AXIS:`yAxis`,STATE:`state`}),ComponentType:Object.freeze({TRIGGER:`trigger`,SQUEEZE:`squeeze`,TOUCHPAD:`touchpad`,THUMBSTICK:`thumbstick`,BUTTON:`button`}),ButtonTouchThreshold:.05,AxisTouchThreshold:.1,VisualResponseProperty:Object.freeze({TRANSFORM:`transform`,VISIBILITY:`visibility`})};function fetchJsonFile(e){return __awaiter(this,void 0,void 0,function*(){let t=yield fetch(e);if(t.ok)return t.json();throw Error(t.statusText)})}function fetchProfilesList(e){return __awaiter(this,void 0,void 0,function*(){if(!e)throw Error(`No basePath supplied`);return yield fetchJsonFile(`${e}/profilesList.json`)})}function fetchProfile(e,t){return __awaiter(this,arguments,void 0,function*(e,t,n=null,r=!0){if(!e)throw Error(`No xrInputSource supplied`);if(!t)throw Error(`No basePath supplied`);let o=yield fetchProfilesList(t),s;if(e.profiles.some(e=>{let n=o[e];return n&&(s={profileId:e,profilePath:`${t}/${n.path}`,deprecated:!!n.deprecated}),!!s}),!s){if(!n)throw Error(`No matching profile name found`);let e=o[n];if(!e)throw Error(`No matching profile name found and default profile "${n}" missing.`);s={profileId:n,profilePath:`${t}/${e.path}`,deprecated:!!e.deprecated}}let c=yield fetchJsonFile(s.profilePath),l;if(r){let t;if(t=c.layouts[e.handedness],!t)throw Error(`No matching handedness, ${e.handedness}, in profile ${s.profileId}`);t.assetPath&&(l=s.profilePath.replace(`profile.json`,t.assetPath))}return{profile:c,assetPath:l}})}var defaultComponentValues={xAxis:0,yAxis:0,button:0,state:Constants.ComponentState.DEFAULT};function normalizeAxes(e=0,t=0){let n=e,r=t;if(Math.sqrt(e*e+t*t)>1){let o=Math.atan2(t,e);n=Math.cos(o),r=Math.sin(o)}return{normalizedXAxis:n*.5+.5,normalizedYAxis:r*.5+.5}}var VisualResponse=class{constructor(e){this.componentProperty=e.componentProperty,this.states=e.states,this.valueNodeName=e.valueNodeName,this.valueNodeProperty=e.valueNodeProperty,this.valueNodeProperty===Constants.VisualResponseProperty.TRANSFORM&&(this.minNodeName=e.minNodeName,this.maxNodeName=e.maxNodeName),this.value=0,this.updateFromComponent(defaultComponentValues)}updateFromComponent({xAxis:e,yAxis:t,button:n,state:r}){let{normalizedXAxis:o,normalizedYAxis:s}=normalizeAxes(e,t);switch(this.componentProperty){case Constants.ComponentProperty.X_AXIS:this.value=this.states.includes(r)?o:.5;break;case Constants.ComponentProperty.Y_AXIS:this.value=this.states.includes(r)?s:.5;break;case Constants.ComponentProperty.BUTTON:this.value=this.states.includes(r)?n:0;break;case Constants.ComponentProperty.STATE:this.valueNodeProperty===Constants.VisualResponseProperty.VISIBILITY?this.value=this.states.includes(r):this.value=+!!this.states.includes(r);break;default:throw Error(`Unexpected visualResponse componentProperty ${this.componentProperty}`)}}},Component=class{constructor(e,t){if(!e||!t||!t.visualResponses||!t.gamepadIndices||Object.keys(t.gamepadIndices).length===0)throw Error(`Invalid arguments supplied`);this.id=e,this.type=t.type,this.rootNodeName=t.rootNodeName,this.touchPointNodeName=t.touchPointNodeName,this.visualResponses={},Object.keys(t.visualResponses).forEach(e=>{let n=new VisualResponse(t.visualResponses[e]);this.visualResponses[e]=n}),this.gamepadIndices=Object.assign({},t.gamepadIndices),this.values={state:Constants.ComponentState.DEFAULT,button:this.gamepadIndices.button===void 0?void 0:0,xAxis:this.gamepadIndices.xAxis===void 0?void 0:0,yAxis:this.gamepadIndices.yAxis===void 0?void 0:0}}get data(){return Object.assign({id:this.id},this.values)}updateFromGamepad(e){if(this.values.state=Constants.ComponentState.DEFAULT,this.gamepadIndices.button!==void 0&&e.buttons.length>this.gamepadIndices.button){let t=e.buttons[this.gamepadIndices.button];this.values.button=t.value,this.values.button=this.values.button<0?0:this.values.button,this.values.button=this.values.button>1?1:this.values.button,t.pressed||this.values.button===1?this.values.state=Constants.ComponentState.PRESSED:(t.touched||this.values.button>Constants.ButtonTouchThreshold)&&(this.values.state=Constants.ComponentState.TOUCHED)}this.gamepadIndices.xAxis!==void 0&&e.axes.length>this.gamepadIndices.xAxis&&(this.values.xAxis=e.axes[this.gamepadIndices.xAxis],this.values.xAxis=this.values.xAxis<-1?-1:this.values.xAxis,this.values.xAxis=this.values.xAxis>1?1:this.values.xAxis,this.values.state===Constants.ComponentState.DEFAULT&&Math.abs(this.values.xAxis)>Constants.AxisTouchThreshold&&(this.values.state=Constants.ComponentState.TOUCHED)),this.gamepadIndices.yAxis!==void 0&&e.axes.length>this.gamepadIndices.yAxis&&(this.values.yAxis=e.axes[this.gamepadIndices.yAxis],this.values.yAxis=this.values.yAxis<-1?-1:this.values.yAxis,this.values.yAxis=this.values.yAxis>1?1:this.values.yAxis,this.values.state===Constants.ComponentState.DEFAULT&&Math.abs(this.values.yAxis)>Constants.AxisTouchThreshold&&(this.values.state=Constants.ComponentState.TOUCHED)),Object.values(this.visualResponses).forEach(e=>{e.updateFromComponent(this.values)})}},MotionController=class{constructor(e,t,n){if(!e)throw Error(`No xrInputSource supplied`);if(!t)throw Error(`No profile supplied`);this.xrInputSource=e,this.assetUrl=n,this.id=t.profileId,this.layoutDescription=t.layouts[e.handedness],this.components={},Object.keys(this.layoutDescription.components).forEach(e=>{let t=this.layoutDescription.components[e];this.components[e]=new Component(e,t)}),this.updateFromGamepad()}get gripSpace(){return this.xrInputSource.gripSpace}get targetRaySpace(){return this.xrInputSource.targetRaySpace}get data(){let e=[];return Object.values(this.components).forEach(t=>{e.push(t.data)}),e}updateFromGamepad(){Object.values(this.components).forEach(e=>{e.updateFromGamepad(this.xrInputSource.gamepad)})}},DEFAULT_PROFILES_PATH=`https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles`,DEFAULT_PROFILE=`generic-trigger`,XRControllerModel=class extends three.Object3D{constructor(){super(),this.motionController=null,this.envMap=null}setEnvironmentMap(e){return this.envMap==e?this:(this.envMap=e,this.traverse(e=>{e instanceof three.Mesh&&e.isMesh&&(e.material.envMap=this.envMap,e.material.needsUpdate=!0)}),this)}updateMatrixWorld(e){super.updateMatrixWorld(e),this.motionController&&(this.motionController.updateFromGamepad(),Object.values(this.motionController.components).forEach(e=>{Object.values(e.visualResponses).forEach(e=>{let{valueNode:t,minNode:n,maxNode:r,value:o,valueNodeProperty:s}=e;t&&(s===Constants.VisualResponseProperty.VISIBILITY?t.visible=o:s===Constants.VisualResponseProperty.TRANSFORM&&(t.quaternion.copy(n.quaternion).slerp(r.quaternion,o),t.position.lerpVectors(n.position,r.position,o)))})}))}};function findNodes(e,t){Object.values(e.components).forEach(e=>{let{type:n,touchPointNodeName:r,visualResponses:o}=e;if(n===Constants.ComponentType.TOUCHPAD)if(e.touchPointNode=t.getObjectByName(r),e.touchPointNode){let t=new three.Mesh(new three.SphereGeometry(.001),new three.MeshBasicMaterial({color:255}));e.touchPointNode.add(t)}else console.warn(`Could not find touch dot, ${e.touchPointNodeName}, in touchpad component ${e.id}`);Object.values(o).forEach(e=>{let{valueNodeName:n,minNodeName:r,maxNodeName:o,valueNodeProperty:s}=e;if(s===Constants.VisualResponseProperty.TRANSFORM){if(e.minNode=t.getObjectByName(r),e.maxNode=t.getObjectByName(o),!e.minNode){console.warn(`Could not find ${r} in the model`);return}if(!e.maxNode){console.warn(`Could not find ${o} in the model`);return}}e.valueNode=t.getObjectByName(n),e.valueNode||console.warn(`Could not find ${n} in the model`)})})}function addAssetSceneToControllerModel(e,t){findNodes(e.motionController,t),e.envMap&&t.traverse(t=>{t instanceof three.Mesh&&t.isMesh&&(t.material.envMap=e.envMap,t.material.needsUpdate=!0)}),e.add(t)}var XRControllerModelFactory=class{constructor(e=null){this.gltfLoader=e,this.path=DEFAULT_PROFILES_PATH,this._assetCache={}}createControllerModel(e){let t=new XRControllerModel,n=null;return e.addEventListener(`connected`,e=>{let r=e.data;r.targetRayMode!==`tracked-pointer`||!r.gamepad||fetchProfile(r,this.path,DEFAULT_PROFILE).then(({profile:e,assetPath:o})=>{t.motionController=new MotionController(r,e,o);let s=this._assetCache[t.motionController.assetUrl];if(s)n=s.scene.clone(),addAssetSceneToControllerModel(t,n);else{if(!this.gltfLoader)throw Error(`GLTFLoader not set.`);this.gltfLoader.load(t.motionController.assetUrl,e=>{this._assetCache[t.motionController.assetUrl]=e,n=e.scene.clone(),addAssetSceneToControllerModel(t,n)})}}).catch(e=>{console.warn(e)})}),e.addEventListener(`disconnected`,()=>{t.motionController=null,t.remove(n),n=null}),t}},defaultEffect=`fade`,defaultXRPanoramaControllerInitArgs=Object.assign({},omit(defaultPanoramaControllerCustomInitArgs,[`maxLatitude`,`minLatitude`]));function mapPanoResource(e,t){if(!t)return e;let n=e.match(/\d+_[a-z].png/);return e.substring(0,n.index)+t+`/`+e.substring(n.index)}var CONTROLLER_EVNET_DELTA_TIME=300,scratchRaycaster=new three.Raycaster,scratchVector3=new three.Vector3,XRPanoramaController=class e extends PanoramaController{static parseArgs(t){if(t instanceof e)return t;let n=Object.assign(Object.assign({},t),{maxLatitude:Math.PI/2,minLatitude:-Math.PI/2});return super.parseArgs(n)}static initAnimationEndState(e){let t=this.parseArgs(e),n=super.initAnimationEndState(t);return Object.assign(Object.assign({},n),{mode:`XRPanorama`})}constructor(e){super(e),this.xrManager=new XRManager(this.renderer,this.renderer.getContext(),{onSessionStart:e=>{this.emit(`xr.session.start`,createEvent(`xr.session.start`,{session:e,machineType:this.xrManager.machineType}))},onSessionEnd:()=>{this.emit(`xr.session.end`,createEvent(`xr.session.end`,{session:null,machineType:this.xrManager.machineType}))}}),this.xrControllerRay={left:new three.Raycaster,right:new three.Raycaster},this.xrControllerRay.left.params.Points={threshold:.1},this.xrControllerRay.left.firstHitOnly=!0,this.xrControllerRay.left.floorIndex=-1,this.xrControllerRay.right.params.Points={threshold:.1},this.xrControllerRay.right.firstHitOnly=!0,this.xrControllerRay.right.floorIndex=-1,this.gazeRay=null,this.pointerLines={left:new FiveLine,right:new FiveLine},this.pointerLines.left.visible=!1,this.pointerLines.right.visible=!0,this.pointerLines.left.setMaterial({color:new three.Vector3(1,1,1)}),this.pointerLines.left.points.material.depthTest=!1,this.pointerLines.right.setMaterial({color:new three.Vector3(1,1,1)}),this.pointerLines.right.points.material.depthTest=!1,this.controllerWrappers=[new three.Group,new three.Group];let t=this.xrManager.getController(0);this.controllerWrappers[0].add(t);let n=this.xrManager.getController(1);this.controllerWrappers[1].add(n);let r=new XRControllerModelFactory;r.gltfLoader={load(e,t){internalFetcher.ajax(e,{responseType:`arraybuffer`}).then(t=>{var n;return parseGltf(t.body,{resourcePath:e.slice(0,e.lastIndexOf(`/`)+1),search:(n=e.split(`?`)[1])==null?``:n,fetcher:internalFetcher})}).then(e=>t(e))}},(this.xrManager.machineType===`Oculus`||this.xrManager.machineType===`Pico`)&&this.scene.add(this.pointerLines.left,this.pointerLines.right,this.controllerWrappers[0],this.controllerWrappers[1]),this.panoResources={},this.panoResources[this.locationMotion.keyframes[0].key=this.locationMotion.keyframes[1].key=createUuid$1()]={panoId:panoStringify(this.currentPano),leftPanoPicture:null,position:this.camera.pose.offset.clone(),effect:defaultEffect,effectEasing:defaultEffectEase,fixCameraTransform:new three.Matrix4},this.parallaxCameraMatrixs=[];let o=AnimationFrameLoop.shared.getContext();if(!o){console.error(`获取session失败,请退出重试`);return}this.on(`xr.session.end`,()=>{this.scene.remove(this.pointerLines.left,this.pointerLines.right)}),this.xrManager.setSession(o),this.on(`xr.session.start`,()=>{let e=this.xrManager.getControllerGrip(0);e.add(r.createControllerModel(e)),this.controllerWrappers[0].add(e);let t=this.xrManager.getControllerGrip(1);t.add(r.createControllerModel(t)),this.controllerWrappers[1].add(t)}),this.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}},this.xrManager.machineType===`VP`&&this.initHandEvent()}updateConfiguration(e){return super.updateConfiguration(Object.assign(Object.assign({},e),{maxLatitude:Math.PI/2,minLatitude:-Math.PI/2}))}moveToPano(e,t,n){var r,o,s;this.userAction=n,this.stopMomentumMovement();let c=panoStringify(e),l=this.works.getObserver(e);if(!l)throw Error(`Invalid PanoIndex`);let u=getImageSizeFromURL(l.images.up),d=this.imageOptions.size;d===void 0&&l&&u&&(d=Number(u)),d===void 0&&(d=2048);let f=this.imageOptions.transform,p=(e,t)=>mapPanoResource(applyImageURLOptions(e,f,t)),m=Object.assign({key:`pano.${c}`},pick(this.imageOptions,[`format`,`size`,`quality`])),h={right:l.images.work.getURL(l.images.right),left:l.images.work.getURL(l.images.left),up:l.images.work.getURL(l.images.up),down:l.images.work.getURL(l.images.down),front:l.images.work.getURL(l.images.front),back:l.images.work.getURL(l.images.back)},g=`pano:`+jsonHash([h,m,f]);if(this.pendingPanoTask){if(this.pendingPanoTask.hash===g)return;{let t=this.pendingPanoTask.panoId;(r=this.panoMeshes.get(t))==null||r.setProgress(0),this.emit(`pano.texture.abort`,createEvent(`pano.texture.abort`,{error:null,progress:0,meta:null,pano:e}))}}let _=`move-to-pano-`+c;this.pending.add(_);let v=createExtendableEvent(`pano.prepare`,{options:t,prevMode:this.mode,prevPano:this.currentPano,pano:e});if(this.emit(`pano.prepare`,v),v.defaultPrevented){this.pending.delete(_);return}v.options!==t&&Object.assign(t,v.options);let y=this.modelScene.parameter,b;y.pano0&&y.pano0.map.name===g?b=y.pano0:y.pano1&&y.pano1.map.name===g&&(b=y.pano1);let S=(o=t.effect)==null?defaultEffect:o,C=(s=t.effectEasing)==null?defaultEffectEase:s;if(b){let n={panoId:c,effect:S,effectEasing:C,leftPanoPicture:{panoId:b.panoId,map:b.map,mapHistogram:b.mapHistogram,mapSize:b.mapSize,matrix:l.matrix.clone().premultiply(l.work.transform),zoom:1},position:l.position.clone().applyMatrix4(l.work.transform),fixCameraTransform:new three.Matrix4};n.leftPanoPicture&&this.panoPictureObserverMap.set(n.leftPanoPicture,l),this.pendingPanoTask=void 0,Promise.resolve().then(()=>waitForExtendableEvent(v)).catch(e=>{let t=toError(e);return this.emit(`error`,t),t}).then(r=>{var o,s;if(!(r instanceof Error))this.pending.delete(_),this.pendingPanoTask=void 0,(o=this.panoMeshes.get(c))==null||o.setProgress(0),this.doMoveToPano(e,n,t);else{let e=null;r instanceof Error&&(e||(e=r));let n=Object.assign(Object.assign(Object.assign({},this.currentPano),{mode:this.mode}),clonePose(this.camera.pose));this.emit(`pano.cancel`,createEvent(`pano.cancel`,{error:null,userAction:this.userAction,options:t,prevPano:this.currentPano,pano:{panoIndex:l.panoIndex,workCode:l.work.workCode},progress:0,state:n})),t.moveCancelCallback&&t.moveCancelCallback(),this.emit(`pano.error`,createEvent(`pano.error`,{error:e,userAction:this.userAction,options:t,prevPano:this.currentPano,pano:{panoIndex:l.panoIndex,workCode:l.work.workCode},progress:0,state:n})),e instanceof Error&&e.message&&this.emit(`error`,e),this.pending.delete(_),this.pendingPanoTask=void 0,(s=this.panoMeshes.get(c))==null||s.setProgress(0)}});return}let w=this.panoMeshes.get(c);w&&w.tap&&w.tap(),this.pendingPanoTask={panoId:c,hash:g,onLoad:n=>{var r;let o=n.body;if(this.destroyed)o.dispose();else{o.name=g;let n=Array.isArray(o.image)?o.image[0]:o.image,s=(r=n==null?void 0:n.width)==null?2048:r,u=new Histogram().formPixels(getRgbaDataFromCubeTexture(this.renderer,o,!0,sharedHistogramRgbaData).data),d={panoId:c,effect:S,effectEasing:C,leftPanoPicture:{panoId:c,map:o,mapSize:s,mapHistogram:new three.Vector4().fromArray(u.toArray()),matrix:l.matrix.clone(),zoom:1},position:l.position.clone(),fixCameraTransform:new three.Matrix4};d.leftPanoPicture&&this.panoPictureObserverMap.set(d.leftPanoPicture,l),this.doMoveToPano(e,d,t)}},onError:e=>{let n=Object.assign(Object.assign(Object.assign({},this.currentPano),{mode:this.mode}),clonePose(this.camera.pose));this.emit(`pano.cancel`,createEvent(`pano.cancel`,{error:null,userAction:this.userAction,options:t,prevPano:this.currentPano,pano:{panoIndex:l.panoIndex,workCode:l.work.workCode},progress:0,state:n})),this.emit(`pano.error`,createEvent(`pano.error`,{error:e,userAction:this.userAction,options:t,prevPano:this.currentPano,pano:{panoIndex:l.panoIndex,workCode:l.work.workCode},progress:0,state:n})),e instanceof Error&&e.message&&this.emit(`error`,e),t.moveCancelCallback&&t.moveCancelCallback()}},Promise.all([Promise.resolve().then(()=>{this.emit(`pano.texture.load`,createEvent(`pano.texture.load`,{error:null,progress:0,meta:null,pano:e}))}).then(()=>this.textureLoader.loadCubeTexture(h,{imageURL:{transform:p,options:m},format:three.RGBFormat,viaAjax:!0,fetcher:getFetcher(this.fiveId,l.work)},void 0,void 0,t=>{var n,r;this.emit(`pano.texture.progress`,createEvent(`pano.texture.progress`,{error:null,progress:t,meta:null,pano:e})),((n=this.pendingPanoTask)==null?void 0:n.hash)===g&&((r=this.panoMeshes.get(c))==null||r.setProgress(t))},this.renderer)).catch(t=>{let n=toError(t);return this.emit(`pano.texture.error`,createEvent(`pano.texture.error`,{error:n,progress:0,meta:null,pano:e})),n}),Promise.resolve().then(()=>waitForExtendableEvent(v)).catch(e=>toError(e))]).then(([t,n])=>{var r,o,s,l;if(!(t instanceof Error)&&!(n instanceof Error))this.pending.delete(_),((r=this.pendingPanoTask)==null?void 0:r.hash)===g?(this.pendingPanoTask.onLoad(t),this.pendingPanoTask=void 0,(o=this.panoMeshes.get(c))==null||o.setProgress(0)):t.body.dispose(),this.emit(`pano.texture.success`,createEvent(`pano.texture.success`,{error:null,progress:1,meta:t.meta,pano:e}));else{let e=null;t instanceof Error?e||(e=t):t.body.dispose(),n instanceof Error&&(e||(e=n)),this.pending.delete(_),((s=this.pendingPanoTask)==null?void 0:s.hash)===g&&(this.pendingPanoTask.onError(e),this.pendingPanoTask=void 0,(l=this.panoMeshes.get(c))==null||l.setProgress(0))}})}doMoveToPano(e,t,n={}){var r,o,s,c,l,u,d,f,p,m;let h=now(),g=createUuid$1();this.panoResources[g]=t;let _=1,v,y,b;if(this.locationMotion.ended){let[e,n]=this.locationMotion.getKeyFrameSegment(h),r=this.locationMotion.value,o=this.panoResourceFromLocationMotionKeyframe(n).position,s=t.position;v=Math.max(o.distanceTo(s),1),y=[{key:n.key,progress:0,value:Object.assign(Object.assign({},r),{count:0})},{key:g,progress:1,value:{distance:0,count:1}}],b=0}else{let[e,n]=this.locationMotion.getKeyFrameSegment(h),r=this.locationMotion.value,o=this.panoResourceFromLocationMotionKeyframe(e).position,s=this.panoResourceFromLocationMotionKeyframe(n).position,c=t.position,l=n.value.count-r.count,u=Math.max(o.distanceTo(s),1)*l;v=u+Math.max(s.distanceTo(c),1),y=[{key:e.key,progress:0,value:Object.assign({},r)},{key:n.key,progress:u/v,value:n.value},{key:g,progress:1,value:{count:n.value.count+1,distance:0}}];let d=this.locationMotionKeyframesLength(this.locationMotion.keyframes),f=this.locationMotionKeyframesLength(y);b=this.locationMotion.getProgressVelocity(h)*d/f}let S=t.effect===`instant`?0:this.calculateMovingDuration(n.duration,t.effect===`fly`||t.effect===`model`?v:0),C={longitude:n.longitude,latitude:n.latitude,fov:n.fov},w=Object.assign(Object.assign({},e),{mode:this.mode,longitude:(r=C.longitude)==null?this.camera.pose.longitude:r,latitude:(o=C.latitude)==null?this.camera.pose.latitude:o,fov:(s=C.fov)==null?this.camera.pose.fov:s,offset:t.position.clone(),distance:0}),T=this.currentPano;if(this.emit(`pano.moveTo`,createEvent(`pano.moveTo`,{options:n,prevPano:T,pano:{panoIndex:w.panoIndex,workCode:w.workCode},progress:0,state:w,userAction:this.userAction,error:null})),n.moveStartCallback&&n.moveStartCallback(w),this.perspToOrthoMotion.set({perspToOrtho:0},S).catch(noop),this.modelAlphaMotion.setKeyframes([{progress:0,value:Object.assign({},this.modelAlphaMotion.value)},{progress:.6,value:Object.assign({},this.modelAlphaMotion.value)},{progress:1,value:{modelAlpha:0}}],S).catch(noop),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),t.effect===`fly`||t.effect===`model`)this.cameraMotion.set(C,S).catch(noop);else{let e=coordinatesToVector({longitude:this.cameraMotion.value.longitude,latitude:this.cameraMotion.value.latitude}),n=coordinatesToVector({longitude:(c=C.longitude)==null?this.cameraMotion.value.longitude:c,latitude:(l=C.latitude)==null?this.cameraMotion.value.latitude:l}),r=new three.Object3D;r.lookAt(e);let o=new three.Matrix4().makeRotationFromQuaternion(r.quaternion);r.lookAt(n);let s=new three.Matrix4().makeRotationFromQuaternion(r.quaternion),h=new three.Matrix4().getInverse(o).premultiply(s),g=this.cameraMotion.value.fov,_=(u=C.fov)==null?this.cameraMotion.value.fov:u,v=1;t.effect===`zoomin`?v=1.5:t.effect===`zoomout`&&(v=.4);let b=_*v;for(let e=0;e<y.length-1;e++){let t=y[e].key;if(t){let e=this.panoResources[t];e&&(e.fixCameraTransform.copy(h),e.leftPanoPicture&&(e.leftPanoPicture.zoom=Math.tan(b/2/180*Math.PI)/Math.tan(g/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:(d=C.longitude)==null?this.cameraMotion.value.longitude:d,latitude:(f=C.latitude)==null?this.cameraMotion.value.latitude:f,fov:b}},{progress:1,value:{longitude:(p=C.longitude)==null?this.cameraMotion.value.longitude:p,latitude:(m=C.latitude)==null?this.cameraMotion.value.latitude:m,fov:_}}],S).catch(noop)}this.locationMotion.setKeyframes(y,S,b).then(()=>{for(let e of this.modelScene.children)e instanceof Model&&e.show();let t=Object.assign(Object.assign({},e),{mode:this.mode,longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov,offset:this.camera.pose.offset.clone(),distance:0});this.emit(`pano.arrived`,createEvent(`pano.arrived`,{options:n,prevPano:T,pano:{panoIndex:t.panoIndex,workCode:t.workCode},progress:1,state:t,userAction:this.userAction,error:null})),n.moveEndCallback&&n.moveEndCallback(t);let r=this.works.getObserver(this.currentPano);if(r&&r.images.video&&this.videoTexture&&this.videoTexture.image instanceof HTMLVideoElement){let e={map:this.videoTexture,size:r.images.video.size.clone(),matrix:r.images.video.matrix.clone(),panoMatrix:r.matrix.clone().premultiply(r.work.transform),alpha:1},t=createUuid$1(),n=this.videoTexture.image;n.setAttribute(`uuid`,t),canplayVideo().then(o=>{o&&r.images.video&&n.getAttribute(`uuid`)===t&&(n.oncanplay=()=>{n.oncanplay=noop,n.play()},n.ontimeupdate=()=>{n.currentTime>.5&&(n.ontimeupdate=noop,this.panoVideo.setMaterial(e))},n.src=r.images.video.source)}).catch((()=>{n.removeAttribute(`uuid`)}))}},()=>{let e=Object.assign(Object.assign(Object.assign({},this.currentPano),{mode:this.mode}),clonePose(this.camera.pose));this.emit(`pano.cancel`,createEvent(`pano.cancel`,{options:n,prevPano:T,pano:{panoIndex:e.panoIndex,workCode:e.workCode},progress:0,state:e,userAction:this.userAction,error:null})),n.moveCancelCallback&&n.moveCancelCallback()})}checkSelectedPano(e){var t;this.stopMomentumMovement(),this.camera.getDirection(new three.Vector3).setY(0);let n=null,r=this.works.getObserver(this.currentPano);if(!r)return null;let o=r.work.observers,s=r.accessibleNodes.filter(e=>{if(e===this.currentPano.panoIndex&&r.work.workCode===this.currentPano.workCode)return!1;let t=o[e];return!t||scratchVector3.copy(t.position).applyMatrix4(t.work.transform).distanceTo(this.camera.position)>this.maxAccessibleDistance?!1:t.loadable||t.active}),[c]=this.modelScene.intersectRaycaster(e);if(c){let[e,r]=arrayMin(s,e=>{let t=o[e];return t?scratchVector3.copy(t.standingPosition).applyMatrix4(t.work.transform).distanceTo(c.point):1/0},!0);typeof e==`number`&&r<this.panoTapTriggerRadius&&(n=(t=o[e])==null?null:t)}if(isNil(n)){let t=this.getForwardObserverOrNot(this.xrManager.cameraVR,e);t&&(n=t)}for(let e of this.locationMotion.keyframes){let t=this.panoResourceFromLocationMotionKeyframe(e);if(!(e.progress<this.locationMotion.progress)&&n){let e=panoStringify({panoIndex:n.panoIndex,workCode:n.work.workCode});if(t.panoId===e){n=null;break}}}if(isNil(n))return this.locationMotion.ended===!0&&this.cameraBounce(),null;if(!n.active){let e=panoStringify({panoIndex:n.panoIndex,workCode:n.work.workCode}),t=this.panoMeshes.get(e);t&&(t.setDisabled(!1),t.setLoading(!0))}let l={workCode:n.work.workCode,panoIndex:n.panoIndex,mode:this.mode,longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov,distance:0,offset:n?n.position.clone():new three.Vector3};return this.emit(`pano.select`,createEvent(`pano.select`,{prevPano:this.currentPano,pano:{panoIndex:l.panoIndex,workCode:l.workCode},state:l,userAction:!0,options:{},progress:0,error:null})),n&&n.active?(this.emit(`pano.request`,createEvent(`pano.request`,{userAction:!0,prevPano:this.currentPano,pano:{panoIndex:l.panoIndex,workCode:l.workCode},progress:0,state:l,options:{},error:null})),{workCode:n.work.workCode,panoIndex:n.panoIndex}):null}destroy(){super.destroy()}isReady(){return!1}updateCamera(e,t,n){return Promise.resolve()}updateCameraWithKeyframes(e,t,n){return Promise.resolve()}updateTime(e,t,...n){var r,o,s,c,l,u,d,f,p;this.userAction=!0;let m={},h={},g=this.camera.getDirection(new three.Vector3),_=this.locationMotion.keyframes[0],v=this.locationMotion.keyframes[this.locationMotion.keyframes.length-1],[y,b]=this.locationMotion.getKeyFrameSegment(e),S=this.panoResourceFromLocationMotionKeyframe(y),C=this.panoResourceFromLocationMotionKeyframe(b),w=this.panoResourceFromLocationMotionKeyframe(_),T=this.panoResourceFromLocationMotionKeyframe(v),E=!1;if(this.cameraMotion.ended===!1&&(this.cameraMotion.update(e),h.fov=this.cameraMotion.value.fov),this.modelAlphaMotion.ended===!1&&(this.modelAlphaMotion.update(e),m.modelAlpha=this.modelAlphaMotion.value.modelAlpha),this.perspToOrthoMotion.ended===!1&&(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(clamp$1(this.perspToOrthoMotion.value.perspToOrtho,0,1))),this.locationMotion.ended===!1){this.locationMotion.update(e);let t=this.locationMotion.value.count-b.value.count+1,n=new three.Vector3().copy(S.position),s=new three.Vector3().copy(C.position);if(m.progress=t,t>=.01&&t<=.99&&(m.progress=clamp$1(C.effectEasing(t),.01,.99)),C.leftPanoPicture&&(t<1?S.leftPanoPicture&&(m.pano0=S.leftPanoPicture):m.pano0=C.leftPanoPicture,m.pano1=C.leftPanoPicture),C.effect===`montage`?m.transition=`BLACK`:C.effect===`spread`?m.transition=`SPREAD`:m.transition=`FADE`,C.effect===`zoomin`||C.effect===`zoomout`?m.progress=Math.pow(t,3):C.effect===`model`&&this.camera.pose.distance<.01&&(m.modelAlpha=1-Math.pow(clamp$1(Math.abs(t-.5)*2,0,1),4)),t<1&&C.effect!==`fly`){if(m.pano0&&S.leftPanoPicture){let e={panoId:m.pano0.panoId,map:m.pano0.map,mapHistogram:m.pano0.mapHistogram,mapSize:m.pano0.mapSize,zoom:m.pano0.zoom,matrix:S.leftPanoPicture.matrix.clone().setPosition(C.position)},t=this.panoPictureObserverMap.get(m.pano0);t&&this.panoPictureObserverMap.set(e,t),m.pano0=e}n.copy(s),E=!0}h.distance=this.locationMotion.value.distance,h.offset=new three.Vector3(n.x+(s.x-n.x)*t,n.y+(s.y-n.y)*t,n.z+(s.z-n.z)*t);let c=[],l=[];for(let e of this.locationMotion.keyframes){let{key:t,progress:n}=e;t!==void 0&&(c.push(t),n>this.locationMotion.progress&&l.push(t))}for(let e of Object.keys(this.panoResources)){if(l.indexOf(e)>=0)continue;let t=this.panoResources[e];if(t.leftPanoPicture){let e=t.leftPanoPicture.map;if(e){if(e===((r=m.pano0)==null?void 0:r.map)||e===((o=m.pano1)==null?void 0:o.map))continue;e.dispose(),t.leftPanoPicture=null}}c.indexOf(e)>=0||delete this.panoResources[e]}let u=panoParse(C.panoId);u!==this.currentPano&&(this.currentPano=u,this.accessibleObserverFloorCheckCount=0),this.emit(`pano.moving`,createEvent(`pano.moving`,{userAction:this.userAction,prevPano:panoParse(w.panoId),pano:panoParse(T.panoId),state:Object.assign(Object.assign(Object.assign(Object.assign({},panoParse(T.panoId)),{mode:this.mode}),clonePose(this.camera.pose)),h),options:{},progress:this.locationMotion.progress,error:null}))}this.camera.setFromPose(h),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);let[D,O]=n,k=new three.Vector3(0,0,0),A=new three.Vector2().copy(this.camera.resolution);if(O&&this.xrManager.session&&this.xrManager.referenceSpace&&this.xrManager.session.renderState.baseLayer){let n=this.xrManager.cameraVR,r=this.xrManager.referenceSpace,o=this.xrManager.session.renderState.baseLayer,u=O.getViewerPose(r),d=(s=u==null?void 0:u.views)==null?[]:s;for(let e=0;e<d.length;e++){let t=d[e],r=n.cameras[e],s=o.getViewport(t);s&&(r.projectionMatrix.fromArray(t.projectionMatrix),r.projectionMatrixInverse.getInverse(r.projectionMatrix),r.matrix.fromArray(t.transform.matrix),r.matrix.setPosition(this.camera.position),r.matrix.decompose(r.position,r.quaternion,r.scale),r.matrixWorld.copy(r.matrix),r.matrixWorldInverse.getInverse(r.matrixWorld),r.matrixAutoUpdate=!1,k.copy(r.position),r.viewport.set(s.x,s.y,s.width,s.height),A.set(s.width,s.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=h.distance)==null?this.camera.pose.distance:c),this.xrManager.session.inputSources){for(let e=0;e<this.xrManager.session.inputSources.length;e++)if(this.xrManager.session.inputSources[e]&&this.xrManager.session.inputSources[e].targetRayMode===`transient-pointer`){let t=O.getPose(this.xrManager.session.inputSources[e].targetRaySpace,r);if(t){let e=t.transform.orientation,n=new three.Quaternion(e.x,e.y,e.z,e.w),r=new three.Vector3(0,0,-1).applyQuaternion(n),o=new three.Raycaster(this.camera.position,r);this.gazeRay=o}}}if(this.xrManager.machineType===`Oculus`||this.xrManager.machineType===`Pico`){let n=this.xrManager.session.inputSources;for(let e=0;e<n.length;e++){let t=this.xrManager.controllers[e],o=n[e];if(!o)continue;t&&t.update(o,O,r);let s=this.xrManager.getController(e),c=new three.Vector3(0,1.2,0),u=s.position.clone().add(k).sub(c);o.handedness===`left`?this.xrControllerRay.left.set(u,new three.Vector3(0,0,-1).applyEuler(s.rotation)):o.handedness===`right`&&this.xrControllerRay.right.set(u,new three.Vector3(0,0,-1).applyEuler(s.rotation)),this.controllerWrappers[e].position.copy(new three.Vector3(0,0,0).add(k).sub(c));let d=this.modelScene.intersectRaycaster(this.xrControllerRay.right);if(d.length===0){let e=this.works.getResolvedObserver(this.currentPano);d=this.xrControllerRay.right.intersectObject(this.modelScene.boundingMesh,!0).map(t=>{var n;let r=(n=e==null?void 0:e.floorIndex)==null?0:n;return Object.assign({floorIndex:r,floor:r},t)})}if(d.length>=1&&d[0].face)if(o.handedness===`right`){let e=this.xrControllerRay.right.intersectObject(this.xrCustomObjectsScene,!0),t=d[0].face.normal,n=t.clone(),r=d[0].point.clone();this.intersectMesh.position.copy(r);let o=r.clone().add(n);if(this.intersectMesh.lookAt(o),Math.abs(t.y)>.99){let e=this.camera.position.clone().sub(r);this.intersectMesh.rotation.z=-Math.atan2(e.z,e.x)}this.intersectMesh.visible=!0,this.needsRender=!0,e.length>0?(this.pointerLines.right.setPoints(u,e[0].point),this.pointerLines.right.points.visible=!0,this.intersectMesh.visible=!1):(this.pointerLines.right.points.visible=!1,this.pointerLines.right.setPoints(u,d[0].point));let s=d[0],c=createEvent(`intersect.update`,{raycaster:(l=this.xrControllerRay.right)==null?null:l,intersection:s==null?null:s,object:this.intersectMesh});if(this.emit(`intersect.update`,c),c.defaultPrevented){this.hideIntersectMesh();return}}else this.pointerLines.left.setPoints(u,d[0].point)}this.updateControllerHelper(n,e,t)}}else O||console.error(`xrFrame丢失,请重试`),this.xrManager.session||console.error(`session丢失,请重试`),this.xrManager.session&&!this.xrManager.session.renderState.baseLayer&&console.error(`no layer found`);isEmptyObject(m)===!1&&this.modelScene.parameter.set(m),this.emit(`camera.update`,createEvent(`camera.update`,{userAction:this.userAction,state:Object.assign(Object.assign(Object.assign({},this.currentPano),{mode:this.mode}),clonePose(this.camera.pose))}));let j=this.works.getResolvedObserver(this.currentPano),M=this.locationMotion.ended?this.getForwardObserverOrNot(this.xrManager.cameraVR):null,N=this.works.getObserver(S.panoId),P=this.works.getObserver(C.panoId);if(this.adjustPanoCircleMeshPositionBasedOnModel&&this.helper.visible&&j){let e=[],t=j.work.observers;for(let n of j.accessibleNodes){let r=t[n];r&&e.push(r)}let n=new Map;if(e.sort((e,t)=>{let r=n.get(e);r===void 0&&(r=e.standingPosition.distanceTo(j.standingPosition),n.set(e,r));let o=n.get(e);return o===void 0&&(o=t.standingPosition.distanceTo(j.standingPosition),n.set(t,o)),r-o}),e.length){this.accessibleObserverFloorCheckCount%=e.length;let t=e[this.accessibleObserverFloorCheckCount],n=this.modelScene.models.find(e=>e.work===(t==null?void 0:t.work));if(t&&n&&n.visible){let e=.3,r=.05,o=.005,s=t.standingPosition.clone().applyMatrix4(t.work.transform),c=panoStringify({panoIndex:t.panoIndex,workCode:t.work.workCode}),l=adjustPanoCircleMeshVectors.map(t=>{scratchRaycaster.ray.origin.copy(s),scratchRaycaster.ray.origin.add(scratchVector3.copy(t).setY(e)),scratchRaycaster.ray.direction.set(0,-1,0),scratchRaycaster.firstHitOnly=!0,scratchRaycaster.floorIndex=-1;let[r]=n.intersectRaycaster(scratchRaycaster);return r&&r.distance-o<=e?new three.Vector3().copy(s).setY(r.point.y+o):s});l.sort((e,t)=>t.y-e.y);let u=l[Math.floor(l.length/2)],[d]=l.filter(e=>e.distanceTo(u)<=.05);if(d){let e=new three.Vector4(s.x,s.y,s.z,d.y-s.y),t=this.adjustPanoCircleMeshPositionFix.get(c);t&&!e.equals(t)&&(this.needsRender=!0),this.adjustPanoCircleMeshPositionFix.set(c,e)}}this.accessibleObserverFloorCheckCount++}}let F=new Map;if(N)for(let e of N.accessibleNodes){let t=N.work.observers[e];if(t){let e=panoStringify({panoIndex:t.panoIndex,workCode:t.work.workCode});F.set(e,t)}}if(P)for(let e of P.accessibleNodes){let t=P.work.observers[e];if(t){let e=panoStringify({panoIndex:t.panoIndex,workCode:t.work.workCode});F.set(e,t)}}if(this.panoMeshes.forEach((e,t)=>{F.get(t)?F.delete(t):(this.helper.remove(e),e.dispose(),this.panoMeshes.delete(t))}),F.forEach((e,t)=>{let n=this.panoCircleMeshCreator(e,{aerialObserverMinHeight:this.aerialObserverMinHeight});this.panoMeshes.set(t,n),this.helper.add(n),F.delete(t)}),this.panoMeshes.forEach((e,t)=>{let n=this.works.getObserver(t);if(n){let r=n.position.distanceTo(n.standingPosition)>this.aerialObserverMinHeight;if(r)e.position.copy(n.position).applyMatrix4(n.work.transform),e.scale.setScalar(18);else{e.position.copy(n.standingPosition).applyMatrix4(n.work.transform);let t=this.adjustPanoCircleMeshPositionFix.get(n.panoId);t&&(scratchVector3.set(t.x,t.y,t.z),scratchVector3.equals(e.position)&&(e.position.y+=t.w)),e.scale.setScalar(1.2)}let o=this.camera.position.clone().setY(e.position.y),s=new three.Vector3().copy(e.position).sub(o).normalize();if(t===panoStringify(this.currentPano)){let t=clamp$1((.5-o.distanceTo(e.position))/.5,0,1);s.multiplyScalar(1-t).add(g.clone().multiplyScalar(t))}if(s.length()>0){let t=r?-Math.PI/2:0,n=Math.atan2(s.x,s.z);e.quaternion.setFromEuler(new three.Euler(t,n,0,`YXZ`))}}else e.visible=!1}),this.camera.pose.distance>.1||E)this.panoMeshes.forEach(n=>{n.setOpacity(0),n.setCurrent(!1),n.updateTime&&n.updateTime(e,t),n.visible=!1});else if(j){let n=j.work.observers,[,r]=arrayMin(j.accessibleNodes,e=>{let t=n[e];return!t||!t.active?1/0:j.standingPosition.distanceTo(t.standingPosition)},!0);r=clamp$1(r,2.5,1/0);let o=j.accessibleNodes.concat(j.panoIndex).map(e=>panoStringify({panoIndex:e,workCode:j.work.workCode}));this.panoMeshes.forEach((n,s)=>{let c=this.works.getObserver(s),l=!1,u=1;if(o.indexOf(s)===-1)l=!1,u=0;else if(!c)l=!1,u=0;else if(!c.loadable&&!c.active)l=!1,u=0;else{let e=n.position.clone().project(this.camera);l=Math.abs(e.x)<1&&Math.abs(e.y)<1&&Math.abs(e.z)<1&&!n.loading&&n.progress===0&&M!==null&&panoStringify({panoIndex:M.panoIndex,workCode:M.work.workCode})===s;let t=n.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);u=t<.01?0:clamp$1(r/t,.1,.85)}c&&c===P&&c.position.distanceTo(c.standingPosition)>this.aerialObserverMinHeight&&n.position.distanceTo(this.camera.position)<35&&(u=0),this.modelScene.parameter.resolveValue(`modelAlpha`)>0&&(u=0),n.setCurrent(l),n.setOpacity(u),n.updateTime&&n.updateTime(e,t)})}{let e=(u=this.modelScene.parameter.progress)==null?1:u,t=Math.round(e),n=this.modelScene.parameter.pano0,r=this.modelScene.parameter.pano1,o=t===0?n:r,s;if(o&&(s=this.works.getObserver(o.panoId),s||(s=this.panoPictureObserverMap.get(o))),this.tiling.appearDuration=this.tileAppearDuration,this.tiling.maxRequest=e<(canUseNativeImageBitmap()?.6:.99)?0:this.tileMaxRequest,this.tiling.imageOptions=this.imageOptions,!s||!o||this.tileLevelForFov===!1||this.camera.perspToOrtho.x>0){this.tiling.setObserver(null);let e={renderer:this.renderer,resolution:A,pixelRatio:1,time:this.camera.time,cameraMatrix:this.xrManager.cameraVR.matrixWorld,cameraProjectionMatrix:this.xrManager.cameraVR.projectionMatrix,panoMap:null,panoMatrix:new three.Matrix4,panoZoom:1,minLevel:0,level:0};this.tiling.update(e),this.modelScene.parameter.set(`refinedScreen`,null)}else{let e=getImageSizeLevel(o.mapSize)+1,c=4;this.tiling.setObserver(s);let l={renderer:this.renderer,resolution:A,pixelRatio:1,time:this.camera.time,cameraMatrix:this.xrManager.cameraVR.matrixWorld,cameraProjectionMatrix:this.xrManager.cameraVR.projectionMatrix,panoMap:o.map,panoMatrix:o.matrix,panoZoom:o.zoom,minLevel:e,level:4},u=this.tiling.update(l),f={map:this.tiling.renderTarget.texture,matrixInverse:this.tiling.camera.matrixWorldInverse,projectionMatrix:this.tiling.camera.projectionMatrix,pano:t,opacity:(n==null?void 0:n.panoId)===(r==null?void 0:r.panoId)?1:easeInQuart(Math.abs(((d=this.modelScene.parameter.progress)==null?0:d)-.5)*2)},p=this.modelScene.parameter.refinedScreen;(u||f.pano!==(p==null?void 0:p.pano)||f.opacity!==(p==null?void 0:p.opacity))&&this.modelScene.parameter.set(`refinedScreen`,f)}}if(this.panoVideo.object.position.copy(this.camera.position),this.panoVideo.updateTime(e),this.intersectMesh&&this.intersectMesh.parent&&j&&j.position.y-j.standingPosition.y>10){let e=clamp$1(this.camera.position.distanceTo(this.intersectMesh.position)*(2*Math.tan(.5*this.camera.fov/180*Math.PI))/5,.5);this.intersectMesh.scale.setScalar(e)}else this.intersectMesh.scale.setScalar(1);{let e=C.effect,{pano0:t,pano1:n}=this.modelScene.parameter;if(t&&n&&t!==n&&(e===`fly`||e===`model`)&&this.flyEffectUseDepthBuffer){if(((f=this.modelScene.parameter.pano0Depth)==null?void 0:f.panoId)!==t.panoId||((p=this.modelScene.parameter.pano1Depth)==null?void 0:p.panoId)!==n.panoId){let e=500,r=512;this.pano0DepthCubeRenderTarget?this.pano0DepthCubeRenderTarget.width!==512&&this.pano0DepthCubeRenderTarget.setSize(512,512):this.pano0DepthCubeRenderTarget=new three.WebGLCubeRenderTarget(512,{minFilter:three.NearestFilter,magFilter:three.NearestFilter,generateMipmaps:!1}),this.pano1DepthCubeRenderTarget?this.pano1DepthCubeRenderTarget.width!==512&&this.pano1DepthCubeRenderTarget.setSize(512,512):this.pano1DepthCubeRenderTarget=new three.WebGLCubeRenderTarget(512,{minFilter:three.NearestFilter,magFilter:three.NearestFilter,generateMipmaps:!1});let o=new three.CubeCamera(this.camera.near,this.camera.far,this.pano0DepthCubeRenderTarget);o.matrix.copy(t.matrix),o.matrixWorld.copy(o.matrix),o.matrixAutoUpdate=!1,renderDepthCube(this.renderer,this.modelScene,o,500);let s=new three.CubeCamera(this.camera.near,this.camera.far,this.pano1DepthCubeRenderTarget);s.matrix.copy(n.matrix),s.matrixWorld.copy(s.matrix),s.matrixAutoUpdate=!1,renderDepthCube(this.renderer,this.modelScene,s,500),this.modelScene.parameter.set({pano0Depth:{panoId:t.panoId,map:this.pano0DepthCubeRenderTarget.texture,mapSize:this.pano0DepthCubeRenderTarget.width,maxDepth:500},pano1Depth:{panoId:n.panoId,map:this.pano1DepthCubeRenderTarget.texture,mapSize:this.pano1DepthCubeRenderTarget.width,maxDepth:500}})}}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))}}render(){if(this.xrManager.session&&this.xrManager.session.renderState.baseLayer){let e=this.xrManager.session.renderState.baseLayer;return this.renderer.setRenderTarget(null),this.renderer.setScissorTest(!1),this.renderer.setFramebuffer(e.framebuffer),this.renderer.render(this.scene,this.xrManager.cameraVR),this.renderer.setFramebuffer(null),!0}return!1}onPanGesture(){}onTapGesture(){}onPinchGesture(){}onMouseMove(){}onMouseOut(){}panoResourceFromLocationMotionKeyframe(e){return this.panoResources[e.key]}updateControllerHelper(e,t,n){let r=this.xrControllerRay.left,o=this.xrControllerRay.right;if(!e||e.length===0)return;let s={buttons:{X:!1,Y:!1,LeftTrigger:!1,LeftPinch:!1,A:!1,B:!1,RightTrigger:!1,RightPinch:!1}};for(let c=0;c<e.length;c++){let l=e[c].handedness,u=e[c].gamepad;switch(l){case`left`:u.axes&&(this.emitHandleEvent(u.axes[2]===-1,`LeftAxesLeft`,t),this.emitHandleEvent(u.axes[2]===1,`LeftAxesRight`,t),this.emitHandleEvent(u.axes[3]===-1,`LeftAxesUp`,t),this.emitHandleEvent(u.axes[3]===1,`LeftAxesDown`,t)),u!=null&&u.buttons&&(u.buttons[4]&&this.emitHandleEvent(u.buttons[4].pressed,`X`,t),u.buttons[5]&&this.emitHandleEvent(u.buttons[5].pressed,`Y`,t),u.buttons[0]&&this.emitHandleEvent(u.buttons[0].pressed,`LeftTrigger`,t),u.buttons[1]&&this.emitHandleEvent(u.buttons[1].pressed,`LeftPinch`,t));let e={raycaster:r,axes:{up:u.axes&&u.axes[3]<0?Math.abs(u.axes[3]):0,down:u.axes&&u.axes[3]<0?0:Math.abs(u.axes[3]),left:u.axes&&u.axes[2]<0?Math.abs(u.axes[2]):0,right:u.axes&&u.axes[2]<0?0:Math.abs(u.axes[2])},deltaTime:n};s.buttons.X=u.buttons&&u.buttons[4]?u.buttons[4].pressed:!1,s.buttons.Y=u.buttons&&u.buttons[5]?u==null?void 0:u.buttons[5].pressed:!1,s.buttons.LeftTrigger=u.buttons&&u.buttons[0]?u==null?void 0:u.buttons[0].pressed:!1,s.buttons.LeftPinch=u.buttons&&u.buttons[1]?u==null?void 0:u.buttons[1].pressed:!1,s.left=e;break;case`right`:u.axes&&(this.emitHandleEvent(u.axes[2]===-1,`RightAxesLeft`,t),this.emitHandleEvent(u.axes[2]===1,`RightAxesRight`,t),this.emitHandleEvent(u.axes[3]===-1,`RightAxesUp`,t),this.emitHandleEvent(u.axes[3]===1,`RightAxesDown`,t)),u.buttons&&(u.buttons[4]&&this.emitHandleEvent(u.buttons[4].pressed,`A`,t),u.buttons[5]&&this.emitHandleEvent(u.buttons[5].pressed,`B`,t),u.buttons[0]&&this.emitHandleEvent(u.buttons[0].pressed,`RightTrigger`,t),u.buttons[1]&&this.emitHandleEvent(u.buttons[1].pressed,`RightPinch`,t)),s.right={raycaster:o,axes:{up:u.axes&&u.axes[3]<0?Math.abs(u.axes[3]):0,down:u.axes&&u.axes[3]<0?0:Math.abs(u.axes[3]),left:u.axes&&u.axes[2]<0?Math.abs(u.axes[2]):0,right:u.axes&&u.axes[2]<0?0:Math.abs(u.axes[2])},deltaTime:n},s.buttons.A=u.buttons&&u.buttons[4]?u==null?void 0:u.buttons[4].pressed:!1,s.buttons.B=u.buttons&&u.buttons[5]?u==null?void 0:u.buttons[5].pressed:!1,s.buttons.RightTrigger=u.buttons&&u.buttons[0]?u==null?void 0:u.buttons[0].pressed:!1,s.buttons.RightPinch=u.buttons&&u.buttons[1]?u==null?void 0:u.buttons[1].pressed:!1;break;default:break}}this.emit(`xr.controller.update`,createEvent(`xr.controller.update`,s))}emitHandleEvent(e,t,n){let r=this.xrControllerRay.left,o=this.xrControllerRay.right;if(e)this.xrHandleState[t].touchStart===!1?(this.xrHandleState[t].touchStartTime=n,this.xrHandleState[t].touchStart=!0,this.emit(`xr.gesture.buttonDown`,createEvent(`xr.gesture.buttonDown`,{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:t,isFinal:!1,isFirst:!0,controllers:{raycaster:{leftRay:r,rightRay:o}}}))):n-this.xrHandleState[t].touchStartTime>CONTROLLER_EVNET_DELTA_TIME&&this.emit(`xr.gesture.press`,createEvent(`xr.gesture.tap`,{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:t,isFinal:!0,isFirst:!0,controllers:{raycaster:{leftRay:r,rightRay:o}}}));else if(this.xrHandleState[t].touchStart===!0){if(this.emit(`xr.gesture.buttonUp`,createEvent(`xr.gesture.buttonUp`,{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:t,isFinal:!0,isFirst:!1,controllers:{raycaster:{leftRay:r,rightRay:o}}})),n-this.xrHandleState[t].touchStartTime<=CONTROLLER_EVNET_DELTA_TIME){let e=createEvent(`xr.gesture.tap`,{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:t,isFinal:!0,isFirst:!1,controllers:{raycaster:{leftRay:r,rightRay:o}}});!this.emit(`xr.gesture.tap`,e)&&!e.defaultPrevented&&t===`RightTrigger`&&this.checkSelectedPano(this.xrControllerRay.right)}this.xrHandleState[t].touchStart=!1,this.xrHandleState[t].touchStartTime=0}}initHandEvent(){if(!this.xrManager.session)throw Error(`初始化失败`);this.xrManager.session.addEventListener(`select`,e=>{this.gazeRay&&this.checkSelectedPano(this.gazeRay)})}},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,gesture.fire,initAnimation.start,initAnimation.end,camera.update,intersect.update,pano.select,pano.moveTo,pano.moving,pano.arrived,pano.cancel,pano.error,pano.prepare,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`.split(`,`);function initLegacyEvent(e){e.on(`initAnimation.start`,t=>{e.emit(`initAnimationWillStart`,t.state.panoIndex,t.state,t.userAction)}),e.on(`initAnimation.end`,t=>{e.emit(`initAnimationEnded`,t.state.panoIndex,t.state,t.userAction)}),e.on(`gesture.pan`,t=>{let n=!1;n=e.emit(`wantsGesture`,`pan`,t.pointers,t.isFinal),n&&t.preventDefault(),n=e.emit(`wantsPanGesture`,t.state,t.isFinal),n&&t.preventDefault(),t.defaultPrevented||(e.emit(`gesture`,`pan`,t.pointers,t.isFinal),e.emit(`panGesture`,t.state,t.isFinal))}),e.on(`gesture.tap`,t=>{let n=!1;n=e.emit(`wantsGesture`,`tap`,t.pointers,t.isFinal),n&&t.preventDefault(),n=e.emit(`wantsTapGesture`,t.center.raycaster,t.center.coords,t.isFinal),n&&t.preventDefault(),t.defaultPrevented||(e.emit(`gesture`,`tap`,t.pointers,t.isFinal),e.emit(`tapGesture`,t.center.raycaster,t.center.coords,t.isFinal))}),e.on(`gesture.dbltap`,t=>{let n=!1;n=e.emit(`wantsGesture`,`dbltap`,t.pointers,t.isFinal),n&&t.preventDefault(),n=e.emit(`wantsDblTapGesture`,t.center.raycaster,t.center.coords,t.isFinal),n&&t.preventDefault(),t.defaultPrevented||(e.emit(`gesture`,`dbltap`,t.pointers,t.isFinal),e.emit(`dblTapGesture`,t.center.raycaster,t.center.coords,t.isFinal))}),e.on(`gesture.press`,t=>{let n=!1;n=e.emit(`wantsGesture`,`press`,t.pointers,t.isFinal),n&&t.preventDefault(),n=e.emit(`wantsPressGesture`,t.center.raycaster,t.center.coords,t.center.delta,t.isFinal),n&&t.preventDefault(),t.defaultPrevented||(e.emit(`gesture`,`press`,t.pointers,t.isFinal),e.emit(`pressGesture`,t.center.raycaster,t.center.coords,t.center.delta,t.isFinal))}),e.on(`gesture.pinch`,t=>{let n=!1;n=e.emit(`wantsGesture`,`pinch`,t.pointers,t.isFinal),n&&t.preventDefault(),n=e.emit(`wantsPinchGesture`,t.scale,t.state.fov,t.isFinal),n&&t.preventDefault(),t.defaultPrevented||(e.emit(`gesture`,`pinch`,t.pointers,t.isFinal),e.emit(`pinchGesture`,t.scale,t.state.fov,t.isFinal))}),e.on(`gesture.mousewheel`,t=>{let n=!1;n=e.emit(`wantsGesture`,`mouseWheel`,t.pointers,t.isFinal),n&&t.preventDefault(),n=e.emit(`wantsMouseWheel`,t.center.delta,t.state.fov,t.isFinal),n&&t.preventDefault(),t.defaultPrevented||(e.emit(`gesture`,`mouseWheel`,t.pointers,t.isFinal),e.emit(`mouseWheel`,t.center.delta,t.state.fov,t.isFinal))}),e.on(`gesture.mousemove`,t=>{let n=!1;n=e.emit(`wantsGesture`,`mouseMove`,t.pointers,t.isFinal),n&&t.preventDefault(),t.defaultPrevented||(e.emit(`gesture`,`mouseMove`,t.pointers,t.isFinal),n=e.emit(`wantsChangeCameraFov`,t.state.fov),n&&t.preventDefault())}),e.on(`gesture.momentum`,t=>{let n=!1;n=e.emit(`wantsInteriaPan`,t.state),n&&t.preventDefault(),t.defaultPrevented||e.emit(`interiaPan`,t.state,t.isFinal)}),e.on(`camera.update`,t=>{e.emit(`cameraFovUpdate`,t.state.fov,t.userAction),e.emit(`cameraDirectionUpdate`,t.state,t.userAction);let n=coordinatesToVector(t.state);n.setLength(t.state.distance);let r=t.state.offset.clone().sub(n);e.emit(`cameraPositionUpdate`,r,t.userAction),e.emit(`cameraUpdate`,t.state,t.userAction)}),e.on(`intersect.update`,t=>{if(t.intersection){let n=!1;n=e.emit(`wantsShowIntersectionOnModel`,t.raycaster),n&&t.preventDefault(),t.defaultPrevented||e.emit(`intersectionOnModelUpdate`,t.intersection,t.object)}else e.emit(`intersectionHidden`)}),e.on(`pano.request`,t=>{let n=e.emit(`wantsMoveToPano`,t.state.panoIndex,t.options,t.userAction);n||(n=e.emit(`wantsToMoveToPano`,t.state.panoIndex,t.options,t.userAction)),n&&t.preventDefault(),t.defaultPrevented||e.emit(`panoWillLoad`,t.state.panoIndex)}),e.on(`pano.select`,t=>{e.emit(`panoSelected`,t.state.panoIndex)}),e.on(`pano.moveTo`,t=>{e.emit(`panoLoaded`,t.state.panoIndex),e.emit(`moveToPano`,t.state.panoIndex,t.userAction),e.emit(`panoWillArrive`,t.state.panoIndex,t.state,t.userAction)}),e.on(`pano.moving`,t=>{e.emit(`movingToPano`,t.state.panoIndex,t.prevPano.panoIndex,t.progress)}),e.on(`pano.arrived`,t=>{e.emit(`panoArrived`,t.state.panoIndex,t.state,t.userAction)}),e.on(`pano.cancel`,t=>{e.emit(`moveToPanoCanceled`,t.state.panoIndex)}),e.on(`pano.error`,t=>{e.emit(`panoLoadError`,t.error,t.state.panoIndex)}),e.on(`pano.texture.load`,t=>{e.emit(`textureStartLoad`,t.pano.panoIndex)}),e.on(`pano.texture.success`,t=>{e.emit(`textureLoaded`,t.pano.panoIndex,t.meta)}),e.on(`pano.texture.error`,t=>{e.emit(`textureError`,t.error,t.pano.panoIndex)}),e.on(`pano.texture.abort`,t=>{e.emit(`textureAbort`,t.pano.panoIndex)}),e.on(`pano.texture.progress`,t=>{e.emit(`textureLoading`,t.progress,t.pano.panoIndex)}),e.on(`xr.session.start`,t=>{e.emit(`webXRSessionStart`)}),e.on(`xr.session.end`,t=>{e.emit(`webXRSessionEnd`)}),e.on(`xr.gesture.tap`,t=>{e.emit(`webXRControllerEvent`,`tap`,t.buttons,{raycaster:t.controllers.raycaster})}),e.on(`xr.gesture.press`,t=>{e.emit(`webXRControllerEvent`,`press`,t.buttons,{raycaster:t.controllers.raycaster})}),e.on(`xr.gesture.buttonUp`,t=>{e.emit(`webXRControllerEvent`,`buttonUp`,t.buttons,{raycaster:t.controllers.raycaster})}),e.on(`xr.gesture.buttonDown`,t=>{e.emit(`webXRControllerEvent`,`buttonDown`,t.buttons,{raycaster:t.controllers.raycaster})}),e.on(`xr.controller.update`,t=>{e.emit(`webXRControllerRayUpdate`,{leftRay:t.left?t.left.raycaster:void 0,rightRay:t.right?t.right.raycaster:void 0}),t.left&&e.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&&e.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})}),e.on(`works.request`,t=>{e.emit(`willLoad`,t.input,t.works[0],e.getCurrentState())}),e.on(`works.load`,t=>{e.emit(`load`,t.input,t.works[0],e.getCurrentState())}),e.on(`works.ready`,t=>{e.emit(`loaded`,t.input,t.works[0])}),e.on(`state.change`,t=>{e.emit(`stateChange`,t.state,t.userAction)}),e.on(`currentState.change`,t=>{e.emit(`currentStateChange`,t.state,t.userAction)}),e.on(`state.set`,t=>{e.emit(`setState`,t.state)}),e.on(`state.synced`,t=>{e.emit(`stateSynced`,t.state)}),e.on(`model.request`,t=>{e.emit(`modelWillLoad`,t.work.model)}),e.on(`model.error`,t=>{e.emit(`modelLoadError`,t.error,t.model)}),e.on(`model.load`,t=>{e.emit(`modelLoaded`,t.model)}),e.on(`model.changeShownFloor`,t=>{e.emit(`modelShownFloorChange`,t.model.shownFloor,t.model.floorLength)}),e.on(`render`,t=>{e.emit(`renderFrame`,t.needsRender)}),e.on(`mode.change.request`,t=>{e.emit(`wantsChangeMode`,t.mode,t.prevMode)}),e.on(`mode.change`,t=>{e.emit(`modeChange`,t.mode,t.prevMode,t.state.panoIndex,t.state,t.userAction)}),e.on(`helpers.visible`,t=>{e.emit(`helpersVisibleChange`,t.object.visible)}),e.on(`network.resource`,t=>{e.emit(`network`,t.source,t.requestType,t.requestState,t.detail)})}function generateDefaultVideoElement(){if(typeof window<`u`){let e=document.createElement(`video`);e.loop=!0,e.autoplay=!0,e.playsInline=!0,e.muted=!0,e.crossOrigin=``;let t=()=>{document.removeEventListener(`touchstart`,t,!1),document.removeEventListener(`mousedown`,t,!1),e.muted=!1};return document.addEventListener(`touchstart`,t,!1),document.addEventListener(`mousedown`,t,!1),e}else return{}}function initLights(){let e=new three.Group;e.name=`internalLights`;{let t=new three.DirectionalLight(16777215,.1);t.name=`direction0`,t.position.copy(new three.Vector3(0,1,0)),e.add(t)}{let t=new three.DirectionalLight(16777215,.1);t.name=`direction1`,t.position.copy(new three.Vector3(-1,-1,-1)),e.add(t)}{let t=new three.DirectionalLight(16777215,.3);t.name=`direction2`,t.position.copy(new three.Vector3(1,1,1)),e.add(t)}{let t=new three.AmbientLight(16777215,.6);t.name=`ambient0`,e.add(t)}return e}function parseKeyValue(e){var t,n;let r={},o=e.split(/(\;|\,)/);for(let e of o){let o=e.split(`=`),s=(t=o[0])==null?void 0:t.trim(),c=(n=o[1])==null?void 0:n.trim();s&&c&&(r[s]=c)}return r}function getViewportScale(){var e;if(typeof document<`u`){let t=document.getElementsByTagName(`meta`);for(let n=0;n<t.length;n++){let r=t[n];if(r.getAttribute(`name`)===`viewport`){let t=parseKeyValue((e=r.getAttribute(`content`))==null?``:e),n=Number(t[`initial-scale`]);if(!isNaN(n))return n}}}return 1}var realsee_png_data_url_default=`data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAV8AAAA/CAQAAADtPwPkAAAR+0lEQVR4AezYg3LEQACH8d1cbdu23Q5qG9G47z/TN/h6tn2b/H+TUTLc7yjcOXV46OUAnUs6EbUp022ZBXc1NhoZYYd7fjDRvdcHAwrlK2QBVJ4sgoqONmY45RUT23sZ6H42F2hK5CtkMbjhZlDmUUcvq1zyieUVyjbE4I1GBfItwxG56YaUZTQwyh4P6NgJ4YYYvCuQb5kOyI03pORjiqe4Lwpq5pt1vJqfUwKWJVbSMYfppYconG+maNNQOWBZuwHTzicGel75NtFOkxr5apmV8cikcko0DrDQs863AeGl0cE0+1xy573m0/wf0cEKW6H7BWtggiMG8sy3oHRDpJMw4NWb6am/bv9znkqEzjd61t5oo5clTrjhwevO75EJRBKSRt745Z16ZEjcM73sccZplBPm8PyTcxZAkSRdHm/acJ0Z3JZhHB0BxqDHgWFZFmm0ZbCw87twI/zc3e/Cz93vPneXtU/WdQS3oTviXdY/q5PsJKfoGuQjZuO/0in1qsj85cuXrxqeAOJpGqdJOqrUutgVl2Qb0BWqp/RE8AWWVB7t2KrIzY2Wx2fWKl7yfswgxqj8lYummYa3hfwF9MuQRmbfQE4ocPDjtUWQ6Tq1M2w7gC2EcrMGtWS6xlpGKEDDcb1vUQ25zT4lrC2s0dU4gFPppKkbeIYr7NMpqjStuFg5rNU9epGyt8PXyfX4DE1bKLhR/1XPxwJhp5DAV67T9ZPwFdovhBMIGUYoRBN4wim6S3eoXVEHXdLgmwY0x6BQnO4xPJ0Ar5OVxhQF0L9UslRM4yaQQfQImnBegi8vhY2A1k6YLlrj61TwDdNQnIISwiPvpD7TwYQTssZXK47vg8y9Gp2nxRcATk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2DIs628e669ubdsR4VXC7C9u79eIVJtOwgdgO/dOICHGK6jQHaIwdXN4Lwt0LWHr4d6kX8tV+ozqAs+uYCSmO2w+jd4zGNeUYL4nqZxeN5WKVgooSAClmEaYhqhdit89QC7niSbCEM2sdkBuHYxQg9ri5ZjkuhI6DMP+J7cTvEtokEx0aPscyddoFJKpSZqV7G1GTxcpmEthpnw5058c6GfwqpwzGOtGjXSJI3FLYhc+O+jSr9aGhPWQlRshS8AticLX7wnsgbXxt6gsWCpRBa0vRGQM8oB9dhmP3QAwFX4c079dJNq6Qi5xbuyTmpPSJ1Ur4UtF7GoTtmUL3zxaWqMU8P/k3cXSQ1EQRjHGdzdHTa4u7tzBs7CedhykNwF2/5jq56iU11db6Lv2yTj8hs3JoiU9sZZp5/62J5v1z9NjrDHaSbnbFMf52sHrDUVaidDxNG0o9+uLjfosfdb3jT5d5j757riJgst9NIZQ2Pn+ySZll80vjI6Wz/hQJG4vPG0L/H6poQch/dW3vL3B0u8jl0HvVj5PvHCElEF8DUAFikVYTcvmfBdDzQlvvMXSV5lP5zrXj/fJ54zuWaeeuoqkW8AwCIaqeTZKkmYrpPwR2eqN9X72W7EG57vU67OBeuMV8KXLUzv93UTTj42tvaFS++GVsc5JRyLSLJ8nzO555hFBmiSRCqMr4GwrcmGkib5xSvcwmzFK6e8s7DMa2xH4YZdZumSOwsVzFeBWdr37tpIhOpSwXqONNgZq/2KgvBt54znHN1HzlljTO4oVD5fb+prNIJXQNL1ofDKQisbPLJDv3jNSLq9OkYBEIihKIj3v7S1TRQCX5Kdl1ZQlol7LF+E++fwirfiq2sf4cTXxc6hzxffPuLEeqSWrPGWMF58TWr5viyJAP5/4EV4KePiaSE8eNRgjDy8/tyRW+FZjhS+2tlovNJovtJovNJ0uhK6Wo64SDdxEbM//KesjwAAAABJRU5ErkJggg==`,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=new three.BufferGeometry;geometry.setAttribute(`position`,new three.BufferAttribute(vertices,3)),geometry.setAttribute(`uv`,new three.BufferAttribute(uvs,2)),geometry.setIndex(new three.BufferAttribute(index,1));var material=new three.MeshBasicMaterial({transparent:!0,depthTest:!1,depthWrite:!1,stencilWrite:!1,fog:!1}),mesh=new three.Mesh(geometry,material);mesh.matrixAutoUpdate=!1;var scene=new three.Scene;scene.add(mesh),scene.matrixAutoUpdate=!1;var camera=new three.OrthographicCamera(-.5,.5,.5,-.5,.1,1);camera.position.set(0,0,.5),camera.lookAt(0,0,0),camera.updateMatrixWorld(!0),camera.matrixAutoUpdate=!1;var prevViewport=new three.Vector4,prevScissor=new three.Vector4;function renderPoweredByRealsee(e){if(material.map){let t=e.getViewport(prevViewport),n=e.getScissor(prevScissor),r=e.getScissorTest(),o=e.autoClear,s=n.x+imageOffset[0]/3,c=n.y+imageOffset[1]/3,l=imageSize[0]/3,u=imageSize[1]/3;e.setViewport(s,c,l,u),e.setScissor(s,c,l,u),e.setScissorTest(!0),e.autoClear=!1,e.render(scene,camera),e.setViewport(t),e.setScissor(n),e.setScissorTest(r),e.autoClear=o}else{let e=new three.Texture,t=new Image;t.onload=()=>{e.image=t,e.wrapS=three.ClampToEdgeWrapping,e.wrapT=three.ClampToEdgeWrapping,e.minFilter=three.LinearFilter,e.needsUpdate=!0,e.generateMipmaps=!1,material.needsUpdate=!0,t.onload=noop},t.src=realsee_png_data_url_default,material.map=e}}var jsContent$1='(function(){function e(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||(n=Promise))(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})}function t(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function n(e){return function(){var n=this,r=arguments;return new Promise(function(i,a){var o=e.apply(n,r);function s(e){t(o,i,a,s,c,`next`,e)}function c(e){t(o,i,a,s,c,`throw`,e)}s(void 0)})}}function r(){return i.apply(this,arguments)}function i(){return i=n(function*(e={}){var t,r=e,i=!1,a=!0,o=self.location.href;if(i||a){try{new URL(`.`,o).href}catch(e){}(function(){var e=n(function*(e){var t=yield fetch(e,{credentials:`same-origin`});if(t.ok)return t.arrayBuffer();throw Error(t.status+` : `+t.url)});return function(t){return e.apply(this,arguments)}})()}console.log.bind(console),console.error.bind(console);var s=!1;function c(e){for(var t=0,n=e.length,r=new Uint8Array(n),i;t<n;++t)i=e.charCodeAt(t),r[t]=~i>>8&i;return r}var l,u,d=!1;function f(){var e=N.buffer;new Int8Array(e),new Int16Array(e),r.HEAPU8=u=new Uint8Array(e),new Uint16Array(e),new Int32Array(e),r.HEAPU32=new Uint32Array(e),r.HEAPF32=new Float32Array(e),new Float64Array(e),new BigInt64Array(e),new BigUint64Array(e)}function p(){if(r.preRun)for(typeof r.preRun==`function`&&(r.preRun=[r.preRun]);r.preRun.length;)E(r.preRun.shift());S(T)}function m(){d=!0,L.c()}function h(){if(r.postRun)for(typeof r.postRun==`function`&&(r.postRun=[r.postRun]);r.postRun.length;)w(r.postRun.shift());S(C)}var g;function _(){return c(`\\0asm\\0\\0\\00\\b\\`\\`}}\\`|}\\`}\\`||\\`\\v\\0\\`\\0\\`\\0\\0\\x07aa\\0\\0\\r\\0\\0\\x07\\x07\\bAÀ¤\\v\\x07b\\0c\\0\\rd\\0\ne\\0\\ff\\0\\v\\f\núT\\rO| \\0 \\0¢"\\0 \\0 \\0¢"¢ \\0DiPîàBù>¢D\'èÀV¿\\xA0¢ DB:áSU¥?¢ \\0D^\\fýÿÿß¿¢D\\0\\0\\0\\0\\0\\0ð?\\xA0\\xA0\\xA0¶\\vT~@AÀ (\\0" \\0B\\x07|Bøÿÿÿ|"BÿÿÿÿX@ §"\\0?\\0A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+#\\0AºU\\0Yn\\b\\0!*\\x009G\\0ãæ\\0åÔ\\0Iû@\\0ÿVé\\0Ê\\0ÅY\\0ú+\\0ÓÁÅ\\0ÅÏ\\0ÛZ®\\0GÅ\\0
Cb\\0!;\\0,y\\0a\\0*L{\\0,\\0C¿\\0&\\0x<\\0¨Ää\\0åÛ{\\0Ä:Â\\0&ôê\\0÷g\\0\\r¿\\0e£+\\0=±\\0½|\\v\\0¤QÜ\\0\'Ýc\\0iáÝ\\0\\0¨)\\0hÎ(\\0 í´\\0D \\0NÊ\\0pc\\0~|#\\0¹2\\0§õ\\0Vç\\0!ñ\\b\\0µ*\\0o~M\\0¥Q\\0µù«\\0ßÖ\\0Ýa\\06\\0Ä:\\0¢¡\\0rím\\x009z\\0¸©\\0k2\\\\\\0F\'[\\0\\x004í\\0Ò\\0w\\0üôU\\0YM\\0àq\\0A \\v=@û!ù?\\0\\0\\0\\0-Dt>\\0\\0\\0Fø<\\0\\0\\0\\`QÌx;\\0\\0\\0\\x1Bð9\\0\\0\\0@ %z8\\0\\0\\0"ã6\\0\\0\\0\\0ói5\\0AÀ \\v@`)}function v(e){return e}function y(e,t){var n,r=v(e);return n=new WebAssembly.Module(r),[new WebAssembly.Instance(n,t),n]}function b(){return{a:F}}function x(){function e(e,t){return L=e.exports,P(L),f(),L}var t=b();return r.instantiateWasm?new Promise((n,i)=>{r.instantiateWasm(t,(t,r)=>{n(e(t,r))})}):(g!=null||(g=_()),e(y(g,t)[0]))}for(var S=e=>{for(;e.length>0;)e.shift()(r)},C=[],w=e=>C.push(e),T=[],E=e=>T.push(e),D=()=>2147483648,O=(e,t)=>Math.ceil(e/t)*t,k=e=>{var t=(e-N.buffer.byteLength+65535)/65536|0;try{return N.grow(t),f(),1}catch(e){}},A=e=>{var t=u.length;e>>>=0;var n=D();if(e>n)return!1;for(var r=1;r<=4;r*=2){var i=t*(1+.2/r);if(i=Math.min(i,e+100663296),k(Math.min(n,O(Math.max(e,i),65536))))return!0}return!1},j=new Uint8Array(123),M=25;M>=0;--M)j[48+M]=52+M,j[65+M]=M,j[97+M]=26+M;if(j[43]=62,j[47]=63,r.noExitRuntime&&r.noExitRuntime,r.print&&r.print,r.printErr&&r.printErr,r.wasmBinary&&r.wasmBinary,r.arguments&&r.arguments,r.thisProgram&&r.thisProgram,r.preInit)for(typeof r.preInit==`function`&&(r.preInit=[r.preInit]);r.preInit.length>0;)r.preInit.shift()();var N;function P(e){r._pack=e.d,r._malloc=e.e,r._free=e.f,N=e.b,e.__indirect_function_table}var F={a:A};function I(){p();function e(){var e;r.calledRun=!0,!s&&(m(),l==null||l(r),(e=r.onRuntimeInitialized)==null||e.call(r),h())}r.setStatus?(r.setStatus(`Running...`),setTimeout(()=>{setTimeout(()=>r.setStatus(``),1),e()},1)):e()}var L=x();return I(),t=d?r:new Promise((e,t)=>{l=e}),t}),i.apply(this,arguments)}let a;function o(){return e(this,void 0,void 0,function*(){a=yield r()})}let s=0,c=[],l=!1,u=!1,d,f,p,m,h,g,_,v,y,b=t=>e(void 0,void 0,void 0,function*(){for(;u;)yield new Promise(e=>setTimeout(e,0));a||(u=!0,yield o(),u=!1);let e=Math.pow(2,Math.ceil(Math.log2(t.vertexCount)));e>s&&(s>0&&(a._free(d),a._free(f),a._free(p),a._free(m),a._free(h),a._free(g),a._free(_),a._free(v),a._free(y)),s=e,d=a._malloc(3*s*4),f=a._malloc(4*s*4),p=a._malloc(3*s*4),m=a._malloc(4*s),h=a._malloc(s),g=a._malloc(8*s*4),_=a._malloc(3*s*4),v=a._malloc(4*s*4),y=a._malloc(3*s*4)),a.HEAPF32.set(t.positions,d/4),a.HEAPF32.set(t.rotations,f/4),a.HEAPF32.set(t.scales,p/4),a.HEAPU8.set(t.colors,m),a.HEAPU8.set(t.selection,h),a._pack(t.selected,t.vertexCount,d,f,p,m,h,g,_,v,y);let n=new Uint32Array(a.HEAPU32.buffer,g,t.vertexCount*8),r=new Uint32Array(n.slice().buffer),i=new Float32Array(a.HEAPF32.buffer,_,t.vertexCount*3),c=new Float32Array(i.slice().buffer),b=new Float32Array(a.HEAPF32.buffer,v,t.vertexCount*4),x=new Float32Array(b.slice().buffer),S=new Float32Array(a.HEAPF32.buffer,y,t.vertexCount*3),C={data:r,worldPositions:c,worldRotations:x,worldScales:new Float32Array(S.slice().buffer),offset:t.offset,vertexCount:t.vertexCount,positions:t.positions.buffer,rotations:t.rotations.buffer,scales:t.scales.buffer,colors:t.colors.buffer,selection:t.selection.buffer};self.postMessage({response:C},[C.data.buffer,C.worldPositions.buffer,C.worldRotations.buffer,C.worldScales.buffer,C.positions,C.rotations,C.scales,C.colors,C.selection]),l=!1}),x=()=>{c.length!==0&&(l||(l=!0,b(c.shift()),setTimeout(()=>{l=!1,x()},0)))};self.onmessage=e=>new Promise((t,n)=>{if(e.data.splat){let n=e.data.splat;for(let e=0;e<c.length;e++)if(c[e].offset===n.offset){c[e]=n,t(!0);return}c.push(n),x(),t(!0)}})})();',blob$1=typeof self<`u`&&self.Blob&&new Blob([`(self.URL || self.webkitURL).revokeObjectURL(self.location.href);`,jsContent$1],{type:`text/javascript;charset=utf-8`});function WorkerWrapper$1(e){let t;try{if(t=blob$1&&(self.URL||self.webkitURL).createObjectURL(blob$1),!t)throw``;let n=new Worker(t,{name:e==null?void 0:e.name});return n.addEventListener(`error`,()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),n}catch(t){return new Worker(`data:text/javascript;charset=utf-8,`+encodeURIComponent(jsContent$1),{name:e==null?void 0:e.name})}}function asyncGeneratorStep(e,t,n,r,o,s,c){try{var l=e[s](c),u=l.value}catch(e){n(e);return}l.done?t(u):Promise.resolve(u).then(r,o)}function _asyncToGenerator(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var s=e.apply(t,n);function c(e){asyncGeneratorStep(s,r,o,c,l,`next`,e)}function l(e){asyncGeneratorStep(s,r,o,c,l,`throw`,e)}c(void 0)})}}function createDataModule(){return _createDataModule.apply(this,arguments)}function _createDataModule(){return _createDataModule=_asyncToGenerator(function*(e={}){var t,n=e,r=!1,o=!0,s=`/five.js`;if(r||o){try{new URL(`.`,s).href}catch(e){}(function(){var e=_asyncToGenerator(function*(e){var t=yield fetch(e,{credentials:`same-origin`});if(t.ok)return t.arrayBuffer();throw Error(t.status+` : `+t.url)});return function(t){return e.apply(this,arguments)}})()}console.log.bind(console),console.error.bind(console);var c=!1;function l(e){for(var t=0,n=e.length,r=new Uint8Array(n),o;t<n;++t)o=e.charCodeAt(t),r[t]=~o>>8&o;return r}var u,d,f=!1;function p(){var e=F.buffer;new Int8Array(e),new Int16Array(e),n.HEAPU8=d=new Uint8Array(e),new Uint16Array(e),new Int32Array(e),n.HEAPU32=new Uint32Array(e),n.HEAPF32=new Float32Array(e),new Float64Array(e),new BigInt64Array(e),new BigUint64Array(e)}function m(){if(n.preRun)for(typeof n.preRun==`function`&&(n.preRun=[n.preRun]);n.preRun.length;)O(n.preRun.shift());w(D)}function h(){f=!0,z.c()}function g(){if(n.postRun)for(typeof n.postRun==`function`&&(n.postRun=[n.postRun]);n.postRun.length;)E(n.postRun.shift());w(T)}var _;function v(){return l(`\0asm\0\0\00\b\`\`}}\`|}\`}\`||\`\v\0\`\0\`\0\0\x07aa\0\0\r\0\0\x07\x07\bAÀ¤\v\x07b\0c\0\rd\0
|
|
2721
2721
|
e\0\ff\0\v\f
|
|
2722
2722
|
úT\rO| \0 \0¢"\0 \0 \0¢"¢ \0DiPîàBù>¢D'èÀV¿\xA0¢ DB:áSU¥?¢ \0D^\fýÿÿß¿¢D\0\0\0\0\0\0ð?\xA0\xA0\xA0¶\vT~@AÀ (\0" \0B\x07|Bøÿÿÿ|"BÿÿÿÿX@ §"\0?\0AtM\r \0\0\r\vAÄ A06\0A\vAÀ \x006\0 \vK| \0 \0 \0¢"¢" ¢¢ D§F;ÍÆ>¢DtçÊâù\0*¿\xA0¢ D²ûn?¢Dw¬ËTUUÅ¿\xA0¢ \0\xA0\xA0¶\v¨\0@ A\bN@ \0D\0\0\0\0\0\0à¢!\0 AÿI@ Aÿ\x07k!\f\v \0D\0\0\0\0\0\0à¢!\0Aý AýO\x1BAþk!\f\v AxJ\r\0 \0D\0\0\0\0\0\0\`¢!\0 A¸pK@ AÉ\x07j!\f\v \0D\0\0\0\0\0\0\`¢!\0Aðh AðhM\x1BAj!\v \0 Aÿ\x07jB4¿¢\v
} \0¼"AvAÿq"AM} Aý\0M@ \0C\0\0\0\0\v} \0"\0C\0\0\0KC\0\0\0Ë \0"C\0\0\0?^@ \0 C\0\0¿\f\v \0 "\0 C\0\0\0¿_E\r\0 \0C\0\0?\v"\0 \0 A\0H\x1B \0\v\v!\0 \0C\0\0\0\0C\0\0\0\0 \0¼Aÿÿÿÿ\x07qAü\x07M\x1B\v+\0 \0 \0 \0CkÓ\r¼Cº/½Cuª*> \0C®å4¿C\0\0?\vÈ| \0C\`B¢\r]A\0AÿA}C\0\0\0\0 \0¼"AüF\r\0@ Aü\x07kAÿÿÿxM@ At"E@#\0Ak"C\0\0¿8\f *\fC\0\0\0\0\f\v Aü\x07F\r AxI A\0NqE@ \0 \0"\0 \0\f\v \0C\0\0\0K¼AÜ\0k!\vA
|
|
2723
2723
|
+\0 AÌùk"A|qk¾» AvAðq"+\b¢D\0\0\0\0\0\0ð¿\xA0" ¢"¢A
|
|
@@ -2804,4 +2804,4 @@ AÐ\\0lj"\\v*< \\0*8" \\v*8 \\0*(" \\v*0 \\0*\\b" \\0*" \\v*4
|
|
|
2804
2804
|
\\rj "C\\0\\0\\\\ ¼"
|
|
2805
2805
|
AAx
|
|
2806
2806
|
A\\0H\\x1BsAü\\x07\\v6\\0 \\fAj!\\f\\f\\v\\0\\v\\0\\v \\f\\v\\0\\v\\v \\0A\\b\\v\`)}function v(e){return e}function y(e,t){var n,r=v(e);return n=new WebAssembly.Module(r),[new WebAssembly.Instance(n,t),n]}function b(){return{a:F}}function x(){function e(e,t){return L=e.exports,P(L),f(),L}var t=b();return r.instantiateWasm?new Promise((n,i)=>{r.instantiateWasm(t,(t,r)=>{n(e(t,r))})}):(g!=null||(g=_()),e(y(g,t)[0]))}for(var S=e=>{for(;e.length>0;)e.shift()(r)},C=[],w=e=>C.push(e),T=[],E=e=>T.push(e),D=()=>2147483648,O=(e,t)=>Math.ceil(e/t)*t,k=e=>{var t=(e-N.buffer.byteLength+65535)/65536|0;try{return N.grow(t),f(),1}catch(e){}},A=e=>{var t=u.length;e>>>=0;var n=D();if(e>n)return!1;for(var r=1;r<=4;r*=2){var i=t*(1+.2/r);if(i=Math.min(i,e+100663296),k(Math.min(n,O(Math.max(e,i),65536))))return!0}return!1},j=new Uint8Array(123),M=25;M>=0;--M)j[48+M]=52+M,j[65+M]=M,j[97+M]=26+M;if(j[43]=62,j[47]=63,r.noExitRuntime&&r.noExitRuntime,r.print&&r.print,r.printErr&&r.printErr,r.wasmBinary&&r.wasmBinary,r.arguments&&r.arguments,r.thisProgram&&r.thisProgram,r.preInit)for(typeof r.preInit==\`function\`&&(r.preInit=[r.preInit]);r.preInit.length>0;)r.preInit.shift()();var N;function P(e){r._sort=e.d,r._malloc=e.e,r._free=e.f,N=e.b,e.__indirect_function_table}var F={a:A};function I(){p();function e(){var e;r.calledRun=!0,!s&&(m(),l==null||l(r),(e=r.onRuntimeInitialized)==null||e.call(r),h())}r.setStatus?(r.setStatus(\`Running...\`),setTimeout(()=>{setTimeout(()=>r.setStatus(\`\`),1),e()},1)):e()}var L=x();return I(),t=d?r:new Promise((e,t)=>{l=e}),t}),i.apply(this,arguments)}let a;function o(){return e(this,void 0,void 0,function*(){a=yield r()})}let s,c,l,u,d,f,p,m,h,g,_=0,v=0,y=!1,b=[],x=!0,S=!0,C=!1,w=!1,T=!1,E=[],D=65536,O=()=>e(void 0,void 0,void 0,function*(){if(C){w=!0;return}C=!0,w=!1,a||(yield o());let e=Math.pow(2,Math.ceil(Math.log2(s.vertexCount)));_<e&&(_>0&&(a._free(c),a._free(u),a._free(d),a._free(f),a._free(p),a._free(g)),_=e,c=a._malloc(64),u=a._malloc(_*4),d=a._malloc(3*_*4),f=a._malloc(_*4),p=a._malloc(_*4),g=a._malloc(_*4)),y||(m=a._malloc(D*4),h=a._malloc(D*4),y=!0),v<s.transforms.length&&(v>0&&a._free(l),v=s.transforms.length,l=a._malloc(v*4)),C=!1,w&&(w=!1,yield O())}),k=()=>{if(C||w||!a)return;C=!0,S&&(a.HEAPF32.set(s.positions,d/4),a.HEAPF32.set(s.transforms,l/4),a.HEAPU32.set(s.transformIndices,u/4),S=!1),a.HEAPF32.set(new Float32Array(b),c/4);let e=a._sort(c,l,u,s.vertexCount,d,f,p,m,h,g),t=Math.min(e,s.vertexCount),n=new Uint32Array(a.HEAPU32.buffer,p,t),r=s.vertexCount*4,i=E.pop();(!i||i.byteLength<r)&&(i=new ArrayBuffer(r));let o=new Uint32Array(i,0,t);o.set(n),self.postMessage({depthIndex:o,generation:s.generation},[i]),C=!1,x=!1},A=()=>{T||(T=!0,x&&k(),setTimeout(()=>{T=!1,A()}))};self.onmessage=e=>new Promise(t=>{var n;if(e.data.warmup){o().finally(()=>t(!0));return}if(e.data.returnBuffer){E.length<3&&E.push(e.data.returnBuffer),t(!0);return}e.data.sortData&&(s={positions:e.data.sortData.positions,transforms:e.data.sortData.transforms,transformIndices:e.data.sortData.transformIndices,vertexCount:e.data.sortData.vertexCount,generation:(n=e.data.sortData.generation)==null?0:n},x=!0,S=!0,O()),e.data.viewProj?(e.data.viewProj.every(e=>b.includes(e))===!1&&(b=e.data.viewProj,x=!0),A(),t(!0)):t(!0)})})();`,blob=typeof self<`u`&&self.Blob&&new Blob([`(self.URL || self.webkitURL).revokeObjectURL(self.location.href);`,jsContent],{type:`text/javascript;charset=utf-8`});function WorkerWrapper(e){let t;try{if(t=blob&&(self.URL||self.webkitURL).createObjectURL(blob),!t)throw``;let n=new Worker(t,{name:e==null?void 0:e.name});return n.addEventListener(`error`,()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),n}catch(t){return new Worker(`data:text/javascript;charset=utf-8,`+encodeURIComponent(jsContent),{name:e==null?void 0:e.name})}}var vertex_default=function(...e){let t=113,n=126,r=0,o=``;return e[0].split(``).map(e=>e.charCodeAt(0)>126?e:String.fromCharCode((e.charCodeAt(0)+113)%126)).join(``)}("}rpvv|{-uvtu}-sy|nH}rpvv|{-uvtu}-v{Hnvor-sy|n-}ynV{qr\x07H{vs|z-uvtu}-nz}yr?Q-lr\x07rH0vsqrs-b`RlS@?l]\\`VaV\\[{vs|z-uvtu}-nz}yr?Q-l}|vv|{ar\x07rH0r{qvs{vs|z-uvtu}-nz}yr?Q-ln{s|zH{vs|z-uvtu}-nz}yr?Q-ln{s|zV{qvprH{vs|z-uvtu}-nz}yr?Q-lyn\brV{qvprH{vs|z-uvtu}-nz}yr?Q-luar\x07rH{vs|z-rp?-luar\x07r`v rH{vs|z-v{-lzn\x07`uQrtrrH0vs-[bZlT`lPYV]]R_`-K-=----{vs|z-rp?-lyn\brPyv}}r_n{trh[bZlT`lYNfR_`jH----{vs|z-znA-lpyv}}rZnvprV{rrh[bZlT`lPYV]]R_`jH0r{qvs{vs|z-rp?-r|yv|{H0vs-R[NOYRlT`lV[ValN[VZNaV\\[{vs|z-sy|n-lnttrtnv|{]|trH{vs|z-sy|n-lnttrtnv|{]|v{Qnv|{H{vs|z-rp@-lnttrtnv|{O|{qZv{H{vs|z-rp@-lnttrtnv|{O|{qZn\x07H0r{qvsn\bv{t-rpA-P|y|Hn\bv{t-rp?-]|vv|{Hn\bv{t-rp?-bHp|{-sy|n-\0E-J-\05E;=6Hp|{-sy|n-xr{ry?Q`v r-J-=;@Hp|{-sy|n-zn\x07`prr{`}npr`}yn`v r-J-?=AE;=Hp|{-sy|n-]V-J-@;>A>BF?CBHp|{-sy|n-Y[l`PNYRlZV[-J-:>?;=Hp|{-sy|n-Y[l`PNYRlZNe-J-F;=Hp|{-sy|n-`UlP>-J-=;AEEC=?B>>F=?F>FFHp|{-sy|n-`UlP?l=-J->;=F?BAEAHp|{-sy|n-`UlP?l>-J-:>;=F?BAEAHp|{-sy|n-`UlP?l?-J-=;@>B@F>CHp|{-sy|n-`UlP?l@-J-:>;=F?BAEAHp|{-sy|n-`UlP?lA-J-=;BAC?DA?Hsy|n-qrp|qrY|t`pnyr5v{-r{p|qrq6-\n----vs-5r{p|qrq-JJ-=6-r{-=;=H-<<-?QT`-znxr----sy|n-{|znyv rq-J-5sy|n5r{p|qrq6-:->;=6-<-?BA;=H----r{-r\x07}5{|znyv rq-7-5Y[l`PNYRlZNe-:-Y[l`PNYRlZV[6-8-Y[l`PNYRlZV[6H\frpA-qrp|qr^n\\pnurqny5v{-r{pe9-v{-r{pf9-v{-r{pg6-\n----sy|n-|\x07-J-sy|n5r{pe6-<-?BB;=-7-?;=-:->;=H----sy|n-|\b-J-sy|n5r{pf6-<-?BB;=-7-?;=-:->;=H----sy|n-| -J->;=-:-no5|\x076-:-no5|\b6H----vs-5| -I-=;=6-\n--------sy|n-z}e-J-|\x07H--------|\x07-J-5>;=-:-no5|\b66-7-5|\x07-KJ-=;=-L->;=-G-:>;=6H--------|\b-J-5>;=-:-no5z}e66-7-5|\b-KJ-=;=-L->;=-G-:>;=6H----\f----rp@-n\x07v-J-{|znyv r5rp@5|\x079-|\b9-| 66H----sy|n-n{tyr-J-sy|n5r{pg6-<-?BB;=-7-]VH----sy|n-unysN{tyr-J-n{tyr-7-=;BH----sy|n-v{Unys-J-v{5unysN{tyr6H----sy|n-p|Unys-J-p|5unysN{tyr6H----r{-rpA5n\x07v-7-v{Unys9-p|Unys6H-<<-5\x079-\b9- 9-6\fzn@-\0na|Zn@5rpA-\x006-\n----sy|n-\x07-J-\0;\x079-\b-J-\0;\b9- -J-\0; 9--J-\0;H----r{-zn@5-------->;=-:-?;=75\b7\b-8- 7 69-?;=75\x077\b-:- 769-------?;=75\x077 -8-\b769--------?;=75\x077\b-8- 769------->;=-:-?;=75\x077\x07-8- 7 69-?;=75\b7 -:-\x07769--------?;=75\x077 -:-\b769-------?;=75\b7 -8-\x07769------->;=-:-?;=75\x077\x07-8-\b7\b6----6H\frp?-tr`UQnnbc5v{-}ynVq\x079-v{-p|z}|{r{\\ssr9-rp?-r\x07r`v r6-\n----v{-uP|z}|{r{P|{-J-=H----vs-5lzn\x07`uQrtrr-KJ->6-uP|z}|{r{P|{-8J-FH----vs-5lzn\x07`uQrtrr-KJ-?6-uP|z}|{r{P|{-8J->BH----vs-5lzn\x07`uQrtrr-KJ-@6-uP|z}|{r{P|{-8J-?>H----v{-}nqqrqP|z}|{r{P|{-J-uP|z}|{r{P|{H----vs-5}nqqrqP|z}|{r{P|{-2-A-.J-=6-\n--------}nqqrqP|z}|{r{P|{-J-55}nqqrqP|z}|{r{P|{-<-A6-8->6-7-AH----\f----sy|n-yv{rnP|z}|{r{V{qr\x07-J-sy|n5}ynVq\x07-7-}nqqrqP|z}|{r{P|{-8-p|z}|{r{\\ssr6H----sy|n-r\x07ryV{qr\x07-J-yv{rnP|z}|{r{V{qr\x07-<-A;=H----sy|n-q-J-r\x07ryV{qr\x07-<-r\x07r`v r;\x07H----sy|n-\b-J-sy||5q6-<-r\x07r`v r;\bH----sy|n-\x07-J-snp5q6H----r{-rp?5\x079-\b6H\f|vq-znv{-56-\n----v{-}ynV{qr\x07b-J-v{5}ynV{qr\x07-8-=;B6H----v{-}ynV{qr\x07V-J-v{5}ynV{qr\x07b6H----<<-qnnh=jG-_-\v-TIIE-\v-OII>C-\v-NII?A----<<-qnnh>jG-pr{re5s>C6-\v-pr{rf5s>C6----<<-qnnh?jG-pr{rg5s>C6-\v-\0ne5E6II>C-\v-\0nf5E6II?A----<<-qnnh@jG-pnyre5E6-\v-pnyrf5E6IIE-\v-pnyrg5E6II>C-\v-\0ng5E6II?A----rpA-}npxrq-J-r\x07rySrpu5lr\x07r9-vrp?5}ynV{qr\x07b-3-=\x07Dss9-}ynV{qr\x07b-KK->>69-=6H----0vsqrs-b`RlS@?l]\\`VaV\\[----<<-全精度中心:避开-s}>C-量化导致的直线锯齿<毛刺----rp@-}ynPr{r-J-r\x07rySrpu5l}|vv|{ar\x07r9-vrp?5}ynV{qr\x07b-3-=\x07Dss9-}ynV{qr\x07b-KK->>69-=6;\x07\b H----0ryr----rp?-}|ef-J-{}npxUnys?\x07>C5}npxrq;\b6H----rp?-}|g\0e-J-{}npxUnys?\x07>C5}npxrq; 6H----rp@-}ynPr{r-J-rp@5}|ef;\x079-}|ef;\b9-}|g\0e;\x076H----0r{qvs----v{-\0nR{pe-J-5}npxrq; -KK->C6-3-=\x07ssH----v{-\0nR{pf-J-5}npxrq; -KK-?A6-3-=\x07ssH----v{-\0nR{pg-J-5}npxrq;-KK-?A6-3-=\x07ssH----rpA-\0n-J-qrp|qr^n\\pnurqny5\0nR{pe9-\0nR{pf9-\0nR{pg6H----sy|n-pnyre-J-qrp|qrY|t`pnyr5}npxrq;-3-=\x07ss6H----sy|n-pnyrf-J-qrp|qrY|t`pnyr55}npxrq;-KK-E6-3-=\x07ss6H----sy|n-pnyrg-J-qrp|qrY|t`pnyr55}npxrq;-KK->C6-3-=\x07ss6H----rpA-p|y|-J-rpA5--------sy|n5}npxrq;\x07-3-=\x07ss69--------sy|n55}npxrq;\x07-KK-E6-3-=\x07ss69--------sy|n55}npxrq;\x07-KK->C6-3-=\x07ss69--------sy|n55}npxrq;\x07-KK-?A6-3-=\x07ss6----6-<-?BB;=H----v{-n{s|zV{qr\x07-J-r\x07rySrpu5ln{s|zV{qvpr9-vrp?5}ynV{qr\x07b-3-=\x07@ss9-}ynV{qr\x07b-KK->=69-=6;\x07H----znA-n{s|z-J-znA5--------r\x07rySrpu5ln{s|z9-vrp?5=9-n{s|zV{qr\x0769-=69--------r\x07rySrpu5ln{s|z9-vrp?5>9-n{s|zV{qr\x0769-=69--------r\x07rySrpu5ln{s|z9-vrp?5?9-n{s|zV{qr\x0769-=69--------r\x07rySrpu5ln{s|z9-vrp?5@9-n{s|zV{qr\x0769-=6----6H----znA-n{s|zZ|qrycvrZnv\x07-J-vrZnv\x07-7-n{s|zH----rpA-|yqPr{r-J-n{s|z-7-rpA5}ynPr{r9->;=6H0vs-R[NOYRlT`lV[ValN[VZNaV\\[----sy|n-y|pny]|tr-J-lnttrtnv|{]|trH----sy|n-pnyr]|tr-J-=;=H----o||y-v{O|{qS|Nttrtnv|{-J-snyrH----vs-5lnttrtnv|{]|tr-I->;=6-\n--------o||y-v{O|{q-J-|yqPr{r;\x07-KJ-lnttrtnv|{O|{qZv{;\x07---------------------33-|yqPr{r;\x07-IJ-lnttrtnv|{O|{qZn\x07;\x07---------------------33-|yqPr{r; -KJ-lnttrtnv|{O|{qZv{; ---------------------33-|yqPr{r; -IJ-lnttrtnv|{O|{qZn\x07; H--------vs-5v{O|{q6-\n------------v{O|{qS|Nttrtnv|{-J-rH------------sy|n-urvtu_n{tr-J-lnttrtnv|{O|{qZn\x07;\b-:-lnttrtnv|{O|{qZv{;\bH------------sy|n-{|znyv rqUrvtu-J-urvtu_n{tr-K-=;==>----------------L-pynz}55|yqPr{r;\b-:-lnttrtnv|{O|{qZv{;\b6-<-urvtu_n{tr9-=;=9->;=6----------------G-=;BH------------sy|n-}|v{Q-J-pynz}5lnttrtnv|{]|v{Qnv|{9-=;=>9->;=6H------------sy|n-navzr-J-5>;=-:-{|znyv rqUrvtu6-7-5>;=-:-}|v{Q6H------------y|pny]|tr-J-pynz}55lnttrtnv|{]|tr-:-navzr6-<-}|v{Q9-=;=9->;=6H------------sy|n-|ssr]|tr-J-z||ur}5=;=9->;=9-y|pny]|tr6H------------pnyr]|tr-J-y|pny]|tr-7-y|pny]|tr-7-y|pny]|trH------------rp@-nttrtnv|{Pr{r-J-5lnttrtnv|{O|{qZv{-8-lnttrtnv|{O|{qZn\x076-<-?;=H------------rp@-qv-J-|yqPr{r;\x07\b -:-nttrtnv|{Pr{rH------------sy|n-qv-J-yr{tu5qv6H------------sy|n-n{q`rrq-J-q|5}ynPr{r9-rp@5>?;FEFE9-DE;?@@9-AB;>CA66H------------sy|n-n{qQv-J-snp5v{5n{q`rrq6-7-A@DBE;BAB@6H------------sy|n-n{tyr-J-n{q`rrq-7->=;=H------------rp@-pnrQv-J-{|znyv r5rp@5----------------p|5n{tyr69----------------zv\x075:=;D9-=;>9-snp5v{5n{q`rrq-7->;D6-7-A@DBE;BAB@669----------------v{5n{tyr6------------66H------------sy|n-r\x07}y|v|{Snp|-J-5>;=-:-|ssr]|tr6-7-5>;=-8->;=-7-n{qQv6H------------rp@-|ssr-J-pnrQv-7-qv-7-r\x07}y|v|{Snp|H------------|yqPr{r;\x07\b -8J-|ssrH------------}ynPr{r-J-5v{rr5n{s|z6-7-|yqPr{r6;\x07\b H--------\f----\f0r{qvs----0vs-[bZlT`lPYV]]R_`-K-=----v{-yn\brV{qr\x07-J-v{5r\x07rySrpu5lyn\brV{qvpr9-vrp?5}ynV{qr\x07b-3-=\x07@ss9-}ynV{qr\x07b-KK->=69-=6;\x076H----vs-5yn\brV{qr\x07-KJ-=-33-yn\brV{qr\x07-I-[bZlT`lYNfR_`6-\n--------rp?-pyv}_n{tr-J-lyn\brPyv}}r_n{trhyn\brV{qr\x07jH--------v{-pyv}`n-J-v{5pyv}_n{tr;\x07-8-=;B6H--------v{-pyv}P|{-J-v{5pyv}_n{tr;\b-8-=;B6H--------v{-pyv}R{q-J-pyv}`n-8-pyv}P|{H--------s|-5v{-v-J-=H-v-I-[bZlT`lPYV]]R_`H-v886-\n----------------vs-5v-I-pyv}`n-\v\v-v-KJ-pyv}R{q6-\n--------------------p|{v{rH----------------\f----------------rpA-pyv}}r]|vv|{-J-lpyv}}rZnvprV{rrhvj-7-|yqPr{rH----------------o||y-pyv}}rq-J-pyv}}r]|vv|{;\x07-K-:=;B-33-pyv}}r]|vv|{;\x07-I-=;BH----------------pyv}}rq-J-pyv}}rq-33-pyv}}r]|vv|{;\b-K-:=;B-33-pyv}}r]|vv|{;\b-I-=;BH----------------pyv}}rq-J-pyv}}rq-33-pyv}}r]|vv|{; -K-:=;B-33-pyv}}r]|vv|{; -I-=;BH----------------vs-5pyv}}rq6-\n--------------------tyl]|vv|{-J-rpA5=;=9-=;=9-?;=9->;=6H--------------------r{H----------------\f--------\f----\f----0r{qvs----rpA-vrPr{r-J-n{s|zZ|qrycvrZnv\x07-7-rpA5}ynPr{r9->;=6H----rpA-pyv}Pr{r-J-}|wrpv|{Znv\x07-7-vrPr{rH----sy|n-pyv}-J->;?-7-pyv}Pr{r;H----vs-5pyv}Pr{r; -I-:pyv}Pr{r;-\v\v-pyv}Pr{r; -K-pyv}Pr{r;-\v\v--------pyv}Pr{r;\x07-I-:pyv}-\v\v-pyv}Pr{r;\x07-K-pyv}-\v\v--------pyv}Pr{r;\b-I-:pyv}-\v\v-pyv}Pr{r;\b-K-pyv}6-\n--------tyl]|vv|{-J-rpA5=;=9-=;=9-?;=9->;=6H--------r{H----\f----rp@-{qpPr{r-J-pyv}Pr{r;\x07\b -<-pyv}Pr{r;H----rp?-s|pny-J-rp?5--------}|wrpv|{Znv\x07h=jh=j-7-r|yv|{;\x07-7-=;B9--------}|wrpv|{Znv\x07h>jh>j-7-r|yv|{;\b-7-=;B----6H----]|vv|{-J-}|vv|{;\x07\bH----zn@-|Zn-J-\0na|Zn@5\0n6H----zn@-pnyrZn-J-zn@5--------pnyre9-=;=9-=;=9--------=;=9-pnyrf9-=;=9--------=;=9-=;=9-pnyrg----6H----zn@-Z-J-pnyrZn-7-|ZnH----<<-cx-J-Z-7-Zka-5@Q-p|nvn{pr-v{-|owrp-}npr6----zn@-cx-J-zn@5--------q|5Zh=j9-Zh=j69-q|5Zh=j9-Zh>j69-q|5Zh=j9-Zh?j69--------q|5Zh>j9-Zh=j69-q|5Zh>j9-Zh>j69-q|5Zh>j9-Zh?j69--------q|5Zh?j9-Zh=j69-q|5Zh?j9-Zh>j69-q|5Zh?j9-Zh?j6----6H----o||y-v\\u|tn}uvp-J-}|wrpv|{Znv\x07h@jh@j-K-=;DH----zn@-WH----vs-5v\\u|tn}uvp6-\n--------W-J-n{}|r5zn@5------------s|pny;\x079-=;=9-=;=9------------=;=9-s|pny;\b9-=;=9------------=;=9-=;=9-=;=--------66H----\f-ryr-\n--------sy|n--J->;=-<-5vrPr{r; -7-vrPr{r; 6H--------W-J-zn@5------------s|pny;\x07-<-vrPr{r; 9-=;=9-:5s|pny;\x07-7-vrPr{r;\x076-7-9------------=;=9-s|pny;\b-<-vrPr{r; 9-:5s|pny;\b-7-vrPr{r;\b6-7-9------------=;=9-=;=9-=;=--------6H----\f----zn@-d-J-n{}|r5zn@5n{s|zZ|qrycvrZnv\x0766H----zn@-a-J-d-7-WH----<<-]|wrp-@Q-p|nvn{pr-|-?Q----zn@-p|?Qz-J-n{}|r5a6-7-cx-7-aH----p|?Qzh=jh=j-8J-xr{ry?Q`v rH----p|?Qzh>jh>j-8J-xr{ry?Q`v rH----rp@-p|?Q-J-rp@5p|?Qzh=jh=j9-p|?Qzh=jh>j9-p|?Qzh>jh>j6H----sy|n-n-J-p|?Q;\x07H----sy|n-q-J-p|?Q; H----sy|n-o-J-p|?Q;\bH----sy|n-Q-J-n-7-q-:-o-7-oH----sy|n-npr-J-n-8-qH----sy|n-npr\\r?-J-=;B-7-nprH----sy|n-rz?-J-\05zn\x075=;>9-npr\\r?-7-npr\\r?-:-Q66H----sy|n-rvtr{cnyr>-J-npr\\r?-8-rz?H----sy|n-rvtr{cnyr?-J-npr\\r?-:-rz?H----vs-5rvtr{cnyr?-IJ-=;=6-\n--------r{H----\f----rp?-rvtr{crp|>-J-{|znyv r5rp?5o9-rvtr{cnyr>-:-n66H----rp?-rvtr{crp|?-J-rp?5rvtr{crp|>;\b9-:rvtr{crp|>;\x076H----rp?-onvcrp|>-J-rvtr{crp|>-7-zv{5\0E-7-\05rvtr{cnyr>69-zn\x07`prr{`}npr`}yn`v r6H----rp?-onvcrp|?-J-rvtr{crp|?-7-zv{5\0E-7-\05rvtr{cnyr?69-zn\x07`prr{`}npr`}yn`v r6H----rp?-onvcvr}|-J-rp?5>;=-<-r|yv|{;\x079->;=-<-r|yv|{;\b6H----rp?-{qp\\ssr-J-rp?5]|vv|{;\x07-7-onvcrp|>-8-]|vv|{;\b-7-onvcrp|?6-7---------------------onvcvr}|-7-?;=H0vs-R[NOYRlT`lV[ValN[VZNaV\\[----sy|n-sv{ny`pnyr]|tr-J-v{O|{qS|Nttrtnv|{-L-pnyr]|tr-G-5lnttrtnv|{]|tr-7-lnttrtnv|{]|tr-7-lnttrtnv|{]|tr6H----{qp\\ssr-7J-zv\x075=;>9->;=9-sv{ny`pnyr]|tr6H0r{qvs----rpA-\0nq]|-J-rpA5{qpPr{r;\x07\b-8-{qp\\ssr9-{qpPr{r; 9->;=6H----tyl]|vv|{-J-\0nq]|H----vs-5lzn\x07`uQrtrr-KJ->6-\n--------rp@-pnzrn]|V{\\owrp-J-rp@5v{rr5n{s|z6-7-rpA5pnzrn]|vv|{9->;=66H--------rp@-|owrpcvrQv-J-{|znyv r5}ynPr{r-:-pnzrn]|V{\\owrp6H--------rpA-u=>?@-J-r\x07r5luar\x07r9-tr`UQnnbc5}ynV{qr\x07V9-=9-luar\x07r`v r66H--------rpA-uABCD-J-r\x07r5luar\x07r9-tr`UQnnbc5}ynV{qr\x07V9-A9-luar\x07r`v r66H--------rpA-uEF>=>>-J-r\x07r5luar\x07r9-tr`UQnnbc5}ynV{qr\x07V9-E9-luar\x07r`v r66H--------rp@-u>-J-u=>?@;toH--------rp@-u?-J-rp@5u=>?@;n9-uABCD;t6H--------rp@-u@-J-rp@5uABCD;on9-uEF>=>>;6H--------sy|n-\x07-J-|owrpcvrQv;\x07H--------sy|n-\b-J-|owrpcvrQv;\bH--------sy|n- -J-|owrpcvrQv; H--------rp@-uP|y|-J-u>-7-5:=;AEEC=?B-7-\b6-8-u?-7-5=;AEEC=?B-7- 6-8-u@-7-5:=;AEEC=?B-7-\x076H--------p|y|;to-8J-uP|y|H--------vs-5lzn\x07`uQrtrr-KJ-?6-\n------------rpA-u>?>@>A>B-J-r\x07r5luar\x07r9-tr`UQnnbc5}ynV{qr\x07V9->?9-luar\x07r`v r66H------------rpA-u>C>D>E>F-J-r\x07r5luar\x07r9-tr`UQnnbc5}ynV{qr\x07V9->C9-luar\x07r`v r66H------------rpA-u?=?>???@-J-r\x07r5luar\x07r9-tr`UQnnbc5}ynV{qr\x07V9-?=9-luar\x07r`v r66H------------rp@-uA-J-uEF>=>>;tonH------------rp@-uB-J-u>?>@>A>B;toH------------rp@-uC-J-rp@5u>?>@>A>B;n9-u>C>D>E>F;t6H------------rp@-uD-J-rp@5u>C>D>E>F;on9-u?=?>???@;6H------------rp@-uElqrt?-J-u?=?>???@;tonH------------sy|n-\x07\x07-J-\x07-7-\x07H------------sy|n-\b\b-J-\b-7-\bH------------sy|n- -J- -7- H------------sy|n-\x07\b-J-\x07-7-\bH------------sy|n-\b -J-\b-7- H------------sy|n-\x07 -J-\x07-7- H------------p|y|;to-8J----------------5`UlP?l=-7-\x07\b6-7-uA-8----------------5`UlP?l>-7-\b 6-7-uB-8----------------5`UlP?l?-7-5?;=-7- -:-\x07\x07-:-\b\b66-7-uC-8----------------5`UlP?l@-7-\x07 6-7-uD-8----------------5`UlP?lA-7-5\x07\x07-:-\b\b66-7-uElqrt?H--------\f----\f----p|y|;to-J-pynz}5p|y|;to9-rp@5=;=69-rp@5>;=66H----P|y|-J-p|y|H----]|vv|{-7J-\0EH----b-J-}|vv|{;\x07\bH\f"),fragment_default=function(...e){let t=113,n=126,r=0,o=``;return e[0].split(``).map(e=>e.charCodeAt(0)>126?e:String.fromCharCode((e.charCodeAt(0)+113)%126)).join(``)}(`}rpvv|{-uvtu}-sy|nH0v{pyqr-Ip|zz|{Kn\bv{t-rpA-P|y|Hn\bv{t-rp?-]|vv|{Hn\bv{t-rp?-bH|vq-znv{-56-
|
|
2807
|
-
----<<-计算从-}yn-中心到当前片段的平方距离----<<-由于-]|vv|{-已经按-\05E6-缩放,平方结果会被缩放-E-倍----<<-如果平方结果大于-E,说明在椭圆外,距离均值超过-\05E6-个标准差----sy|n-N-J-q|5]|vv|{9-]|vv|{6H----vs-5N-K-E;=6-qvpnqH--------rp@-p|y|-J-P|y|;toH--------<<-由于渲染的-}yn-按-\05E6-缩放,高斯公式中的逆协方差矩阵部分变成单位矩阵----<<-因此只剩下-5e-:-zrn{6-7-5e-:-zrn{6,而-zrn{-为零,所以是-e-7-e,即-N----sy|n-|}npv\b-J-r\x07}5:=;B-7-N6-7-P|y|;nH--------tylSntP|y|-J-rpA5p|y|;to9-|}npv\b6H\f`),MAX_POOL_SIZE=2,PBMGaussianSplattingRenderMesh=class extends three.Mesh{constructor(){super(),this.renderData=null,this.needsRender=!1,this.sortWorker=null,this.depthIndex=new Uint32Array,this.splatIndexCapacity=0,this.activeSlot=null,this.pendingSlot=null,this.rebuildGeneration=0,this.forceClipperUniformRefresh=!1,this.incrementalUpdateInFlight=!1,this.freeSlotPool=[],this.dataTexture=null,this.positionTexture=null,this.transformsTexture=null,this.transformIndicesTexture=null,this.layerIndicesTexture=null,this.shTexture=null,this.usedSHDegree=0,this.sortDataRebuilding=!1,this.onBeforeRender=(e,t,n)=>{let r=n,o=this.collectObjects(t);if(o.length===0){this.geometry.instanceCount=0;return}let s=0,c=!1;o.forEach(e=>{e.usedSHDegree>s&&(s=e.usedSHDegree),e.initAnimationEnabled&&(c=!0)}),this.setMaxShDegree(s),this.updateInitAnimationDefine(c),this.isSceneNeedsRebuild(o)&&(this.tryStartIncrementalUpdate(o)||(this.startPendingRebuild(o),this.gsSceneState.lastClipperHash=``));let l=o.filter(e=>e.transformChanged);l.length>0&&(this.syncTransformsForSlot(this.activeSlot,l),this.syncTransformsForSlot(this.pendingSlot,l),l.forEach(e=>{e.transformChanged=!1,e.selectedChanged=!1})),this.activeSlot&&this.updateSlotTextures(this.activeSlot),this.pendingSlot&&this.updateSlotTextures(this.pendingSlot);let u=new three.Matrix4().multiplyMatrices(r.perspectiveProjectionMatrix,r.matrixWorldInverse).elements;this.pendingSlot&&this.pendingSlot.renderData.initialBuildComplete&&this.pendingSlot.awaitingFirstSort?this.requestSort(this.pendingSlot,u):this.activeSlot&&this.requestSort(this.activeSlot,u);let d=this.getClipperHash(o);if((this.forceClipperUniformRefresh||d!==this.gsSceneState.lastClipperHash)&&(this.updateClipperUniforms(o),this.gsSceneState.lastClipperHash=d,this.forceClipperUniformRefresh=!1,this.needsRender=!0),this.activeSlot){let e=Math.min(this.usedSHDegree,this.activeSlot.renderData.maxShDegree);this.material.uniforms.u_maxShDegree.value=e,e>0&&!this.activeSlot.textures.shTexture?this.createSHTexture(this.activeSlot):e===0&&this.activeSlot.textures.shTexture&&(this.activeSlot.textures.shTexture.dispose(),this.activeSlot.textures.shTexture=null),this.material.uniforms.u_shTexture.value=this.activeSlot.textures.shTexture,this.renderData=this.activeSlot.renderData}else this.pendingSlot||(this.bindSlotTextures(null),this.material.uniforms.u_maxShDegree.value=0,this.geometry.instanceCount=0);this.material.uniforms.resolution.value.set(r.resolution.x,r.resolution.y)};let e=this.createGeometry(),t=this.createMaterial();this.geometry=e,this.material=t,this.frustumCulled=!1,this.renderOrder=-99999999999,this.gsSceneState={lastObjectsHash:``,lastClipperHash:``},this.sortWorker=new WorkerWrapper,this.sortWorker.postMessage({warmup:!0}),RenderData.warmupWasm(),this.sortWorker.onmessage=e=>{var t;if(e.data.depthIndex){let n=e.data.depthIndex,r=e.data.generation;this.pendingSlot&&r===this.pendingSlot.generation?(this.pendingSlot.awaitingFirstSort=!1,this.swapPendingToActive(n)):this.activeSlot&&r===this.activeSlot.generation&&(this.activeSlot.awaitingFirstSort=!1,this.applyDepthIndex(n));let o=n.buffer;o.byteLength>0&&((t=this.sortWorker)==null||t.postMessage({returnBuffer:o},[o]))}}}ensureSplatIndexCapacity(e){let t=this.geometry.getAttribute(`splatIndex`);if(e<=this.splatIndexCapacity)return t;let n=this.getExpandedCapacity(e),r=t.array,o=new Float32Array(n);o.set(r.subarray(0,Math.min(r.length,n)));let s=new three.InstancedBufferAttribute(o,1,!1,1);return s.setUsage(three.DynamicDrawUsage),this.geometry.setAttribute(`splatIndex`,s),this.splatIndexCapacity=n,this.geometry._maxInstanceCount=n,s}getExpandedCapacity(e){let t=Math.max(this.splatIndexCapacity,1);for(;t<e;)t*=2;return t}createGeometry(){let e=new three.InstancedBufferGeometry,t=new Float32Array([-1,-1,0,1,-1,0,1,1,0,-1,1,0]);e.setAttribute(`position`,new three.BufferAttribute(t,3));let n=new Uint16Array([0,1,2,0,2,3]);e.setIndex(new three.BufferAttribute(n,1)),this.splatIndexCapacity=1;let r=new Float32Array(this.splatIndexCapacity);for(let e=0;e<r.length;e++)r[e]=e;let o=new three.InstancedBufferAttribute(r,1,!1,1);return o.setUsage(three.DynamicDrawUsage),e.setAttribute(`splatIndex`,o),e._maxInstanceCount=this.splatIndexCapacity,e.instanceCount=0,e}createMaterial(){return new three.ShaderMaterial({vertexShader:vertex_default,fragmentShader:fragment_default,defines:{NUM_GS_LAYERS:0,NUM_GS_CLIPPERS:0,USE_F32_POSITION:1,ENABLE_GS_INIT_ANIMATION:0},uniforms:{u_texture:{value:null},u_positionTexture:{value:null},u_transforms:{value:null},u_transformIndices:{value:null},u_layerIndices:{value:null},u_numGsLayers:{value:0},u_numGsClippers:{value:0},u_layerClipperRanges:{value:[]},u_clipperMatricesInverse:{value:[]},u_shTexture:{value:null},u_shTextureSize:{value:new three.Vector2},u_maxShDegree:{value:0},resolution:{value:new three.Vector2},u_aggregationProgress:{value:0},u_aggregationBoundsMin:{value:new three.Vector3(0,0,0)},u_aggregationBoundsMax:{value:new three.Vector3(0,0,0)},u_aggregationPointDuration:{value:.6}},side:three.DoubleSide,transparent:!0,blending:three.NormalBlending,depthTest:!0,depthWrite:!1})}createDefaultLayerClipperRanges(e){return Array.from({length:e},()=>new three.Vector2(-1,0))}createDefaultClipperMatrices(e){return Array.from({length:e},()=>new three.Matrix4)}createTextures(e,t){var n;let r;t&&t.dataTexture.image.width===e.width&&t.dataTexture.image.height===e.height?(r=t.dataTexture,r.image.data=e.data,r.needsUpdate=!0):(t&&t.dataTexture.dispose(),r=new three.DataTexture(e.data,e.width,e.height,three.RGBAIntegerFormat,three.UnsignedIntType),r.internalFormat=`RGBA32UI`,r.minFilter=three.NearestFilter,r.magFilter=three.NearestFilter,r.needsUpdate=!0);let o;t&&t.positionTexture.image.width===e.width&&t.positionTexture.image.height===e.height?(o=t.positionTexture,o.image.data=e.positionData,o.needsUpdate=!0):(t&&t.positionTexture.dispose(),o=new three.DataTexture(e.positionData,e.width,e.height,three.RGBFormat,three.FloatType),o.internalFormat=`RGB32F`,o.minFilter=three.NearestFilter,o.magFilter=three.NearestFilter,o.needsUpdate=!0);let s;t&&t.transformsTexture.image.width===e.transformsWidth&&t.transformsTexture.image.height===e.transformsHeight?(s=t.transformsTexture,s.image.data=e.transforms,s.needsUpdate=!0):(t&&t.transformsTexture.dispose(),s=new three.DataTexture(e.transforms,e.transformsWidth,e.transformsHeight,three.RGBAFormat,three.FloatType),s.internalFormat=`RGBA32F`,s.minFilter=three.NearestFilter,s.magFilter=three.NearestFilter,s.needsUpdate=!0);let c;t&&t.transformIndicesTexture.image.width===e.transformIndicesWidth&&t.transformIndicesTexture.image.height===e.transformIndicesHeight?(c=t.transformIndicesTexture,c.image.data=e.transformIndices,c.needsUpdate=!0):(t&&t.transformIndicesTexture.dispose(),c=new three.DataTexture(e.transformIndices,e.transformIndicesWidth,e.transformIndicesHeight,three.RedIntegerFormat,three.UnsignedIntType),c.internalFormat=`R32UI`,c.minFilter=three.NearestFilter,c.magFilter=three.NearestFilter,c.needsUpdate=!0);let l;t&&t.layerIndicesTexture.image.width===e.layerIndicesWidth&&t.layerIndicesTexture.image.height===e.layerIndicesHeight?(l=t.layerIndicesTexture,l.image.data=e.layerIndices,l.needsUpdate=!0):(t&&t.layerIndicesTexture.dispose(),l=new three.DataTexture(e.layerIndices,e.layerIndicesWidth,e.layerIndicesHeight,three.RedIntegerFormat,three.UnsignedIntType),l.internalFormat=`R32UI`,l.minFilter=three.NearestFilter,l.magFilter=three.NearestFilter,l.needsUpdate=!0);let u=(n=t==null?void 0:t.shTexture)==null?null:n;return{dataTexture:r,positionTexture:o,transformsTexture:s,transformIndicesTexture:c,layerIndicesTexture:l,shTexture:u}}createSHTexture(e){let{renderData:t,textures:n}=e;if(t.shDataReleased)return;n.shTexture&&(n.shTexture.dispose(),n.shTexture=null);let r=Math.min(this.usedSHDegree,t.maxShDegree),o=0;if(r>=1&&(o+=9),r>=2&&(o+=15),r>=3&&(o+=21),o===0)return;let s=4,c=o;c%4!=0&&(c=Math.ceil(c/4)*4);let l=t.numPoints*c/4,u=2048,d=Math.ceil(l/u),f=new Float32Array(u*d*4);for(let e=0;e<t.numPoints;e++){let n=c/4*e,o=0;if(t.sh1&&r>=1)for(let r=0;r<9;r++){let s=n+Math.floor(o/4),c=o%4,l=s*4+c;f[l]=t.sh1[e*9+r],o++}if(t.sh2&&r>=2)for(let r=0;r<15;r++){let s=n+Math.floor(o/4),c=o%4,l=s*4+c;f[l]=t.sh2[e*15+r],o++}if(t.sh3&&r>=3)for(let r=0;r<21;r++){let s=n+Math.floor(o/4),c=o%4,l=s*4+c;f[l]=t.sh3[e*21+r],o++}}n.shTexture=new three.DataTexture(f,u,d,three.RGBAFormat,three.FloatType),n.shTexture.internalFormat=`RGBA32F`,n.shTexture.minFilter=three.NearestFilter,n.shTexture.magFilter=three.NearestFilter,n.shTexture.needsUpdate=!0,this.material.uniforms.u_shTextureSize.value.set(u,d),this.material.uniforms.u_maxShDegree.value=r,e.renderData.releaseSHData()}setMaxShDegree(e){var t,n;if(e<0||e>2){console.warn(`现在只支持012三种阶数,你输入的是${e}`);return}let r=this.usedSHDegree;this.usedSHDegree=e,r!==e&&((t=this.activeSlot)!=null&&t.textures.shTexture&&(this.activeSlot.textures.shTexture.dispose(),this.activeSlot.textures.shTexture=null),(n=this.pendingSlot)!=null&&n.textures.shTexture&&(this.pendingSlot.textures.shTexture.dispose(),this.pendingSlot.textures.shTexture=null),this.material.uniforms.u_maxShDegree.value=e,e===0?this.material.uniforms.u_shTexture.value=null:this.activeSlot&&this.activeSlot.renderData.maxShDegree>0&&(this.createSHTexture(this.activeSlot),this.material.uniforms.u_shTexture.value=this.activeSlot.textures.shTexture))}bindSlotTextures(e){if(!e){this.dataTexture=null,this.positionTexture=null,this.transformsTexture=null,this.transformIndicesTexture=null,this.layerIndicesTexture=null,this.shTexture=null,this.material.uniforms.u_texture.value=null,this.material.uniforms.u_positionTexture.value=null,this.material.uniforms.u_transforms.value=null,this.material.uniforms.u_transformIndices.value=null,this.material.uniforms.u_layerIndices.value=null,this.material.uniforms.u_shTexture.value=null;return}this.dataTexture=e.textures.dataTexture,this.positionTexture=e.textures.positionTexture,this.transformsTexture=e.textures.transformsTexture,this.transformIndicesTexture=e.textures.transformIndicesTexture,this.layerIndicesTexture=e.textures.layerIndicesTexture,this.shTexture=e.textures.shTexture,this.material.uniforms.u_texture.value=this.dataTexture,this.material.uniforms.u_positionTexture.value=this.positionTexture,this.material.uniforms.u_transforms.value=this.transformsTexture,this.material.uniforms.u_transformIndices.value=this.transformIndicesTexture,this.material.uniforms.u_layerIndices.value=this.layerIndicesTexture,this.material.uniforms.u_shTexture.value=this.shTexture}disposeSlot(e){e&&(e.renderData.dispose(),this.disposeTextures(e.textures))}recycleSlot(e){if(e){if(this.freeSlotPool.length>=MAX_POOL_SIZE){let e=this.freeSlotPool.shift();this.disposeSlot(e)}e.renderData.releaseSortData(),e.renderData.releaseAggregatedData(),e.awaitingFirstSort=!0,e.sortDataUploaded=!1,this.freeSlotPool.push(e)}}disposeTextures(e){e.dataTexture.dispose(),e.positionTexture.dispose(),e.transformsTexture.dispose(),e.transformIndicesTexture.dispose(),e.layerIndicesTexture.dispose(),e.shTexture&&(e.shTexture.dispose(),e.shTexture=null)}applyDepthIndex(e){this.depthIndex=e;let t=this.depthIndex.length,n=this.ensureSplatIndexCapacity(t);n.array.set(this.depthIndex,0),n.count=this.depthIndex.length,n.updateRange.offset=0,n.updateRange.count=t,n.needsUpdate=!0,this.geometry.instanceCount=this.depthIndex.length,this.needsRender=!0}swapPendingToActive(e){if(!this.pendingSlot)return;let t=this.activeSlot;this.activeSlot=this.pendingSlot,this.pendingSlot=null,this.renderData=this.activeSlot.renderData,this.ensureSplatIndexCapacity(this.activeSlot.renderData.numPoints),this.bindSlotTextures(this.activeSlot),this.activeSlot.sortDataUploaded=!0,this.forceClipperUniformRefresh=!0,this.applyDepthIndex(e),t&&this.recycleSlot(t)}createSlot(e){let t={generation:e.generation,renderData:e,textures:this.createTextures(e),awaitingFirstSort:!0,sortDataUploaded:!1};return this.usedSHDegree>0&&e.maxShDegree>0&&this.createSHTexture(t),t}updateSlotTextures(e){e.renderData.dataChanged&&(e.textures.dataTexture.needsUpdate=!0,e.textures.positionTexture.needsUpdate=!0,e.renderData.dataChanged=!1),e.renderData.transformsChanged&&(e.textures.transformsTexture.needsUpdate=!0,e.renderData.indexDataReleased||(e.textures.transformIndicesTexture.needsUpdate=!0),e.renderData.transformsChanged=!1)}postSortData(e){var t;let n=e.renderData.positions,r=new Float32Array(e.renderData.transforms.slice().buffer),o=new Uint32Array(e.renderData.transformIndices.slice().buffer);(t=this.sortWorker)==null||t.postMessage({sortData:{positions:n,transforms:r,transformIndices:o,vertexCount:e.renderData.numPoints,generation:e.generation}},[n.buffer,r.buffer,o.buffer]),e.renderData.releaseSortData(),e.renderData.releaseIndexData(),e.sortDataUploaded=!0}requestSort(e,t){var n;if(e.renderData.initialBuildComplete){if(e.renderData.dataChanged||e.renderData.transformsChanged||!e.sortDataUploaded){if(e.renderData.sortDataReleased){this.sortDataRebuilding||(this.sortDataRebuilding=!0,e.renderData.rebuildSortData().then(()=>{this.sortDataRebuilding=!1,(this.activeSlot===e||this.pendingSlot===e)&&(e.sortDataUploaded=!1,this.needsRender=!0)}));return}this.postSortData(e)}(n=this.sortWorker)==null||n.postMessage({viewProj:t})}}syncTransformsForSlot(e,t){e&&t.forEach(t=>{e.renderData.splatIndices.has(t)&&e.renderData.updateTransform(t)})}collectObjects(e){let t=[];return e.traverse(e=>{e instanceof PBMGaussianSplattingObject&&e.visible&&t.push(e)}),t.sort((e,t)=>{let n=e.uuid+e.gsViewLayerKey,r=t.uuid+t.gsViewLayerKey;return n<r?-1:+(n>r)}),t}isSceneNeedsRebuild(e){let t=e.map(e=>`${e.uuid}:${e.gsViewLayerKey}`).join(`|`),n=t!==this.gsSceneState.lastObjectsHash;return this.gsSceneState.lastObjectsHash=t,n}getClipperHash(e){return e.map(e=>{let t=e.gsClippers.map(e=>{var t;return`${(t=e.floorIndex)==null?-1:t}:${e.clippingBoxMatrix.elements.join(`,`)}`}).join(`;`);return`${e.gsViewLayerKey}:${t}`}).join(`|`)}updateClipperCounts(e,t){let n=Math.max(0,e|0),r=Math.max(0,t|0),o=this.material.defines;(o.NUM_GS_LAYERS!==n||o.NUM_GS_CLIPPERS!==r)&&(o.NUM_GS_LAYERS=n,o.NUM_GS_CLIPPERS=r,this.material.needsUpdate=!0),this.material.uniforms.u_numGsLayers.value=e,this.material.uniforms.u_numGsClippers.value=t}updateInitAnimationDefine(e){let t=this.material.defines,n=+!!e;t.ENABLE_GS_INIT_ANIMATION!==n&&(t.ENABLE_GS_INIT_ANIMATION=n,this.material.needsUpdate=!0,this.needsRender=!0)}updateClipperUniforms(e){var t,n,r,o;let s=(n=(t=this.activeSlot)==null?void 0:t.renderData)==null?null:n;if(!s){this.material.uniforms.u_layerClipperRanges.value=[],this.material.uniforms.u_clipperMatricesInverse.value=[],this.updateClipperCounts(0,0);return}let c=new Map;for(let t of e)c.has(t.gsViewLayerKey)||c.set(t.gsViewLayerKey,t.gsClippers);let l=s.layerKeys.length,u=0;for(let e of s.layerKeys)u+=((r=c.get(e))==null?[]:r).length;let d=this.createDefaultLayerClipperRanges(l),f=this.createDefaultClipperMatrices(u),p=0;for(let e of s.layerKeys){let t=s.layerKeyToIndex.get(e);if(t===void 0)continue;let n=(o=c.get(e))==null?[]:o,r=p,l=0;for(let e of n)f[p].getInverse(e.clippingBoxMatrix),p++,l++;l>0&&d[t].set(r,l)}this.material.uniforms.u_layerClipperRanges.value=d,this.material.uniforms.u_clipperMatricesInverse.value=f,this.updateClipperCounts(l,p)}startPendingRebuild(e){this.pendingSlot&&(this.recycleSlot(this.pendingSlot),this.pendingSlot=null),this.rebuildGeneration+=1;let t=new RenderData(e,this.rebuildGeneration),n=this.freeSlotPool.pop();if(n){n.renderData.dispose();let e=this.createTextures(t,n.textures);this.pendingSlot={generation:t.generation,renderData:t,textures:e,awaitingFirstSort:!0,sortDataUploaded:!1}}else this.pendingSlot=this.createSlot(t)}tryStartIncrementalUpdate(e){if(!this.activeSlot||this.pendingSlot||this.incrementalUpdateInFlight)return!1;let t=this.activeSlot.renderData.getObjectsInOrder();if(!this.activeSlot.renderData.canIncrementalAppend(e))return!1;let n=e.slice(t.length);if(n.length===0)return!1;this.incrementalUpdateInFlight=!0;let r=this.activeSlot;return r.renderData.appendObjects(n).then(e=>{e&&(this.activeSlot!==r||r.renderData.disposed||(r.textures=this.createTextures(r.renderData,r.textures),this.usedSHDegree>0&&r.renderData.maxShDegree>0&&this.createSHTexture(r),this.bindSlotTextures(r),this.ensureSplatIndexCapacity(r.renderData.numPoints),r.sortDataUploaded=!1,r.awaitingFirstSort=!0,this.forceClipperUniformRefresh=!0,this.gsSceneState.lastClipperHash=``,this.needsRender=!0))}).catch(e=>{console.warn(`Incremental append failed, fallback to rebuild:`,e)}).finally(()=>{this.incrementalUpdateInFlight=!1}),!0}dispose(){this.disposeSlot(this.pendingSlot),this.pendingSlot=null,this.disposeSlot(this.activeSlot),this.activeSlot=null;for(let e of this.freeSlotPool)this.disposeSlot(e);this.freeSlotPool.length=0,this.renderData=null,this.sortWorker&&this.sortWorker.terminate(),this.bindSlotTextures(null),this.geometry.dispose(),this.material.dispose()}},PBMGaussianSplattingTestMesh=class extends three.Mesh{constructor(){super(),this.onBeforeRender=(e,t,n)=>{this.collectObjects(t).length>0&&console.warn(`未开启webgl2, 3dgs仅支持在开启webgl2模式后使用`)}}collectObjects(e){let t=[];return e.traverse(e=>{e instanceof PBMGaussianSplattingObject&&e.visible&&t.push(e)}),t}},DEFAULT_MODE_CHANGE_DURATION=1e3,DEFAULT_CAMERA_FOV=90,DEFAULT_REQUEST_PROXY=e=>e.replace(`//vrlab-public.ljcdn.com/`,`//vr-public.realsee-cdn.cn/`).replace(`//vrlab-image4.ljcdn.com/`,`//vr-image-4.realsee-cdn.cn/`).replace(`//vrlab-image3.ljcdn.com/`,`//vr-image-3.realsee-cdn.cn/`).replace(`//vrlab-image2.ljcdn.com/`,`//vr-image-2.realsee-cdn.cn/`).replace(`//vrlab-image1.ljcdn.com/`,`//vr-image-1.realsee-cdn.cn/`),scratchSphere=new three.Sphere,scratchBox3=new three.Box3,scratchViewport=new three.Vector4,scratchScissor=new three.Vector4,scratchClearColor=new three.Color,scratchRenderSize=new three.Vector2,worksMap=new WeakMap,emptyWorks=createWorks([parseWork(null)]),Five_Instances={},Five=class e extends Subscribe{static get version(){return`6.8.7`}static get dracoPath(){return draco.decoderPath}static set dracoPath(e){draco.setDecoderPath(e)}static get ktx2Path(){return ktx2.transcoderPath}static set ktx2Path(e){ktx2.setTranscoderPath(e)}static get useNativeImageBitmap(){return canUseNativeImageBitmap()}static set useNativeImageBitmap(e){useNativeImageBitmap(e)}constructor(e={}){var t,n,r,o,s,c,l,u,d,f,p;if(super(),this.pbmGaussianSplattingRenderMesh=null,this.fiveId=createUuid$1(),Five_Instances[this.fiveId]=this,this.currentUpdateArgs={time:now(),args:[]},this.currentMode=`Panorama`,this.pano={workCode:``,panoIndex:0},this.needsRender=!1,this.onlyRenderIfNeeds=(t=e.onlyRenderIfNeeds)==null?!0:t,this.imageOptions=Object.assign({},(n=e.imageOptions)==null?{}:n),this.textureOptions=Object.assign({},(r=e.textureOptions)==null?{}:r),this.poweredByRealsee=(o=e.poweredByRealsee)==null?!0:o,this.backgroundColor=new three.Color((s=e.backgroundColor)==null?1579548:s),this.backgroundAlpha=(c=e.backgroundAlpha)==null?1:c,this.extraElements=[],this.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)},this.fps={testCount:0,testTime:now()},this.modeChangeDuration=(l=e.modeChangeDuration)==null?DEFAULT_MODE_CHANGE_DURATION:l,this.enableWheel=(u=e.enableWheel)==null?!0:u,typeof window<`u`)if(`renderer`in e)e.renderer instanceof InternalWebGLRenderer&&this.throwError(Error(`cannot render a internal renderer`)),this.renderer=e.renderer;else try{this.renderer=new InternalWebGLRenderer({preserveDrawingBuffer:e.preserveDrawingBuffer,antialias:e.antialias,webgl2:e.webgl2,logarithmicDepthBuffer:e.logarithmicDepthBuffer,precision:e.precision,powerPreference:e.powerPreference});let t=getViewportScale();this.renderer.setPixelRatio(t===1?window.devicePixelRatio:1),this.renderer.setSize(512,512),this.renderer.setClearColor(this.backgroundColor,this.backgroundAlpha)}catch(e){let t=e instanceof Error?e:Error(String(e));this.throwError(t)}this.getPixelsRenderTarget=new three.WebGLRenderTarget(1,1,{encoding:(f=(d=this.renderer)==null?void 0:d.outputEncoding)==null?three.sRGBEncoding:f,generateMipmaps:!1}),this.viewport=Object.assign({left:0,bottom:0,width:1,height:1},e.viewport),this.camera=new Camera(DEFAULT_CAMERA_FOV),this.scene=new Scene,this.xrCustomObjectsScene=new three.Scene,this.scene.add(this.xrCustomObjectsScene),this.scene.matrixAutoUpdate=!1,this.loadWorkTask=Promise.resolve(),this.requestProxy=(p=e.requestProxy)==null?DEFAULT_REQUEST_PROXY:p,this.networkSubscribe=new NetworkSubscribe,this.networkSubscribe.on(`network`,(e,t,n,r)=>{var o;this.emit(`network.resource`,createEvent(`network.resource`,{source:e,requestType:t,requestState:n,detail:r})),(o=this.analysis)==null||o.network(this.works,e,t,n,r)}),this.readyCallbacks=[],this.syncingState=!1,this.helperGroup=new three.Group,this.helperGroup.name=`helper`,this.helperGroup.matrixAutoUpdate=!1,this.scene.add(this.helperGroup),worksMap.set(this,emptyWorks),this.modelScene=new ModelScene({fiveId:this.fiveId}),this.modelScene.addEventListener(`model.create`,e=>{this.bindModel(e.model)}),this.scene.add(this.modelScene);let[m]=this.modelScene.setModels(emptyWorks,{forceReplaceImmediately:!0});defineProperty(m,`loaded`,{get(){return!1},set(e){}}),this.videoTexture=new three.VideoTexture(e.videoInstance||generateDefaultVideoElement());let h=initLights();this.scene.add(h),this.state={mode:this.currentMode,workCode:this.pano.workCode,panoIndex:this.pano.panoIndex,longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov,offset:this.camera.pose.offset.clone(),distance:this.camera.pose.distance},this.stateSynced=!1,this.destroyed=!1,this.paused=!0,typeof window<`u`&&(e.play!==!1&&this.play(),this.stopAnimationLoop=AnimationFrameLoop.shared.add((e,t,...n)=>{this.updateTime(e,t,...n)},!1,0,10));let g=()=>{typeof document<`u`&&document.fullscreenElement===null&&this.currentMode===`VRPanorama`&&this.controller.emit(`vr.requestExit`,createEvent(`vr.requestExit`,{}))},_=()=>{this.needsRender=!0};if(typeof document<`u`&&document.addEventListener(`fullscreenchange`,g,!1),this.renderer&&this.renderer.domElement.addEventListener(`webglcontextrestored`,_,!1),this.removeEventListeners=()=>{typeof document<`u`&&document.removeEventListener(`fullscreenchange`,g,!1),this.renderer&&this.renderer.domElement.removeEventListener(`webglcontextrestored`,_,!1)},this.plugins={},e.plugins&&e.plugins.length){for(let t of e.plugins)if(typeof t==`function`)t(this);else if(Array.isArray(t)){let[e,n,r]=t;if(typeof e==`function`){let t=e(this,r);typeof n==`string`&&(this.plugins[n]?this.throwError(Error(`plugin name ${n} is exists.`)):this.plugins[n]=t)}}}initLegacyEvent(this),this.fiveRenderer=new FiveRenderer,this.adaptiveLuminancePass=new AdaptiveLuminancePass,this.adaptiveLuminancePass.enabled=!1,this.fiveRenderer.composer.addPass(this.adaptiveLuminancePass),this.eyeDomeLightingPass=new EyeDomeLightingPass(this.camera),this.eyeDomeLightingPass.enabled=!1,this.fiveRenderer.composer.addPass(this.eyeDomeLightingPass),e.webgl2?(this.pbmGaussianSplattingRenderMesh=new PBMGaussianSplattingRenderMesh,this.scene.add(this.pbmGaussianSplattingRenderMesh)):this.scene.add(new PBMGaussianSplattingTestMesh)}get ident(){return this.fiveId}get panoIndex(){return this.pano.panoIndex}get panoId(){return panoStringify(this.pano)}dispose(){var e;if(this.destroyed===!0)return;delete Five_Instances[this.fiveId],this.emit(`dispose`),this.destroyed=!0,this.pause(),this.stopAnimationLoop&&(this.stopAnimationLoop(),this.stopAnimationLoop=void 0),this.off(),this.networkSubscribe.off(),this.controller&&(this.controller.destroy(),this.controller=void 0);let t=this.getElement();t&&t.parentNode&&t.parentNode.removeChild(t);let n=this.modelScene.parameter;n.pano0&&n.pano0.map.dispose(),n.pano1&&n.pano1.map!==((e=n.pano0)==null?void 0:e.map)&&n.pano1.map.dispose(),n.reset(`pano0`,`pano1`),this.modelScene.dispose(),this.scene.dispose(),this.xrCustomObjectsScene.dispose(),worksMap.set(this,emptyWorks),this.renderer&&this.renderer.render(new three.Scene,new three.Camera),this.fiveRenderer.dispose(),this.renderer instanceof InternalWebGLRenderer&&(this.renderer.forceContextLoss&&this.renderer.forceContextLoss(),this.renderer.dispose())}setViewport(e){Object.assign(this.viewport,e),this.needsRender=!0}get boundingMesh(){return this.modelScene.boundingMesh}get helperVisible(){return this.helperGroup.visible}set helperVisible(e){this.helperGroup.visible!==e&&(this.helperGroup.visible=e,this.emit(`helpers.visible`,createEvent(`helpers.visible`,{object:this.helperGroup})),this.needsRender=!0)}updateConfiguration(e,t=!0){let n=!1,r=!1;e.panorama&&(Object.assign(this.controllerInits.Panorama,omitUndefinedFields(e.panorama)),this.currentMode===`Panorama`&&(n=!0)),e.model&&(Object.assign(this.controllerInits.Model,omitUndefinedFields(e.model)),this.currentMode===`Model`&&(n=!0)),e.floorplan&&(Object.assign(this.controllerInits.Floorplan,omitUndefinedFields(e.floorplan)),this.currentMode===`Floorplan`&&(n=!0)),e.topview&&(Object.assign(this.controllerInits.Topview,omitUndefinedFields(e.topview)),this.currentMode===`Topview`&&(n=!0)),e.mapview&&(Object.assign(this.controllerInits.Mapview,omitUndefinedFields(e.mapview)),this.currentMode===`Mapview`&&(n=!0)),e.vrPanorama&&(Object.assign(this.controllerInits.VRPanorama,omitUndefinedFields(e.vrPanorama)),this.currentMode===`VRPanorama`&&(n=!0)),e.xrPanorama&&(Object.assign(this.controllerInits.XRPanorama,omitUndefinedFields(e.xrPanorama)),this.currentMode===`XRPanorama`&&(n=!0)),e.imageOptions&&(Object.assign(this.imageOptions,e.imageOptions),(this.currentMode===`Panorama`||this.currentMode===`VRPanorama`)&&(r=!0,n=!0)),e.textureOptions&&Object.assign(this.textureOptions,e.textureOptions),t&&n&&this.controller&&this.currentMode&&(!this.controller.updateConfiguration(this.controllerInits[this.currentMode])||r)&&this.changeMode(this.currentMode,this.getCurrentState(),0,!1,!0)}appendTo(e,t={}){if(!this.renderer)return;if(!(this.renderer instanceof InternalWebGLRenderer)){this.throwError(Error(`cannot call appendTo method when render a external renderer`));return}let n=this.getElement();if(!n)return;e.appendChild(n),this.refresh(t);let r=window.getComputedStyle(e).position;r!==`relative`&&r!==`absolute`&&r!==`fixed`&&r!==`sticky`&&(e.style.position=`relative`)}refresh(e={},t){var n,r,o;if(!this.renderer)return;let s=this.renderer.domElement.parentNode,{width:c=(n=s==null?void 0:s.offsetWidth)==null?512:n,height:l=(r=s==null?void 0:s.offsetHeight)==null?512:r}=e;if(c=Math.max(1,c),l=Math.max(1,l),!t){let e=getViewportScale(),n=typeof window<`u`?window.devicePixelRatio:1;if(t=(o=e===1?n:1)==null?1:o,t>1){let e=Math.max(c,l)*t,n=Math.min(this.renderer.capabilities.maxTextureSize,4096);e>n&&(t=Math.max(t/e*n,1),t=Math.floor(t*100)/100)}}this.renderer.setPixelRatio(t),this.renderer.setSize(c,l),this.needsRender=!0;let u=now(),d=u-this.currentUpdateArgs.time,f=this.currentUpdateArgs.args;this.updateTime(u,d,...f)}addExtraElement(e){return this.extraElements.indexOf(e)===-1&&(this.extraElements.push(e),this.controller&&this.controller.bindExtraElement(e)),()=>this.removeExtraElement(e)}removeExtraElement(e){let t=this.extraElements.indexOf(e);t!==-1&&(this.extraElements.splice(t,1),this.controller&&this.controller.unbindExtraElement(e))}getSize(e){if(!this.renderer)throw Error(`renderer is not initialized`);return this.renderer.getSize(e),e.x*=this.viewport.width,e.y*=this.viewport.height,e}getDrawingBufferSize(e){if(!this.renderer)throw Error(`renderer is not initialized`);return this.renderer.getDrawingBufferSize(e),e.x*=this.viewport.width,e.y*=this.viewport.height,e}updateCamera(e,t,n=!0){if(!this.controller)throw Error(`controller is not initialized.`);return this.controller.updateCamera(e,t,n)}updateCameraWithKeyframes(e,t,n=!0){if(!this.controller)throw Error(`controller is not initialized.`);return this.controller.updateCameraWithKeyframes(e,t,n)}get works(){return worksMap.get(this)||emptyWorks}get work(){return this.works[0]}get observers(){return this.work.observers}get models(){return this.modelScene.models}get model(){return this.modelScene.models[0]}load(e,t,n,r=!0){if(!this.renderer)throw Error(`renderer is not initialized`);let o=this.loadWorkTask.then(()=>isPromise(e)?e.then(e=>this.load_(e,t,n,r)):this.load_(e,t,n,r));return this.loadWorkTask=o.catch(e=>{this.throwError(e)}),o}load_(t,n,r,o=!0){var s,c,l,u,d,f,p,m,h,g;let _={};typeof r==`number`?_.duration=r:typeof r==`object`&&Object.assign(_,r),this.works===emptyWorks&&(_.duration===void 0&&(_.duration=0),_.effect===void 0&&(_.effect=`instant`));let v={};Object.assign(v,_.model),!v[`3d-tiles`]&&_[`3d-tiles`]&&(v[`3d-tiles`]=_[`3d-tiles`]),!v.textureOptions&&_.textureOptions&&(v.textureOptions=_.textureOptions),!v.textureOptions&&this.textureOptions&&(v.textureOptions=this.textureOptions);let y=[];if(Array.isArray(t))for(let e of t)e instanceof Work?y.push(e):typeof e!=`string`&&`work`in e?y.push(parseWork(e.work,e)):y.push(parseWork(e));else t instanceof Work?y.push(t):y.push(parseWork(t));_.mode===`add`&&(y=[].concat(this.works,y));let b;try{b=createWorks(y)}catch(e){return this.throwError(e),Promise.reject(e)}for(let e of b)this.bindWorkFetcher(e);n===void 0&&(n=`inherit`),n===`inherit`&&this.works===emptyWorks&&(n=`initial`);let S=this.currentMode,C=b.initial,w=C.work.observers[0],T=w?{workCode:w.work.workCode,panoIndex:w.panoIndex}:{workCode:C.work.workCode,panoIndex:0},E=(s=C.mode)==null?w?`Panorama`:`Mapview`:s,D={};if(n===`inherit`){let e=this.getCurrentState(),[t]=b.filter(t=>t.workCode===e.workCode);if(t)T={workCode:e.workCode,panoIndex:e.panoIndex},E=e.mode,D={longitude:e.latitude,latitude:e.latitude,fov:e.fov,distance:e.distance,offset:e.offset.clone()};else{n={mode:S};let e=(l=(c=b[0])==null?void 0:c.observers)==null?void 0:l[this.panoIndex];e?(n.workCode=e.work.workCode,n.panoIndex=e.panoIndex):typeof b.initial.panoIndex==`number`?(n.workCode=b.initial.work.workCode,n.panoIndex=b.initial.panoIndex):(n.mode===`Panorama`||n.mode===`VRPanorama`||n.mode===`XRPanorama`)&&(n.mode=`Mapview`),n.mode===S&&(n.longitude=this.camera.pose.longitude,n.latitude=this.camera.pose.latitude,n.fov=this.camera.pose.fov)}}if(n===`initial`&&(typeof C.panoIndex==`number`&&(T={workCode:C.work.workCode,panoIndex:C.panoIndex}),C.mode&&(E=C.mode),D={longitude:C.longitude,latitude:C.latitude,fov:C.fov,distance:C.distance,offset:(u=C.offset)==null?void 0:u.clone()}),typeof n==`object`){if(E=(d=n.mode)==null?S:d,typeof n.panoIndex==`number`){let e=b.getObserver({workCode:(p=(f=n.workCode)==null?C.work.workCode:f)==null?``:p,panoIndex:n.panoIndex});e&&(T={workCode:e.work.workCode,panoIndex:e.panoIndex})}D={longitude:n.longitude,latitude:n.latitude,fov:n.fov,distance:n.distance,offset:n.offset?new three.Vector3().copy(n.offset):void 0}}let O=(m=_.duration)==null?this.modeChangeDuration:m;(E===`Floorplan`||E===`Topview`||E===`Mapview`)&&S===E&&(O=0);let k=`fly`;(E===`Panorama`||E===`VRPanorama`||E===`XRPanorama`)&&S===E&&(k=(h=_.effect)==null?`fade`:h),this.emit(`works.request`,createEvent(`works.request`,{input:t,works:b,userAction:o}));let A=(e,t,r)=>{let s=this.getCurrentState(),c=Object.assign(Object.assign({mode:e},t),r);n===`inherit`&&(c=this.getCurrentState()),this.pano=t;let l=Object.assign(Object.assign({initial:{state:c,currentState:s,duration:O,effect:k,userAction:o}},this.commonParams()),this.controllerInits[e]),u=Controllers[c.mode].initAnimationEndState(l);if(this.controller&&S===e)this.controller.updateWork(b,u,{effect:k,duration:O},o)===!1&&(this.controller.destroy(),this.controller=this.applyController(e,l));else{if(this.controller)this.controller.destroy();else{let t=Controllers[e].initAnimationEndState(l);this.camera.setFromPose(t),this.emit(`camera.update`,createEvent(`camera.update`,{state:this.getCurrentState(),userAction:o}))}this.controller=this.applyController(e,l);let t=createEvent(`mode.change`,{prevMode:S,mode:e,state:u,userAction:o});try{this.emit(`mode.change`,t)}catch(e){console.error(e)}}this.updateTime(this.currentUpdateArgs.time,0,...this.currentUpdateArgs.args)};worksMap.set(this,b);let j=Promise.resolve();if(E===e.Mode.Floorplan||E===e.Mode.Topview||E===e.Mode.Mapview||E===e.Mode.Model){this.modelScene.loaded===!1&&(this.camera.setFromPose(D),assignPose(this.state,this.camera.pose));let e=this.modelScene.setModels(b,v);j=Promise.all(e.map(e=>e.loadedReady)).then(()=>{this.needsRender=!0,A(E,T,D),this.emit(`camera.update`,createEvent(`camera.update`,{state:this.getCurrentState(),userAction:o}))})}else{A(E,T,D);let e=this.controller,t=!1;this.modelScene.autoRefine=!1;let n=()=>{this.works===b&&t===!1&&(this.needsRender=!0,this.emit(`camera.update`,createEvent(`camera.update`,{state:this.getCurrentState(),userAction:o})),t=!0,this.modelScene.autoRefine=!0),e.off(`pano.arrived`,n),e.off(`pano.cancel`,n)},r=this.modelScene.setModels(b,v);j=Promise.all(r.map(e=>e.initReady)).then(noop),e.once(`pano.arrived`,n),e.once(`pano.cancel`,n),setTimeout(n,((g=_.duration)==null?this.modeChangeDuration:g)+1e3)}return this.emit(`works.load`,createEvent(`works.load`,{input:t,userAction:o,works:b})),j.then(()=>this.ready()).then(()=>{var e;this.emit(`works.ready`,createEvent(`works.ready`,{input:t,userAction:o,works:b})),(e=this.analysis)==null||e.work(b)})}reset(){let e=this.loadWorkTask.then(()=>this.reset_());return this.loadWorkTask=e.catch(e=>{this.throwError(e)}),e}reset_(){return new Promise(e=>{var t;this.controller&&(this.controller.destroy(),this.controller=void 0);let n=this.modelScene.parameter;n.pano0&&n.pano0.map.dispose(),n.pano1&&n.pano1.map!==((t=n.pano0)==null?void 0:t.map)&&n.pano1.map.dispose(),n.set({pano0:null,pano1:null,modelAlpha:1}),worksMap.set(this,emptyWorks),this.modelScene.setModels(emptyWorks,{forceReplaceImmediately:!0}),this.renderer&&this.modelScene.update(this.renderer,this.camera),this.needsRender=!0,this.currentMode=`Panorama`,this.pano={workCode:``,panoIndex:0},this.camera.setFromPose({distance:0,fov:DEFAULT_CAMERA_FOV,longitude:0,latitude:0,offset:new three.Vector3(0,0,0)}),this.state={mode:this.currentMode,workCode:this.pano.workCode,panoIndex:this.pano.panoIndex,longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov,offset:this.camera.pose.offset.clone(),distance:this.camera.pose.distance},this.camera.needsRender=!1,this.needsRender=!1,e()})}changeMode(t,n={},r,o=!0,s=!1){return new Promise((c,l)=>{var u,d,f,p;if(!this.renderer)throw Error(`renderer is not initialized.`);n=Object.assign({},n);let m=0;this.controller&&(m=typeof r==`number`?r:(u=r==null?void 0:r.duration)==null?this.modeChangeDuration:u);let h=`fly`;this.controller&&typeof r==`object`&&r.effect&&(h=r.effect);let g=typeof n.panoIndex==`number`?{workCode:(p=(d=n.workCode)==null?(f=this.work)==null?void 0:f.workCode:d)==null?``:p,panoIndex:n.panoIndex}:this.pano;if(!e.Mode.hasOwnProperty(t)){let e=Error(`mode "${t}" is not existed`);this.throwError(e),l(e);return}if((t===e.Mode.Panorama||t===e.Mode.VRPanorama||t===e.Mode.XRPanorama)&&!this.works.getObserver(g)){let e=Error(`PanoId ${panoStringify(g)} not existed.`);this.throwError(e),l(e);return}(t===e.Mode.Floorplan||t===e.Mode.Topview||t===e.Mode.Mapview||t===e.Mode.Model)&&this.modelScene.empty&&(m=0);let _=this.controller,v=this.currentMode,y=()=>{if(this.controller&&this.controller.stopMomentumMovement(),this.controller&&s===!1&&v===t)t===e.Mode.Panorama||t===e.Mode.Model||t===e.Mode.VRPanorama||t===e.Mode.XRPanorama?!panoEqual(this.pano,g)&&`moveToPano`in this.controller&&typeof this.controller.moveToPano==`function`?this.controller.moveToPano(g,Object.assign({duration:m},n),o):this.controller.updateCamera(n,m,o).catch(noop):(panoEqual(this.pano,g)||(this.pano=g),this.controller.updateCamera(n,m,o).catch(noop));else{let e=Object.assign(Object.assign({},n),g),r=Object.assign(Object.assign({initial:{state:e,currentState:this.getCurrentState(),duration:m,effect:h,userAction:o}},this.commonParams()),this.controllerInits[t]),s=Controllers[t].initAnimationEndState(r),c=createEvent(`mode.change.request`,{prevMode:this.currentMode,mode:t,state:s,userAction:o});if(this.emit(`mode.change.request`,c),!c.defaultPrevented){_&&_.destroy(),this.controller=this.applyController(t,r);let e=createEvent(`mode.change`,{prevMode:this.currentMode,mode:t,state:s,userAction:o});this.emit(`mode.change`,e)}}c()},b=AnimationFrameLoop.shared.getContext();b&&(typeof XRSession<`u`&&b instanceof XRSession&&b.end(),AnimationFrameLoop.shared.setContext(null)),t===e.Mode.VRPanorama?(this.requestFullscreen(),requestDeviceOrientationPermission().then(()=>y()).catch(e=>{let t=e instanceof Error?e:Error(String(e));this.exitFullscreen(),this.throwError(t),l(t)})):t===e.Mode.XRPanorama?requestXRSessionPermission().then(e=>{AnimationFrameLoop.shared.setContext(e),s=!0,y()}).catch(e=>{let t=e instanceof Error?e:Error(String(e));this.throwError(t),l(t)}):y()})}getPixels(e,t,n,r,o,s,c){if(!this.renderer)throw Error(`renderer is not initialized.`);let l=now(),u=this.renderer.getPixelRatio(),d=this.renderer.getRenderTarget(),f=this.getSize(new three.Vector2),p=0,m=0,h=1,g=1,_,v,y,b,S;typeof e==`number`?(p=e,typeof t==`number`&&(m=t),typeof n==`number`&&(h=n),typeof r==`number`&&(g=r),_=o,v=s,S=c):(p=e.x,m=e.y,h=e.width,g=e.height,_=e.pixelRatio,v=e.flipY,y=e.helperVisible,b=e.skipPanorama,S=e.buffer),p=Math.floor(p),m=Math.floor(m),h=Math.floor(h),g=Math.floor(g),_=Math.floor(_==null?u:_),v=v==null?!1:v;let C=this.helperVisible,w=this.modelScene.parameter.modelAlpha;this.helperVisible=y==null?this.helperVisible:y,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);let T=this.getPixelsRenderTarget;T.setSize(h*_,g*_),this.renderer.setRenderTarget(T),this.camera.pixelRatio=_,this.camera.resolution.set(h,g),this.camera.setViewOffset(f.width,f.height,p,f.height-m-g,h,g),this.camera.aspect=f.width/f.height,this.camera.updateTime(l),this.scene.update(this.renderer,this.camera);let E=this.renderer.autoClear,D=this.renderer.autoClearColor,O=this.renderer.autoClearDepth,k=this.renderer.autoClearStencil,A=scratchClearColor.copy(this.renderer.getClearColor()),j=this.renderer.getClearAlpha(),M=this.renderer.getScissorTest();this.renderer.autoClear=!0,this.renderer.autoClearColor=!0,this.renderer.autoClearDepth=!0,this.renderer.autoClearStencil=!0,this.renderer.setScissorTest(!1);let N=this.scene.background;this.scene.background=this.camera.isOrthographicCamera?null:N,this.renderer.render(this.scene,this.camera),this.scene.background=N,this.renderer.autoClear=E,this.renderer.autoClearColor=D,this.renderer.autoClearDepth=O,this.renderer.autoClearStencil=k,this.renderer.setClearColor(A,j),this.renderer.setScissorTest(M),this.helperVisible=C,w===void 0?this.modelScene.parameter.reset(`modelAlpha`):this.modelScene.parameter.set(`modelAlpha`,w),this.renderer.setRenderTarget(d),this.camera.clearViewOffset(),this.camera.pixelRatio=u,this.camera.resolution.copy(f),this.camera.aspect=this.camera.resolution.width/this.camera.resolution.height,this.camera.updateTime(l),this.modelScene.update(this.renderer,this.camera),this.scene.update(this.renderer,this.camera);let P=h*_,F=g*_,I=P*F,L=I*4;if(S){if(S.length!==L)throw Error(`buffer length is not equals pixels ${L}`)}else S=new Uint8Array(L);if(this.renderer.readRenderTargetPixels(T,0,0,h*_,g*_,S),v){let e=I/2;for(let t=0,n=0,r=0,o=0;n<e;n++)for(o=(F-Math.floor(n/P)-1)*P+n%P,r=0;r<4;r++)t=S[n*4+r],S[n*4+r]=S[o*4+r],S[o*4+r]=t}return S}getElement(){var e;return(e=this.renderer)==null?void 0:e.domElement}render(e){let t=this.renderer;if(!t)return;let n=t.getRenderTarget();t.setRenderTarget(null);let r=t.autoClear,o=t.autoClearColor,s=t.autoClearDepth,c=t.autoClearStencil,l=scratchClearColor.copy(t.getClearColor()),u=t.getClearAlpha(),d=t.getViewport(scratchViewport),f=t.getScissor(scratchScissor),p=t.getScissorTest();t.autoClear=!0,t.autoClearColor=!0,t.autoClearDepth=!0,t.autoClearStencil=!0;let m=t.getSize(scratchRenderSize),h=Math.floor(m.x*this.viewport.left),g=Math.floor(m.y*this.viewport.bottom),_=Math.floor(m.x*this.viewport.width),v=Math.floor(m.y*this.viewport.height);t.setClearColor(this.backgroundColor,this.backgroundAlpha),t.setViewport(h,g,_,v),t.setScissor(h,g,_,v);let y=this.viewport.bottom!==0||this.viewport.left!==0||this.viewport.width!==1||this.viewport.height!==1;t.setScissorTest(y);let b=this.scene.background;this.scene.background=this.camera.isOrthographicCamera?null:b;let S=!0;if(this.controller&&this.controller.render()&&(S=!1),S){let e=this.fiveRenderer.render(t,this.scene,this.modelScene,this.camera,this.needsRender);this.poweredByRealsee&&e&&renderPoweredByRealsee(t)}this.scene.background=b,t.autoClear=r,t.autoClearColor=o,t.autoClearDepth=s,t.autoClearStencil=c,t.setClearColor(l,u),t.setViewport(d),t.setScissor(f),t.setScissorTest(p),t.setRenderTarget(n),e&&AnimationFrameLoop.shared.add(e,!0)}updateTime(e,t,...n){if(this.currentUpdateArgs={time:e,args:n},this.destroyed)return;if(this.renderer&&ktx2.detectSupport(this.renderer),this.syncingState=this.syncState(e,t),this.controller&&this.controller.updateTime(e,t,...n),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.controllerMode=this.currentMode,this.camera.updateTime(e),this.renderer){let e=this.modelScene.loaded,t=this.modelScene.refined;this.modelScene.update(this.renderer,this.camera),e===!1&&this.modelScene.loaded===!0&&(this.controller&&this.controller.updateModel(this.modelScene),AnimationFrameLoop.shared.add(()=>{this.emit(`models.load`,createEvent(`models.load`,{modelScene:this.modelScene}))},!0,0,10)),t===!1&&this.modelScene.refined===!0&&AnimationFrameLoop.shared.add(()=>{this.emit(`models.refined`,createEvent(`models.refined`,{modelScene:this.modelScene}))},!0,0,10)}if(this.camera.autoNearFar){scratchBox3.makeEmpty(),scratchBox3.expandByObject(this.modelScene.boundingMesh);let t=scratchBox3.getBoundingSphere(scratchSphere),n=t.radius*2;t.containsPoint(this.camera.position)||(n=this.camera.position.distanceTo(t.center)+t.radius),n=clamp$1(n,800);let r=n/1e4;r=clamp$1(r,.03,.1),this.camera.near!==r&&(this.camera.near=r),this.camera.far!==n&&(this.camera.far=n),this.camera.updateTime(e)}if(this.renderer){let e=this.modelScene.visible;this.modelScene.visible=!1,this.scene.update(this.renderer,this.camera),this.modelScene.visible=e}if(this.syncingState=!1,this.controller&&this.controller.needsRender===!0&&(this.controller.needsRender=!1,this.needsRender=!0),this.camera.needsRender===!0&&(this.camera.needsRender=!1,this.needsRender=!0),this.modelScene.needsRender===!0&&(this.modelScene.needsRender=!1,this.needsRender=!0),this.scene.needsRender===!0&&(this.scene.needsRender=!1,this.needsRender=!0),this.pbmGaussianSplattingRenderMesh&&this.pbmGaussianSplattingRenderMesh.needsRender===!0&&(this.pbmGaussianSplattingRenderMesh.needsRender=!1,this.needsRender=!0),this.onlyRenderIfNeeds!==!0&&(this.needsRender=!0),this.paused===!0)return;let r=createEvent(`render.prepare`,{needsRender:this.needsRender});this.emit(`render.prepare`,r),r.defaultPrevented&&(this.needsRender=!1);let o=this.needsRender;this.render(),this.needsRender=!1,this.emit(`render`,createEvent(`render`,{needsRender:o})),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))}pause(){this.paused=!0,this.renderer&&this.renderer instanceof InternalWebGLRenderer&&this.renderer.clear(!0,!0,!0)}play(){this.needsRender=!0,this.paused=!1}moveToPano(t,n={},r=!0){let{controller:o,renderer:s}=this;if(!o)return this.throwError(Error(`controller is not initialized.`)),Promise.resolve();if(!s)return this.throwError(Error(`renderer is not initialized.`)),Promise.resolve();typeof t==`number`&&this.pano.workCode&&(t={workCode:this.pano.workCode,panoIndex:t});let c=this.works.getObserver(t);if(!c)return this.throwError(Error(`pano ${JSON.stringify(t)} not existed.`)),Promise.resolve();let l={workCode:c.work.workCode,panoIndex:c.panoIndex};return`moveToPano`in o&&typeof o.moveToPano==`function`?o.moveToPano(l,n,r):c&&(this.pano=l,this.once(`initAnimation.start`,e=>{n.moveStartCallback&&n.moveStartCallback(e.state)}),this.once(`initAnimation.end`,e=>{n.moveEndCallback&&n.moveEndCallback(e.state)}),this.changeMode(e.Mode.Panorama,n,{effect:n.effect},r)),this.ready()}preloadPano(e,t=noop){let n=this.works.getObserver(e);if(!n)return Promise.reject(Error(`Pano ${JSON.stringify(e)} never found`));let r=[`right`,`left`,`up`,`down`,`front`,`back`],o=now();return Promise.all(r.map(e=>{let t=panoStringify({panoIndex:n.panoIndex,workCode:n.work.workCode}),r=Object.assign({key:`pano.${t}.${e}`},pick(this.imageOptions,[`size`,`format`,`quality`,`forceUseExifOrientation`,`mappings`])),o=n.work.getURL(n.images[e]),s=this.imageOptions.transform?this.imageOptions.transform(o,r):imageURL(o,r);return getFetcher(this.fiveId,n.work).preload(s)})).then(()=>{let e=now()-o;return t(e),e})}project2d(e,t=!1){if(!this.renderer)return null;if(t){let t=this.camera.position,n=e.clone().sub(t),r=new three.Raycaster(t,n.clone().normalize());r.params.Points={threshold:.1};let[o]=this.modelScene.intersectRaycaster(r);if(o&&o.distance+.01<n.length())return null}let n=e.clone().project(this.camera);if(Math.abs(n.z)>1)return null;let r=this.renderer.getSize(new three.Vector2),o=r.x*this.viewport.width,s=r.y*this.viewport.height,c=r.x*this.viewport.left+(n.x+1)/2*o,l=r.y*(1-this.viewport.bottom-this.viewport.height)+(-n.y+1)/2*s;return new three.Vector2(c,l)}getCurrentState(){return Object.assign(Object.assign({},this.camera.copyPose()),{mode:this.currentMode,workCode:this.pano.workCode,panoIndex:this.pano.panoIndex})}setState(e,t=!1,n=!0){var r,o,s,c,l,u,d,f,p,m;e=pick(e,[`mode`,`workCode`,`panoIndex`,`longitude`,`latitude`,`fov`,`offset`,`distance`]),e.offset&&!(e instanceof three.Vector3)&&(e.offset=new three.Vector3(e.offset.x,e.offset.y,e.offset.z));let h;if(typeof e.panoIndex==`number`)if(e.workCode)h={workCode:e.workCode,panoIndex:e.panoIndex};else{let t=(o=(r=this.work)==null?void 0:r.workCode)==null?``:o,n=this.state.workCode;this.works.filter(e=>e.workCode===n).length>0&&(t=n),h={workCode:t,panoIndex:e.panoIndex}}let g=(s=e.mode)==null?this.state.mode:s,_,v,y,b,S;if(this.controller&&this.controller.stopMomentumMovement(),this.state.mode!==g){if(g===`VRPanorama`){this.changeMode(`VRPanorama`,void 0,void 0,!0);return}let t={workCode:h==null?void 0:h.workCode,panoIndex:h==null?void 0:h.panoIndex};typeof e.longitude==`number`&&(t.longitude=e.longitude),typeof e.latitude==`number`&&(t.latitude=e.latitude),typeof e.fov==`number`&&(t.fov=e.fov),typeof e.distance==`number`&&(t.distance=e.distance),e.offset instanceof three.Vector3&&(t.offset=e.offset);let n=Object.assign(Object.assign({initial:{state:t,currentState:this.getCurrentState(),duration:this.modeChangeDuration,effect:`fly`,userAction:!1}},this.commonParams()),this.controllerInits[g]),r=Controllers[g].initAnimationEndState(n);_=r.longitude,v=r.latitude,y=r.fov,b=r.offset,S=r.distance}else _=(c=e.longitude)==null?this.state.longitude:c,v=(l=e.latitude)==null?this.state.latitude:l,y=(u=e.fov)==null?this.state.fov:u,b=(d=e.offset)==null?this.state.offset:d,S=(f=e.distance)==null?this.state.distance:f;let C={workCode:(h==null?this.pano:h).workCode,panoIndex:(h==null?this.pano:h).panoIndex,mode:g,longitude:_,latitude:v,fov:y,offset:b,distance:S};this.emit(`state.set`,createEvent(`state.set`,{userAction:n,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&&n&&(this.controller.userAction=!1),t&&this.state.mode===C.mode&&(this.syncingState=this.syncState(now(),0,t),this.syncingState&&((p=this.controller)==null||p.updateTime(now(),0),this.syncingState=!1)),this.emit(`state.change`,createEvent(`state.change`,{userAction:n,state:this.state})),(m=this.analysis)==null||m.state(this.works,this.state)))}syncState(t,n,r=!1){let o=this.stateSynced;if(this.stateSynced=!1,!this.controller)return!1;if(this.state.mode!==this.currentMode){let e={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,e,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)){let e={longitude:this.state.longitude,latitude:this.state.latitude,fov:this.state.fov,offset:this.state.offset};return this.controller.moveToPosition(this.state.offset,Object.assign(Object.assign({},e),{duration:r?0:void 0}),!1),!0}}else{let e={workCode:this.state.workCode,panoIndex:this.state.panoIndex};if(!panoEqual(e,this.pano)&&`moveToPano`in this.controller&&typeof this.controller.moveToPano==`function`){let t={longitude:this.state.longitude,latitude:this.state.latitude,fov:this.state.fov,offset:this.state.offset,distance:this.state.distance};return this.controller.moveToPano(e,t,!1),!0}}if(this.controller instanceof Controllers.Floorplan||this.controller instanceof Controllers.Topview||this.controller instanceof Controllers.Mapview){let e=1,t=.2,n=.2,o=Math.PI/45,s=r?this.state.fov:stepNumber(this.camera.pose.fov,this.state.fov,1),c=Math.abs(this.camera.pose.distance-this.state.distance),l=c>n*15?c/15:.2,u=r?this.state.distance:stepNumber(this.camera.pose.distance,this.state.distance,l),d=this.camera.pose.offset.distanceTo(this.state.offset),f=d>n*15?d/15:n,p=r?new three.Vector3().copy(this.state.offset):stepVector(this.camera.pose.offset,this.state.offset,f),{longitude:m,latitude:h}=r?{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},o);if(notSimilarValue(s,this.camera.pose.fov)||notSimilarVector3(p,this.camera.pose.offset)||notSimilarValue(u,this.camera.pose.distance)||notSimilarValue(m,this.camera.pose.longitude,Math.PI*2)||notSimilarValue(h,this.camera.pose.latitude)){let e={x:p.x,y:p.y,z:p.z},t={fov:s};return Object.assign(e,{distance:u}),Object.assign(t,{longitude:m,latitude:h}),this.controller.stopMomentumMovement(),this.controller.cameraMotion.set(t,0).catch(noop),this.controller.locationMotion.set(e,0).catch(noop),!0}}else{let e=1,t=Math.PI/45,n=r?this.state.fov:stepNumber(this.camera.pose.fov,this.state.fov,1),{longitude:o,latitude:s}=r?{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},t),c=this.state.distance,l=new three.Vector3().copy(this.state.offset);if(notSimilarValue(c,this.camera.pose.distance)&&(this.state.distance=this.camera.pose.distance),notSimilarVector3(l,this.camera.pose.offset)&&(this.state.offset=this.camera.pose.offset.clone()),notSimilarValue(o,this.camera.pose.longitude,Math.PI*2)||notSimilarValue(s,this.camera.pose.latitude)||notSimilarValue(n,this.camera.pose.fov))return this.controller.stopMomentumMovement(),this.controller.cameraMotion.set({longitude:o,latitude:s,fov:n},0).catch(noop),!0}if(this.stateSynced=!0,o===!1&&this.emit(`state.synced`,createEvent(`state.synced`,{userAction:!1,state:this.state})),this.readyCallbacks.length&&this.stateSynced){let t=this.currentMode;if(!(t===e.Mode.Floorplan||t===e.Mode.Topview||t===e.Mode.Mapview||t===e.Mode.Model)||this.modelScene.loaded){let e=this.readyCallbacks.slice();this.readyCallbacks.length=0;for(let t of e)this.controller instanceof Controllers.Panorama&&t.tile===!0&&!this.controller.isTileReady()?this.readyCallbacks.push(t):t()}}return!1}ready(e={}){return new Promise(t=>{var n;this.readyCallbacks.push(Object.assign(t,{tile:(n=e.tile)==null?!1:n}))}).then(()=>this.model.initReady).then(noop)}requestFullscreen(){var e;if(!isMobile)return;let t=(e=this.getElement())==null?void 0:e.parentNode;t&&`requestFullscreen`in t&&typeof document<`u`&&document.fullscreenElement===null&&t.requestFullscreen()}exitFullscreen(){typeof document<`u`&&document.fullscreenElement&&`exitFullscreen`in document&&document.exitFullscreen()}throwError(e){this.hasListener(`error`)?this.emit(`error`,e):console.error(e)}bindModel(e){let t=()=>{AnimationFrameLoop.shared.add(()=>{this.emit(`model.load`,createEvent(`model.load`,{work:e.work,model:e,error:null}))},!0)},n=t=>{let{error:n}=t;this.emit(`model.error`,createEvent(`model.error`,{work:e.work,model:e,error:n})),this.throwError(n)},r=()=>{this.emit(`model.changeShownFloor`,createEvent(`model.changeShownFloor`,{work:e.work,model:e,error:null}))},o=t=>{this.emit(`models.tileLoad`,createEvent(`model.tileLoad`,{work:e.work,model:e,tile:t.tile}))},s=t=>{this.emit(`models.tileUnload`,createEvent(`model.tileUnload`,{work:e.work,model:e,tile:t.tile}))},c=()=>{e.removeEventListener(`load`,t),e.removeEventListener(`error`,n),e.removeEventListener(`changeShownFloor`,r),e.removeEventListener(`tileLoad`,o),e.removeEventListener(`tileUnload`,s),e.removeEventListener(`dispose`,c)};e.addEventListener(`load`,t),e.addEventListener(`error`,n),e.addEventListener(`changeShownFloor`,r),e.addEventListener(`tileLoad`,o),e.addEventListener(`tileUnload`,s),e.addEventListener(`dispose`,c),this.emit(`model.request`,createEvent(`model.request`,{work:e.work,model:e,error:null}))}bindWorkFetcher(e){let t=this,n=e.workCode,r=e.allowHosts,o=new Fetcher({get networkSubscribe(){return t.networkSubscribe},requestProxy(e){return Promise.resolve(e).then(e=>t.requestProxy(e,n)).then(e=>{let t=verifyURL(e,r);return t instanceof Error?Promise.reject(t):t})}});registerFetcher(this.fiveId,e,o)}commonParams(){return{fiveId:this.fiveId,scene:this.scene,xrCustomObjectsScene:this.xrCustomObjectsScene,helper:this.helperGroup,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}}applyController(t,n){if(!this.renderer)throw Error(`renderer is not initialized.`);let r=Controllers[t];this.currentMode=t;let o=new r(n);for(let e of PROXY_CONTROLLER_EVENT_NAMES)o.on(e,(...t)=>{if(this.emit(e,...t))return!1});{let e=Controllers[t].initAnimationEndState(n),r=n.initial.userAction;stateEqual(this.state,e)||(assignState(this.state,e),this.emit(`state.change`,createEvent(`state.change`,{userAction:r,state:this.state}))),this.emit(`currentState.change`,createEvent(`currentState.change`,{userAction:r,state:this.getCurrentState()}))}return o.on(`camera.update`,e=>{var t;if(this.controller){let n=this.controller.getTargetState();e.userAction&&this.syncingState===!1&&this.state.mode===n.mode&&!stateEqual(this.state,n)&&(assignState(this.state,n),this.emit(`state.change`,createEvent(`state.change`,{userAction:e.userAction,state:this.state})),(t=this.analysis)==null||t.state(this.works,this.state))}this.emit(`currentState.change`,createEvent(`currentState.change`,{userAction:e.userAction,state:this.getCurrentState()}))}),o.on(`initAnimation.start`,e=>{var t;let{state:n,userAction:r}=e;r&&this.state.mode===n.mode&&!stateEqual(this.state,n)&&(assignState(this.state,n),this.emit(`state.change`,createEvent(`state.change`,{userAction:r,state:this.state})),(t=this.analysis)==null||t.state(this.works,this.state))}),o.on(`initAnimation.end`,e=>{var t;let{state:n,userAction:r}=e;this.pano={workCode:n.workCode,panoIndex:n.panoIndex},r&&this.state.mode===n.mode&&!stateEqual(this.state,n)&&(assignState(this.state,n),this.emit(`state.change`,createEvent(`state.change`,{userAction:r,state:this.state})),(t=this.analysis)==null||t.state(this.works,this.state))}),o.on(`pano.moveTo`,e=>{var t;let{state:n,userAction:r}=e;this.pano={workCode:n.workCode,panoIndex:n.panoIndex},r&&this.state.mode===n.mode&&!stateEqual(this.state,n)&&(assignState(this.state,n),this.emit(`state.change`,createEvent(`state.change`,{userAction:r,state:this.state})),(t=this.analysis)==null||t.state(this.works,this.state))}),o.on(`pano.arrived`,e=>{var t;let{state:n,userAction:r}=e;this.pano={workCode:n.workCode,panoIndex:n.panoIndex},r&&this.state.mode===n.mode&&!stateEqual(this.state,n)&&(assignState(this.state,n),this.emit(`state.change`,createEvent(`state.change`,{userAction:r,state:this.state})),(t=this.analysis)==null||t.state(this.works,this.state))}),o.on(`pano.cancel`,e=>{var t;let{state:n,userAction:r}=e;r&&this.state.mode===n.mode&&!stateEqual(this.state,n)&&(assignState(this.state,n),this.emit(`state.change`,createEvent(`state.change`,{userAction:r,state:this.state})),(t=this.analysis)==null||t.state(this.works,this.state))}),o.on(`pano.error`,e=>{var t;let{state:n}=e;this.state.mode===n.mode&&!stateEqual(this.state,n)&&(assignState(this.state,n),(t=this.analysis)==null||t.state(this.works,this.state))}),o.on(`pano.moveTo`,e=>{let{userAction:t}=e;this.emit(`currentState.change`,createEvent(`currentState.change`,{userAction:t,state:this.getCurrentState()}))}),o.on(`pano.request`,e=>{this.emit(`pano.request`,e),e.defaultPrevented||this.moveToPano(e.state,e.options,e.userAction)}),o.on(`vr.requestExit`,()=>{this.currentMode===e.Mode.VRPanorama&&(this.exitFullscreen(),this.changeMode(e.Mode.Panorama))}),o.on(`error`,e=>this.throwError(e)),o}removeEventListeners(){}get internalLightsEnabled(){let e=this.scene.children.find(e=>e.name===`internalLights`);return e?e.visible:!1}set internalLightsEnabled(e){let t=this.scene.children.find(e=>e.name===`internalLights`);t&&(t.visible=e),t=this.modelScene.children.find(e=>e.name===`internalLights`),t&&(t.visible=e)}get scissor(){return this.viewport}setScissor(e){return this.setViewport(e)}getPose(){let{longitude:e,latitude:t,fov:n,offset:r,distance:o}=this.camera.copyPose();return{longitude:e,latitude:t,fov:n,offset:r.clone(),distance:o}}getLongitudeAndLatitude(){let{longitude:e,latitude:t}=this.getPose();return{longitude:e,latitude:t}}getOffset(){return this.getPose().offset}getCameraLocal(){if(this.pano.workCode&&this.controller&&this.works){let e=this.works.getObserver(this.pano);if(e){let t=new three.Object3D;t.matrix.copy(e.matrix).premultiply(e.work.transform),t.matrix.decompose(t.position,t.quaternion,t.scale),t.matrixAutoUpdate=!1;let n=new three.Vector3(0,0,-1);n.applyQuaternion(this.camera.quaternion);let r=t.quaternion.clone().inverse();return n.applyQuaternion(r),{theta:Math.atan2(n.x,-n.z),phi:-Math.asin(n.y),lookAtVector:n}}}return null}addPass(e){this.fiveRenderer.composer.addPass(e)}removePass(e){let t=this.fiveRenderer.composer.passes.indexOf(e);t!==-1&&this.fiveRenderer.composer.passes.splice(t,1)}insertPass(e,t){this.fiveRenderer.composer.insertPass(e,t)}get renderMode(){return this.fiveRenderer.renderMode}set renderMode(e){this.fiveRenderer.renderMode=e}get enableHQ(){return this.fiveRenderer.renderMode===`point-cloud-high-quality`}set enableHQ(e){this.fiveRenderer.renderMode=e?`point-cloud-high-quality`:`default`,this.needsRender=!0}get enableEDL(){return this.eyeDomeLightingPass.enabled}set enableEDL(e){this.eyeDomeLightingPass.enabled=e,this.needsRender=!0}get enableAdaptiveLuminance(){return this.adaptiveLuminancePass.enabled}set enableAdaptiveLuminance(e){this.adaptiveLuminancePass.enabled=e,this.needsRender=!0}get enableIOSEDR(){return!1}set enableIOSEDR(e){}get enablePostProcessing(){return!0}set enablePostProcessing(e){}get modelSceneNeedsRender(){return this.modelScene.needsRender}set modelSceneNeedsRender(e){this.modelScene.needsRender=e}};Five.Mode={Panorama:`Panorama`,Model:`Model`,Floorplan:`Floorplan`,Topview:`Topview`,Mapview:`Mapview`,VRPanorama:`VRPanorama`,XRPanorama:`XRPanorama`},typeof window<`u`&&Object.assign(window,{__FIVE_DEBUG__:{THREE:three,constructor:Five,instances:Five_Instances}});var XRButton=class{static createButton(e){let t=document.createElement(`button`);function n(){t.style.display=``,t.style.cursor=`pointer`,t.style.left=`calc(50% - 50px)`,t.style.width=`100px`,t.textContent=`ENTER VR`,t.onmouseenter=function(){t.style.opacity=`1.0`},t.onmouseleave=function(){t.style.opacity=`0.5`},t.onclick=function(){e&&e()}}function r(){t.style.display=``,t.style.cursor=`auto`,t.style.left=`calc(50% - 75px)`,t.style.width=`150px`,t.onmouseenter=null,t.onmouseleave=null,t.onclick=null}function o(){r(),t.textContent=`VR NOT SUPPORTED`}function s(e){e.style.position=`absolute`,e.style.bottom=`20px`,e.style.padding=`12px 6px`,e.style.border=`1px solid #fff`,e.style.borderRadius=`4px`,e.style.background=`rgba(0,0,0,0.1)`,e.style.color=`#fff`,e.style.font=`normal 13px sans-serif`,e.style.textAlign=`center`,e.style.opacity=`0.5`,e.style.outline=`none`,e.style.zIndex=`999`}if(`xr`in navigator)return t.id=`VRButton`,t.style.display=`none`,s(t),navigator.xr.isSessionSupported(`immersive-vr`).then(function(e){e?n():o()}),t;{let e=document.createElement(`a`);return window.isSecureContext===!1?(e.href=document.location.href.replace(/^http:/,`https:`),e.innerHTML=`WEBXR NEEDS HTTPS`):(e.href=`https://immersiveweb.dev/`,e.innerHTML=`WEBXR NOT AVAILABLE`),e.style.left=`calc(50% - 90px)`,e.style.width=`180px`,e.style.textDecoration=`none`,s(e),e}}};exports.AdaptiveLuminancePass=AdaptiveLuminancePass,exports.AnimationFrameLoop=AnimationFrameLoop,exports.BoundingMesh=BoundingMesh,exports.Camera=Camera,exports.CustomShader=PBMCustomShader,exports.PBMCustomShader=PBMCustomShader,exports.EffectComposer=EffectComposer,exports.EyeDomeLightingPass=EyeDomeLightingPass,exports.Fetcher=Fetcher,exports.Five=Five,exports.FivePass=FivePass,exports.FiveRenderer=FiveRenderer,exports.FlowingLight2DPass=FlowingLight2DPass,exports.FlowingLight3DPass=FlowingLight3DPass,exports.FullScreenQuad=FullScreenQuad,exports.GaussianBlurPass=GaussianBlurPass,exports.Histogram=Histogram,exports.InternalWebGLRenderer=InternalWebGLRenderer,exports.Model=Model,exports.ModelScene=ModelScene,exports.Motion=Motion,exports.NetworkSubscribe=NetworkSubscribe,exports.PBMContainer=PBMContainer,exports.PBMGSObject=PBMGaussianSplattingObject,exports.PBMGroup=PBMGroup,exports.PBMMesh=PBMMesh,exports.PBMMeshMaterial=PBMMeshMaterial,exports.PBMPanoFilter=PBMPanoFilter,exports.PBMPointCloud=PBMPointCloud,exports.PBMPointCloudMaterial=PBMPointCloudMaterial,exports.PBMSkinnedMesh=PBMSkinnedMesh,exports.PBMUpdateable=PBMUpdateable,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.Tile3D=Tile3D,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.loadSplat=loadSplat,exports.loadSpz=loadSpz,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});
|
|
2807
|
+
----<<-计算从-}yn-中心到当前片段的平方距离----<<-由于-]|vv|{-已经按-\05E6-缩放,平方结果会被缩放-E-倍----<<-如果平方结果大于-E,说明在椭圆外,距离均值超过-\05E6-个标准差----sy|n-N-J-q|5]|vv|{9-]|vv|{6H----vs-5N-K-E;=6-qvpnqH--------rp@-p|y|-J-P|y|;toH--------<<-由于渲染的-}yn-按-\05E6-缩放,高斯公式中的逆协方差矩阵部分变成单位矩阵----<<-因此只剩下-5e-:-zrn{6-7-5e-:-zrn{6,而-zrn{-为零,所以是-e-7-e,即-N----sy|n-|}npv\b-J-r\x07}5:=;B-7-N6-7-P|y|;nH--------tylSntP|y|-J-rpA5p|y|;to9-|}npv\b6H\f`),MAX_POOL_SIZE=2,PBMGaussianSplattingRenderMesh=class extends three.Mesh{constructor(){super(),this.renderData=null,this.needsRender=!1,this.sortWorker=null,this.depthIndex=new Uint32Array,this.splatIndexCapacity=0,this.activeSlot=null,this.pendingSlot=null,this.rebuildGeneration=0,this.forceClipperUniformRefresh=!1,this.incrementalUpdateInFlight=!1,this.freeSlotPool=[],this.dataTexture=null,this.positionTexture=null,this.transformsTexture=null,this.transformIndicesTexture=null,this.layerIndicesTexture=null,this.shTexture=null,this.usedSHDegree=0,this.sortDataRebuilding=!1,this.onBeforeRender=(e,t,n)=>{let r=n,o=this.collectObjects(t);if(o.length===0){this.geometry.instanceCount=0;return}let s=0,c=!1;o.forEach(e=>{e.usedSHDegree>s&&(s=e.usedSHDegree),e.initAnimationEnabled&&(c=!0)}),this.setMaxShDegree(s),this.updateInitAnimationDefine(c),this.isSceneNeedsRebuild(o)&&(this.tryStartIncrementalUpdate(o)||(this.startPendingRebuild(o),this.gsSceneState.lastClipperHash=``));let l=o.filter(e=>e.transformChanged);l.length>0&&(this.syncTransformsForSlot(this.activeSlot,l),this.syncTransformsForSlot(this.pendingSlot,l),l.forEach(e=>{e.transformChanged=!1,e.selectedChanged=!1})),this.activeSlot&&this.updateSlotTextures(this.activeSlot),this.pendingSlot&&this.updateSlotTextures(this.pendingSlot);let u=new three.Matrix4().multiplyMatrices(r.perspectiveProjectionMatrix,r.matrixWorldInverse).elements;this.pendingSlot&&this.pendingSlot.renderData.initialBuildComplete&&this.pendingSlot.awaitingFirstSort?this.requestSort(this.pendingSlot,u):this.activeSlot&&this.requestSort(this.activeSlot,u);let d=this.getClipperHash(o);if((this.forceClipperUniformRefresh||d!==this.gsSceneState.lastClipperHash)&&(this.updateClipperUniforms(o),this.gsSceneState.lastClipperHash=d,this.forceClipperUniformRefresh=!1,this.needsRender=!0),this.activeSlot){let e=Math.min(this.usedSHDegree,this.activeSlot.renderData.maxShDegree);this.material.uniforms.u_maxShDegree.value=e,e>0&&!this.activeSlot.textures.shTexture?this.createSHTexture(this.activeSlot):e===0&&this.activeSlot.textures.shTexture&&(this.activeSlot.textures.shTexture.dispose(),this.activeSlot.textures.shTexture=null),this.material.uniforms.u_shTexture.value=this.activeSlot.textures.shTexture,this.renderData=this.activeSlot.renderData}else this.pendingSlot||(this.bindSlotTextures(null),this.material.uniforms.u_maxShDegree.value=0,this.geometry.instanceCount=0);this.material.uniforms.resolution.value.set(r.resolution.x,r.resolution.y)};let e=this.createGeometry(),t=this.createMaterial();this.geometry=e,this.material=t,this.frustumCulled=!1,this.renderOrder=-99999999999,this.gsSceneState={lastObjectsHash:``,lastClipperHash:``},this.sortWorker=new WorkerWrapper,this.sortWorker.postMessage({warmup:!0}),RenderData.warmupWasm(),this.sortWorker.onmessage=e=>{var t;if(e.data.depthIndex){let n=e.data.depthIndex,r=e.data.generation;this.pendingSlot&&r===this.pendingSlot.generation?(this.pendingSlot.awaitingFirstSort=!1,this.swapPendingToActive(n)):this.activeSlot&&r===this.activeSlot.generation&&(this.activeSlot.awaitingFirstSort=!1,this.applyDepthIndex(n));let o=n.buffer;o.byteLength>0&&((t=this.sortWorker)==null||t.postMessage({returnBuffer:o},[o]))}}}ensureSplatIndexCapacity(e){let t=this.geometry.getAttribute(`splatIndex`);if(e<=this.splatIndexCapacity)return t;let n=this.getExpandedCapacity(e),r=t.array,o=new Float32Array(n);o.set(r.subarray(0,Math.min(r.length,n)));let s=new three.InstancedBufferAttribute(o,1,!1,1);return s.setUsage(three.DynamicDrawUsage),this.geometry.setAttribute(`splatIndex`,s),this.splatIndexCapacity=n,this.geometry._maxInstanceCount=n,s}getExpandedCapacity(e){let t=Math.max(this.splatIndexCapacity,1);for(;t<e;)t*=2;return t}createGeometry(){let e=new three.InstancedBufferGeometry,t=new Float32Array([-1,-1,0,1,-1,0,1,1,0,-1,1,0]);e.setAttribute(`position`,new three.BufferAttribute(t,3));let n=new Uint16Array([0,1,2,0,2,3]);e.setIndex(new three.BufferAttribute(n,1)),this.splatIndexCapacity=1;let r=new Float32Array(this.splatIndexCapacity);for(let e=0;e<r.length;e++)r[e]=e;let o=new three.InstancedBufferAttribute(r,1,!1,1);return o.setUsage(three.DynamicDrawUsage),e.setAttribute(`splatIndex`,o),e._maxInstanceCount=this.splatIndexCapacity,e.instanceCount=0,e}createMaterial(){return new three.ShaderMaterial({vertexShader:vertex_default,fragmentShader:fragment_default,defines:{NUM_GS_LAYERS:0,NUM_GS_CLIPPERS:0,USE_F32_POSITION:1,ENABLE_GS_INIT_ANIMATION:0},uniforms:{u_texture:{value:null},u_positionTexture:{value:null},u_transforms:{value:null},u_transformIndices:{value:null},u_layerIndices:{value:null},u_numGsLayers:{value:0},u_numGsClippers:{value:0},u_layerClipperRanges:{value:[]},u_clipperMatricesInverse:{value:[]},u_shTexture:{value:null},u_shTextureSize:{value:new three.Vector2},u_maxShDegree:{value:0},resolution:{value:new three.Vector2},u_aggregationProgress:{value:0},u_aggregationBoundsMin:{value:new three.Vector3(0,0,0)},u_aggregationBoundsMax:{value:new three.Vector3(0,0,0)},u_aggregationPointDuration:{value:.6}},side:three.DoubleSide,transparent:!0,blending:three.NormalBlending,depthTest:!0,depthWrite:!1})}createDefaultLayerClipperRanges(e){return Array.from({length:e},()=>new three.Vector2(-1,0))}createDefaultClipperMatrices(e){return Array.from({length:e},()=>new three.Matrix4)}createTextures(e,t){var n;let r;t&&t.dataTexture.image.width===e.width&&t.dataTexture.image.height===e.height?(r=t.dataTexture,r.image.data=e.data,r.needsUpdate=!0):(t&&t.dataTexture.dispose(),r=new three.DataTexture(e.data,e.width,e.height,three.RGBAIntegerFormat,three.UnsignedIntType),r.internalFormat=`RGBA32UI`,r.minFilter=three.NearestFilter,r.magFilter=three.NearestFilter,r.needsUpdate=!0);let o;t&&t.positionTexture.image.width===e.width&&t.positionTexture.image.height===e.height?(o=t.positionTexture,o.image.data=e.positionData,o.needsUpdate=!0):(t&&t.positionTexture.dispose(),o=new three.DataTexture(e.positionData,e.width,e.height,three.RGBFormat,three.FloatType),o.internalFormat=`RGB32F`,o.minFilter=three.NearestFilter,o.magFilter=three.NearestFilter,o.needsUpdate=!0);let s;t&&t.transformsTexture.image.width===e.transformsWidth&&t.transformsTexture.image.height===e.transformsHeight?(s=t.transformsTexture,s.image.data=e.transforms,s.needsUpdate=!0):(t&&t.transformsTexture.dispose(),s=new three.DataTexture(e.transforms,e.transformsWidth,e.transformsHeight,three.RGBAFormat,three.FloatType),s.internalFormat=`RGBA32F`,s.minFilter=three.NearestFilter,s.magFilter=three.NearestFilter,s.needsUpdate=!0);let c;t&&t.transformIndicesTexture.image.width===e.transformIndicesWidth&&t.transformIndicesTexture.image.height===e.transformIndicesHeight?(c=t.transformIndicesTexture,c.image.data=e.transformIndices,c.needsUpdate=!0):(t&&t.transformIndicesTexture.dispose(),c=new three.DataTexture(e.transformIndices,e.transformIndicesWidth,e.transformIndicesHeight,three.RedIntegerFormat,three.UnsignedIntType),c.internalFormat=`R32UI`,c.minFilter=three.NearestFilter,c.magFilter=three.NearestFilter,c.needsUpdate=!0);let l;t&&t.layerIndicesTexture.image.width===e.layerIndicesWidth&&t.layerIndicesTexture.image.height===e.layerIndicesHeight?(l=t.layerIndicesTexture,l.image.data=e.layerIndices,l.needsUpdate=!0):(t&&t.layerIndicesTexture.dispose(),l=new three.DataTexture(e.layerIndices,e.layerIndicesWidth,e.layerIndicesHeight,three.RedIntegerFormat,three.UnsignedIntType),l.internalFormat=`R32UI`,l.minFilter=three.NearestFilter,l.magFilter=three.NearestFilter,l.needsUpdate=!0);let u=(n=t==null?void 0:t.shTexture)==null?null:n;return{dataTexture:r,positionTexture:o,transformsTexture:s,transformIndicesTexture:c,layerIndicesTexture:l,shTexture:u}}createSHTexture(e){let{renderData:t,textures:n}=e;if(t.shDataReleased)return;n.shTexture&&(n.shTexture.dispose(),n.shTexture=null);let r=Math.min(this.usedSHDegree,t.maxShDegree),o=0;if(r>=1&&(o+=9),r>=2&&(o+=15),r>=3&&(o+=21),o===0)return;let s=4,c=o;c%4!=0&&(c=Math.ceil(c/4)*4);let l=t.numPoints*c/4,u=2048,d=Math.ceil(l/u),f=new Float32Array(u*d*4);for(let e=0;e<t.numPoints;e++){let n=c/4*e,o=0;if(t.sh1&&r>=1)for(let r=0;r<9;r++){let s=n+Math.floor(o/4),c=o%4,l=s*4+c;f[l]=t.sh1[e*9+r],o++}if(t.sh2&&r>=2)for(let r=0;r<15;r++){let s=n+Math.floor(o/4),c=o%4,l=s*4+c;f[l]=t.sh2[e*15+r],o++}if(t.sh3&&r>=3)for(let r=0;r<21;r++){let s=n+Math.floor(o/4),c=o%4,l=s*4+c;f[l]=t.sh3[e*21+r],o++}}n.shTexture=new three.DataTexture(f,u,d,three.RGBAFormat,three.FloatType),n.shTexture.internalFormat=`RGBA32F`,n.shTexture.minFilter=three.NearestFilter,n.shTexture.magFilter=three.NearestFilter,n.shTexture.needsUpdate=!0,this.material.uniforms.u_shTextureSize.value.set(u,d),this.material.uniforms.u_maxShDegree.value=r,e.renderData.releaseSHData()}setMaxShDegree(e){var t,n;if(e<0||e>2){console.warn(`现在只支持012三种阶数,你输入的是${e}`);return}let r=this.usedSHDegree;this.usedSHDegree=e,r!==e&&((t=this.activeSlot)!=null&&t.textures.shTexture&&(this.activeSlot.textures.shTexture.dispose(),this.activeSlot.textures.shTexture=null),(n=this.pendingSlot)!=null&&n.textures.shTexture&&(this.pendingSlot.textures.shTexture.dispose(),this.pendingSlot.textures.shTexture=null),this.material.uniforms.u_maxShDegree.value=e,e===0?this.material.uniforms.u_shTexture.value=null:this.activeSlot&&this.activeSlot.renderData.maxShDegree>0&&(this.createSHTexture(this.activeSlot),this.material.uniforms.u_shTexture.value=this.activeSlot.textures.shTexture))}bindSlotTextures(e){if(!e){this.dataTexture=null,this.positionTexture=null,this.transformsTexture=null,this.transformIndicesTexture=null,this.layerIndicesTexture=null,this.shTexture=null,this.material.uniforms.u_texture.value=null,this.material.uniforms.u_positionTexture.value=null,this.material.uniforms.u_transforms.value=null,this.material.uniforms.u_transformIndices.value=null,this.material.uniforms.u_layerIndices.value=null,this.material.uniforms.u_shTexture.value=null;return}this.dataTexture=e.textures.dataTexture,this.positionTexture=e.textures.positionTexture,this.transformsTexture=e.textures.transformsTexture,this.transformIndicesTexture=e.textures.transformIndicesTexture,this.layerIndicesTexture=e.textures.layerIndicesTexture,this.shTexture=e.textures.shTexture,this.material.uniforms.u_texture.value=this.dataTexture,this.material.uniforms.u_positionTexture.value=this.positionTexture,this.material.uniforms.u_transforms.value=this.transformsTexture,this.material.uniforms.u_transformIndices.value=this.transformIndicesTexture,this.material.uniforms.u_layerIndices.value=this.layerIndicesTexture,this.material.uniforms.u_shTexture.value=this.shTexture}disposeSlot(e){e&&(e.renderData.dispose(),this.disposeTextures(e.textures))}recycleSlot(e){if(e){if(this.freeSlotPool.length>=MAX_POOL_SIZE){let e=this.freeSlotPool.shift();this.disposeSlot(e)}e.renderData.releaseSortData(),e.renderData.releaseAggregatedData(),e.awaitingFirstSort=!0,e.sortDataUploaded=!1,this.freeSlotPool.push(e)}}disposeTextures(e){e.dataTexture.dispose(),e.positionTexture.dispose(),e.transformsTexture.dispose(),e.transformIndicesTexture.dispose(),e.layerIndicesTexture.dispose(),e.shTexture&&(e.shTexture.dispose(),e.shTexture=null)}applyDepthIndex(e){this.depthIndex=e;let t=this.depthIndex.length,n=this.ensureSplatIndexCapacity(t);n.array.set(this.depthIndex,0),n.count=this.depthIndex.length,n.updateRange.offset=0,n.updateRange.count=t,n.needsUpdate=!0,this.geometry.instanceCount=this.depthIndex.length,this.needsRender=!0}swapPendingToActive(e){if(!this.pendingSlot)return;let t=this.activeSlot;this.activeSlot=this.pendingSlot,this.pendingSlot=null,this.renderData=this.activeSlot.renderData,this.ensureSplatIndexCapacity(this.activeSlot.renderData.numPoints),this.bindSlotTextures(this.activeSlot),this.activeSlot.sortDataUploaded=!0,this.forceClipperUniformRefresh=!0,this.applyDepthIndex(e),t&&this.recycleSlot(t)}createSlot(e){let t={generation:e.generation,renderData:e,textures:this.createTextures(e),awaitingFirstSort:!0,sortDataUploaded:!1};return this.usedSHDegree>0&&e.maxShDegree>0&&this.createSHTexture(t),t}updateSlotTextures(e){e.renderData.dataChanged&&(e.textures.dataTexture.needsUpdate=!0,e.textures.positionTexture.needsUpdate=!0,e.renderData.dataChanged=!1),e.renderData.transformsChanged&&(e.textures.transformsTexture.needsUpdate=!0,e.renderData.indexDataReleased||(e.textures.transformIndicesTexture.needsUpdate=!0),e.renderData.transformsChanged=!1)}postSortData(e){var t;let n=e.renderData.positions,r=new Float32Array(e.renderData.transforms.slice().buffer),o=new Uint32Array(e.renderData.transformIndices.slice().buffer);(t=this.sortWorker)==null||t.postMessage({sortData:{positions:n,transforms:r,transformIndices:o,vertexCount:e.renderData.numPoints,generation:e.generation}},[n.buffer,r.buffer,o.buffer]),e.renderData.releaseSortData(),e.renderData.releaseIndexData(),e.sortDataUploaded=!0}requestSort(e,t){var n;if(e.renderData.initialBuildComplete){if(e.renderData.dataChanged||e.renderData.transformsChanged||!e.sortDataUploaded){if(e.renderData.sortDataReleased){this.sortDataRebuilding||(this.sortDataRebuilding=!0,e.renderData.rebuildSortData().then(()=>{this.sortDataRebuilding=!1,(this.activeSlot===e||this.pendingSlot===e)&&(e.sortDataUploaded=!1,this.needsRender=!0)}));return}this.postSortData(e)}(n=this.sortWorker)==null||n.postMessage({viewProj:t})}}syncTransformsForSlot(e,t){e&&t.forEach(t=>{e.renderData.splatIndices.has(t)&&e.renderData.updateTransform(t)})}collectObjects(e){let t=[];return e.traverse(e=>{e instanceof PBMGaussianSplattingObject&&e.visible&&t.push(e)}),t.sort((e,t)=>{let n=e.uuid+e.gsViewLayerKey,r=t.uuid+t.gsViewLayerKey;return n<r?-1:+(n>r)}),t}isSceneNeedsRebuild(e){let t=e.map(e=>`${e.uuid}:${e.gsViewLayerKey}`).join(`|`),n=t!==this.gsSceneState.lastObjectsHash;return this.gsSceneState.lastObjectsHash=t,n}getClipperHash(e){return e.map(e=>{let t=e.gsClippers.map(e=>{var t;return`${(t=e.floorIndex)==null?-1:t}:${e.clippingBoxMatrix.elements.join(`,`)}`}).join(`;`);return`${e.gsViewLayerKey}:${t}`}).join(`|`)}updateClipperCounts(e,t){let n=Math.max(0,e|0),r=Math.max(0,t|0),o=this.material.defines;(o.NUM_GS_LAYERS!==n||o.NUM_GS_CLIPPERS!==r)&&(o.NUM_GS_LAYERS=n,o.NUM_GS_CLIPPERS=r,this.material.needsUpdate=!0),this.material.uniforms.u_numGsLayers.value=e,this.material.uniforms.u_numGsClippers.value=t}updateInitAnimationDefine(e){let t=this.material.defines,n=+!!e;t.ENABLE_GS_INIT_ANIMATION!==n&&(t.ENABLE_GS_INIT_ANIMATION=n,this.material.needsUpdate=!0,this.needsRender=!0)}updateClipperUniforms(e){var t,n,r,o;let s=(n=(t=this.activeSlot)==null?void 0:t.renderData)==null?null:n;if(!s){this.material.uniforms.u_layerClipperRanges.value=[],this.material.uniforms.u_clipperMatricesInverse.value=[],this.updateClipperCounts(0,0);return}let c=new Map;for(let t of e)c.has(t.gsViewLayerKey)||c.set(t.gsViewLayerKey,t.gsClippers);let l=s.layerKeys.length,u=0;for(let e of s.layerKeys)u+=((r=c.get(e))==null?[]:r).length;let d=this.createDefaultLayerClipperRanges(l),f=this.createDefaultClipperMatrices(u),p=0;for(let e of s.layerKeys){let t=s.layerKeyToIndex.get(e);if(t===void 0)continue;let n=(o=c.get(e))==null?[]:o,r=p,l=0;for(let e of n)f[p].getInverse(e.clippingBoxMatrix),p++,l++;l>0&&d[t].set(r,l)}this.material.uniforms.u_layerClipperRanges.value=d,this.material.uniforms.u_clipperMatricesInverse.value=f,this.updateClipperCounts(l,p)}startPendingRebuild(e){this.pendingSlot&&(this.recycleSlot(this.pendingSlot),this.pendingSlot=null),this.rebuildGeneration+=1;let t=new RenderData(e,this.rebuildGeneration),n=this.freeSlotPool.pop();if(n){n.renderData.dispose();let e=this.createTextures(t,n.textures);this.pendingSlot={generation:t.generation,renderData:t,textures:e,awaitingFirstSort:!0,sortDataUploaded:!1}}else this.pendingSlot=this.createSlot(t)}tryStartIncrementalUpdate(e){if(!this.activeSlot||this.pendingSlot||this.incrementalUpdateInFlight)return!1;let t=this.activeSlot.renderData.getObjectsInOrder();if(!this.activeSlot.renderData.canIncrementalAppend(e))return!1;let n=e.slice(t.length);if(n.length===0)return!1;this.incrementalUpdateInFlight=!0;let r=this.activeSlot;return r.renderData.appendObjects(n).then(e=>{e&&(this.activeSlot!==r||r.renderData.disposed||(r.textures=this.createTextures(r.renderData,r.textures),this.usedSHDegree>0&&r.renderData.maxShDegree>0&&this.createSHTexture(r),this.bindSlotTextures(r),this.ensureSplatIndexCapacity(r.renderData.numPoints),r.sortDataUploaded=!1,r.awaitingFirstSort=!0,this.forceClipperUniformRefresh=!0,this.gsSceneState.lastClipperHash=``,this.needsRender=!0))}).catch(e=>{console.warn(`Incremental append failed, fallback to rebuild:`,e)}).finally(()=>{this.incrementalUpdateInFlight=!1}),!0}dispose(){this.disposeSlot(this.pendingSlot),this.pendingSlot=null,this.disposeSlot(this.activeSlot),this.activeSlot=null;for(let e of this.freeSlotPool)this.disposeSlot(e);this.freeSlotPool.length=0,this.renderData=null,this.sortWorker&&this.sortWorker.terminate(),this.bindSlotTextures(null),this.geometry.dispose(),this.material.dispose()}},PBMGaussianSplattingTestMesh=class extends three.Mesh{constructor(){super(),this.onBeforeRender=(e,t,n)=>{this.collectObjects(t).length>0&&console.warn(`未开启webgl2, 3dgs仅支持在开启webgl2模式后使用`)}}collectObjects(e){let t=[];return e.traverse(e=>{e instanceof PBMGaussianSplattingObject&&e.visible&&t.push(e)}),t}},DEFAULT_MODE_CHANGE_DURATION=1e3,DEFAULT_CAMERA_FOV=90,DEFAULT_REQUEST_PROXY=e=>e.replace(`//vrlab-public.ljcdn.com/`,`//vr-public.realsee-cdn.cn/`).replace(`//vrlab-image4.ljcdn.com/`,`//vr-image-4.realsee-cdn.cn/`).replace(`//vrlab-image3.ljcdn.com/`,`//vr-image-3.realsee-cdn.cn/`).replace(`//vrlab-image2.ljcdn.com/`,`//vr-image-2.realsee-cdn.cn/`).replace(`//vrlab-image1.ljcdn.com/`,`//vr-image-1.realsee-cdn.cn/`),scratchSphere=new three.Sphere,scratchBox3=new three.Box3,scratchViewport=new three.Vector4,scratchScissor=new three.Vector4,scratchClearColor=new three.Color,scratchRenderSize=new three.Vector2,worksMap=new WeakMap,emptyWorks=createWorks([parseWork(null)]),Five_Instances={},Five=class e extends Subscribe{static get version(){return`6.8.9`}static get dracoPath(){return draco.decoderPath}static set dracoPath(e){draco.setDecoderPath(e)}static get ktx2Path(){return ktx2.transcoderPath}static set ktx2Path(e){ktx2.setTranscoderPath(e)}static get useNativeImageBitmap(){return canUseNativeImageBitmap()}static set useNativeImageBitmap(e){useNativeImageBitmap(e)}constructor(e={}){var t,n,r,o,s,c,l,u,d,f,p;if(super(),this.pbmGaussianSplattingRenderMesh=null,this.fiveId=createUuid$1(),Five_Instances[this.fiveId]=this,this.currentUpdateArgs={time:now(),args:[]},this.currentMode=`Panorama`,this.pano={workCode:``,panoIndex:0},this.needsRender=!1,this.onlyRenderIfNeeds=(t=e.onlyRenderIfNeeds)==null?!0:t,this.imageOptions=Object.assign({},(n=e.imageOptions)==null?{}:n),this.textureOptions=Object.assign({},(r=e.textureOptions)==null?{}:r),this.poweredByRealsee=(o=e.poweredByRealsee)==null?!0:o,this.backgroundColor=new three.Color((s=e.backgroundColor)==null?1579548:s),this.backgroundAlpha=(c=e.backgroundAlpha)==null?1:c,this.extraElements=[],this.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)},this.fps={testCount:0,testTime:now()},this.modeChangeDuration=(l=e.modeChangeDuration)==null?DEFAULT_MODE_CHANGE_DURATION:l,this.enableWheel=(u=e.enableWheel)==null?!0:u,typeof window<`u`)if(`renderer`in e)e.renderer instanceof InternalWebGLRenderer&&this.throwError(Error(`cannot render a internal renderer`)),this.renderer=e.renderer;else try{this.renderer=new InternalWebGLRenderer({preserveDrawingBuffer:e.preserveDrawingBuffer,antialias:e.antialias,webgl2:e.webgl2,logarithmicDepthBuffer:e.logarithmicDepthBuffer,precision:e.precision,powerPreference:e.powerPreference});let t=getViewportScale();this.renderer.setPixelRatio(t===1?window.devicePixelRatio:1),this.renderer.setSize(512,512),this.renderer.setClearColor(this.backgroundColor,this.backgroundAlpha)}catch(e){let t=e instanceof Error?e:Error(String(e));this.throwError(t)}this.getPixelsRenderTarget=new three.WebGLRenderTarget(1,1,{encoding:(f=(d=this.renderer)==null?void 0:d.outputEncoding)==null?three.sRGBEncoding:f,generateMipmaps:!1}),this.viewport=Object.assign({left:0,bottom:0,width:1,height:1},e.viewport),this.camera=new Camera(DEFAULT_CAMERA_FOV),this.scene=new Scene,this.xrCustomObjectsScene=new three.Scene,this.scene.add(this.xrCustomObjectsScene),this.scene.matrixAutoUpdate=!1,this.loadWorkTask=Promise.resolve(),this.requestProxy=(p=e.requestProxy)==null?DEFAULT_REQUEST_PROXY:p,this.networkSubscribe=new NetworkSubscribe,this.networkSubscribe.on(`network`,(e,t,n,r)=>{var o;this.emit(`network.resource`,createEvent(`network.resource`,{source:e,requestType:t,requestState:n,detail:r})),(o=this.analysis)==null||o.network(this.works,e,t,n,r)}),this.readyCallbacks=[],this.syncingState=!1,this.helperGroup=new three.Group,this.helperGroup.name=`helper`,this.helperGroup.matrixAutoUpdate=!1,this.scene.add(this.helperGroup),worksMap.set(this,emptyWorks),this.modelScene=new ModelScene({fiveId:this.fiveId}),this.modelScene.addEventListener(`model.create`,e=>{this.bindModel(e.model)}),this.scene.add(this.modelScene);let[m]=this.modelScene.setModels(emptyWorks,{forceReplaceImmediately:!0});defineProperty(m,`loaded`,{get(){return!1},set(e){}}),this.videoTexture=new three.VideoTexture(e.videoInstance||generateDefaultVideoElement());let h=initLights();this.scene.add(h),this.state={mode:this.currentMode,workCode:this.pano.workCode,panoIndex:this.pano.panoIndex,longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov,offset:this.camera.pose.offset.clone(),distance:this.camera.pose.distance},this.stateSynced=!1,this.destroyed=!1,this.paused=!0,typeof window<`u`&&(e.play!==!1&&this.play(),this.stopAnimationLoop=AnimationFrameLoop.shared.add((e,t,...n)=>{this.updateTime(e,t,...n)},!1,0,10));let g=()=>{typeof document<`u`&&document.fullscreenElement===null&&this.currentMode===`VRPanorama`&&this.controller.emit(`vr.requestExit`,createEvent(`vr.requestExit`,{}))},_=()=>{this.needsRender=!0};if(typeof document<`u`&&document.addEventListener(`fullscreenchange`,g,!1),this.renderer&&this.renderer.domElement.addEventListener(`webglcontextrestored`,_,!1),this.removeEventListeners=()=>{typeof document<`u`&&document.removeEventListener(`fullscreenchange`,g,!1),this.renderer&&this.renderer.domElement.removeEventListener(`webglcontextrestored`,_,!1)},this.plugins={},e.plugins&&e.plugins.length){for(let t of e.plugins)if(typeof t==`function`)t(this);else if(Array.isArray(t)){let[e,n,r]=t;if(typeof e==`function`){let t=e(this,r);typeof n==`string`&&(this.plugins[n]?this.throwError(Error(`plugin name ${n} is exists.`)):this.plugins[n]=t)}}}initLegacyEvent(this),this.fiveRenderer=new FiveRenderer,this.adaptiveLuminancePass=new AdaptiveLuminancePass,this.adaptiveLuminancePass.enabled=!1,this.fiveRenderer.composer.addPass(this.adaptiveLuminancePass),this.eyeDomeLightingPass=new EyeDomeLightingPass(this.camera),this.eyeDomeLightingPass.enabled=!1,this.fiveRenderer.composer.addPass(this.eyeDomeLightingPass),e.webgl2?(this.pbmGaussianSplattingRenderMesh=new PBMGaussianSplattingRenderMesh,this.scene.add(this.pbmGaussianSplattingRenderMesh)):this.scene.add(new PBMGaussianSplattingTestMesh)}get ident(){return this.fiveId}get panoIndex(){return this.pano.panoIndex}get panoId(){return panoStringify(this.pano)}dispose(){var e;if(this.destroyed===!0)return;delete Five_Instances[this.fiveId],this.emit(`dispose`),this.destroyed=!0,this.pause(),this.stopAnimationLoop&&(this.stopAnimationLoop(),this.stopAnimationLoop=void 0),this.off(),this.networkSubscribe.off(),this.controller&&(this.controller.destroy(),this.controller=void 0);let t=this.getElement();t&&t.parentNode&&t.parentNode.removeChild(t);let n=this.modelScene.parameter;n.pano0&&n.pano0.map.dispose(),n.pano1&&n.pano1.map!==((e=n.pano0)==null?void 0:e.map)&&n.pano1.map.dispose(),n.reset(`pano0`,`pano1`),this.modelScene.dispose(),this.scene.dispose(),this.xrCustomObjectsScene.dispose(),worksMap.set(this,emptyWorks),this.renderer&&this.renderer.render(new three.Scene,new three.Camera),this.fiveRenderer.dispose(),this.renderer instanceof InternalWebGLRenderer&&(this.renderer.forceContextLoss&&this.renderer.forceContextLoss(),this.renderer.dispose())}setViewport(e){Object.assign(this.viewport,e),this.needsRender=!0}get boundingMesh(){return this.modelScene.boundingMesh}get helperVisible(){return this.helperGroup.visible}set helperVisible(e){this.helperGroup.visible!==e&&(this.helperGroup.visible=e,this.emit(`helpers.visible`,createEvent(`helpers.visible`,{object:this.helperGroup})),this.needsRender=!0)}updateConfiguration(e,t=!0){let n=!1,r=!1;e.panorama&&(Object.assign(this.controllerInits.Panorama,omitUndefinedFields(e.panorama)),this.currentMode===`Panorama`&&(n=!0)),e.model&&(Object.assign(this.controllerInits.Model,omitUndefinedFields(e.model)),this.currentMode===`Model`&&(n=!0)),e.floorplan&&(Object.assign(this.controllerInits.Floorplan,omitUndefinedFields(e.floorplan)),this.currentMode===`Floorplan`&&(n=!0)),e.topview&&(Object.assign(this.controllerInits.Topview,omitUndefinedFields(e.topview)),this.currentMode===`Topview`&&(n=!0)),e.mapview&&(Object.assign(this.controllerInits.Mapview,omitUndefinedFields(e.mapview)),this.currentMode===`Mapview`&&(n=!0)),e.vrPanorama&&(Object.assign(this.controllerInits.VRPanorama,omitUndefinedFields(e.vrPanorama)),this.currentMode===`VRPanorama`&&(n=!0)),e.xrPanorama&&(Object.assign(this.controllerInits.XRPanorama,omitUndefinedFields(e.xrPanorama)),this.currentMode===`XRPanorama`&&(n=!0)),e.imageOptions&&(Object.assign(this.imageOptions,e.imageOptions),(this.currentMode===`Panorama`||this.currentMode===`VRPanorama`)&&(r=!0,n=!0)),e.textureOptions&&Object.assign(this.textureOptions,e.textureOptions),t&&n&&this.controller&&this.currentMode&&(!this.controller.updateConfiguration(this.controllerInits[this.currentMode])||r)&&this.changeMode(this.currentMode,this.getCurrentState(),0,!1,!0)}appendTo(e,t={}){if(!this.renderer)return;if(!(this.renderer instanceof InternalWebGLRenderer)){this.throwError(Error(`cannot call appendTo method when render a external renderer`));return}let n=this.getElement();if(!n)return;e.appendChild(n),this.refresh(t);let r=window.getComputedStyle(e).position;r!==`relative`&&r!==`absolute`&&r!==`fixed`&&r!==`sticky`&&(e.style.position=`relative`)}refresh(e={},t){var n,r,o;if(!this.renderer)return;let s=this.renderer.domElement.parentNode,{width:c=(n=s==null?void 0:s.offsetWidth)==null?512:n,height:l=(r=s==null?void 0:s.offsetHeight)==null?512:r}=e;if(c=Math.max(1,c),l=Math.max(1,l),!t){let e=getViewportScale(),n=typeof window<`u`?window.devicePixelRatio:1;if(t=(o=e===1?n:1)==null?1:o,t>1){let e=Math.max(c,l)*t,n=Math.min(this.renderer.capabilities.maxTextureSize,4096);e>n&&(t=Math.max(t/e*n,1),t=Math.floor(t*100)/100)}}this.renderer.setPixelRatio(t),this.renderer.setSize(c,l),this.needsRender=!0;let u=now(),d=u-this.currentUpdateArgs.time,f=this.currentUpdateArgs.args;this.updateTime(u,d,...f)}addExtraElement(e){return this.extraElements.indexOf(e)===-1&&(this.extraElements.push(e),this.controller&&this.controller.bindExtraElement(e)),()=>this.removeExtraElement(e)}removeExtraElement(e){let t=this.extraElements.indexOf(e);t!==-1&&(this.extraElements.splice(t,1),this.controller&&this.controller.unbindExtraElement(e))}getSize(e){if(!this.renderer)throw Error(`renderer is not initialized`);return this.renderer.getSize(e),e.x*=this.viewport.width,e.y*=this.viewport.height,e}getDrawingBufferSize(e){if(!this.renderer)throw Error(`renderer is not initialized`);return this.renderer.getDrawingBufferSize(e),e.x*=this.viewport.width,e.y*=this.viewport.height,e}updateCamera(e,t,n=!0){if(!this.controller)throw Error(`controller is not initialized.`);return this.controller.updateCamera(e,t,n)}updateCameraWithKeyframes(e,t,n=!0){if(!this.controller)throw Error(`controller is not initialized.`);return this.controller.updateCameraWithKeyframes(e,t,n)}get works(){return worksMap.get(this)||emptyWorks}get work(){return this.works[0]}get observers(){return this.work.observers}get models(){return this.modelScene.models}get model(){return this.modelScene.models[0]}load(e,t,n,r=!0){if(!this.renderer)throw Error(`renderer is not initialized`);let o=this.loadWorkTask.then(()=>isPromise(e)?e.then(e=>this.load_(e,t,n,r)):this.load_(e,t,n,r));return this.loadWorkTask=o.catch(e=>{this.throwError(e)}),o}load_(t,n,r,o=!0){var s,c,l,u,d,f,p,m,h,g;let _={};typeof r==`number`?_.duration=r:typeof r==`object`&&Object.assign(_,r),this.works===emptyWorks&&(_.duration===void 0&&(_.duration=0),_.effect===void 0&&(_.effect=`instant`));let v={};Object.assign(v,_.model),!v[`3d-tiles`]&&_[`3d-tiles`]&&(v[`3d-tiles`]=_[`3d-tiles`]),!v.textureOptions&&_.textureOptions&&(v.textureOptions=_.textureOptions),!v.textureOptions&&this.textureOptions&&(v.textureOptions=this.textureOptions);let y=[];if(Array.isArray(t))for(let e of t)e instanceof Work?y.push(e):typeof e!=`string`&&`work`in e?y.push(parseWork(e.work,e)):y.push(parseWork(e));else t instanceof Work?y.push(t):y.push(parseWork(t));_.mode===`add`&&(y=[].concat(this.works,y));let b;try{b=createWorks(y)}catch(e){return this.throwError(e),Promise.reject(e)}for(let e of b)this.bindWorkFetcher(e);n===void 0&&(n=`inherit`),n===`inherit`&&this.works===emptyWorks&&(n=`initial`);let S=this.currentMode,C=b.initial,w=C.work.observers[0],T=w?{workCode:w.work.workCode,panoIndex:w.panoIndex}:{workCode:C.work.workCode,panoIndex:0},E=(s=C.mode)==null?w?`Panorama`:`Mapview`:s,D={};if(n===`inherit`){let e=this.getCurrentState(),[t]=b.filter(t=>t.workCode===e.workCode);if(t)T={workCode:e.workCode,panoIndex:e.panoIndex},E=e.mode,D={longitude:e.latitude,latitude:e.latitude,fov:e.fov,distance:e.distance,offset:e.offset.clone()};else{n={mode:S};let e=(l=(c=b[0])==null?void 0:c.observers)==null?void 0:l[this.panoIndex];e?(n.workCode=e.work.workCode,n.panoIndex=e.panoIndex):typeof b.initial.panoIndex==`number`?(n.workCode=b.initial.work.workCode,n.panoIndex=b.initial.panoIndex):(n.mode===`Panorama`||n.mode===`VRPanorama`||n.mode===`XRPanorama`)&&(n.mode=`Mapview`),n.mode===S&&(n.longitude=this.camera.pose.longitude,n.latitude=this.camera.pose.latitude,n.fov=this.camera.pose.fov)}}if(n===`initial`&&(typeof C.panoIndex==`number`&&(T={workCode:C.work.workCode,panoIndex:C.panoIndex}),C.mode&&(E=C.mode),D={longitude:C.longitude,latitude:C.latitude,fov:C.fov,distance:C.distance,offset:(u=C.offset)==null?void 0:u.clone()}),typeof n==`object`){if(E=(d=n.mode)==null?S:d,typeof n.panoIndex==`number`){let e=b.getObserver({workCode:(p=(f=n.workCode)==null?C.work.workCode:f)==null?``:p,panoIndex:n.panoIndex});e&&(T={workCode:e.work.workCode,panoIndex:e.panoIndex})}D={longitude:n.longitude,latitude:n.latitude,fov:n.fov,distance:n.distance,offset:n.offset?new three.Vector3().copy(n.offset):void 0}}let O=(m=_.duration)==null?this.modeChangeDuration:m;(E===`Floorplan`||E===`Topview`||E===`Mapview`)&&S===E&&(O=0);let k=`fly`;(E===`Panorama`||E===`VRPanorama`||E===`XRPanorama`)&&S===E&&(k=(h=_.effect)==null?`fade`:h),this.emit(`works.request`,createEvent(`works.request`,{input:t,works:b,userAction:o}));let A=(e,t,r)=>{let s=this.getCurrentState(),c=Object.assign(Object.assign({mode:e},t),r);n===`inherit`&&(c=this.getCurrentState()),this.pano=t;let l=Object.assign(Object.assign({initial:{state:c,currentState:s,duration:O,effect:k,userAction:o}},this.commonParams()),this.controllerInits[e]),u=Controllers[c.mode].initAnimationEndState(l);if(this.controller&&S===e)this.controller.updateWork(b,u,{effect:k,duration:O},o)===!1&&(this.controller.destroy(),this.controller=this.applyController(e,l));else{if(this.controller)this.controller.destroy();else{let t=Controllers[e].initAnimationEndState(l);this.camera.setFromPose(t),this.emit(`camera.update`,createEvent(`camera.update`,{state:this.getCurrentState(),userAction:o}))}this.controller=this.applyController(e,l);let t=createEvent(`mode.change`,{prevMode:S,mode:e,state:u,userAction:o});try{this.emit(`mode.change`,t)}catch(e){console.error(e)}}this.updateTime(this.currentUpdateArgs.time,0,...this.currentUpdateArgs.args)};worksMap.set(this,b);let j=Promise.resolve();if(E===e.Mode.Floorplan||E===e.Mode.Topview||E===e.Mode.Mapview||E===e.Mode.Model){this.modelScene.loaded===!1&&(this.camera.setFromPose(D),assignPose(this.state,this.camera.pose));let e=this.modelScene.setModels(b,v);j=Promise.all(e.map(e=>e.loadedReady)).then(()=>{this.needsRender=!0,A(E,T,D),this.emit(`camera.update`,createEvent(`camera.update`,{state:this.getCurrentState(),userAction:o}))})}else{A(E,T,D);let e=this.controller,t=!1;this.modelScene.autoRefine=!1;let n=()=>{this.works===b&&t===!1&&(this.needsRender=!0,this.emit(`camera.update`,createEvent(`camera.update`,{state:this.getCurrentState(),userAction:o})),t=!0,this.modelScene.autoRefine=!0),e.off(`pano.arrived`,n),e.off(`pano.cancel`,n)},r=this.modelScene.setModels(b,v);j=Promise.all(r.map(e=>e.initReady)).then(noop),e.once(`pano.arrived`,n),e.once(`pano.cancel`,n),setTimeout(n,((g=_.duration)==null?this.modeChangeDuration:g)+1e3)}return this.emit(`works.load`,createEvent(`works.load`,{input:t,userAction:o,works:b})),j.then(()=>this.ready()).then(()=>{var e;this.emit(`works.ready`,createEvent(`works.ready`,{input:t,userAction:o,works:b})),(e=this.analysis)==null||e.work(b)})}reset(){let e=this.loadWorkTask.then(()=>this.reset_());return this.loadWorkTask=e.catch(e=>{this.throwError(e)}),e}reset_(){return new Promise(e=>{var t;this.controller&&(this.controller.destroy(),this.controller=void 0);let n=this.modelScene.parameter;n.pano0&&n.pano0.map.dispose(),n.pano1&&n.pano1.map!==((t=n.pano0)==null?void 0:t.map)&&n.pano1.map.dispose(),n.set({pano0:null,pano1:null,modelAlpha:1}),worksMap.set(this,emptyWorks),this.modelScene.setModels(emptyWorks,{forceReplaceImmediately:!0}),this.renderer&&this.modelScene.update(this.renderer,this.camera),this.needsRender=!0,this.currentMode=`Panorama`,this.pano={workCode:``,panoIndex:0},this.camera.setFromPose({distance:0,fov:DEFAULT_CAMERA_FOV,longitude:0,latitude:0,offset:new three.Vector3(0,0,0)}),this.state={mode:this.currentMode,workCode:this.pano.workCode,panoIndex:this.pano.panoIndex,longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov,offset:this.camera.pose.offset.clone(),distance:this.camera.pose.distance},this.camera.needsRender=!1,this.needsRender=!1,e()})}changeMode(t,n={},r,o=!0,s=!1){return new Promise((c,l)=>{var u,d,f,p;if(!this.renderer)throw Error(`renderer is not initialized.`);n=Object.assign({},n);let m=0;this.controller&&(m=typeof r==`number`?r:(u=r==null?void 0:r.duration)==null?this.modeChangeDuration:u);let h=`fly`;this.controller&&typeof r==`object`&&r.effect&&(h=r.effect);let g=typeof n.panoIndex==`number`?{workCode:(p=(d=n.workCode)==null?(f=this.work)==null?void 0:f.workCode:d)==null?``:p,panoIndex:n.panoIndex}:this.pano;if(!e.Mode.hasOwnProperty(t)){let e=Error(`mode "${t}" is not existed`);this.throwError(e),l(e);return}if((t===e.Mode.Panorama||t===e.Mode.VRPanorama||t===e.Mode.XRPanorama)&&!this.works.getObserver(g)){let e=Error(`PanoId ${panoStringify(g)} not existed.`);this.throwError(e),l(e);return}(t===e.Mode.Floorplan||t===e.Mode.Topview||t===e.Mode.Mapview||t===e.Mode.Model)&&this.modelScene.empty&&(m=0);let _=this.controller,v=this.currentMode,y=()=>{if(this.controller&&this.controller.stopMomentumMovement(),this.controller&&s===!1&&v===t)t===e.Mode.Panorama||t===e.Mode.Model||t===e.Mode.VRPanorama||t===e.Mode.XRPanorama?!panoEqual(this.pano,g)&&`moveToPano`in this.controller&&typeof this.controller.moveToPano==`function`?this.controller.moveToPano(g,Object.assign({duration:m},n),o):this.controller.updateCamera(n,m,o).catch(noop):(panoEqual(this.pano,g)||(this.pano=g),this.controller.updateCamera(n,m,o).catch(noop));else{let e=Object.assign(Object.assign({},n),g),r=Object.assign(Object.assign({initial:{state:e,currentState:this.getCurrentState(),duration:m,effect:h,userAction:o}},this.commonParams()),this.controllerInits[t]),s=Controllers[t].initAnimationEndState(r),c=createEvent(`mode.change.request`,{prevMode:this.currentMode,mode:t,state:s,userAction:o});if(this.emit(`mode.change.request`,c),!c.defaultPrevented){_&&_.destroy(),this.controller=this.applyController(t,r);let e=createEvent(`mode.change`,{prevMode:this.currentMode,mode:t,state:s,userAction:o});this.emit(`mode.change`,e)}}c()},b=AnimationFrameLoop.shared.getContext();b&&(typeof XRSession<`u`&&b instanceof XRSession&&b.end(),AnimationFrameLoop.shared.setContext(null)),t===e.Mode.VRPanorama?(this.requestFullscreen(),requestDeviceOrientationPermission().then(()=>y()).catch(e=>{let t=e instanceof Error?e:Error(String(e));this.exitFullscreen(),this.throwError(t),l(t)})):t===e.Mode.XRPanorama?requestXRSessionPermission().then(e=>{AnimationFrameLoop.shared.setContext(e),s=!0,y()}).catch(e=>{let t=e instanceof Error?e:Error(String(e));this.throwError(t),l(t)}):y()})}getPixels(e,t,n,r,o,s,c){if(!this.renderer)throw Error(`renderer is not initialized.`);let l=now(),u=this.renderer.getPixelRatio(),d=this.renderer.getRenderTarget(),f=this.getSize(new three.Vector2),p=0,m=0,h=1,g=1,_,v,y,b,S;typeof e==`number`?(p=e,typeof t==`number`&&(m=t),typeof n==`number`&&(h=n),typeof r==`number`&&(g=r),_=o,v=s,S=c):(p=e.x,m=e.y,h=e.width,g=e.height,_=e.pixelRatio,v=e.flipY,y=e.helperVisible,b=e.skipPanorama,S=e.buffer),p=Math.floor(p),m=Math.floor(m),h=Math.floor(h),g=Math.floor(g),_=Math.floor(_==null?u:_),v=v==null?!1:v;let C=this.helperVisible,w=this.modelScene.parameter.modelAlpha;this.helperVisible=y==null?this.helperVisible:y,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);let T=this.getPixelsRenderTarget;T.setSize(h*_,g*_),this.renderer.setRenderTarget(T),this.camera.pixelRatio=_,this.camera.resolution.set(h,g),this.camera.setViewOffset(f.width,f.height,p,f.height-m-g,h,g),this.camera.aspect=f.width/f.height,this.camera.updateTime(l),this.scene.update(this.renderer,this.camera);let E=this.renderer.autoClear,D=this.renderer.autoClearColor,O=this.renderer.autoClearDepth,k=this.renderer.autoClearStencil,A=scratchClearColor.copy(this.renderer.getClearColor()),j=this.renderer.getClearAlpha(),M=this.renderer.getScissorTest();this.renderer.autoClear=!0,this.renderer.autoClearColor=!0,this.renderer.autoClearDepth=!0,this.renderer.autoClearStencil=!0,this.renderer.setScissorTest(!1);let N=this.scene.background;this.scene.background=this.camera.isOrthographicCamera?null:N,this.renderer.render(this.scene,this.camera),this.scene.background=N,this.renderer.autoClear=E,this.renderer.autoClearColor=D,this.renderer.autoClearDepth=O,this.renderer.autoClearStencil=k,this.renderer.setClearColor(A,j),this.renderer.setScissorTest(M),this.helperVisible=C,w===void 0?this.modelScene.parameter.reset(`modelAlpha`):this.modelScene.parameter.set(`modelAlpha`,w),this.renderer.setRenderTarget(d),this.camera.clearViewOffset(),this.camera.pixelRatio=u,this.camera.resolution.copy(f),this.camera.aspect=this.camera.resolution.width/this.camera.resolution.height,this.camera.updateTime(l),this.modelScene.update(this.renderer,this.camera),this.scene.update(this.renderer,this.camera);let P=h*_,F=g*_,I=P*F,L=I*4;if(S){if(S.length!==L)throw Error(`buffer length is not equals pixels ${L}`)}else S=new Uint8Array(L);if(this.renderer.readRenderTargetPixels(T,0,0,h*_,g*_,S),v){let e=I/2;for(let t=0,n=0,r=0,o=0;n<e;n++)for(o=(F-Math.floor(n/P)-1)*P+n%P,r=0;r<4;r++)t=S[n*4+r],S[n*4+r]=S[o*4+r],S[o*4+r]=t}return S}getElement(){var e;return(e=this.renderer)==null?void 0:e.domElement}render(e){let t=this.renderer;if(!t)return;let n=t.getRenderTarget();t.setRenderTarget(null);let r=t.autoClear,o=t.autoClearColor,s=t.autoClearDepth,c=t.autoClearStencil,l=scratchClearColor.copy(t.getClearColor()),u=t.getClearAlpha(),d=t.getViewport(scratchViewport),f=t.getScissor(scratchScissor),p=t.getScissorTest();t.autoClear=!0,t.autoClearColor=!0,t.autoClearDepth=!0,t.autoClearStencil=!0;let m=t.getSize(scratchRenderSize),h=Math.floor(m.x*this.viewport.left),g=Math.floor(m.y*this.viewport.bottom),_=Math.floor(m.x*this.viewport.width),v=Math.floor(m.y*this.viewport.height);t.setClearColor(this.backgroundColor,this.backgroundAlpha),t.setViewport(h,g,_,v),t.setScissor(h,g,_,v);let y=this.viewport.bottom!==0||this.viewport.left!==0||this.viewport.width!==1||this.viewport.height!==1;t.setScissorTest(y);let b=this.scene.background;this.scene.background=this.camera.isOrthographicCamera?null:b;let S=!0;if(this.controller&&this.controller.render()&&(S=!1),S){let e=this.fiveRenderer.render(t,this.scene,this.modelScene,this.camera,this.needsRender);this.poweredByRealsee&&e&&renderPoweredByRealsee(t)}this.scene.background=b,t.autoClear=r,t.autoClearColor=o,t.autoClearDepth=s,t.autoClearStencil=c,t.setClearColor(l,u),t.setViewport(d),t.setScissor(f),t.setScissorTest(p),t.setRenderTarget(n),e&&AnimationFrameLoop.shared.add(e,!0)}updateTime(e,t,...n){if(this.currentUpdateArgs={time:e,args:n},this.destroyed)return;if(this.renderer&&ktx2.detectSupport(this.renderer),this.syncingState=this.syncState(e,t),this.controller&&this.controller.updateTime(e,t,...n),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.controllerMode=this.currentMode,this.camera.updateTime(e),this.renderer){let e=this.modelScene.loaded,t=this.modelScene.refined;this.modelScene.update(this.renderer,this.camera),e===!1&&this.modelScene.loaded===!0&&(this.controller&&this.controller.updateModel(this.modelScene),AnimationFrameLoop.shared.add(()=>{this.emit(`models.load`,createEvent(`models.load`,{modelScene:this.modelScene}))},!0,0,10)),t===!1&&this.modelScene.refined===!0&&AnimationFrameLoop.shared.add(()=>{this.emit(`models.refined`,createEvent(`models.refined`,{modelScene:this.modelScene}))},!0,0,10)}if(this.camera.autoNearFar){scratchBox3.makeEmpty(),scratchBox3.expandByObject(this.modelScene.boundingMesh);let t=scratchBox3.getBoundingSphere(scratchSphere),n=t.radius*2;t.containsPoint(this.camera.position)||(n=this.camera.position.distanceTo(t.center)+t.radius),n=clamp$1(n,800);let r=n/1e4;r=clamp$1(r,.03,.1),this.camera.near!==r&&(this.camera.near=r),this.camera.far!==n&&(this.camera.far=n),this.camera.updateTime(e)}if(this.renderer){let e=this.modelScene.visible;this.modelScene.visible=!1,this.scene.update(this.renderer,this.camera),this.modelScene.visible=e}if(this.syncingState=!1,this.controller&&this.controller.needsRender===!0&&(this.controller.needsRender=!1,this.needsRender=!0),this.camera.needsRender===!0&&(this.camera.needsRender=!1,this.needsRender=!0),this.modelScene.needsRender===!0&&(this.modelScene.needsRender=!1,this.needsRender=!0),this.scene.needsRender===!0&&(this.scene.needsRender=!1,this.needsRender=!0),this.pbmGaussianSplattingRenderMesh&&this.pbmGaussianSplattingRenderMesh.needsRender===!0&&(this.pbmGaussianSplattingRenderMesh.needsRender=!1,this.needsRender=!0),this.onlyRenderIfNeeds!==!0&&(this.needsRender=!0),this.paused===!0)return;let r=createEvent(`render.prepare`,{needsRender:this.needsRender});this.emit(`render.prepare`,r),r.defaultPrevented&&(this.needsRender=!1);let o=this.needsRender;this.render(),this.needsRender=!1,this.emit(`render`,createEvent(`render`,{needsRender:o})),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))}pause(){this.paused=!0,this.renderer&&this.renderer instanceof InternalWebGLRenderer&&this.renderer.clear(!0,!0,!0)}play(){this.needsRender=!0,this.paused=!1}moveToPano(t,n={},r=!0){let{controller:o,renderer:s}=this;if(!o)return this.throwError(Error(`controller is not initialized.`)),Promise.resolve();if(!s)return this.throwError(Error(`renderer is not initialized.`)),Promise.resolve();typeof t==`number`&&this.pano.workCode&&(t={workCode:this.pano.workCode,panoIndex:t});let c=this.works.getObserver(t);if(!c)return this.throwError(Error(`pano ${JSON.stringify(t)} not existed.`)),Promise.resolve();let l={workCode:c.work.workCode,panoIndex:c.panoIndex};return`moveToPano`in o&&typeof o.moveToPano==`function`?o.moveToPano(l,n,r):c&&(this.pano=l,this.once(`initAnimation.start`,e=>{n.moveStartCallback&&n.moveStartCallback(e.state)}),this.once(`initAnimation.end`,e=>{n.moveEndCallback&&n.moveEndCallback(e.state)}),this.changeMode(e.Mode.Panorama,n,{effect:n.effect},r)),this.ready()}preloadPano(e,t=noop){let n=this.works.getObserver(e);if(!n)return Promise.reject(Error(`Pano ${JSON.stringify(e)} never found`));let r=[`right`,`left`,`up`,`down`,`front`,`back`],o=now();return Promise.all(r.map(e=>{let t=panoStringify({panoIndex:n.panoIndex,workCode:n.work.workCode}),r=Object.assign({key:`pano.${t}.${e}`},pick(this.imageOptions,[`size`,`format`,`quality`,`forceUseExifOrientation`,`mappings`])),o=n.work.getURL(n.images[e]),s=this.imageOptions.transform?this.imageOptions.transform(o,r):imageURL(o,r);return getFetcher(this.fiveId,n.work).preload(s)})).then(()=>{let e=now()-o;return t(e),e})}project2d(e,t=!1){if(!this.renderer)return null;if(t){let t=this.camera.position,n=e.clone().sub(t),r=new three.Raycaster(t,n.clone().normalize());r.params.Points={threshold:.1};let[o]=this.modelScene.intersectRaycaster(r);if(o&&o.distance+.01<n.length())return null}let n=e.clone().project(this.camera);if(Math.abs(n.z)>1)return null;let r=this.renderer.getSize(new three.Vector2),o=r.x*this.viewport.width,s=r.y*this.viewport.height,c=r.x*this.viewport.left+(n.x+1)/2*o,l=r.y*(1-this.viewport.bottom-this.viewport.height)+(-n.y+1)/2*s;return new three.Vector2(c,l)}getCurrentState(){return Object.assign(Object.assign({},this.camera.copyPose()),{mode:this.currentMode,workCode:this.pano.workCode,panoIndex:this.pano.panoIndex})}setState(e,t=!1,n=!0){var r,o,s,c,l,u,d,f,p,m;e=pick(e,[`mode`,`workCode`,`panoIndex`,`longitude`,`latitude`,`fov`,`offset`,`distance`]),e.offset&&!(e instanceof three.Vector3)&&(e.offset=new three.Vector3(e.offset.x,e.offset.y,e.offset.z));let h;if(typeof e.panoIndex==`number`)if(e.workCode)h={workCode:e.workCode,panoIndex:e.panoIndex};else{let t=(o=(r=this.work)==null?void 0:r.workCode)==null?``:o,n=this.state.workCode;this.works.filter(e=>e.workCode===n).length>0&&(t=n),h={workCode:t,panoIndex:e.panoIndex}}let g=(s=e.mode)==null?this.state.mode:s,_,v,y,b,S;if(this.controller&&this.controller.stopMomentumMovement(),this.state.mode!==g){if(g===`VRPanorama`){this.changeMode(`VRPanorama`,void 0,void 0,!0);return}let t={workCode:h==null?void 0:h.workCode,panoIndex:h==null?void 0:h.panoIndex};typeof e.longitude==`number`&&(t.longitude=e.longitude),typeof e.latitude==`number`&&(t.latitude=e.latitude),typeof e.fov==`number`&&(t.fov=e.fov),typeof e.distance==`number`&&(t.distance=e.distance),e.offset instanceof three.Vector3&&(t.offset=e.offset);let n=Object.assign(Object.assign({initial:{state:t,currentState:this.getCurrentState(),duration:this.modeChangeDuration,effect:`fly`,userAction:!1}},this.commonParams()),this.controllerInits[g]),r=Controllers[g].initAnimationEndState(n);_=r.longitude,v=r.latitude,y=r.fov,b=r.offset,S=r.distance}else _=(c=e.longitude)==null?this.state.longitude:c,v=(l=e.latitude)==null?this.state.latitude:l,y=(u=e.fov)==null?this.state.fov:u,b=(d=e.offset)==null?this.state.offset:d,S=(f=e.distance)==null?this.state.distance:f;let C={workCode:(h==null?this.pano:h).workCode,panoIndex:(h==null?this.pano:h).panoIndex,mode:g,longitude:_,latitude:v,fov:y,offset:b,distance:S};this.emit(`state.set`,createEvent(`state.set`,{userAction:n,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&&n&&(this.controller.userAction=!1),t&&this.state.mode===C.mode&&(this.syncingState=this.syncState(now(),0,t),this.syncingState&&((p=this.controller)==null||p.updateTime(now(),0),this.syncingState=!1)),this.emit(`state.change`,createEvent(`state.change`,{userAction:n,state:this.state})),(m=this.analysis)==null||m.state(this.works,this.state)))}syncState(t,n,r=!1){let o=this.stateSynced;if(this.stateSynced=!1,!this.controller)return!1;if(this.state.mode!==this.currentMode){let e={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,e,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)){let e={longitude:this.state.longitude,latitude:this.state.latitude,fov:this.state.fov,offset:this.state.offset};return this.controller.moveToPosition(this.state.offset,Object.assign(Object.assign({},e),{duration:r?0:void 0}),!1),!0}}else{let e={workCode:this.state.workCode,panoIndex:this.state.panoIndex};if(!panoEqual(e,this.pano)&&`moveToPano`in this.controller&&typeof this.controller.moveToPano==`function`){let t={longitude:this.state.longitude,latitude:this.state.latitude,fov:this.state.fov,offset:this.state.offset,distance:this.state.distance};return this.controller.moveToPano(e,t,!1),!0}}if(this.controller instanceof Controllers.Floorplan||this.controller instanceof Controllers.Topview||this.controller instanceof Controllers.Mapview){let e=1,t=.2,n=.2,o=Math.PI/45,s=r?this.state.fov:stepNumber(this.camera.pose.fov,this.state.fov,1),c=Math.abs(this.camera.pose.distance-this.state.distance),l=c>n*15?c/15:.2,u=r?this.state.distance:stepNumber(this.camera.pose.distance,this.state.distance,l),d=this.camera.pose.offset.distanceTo(this.state.offset),f=d>n*15?d/15:n,p=r?new three.Vector3().copy(this.state.offset):stepVector(this.camera.pose.offset,this.state.offset,f),{longitude:m,latitude:h}=r?{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},o);if(notSimilarValue(s,this.camera.pose.fov)||notSimilarVector3(p,this.camera.pose.offset)||notSimilarValue(u,this.camera.pose.distance)||notSimilarValue(m,this.camera.pose.longitude,Math.PI*2)||notSimilarValue(h,this.camera.pose.latitude)){let e={x:p.x,y:p.y,z:p.z},t={fov:s};return Object.assign(e,{distance:u}),Object.assign(t,{longitude:m,latitude:h}),this.controller.stopMomentumMovement(),this.controller.cameraMotion.set(t,0).catch(noop),this.controller.locationMotion.set(e,0).catch(noop),!0}}else{let e=1,t=Math.PI/45,n=r?this.state.fov:stepNumber(this.camera.pose.fov,this.state.fov,1),{longitude:o,latitude:s}=r?{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},t),c=this.state.distance,l=new three.Vector3().copy(this.state.offset);if(notSimilarValue(c,this.camera.pose.distance)&&(this.state.distance=this.camera.pose.distance),notSimilarVector3(l,this.camera.pose.offset)&&(this.state.offset=this.camera.pose.offset.clone()),notSimilarValue(o,this.camera.pose.longitude,Math.PI*2)||notSimilarValue(s,this.camera.pose.latitude)||notSimilarValue(n,this.camera.pose.fov))return this.controller.stopMomentumMovement(),this.controller.cameraMotion.set({longitude:o,latitude:s,fov:n},0).catch(noop),!0}if(this.stateSynced=!0,o===!1&&this.emit(`state.synced`,createEvent(`state.synced`,{userAction:!1,state:this.state})),this.readyCallbacks.length&&this.stateSynced){let t=this.currentMode;if(!(t===e.Mode.Floorplan||t===e.Mode.Topview||t===e.Mode.Mapview||t===e.Mode.Model)||this.modelScene.loaded){let e=this.readyCallbacks.slice();this.readyCallbacks.length=0;for(let t of e)this.controller instanceof Controllers.Panorama&&t.tile===!0&&!this.controller.isTileReady()?this.readyCallbacks.push(t):t()}}return!1}ready(e={}){return new Promise(t=>{var n;this.readyCallbacks.push(Object.assign(t,{tile:(n=e.tile)==null?!1:n}))}).then(()=>this.model.initReady).then(noop)}requestFullscreen(){var e;if(!isMobile)return;let t=(e=this.getElement())==null?void 0:e.parentNode;t&&`requestFullscreen`in t&&typeof document<`u`&&document.fullscreenElement===null&&t.requestFullscreen()}exitFullscreen(){typeof document<`u`&&document.fullscreenElement&&`exitFullscreen`in document&&document.exitFullscreen()}throwError(e){this.hasListener(`error`)?this.emit(`error`,e):console.error(e)}bindModel(e){let t=()=>{AnimationFrameLoop.shared.add(()=>{this.emit(`model.load`,createEvent(`model.load`,{work:e.work,model:e,error:null}))},!0)},n=t=>{let{error:n}=t;this.emit(`model.error`,createEvent(`model.error`,{work:e.work,model:e,error:n})),this.throwError(n)},r=()=>{this.emit(`model.changeShownFloor`,createEvent(`model.changeShownFloor`,{work:e.work,model:e,error:null}))},o=t=>{this.emit(`models.tileLoad`,createEvent(`model.tileLoad`,{work:e.work,model:e,tile:t.tile}))},s=t=>{this.emit(`models.tileUnload`,createEvent(`model.tileUnload`,{work:e.work,model:e,tile:t.tile}))},c=()=>{e.removeEventListener(`load`,t),e.removeEventListener(`error`,n),e.removeEventListener(`changeShownFloor`,r),e.removeEventListener(`tileLoad`,o),e.removeEventListener(`tileUnload`,s),e.removeEventListener(`dispose`,c)};e.addEventListener(`load`,t),e.addEventListener(`error`,n),e.addEventListener(`changeShownFloor`,r),e.addEventListener(`tileLoad`,o),e.addEventListener(`tileUnload`,s),e.addEventListener(`dispose`,c),this.emit(`model.request`,createEvent(`model.request`,{work:e.work,model:e,error:null}))}bindWorkFetcher(e){let t=this,n=e.workCode,r=e.allowHosts,o=new Fetcher({get networkSubscribe(){return t.networkSubscribe},requestProxy(e){return Promise.resolve(e).then(e=>t.requestProxy(e,n)).then(e=>{let t=verifyURL(e,r);return t instanceof Error?Promise.reject(t):t})}});registerFetcher(this.fiveId,e,o)}commonParams(){return{fiveId:this.fiveId,scene:this.scene,xrCustomObjectsScene:this.xrCustomObjectsScene,helper:this.helperGroup,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}}applyController(t,n){if(!this.renderer)throw Error(`renderer is not initialized.`);let r=Controllers[t];this.currentMode=t;let o=new r(n);for(let e of PROXY_CONTROLLER_EVENT_NAMES)o.on(e,(...t)=>{if(this.emit(e,...t))return!1});{let e=Controllers[t].initAnimationEndState(n),r=n.initial.userAction;stateEqual(this.state,e)||(assignState(this.state,e),this.emit(`state.change`,createEvent(`state.change`,{userAction:r,state:this.state}))),this.emit(`currentState.change`,createEvent(`currentState.change`,{userAction:r,state:this.getCurrentState()}))}return o.on(`camera.update`,e=>{var t;if(this.controller){let n=this.controller.getTargetState();e.userAction&&this.syncingState===!1&&this.state.mode===n.mode&&!stateEqual(this.state,n)&&(assignState(this.state,n),this.emit(`state.change`,createEvent(`state.change`,{userAction:e.userAction,state:this.state})),(t=this.analysis)==null||t.state(this.works,this.state))}this.emit(`currentState.change`,createEvent(`currentState.change`,{userAction:e.userAction,state:this.getCurrentState()}))}),o.on(`initAnimation.start`,e=>{var t;let{state:n,userAction:r}=e;r&&this.state.mode===n.mode&&!stateEqual(this.state,n)&&(assignState(this.state,n),this.emit(`state.change`,createEvent(`state.change`,{userAction:r,state:this.state})),(t=this.analysis)==null||t.state(this.works,this.state))}),o.on(`initAnimation.end`,e=>{var t;let{state:n,userAction:r}=e;this.pano={workCode:n.workCode,panoIndex:n.panoIndex},r&&this.state.mode===n.mode&&!stateEqual(this.state,n)&&(assignState(this.state,n),this.emit(`state.change`,createEvent(`state.change`,{userAction:r,state:this.state})),(t=this.analysis)==null||t.state(this.works,this.state))}),o.on(`pano.moveTo`,e=>{var t;let{state:n,userAction:r}=e;this.pano={workCode:n.workCode,panoIndex:n.panoIndex},r&&this.state.mode===n.mode&&!stateEqual(this.state,n)&&(assignState(this.state,n),this.emit(`state.change`,createEvent(`state.change`,{userAction:r,state:this.state})),(t=this.analysis)==null||t.state(this.works,this.state))}),o.on(`pano.arrived`,e=>{var t;let{state:n,userAction:r}=e;this.pano={workCode:n.workCode,panoIndex:n.panoIndex},r&&this.state.mode===n.mode&&!stateEqual(this.state,n)&&(assignState(this.state,n),this.emit(`state.change`,createEvent(`state.change`,{userAction:r,state:this.state})),(t=this.analysis)==null||t.state(this.works,this.state))}),o.on(`pano.cancel`,e=>{var t;let{state:n,userAction:r}=e;r&&this.state.mode===n.mode&&!stateEqual(this.state,n)&&(assignState(this.state,n),this.emit(`state.change`,createEvent(`state.change`,{userAction:r,state:this.state})),(t=this.analysis)==null||t.state(this.works,this.state))}),o.on(`pano.error`,e=>{var t;let{state:n}=e;this.state.mode===n.mode&&!stateEqual(this.state,n)&&(assignState(this.state,n),(t=this.analysis)==null||t.state(this.works,this.state))}),o.on(`pano.moveTo`,e=>{let{userAction:t}=e;this.emit(`currentState.change`,createEvent(`currentState.change`,{userAction:t,state:this.getCurrentState()}))}),o.on(`pano.request`,e=>{this.emit(`pano.request`,e),e.defaultPrevented||this.moveToPano(e.state,e.options,e.userAction)}),o.on(`vr.requestExit`,()=>{this.currentMode===e.Mode.VRPanorama&&(this.exitFullscreen(),this.changeMode(e.Mode.Panorama))}),o.on(`error`,e=>this.throwError(e)),o}removeEventListeners(){}get internalLightsEnabled(){let e=this.scene.children.find(e=>e.name===`internalLights`);return e?e.visible:!1}set internalLightsEnabled(e){let t=this.scene.children.find(e=>e.name===`internalLights`);t&&(t.visible=e),t=this.modelScene.children.find(e=>e.name===`internalLights`),t&&(t.visible=e)}get scissor(){return this.viewport}setScissor(e){return this.setViewport(e)}getPose(){let{longitude:e,latitude:t,fov:n,offset:r,distance:o}=this.camera.copyPose();return{longitude:e,latitude:t,fov:n,offset:r.clone(),distance:o}}getLongitudeAndLatitude(){let{longitude:e,latitude:t}=this.getPose();return{longitude:e,latitude:t}}getOffset(){return this.getPose().offset}getCameraLocal(){if(this.pano.workCode&&this.controller&&this.works){let e=this.works.getObserver(this.pano);if(e){let t=new three.Object3D;t.matrix.copy(e.matrix).premultiply(e.work.transform),t.matrix.decompose(t.position,t.quaternion,t.scale),t.matrixAutoUpdate=!1;let n=new three.Vector3(0,0,-1);n.applyQuaternion(this.camera.quaternion);let r=t.quaternion.clone().inverse();return n.applyQuaternion(r),{theta:Math.atan2(n.x,-n.z),phi:-Math.asin(n.y),lookAtVector:n}}}return null}addPass(e){this.fiveRenderer.composer.addPass(e)}removePass(e){let t=this.fiveRenderer.composer.passes.indexOf(e);t!==-1&&this.fiveRenderer.composer.passes.splice(t,1)}insertPass(e,t){this.fiveRenderer.composer.insertPass(e,t)}get renderMode(){return this.fiveRenderer.renderMode}set renderMode(e){this.fiveRenderer.renderMode=e}get enableHQ(){return this.fiveRenderer.renderMode===`point-cloud-high-quality`}set enableHQ(e){this.fiveRenderer.renderMode=e?`point-cloud-high-quality`:`default`,this.needsRender=!0}get enableEDL(){return this.eyeDomeLightingPass.enabled}set enableEDL(e){this.eyeDomeLightingPass.enabled=e,this.needsRender=!0}get enableAdaptiveLuminance(){return this.adaptiveLuminancePass.enabled}set enableAdaptiveLuminance(e){this.adaptiveLuminancePass.enabled=e,this.needsRender=!0}get enableIOSEDR(){return!1}set enableIOSEDR(e){}get enablePostProcessing(){return!0}set enablePostProcessing(e){}get modelSceneNeedsRender(){return this.modelScene.needsRender}set modelSceneNeedsRender(e){this.modelScene.needsRender=e}};Five.Mode={Panorama:`Panorama`,Model:`Model`,Floorplan:`Floorplan`,Topview:`Topview`,Mapview:`Mapview`,VRPanorama:`VRPanorama`,XRPanorama:`XRPanorama`},typeof window<`u`&&Object.assign(window,{__FIVE_DEBUG__:{THREE:three,constructor:Five,instances:Five_Instances}});var XRButton=class{static createButton(e){let t=document.createElement(`button`);function n(){t.style.display=``,t.style.cursor=`pointer`,t.style.left=`calc(50% - 50px)`,t.style.width=`100px`,t.textContent=`ENTER VR`,t.onmouseenter=function(){t.style.opacity=`1.0`},t.onmouseleave=function(){t.style.opacity=`0.5`},t.onclick=function(){e&&e()}}function r(){t.style.display=``,t.style.cursor=`auto`,t.style.left=`calc(50% - 75px)`,t.style.width=`150px`,t.onmouseenter=null,t.onmouseleave=null,t.onclick=null}function o(){r(),t.textContent=`VR NOT SUPPORTED`}function s(e){e.style.position=`absolute`,e.style.bottom=`20px`,e.style.padding=`12px 6px`,e.style.border=`1px solid #fff`,e.style.borderRadius=`4px`,e.style.background=`rgba(0,0,0,0.1)`,e.style.color=`#fff`,e.style.font=`normal 13px sans-serif`,e.style.textAlign=`center`,e.style.opacity=`0.5`,e.style.outline=`none`,e.style.zIndex=`999`}if(`xr`in navigator)return t.id=`VRButton`,t.style.display=`none`,s(t),navigator.xr.isSessionSupported(`immersive-vr`).then(function(e){e?n():o()}),t;{let e=document.createElement(`a`);return window.isSecureContext===!1?(e.href=document.location.href.replace(/^http:/,`https:`),e.innerHTML=`WEBXR NEEDS HTTPS`):(e.href=`https://immersiveweb.dev/`,e.innerHTML=`WEBXR NOT AVAILABLE`),e.style.left=`calc(50% - 90px)`,e.style.width=`180px`,e.style.textDecoration=`none`,s(e),e}}};exports.AdaptiveLuminancePass=AdaptiveLuminancePass,exports.AnimationFrameLoop=AnimationFrameLoop,exports.BoundingMesh=BoundingMesh,exports.Camera=Camera,exports.CustomShader=PBMCustomShader,exports.PBMCustomShader=PBMCustomShader,exports.EffectComposer=EffectComposer,exports.EyeDomeLightingPass=EyeDomeLightingPass,exports.Fetcher=Fetcher,exports.Five=Five,exports.FivePass=FivePass,exports.FiveRenderer=FiveRenderer,exports.FlowingLight2DPass=FlowingLight2DPass,exports.FlowingLight3DPass=FlowingLight3DPass,exports.FullScreenQuad=FullScreenQuad,exports.GaussianBlurPass=GaussianBlurPass,exports.Histogram=Histogram,exports.InternalWebGLRenderer=InternalWebGLRenderer,exports.Model=Model,exports.ModelScene=ModelScene,exports.Motion=Motion,exports.NetworkSubscribe=NetworkSubscribe,exports.PBMContainer=PBMContainer,exports.PBMGSObject=PBMGaussianSplattingObject,exports.PBMGroup=PBMGroup,exports.PBMMesh=PBMMesh,exports.PBMMeshMaterial=PBMMeshMaterial,exports.PBMPanoFilter=PBMPanoFilter,exports.PBMPointCloud=PBMPointCloud,exports.PBMPointCloudMaterial=PBMPointCloudMaterial,exports.PBMSkinnedMesh=PBMSkinnedMesh,exports.PBMUpdateable=PBMUpdateable,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.Tile3D=Tile3D,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.loadSplat=loadSplat,exports.loadSpz=loadSpz,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});
|