@arcgis/core 5.0.0-next.16 → 5.0.0-next.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (262) hide show
  1. package/analysis/ElevationProfile/ElevationProfileLineInput.js +1 -1
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/{adf7ccf4ef629211c7ee.js → 08aacbfb651cc2e1c054.js} +1 -1
  4. package/assets/esri/core/workers/chunks/234b52b2a391631ceff6.js +1 -0
  5. package/assets/esri/core/workers/chunks/{658cd45b5fb304fd840a.js → 3aa77696c5ea54a238da.js} +1 -1
  6. package/assets/esri/core/workers/chunks/{8f3503b2fb6cd38757b9.js → 458e87902abc24b375da.js} +1 -1
  7. package/assets/esri/core/workers/chunks/{57b410198d83bf0ab708.js → 4a89e120be142ab58a27.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{49571d6875de1f2e7e25.js → 4b9dfdc23ba3d6ebcc1b.js} +2 -2
  9. package/assets/esri/core/workers/chunks/{a410dcf80d17a2383337.js → 65a4099bdbe31834d0cc.js} +1 -1
  10. package/assets/esri/core/workers/chunks/722da7a39a0ad9300752.js +1 -0
  11. package/assets/esri/core/workers/chunks/{cdb4664fd59860ddeb5a.js → 72f1c3d97e7b9546c113.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{bc318b6fef192cee2a72.js → 76e945da8f30d8641c3d.js} +20 -20
  13. package/assets/esri/core/workers/chunks/{319c3f46f2afb8f3e5a9.js → 89c9cf7f799858d14c76.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{e19cd07df8ce87e18832.js → 8b33732e3c2924c1f60d.js} +1 -1
  15. package/assets/esri/core/workers/chunks/98739414c107ad78e4d8.js +1 -0
  16. package/assets/esri/core/workers/chunks/{8b73db0f4d6714396eb0.js → a6fa90eab77ac0e1cdfc.js} +1 -1
  17. package/assets/esri/core/workers/chunks/ac366221e8636b60aee5.js +1 -0
  18. package/assets/esri/core/workers/chunks/{23e17b745adf71a5efc7.js → aca72ca7f43f70eb8077.js} +1 -1
  19. package/assets/esri/core/workers/chunks/ad0c7225941437d18408.js +1 -0
  20. package/assets/esri/core/workers/chunks/b30897952494a3e5b9fe.js +1 -0
  21. package/assets/esri/core/workers/chunks/bfd3d81e8e148be99686.js +1 -0
  22. package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
  23. package/assets/esri/libs/lyr3d/lyr3DWorker.wasm +0 -0
  24. package/assets/esri/themes/base/widgets/_Editor.scss +2 -1
  25. package/assets/esri/themes/base/widgets/_FeatureForm.scss +1 -1
  26. package/assets/esri/themes/dark/main.css +1 -1
  27. package/assets/esri/themes/light/main.css +1 -1
  28. package/assets/esri/themes/light/view.css +1 -1
  29. package/chunks/GaussianSplat.glsl.js +2 -2
  30. package/chunks/ImageMaterial.glsl.js +1 -1
  31. package/chunks/lyr3DMain.js +1 -1
  32. package/config.js +1 -1
  33. package/graphic/graphicOriginUtils.js +1 -1
  34. package/interfaces.d.ts +113 -54
  35. package/intl/locale.js +1 -1
  36. package/kernel.js +1 -1
  37. package/layers/BingMapsLayer.js +1 -1
  38. package/layers/Lyr3DWasmPerSceneView.js +1 -1
  39. package/layers/support/attributionUtils.js +5 -0
  40. package/layers/support/fieldConfigUtils.js +1 -1
  41. package/layers/support/fieldFormatUtils.js +1 -1
  42. package/layers/video/VideoController.js +1 -1
  43. package/libs/parquet/parquet.js +1 -1
  44. package/package.json +1 -1
  45. package/support/revision.js +1 -1
  46. package/symbols/cim/SDFHelper.js +1 -1
  47. package/symbols/cim/cimAnalyzer.js +1 -1
  48. package/views/2d/LabelManager.js +1 -1
  49. package/views/2d/analysis/ElevationProfile/ElevationProfileLineVisualization2D.js +1 -1
  50. package/views/2d/engine/flow/dataUtils.js +1 -1
  51. package/views/2d/engine/webgl/FeatureTile.js +1 -1
  52. package/views/2d/engine/webgl/OverlayMultipoint.js +1 -1
  53. package/views/2d/engine/webgl/TextureManager.js +1 -1
  54. package/views/2d/engine/webgl/VideoScreenRenderer.js +1 -1
  55. package/views/2d/engine/webgl/animations/store/AnimationStore.js +1 -1
  56. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AAnimatedPolyShader.js +1 -1
  57. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedFillShader.js +1 -1
  58. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedLineShader.js +1 -1
  59. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedPolyMeshWriters.js +1 -1
  60. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedTechnique.js +1 -1
  61. package/views/2d/engine/webgl/shaderGraph/techniques/colorize/ColorizeTechnique.js +1 -1
  62. package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityResources.js +1 -1
  63. package/views/2d/engine/webgl/shaderGraph/techniques/drop-shadow/DropShadowTechnique.js +1 -1
  64. package/views/2d/engine/webgl/shaderGraph/techniques/opacity/OpacityTechnique.js +1 -1
  65. package/views/2d/engine/webgl/shaderGraph/techniques/raster/RasterColorizerTechnique.js +1 -1
  66. package/views/2d/engine/webgl/shaderGraph/techniques/raster/RasterHighlightTechnique.js +1 -1
  67. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/LineShader.js +1 -1
  68. package/views/2d/engine/webgl/textureUtils.js +1 -1
  69. package/views/2d/layers/features/FeatureContainer.js +1 -1
  70. package/views/2d/layers/features/Processor.js +1 -1
  71. package/views/2d/layers/features/processor/BinningStrategy.js +1 -1
  72. package/views/2d/layers/features/processor/ClusterStrategy.js +1 -1
  73. package/views/2d/layers/features/processor/TrackStrategy.js +1 -1
  74. package/views/2d/layers/features/support/FeatureMetadata.js +1 -1
  75. package/views/3d/GroundView3D.js +1 -1
  76. package/views/3d/analysis/Dimension/LengthDimensionSubTool.js +1 -1
  77. package/views/3d/analysis/ElevationProfile/ElevationProfileGeometryVisualization3D.js +1 -1
  78. package/views/3d/analysis/Slice/RotateManipulator.js +1 -1
  79. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillComputation.js +1 -1
  80. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementTool.js +1 -1
  81. package/views/3d/analysis/images/Factory.js +1 -1
  82. package/views/3d/environment/ChapmanAtmosphere.js +1 -1
  83. package/views/3d/environment/ChapmanAtmosphereTechnique.js +1 -1
  84. package/views/3d/environment/CloudsCompositionTechnique.js +1 -1
  85. package/views/3d/environment/CloudsTechnique.js +1 -1
  86. package/views/3d/environment/EnvironmentManager.js +1 -1
  87. package/views/3d/environment/FogTechnique.js +1 -1
  88. package/views/3d/environment/NoiseTextureAtlasTechnique.js +1 -1
  89. package/views/3d/environment/PrecipitationTechnique.js +1 -1
  90. package/views/3d/environment/SimpleAtmosphereTechnique.js +1 -1
  91. package/views/3d/layers/BuildingComponentSublayerView3D.js +1 -1
  92. package/views/3d/layers/DrapedSubView3D.js +1 -1
  93. package/views/3d/layers/FlowSubView3D.js +1 -1
  94. package/views/3d/layers/ImageryTileLayerView3D.js +1 -1
  95. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  96. package/views/3d/layers/IntegratedMeshLayerView3D.js +1 -1
  97. package/views/3d/layers/MediaLayerView3D.js +1 -1
  98. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  99. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  100. package/views/3d/layers/SceneLayerView3D.js +1 -1
  101. package/views/3d/layers/TiledLayerView3D.js +1 -1
  102. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  103. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  104. package/views/3d/layers/graphics/Graphics3DTextSymbolLayer.js +1 -1
  105. package/views/3d/layers/graphics/defaultSymbolComplexity.js +1 -1
  106. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  107. package/views/3d/layers/graphics/pipeline/rendering/FeaturePipelineRenderManager.js +1 -1
  108. package/views/3d/layers/graphics/wosrLoader.js +1 -1
  109. package/views/3d/layers/i3s/I3SMaterialUtil.js +1 -1
  110. package/views/3d/support/QualityProfile.js +5 -0
  111. package/views/3d/support/QualitySettings.js +1 -1
  112. package/views/3d/support/StreamTextureCollection.js +1 -1
  113. package/views/3d/support/TextureCollection.js +1 -1
  114. package/views/3d/support/engineContent/marker.js +1 -1
  115. package/views/3d/support/engineContent/sdfPrimitives.js +1 -1
  116. package/views/3d/support/flow/FlowSubViewTiles3D.js +1 -1
  117. package/views/3d/support/flow/FlowWorker.js +1 -1
  118. package/views/3d/support/flow/FlowWorkerHandle.js +1 -1
  119. package/views/3d/support/flow/StreamlineResources3D.js +1 -1
  120. package/views/3d/support/flow/StreamlineResources3DOverlay.js +1 -1
  121. package/views/3d/support/flow/StreamlineResources3DShape.js +1 -1
  122. package/views/3d/support/flow/constants.js +1 -1
  123. package/views/3d/support/flow/loadUtils.js +1 -1
  124. package/views/3d/support/gaussianSplatting/GaussianSplatOrderTexture.js +1 -1
  125. package/views/3d/support/popupHitTest.js +1 -1
  126. package/views/3d/terrain/BlendLayersTechnique.js +1 -1
  127. package/views/3d/terrain/OverlayRenderer.js +1 -1
  128. package/views/3d/terrain/RasterColorizerTechnique.js +1 -1
  129. package/views/3d/terrain/TerrainSurface.js +1 -1
  130. package/views/3d/terrain/TileAgent.js +1 -1
  131. package/views/3d/terrain/TileCompositor.js +1 -1
  132. package/views/3d/webgl-engine/Stage.js +1 -1
  133. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  134. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  135. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechnique.js +1 -1
  136. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
  137. package/views/3d/webgl-engine/core/material/MaterialBase.js +1 -1
  138. package/views/3d/webgl-engine/core/material/RenderTexture.js +1 -1
  139. package/views/3d/webgl-engine/core/shaderTechnique/{ReloadableShaderModule.js → ReloadableShader.js} +1 -1
  140. package/views/3d/webgl-engine/core/shaderTechnique/ShaderTechnique.js +1 -1
  141. package/views/3d/webgl-engine/effects/focusArea/FocusAreaColorTechnique.js +1 -1
  142. package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskTechnique.js +1 -1
  143. package/views/3d/webgl-engine/effects/glow/GlowBlurTechnique.js +1 -1
  144. package/views/3d/webgl-engine/effects/glow/GlowCompositionTechnique.js +1 -1
  145. package/views/3d/webgl-engine/effects/haze/Haze.js +1 -1
  146. package/views/3d/webgl-engine/effects/haze/HazeCompositingTechnique.js +1 -1
  147. package/views/3d/webgl-engine/effects/haze/HazeTechnique.js +1 -1
  148. package/views/3d/webgl-engine/effects/highlight/HighlightApplyTechnique.js +1 -1
  149. package/views/3d/webgl-engine/effects/highlight/HighlightBlurTechnique.js +1 -1
  150. package/views/3d/webgl-engine/effects/highlight/HighlightDownsampleTechnique.js +1 -1
  151. package/views/3d/webgl-engine/effects/highlight/HighlightToSingleTechnique.js +1 -1
  152. package/views/3d/webgl-engine/effects/highlight/ShadowHighlightTechnique.js +1 -1
  153. package/views/3d/webgl-engine/effects/laserlines/LaserlinePathTechnique.js +1 -1
  154. package/views/3d/webgl-engine/effects/laserlines/LaserlineTechnique.js +1 -1
  155. package/views/3d/webgl-engine/effects/magnifier/MagnifierTechnique.js +1 -1
  156. package/views/3d/webgl-engine/effects/smaa/SMAA.js +1 -1
  157. package/views/3d/webgl-engine/effects/smaa/SMAABlendWeightsTechnique.js +1 -1
  158. package/views/3d/webgl-engine/effects/smaa/SMAABlurTechnique.js +1 -1
  159. package/views/3d/webgl-engine/effects/smaa/SMAAEdgeDetectTechnique.js +1 -1
  160. package/views/3d/webgl-engine/effects/ssao/SSAO.js +1 -1
  161. package/views/3d/webgl-engine/effects/ssao/SSAOBlurTechnique.js +1 -1
  162. package/views/3d/webgl-engine/effects/ssao/SSAOTechnique.js +1 -1
  163. package/views/3d/webgl-engine/effects/stars/StarsTechnique.js +1 -1
  164. package/views/3d/webgl-engine/effects/transparency/OITBlendTechnique.js +1 -1
  165. package/views/3d/webgl-engine/lib/AnimationTimeStep.js +1 -1
  166. package/views/3d/webgl-engine/lib/BasisUtil.js +1 -1
  167. package/views/3d/webgl-engine/lib/DDSUtil.js +1 -1
  168. package/views/3d/webgl-engine/lib/GLTextureMaterial.js +1 -1
  169. package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
  170. package/views/3d/webgl-engine/lib/ManagedTexture.js +5 -0
  171. package/views/3d/webgl-engine/lib/OrderIndependentTransparency.js +1 -1
  172. package/views/3d/webgl-engine/lib/Program.js +1 -1
  173. package/views/3d/webgl-engine/lib/RenderFeature.js +1 -1
  174. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  175. package/views/3d/webgl-engine/lib/RenderingContext.js +1 -1
  176. package/views/3d/webgl-engine/lib/TextTextureAtlas.js +1 -1
  177. package/views/3d/webgl-engine/lib/TextTextureFactory.js +1 -1
  178. package/views/3d/webgl-engine/lib/TextureRepository.js +1 -1
  179. package/views/3d/webgl-engine/lib/TextureTechnique.js +1 -1
  180. package/views/3d/webgl-engine/lib/edgeRendering/EdgeShaderTechnique.js +1 -1
  181. package/views/3d/webgl-engine/lib/glUtil3D.js +1 -1
  182. package/views/3d/webgl-engine/materials/ImageMaterial.js +1 -1
  183. package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
  184. package/views/3d/webgl-engine/materials/WaterTechnique.js +1 -1
  185. package/views/3d/webgl-engine/materials/internal/WaterTextureRepository.js +1 -1
  186. package/views/3d/webgl-engine/materials/stippleTextureRepository.js +1 -1
  187. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  188. package/views/3d/webgl-engine/shaders/AtmosphereCompositingTechnique.js +1 -1
  189. package/views/3d/webgl-engine/shaders/CheckerBoardTechnique.js +1 -1
  190. package/views/3d/webgl-engine/shaders/ColorMaterialTechnique.js +1 -1
  191. package/views/3d/webgl-engine/shaders/CompositingTechnique.js +1 -1
  192. package/views/3d/webgl-engine/shaders/CutFillCompositionTechnique.js +1 -1
  193. package/views/3d/webgl-engine/shaders/CutFillDepthTechnique.js +1 -1
  194. package/views/3d/webgl-engine/shaders/CutFillMaskTechnique.js +1 -1
  195. package/views/3d/webgl-engine/shaders/CutFillReductionTechnique.js +1 -1
  196. package/views/3d/webgl-engine/shaders/CutFillTargetDepthTechnique.js +1 -1
  197. package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
  198. package/views/3d/webgl-engine/shaders/GaussianSplat.glsl.js +1 -1
  199. package/views/3d/webgl-engine/shaders/GaussianSplatCompositionTechnique.js +1 -1
  200. package/views/3d/webgl-engine/shaders/GaussianSplatDepthCompositionTechnique.js +1 -1
  201. package/views/3d/webgl-engine/shaders/GaussianSplatDepthTechnique.js +1 -1
  202. package/views/3d/webgl-engine/shaders/GaussianSplatTechnique.js +1 -1
  203. package/views/3d/webgl-engine/shaders/GaussianSplatTechniqueConfiguration.js +1 -1
  204. package/views/3d/webgl-engine/shaders/HUDCompositingTechnique.js +1 -1
  205. package/views/3d/webgl-engine/shaders/HUDMaterialTechnique.js +1 -1
  206. package/views/3d/webgl-engine/shaders/HeatmapDensityTechnique.js +1 -1
  207. package/views/3d/webgl-engine/shaders/HeatmapTechnique.js +1 -1
  208. package/views/3d/webgl-engine/shaders/ImageMaterialTechnique.js +1 -1
  209. package/views/3d/webgl-engine/shaders/LineCalloutTechnique.js +1 -1
  210. package/views/3d/webgl-engine/shaders/LineMarkerTechnique.js +1 -1
  211. package/views/3d/webgl-engine/shaders/MeasurementArrowTechnique.js +1 -1
  212. package/views/3d/webgl-engine/shaders/NativeLineTechnique.js +1 -1
  213. package/views/3d/webgl-engine/shaders/OverlayCompositingTechnique.js +1 -1
  214. package/views/3d/webgl-engine/shaders/PatternTechnique.js +1 -1
  215. package/views/3d/webgl-engine/shaders/PointRendererTechnique.js +1 -1
  216. package/views/3d/webgl-engine/shaders/RealisticTreeTechnique.js +1 -1
  217. package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
  218. package/views/3d/webgl-engine/shaders/ShadedColorMaterialTechnique.js +1 -1
  219. package/views/3d/webgl-engine/shaders/ShadowCastAccumulateTechnique.js +1 -1
  220. package/views/3d/webgl-engine/shaders/ShadowCastClearTechnique.js +1 -1
  221. package/views/3d/webgl-engine/shaders/ShadowCastVisualizeTechnique.js +1 -1
  222. package/views/3d/webgl-engine/shaders/SlicePlaneMaterialTechnique.js +1 -1
  223. package/views/3d/webgl-engine/shaders/TerrainTechnique.js +1 -1
  224. package/views/3d/webgl-engine/shaders/ViewshedTechnique.js +1 -1
  225. package/views/GroundView.js +1 -1
  226. package/views/SceneView.js +1 -1
  227. package/views/analysis/ElevationProfile/ElevationProfileTool.js +1 -1
  228. package/views/analysis/ElevationProfile/types.d.ts +5 -0
  229. package/views/analysis/ElevationProfile/types.js +5 -0
  230. package/views/support/layerViewUtils.js +1 -1
  231. package/views/webgl/Texture.js +1 -1
  232. package/views/webgl/VertexAttributeLocations.js +1 -1
  233. package/views/webgl/testSVGPremultipliedAlpha.js +1 -1
  234. package/widgets/Attribution/AttributionViewModel.js +1 -1
  235. package/widgets/Editor/MergeFeaturesWorkflow.js +1 -1
  236. package/widgets/Editor/SplitFeatureWorkflow.js +1 -1
  237. package/widgets/Editor/UpdateWorkflow.js +1 -1
  238. package/widgets/Editor/Workflow.js +1 -1
  239. package/widgets/Editor/components/CreateFeaturesPanelContent.js +1 -1
  240. package/widgets/Editor/components/PendingFeatureList.js +1 -1
  241. package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
  242. package/widgets/Editor.js +1 -1
  243. package/widgets/Feature/support/featureUtils.js +1 -1
  244. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationList.js +1 -1
  245. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationSettings.js +1 -1
  246. package/widgets/FeatureTable/FieldColumn.js +1 -1
  247. package/widgets/FeatureTable/Grid/Column.js +1 -1
  248. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  249. package/widgets/OrientedImageryViewer/adapters/view/MapViewAdapter.js +1 -1
  250. package/widgets/OrientedImageryViewer/adapters/view/SceneViewAdapter.js +1 -1
  251. package/widgets/OrientedImageryViewer/components/OrientedImageryVideoViewModel.js +1 -1
  252. package/widgets/support/UtilityNetworkAssociations/FeatureUtilityNetworkAssociationsViewModel.js +1 -1
  253. package/assets/esri/core/workers/chunks/38ee69125da60464d5a1.js +0 -1
  254. package/assets/esri/core/workers/chunks/4f0016111fd84c612f41.js +0 -1
  255. package/assets/esri/core/workers/chunks/8208dfa8f7fae7e616b9.js +0 -1
  256. package/assets/esri/core/workers/chunks/847f4fc39100fac1df01.js +0 -1
  257. package/assets/esri/core/workers/chunks/ab005fe84952f0676020.js +0 -1
  258. package/assets/esri/core/workers/chunks/bc19a232076d98825eef.js +0 -1
  259. package/assets/esri/core/workers/chunks/c3dcfe26c2c3c829762d.js +0 -1
  260. package/views/3d/support/DisplayQualityProfile.js +0 -5
  261. package/views/3d/webgl-engine/lib/Texture.js +0 -5
  262. /package/views/3d/webgl-engine/lib/{ITexture.js → IManagedTexture.js} +0 -0
@@ -1,4 +1,4 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[2883],{1843:(e,t,r)=>{r.d(t,{BP:()=>u,l5:()=>h});var i=r(20498),n=r(13030),o=r(90239),a=r(4431),s=r(620),l=r(85079);class c{constructor(e,t){this.layout=e,this.buffer="number"==typeof t?new ArrayBuffer(t*e.stride):t;for(const t of e.fields.keys()){const r=e.fields.get(t);this[t]=new r.constructor(this.buffer,r.offset,this.stride)}}get stride(){return this.layout.stride}get count(){return this.buffer.byteLength/this.stride}get byteLength(){return this.buffer.byteLength}getField(e,t){const r=this[e];return r&&r.elementCount===t.ElementCount&&r.elementType===t.ElementType?r:null}slice(e,t){return new c(this.layout,this.buffer.slice(e*this.stride,t*this.stride))}copyFrom(e,t=0,r=0,i=e.count){const n=this.stride;if(n%4==0){const o=new Uint32Array(e.buffer,t*n,i*n/4);new Uint32Array(this.buffer,r*n,i*n/4).set(o)}else{const o=new Uint8Array(e.buffer,t*n,i*n);new Uint8Array(this.buffer,r*n,i*n).set(o)}return this}get usedMemory(){return this.byteLength}dispose(){}}class d{constructor(e){this._stride=0,this._fields=new Map,e&&(this._stride=e.stride,e.fields.forEach(e=>this._fields.set(e[0],{...e[1],constructor:f(e[1].constructor)})))}freeze(){return this}get locations(){return(0,l.Xk)((0,a.U)(this))}vec2f16(e,t){return this._appendField(e,i.SX?n.ZD:n.gH,t),this}vec2f(e,t){return this._appendField(e,n.gH,t),this}vec2f64(e,t){return this._appendField(e,n.si,t),this}vec3f16(e,t){return this._appendField(e,i.SX?n.EC:n.xs,t),this}vec3f(e,t){return this._appendField(e,n.xs,t),this}vec3f64(e,t){return this._appendField(e,n.Xm,t),this}vec4f16(e,t){return this._appendField(e,i.SX?n.jz:n.Eq,t),this}vec4f(e,t){return this._appendField(e,n.Eq,t),this}vec4f64(e,t){return this._appendField(e,n.Aj,t),this}mat3f(e,t){return this._appendField(e,n.jZ,t),this}mat3f64(e,t){return this._appendField(e,n.j0,t),this}mat4f(e,t){return this._appendField(e,n.Sx,t),this}mat4f64(e,t){return this._appendField(e,n.E$,t),this}vec4u8(e,t){return this._appendField(e,n.XP,t),this}f16(e,t){return this._appendField(e,i.SX?n.XW:n.Y$,t),this}f32(e,t){return this._appendField(e,n.Y$,t),this}f64(e,t){return this._appendField(e,n.qB,t),this}u8(e,t){return this._appendField(e,n.SL,t),this}u16(e,t){return this._appendField(e,n.h,t),this}i8(e,t){return this._appendField(e,n.bf,t),this}vec2i8(e,t){return this._appendField(e,n.D6,t),this}vec2i16(e,t){return this._appendField(e,n.mJ,t),this}vec2u8(e,t){return this._appendField(e,n.LC,t),this}vec2u16(e,t){return this._appendField(e,n.Yi,t),this}vec4u16(e,t){return this._appendField(e,n.Uz,t),this}vec4i16(e,t){return this._appendField(e,n.E7,t),this}u32(e,t){return this._appendField(e,n.P,t),this}_appendField(e,t,r){this._fields.has(e)&&(0,s.vA)(!1,`${e} already added to vertex buffer layout`);const i=t.ElementCount*(0,o.GJ)(t.ElementType),n=this._stride;this._fields.set(e,{constructor:t,size:i,offset:n,optional:r}),this._alignFields()}_alignFields(){let e=0,t=1;this._fields.forEach(r=>{const i=(0,o.GJ)(r.constructor.ElementType);e=Math.floor((e+i-1)/i)*i,r.offset=e,e+=r.size,t=Math.max(t,i)}),e=Math.floor((e+t-1)/t)*t,this._stride=e}createBuffer(e){return new c(this,e)}createView(e){return new c(this,e)}clone(){const e=new d;return e._stride=this._stride,e._fields=new Map,this._fields.forEach((t,r)=>e._fields.set(r,t)),e.BufferType=this.BufferType,e}get stride(){return this._stride}get fields(){return this._fields}}function u(){return new d}class h{constructor(e){this.fields=new Array,e.fields.forEach((e,t)=>{const r={...e,constructor:m(e.constructor)};this.fields.push([t,r])}),this.stride=e.stride}}const p=[n.Y$,n.gH,n.xs,n.Eq,n.jZ,n.Sx,n.qB,n.si,n.Xm,n.Aj,n.j0,n.E$,n.SL,n.LC,n.eI,n.XP,n.h,n.Yi,n.nS,n.Uz,n.P,n.An,n.H$,n.ml,n.bf,n.D6,n.m8,n.TX,n.Qt,n.mJ,n.Vp,n.E7,n.My,n.UL,n.zD,n.Y4];function m(e){return`${e.ElementType}_${e.ElementCount}`}function f(e){return g.get(e)}const g=new Map;p.forEach(e=>g.set(m(e),e))},2495:(e,t,r)=>{r.d(t,{$U:()=>Ee,fs:()=>Re,ty:()=>Ie});var i=r(38954),n=r(51850),o=r(49255),a=r(25634),s=r(11725),l=r(33524),c=r(70328),d=r(620);class u{constructor(e=0,t=!1,r=!0){this.tolerance=e,this.isVerticalRay=t,this.normalRequired=r}}const h=(0,c.vt)(),p=(0,n.vt)();function m(e,t,r,n,o,a,s){if(null==e)return;const l=function(e,t){return(0,i.j)(t,1/e[0],1/e[1],1/e[2])}(r,p);if((0,c.Ne)(h,e.bbMin),(0,c.vI)(h,e.bbMax),null!=o&&o.applyToAabb(h),function(e,t,r,i){return function(e,t,r,i){const n=(e[0]-i-t[0])*r[0],o=(e[3]+i-t[0])*r[0];let a=Math.min(n,o),s=Math.max(n,o);const l=(e[1]-i-t[1])*r[1],c=(e[4]+i-t[1])*r[1];if(s=Math.min(s,Math.max(l,c)),s<0)return!1;if(a=Math.max(a,Math.min(l,c)),a>s)return!1;const d=(e[2]-i-t[2])*r[2],u=(e[5]+i-t[2])*r[2];return s=Math.min(s,Math.max(d,u)),!(s<0)&&(a=Math.max(a,Math.min(d,u)),!(a>s)&&a<1/0)}(e,t,r,i)}(h,t,l,n)){const{primitiveIndices:i,position:l}=e,c=i?i.length:l.indices.length/3;if(c>T){const i=e.getChildren();if(void 0!==i){for(const e of i)m(e,t,r,n,o,a,s);return}}!function(e,t,r,i,n,o,a,s,l,c,d){const u=e[0],h=e[1],p=e[2],m=t[0],g=t[1],v=t[2],{normalRequired:_}=c;for(let e=0;e<i;++e){const t=s[e],r=3*t,i=a*n[r];let c=o[i],x=o[i+1],y=o[i+2];const b=a*n[r+1];let M=o[b],T=o[b+1],S=o[b+2];const E=a*n[r+2];let A=o[E],R=o[E+1],I=o[E+2];null!=l&&([c,x,y]=l.applyToVertex(c,x,y,e),[M,T,S]=l.applyToVertex(M,T,S,e),[A,R,I]=l.applyToVertex(A,R,I,e));const F=M-c,O=T-x,P=S-y,D=A-c,N=R-x,H=I-y,L=g*H-N*v,z=v*D-H*m,B=m*N-D*g,G=F*L+O*z+P*B;if(Math.abs(G)<=C)continue;const U=u-c,V=h-x,j=p-y,W=U*L+V*z+j*B;if(G>0){if(W<0||W>G)continue}else if(W>0||W<G)continue;const k=V*P-O*j,$=j*F-P*U,Z=U*O-F*V,q=m*k+g*$+v*Z;if(G>0){if(q<0||W+q>G)continue}else if(q>0||W+q<G)continue;const Y=(D*k+N*$+H*Z)/G;Y>=0&&d(Y,t,_?w(F,O,P,D,N,H,f):null)}}(t,r,0,c,l.indices,l.data,l.stride,i,o,a,s)}}const f=(0,n.vt)();function g(e,t,r,i,n,o,a,s){const l=e[0],c=e[1],d=e[2],u=t[0],h=t[1],p=t[2];for(let e=r;e<i;++e){const t=3*e,r=t+1,i=t+2,m=o*t,g=n[m],v=n[m+1],_=n[m+2],x=o*r,y=o*i,b=n[x]-g,M=n[x+1]-v,T=n[x+2]-_,S=n[y]-g,E=n[y+1]-v,A=n[y+2]-_,R=h*A-E*p,I=p*S-A*u,F=u*E-S*h,O=b*R+M*I+T*F;if(Math.abs(O)<=C)continue;const P=l-g,D=c-v,N=d-_,H=P*R+D*I+N*F;if(O>0){if(H<0||H>O)continue}else if(H>0||H<O)continue;const L=D*T-M*N,z=N*b-T*P,B=P*M-b*D,G=u*L+h*z+p*B;if(O>0){if(G<0||H+G>O)continue}else if(G>0||H+G<O)continue;const U=(S*L+E*z+A*B)/O;U>=0&&s(U,e,a?w(b,M,T,S,E,A,f):null)}}const v=(0,n.vt)(),_=(0,n.vt)(),x=(0,n.vt)();function w(e,t,r,n,o,a,s){return(0,i.j)(b,e,t,r),(0,i.j)(M,n,o,a),(0,i.i)(s,b,M),(0,i.n)(s,s),s}function y(e){return(0,i.a)(b,e[1],e[0]),(0,i.a)(M,e[2],e[0]),(0,i.i)(f,b,M),(0,i.n)(f,f),f}const b=(0,n.vt)(),M=(0,n.vt)(),T=1e3,C=1e-7,S=(0,n.vt)(),E=[(0,n.vt)(),(0,n.vt)(),(0,n.vt)()];var A=r(16396),R=r(13030),I=r(59907);class F{constructor(e){this.layout=e}elementCount(e){return e.get("position").indices.length}write(e,t,r,i,n,o){return(0,I.vJ)(r,i,this.layout,e,t,n,o)}intersect(e,t,r,n,o,a,s){const l=this.layout.createView(e).getField("position",R.xs);if(null==l)return;const c=(0,i.a)(O,a,o),d=l.count/3,u=n.options.normalRequired;g(o,c,0,d,l.typedBuffer,l.typedBufferStride,u,(e,t,r)=>s(e,r,t))}}const O=(0,n.vt)();var P=r(43616),D=r(91829),N=r(4431),H=r(1843),L=r(72824),z=r(97220),B=r(98958),G=r(16943);const U={mask:255},V={function:{func:519,ref:2,mask:2},operation:{fail:7680,zFail:7680,zPass:0}},j={function:{func:519,ref:2,mask:2},operation:{fail:7680,zFail:7680,zPass:7681}};var W=r(4576),k=r(44208);r(53966),r(34275),r(94656),r(63907),(0,k.A)("esri-tests-disable-gpu-memory-measurements");var $=r(31635),Z=r(69622),q=r(65529),Y=r(10107),X=r(64108),J=r(77690),K=r(29242),Q=r(58083),ee=r(9093),te=r(32728);class re{constructor(e){this.localTransform=e.localTransform,this.globalTransform=e.globalTransform,this.modelOrigin=e.modelOrigin,this.model=e.instanceModel,this.modelNormal=e.instanceModelNormal,this.modelScaleFactors=e.modelScaleFactors,this.boundingSphere=e.boundingSphere,this.featureAttribute=e.getField("instanceFeatureAttribute",R.Eq),this.color=e.getField("instanceColor",R.XP),this.olidColor=e.getField("instanceOlidColor",R.XP),this.state=e.getField("state",R.SL),this.lodLevel=e.getField("lodLevel",R.SL)}}let ie=class extends Z.A{constructor(e,t){super(e),this.events=new q.bk,this._capacity=0,this._size=0,this._next=0,this._highlightOptionsMap=new Map,this._highlightOptionsMapPrev=new Map,this._layout=function(e){return oe(ne.clone(),e).u8("state").u8("lodLevel")}(t),this._capacity=de,this._buffer=this._layout.createBuffer(this._capacity),this._view=new re(this._buffer)}get capacity(){return this._capacity}get size(){return this._size}get view(){return this._view}addInstance(){this._size+1>this._capacity&&this._grow();const e=this._findSlot();return this._view.state.set(e,1),this._size++,this.events.emit("instances-changed"),e}removeInstance(e){const t=this._view.state;(0,d.vA)(e>=0&&e<this._capacity&&!!(1&t.get(e)),"invalid instance handle"),this._getStateFlag(e,18)?this._setStateFlags(e,32):this.freeInstance(e),this.events.emit("instances-changed")}freeInstance(e){const t=this._view.state;(0,d.vA)(e>=0&&e<this._capacity&&!!(1&t.get(e)),"invalid instance handle"),t.set(e,0),this._size--}setLocalTransform(e,t,r=!0){this._view.localTransform.setMat(e,t),r&&this.updateModelTransform(e)}getLocalTransform(e,t){this._view.localTransform.getMat(e,t)}setGlobalTransform(e,t,r=!0){this._view.globalTransform.setMat(e,t),r&&this.updateModelTransform(e)}getGlobalTransform(e,t){this._view.globalTransform.getMat(e,t)}updateModelTransform(e){const t=this._view,r=ae,n=se;t.localTransform.getMat(e,le),t.globalTransform.getMat(e,ce);const o=(0,Q.lw)(ce,ce,le);(0,i.j)(r,o[12],o[13],o[14]),t.modelOrigin.setVec(e,r),(0,J.z0)(n,o),t.model.setMat(e,n);const a=(0,te.wp)(ae,o);a.sort(),t.modelScaleFactors.set(e,0,a[1]),t.modelScaleFactors.set(e,1,a[2]),(0,J.B8)(n,n),(0,J.mg)(n,n),t.modelNormal.setMat(e,n),this._setStateFlags(e,64),this.events.emit("instance-transform-changed",{index:e})}getModelTransform(e,t){const r=this._view;r.model.getMat(e,se),r.modelOrigin.getVec(e,ae),t[0]=se[0],t[1]=se[1],t[2]=se[2],t[3]=0,t[4]=se[3],t[5]=se[4],t[6]=se[5],t[7]=0,t[8]=se[6],t[9]=se[7],t[10]=se[8],t[11]=0,t[12]=ae[0],t[13]=ae[1],t[14]=ae[2],t[15]=1}applyShaderTransformation(e,t){null!=this.shaderTransformation&&this.shaderTransformation.applyTransform(this,e,t)}getCombinedModelTransform(e,t){return this.getModelTransform(e,t),null!=this.shaderTransformation&&this.shaderTransformation.applyTransform(this,e,t),t}getCombinedLocalTransform(e,t){this._view.localTransform.getMat(e,t),null!=this.shaderTransformation&&this.shaderTransformation.applyTransform(this,e,t)}getCombinedMaxScaleFactor(e){let t=this._view.modelScaleFactors.get(e,1);return null!=this.shaderTransformation&&(this.shaderTransformation.scaleFactor(ae,this,e),t*=Math.max(ae[0],ae[1],ae[2])),t}getCombinedMedianScaleFactor(e){let t=this._view.modelScaleFactors.get(e,0);return null!=this.shaderTransformation&&(this.shaderTransformation.scaleFactor(ae,this,e),t*=function(e,t,r){return Math.max(Math.min(e,t),Math.min(Math.max(e,t),r))}(ae[0],ae[1],ae[2])),t}getModel(e,t){this._view.model.getMat(e,t)}setFeatureAttribute(e,t){this._view.featureAttribute?.setVec(e,t)}getFeatureAttribute(e,t){this._view.featureAttribute?.getVec(e,t)}setColor(e,t){this._view.color?.setVec(e,t)}setObjectAndLayerIdColor(e,t){this._view.olidColor?.setVec(e,t)}setVisible(e,t){t!==this.getVisible(e)&&(this._setStateFlag(e,4,t),this.events.emit("instance-visibility-changed",{index:e}))}getVisible(e){return this._getStateFlag(e,4)}setHighlight(e,t){const{_highlightOptionsMap:r}=this,i=r.get(e);t?t!==i&&(r.set(e,t),this._setStateFlag(e,8,!0),this.events.emit("instance-highlight-changed")):i&&(r.delete(e),this._setStateFlag(e,8,!1),this.events.emit("instance-highlight-changed"))}get highlightOptionsMap(){return this._highlightOptionsMap}getHighlightStateFlag(e){return this._getStateFlag(e,8)}geHighlightOptionsPrev(e){const t=this._highlightOptionsMapPrev.get(e)??null;return this._highlightOptionsMapPrev.delete(e),t}getHighlightName(e){const t=this.highlightOptionsMap.get(e)??null;return t?this._highlightOptionsMapPrev.set(e,t):this._highlightOptionsMapPrev.delete(e),t}getState(e){return this._view.state.get(e)}getLodLevel(e){return this._view.lodLevel.get(e)}countFlags(e){let t=0;for(let r=0;r<this._capacity;++r)this.getState(r)&e&&++t;return t}_setStateFlags(e,t){const r=this._view.state;t=r.get(e)|t,r.set(e,t)}_clearStateFlags(e,t){const r=this._view.state;t=r.get(e)&~t,r.set(e,t)}_setStateFlag(e,t,r){r?this._setStateFlags(e,t):this._clearStateFlags(e,t)}_getStateFlag(e,t){return!!(this._view.state.get(e)&t)}_grow(){this._capacity=Math.max(de,Math.floor(this._capacity*W.Ji)),this._buffer=this._layout.createBuffer(this._capacity).copyFrom(this._buffer),this._view=new re(this._buffer)}_findSlot(){const e=this._view.state;let t=this._next;for(;1&e.get(t);)t=t+1===this._capacity?0:t+1;return this._next=t+1===this._capacity?0:t+1,t}};(0,$.Cg)([(0,Y.MZ)({constructOnly:!0})],ie.prototype,"shaderTransformation",void 0),(0,$.Cg)([(0,Y.MZ)()],ie.prototype,"_size",void 0),(0,$.Cg)([(0,Y.MZ)({readOnly:!0})],ie.prototype,"size",null),ie=(0,$.Cg)([(0,X.$)("esri.views.3d.webgl-engine.lib.lodRendering.InstanceData")],ie);const ne=(0,H.BP)().mat4f64("localTransform").mat4f64("globalTransform").vec4f64("boundingSphere").vec3f64("modelOrigin").mat3f("instanceModel").mat3f("instanceModelNormal").vec2f("modelScaleFactors");function oe(e,t){return t.instancedFeatureAttribute&&e.vec4f("instanceFeatureAttribute"),t.instancedColor&&e.vec4u8("instanceColor"),(0,G.E)()&&e.vec4u8("instanceOlidColor"),e}const ae=(0,n.vt)(),se=(0,K.vt)(),le=(0,ee.vt)(),ce=(0,ee.vt)(),de=64,ue=(0,H.BP)().vec3f("instanceModelOriginHi").vec3f("instanceModelOriginLo").mat3f("instanceModel").mat3f("instanceModelNormal");var he=r(74810),pe=r(28491),me=r(90644),fe=r(85079),ge=r(49788);class ve extends L.Zo{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=he.mb,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=2,this.instanced=!1,this.instancedFeatureAttribute=!1,this.instancedColor=!1,this.instanceColorEncodesAlphaIgnore=!1,this.emissiveStrength=0,this.emissiveSource=1,this.emissiveBaseColor=n.uY,this.instancedDoublePrecision=!1,this.normalType=0,this.receiveShadows=!0,this.receiveAmbientOcclusion=!0,this.castShadows=!0,this.ambient=(0,n.CN)(.2,.2,.2),this.diffuse=(0,n.CN)(.8,.8,.8),this.externalColor=(0,D.fA)(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=(0,n.vt)(),this.hasSlicePlane=!1,this.offsetTransparentBackfaces=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.modelTransformation=null,this.drivenOpacity=!1,this.writeDepth=!0,this.customDepthTest=0,this.textureAlphaMode=0,this.textureAlphaCutoff=ge.Q,this.textureAlphaPremultiplied=!1,this.renderOccluded=1,this.isDecoration=!1}get hasVVSize(){return!!this.vvSize}get hasVVColor(){return!!this.vvColor}get hasVVOpacity(){return!!this.vvOpacity}}L.gy;class _e extends B.w{constructor(e,t,i=new z.$(pe.D,()=>r.e(5141).then(r.bind(r,5141)))){const n=[(0,N.U)(ye(t))];t.instanced&&t.instancedDoublePrecision&&n.push((0,N.U)(function(e){return oe(ue.clone(),e)}(t))),super(e,t,i,(0,fe._u)(n))}_makePipeline(e,t){const{oitPass:r,output:i,transparent:n,cullFace:a,customDepthTest:s,hasOccludees:c}=e;return(0,me.Ey)({blending:(0,o.RN)(i)&&n?(0,l.Yf)(r):null,culling:we(e)?(0,me.Xt)(a):null,depthTest:{func:(0,l.K_)(r,xe(s))},depthWrite:(0,l.z5)(e),drawBuffers:(0,B.L)(i,(0,l.m6)(r,i)),colorWrite:me.kn,stencilWrite:c?U:null,stencilTest:c?t?j:V:null,polygonOffset:(0,l.mE)(e)})}initializePipeline(e){return this._occludeePipelineState=this._makePipeline(e,!0),this._makePipeline(e,!1)}getPipeline(e){return e?this._occludeePipelineState:super.getPipeline()}}function xe(e){switch(e){case 1:return 515;case 0:case 3:return 513;case 2:return 516}}function we(e){return 0!==e.cullFace||!e.hasSlicePlane&&!e.transparent&&!e.doubleSidedMode}function ye(e){const t=(0,H.BP)().vec3f("position");return 1===e.normalType?t.vec2i16("normalCompressed",{glNormalized:!0}):t.vec3f("normal"),e.hasVertexTangents&&t.vec4f("tangent"),e.hasTextures&&t.vec2f16("uv0"),e.hasVertexColors&&t.vec4u8("color"),e.hasSymbolColors&&t.vec4u8("symbolColor"),!e.instanced&&(0,G.E)()&&t.vec4u8("olidColor"),t}var be=r(51976),Me=r(35256);class Te extends Me.E{constructor(e){super(),this.spherical=e,this.alphaDiscardMode=1,this.doubleSidedMode=0,this.pbrMode=0,this.cullFace=0,this.normalType=0,this.customDepthTest=0,this.emissionSource=0,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.hasVerticalOffset=!1,this.hasColorTexture=!1,this.hasMetallicRoughnessTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasScreenSizePerspective=!1,this.hasVertexTangents=!1,this.hasOccludees=!1,this.instanced=!1,this.instancedDoublePrecision=!1,this.hasModelTransformation=!1,this.offsetBackfaces=!1,this.hasVVSize=!1,this.hasVVColor=!1,this.receiveShadows=!1,this.receiveAmbientOcclusion=!1,this.textureAlphaPremultiplied=!1,this.instancedFeatureAttribute=!1,this.instancedColor=!1,this.writeDepth=!0,this.transparent=!1,this.enableOffset=!0,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.snowCover=!1,this.hasColorTextureTransform=!1,this.hasEmissionTextureTransform=!1,this.hasNormalTextureTransform=!1,this.hasOcclusionTextureTransform=!1,this.hasMetallicRoughnessTextureTransform=!1,this.occlusionPass=!1,this.useCustomDTRExponentForWater=!1,this.useFillLights=!0,this.draped=!1}get textureCoordinateType(){return this.hasTextures?1:0}get hasTextures(){return this.hasColorTexture||this.hasNormalTexture||this.hasMetallicRoughnessTexture||3===this.emissionSource||this.hasOcclusionTexture}get hasVVInstancing(){return this.instanced}get discardInvisibleFragments(){return this.transparent}}(0,$.Cg)([(0,be.W)({count:4})],Te.prototype,"alphaDiscardMode",void 0),(0,$.Cg)([(0,be.W)({count:3})],Te.prototype,"doubleSidedMode",void 0),(0,$.Cg)([(0,be.W)({count:7})],Te.prototype,"pbrMode",void 0),(0,$.Cg)([(0,be.W)({count:3})],Te.prototype,"cullFace",void 0),(0,$.Cg)([(0,be.W)({count:3})],Te.prototype,"normalType",void 0),(0,$.Cg)([(0,be.W)({count:3})],Te.prototype,"customDepthTest",void 0),(0,$.Cg)([(0,be.W)({count:8})],Te.prototype,"emissionSource",void 0),(0,$.Cg)([(0,be.W)()],Te.prototype,"hasVertexColors",void 0),(0,$.Cg)([(0,be.W)()],Te.prototype,"hasSymbolColors",void 0),(0,$.Cg)([(0,be.W)()],Te.prototype,"hasVerticalOffset",void 0),(0,$.Cg)([(0,be.W)()],Te.prototype,"hasColorTexture",void 0),(0,$.Cg)([(0,be.W)()],Te.prototype,"hasMetallicRoughnessTexture",void 0),(0,$.Cg)([(0,be.W)()],Te.prototype,"hasOcclusionTexture",void 0),(0,$.Cg)([(0,be.W)()],Te.prototype,"hasNormalTexture",void 0),(0,$.Cg)([(0,be.W)()],Te.prototype,"hasScreenSizePerspective",void 0),(0,$.Cg)([(0,be.W)()],Te.prototype,"hasVertexTangents",void 0),(0,$.Cg)([(0,be.W)()],Te.prototype,"hasOccludees",void 0),(0,$.Cg)([(0,be.W)()],Te.prototype,"instanced",void 0),(0,$.Cg)([(0,be.W)()],Te.prototype,"instancedDoublePrecision",void 0),(0,$.Cg)([(0,be.W)()],Te.prototype,"hasModelTransformation",void 0),(0,$.Cg)([(0,be.W)()],Te.prototype,"offsetBackfaces",void 0),(0,$.Cg)([(0,be.W)()],Te.prototype,"hasVVSize",void 0),(0,$.Cg)([(0,be.W)()],Te.prototype,"hasVVColor",void 0),(0,$.Cg)([(0,be.W)()],Te.prototype,"receiveShadows",void 0),(0,$.Cg)([(0,be.W)()],Te.prototype,"receiveAmbientOcclusion",void 0),(0,$.Cg)([(0,be.W)()],Te.prototype,"textureAlphaPremultiplied",void 0),(0,$.Cg)([(0,be.W)()],Te.prototype,"instancedFeatureAttribute",void 0),(0,$.Cg)([(0,be.W)()],Te.prototype,"instancedColor",void 0),(0,$.Cg)([(0,be.W)()],Te.prototype,"writeDepth",void 0),(0,$.Cg)([(0,be.W)()],Te.prototype,"transparent",void 0),(0,$.Cg)([(0,be.W)()],Te.prototype,"enableOffset",void 0),(0,$.Cg)([(0,be.W)()],Te.prototype,"terrainDepthTest",void 0),(0,$.Cg)([(0,be.W)()],Te.prototype,"cullAboveTerrain",void 0),(0,$.Cg)([(0,be.W)()],Te.prototype,"snowCover",void 0),(0,$.Cg)([(0,be.W)()],Te.prototype,"hasColorTextureTransform",void 0),(0,$.Cg)([(0,be.W)()],Te.prototype,"hasEmissionTextureTransform",void 0),(0,$.Cg)([(0,be.W)()],Te.prototype,"hasNormalTextureTransform",void 0),(0,$.Cg)([(0,be.W)()],Te.prototype,"hasOcclusionTextureTransform",void 0),(0,$.Cg)([(0,be.W)()],Te.prototype,"hasMetallicRoughnessTextureTransform",void 0);var Ce=r(57323);class Se extends _e{constructor(e,t){super(e,t,new z.$(Ce.R,()=>r.e(2314).then(r.bind(r,39933))))}}class Ee extends s.i{constructor(e,t){super(e,Re),this.materialType="default",this.supportsEdges=!0,this.intersectDraped=void 0,this.produces=new Map([[2,e=>((0,o.iq)(e)||(0,o.Bf)(e))&&!this.transparent],[4,e=>((0,o.iq)(e)||(0,o.Bf)(e))&&this.transparent&&this.parameters.writeDepth],[8,e=>((0,o.iq)(e)||(0,o.Bf)(e))&&this.transparent&&!this.parameters.writeDepth]]),this._layout=ye(this.parameters),this._configuration=new Te(t.spherical)}isVisibleForOutput(e){return 4!==e&&6!==e&&5!==e||this.parameters.castShadows}get visible(){const{layerOpacity:e,colorMixMode:t,opacity:r,externalColor:i}=this.parameters;return e*("replace"===t?1:r)*("ignore"===t||isNaN(i[3])?1:i[3])>=ge.Q}get _hasEmissiveBase(){return!!this.parameters.emissiveTextureId||!(0,i.q)(this.parameters.emissiveBaseColor,n.uY)}get hasEmissions(){return this.parameters.emissiveStrength>0&&(0===this.parameters.emissiveSource&&this._hasEmissiveBase||1===this.parameters.emissiveSource)}getConfiguration(e,t){const{parameters:r,_configuration:i}=this,{treeRendering:n,doubleSided:a,doubleSidedType:s}=r;return super.getConfiguration(e,t,this._configuration),i.hasNormalTexture=r.hasNormalTexture,i.hasColorTexture=r.hasColorTexture,i.hasMetallicRoughnessTexture=r.hasMetallicRoughnessTexture,i.hasOcclusionTexture=r.hasOcclusionTexture,i.hasVertexTangents=!n&&r.hasVertexTangents,i.instanced=r.instanced,i.instancedDoublePrecision=r.instancedDoublePrecision,i.hasVVColor=!!r.vvColor,i.hasVVSize=!!r.vvSize,i.hasVerticalOffset=null!=r.verticalOffset,i.hasScreenSizePerspective=null!=r.screenSizePerspective,i.hasSlicePlane=r.hasSlicePlane,i.alphaDiscardMode=r.textureAlphaMode,i.normalType=n?0:r.normalType,i.transparent=this.transparent,i.writeDepth=r.writeDepth,i.customDepthTest=r.customDepthTest??0,i.hasOccludees=t.hasOccludees,i.cullFace=r.hasSlicePlane?0:r.cullFace,i.cullAboveTerrain=t.cullAboveTerrain,i.hasModelTransformation=!n&&null!=r.modelTransformation,i.hasVertexColors=r.hasVertexColors,i.hasSymbolColors=r.hasSymbolColors,i.doubleSidedMode=n?2:a&&"normal"===s?1:a&&"winding-order"===s?2:0,i.instancedFeatureAttribute=r.instancedFeatureAttribute,i.instancedColor=r.instancedColor,(0,o.RN)(e)?(i.terrainDepthTest=t.terrainDepthTest,i.receiveShadows=r.receiveShadows,i.receiveAmbientOcclusion=r.receiveAmbientOcclusion&&null!=t.ssao):(i.terrainDepthTest=!1,i.receiveShadows=i.receiveAmbientOcclusion=!1),i.textureAlphaPremultiplied=!!r.textureAlphaPremultiplied,i.pbrMode=r.usePBR?r.isSchematic?2:1:0,i.emissionSource=r.emissionSource,i.offsetBackfaces=!(!this.transparent||!r.offsetTransparentBackfaces),i.oitPass=t.oitPass,i.enableOffset=t.camera.relativeElevation<l.xt,i.snowCover=t.snowCover>0,i.hasColorTextureTransform=!!r.colorTextureTransformMatrix,i.hasNormalTextureTransform=!!r.normalTextureTransformMatrix,i.hasEmissionTextureTransform=!!r.emissiveTextureTransformMatrix,i.hasOcclusionTextureTransform=!!r.occlusionTextureTransformMatrix,i.hasMetallicRoughnessTextureTransform=!!r.metallicRoughnessTextureTransformMatrix,i}intersect(e,t,r,n,o,a){if(null!=this.parameters.verticalOffset){const e=r.camera;(0,i.j)(He,t[12],t[13],t[14]);let a=null;switch(r.viewingMode){case 1:a=(0,i.n)(De,He);break;case 2:a=(0,i.d)(De,Pe)}let s=0;const l=(0,i.e)(Le,He,e.eye),c=(0,i.b)(l),d=(0,i.h)(l,l,1/c);let u=null;this.parameters.screenSizePerspective&&(u=(0,i.f)(a,d)),s+=(0,P.kE)(e,c,this.parameters.verticalOffset,u??0,this.parameters.screenSizePerspective,null),(0,i.h)(a,a,s),(0,i.o)(Ne,a,r.transform.inverseRotation),n=(0,i.e)(Fe,n,Ne),o=(0,i.e)(Oe,o,Ne)}!function(e,t,r,n,o,a){if(!e.visible)return;const s=(0,i.a)(S,n,r),l=(e,t,r)=>a(e,r,t),{tolerance:c}=t,h=new u(c,!1,t.options.normalRequired);if(e.boundingInfo)(0,d.vA)(0===e.type),m(e.boundingInfo,r,s,c,o,h,l);else{const t=e.positionAttribute,n=t.indices;!function(e,t,r,n,o,a,s,l,c,d){const u=t,h=E,p=Math.abs(u[0]),m=Math.abs(u[1]),f=Math.abs(u[2]),g=p>=m?p>=f?0:2:m>=f?1:2,w=g,b=u[w]<0?2:1,M=(g+b)%3,T=(g+(3-b))%3,C=u[M]/u[w],S=u[T]/u[w],A=1/u[w],R=v,I=_,F=x,{normalRequired:O}=c;for(let t=r;t<n;++t){const r=3*t,n=s*o[r];(0,i.j)(h[0],a[n+0],a[n+1],a[n+2]);const c=s*o[r+1];(0,i.j)(h[1],a[c+0],a[c+1],a[c+2]);const u=s*o[r+2];(0,i.j)(h[2],a[u+0],a[u+1],a[u+2]),l&&((0,i.d)(h[0],l.applyToVertex(h[0][0],h[0][1],h[0][2],t)),(0,i.d)(h[1],l.applyToVertex(h[1][0],h[1][1],h[1][2],t)),(0,i.d)(h[2],l.applyToVertex(h[2][0],h[2][1],h[2][2],t))),(0,i.a)(R,h[0],e),(0,i.a)(I,h[1],e),(0,i.a)(F,h[2],e);const p=R[M]-C*R[w],m=R[T]-S*R[w],f=I[M]-C*I[w],g=I[T]-S*I[w],v=F[M]-C*F[w],_=F[T]-S*F[w],x=v*g-_*f,b=p*_-m*v,E=f*m-g*p;if((x<0||b<0||E<0)&&(x>0||b>0||E>0))continue;const P=x+b+E;if(0===P)continue;const D=x*(A*R[w])+b*(A*I[w])+E*(A*F[w]);if(D*Math.sign(P)<0)continue;const N=D/P;N>=0&&d(N,t,O?y(h):null)}}(r,s,0,n.length/3,n,t.data,t.stride,o,h,l)}}(e,r,n,o,(0,A.ou)(r.verticalOffset),a)}createGLMaterial(e){return new Ae(e)}createBufferWriter(){return new F(this._layout)}get transparent(){return Ie(this.parameters)}}class Ae extends a.m8{constructor(e){super({...e,...e.material.parameters})}beginSlot(e){this._material.setParameters({receiveShadows:e.shadowMap.enabled});const t=this._material.parameters;this.updateTexture(t.textureId);const r=e.camera.viewInverseTransposeMatrix;return(0,i.j)(t.origin,r[3],r[7],r[11]),this._material.setParameters(this.textureBindParameters),this.getTechnique(t.treeRendering?Se:_e,e)}}class Re extends ve{constructor(){super(...arguments),this.treeRendering=!1,this.hasVertexTangents=!1}get hasNormalTexture(){return!this.treeRendering&&!!this.normalTextureId}get hasColorTexture(){return!!this.textureId}get hasMetallicRoughnessTexture(){return!this.treeRendering&&!!this.metallicRoughnessTextureId}get hasOcclusionTexture(){return!this.treeRendering&&!!this.occlusionTextureId}get emissionSource(){return this.treeRendering?0:null!=this.emissiveTextureId&&0===this.emissiveSource?3:this.usePBR?0===this.emissiveSource?2:1:0}get hasTextures(){return this.hasColorTexture||this.hasNormalTexture||this.hasMetallicRoughnessTexture||3===this.emissionSource||this.hasOcclusionTexture}}function Ie(e){const{drivenOpacity:t,opacity:r,externalColor:i,layerOpacity:n,texture:o,textureId:a,textureAlphaMode:s,colorMixMode:l}=e,c=i[3];return t||r<1&&"replace"!==l||c<1&&"ignore"!==l||n<1||(null!=o||null!=a)&&1!==s&&2!==s&&"replace"!==l}const Fe=(0,n.vt)(),Oe=(0,n.vt)(),Pe=(0,n.fA)(0,0,1),De=(0,n.vt)(),Ne=(0,n.vt)(),He=(0,n.vt)(),Le=(0,n.vt)()},4431:(e,t,r)=>{r.d(t,{U:()=>o}),r(44208);var i=r(63907),n=r(74038);function o(e,t=0){const r=e.stride;return Array.from(e.fields.keys()).map(o=>{const a=e.fields.get(o),s=a.constructor.ElementCount,l=function(e){switch(e){case"u8":return i.pe.UNSIGNED_BYTE;case"u16":return i.pe.UNSIGNED_SHORT;case"u32":return i.pe.UNSIGNED_INT;case"i8":return i.pe.BYTE;case"i16":return i.pe.SHORT;case"i32":return i.pe.INT;case"f16":return i.pe.HALF_FLOAT;case"f32":return i.pe.FLOAT;default:throw new Error("BufferType not supported in WebGL")}}(a.constructor.ElementType),c=a.offset,d=a.optional?.glNormalized??!1;return new n._(o,s,l,c,r,d,t)})}},6867:(e,t,r)=>{r.d(t,{i:()=>d});var i=r(58083),n=r(9093),o=r(38954),a=r(51850),s=r(87317),l=r(91829),c=r(71351);class d{get ray(){return this._ray}get distanceInRenderSpace(){return null==this.distance?null:((0,o.h)(h,this.ray.direction,this.distance),(0,o.b)(h))}withinDistance(e){return!!u(this)&&this.distanceInRenderSpace<=e}getIntersectionPoint(e){return!!u(this)&&((0,o.h)(h,this.ray.direction,this.distance),(0,o.g)(e,this.ray.origin,h),!0)}getTransformedNormal(e){return(0,o.d)(p,this.normal),p[3]=0,(0,s.t)(p,p,this.transformation),(0,o.d)(e,p),(0,o.n)(e,e)}constructor(e){this.intersector=4,this.normal=(0,a.vt)(),this.transformation=(0,n.vt)(),this._ray=(0,c.vt)(),this.init(e)}init(e){this.distance=this.target=this.drapedLayerOrder=this.renderPriority=null,this.intersector=4,(0,c.C)(e,this._ray)}set(e,t,r,s,l,c,d){this.intersector=e,this.distance=r,(0,o.d)(this.normal,s??a.Cb),(0,i.C)(this.transformation,l??n.zK),this.target=t,this.drapedLayerOrder=c,this.renderPriority=d}copy(e){(0,c.C)(e.ray,this._ray),this.intersector=e.intersector,this.distance=e.distance,this.target=e.target,this.drapedLayerOrder=e.drapedLayerOrder,this.renderPriority=e.renderPriority,(0,o.d)(this.normal,e.normal),(0,i.C)(this.transformation,e.transformation)}}function u(e){return null!=e?.distance}const h=(0,a.vt)(),p=(0,l.vt)()},10906:(e,t,r)=>{r.d(t,{b:()=>o});var i=r(33094),n=r(31821);function o(e,t){t.snowCover&&(e.uniforms.add(new i.U("snowCover",e=>e.snowCover)).code.add(n.H`float getSnow(vec3 normal, vec3 groundNormal) {
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[1145],{1843:(e,t,r)=>{r.d(t,{BP:()=>u,l5:()=>h});var i=r(20498),n=r(13030),o=r(90239),a=r(4431),s=r(620),l=r(85079);class c{constructor(e,t){this.layout=e,this.buffer="number"==typeof t?new ArrayBuffer(t*e.stride):t;for(const t of e.fields.keys()){const r=e.fields.get(t);this[t]=new r.constructor(this.buffer,r.offset,this.stride)}}get stride(){return this.layout.stride}get count(){return this.buffer.byteLength/this.stride}get byteLength(){return this.buffer.byteLength}getField(e,t){const r=this[e];return r&&r.elementCount===t.ElementCount&&r.elementType===t.ElementType?r:null}slice(e,t){return new c(this.layout,this.buffer.slice(e*this.stride,t*this.stride))}copyFrom(e,t=0,r=0,i=e.count){const n=this.stride;if(n%4==0){const o=new Uint32Array(e.buffer,t*n,i*n/4);new Uint32Array(this.buffer,r*n,i*n/4).set(o)}else{const o=new Uint8Array(e.buffer,t*n,i*n);new Uint8Array(this.buffer,r*n,i*n).set(o)}return this}get usedMemory(){return this.byteLength}dispose(){}}class d{constructor(e){this._stride=0,this._fields=new Map,e&&(this._stride=e.stride,e.fields.forEach(e=>this._fields.set(e[0],{...e[1],constructor:f(e[1].constructor)})))}freeze(){return this}get locations(){return(0,l.Xk)((0,a.U)(this))}vec2f16(e,t){return this._appendField(e,i.SX?n.ZD:n.gH,t),this}vec2f(e,t){return this._appendField(e,n.gH,t),this}vec2f64(e,t){return this._appendField(e,n.si,t),this}vec3f16(e,t){return this._appendField(e,i.SX?n.EC:n.xs,t),this}vec3f(e,t){return this._appendField(e,n.xs,t),this}vec3f64(e,t){return this._appendField(e,n.Xm,t),this}vec4f16(e,t){return this._appendField(e,i.SX?n.jz:n.Eq,t),this}vec4f(e,t){return this._appendField(e,n.Eq,t),this}vec4f64(e,t){return this._appendField(e,n.Aj,t),this}mat3f(e,t){return this._appendField(e,n.jZ,t),this}mat3f64(e,t){return this._appendField(e,n.j0,t),this}mat4f(e,t){return this._appendField(e,n.Sx,t),this}mat4f64(e,t){return this._appendField(e,n.E$,t),this}vec4u8(e,t){return this._appendField(e,n.XP,t),this}f16(e,t){return this._appendField(e,i.SX?n.XW:n.Y$,t),this}f32(e,t){return this._appendField(e,n.Y$,t),this}f64(e,t){return this._appendField(e,n.qB,t),this}u8(e,t){return this._appendField(e,n.SL,t),this}u16(e,t){return this._appendField(e,n.h,t),this}i8(e,t){return this._appendField(e,n.bf,t),this}vec2i8(e,t){return this._appendField(e,n.D6,t),this}vec2i16(e,t){return this._appendField(e,n.mJ,t),this}vec2u8(e,t){return this._appendField(e,n.LC,t),this}vec2u16(e,t){return this._appendField(e,n.Yi,t),this}vec4u16(e,t){return this._appendField(e,n.Uz,t),this}vec4i16(e,t){return this._appendField(e,n.E7,t),this}u32(e,t){return this._appendField(e,n.P,t),this}_appendField(e,t,r){this._fields.has(e)&&(0,s.vA)(!1,`${e} already added to vertex buffer layout`);const i=t.ElementCount*(0,o.GJ)(t.ElementType),n=this._stride;this._fields.set(e,{constructor:t,size:i,offset:n,optional:r}),this._alignFields()}_alignFields(){let e=0,t=1;this._fields.forEach(r=>{const i=(0,o.GJ)(r.constructor.ElementType);e=Math.floor((e+i-1)/i)*i,r.offset=e,e+=r.size,t=Math.max(t,i)}),e=Math.floor((e+t-1)/t)*t,this._stride=e}createBuffer(e){return new c(this,e)}createView(e){return new c(this,e)}clone(){const e=new d;return e._stride=this._stride,e._fields=new Map,this._fields.forEach((t,r)=>e._fields.set(r,t)),e.BufferType=this.BufferType,e}get stride(){return this._stride}get fields(){return this._fields}}function u(){return new d}class h{constructor(e){this.fields=new Array,e.fields.forEach((e,t)=>{const r={...e,constructor:m(e.constructor)};this.fields.push([t,r])}),this.stride=e.stride}}const p=[n.Y$,n.gH,n.xs,n.Eq,n.jZ,n.Sx,n.qB,n.si,n.Xm,n.Aj,n.j0,n.E$,n.SL,n.LC,n.eI,n.XP,n.h,n.Yi,n.nS,n.Uz,n.P,n.An,n.H$,n.ml,n.bf,n.D6,n.m8,n.TX,n.Qt,n.mJ,n.Vp,n.E7,n.My,n.UL,n.zD,n.Y4];function m(e){return`${e.ElementType}_${e.ElementCount}`}function f(e){return g.get(e)}const g=new Map;p.forEach(e=>g.set(m(e),e))},2495:(e,t,r)=>{r.d(t,{$U:()=>Ee,fs:()=>Re,ty:()=>Ie});var i=r(38954),n=r(51850),o=r(49255),a=r(25634),s=r(11725),l=r(33524),c=r(70328),d=r(620);class u{constructor(e=0,t=!1,r=!0){this.tolerance=e,this.isVerticalRay=t,this.normalRequired=r}}const h=(0,c.vt)(),p=(0,n.vt)();function m(e,t,r,n,o,a,s){if(null==e)return;const l=function(e,t){return(0,i.j)(t,1/e[0],1/e[1],1/e[2])}(r,p);if((0,c.Ne)(h,e.bbMin),(0,c.vI)(h,e.bbMax),null!=o&&o.applyToAabb(h),function(e,t,r,i){return function(e,t,r,i){const n=(e[0]-i-t[0])*r[0],o=(e[3]+i-t[0])*r[0];let a=Math.min(n,o),s=Math.max(n,o);const l=(e[1]-i-t[1])*r[1],c=(e[4]+i-t[1])*r[1];if(s=Math.min(s,Math.max(l,c)),s<0)return!1;if(a=Math.max(a,Math.min(l,c)),a>s)return!1;const d=(e[2]-i-t[2])*r[2],u=(e[5]+i-t[2])*r[2];return s=Math.min(s,Math.max(d,u)),!(s<0)&&(a=Math.max(a,Math.min(d,u)),!(a>s)&&a<1/0)}(e,t,r,i)}(h,t,l,n)){const{primitiveIndices:i,position:l}=e,c=i?i.length:l.indices.length/3;if(c>T){const i=e.getChildren();if(void 0!==i){for(const e of i)m(e,t,r,n,o,a,s);return}}!function(e,t,r,i,n,o,a,s,l,c,d){const u=e[0],h=e[1],p=e[2],m=t[0],g=t[1],v=t[2],{normalRequired:_}=c;for(let e=0;e<i;++e){const t=s[e],r=3*t,i=a*n[r];let c=o[i],x=o[i+1],y=o[i+2];const b=a*n[r+1];let M=o[b],T=o[b+1],S=o[b+2];const E=a*n[r+2];let A=o[E],R=o[E+1],I=o[E+2];null!=l&&([c,x,y]=l.applyToVertex(c,x,y,e),[M,T,S]=l.applyToVertex(M,T,S,e),[A,R,I]=l.applyToVertex(A,R,I,e));const F=M-c,O=T-x,P=S-y,D=A-c,N=R-x,H=I-y,L=g*H-N*v,z=v*D-H*m,B=m*N-D*g,G=F*L+O*z+P*B;if(Math.abs(G)<=C)continue;const U=u-c,V=h-x,j=p-y,W=U*L+V*z+j*B;if(G>0){if(W<0||W>G)continue}else if(W>0||W<G)continue;const k=V*P-O*j,$=j*F-P*U,Z=U*O-F*V,q=m*k+g*$+v*Z;if(G>0){if(q<0||W+q>G)continue}else if(q>0||W+q<G)continue;const Y=(D*k+N*$+H*Z)/G;Y>=0&&d(Y,t,_?w(F,O,P,D,N,H,f):null)}}(t,r,0,c,l.indices,l.data,l.stride,i,o,a,s)}}const f=(0,n.vt)();function g(e,t,r,i,n,o,a,s){const l=e[0],c=e[1],d=e[2],u=t[0],h=t[1],p=t[2];for(let e=r;e<i;++e){const t=3*e,r=t+1,i=t+2,m=o*t,g=n[m],v=n[m+1],_=n[m+2],x=o*r,y=o*i,b=n[x]-g,M=n[x+1]-v,T=n[x+2]-_,S=n[y]-g,E=n[y+1]-v,A=n[y+2]-_,R=h*A-E*p,I=p*S-A*u,F=u*E-S*h,O=b*R+M*I+T*F;if(Math.abs(O)<=C)continue;const P=l-g,D=c-v,N=d-_,H=P*R+D*I+N*F;if(O>0){if(H<0||H>O)continue}else if(H>0||H<O)continue;const L=D*T-M*N,z=N*b-T*P,B=P*M-b*D,G=u*L+h*z+p*B;if(O>0){if(G<0||H+G>O)continue}else if(G>0||H+G<O)continue;const U=(S*L+E*z+A*B)/O;U>=0&&s(U,e,a?w(b,M,T,S,E,A,f):null)}}const v=(0,n.vt)(),_=(0,n.vt)(),x=(0,n.vt)();function w(e,t,r,n,o,a,s){return(0,i.j)(b,e,t,r),(0,i.j)(M,n,o,a),(0,i.i)(s,b,M),(0,i.n)(s,s),s}function y(e){return(0,i.a)(b,e[1],e[0]),(0,i.a)(M,e[2],e[0]),(0,i.i)(f,b,M),(0,i.n)(f,f),f}const b=(0,n.vt)(),M=(0,n.vt)(),T=1e3,C=1e-7,S=(0,n.vt)(),E=[(0,n.vt)(),(0,n.vt)(),(0,n.vt)()];var A=r(16396),R=r(13030),I=r(59907);class F{constructor(e){this.layout=e}elementCount(e){return e.get("position").indices.length}write(e,t,r,i,n,o){return(0,I.vJ)(r,i,this.layout,e,t,n,o)}intersect(e,t,r,n,o,a,s){const l=this.layout.createView(e).getField("position",R.xs);if(null==l)return;const c=(0,i.a)(O,a,o),d=l.count/3,u=n.options.normalRequired;g(o,c,0,d,l.typedBuffer,l.typedBufferStride,u,(e,t,r)=>s(e,r,t))}}const O=(0,n.vt)();var P=r(43616),D=r(31635),N=(r(53966),r(44208)),H=(r(87811),r(49186),r(64108)),L=r(91829),z=r(4431),B=r(1843),G=r(72824),U=r(13840),V=r(42958),j=r(16943);const W={mask:255},k={function:{func:519,ref:2,mask:2},operation:{fail:7680,zFail:7680,zPass:0}},$={function:{func:519,ref:2,mask:2},operation:{fail:7680,zFail:7680,zPass:7681}};var Z=r(4576);r(34275),r(94656),r(63907),(0,N.A)("esri-tests-disable-gpu-memory-measurements");var q=r(69622),Y=r(65529),X=r(10107),J=r(77690),K=r(29242),Q=r(58083),ee=r(9093),te=r(32728);class re{constructor(e){this.localTransform=e.localTransform,this.globalTransform=e.globalTransform,this.modelOrigin=e.modelOrigin,this.model=e.instanceModel,this.modelNormal=e.instanceModelNormal,this.modelScaleFactors=e.modelScaleFactors,this.boundingSphere=e.boundingSphere,this.featureAttribute=e.getField("instanceFeatureAttribute",R.Eq),this.color=e.getField("instanceColor",R.XP),this.olidColor=e.getField("instanceOlidColor",R.XP),this.state=e.getField("state",R.SL),this.lodLevel=e.getField("lodLevel",R.SL)}}let ie=class extends q.A{constructor(e,t){super(e),this.events=new Y.bk,this._capacity=0,this._size=0,this._next=0,this._highlightOptionsMap=new Map,this._highlightOptionsMapPrev=new Map,this._layout=function(e){return oe(ne.clone(),e).u8("state").u8("lodLevel")}(t),this._capacity=de,this._buffer=this._layout.createBuffer(this._capacity),this._view=new re(this._buffer)}get capacity(){return this._capacity}get size(){return this._size}get view(){return this._view}addInstance(){this._size+1>this._capacity&&this._grow();const e=this._findSlot();return this._view.state.set(e,1),this._size++,this.events.emit("instances-changed"),e}removeInstance(e){const t=this._view.state;(0,d.vA)(e>=0&&e<this._capacity&&!!(1&t.get(e)),"invalid instance handle"),this._getStateFlag(e,18)?this._setStateFlags(e,32):this.freeInstance(e),this.events.emit("instances-changed")}freeInstance(e){const t=this._view.state;(0,d.vA)(e>=0&&e<this._capacity&&!!(1&t.get(e)),"invalid instance handle"),t.set(e,0),this._size--}setLocalTransform(e,t,r=!0){this._view.localTransform.setMat(e,t),r&&this.updateModelTransform(e)}getLocalTransform(e,t){this._view.localTransform.getMat(e,t)}setGlobalTransform(e,t,r=!0){this._view.globalTransform.setMat(e,t),r&&this.updateModelTransform(e)}getGlobalTransform(e,t){this._view.globalTransform.getMat(e,t)}updateModelTransform(e){const t=this._view,r=ae,n=se;t.localTransform.getMat(e,le),t.globalTransform.getMat(e,ce);const o=(0,Q.lw)(ce,ce,le);(0,i.j)(r,o[12],o[13],o[14]),t.modelOrigin.setVec(e,r),(0,J.z0)(n,o),t.model.setMat(e,n);const a=(0,te.wp)(ae,o);a.sort(),t.modelScaleFactors.set(e,0,a[1]),t.modelScaleFactors.set(e,1,a[2]),(0,J.B8)(n,n),(0,J.mg)(n,n),t.modelNormal.setMat(e,n),this._setStateFlags(e,64),this.events.emit("instance-transform-changed",{index:e})}getModelTransform(e,t){const r=this._view;r.model.getMat(e,se),r.modelOrigin.getVec(e,ae),t[0]=se[0],t[1]=se[1],t[2]=se[2],t[3]=0,t[4]=se[3],t[5]=se[4],t[6]=se[5],t[7]=0,t[8]=se[6],t[9]=se[7],t[10]=se[8],t[11]=0,t[12]=ae[0],t[13]=ae[1],t[14]=ae[2],t[15]=1}applyShaderTransformation(e,t){null!=this.shaderTransformation&&this.shaderTransformation.applyTransform(this,e,t)}getCombinedModelTransform(e,t){return this.getModelTransform(e,t),null!=this.shaderTransformation&&this.shaderTransformation.applyTransform(this,e,t),t}getCombinedLocalTransform(e,t){this._view.localTransform.getMat(e,t),null!=this.shaderTransformation&&this.shaderTransformation.applyTransform(this,e,t)}getCombinedMaxScaleFactor(e){let t=this._view.modelScaleFactors.get(e,1);return null!=this.shaderTransformation&&(this.shaderTransformation.scaleFactor(ae,this,e),t*=Math.max(ae[0],ae[1],ae[2])),t}getCombinedMedianScaleFactor(e){let t=this._view.modelScaleFactors.get(e,0);return null!=this.shaderTransformation&&(this.shaderTransformation.scaleFactor(ae,this,e),t*=function(e,t,r){return Math.max(Math.min(e,t),Math.min(Math.max(e,t),r))}(ae[0],ae[1],ae[2])),t}getModel(e,t){this._view.model.getMat(e,t)}setFeatureAttribute(e,t){this._view.featureAttribute?.setVec(e,t)}getFeatureAttribute(e,t){this._view.featureAttribute?.getVec(e,t)}setColor(e,t){this._view.color?.setVec(e,t)}setObjectAndLayerIdColor(e,t){this._view.olidColor?.setVec(e,t)}setVisible(e,t){t!==this.getVisible(e)&&(this._setStateFlag(e,4,t),this.events.emit("instance-visibility-changed",{index:e}))}getVisible(e){return this._getStateFlag(e,4)}setHighlight(e,t){const{_highlightOptionsMap:r}=this,i=r.get(e);t?t!==i&&(r.set(e,t),this._setStateFlag(e,8,!0),this.events.emit("instance-highlight-changed")):i&&(r.delete(e),this._setStateFlag(e,8,!1),this.events.emit("instance-highlight-changed"))}get highlightOptionsMap(){return this._highlightOptionsMap}getHighlightStateFlag(e){return this._getStateFlag(e,8)}geHighlightOptionsPrev(e){const t=this._highlightOptionsMapPrev.get(e)??null;return this._highlightOptionsMapPrev.delete(e),t}getHighlightName(e){const t=this.highlightOptionsMap.get(e)??null;return t?this._highlightOptionsMapPrev.set(e,t):this._highlightOptionsMapPrev.delete(e),t}getState(e){return this._view.state.get(e)}getLodLevel(e){return this._view.lodLevel.get(e)}countFlags(e){let t=0;for(let r=0;r<this._capacity;++r)this.getState(r)&e&&++t;return t}_setStateFlags(e,t){const r=this._view.state;t=r.get(e)|t,r.set(e,t)}_clearStateFlags(e,t){const r=this._view.state;t=r.get(e)&~t,r.set(e,t)}_setStateFlag(e,t,r){r?this._setStateFlags(e,t):this._clearStateFlags(e,t)}_getStateFlag(e,t){return!!(this._view.state.get(e)&t)}_grow(){this._capacity=Math.max(de,Math.floor(this._capacity*Z.Ji)),this._buffer=this._layout.createBuffer(this._capacity).copyFrom(this._buffer),this._view=new re(this._buffer)}_findSlot(){const e=this._view.state;let t=this._next;for(;1&e.get(t);)t=t+1===this._capacity?0:t+1;return this._next=t+1===this._capacity?0:t+1,t}};(0,D.Cg)([(0,X.MZ)({constructOnly:!0})],ie.prototype,"shaderTransformation",void 0),(0,D.Cg)([(0,X.MZ)()],ie.prototype,"_size",void 0),(0,D.Cg)([(0,X.MZ)({readOnly:!0})],ie.prototype,"size",null),ie=(0,D.Cg)([(0,H.$)("esri.views.3d.webgl-engine.lib.lodRendering.InstanceData")],ie);const ne=(0,B.BP)().mat4f64("localTransform").mat4f64("globalTransform").vec4f64("boundingSphere").vec3f64("modelOrigin").mat3f("instanceModel").mat3f("instanceModelNormal").vec2f("modelScaleFactors");function oe(e,t){return t.instancedFeatureAttribute&&e.vec4f("instanceFeatureAttribute"),t.instancedColor&&e.vec4u8("instanceColor"),(0,j.E)()&&e.vec4u8("instanceOlidColor"),e}const ae=(0,n.vt)(),se=(0,K.vt)(),le=(0,ee.vt)(),ce=(0,ee.vt)(),de=64,ue=(0,B.BP)().vec3f("instanceModelOriginHi").vec3f("instanceModelOriginLo").mat3f("instanceModel").mat3f("instanceModelNormal");var he=r(74810),pe=r(28491),me=r(90644),fe=r(85079),ge=r(49788);class ve extends G.Zo{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=he.mb,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=2,this.instanced=!1,this.instancedFeatureAttribute=!1,this.instancedColor=!1,this.instanceColorEncodesAlphaIgnore=!1,this.emissiveStrength=0,this.emissiveSource=1,this.emissiveBaseColor=n.uY,this.instancedDoublePrecision=!1,this.normalType=0,this.receiveShadows=!0,this.receiveAmbientOcclusion=!0,this.castShadows=!0,this.ambient=(0,n.CN)(.2,.2,.2),this.diffuse=(0,n.CN)(.8,.8,.8),this.externalColor=(0,L.fA)(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=(0,n.vt)(),this.hasSlicePlane=!1,this.offsetTransparentBackfaces=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.modelTransformation=null,this.drivenOpacity=!1,this.writeDepth=!0,this.customDepthTest=0,this.textureAlphaMode=0,this.textureAlphaCutoff=ge.Q,this.textureAlphaPremultiplied=!1,this.renderOccluded=1,this.isDecoration=!1}get hasVVSize(){return!!this.vvSize}get hasVVColor(){return!!this.vvColor}get hasVVOpacity(){return!!this.vvOpacity}}G.gy;let _e=class extends V.w{constructor(e,t){const i=[(0,z.U)(ye(t))];t.instanced&&t.instancedDoublePrecision&&i.push((0,z.U)(function(e){return oe(ue.clone(),e)}(t))),super(e,t,(0,fe._u)(i)),this.shader=new U.r(pe.D,()=>r.e(5141).then(r.bind(r,5141)))}_makePipeline(e,t){const{oitPass:r,output:i,transparent:n,cullFace:a,customDepthTest:s,hasOccludees:c}=e;return(0,me.Ey)({blending:(0,o.RN)(i)&&n?(0,l.Yf)(r):null,culling:we(e)?(0,me.Xt)(a):null,depthTest:{func:(0,l.K_)(r,xe(s))},depthWrite:(0,l.z5)(e),drawBuffers:(0,V.L)(i,(0,l.m6)(r,i)),colorWrite:me.kn,stencilWrite:c?W:null,stencilTest:c?t?$:k:null,polygonOffset:(0,l.mE)(e)})}initializePipeline(e){return this._occludeePipelineState=this._makePipeline(e,!0),this._makePipeline(e,!1)}getPipeline(e){return e?this._occludeePipelineState:super.getPipeline()}};function xe(e){switch(e){case 1:return 515;case 0:case 3:return 513;case 2:return 516}}function we(e){return 0!==e.cullFace||!e.hasSlicePlane&&!e.transparent&&!e.doubleSidedMode}function ye(e){const t=(0,B.BP)().vec3f("position");return 1===e.normalType?t.vec2i16("normalCompressed",{glNormalized:!0}):t.vec3f("normal"),e.hasVertexTangents&&t.vec4f("tangent"),e.hasTextures&&t.vec2f16("uv0"),e.hasVertexColors&&t.vec4u8("color"),e.hasSymbolColors&&t.vec4u8("symbolColor"),!e.instanced&&(0,j.E)()&&t.vec4u8("olidColor"),t}_e=(0,D.Cg)([(0,H.$)("esri.views.3d.webgl-engine.shaders.DefaultMaterialTechnique")],_e);var be=r(51976),Me=r(35256);class Te extends Me.E{constructor(e){super(),this.spherical=e,this.alphaDiscardMode=1,this.doubleSidedMode=0,this.pbrMode=0,this.cullFace=0,this.normalType=0,this.customDepthTest=0,this.emissionSource=0,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.hasVerticalOffset=!1,this.hasColorTexture=!1,this.hasMetallicRoughnessTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasScreenSizePerspective=!1,this.hasVertexTangents=!1,this.hasOccludees=!1,this.instanced=!1,this.instancedDoublePrecision=!1,this.hasModelTransformation=!1,this.offsetBackfaces=!1,this.hasVVSize=!1,this.hasVVColor=!1,this.receiveShadows=!1,this.receiveAmbientOcclusion=!1,this.textureAlphaPremultiplied=!1,this.instancedFeatureAttribute=!1,this.instancedColor=!1,this.writeDepth=!0,this.transparent=!1,this.enableOffset=!0,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.snowCover=!1,this.hasColorTextureTransform=!1,this.hasEmissionTextureTransform=!1,this.hasNormalTextureTransform=!1,this.hasOcclusionTextureTransform=!1,this.hasMetallicRoughnessTextureTransform=!1,this.occlusionPass=!1,this.useCustomDTRExponentForWater=!1,this.useFillLights=!0,this.draped=!1}get textureCoordinateType(){return this.hasTextures?1:0}get hasTextures(){return this.hasColorTexture||this.hasNormalTexture||this.hasMetallicRoughnessTexture||3===this.emissionSource||this.hasOcclusionTexture}get hasVVInstancing(){return this.instanced}get discardInvisibleFragments(){return this.transparent}}(0,D.Cg)([(0,be.W)({count:4})],Te.prototype,"alphaDiscardMode",void 0),(0,D.Cg)([(0,be.W)({count:3})],Te.prototype,"doubleSidedMode",void 0),(0,D.Cg)([(0,be.W)({count:7})],Te.prototype,"pbrMode",void 0),(0,D.Cg)([(0,be.W)({count:3})],Te.prototype,"cullFace",void 0),(0,D.Cg)([(0,be.W)({count:3})],Te.prototype,"normalType",void 0),(0,D.Cg)([(0,be.W)({count:3})],Te.prototype,"customDepthTest",void 0),(0,D.Cg)([(0,be.W)({count:8})],Te.prototype,"emissionSource",void 0),(0,D.Cg)([(0,be.W)()],Te.prototype,"hasVertexColors",void 0),(0,D.Cg)([(0,be.W)()],Te.prototype,"hasSymbolColors",void 0),(0,D.Cg)([(0,be.W)()],Te.prototype,"hasVerticalOffset",void 0),(0,D.Cg)([(0,be.W)()],Te.prototype,"hasColorTexture",void 0),(0,D.Cg)([(0,be.W)()],Te.prototype,"hasMetallicRoughnessTexture",void 0),(0,D.Cg)([(0,be.W)()],Te.prototype,"hasOcclusionTexture",void 0),(0,D.Cg)([(0,be.W)()],Te.prototype,"hasNormalTexture",void 0),(0,D.Cg)([(0,be.W)()],Te.prototype,"hasScreenSizePerspective",void 0),(0,D.Cg)([(0,be.W)()],Te.prototype,"hasVertexTangents",void 0),(0,D.Cg)([(0,be.W)()],Te.prototype,"hasOccludees",void 0),(0,D.Cg)([(0,be.W)()],Te.prototype,"instanced",void 0),(0,D.Cg)([(0,be.W)()],Te.prototype,"instancedDoublePrecision",void 0),(0,D.Cg)([(0,be.W)()],Te.prototype,"hasModelTransformation",void 0),(0,D.Cg)([(0,be.W)()],Te.prototype,"offsetBackfaces",void 0),(0,D.Cg)([(0,be.W)()],Te.prototype,"hasVVSize",void 0),(0,D.Cg)([(0,be.W)()],Te.prototype,"hasVVColor",void 0),(0,D.Cg)([(0,be.W)()],Te.prototype,"receiveShadows",void 0),(0,D.Cg)([(0,be.W)()],Te.prototype,"receiveAmbientOcclusion",void 0),(0,D.Cg)([(0,be.W)()],Te.prototype,"textureAlphaPremultiplied",void 0),(0,D.Cg)([(0,be.W)()],Te.prototype,"instancedFeatureAttribute",void 0),(0,D.Cg)([(0,be.W)()],Te.prototype,"instancedColor",void 0),(0,D.Cg)([(0,be.W)()],Te.prototype,"writeDepth",void 0),(0,D.Cg)([(0,be.W)()],Te.prototype,"transparent",void 0),(0,D.Cg)([(0,be.W)()],Te.prototype,"enableOffset",void 0),(0,D.Cg)([(0,be.W)()],Te.prototype,"terrainDepthTest",void 0),(0,D.Cg)([(0,be.W)()],Te.prototype,"cullAboveTerrain",void 0),(0,D.Cg)([(0,be.W)()],Te.prototype,"snowCover",void 0),(0,D.Cg)([(0,be.W)()],Te.prototype,"hasColorTextureTransform",void 0),(0,D.Cg)([(0,be.W)()],Te.prototype,"hasEmissionTextureTransform",void 0),(0,D.Cg)([(0,be.W)()],Te.prototype,"hasNormalTextureTransform",void 0),(0,D.Cg)([(0,be.W)()],Te.prototype,"hasOcclusionTextureTransform",void 0),(0,D.Cg)([(0,be.W)()],Te.prototype,"hasMetallicRoughnessTextureTransform",void 0);var Ce=r(57323);let Se=class extends _e{constructor(){super(...arguments),this.shader=new U.r(Ce.R,()=>r.e(2314).then(r.bind(r,39933)))}};Se=(0,D.Cg)([(0,H.$)("esri.views.3d.webgl-engine.shaders.RealisticTreeTechnique")],Se);class Ee extends s.i{constructor(e,t){super(e,Re),this.materialType="default",this.supportsEdges=!0,this.intersectDraped=void 0,this.produces=new Map([[2,e=>((0,o.iq)(e)||(0,o.Bf)(e))&&!this.transparent],[4,e=>((0,o.iq)(e)||(0,o.Bf)(e))&&this.transparent&&this.parameters.writeDepth],[8,e=>((0,o.iq)(e)||(0,o.Bf)(e))&&this.transparent&&!this.parameters.writeDepth]]),this._layout=ye(this.parameters),this._configuration=new Te(t.spherical)}isVisibleForOutput(e){return 4!==e&&6!==e&&5!==e||this.parameters.castShadows}get visible(){const{layerOpacity:e,colorMixMode:t,opacity:r,externalColor:i}=this.parameters;return e*("replace"===t?1:r)*("ignore"===t||isNaN(i[3])?1:i[3])>=ge.Q}get _hasEmissiveBase(){return!!this.parameters.emissiveTextureId||!(0,i.q)(this.parameters.emissiveBaseColor,n.uY)}get hasEmissions(){return this.parameters.emissiveStrength>0&&(0===this.parameters.emissiveSource&&this._hasEmissiveBase||1===this.parameters.emissiveSource)}getConfiguration(e,t){const{parameters:r,_configuration:i}=this,{treeRendering:n,doubleSided:a,doubleSidedType:s}=r;return super.getConfiguration(e,t,this._configuration),i.hasNormalTexture=r.hasNormalTexture,i.hasColorTexture=r.hasColorTexture,i.hasMetallicRoughnessTexture=r.hasMetallicRoughnessTexture,i.hasOcclusionTexture=r.hasOcclusionTexture,i.hasVertexTangents=!n&&r.hasVertexTangents,i.instanced=r.instanced,i.instancedDoublePrecision=r.instancedDoublePrecision,i.hasVVColor=!!r.vvColor,i.hasVVSize=!!r.vvSize,i.hasVerticalOffset=null!=r.verticalOffset,i.hasScreenSizePerspective=null!=r.screenSizePerspective,i.hasSlicePlane=r.hasSlicePlane,i.alphaDiscardMode=r.textureAlphaMode,i.normalType=n?0:r.normalType,i.transparent=this.transparent,i.writeDepth=r.writeDepth,i.customDepthTest=r.customDepthTest??0,i.hasOccludees=t.hasOccludees,i.cullFace=r.hasSlicePlane?0:r.cullFace,i.cullAboveTerrain=t.cullAboveTerrain,i.hasModelTransformation=!n&&null!=r.modelTransformation,i.hasVertexColors=r.hasVertexColors,i.hasSymbolColors=r.hasSymbolColors,i.doubleSidedMode=n?2:a&&"normal"===s?1:a&&"winding-order"===s?2:0,i.instancedFeatureAttribute=r.instancedFeatureAttribute,i.instancedColor=r.instancedColor,(0,o.RN)(e)?(i.terrainDepthTest=t.terrainDepthTest,i.receiveShadows=r.receiveShadows,i.receiveAmbientOcclusion=r.receiveAmbientOcclusion&&null!=t.ssao):(i.terrainDepthTest=!1,i.receiveShadows=i.receiveAmbientOcclusion=!1),i.textureAlphaPremultiplied=!!r.textureAlphaPremultiplied,i.pbrMode=r.usePBR?r.isSchematic?2:1:0,i.emissionSource=r.emissionSource,i.offsetBackfaces=!(!this.transparent||!r.offsetTransparentBackfaces),i.oitPass=t.oitPass,i.enableOffset=t.camera.relativeElevation<l.xt,i.snowCover=t.snowCover>0,i.hasColorTextureTransform=!!r.colorTextureTransformMatrix,i.hasNormalTextureTransform=!!r.normalTextureTransformMatrix,i.hasEmissionTextureTransform=!!r.emissiveTextureTransformMatrix,i.hasOcclusionTextureTransform=!!r.occlusionTextureTransformMatrix,i.hasMetallicRoughnessTextureTransform=!!r.metallicRoughnessTextureTransformMatrix,i}intersect(e,t,r,n,o,a){if(null!=this.parameters.verticalOffset){const e=r.camera;(0,i.j)(He,t[12],t[13],t[14]);let a=null;switch(r.viewingMode){case 1:a=(0,i.n)(De,He);break;case 2:a=(0,i.d)(De,Pe)}let s=0;const l=(0,i.e)(Le,He,e.eye),c=(0,i.b)(l),d=(0,i.h)(l,l,1/c);let u=null;this.parameters.screenSizePerspective&&(u=(0,i.f)(a,d)),s+=(0,P.kE)(e,c,this.parameters.verticalOffset,u??0,this.parameters.screenSizePerspective,null),(0,i.h)(a,a,s),(0,i.o)(Ne,a,r.transform.inverseRotation),n=(0,i.e)(Fe,n,Ne),o=(0,i.e)(Oe,o,Ne)}!function(e,t,r,n,o,a){if(!e.visible)return;const s=(0,i.a)(S,n,r),l=(e,t,r)=>a(e,r,t),{tolerance:c}=t,h=new u(c,!1,t.options.normalRequired);if(e.boundingInfo)(0,d.vA)(0===e.type),m(e.boundingInfo,r,s,c,o,h,l);else{const t=e.positionAttribute,n=t.indices;!function(e,t,r,n,o,a,s,l,c,d){const u=t,h=E,p=Math.abs(u[0]),m=Math.abs(u[1]),f=Math.abs(u[2]),g=p>=m?p>=f?0:2:m>=f?1:2,w=g,b=u[w]<0?2:1,M=(g+b)%3,T=(g+(3-b))%3,C=u[M]/u[w],S=u[T]/u[w],A=1/u[w],R=v,I=_,F=x,{normalRequired:O}=c;for(let t=r;t<n;++t){const r=3*t,n=s*o[r];(0,i.j)(h[0],a[n+0],a[n+1],a[n+2]);const c=s*o[r+1];(0,i.j)(h[1],a[c+0],a[c+1],a[c+2]);const u=s*o[r+2];(0,i.j)(h[2],a[u+0],a[u+1],a[u+2]),l&&((0,i.d)(h[0],l.applyToVertex(h[0][0],h[0][1],h[0][2],t)),(0,i.d)(h[1],l.applyToVertex(h[1][0],h[1][1],h[1][2],t)),(0,i.d)(h[2],l.applyToVertex(h[2][0],h[2][1],h[2][2],t))),(0,i.a)(R,h[0],e),(0,i.a)(I,h[1],e),(0,i.a)(F,h[2],e);const p=R[M]-C*R[w],m=R[T]-S*R[w],f=I[M]-C*I[w],g=I[T]-S*I[w],v=F[M]-C*F[w],_=F[T]-S*F[w],x=v*g-_*f,b=p*_-m*v,E=f*m-g*p;if((x<0||b<0||E<0)&&(x>0||b>0||E>0))continue;const P=x+b+E;if(0===P)continue;const D=x*(A*R[w])+b*(A*I[w])+E*(A*F[w]);if(D*Math.sign(P)<0)continue;const N=D/P;N>=0&&d(N,t,O?y(h):null)}}(r,s,0,n.length/3,n,t.data,t.stride,o,h,l)}}(e,r,n,o,(0,A.ou)(r.verticalOffset),a)}createGLMaterial(e){return new Ae(e)}createBufferWriter(){return new F(this._layout)}get transparent(){return Ie(this.parameters)}}class Ae extends a.m8{constructor(e){super({...e,...e.material.parameters})}beginSlot(e){this._material.setParameters({receiveShadows:e.shadowMap.enabled});const t=this._material.parameters;this.updateTexture(t.textureId);const r=e.camera.viewInverseTransposeMatrix;return(0,i.j)(t.origin,r[3],r[7],r[11]),this._material.setParameters(this.textureBindParameters),this.getTechnique(t.treeRendering?Se:_e,e)}}class Re extends ve{constructor(){super(...arguments),this.treeRendering=!1,this.hasVertexTangents=!1}get hasNormalTexture(){return!this.treeRendering&&!!this.normalTextureId}get hasColorTexture(){return!!this.textureId}get hasMetallicRoughnessTexture(){return!this.treeRendering&&!!this.metallicRoughnessTextureId}get hasOcclusionTexture(){return!this.treeRendering&&!!this.occlusionTextureId}get emissionSource(){return this.treeRendering?0:null!=this.emissiveTextureId&&0===this.emissiveSource?3:this.usePBR?0===this.emissiveSource?2:1:0}get hasTextures(){return this.hasColorTexture||this.hasNormalTexture||this.hasMetallicRoughnessTexture||3===this.emissionSource||this.hasOcclusionTexture}}function Ie(e){const{drivenOpacity:t,opacity:r,externalColor:i,layerOpacity:n,texture:o,textureId:a,textureAlphaMode:s,colorMixMode:l}=e,c=i[3];return t||r<1&&"replace"!==l||c<1&&"ignore"!==l||n<1||(null!=o||null!=a)&&1!==s&&2!==s&&"replace"!==l}const Fe=(0,n.vt)(),Oe=(0,n.vt)(),Pe=(0,n.fA)(0,0,1),De=(0,n.vt)(),Ne=(0,n.vt)(),He=(0,n.vt)(),Le=(0,n.vt)()},4431:(e,t,r)=>{r.d(t,{U:()=>o}),r(44208);var i=r(63907),n=r(74038);function o(e,t=0){const r=e.stride;return Array.from(e.fields.keys()).map(o=>{const a=e.fields.get(o),s=a.constructor.ElementCount,l=function(e){switch(e){case"u8":return i.pe.UNSIGNED_BYTE;case"u16":return i.pe.UNSIGNED_SHORT;case"u32":return i.pe.UNSIGNED_INT;case"i8":return i.pe.BYTE;case"i16":return i.pe.SHORT;case"i32":return i.pe.INT;case"f16":return i.pe.HALF_FLOAT;case"f32":return i.pe.FLOAT;default:throw new Error("BufferType not supported in WebGL")}}(a.constructor.ElementType),c=a.offset,d=a.optional?.glNormalized??!1;return new n._(o,s,l,c,r,d,t)})}},6867:(e,t,r)=>{r.d(t,{i:()=>d});var i=r(58083),n=r(9093),o=r(38954),a=r(51850),s=r(87317),l=r(91829),c=r(71351);class d{get ray(){return this._ray}get distanceInRenderSpace(){return null==this.distance?null:((0,o.h)(h,this.ray.direction,this.distance),(0,o.b)(h))}withinDistance(e){return!!u(this)&&this.distanceInRenderSpace<=e}getIntersectionPoint(e){return!!u(this)&&((0,o.h)(h,this.ray.direction,this.distance),(0,o.g)(e,this.ray.origin,h),!0)}getTransformedNormal(e){return(0,o.d)(p,this.normal),p[3]=0,(0,s.t)(p,p,this.transformation),(0,o.d)(e,p),(0,o.n)(e,e)}constructor(e){this.intersector=4,this.normal=(0,a.vt)(),this.transformation=(0,n.vt)(),this._ray=(0,c.vt)(),this.init(e)}init(e){this.distance=this.target=this.drapedLayerOrder=this.renderPriority=null,this.intersector=4,(0,c.C)(e,this._ray)}set(e,t,r,s,l,c,d){this.intersector=e,this.distance=r,(0,o.d)(this.normal,s??a.Cb),(0,i.C)(this.transformation,l??n.zK),this.target=t,this.drapedLayerOrder=c,this.renderPriority=d}copy(e){(0,c.C)(e.ray,this._ray),this.intersector=e.intersector,this.distance=e.distance,this.target=e.target,this.drapedLayerOrder=e.drapedLayerOrder,this.renderPriority=e.renderPriority,(0,o.d)(this.normal,e.normal),(0,i.C)(this.transformation,e.transformation)}}function u(e){return null!=e?.distance}const h=(0,a.vt)(),p=(0,l.vt)()},10906:(e,t,r)=>{r.d(t,{b:()=>o});var i=r(33094),n=r(31821);function o(e,t){t.snowCover&&(e.uniforms.add(new i.U("snowCover",e=>e.snowCover)).code.add(n.H`float getSnow(vec3 normal, vec3 groundNormal) {
2
2
  return smoothstep(0.5, 0.55, dot(normal, groundNormal)) * snowCover;
3
3
  }
4
4
  float getRealisticTreeSnow(vec3 faceNormal, vec3 shadingNormal, vec3 groundNormal) {
@@ -8,7 +8,14 @@ smoothstep(0.0, 0.1, dot(shadingNormal, groundNormal)));
8
8
  return snow * snowCover;
9
9
  }`),e.code.add(n.H`vec3 applySnowToMRR(vec3 mrr, float snow) {
10
10
  return mix(mrr, vec3(0.0, 1.0, 0.04), snow);
11
- }`))}},11725:(e,t,r)=>{r.d(t,{i:()=>s});var i=r(24326),n=r(35256),o=r(43616),a=r(65786);class s{constructor(e,t){this.id=(0,i.c)(),this.supportsEdges=!1,this._renderPriority=0,this._parameters=new t,(0,o.MB)(this._parameters,e),this.validateParameters(this._parameters)}get parameters(){return this._parameters}update(e){return!1}setParameters(e,t=!0){(0,o.MB)(this._parameters,e)&&(this.validateParameters(this._parameters),t&&this._parametersChanged())}validateParameters(e){}shouldRender(e){return this.visible&&this.isVisibleForOutput(e.output)&&(!this.parameters.isDecoration||e.bind.decorations)&&0!==(this.parameters.renderOccluded&e.renderOccludedMask)}isVisibleForOutput(e){return!0}get renderPriority(){return this._renderPriority}set renderPriority(e){e!==this._renderPriority&&(this._renderPriority=e,this._parametersChanged())}_parametersChanged(){this.repository?.materialChanged(this)}get renderOccludedFlags(){return this.visible?this.parameters.renderOccluded:0}get hasEmissions(){return!1}getConfiguration(e,t,r=new n.E){return r.output=e,r.hasHighlightMixTexture=9===e&&null!=t.highlightMixTexture,r}}a.Y},11868:(e,t,r)=>{r.d(t,{Wz:()=>o,oe:()=>n});var i=r(34275);function n(e,t=!1){return e<=i.y9?t?new Array(e).fill(0):new Array(e):new Float32Array(e)}function o(e){return(Array.isArray(e)?e.length:e.byteLength/8)<=i.y9?Array.from(e):new Float32Array(e)}},11964:(e,t,r)=>{r.d(t,{Cr:()=>d,H6:()=>p,LV:()=>c,_I:()=>h,kb:()=>u,vt:()=>l});var i=r(34727),n=r(4341),o=r(38954),a=r(51850),s=r(32114);function l(e){return e?{origin:(0,a.o8)(e.origin),vector:(0,a.o8)(e.vector)}:{origin:(0,a.vt)(),vector:(0,a.vt)()}}function c(e,t){const r=m.get();return r.origin=e,r.vector=t,r}function d(e,t,r=l()){return(0,o.d)(r.origin,e),(0,o.e)(r.vector,t,e),r}function u(e,t){const r=(0,o.e)(s.rq.get(),t,e.origin),n=(0,o.f)(e.vector,r),a=(0,o.f)(e.vector,e.vector),l=(0,i.qE)(n/a,0,1),c=(0,o.e)(s.rq.get(),(0,o.h)(s.rq.get(),e.vector,l),r);return(0,o.f)(c,c)}function h(e,t,r){return p(e,t,0,1,r)}function p(e,t,r,n,a){const{vector:l,origin:c}=e,d=(0,o.e)(s.rq.get(),t,c),u=(0,o.f)(l,d)/(0,o.m)(l);return(0,o.h)(a,l,(0,i.qE)(u,r,n)),(0,o.g)(a,a,e.origin)}(0,a.vt)(),(0,a.vt)();const m=new n.I(()=>l())},12791:(e,t,r)=>{r.d(t,{x:()=>n});var i=r(74333);class n extends i.n{constructor(e,t){super(e,"sampler2D",0,(r,i)=>r.bindTexture(e,t(i)))}}},14113:(e,t,r)=>{r.d(t,{N5:()=>s});var i=r(49186),n=(r(44208),r(53966));const o=()=>n.A.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder");class a{constructor(){this._includedModules=new Map}include(e,t){this._includedModules.has(e)?this._includedModules.get(e):(this._includedModules.set(e,t),e(this.builder,t))}}class s extends a{constructor(){super(...arguments),this.vertex=new u,this.fragment=new u,this.attributes=new h,this.varyings=new p,this.outputs=new m}get fragmentUniforms(){return this.fragment.uniforms.entries}get attributeNames(){return this.attributes.names}get builder(){return this}generate(e,t=!1){const r=this.attributes.generateSource(e),i=this.varyings.generateSource(e),n="vertex"===e?this.vertex:this.fragment,o=n.uniforms.generateSource(),a=n.code.generateSource(),s=n.main.generateSource(t),l="vertex"===e?v:g,c=n.constants.generateSource(),d=this.outputs.generateSource(e);return`#version 300 es\n${l}\n${c.join("\n")}\n${o.join("\n")}\n${r.join("\n")}\n${i.join("\n")}\n${d.join("\n")}\n${a.join("\n")}\n${s.join("\n")}`}generateBind(e){const t=new Map;this.vertex.uniforms.entries.forEach(e=>{const r=e.bind[0];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{const r=e.bind[0];r&&t.set(e.name,r)});const r=Array.from(t.values()),i=r.length;return t=>{for(let n=0;n<i;++n)r[n](e,t)}}generateBindPass(e){const t=new Map;this.vertex.uniforms.entries.forEach(e=>{const r=e.bind[1];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{const r=e.bind[1];r&&t.set(e.name,r)});const r=Array.from(t.values()),i=r.length;return(t,n)=>{for(let o=0;o<i;++o)r[o](e,t,n)}}generateBindDraw(e){const t=new Map;this.vertex.uniforms.entries.forEach(e=>{const r=e.bind[2];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{const r=e.bind[2];r&&t.set(e.name,r)});const r=Array.from(t.values()),i=r.length;return(t,n,o)=>{for(let a=0;a<i;++a)r[a](e,o,t,n)}}}class l{constructor(e){this._stage=e,this._entries=new Map}add(...e){for(const t of e)this._add(t);return this._stage}get(e){return this._entries.get(e)}_add(e){if(null!=e){if(this._entries.has(e.name)&&!this._entries.get(e.name).equals(e))throw new i.A("shaderbuilder:duplicate-uniform",`Duplicate uniform name ${e.name} for different uniform type`);this._entries.set(e.name,e)}else o().error(`Trying to add null Uniform from ${(new Error).stack}.`)}generateSource(){return Array.from(this._entries.values()).map(({name:e,arraySize:t,type:r})=>null!=t?`uniform ${r} ${e}[${t}];`:`uniform ${r} ${e};`)}get entries(){return Array.from(this._entries.values())}}class c{constructor(e){this._stage=e,this._bodies=new Array}add(e){return this._bodies.push(e),this._stage}generateSource(e){if(this._bodies.length>0)return[`void main() {\n ${this._bodies.join("\n")||""} \n}`];if(e)throw new i.A("shaderbuilder:missing-main","Shader does not contain main function body.");return[]}}class d{constructor(e){this._stage=e,this._entries=new Array}add(e){return this._entries.push(e),this._stage}generateSource(){return this._entries}}class u extends a{constructor(){super(...arguments),this.uniforms=new l(this),this.main=new c(this),this.code=new d(this),this.constants=new f(this)}get builder(){return this}}class h{constructor(){this._entries=new Array}add(e,t){this._entries.push([e,t])}generateSource(e){return"fragment"===e?[]:this._entries.map(e=>`in ${e[1]} ${e[0]};`)}get names(){return this._entries.map(([e])=>e)}}class p{constructor(){this._entries=new Map}add(e,t,r){this._entries.has(e)?o().warn(`Ignoring duplicate varying ${t} ${e}`):this._entries.set(e,{type:t,invariant:r?.invariant??!1})}generateSource(e){const t=new Array;return this._entries.forEach((r,i)=>t.push((r.invariant&&"vertex"===e?"invariant ":"")+("int"===r.type?"flat ":"")+("vertex"===e?"out":"in")+` ${r.type} ${i};`)),t}}class m{constructor(){this._entries=new Map}add(e,t,r=0){const i=this._entries.get(r);i?.name!==e||i?.type!==t?this._entries.set(r,{name:e,type:t}):o().warn(`Fragment shader output location ${r} occupied`)}static{this.DEFAULT_TYPE="vec4"}static{this.DEFAULT_NAME="fragColor"}generateSource(e){if("vertex"===e)return[];0===this._entries.size&&this._entries.set(0,{name:m.DEFAULT_NAME,type:m.DEFAULT_TYPE});const t=new Array;return this._entries.forEach((e,r)=>t.push(`layout(location = ${r}) out ${e.type} ${e.name};`)),t}}class f{constructor(e){this._stage=e,this._entries=new Set}add(e,t,r){let i="ERROR_CONSTRUCTOR_STRING";switch(t){case"float":i=f._numberToFloatStr(r);break;case"int":i=f._numberToIntStr(r);break;case"bool":i=r.toString();break;case"vec2":i=`vec2(${f._numberToFloatStr(r[0])}, ${f._numberToFloatStr(r[1])})`;break;case"vec3":i=`vec3(${f._numberToFloatStr(r[0])}, ${f._numberToFloatStr(r[1])}, ${f._numberToFloatStr(r[2])})`;break;case"vec4":i=`vec4(${f._numberToFloatStr(r[0])}, ${f._numberToFloatStr(r[1])}, ${f._numberToFloatStr(r[2])}, ${f._numberToFloatStr(r[3])})`;break;case"ivec2":i=`ivec2(${f._numberToIntStr(r[0])}, ${f._numberToIntStr(r[1])})`;break;case"ivec3":i=`ivec3(${f._numberToIntStr(r[0])}, ${f._numberToIntStr(r[1])}, ${f._numberToIntStr(r[2])})`;break;case"ivec4":i=`ivec4(${f._numberToIntStr(r[0])}, ${f._numberToIntStr(r[1])}, ${f._numberToIntStr(r[2])}, ${f._numberToIntStr(r[3])})`;break;case"uvec2":i=`uvec2(${f._numberToIntStr(r[0])}, ${f._numberToIntStr(r[1])})`;break;case"uvec3":i=`uvec3(${f._numberToIntStr(r[0])}, ${f._numberToIntStr(r[1])}, ${f._numberToIntStr(r[2])})`;break;case"uvec4":i=`uvec4(${f._numberToIntStr(r[0])}, ${f._numberToIntStr(r[1])}, ${f._numberToIntStr(r[2])}, ${f._numberToIntStr(r[3])})`;break;case"mat2":case"mat3":case"mat4":i=`${t}(${Array.prototype.map.call(r,e=>f._numberToFloatStr(e)).join(", ")})`}return this._entries.add(`const ${t} ${e} = ${i};`),this._stage}static _numberToIntStr(e){return e.toFixed(0)}static _numberToFloatStr(e){return Number.isInteger(e)?e.toFixed(1):e.toString()}generateSource(){return Array.from(this._entries)}}const g="#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n precision highp int;\n precision highp sampler2D;\n precision highp usampler2D;\n precision highp sampler2DArray;\n precision highp sampler2DShadow;\n#else\n precision mediump float;\n precision mediump int;\n precision mediump sampler2D;\n precision mediump usampler2D;\n precision mediump sampler2DArray;\n precision mediump sampler2DShadow;\n#endif",v="precision highp float;\n precision highp sampler2D;\n precision highp usampler2D;\n precision highp sampler2DArray;\n precision highp sampler2DShadow;\n\n\n invariant gl_Position;\n "},14314:(e,t,r)=>{r.d(t,{I:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"vec4",0,(i,n)=>i.setUniform4fv(e,t(n),r))}}},15581:(e,t,r)=>{r.d(t,{S:()=>x,b:()=>g,g:()=>v});var i=r(37585),n=r(48163),o=r(82048),a=r(52540),s=r(34845),l=r(77108),c=r(47286),d=r(33094),u=r(20304),h=r(31821),p=r(63761),m=r(14113);const f=16;function g(){const e=new m.N5,t=e.fragment;return e.include(o.c),e.include(s.Ir),t.include(a.E),t.uniforms.add(new d.U("radius",e=>v(e.camera))).code.add(h.H`vec3 sphere[16] = vec3[16](
11
+ }`))}},11725:(e,t,r)=>{r.d(t,{i:()=>s});var i=r(24326),n=r(35256),o=r(43616),a=r(65786);class s{constructor(e,t){this.id=(0,i.c)(),this.supportsEdges=!1,this._renderPriority=0,this._parameters=new t,(0,o.MB)(this._parameters,e),this.validateParameters(this._parameters)}get parameters(){return this._parameters}update(e){return!1}setParameters(e,t=!0){(0,o.MB)(this._parameters,e)&&(this.validateParameters(this._parameters),t&&this._parametersChanged())}validateParameters(e){}shouldRender(e){return this.visible&&this.isVisibleForOutput(e.output)&&(!this.parameters.isDecoration||e.bind.decorations)&&0!==(this.parameters.renderOccluded&e.renderOccludedMask)}isVisibleForOutput(e){return!0}get renderPriority(){return this._renderPriority}set renderPriority(e){e!==this._renderPriority&&(this._renderPriority=e,this._parametersChanged())}_parametersChanged(){this.repository?.materialChanged(this)}get renderOccludedFlags(){return this.visible?this.parameters.renderOccluded:0}get hasEmissions(){return!1}getConfiguration(e,t,r=new n.E){return r.output=e,r.hasHighlightMixTexture=9===e&&null!=t.highlightMixTexture,r}}a.Y},11868:(e,t,r)=>{r.d(t,{Wz:()=>o,oe:()=>n});var i=r(34275);function n(e,t=!1){return e<=i.y9?t?new Array(e).fill(0):new Array(e):new Float32Array(e)}function o(e){return(Array.isArray(e)?e.length:e.byteLength/8)<=i.y9?Array.from(e):new Float32Array(e)}},11964:(e,t,r)=>{r.d(t,{Cr:()=>d,H6:()=>p,LV:()=>c,_I:()=>h,kb:()=>u,vt:()=>l});var i=r(34727),n=r(4341),o=r(38954),a=r(51850),s=r(32114);function l(e){return e?{origin:(0,a.o8)(e.origin),vector:(0,a.o8)(e.vector)}:{origin:(0,a.vt)(),vector:(0,a.vt)()}}function c(e,t){const r=m.get();return r.origin=e,r.vector=t,r}function d(e,t,r=l()){return(0,o.d)(r.origin,e),(0,o.e)(r.vector,t,e),r}function u(e,t){const r=(0,o.e)(s.rq.get(),t,e.origin),n=(0,o.f)(e.vector,r),a=(0,o.f)(e.vector,e.vector),l=(0,i.qE)(n/a,0,1),c=(0,o.e)(s.rq.get(),(0,o.h)(s.rq.get(),e.vector,l),r);return(0,o.f)(c,c)}function h(e,t,r){return p(e,t,0,1,r)}function p(e,t,r,n,a){const{vector:l,origin:c}=e,d=(0,o.e)(s.rq.get(),t,c),u=(0,o.f)(l,d)/(0,o.m)(l);return(0,o.h)(a,l,(0,i.qE)(u,r,n)),(0,o.g)(a,a,e.origin)}(0,a.vt)(),(0,a.vt)();const m=new n.I(()=>l())},12791:(e,t,r)=>{r.d(t,{x:()=>n});var i=r(74333);class n extends i.n{constructor(e,t){super(e,"sampler2D",0,(r,i)=>r.bindTexture(e,t(i)))}}},13840:(e,t,r)=>{r.d(t,{r:()=>i});class i{constructor(e,t){this._module=e,this._load=t}get(){return this._module}async reload(){return this._module=await this._load(),this._module}}},14113:(e,t,r)=>{r.d(t,{N5:()=>s});var i=r(49186),n=(r(44208),r(53966));const o=()=>n.A.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder");class a{constructor(){this._includedModules=new Map}include(e,t){this._includedModules.has(e)?this._includedModules.get(e):(this._includedModules.set(e,t),e(this.builder,t))}}class s extends a{constructor(){super(...arguments),this.vertex=new u,this.fragment=new u,this.attributes=new h,this.varyings=new p,this.outputs=new m}get fragmentUniforms(){return this.fragment.uniforms.entries}get attributeNames(){return this.attributes.names}get builder(){return this}generate(e,t=!1){const r=this.attributes.generateSource(e),i=this.varyings.generateSource(e),n="vertex"===e?this.vertex:this.fragment,o=n.uniforms.generateSource(),a=n.code.generateSource(),s=n.main.generateSource(t),l="vertex"===e?v:g,c=n.constants.generateSource(),d=this.outputs.generateSource(e);return`#version 300 es\n${l}\n${c.join("\n")}\n${o.join("\n")}\n${r.join("\n")}\n${i.join("\n")}\n${d.join("\n")}\n${a.join("\n")}\n${s.join("\n")}`}generateBind(e){const t=new Map;this.vertex.uniforms.entries.forEach(e=>{const r=e.bind[0];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{const r=e.bind[0];r&&t.set(e.name,r)});const r=Array.from(t.values()),i=r.length;return t=>{for(let n=0;n<i;++n)r[n](e,t)}}generateBindPass(e){const t=new Map;this.vertex.uniforms.entries.forEach(e=>{const r=e.bind[1];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{const r=e.bind[1];r&&t.set(e.name,r)});const r=Array.from(t.values()),i=r.length;return(t,n)=>{for(let o=0;o<i;++o)r[o](e,t,n)}}generateBindDraw(e){const t=new Map;this.vertex.uniforms.entries.forEach(e=>{const r=e.bind[2];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{const r=e.bind[2];r&&t.set(e.name,r)});const r=Array.from(t.values()),i=r.length;return(t,n,o)=>{for(let a=0;a<i;++a)r[a](e,o,t,n)}}}class l{constructor(e){this._stage=e,this._entries=new Map}add(...e){for(const t of e)this._add(t);return this._stage}get(e){return this._entries.get(e)}_add(e){if(null!=e){if(this._entries.has(e.name)&&!this._entries.get(e.name).equals(e))throw new i.A("shaderbuilder:duplicate-uniform",`Duplicate uniform name ${e.name} for different uniform type`);this._entries.set(e.name,e)}else o().error(`Trying to add null Uniform from ${(new Error).stack}.`)}generateSource(){return Array.from(this._entries.values()).map(({name:e,arraySize:t,type:r})=>null!=t?`uniform ${r} ${e}[${t}];`:`uniform ${r} ${e};`)}get entries(){return Array.from(this._entries.values())}}class c{constructor(e){this._stage=e,this._bodies=new Array}add(e){return this._bodies.push(e),this._stage}generateSource(e){if(this._bodies.length>0)return[`void main() {\n ${this._bodies.join("\n")||""} \n}`];if(e)throw new i.A("shaderbuilder:missing-main","Shader does not contain main function body.");return[]}}class d{constructor(e){this._stage=e,this._entries=new Array}add(e){return this._entries.push(e),this._stage}generateSource(){return this._entries}}class u extends a{constructor(){super(...arguments),this.uniforms=new l(this),this.main=new c(this),this.code=new d(this),this.constants=new f(this)}get builder(){return this}}class h{constructor(){this._entries=new Array}add(e,t){this._entries.push([e,t])}generateSource(e){return"fragment"===e?[]:this._entries.map(e=>`in ${e[1]} ${e[0]};`)}get names(){return this._entries.map(([e])=>e)}}class p{constructor(){this._entries=new Map}add(e,t,r){this._entries.has(e)?o().warn(`Ignoring duplicate varying ${t} ${e}`):this._entries.set(e,{type:t,invariant:r?.invariant??!1})}generateSource(e){const t=new Array;return this._entries.forEach((r,i)=>t.push((r.invariant&&"vertex"===e?"invariant ":"")+("int"===r.type?"flat ":"")+("vertex"===e?"out":"in")+` ${r.type} ${i};`)),t}}class m{constructor(){this._entries=new Map}add(e,t,r=0){const i=this._entries.get(r);i?.name!==e||i?.type!==t?this._entries.set(r,{name:e,type:t}):o().warn(`Fragment shader output location ${r} occupied`)}static{this.DEFAULT_TYPE="vec4"}static{this.DEFAULT_NAME="fragColor"}generateSource(e){if("vertex"===e)return[];0===this._entries.size&&this._entries.set(0,{name:m.DEFAULT_NAME,type:m.DEFAULT_TYPE});const t=new Array;return this._entries.forEach((e,r)=>t.push(`layout(location = ${r}) out ${e.type} ${e.name};`)),t}}class f{constructor(e){this._stage=e,this._entries=new Set}add(e,t,r){let i="ERROR_CONSTRUCTOR_STRING";switch(t){case"float":i=f._numberToFloatStr(r);break;case"int":i=f._numberToIntStr(r);break;case"bool":i=r.toString();break;case"vec2":i=`vec2(${f._numberToFloatStr(r[0])}, ${f._numberToFloatStr(r[1])})`;break;case"vec3":i=`vec3(${f._numberToFloatStr(r[0])}, ${f._numberToFloatStr(r[1])}, ${f._numberToFloatStr(r[2])})`;break;case"vec4":i=`vec4(${f._numberToFloatStr(r[0])}, ${f._numberToFloatStr(r[1])}, ${f._numberToFloatStr(r[2])}, ${f._numberToFloatStr(r[3])})`;break;case"ivec2":i=`ivec2(${f._numberToIntStr(r[0])}, ${f._numberToIntStr(r[1])})`;break;case"ivec3":i=`ivec3(${f._numberToIntStr(r[0])}, ${f._numberToIntStr(r[1])}, ${f._numberToIntStr(r[2])})`;break;case"ivec4":i=`ivec4(${f._numberToIntStr(r[0])}, ${f._numberToIntStr(r[1])}, ${f._numberToIntStr(r[2])}, ${f._numberToIntStr(r[3])})`;break;case"uvec2":i=`uvec2(${f._numberToIntStr(r[0])}, ${f._numberToIntStr(r[1])})`;break;case"uvec3":i=`uvec3(${f._numberToIntStr(r[0])}, ${f._numberToIntStr(r[1])}, ${f._numberToIntStr(r[2])})`;break;case"uvec4":i=`uvec4(${f._numberToIntStr(r[0])}, ${f._numberToIntStr(r[1])}, ${f._numberToIntStr(r[2])}, ${f._numberToIntStr(r[3])})`;break;case"mat2":case"mat3":case"mat4":i=`${t}(${Array.prototype.map.call(r,e=>f._numberToFloatStr(e)).join(", ")})`}return this._entries.add(`const ${t} ${e} = ${i};`),this._stage}static _numberToIntStr(e){return e.toFixed(0)}static _numberToFloatStr(e){return Number.isInteger(e)?e.toFixed(1):e.toString()}generateSource(){return Array.from(this._entries)}}const g="#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n precision highp int;\n precision highp sampler2D;\n precision highp usampler2D;\n precision highp sampler2DArray;\n precision highp sampler2DShadow;\n#else\n precision mediump float;\n precision mediump int;\n precision mediump sampler2D;\n precision mediump usampler2D;\n precision mediump sampler2DArray;\n precision mediump sampler2DShadow;\n#endif",v="precision highp float;\n precision highp sampler2D;\n precision highp usampler2D;\n precision highp sampler2DArray;\n precision highp sampler2DShadow;\n\n\n invariant gl_Position;\n "},14314:(e,t,r)=>{r.d(t,{I:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"vec4",0,(i,n)=>i.setUniform4fv(e,t(n),r))}}},14527:(e,t,r)=>{r.d(t,{n:()=>pt});var i=r(31821),n=r(12791),o=r(31635),a=r(34727),s=r(97768),l=r(36708),c=r(78659),d=r(10107),u=(r(44208),r(53966)),h=(r(87811),r(64108)),p=r(37585),m=r(69540);let f=class extends m.Pw{constructor(e){super(e),this.row=0,this.column=0,this.rows=1,this.columns=1}equals(e){return null!=e&&this.row===e.row&&this.rows===e.rows&&this.column===e.column&&this.columns===e.columns}};(0,o.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],f.prototype,"row",void 0),(0,o.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],f.prototype,"column",void 0),(0,o.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],f.prototype,"rows",void 0),(0,o.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],f.prototype,"columns",void 0),f=(0,o.Cg)([(0,h.$)("esri.CameraLayout")],f);const g=f;var v=r(69052),_=r(25482),x=r(79901),w=r(36005),y=r(43937),b=r(56507),M=r(86738);let T=class extends((0,m.OU)(_.o)){constructor(...e){super(...e),this.position=new M.A([0,0,0]),this.heading=0,this.tilt=0,this.fov=55,this.layout=new g}normalizeCtorArgs(e,t,r,i){if(e&&"object"==typeof e&&("x"in e||Array.isArray(e))){const n={position:e};return null!=t&&(n.heading=t),null!=r&&(n.tilt=r),null!=i&&(n.fov=i),n}return e}writePosition(e,t,r,i){const n=e.clone();n.x=(0,b.GB)(e.x||0),n.y=(0,b.GB)(e.y||0),n.z=e.hasZ?(0,b.GB)(e.z||0):e.z,t[r]=n.write({},i)}readPosition(e,t){const r=new M.A;return r.read(e,t),r.x=(0,b.GB)(r.x||0),r.y=(0,b.GB)(r.y||0),r.z=r.hasZ?(0,b.GB)(r.z||0):r.z,r}equals(e){return null!=e&&this.tilt===e.tilt&&this.heading===e.heading&&this.fov===e.fov&&this.position.equals(e.position)&&this.layout.equals(e.layout)}};(0,o.Cg)([(0,d.MZ)({type:M.A,json:{write:{isRequired:!0}}})],T.prototype,"position",void 0),(0,o.Cg)([(0,y.K)("position")],T.prototype,"writePosition",null),(0,o.Cg)([(0,w.w)("position")],T.prototype,"readPosition",null),(0,o.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),(0,x.w)(e=>v.ie.normalize((0,b.GB)(e)))],T.prototype,"heading",void 0),(0,o.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),(0,x.w)(e=>(0,a.qE)((0,b.GB)(e),-180,180))],T.prototype,"tilt",void 0),(0,o.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{default:55,write:!0}}),(0,x.w)(e=>(0,a.qE)((0,b.GB)(e,55),1,170))],T.prototype,"fov",void 0),(0,o.Cg)([(0,d.MZ)({type:g,nonNullable:!0,json:{read:!1,write:!1}})],T.prototype,"layout",void 0),T=(0,o.Cg)([(0,h.$)("esri.Camera")],T);var C,S=r(9093),E=r(38954),A=r(51850),R=r(16930),I=(r(48353),r(9762),r(65806)),F=r(27993),O=r(73941),P=(r(19419),r(69622)),D=r(90629),N=r(58083),H=r(48163),L=r(87317),z=r(91829),B=r(82919),G=r(71351),U=r(44280);let V=C=class extends P.A{constructor(e){super(e),this._ray=(0,G.vt)(),this._viewport=(0,z.fA)(0,0,1,1),this._padding=(0,z.fA)(0,0,0,0),this._fov=55/180*Math.PI,this._nearFar=(0,H.fA)(1,1e3),this._viewDirty=!0,this._viewMatrix=(0,S.vt)(),this._viewProjectionDirty=!0,this._viewProjectionMatrix=(0,S.vt)(),this._viewInverseTransposeMatrixDirty=!0,this._viewInverseTransposeMatrix=(0,S.vt)(),this._frustumDirty=!0,this._frustum=(0,B.vt)(),this._fullViewport=(0,z.vt)(),this._pixelRatio=1,this.row=0,this.column=0,this._rows=1,this._columns=1,this._center=(0,A.vt)(),this._up=(0,A.vt)(),this.relativeElevation=0}get pixelRatio(){return this._pixelRatio}set pixelRatio(e){this._pixelRatio=e>0?e:1}get rows(){return this._rows}set rows(e){this._rows=Math.max(1,e)}get columns(){return this._columns}set columns(e){this._columns=Math.max(1,e)}get eye(){return this._ray.origin}set eye(e){this._compareAndSetView(e,this._ray.origin)}get center(){return this._center}set center(e){this._compareAndSetView(e,this._center,"_center")}get ray(){return(0,E.e)(this._ray.direction,this.center,this.eye),this._ray}get up(){return this._up}set up(e){this._compareAndSetView(e,this._up,"_up")}get viewMatrix(){return this._ensureViewClean(),this._viewMatrix}set viewMatrix(e){(0,N.C)(this._viewMatrix,e),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0}get viewForward(){return this._ensureViewClean(),(0,E.j)((0,A.vt)(),-this._viewMatrix[2],-this._viewMatrix[6],-this._viewMatrix[10])}get viewUp(){return this._ensureViewClean(),(0,E.j)((0,A.vt)(),this._viewMatrix[1],this._viewMatrix[5],this._viewMatrix[9])}get viewRight(){return this._ensureViewClean(),(0,E.j)((0,A.vt)(),this._viewMatrix[0],this._viewMatrix[4],this._viewMatrix[8])}get nearFar(){return this._nearFar}get near(){return this._nearFar[0]}set near(e){this._nearFar[0]!==e&&(this._nearFar[0]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get far(){return this._nearFar[1]}set far(e){this._nearFar[1]!==e&&(this._nearFar[1]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get viewport(){return this._viewport}set viewport(e){this.x=e[0],this.y=e[1],this.width=e[2],this.height=e[3]}get screenViewport(){if(1===this.pixelRatio)return this._viewport;const e=(0,L.c)((0,z.vt)(),this._viewport,1/this.pixelRatio),t=this._get("screenViewport");return t&&(0,L.e)(e,t)?t:e}get screenPadding(){if(1===this.pixelRatio)return this._padding;const e=(0,L.c)((0,z.vt)(),this._padding,1/this.pixelRatio),t=this._get("screenPadding");return t&&(0,L.e)(e,t)?t:e}get x(){return this._viewport[0]}set x(e){e+=this._padding[3],this._viewport[0]!==e&&(this._viewport[0]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get y(){return this._viewport[1]}set y(e){e+=this._padding[2],this._viewport[1]!==e&&(this._viewport[1]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get width(){return this._viewport[2]}set width(e){this._viewport[2]!==e&&(this._viewport[2]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get height(){return this._viewport[3]}set height(e){this._viewport[3]!==e&&(this._viewport[3]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get fullWidth(){return this._viewport[2]+this._padding[1]+this._padding[3]}set fullWidth(e){this.width=e-(this._padding[1]+this._padding[3])}get fullHeight(){return this._viewport[3]+this._padding[0]+this._padding[2]}set fullHeight(e){this.height=e-(this._padding[0]+this._padding[2])}get fullViewport(){return this._fullViewport[0]=this._viewport[0]-this._padding[3],this._fullViewport[1]=this._viewport[1]-this._padding[2],this._fullViewport[2]=this.fullWidth,this._fullViewport[3]=this.fullHeight,this._fullViewport}get _aspect(){return this.width/this.height}get padding(){return this._padding}set padding(e){(0,L.a)(this._padding,e)||(this._viewport[0]+=e[3]-this._padding[3],this._viewport[1]+=e[2]-this._padding[2],this._viewport[2]-=e[1]+e[3]-(this._padding[1]+this._padding[3]),this._viewport[3]-=e[0]+e[2]-(this._padding[0]+this._padding[2]),(0,L.d)(this._padding,e),this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_padding"),this.notifyChange("_viewport"))}get viewProjectionMatrix(){return this._viewProjectionDirty&&((0,N.lw)(this._viewProjectionMatrix,this.projectionMatrix,this.viewMatrix),this._viewProjectionDirty=!1),this._viewProjectionMatrix}get projectionMatrix(){return this._projectionMatrixInternal}get inverseProjectionMatrix(){return(0,N.B8)((0,S.vt)(),this.projectionMatrix)||this._get("inverseProjectionMatrix")||(0,S.vt)()}get fov(){return this._fov}set fov(e){this._fov=e,this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovX(){return e=this._fov,t=this.width,r=this.height,2*Math.atan(t*Math.tan(.5*e)/Math.sqrt(t*t+r*r));var e,t,r}set fovX(e){this._fov=function(e,t,r){return 2*Math.atan(Math.sqrt(t*t+r*r)*Math.tan(.5*e)/t)}(e,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovY(){return e=this._fov,t=this.width,r=this.height,2*Math.atan(r*Math.tan(.5*e)/Math.sqrt(t*t+r*r));var e,t,r}set fovY(e){this._fov=function(e,t,r){return 2*Math.atan(Math.sqrt(t*t+r*r)*Math.tan(.5*e)/r)}(e,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get distance(){return(0,E.k)(this.center,this.eye)}get frustum(){return this._recomputeFrustum(),this._frustum}get viewInverseTransposeMatrix(){return(this._viewInverseTransposeMatrixDirty||this._viewDirty)&&((0,N.B8)(this._viewInverseTransposeMatrix,this.viewMatrix),(0,N.mg)(this._viewInverseTransposeMatrix,this._viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),this._viewInverseTransposeMatrix}depthNDCToWorld(e){const{near:t,far:r}=this;return 2*t*r/(r+t-e*(r-t))}get perRenderPixelRatio(){return Math.tan(this.fovX/2)/(this.width/2)}get perScreenPixelRatio(){return this.perRenderPixelRatio*this.pixelRatio}get aboveGround(){return null!=this.relativeElevation&&this.relativeElevation>=0}get _projectionMatrixInternal(){const e=this.width,t=this.height,r=this.near*Math.tan(this.fovY/2)*2,i=r*this._aspect,n=r/this.rows,o=i/this.columns,a=-i/2+this.column*o,s=a+o,l=-r/2+this.row*n,c=l+n,d=(0,N.$h)((0,S.vt)(),a*(1+2*this._padding[3]/e),s*(1+2*this._padding[1]/e),l*(1+2*this._padding[2]/t),c*(1+2*this._padding[0]/t),this.near,this.far),u=this._get("projectionMatrix");return u&&(0,N.aI)(u,d)?u:d}copyFrom(e){(0,E.d)(this._ray.origin,e.eye),this.center=e.center,this.up=e.up,(0,L.d)(this._viewport,e.viewport),this.notifyChange("_viewport"),(0,L.d)(this._padding,e.padding),this.notifyChange("_padding"),(0,p.C)(this._nearFar,e.nearFar),this.notifyChange("_nearFar"),this._fov=e.fov,this.row=e.row,this.column=e.column,this.rows=e.rows,this.columns=e.columns,this.relativeElevation=e.relativeElevation;const t=e;return this._viewDirty=t._viewDirty,this._viewDirty||((0,N.C)(this._viewMatrix,e.viewMatrix),this.notifyChange("_viewMatrix")),this._viewProjectionDirty=!0,this._frustumDirty=t._frustumDirty,this._frustumDirty||((0,B.C)(this._frustum,e.frustum),this._frustumDirty=!1),t._viewInverseTransposeMatrixDirty?this._viewInverseTransposeMatrixDirty=!0:((0,N.C)(this._viewInverseTransposeMatrix,e.viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),(0,L.d)(this._fullViewport,e.fullViewport),this.pixelRatio=e.pixelRatio,this}copyViewFrom(e){this.eye=e.eye,this.center=e.center,this.up=e.up,this.fov=e.fov}clone(){return(new C).copyFrom(this)}equals(e){return(0,E.q)(this.eye,e.eye)&&(0,E.q)(this.center,e.center)&&(0,E.q)(this.up,e.up)&&(0,L.a)(this._viewport,e.viewport)&&(0,L.a)(this._padding,e.padding)&&(0,p.t2)(this.nearFar,e.nearFar)&&this._fov===e.fov&&this.pixelRatio===e.pixelRatio&&this.relativeElevation===e.relativeElevation&&this.row===e.row&&this.column===e.column&&this.rows===e.rows&&this.columns===e.columns}almostEquals(e){const t=Math.max(1,1/this.pixelRatio,1/e.pixelRatio);if(Math.abs(e.fov-this._fov)>=.001||(0,L.f)(e.screenPadding,this.screenPadding)>=t||(0,L.f)(this.screenViewport,e.screenViewport)>=t||this.row!==e.row||this.column!==e.column||this.rows!==e.rows||this.columns!==e.columns)return!1;(0,E.a)(k,e.eye,e.center),(0,E.a)($,this.eye,this.center);const r=(0,E.f)(k,$),i=(0,E.y)(k),n=(0,E.y)($),o=5e-4;return r*r>=(1-1e-10)*i*n&&(0,E.x)(e.eye,this.eye)<Math.max(i,n)*o*o}computeRenderPixelSizeAt(e){return this.computeRenderPixelSizeAtDist(this._viewDirectionDistance(e))}computeRenderPixelSizeAtDist(e){return e*this.perRenderPixelRatio}computeScreenPixelSizeAt(e){return this.computeScreenPixelSizeAtDist(this._viewDirectionDistance(e))}_viewDirectionDistance(e){return Math.abs((0,U.gr)(this.viewForward,(0,E.e)(k,e,this.eye)))}computeScreenPixelSizeAtDist(e){return e*this.perScreenPixelRatio}computeDistanceFromRadius(e,t){return e/Math.tan(Math.min(this.fovX,this.fovY)/(2*(t||1)))}getScreenCenter(e=(0,D.gs)()){return e[0]=(this.padding[3]+this.width/2)/this.pixelRatio,e[1]=(this.padding[0]+this.height/2)/this.pixelRatio,e}getRenderCenter(e,t=.5,r=.5){return e[0]=this.padding[3]+this.width*t,e[1]=this.padding[2]+this.height*r,e[2]=.5,e}setGLViewport(e){const t=this.viewport,r=this.padding;e.setViewport(t[0]-r[3],t[1]-r[2],t[2]+r[1]+r[3],t[3]+r[0]+r[2])}applyProjection(e,t){e!==j&&(0,E.d)(j,e),j[3]=1,(0,L.t)(j,j,this.projectionMatrix);const r=Math.abs(j[3]);(0,E.h)(j,j,1/r);const i=this.fullViewport;t[0]=(0,a.Cc)(0,i[0]+i[2],.5+.5*j[0]),t[1]=(0,a.Cc)(0,i[1]+i[3],.5+.5*j[1]),t[2]=.5*(j[2]+1),t[3]=r}unapplyProjection(e,t){const r=this.fullViewport;j[0]=(e[0]/(r[0]+r[2])*2-1)*e[3],j[1]=(e[1]/(r[1]+r[3])*2-1)*e[3],j[2]=(2*e[2]-1)*e[3],j[3]=e[3],null!=this.inverseProjectionMatrix&&((0,L.t)(j,j,this.inverseProjectionMatrix),t[0]=j[0],t[1]=j[1],t[2]=j[2])}projectToScreen(e,t){return this.projectToRenderScreen(e,Z),this.renderToScreen(Z,t),t}projectToRenderScreen(e,t){if(j[0]=e[0],j[1]=e[1],j[2]=e[2],j[3]=1,(0,L.t)(j,j,this.viewProjectionMatrix),0===j[3])return null;const r=j;(0,E.h)(r,r,1/Math.abs(j[3]));const i=this.fullViewport,n=(0,a.Cc)(0,i[0]+i[2],.5+.5*r[0]),o=(0,a.Cc)(0,i[1]+i[3],.5+.5*r[1]);return"x"in t?(t.x=n,t.y=o):(t[0]=n,t[1]=o,t.length>2&&(t[2]=.5*(r[2]+1))),t}unprojectFromScreen(e,t){return this.unprojectFromRenderScreen(this.screenToRender(e,Z),t)}unprojectFromRenderScreen(e,t){if((0,N.lw)(W,this.projectionMatrix,this.viewMatrix),!(0,N.B8)(W,W))return null;const r=this.fullViewport;return j[0]=2*(e[0]-r[0])/r[2]-1,j[1]=2*(e[1]-r[1])/r[3]-1,j[2]=2*e[2]-1,j[3]=1,(0,L.t)(j,j,W),0===j[3]?null:(t[0]=j[0]/j[3],t[1]=j[1]/j[3],t[2]=j[2]/j[3],t)}constrainWindowSize(e,t,r,i){const n=e*this.pixelRatio,o=t*this.pixelRatio,a=Math.max(n-r/2,0),s=Math.max(this.fullHeight-o-i/2,0),l=-Math.min(n-r/2,0),c=-Math.min(this.fullHeight-o-i/2,0),d=r-l- -Math.min(this.fullWidth-n-r/2,0),u=i-c- -Math.min(o-i/2,0);return[Math.round(a),Math.round(s),Math.round(d),Math.round(u)]}computeUp(e){1===e?this._computeUpGlobal():this._computeUpLocal()}screenToRender(e,t){const r=e[0]*this.pixelRatio,i=this.fullHeight-e[1]*this.pixelRatio;return t[0]=r,t[1]=i,t}renderToScreen(e,t){const r=e[0]/this.pixelRatio,i=(this.fullHeight-e[1])/this.pixelRatio;t[0]=r,t[1]=i}_computeUpGlobal(){(0,E.e)(k,this.center,this.eye);const e=(0,E.b)(this.center);e<1?(0,E.q)(this._up,A.Cb)&&((0,E.d)(this._up,A.Cb),this._markViewDirty(),this.notifyChange("_up")):Math.abs((0,E.f)(k,this.center))>.9999*(0,E.b)(k)*e||((0,E.i)($,k,this.center),(0,E.i)($,$,k),(0,E.n)($,$),(0,E.q)(this._up,$)||((0,E.d)(this._up,$),this.notifyChange("_up"),this._markViewDirty()))}_computeUpLocal(){(0,E.E)(k,this.eye,this.center),Math.abs(k[2])<=.9999&&((0,E.h)(k,k,k[2]),(0,E.j)(k,-k[0],-k[1],1-k[2]),(0,E.n)(k,k),(0,E.q)(this._up,k)||((0,E.d)(this._up,k),this.notifyChange("_up"),this._markViewDirty()))}_compareAndSetView(e,t,r=""){"number"==typeof e[0]&&isFinite(e[0])&&"number"==typeof e[1]&&isFinite(e[1])&&"number"==typeof e[2]&&isFinite(e[2])?(0,E.q)(e,t)||((0,E.d)(t,e),this._markViewDirty(),r.length&&this.notifyChange(r)):u.A.getLogger("esri.views.3d.webgl-engine.lib.RenderCamera").warn("RenderCamera vector contains invalid number, ignoring value")}_markViewDirty(){this._viewDirty=!0,this._frustumDirty=!0,this._viewProjectionDirty=!0}_recomputeFrustum(){this._frustumDirty&&((0,B.ui)(this.viewMatrix,this.projectionMatrix,this._frustum),this._frustumDirty=!1)}_ensureViewClean(){this._viewDirty&&((0,N.t5)(this._viewMatrix,this.eye,this.center,this.up),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0)}};(0,o.Cg)([(0,d.MZ)()],V.prototype,"_viewport",void 0),(0,o.Cg)([(0,d.MZ)()],V.prototype,"_padding",void 0),(0,o.Cg)([(0,d.MZ)()],V.prototype,"_fov",void 0),(0,o.Cg)([(0,d.MZ)()],V.prototype,"_nearFar",void 0),(0,o.Cg)([(0,d.MZ)()],V.prototype,"_viewDirty",void 0),(0,o.Cg)([(0,d.MZ)()],V.prototype,"_viewMatrix",void 0),(0,o.Cg)([(0,d.MZ)()],V.prototype,"_pixelRatio",void 0),(0,o.Cg)([(0,d.MZ)()],V.prototype,"pixelRatio",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"row",void 0),(0,o.Cg)([(0,d.MZ)()],V.prototype,"column",void 0),(0,o.Cg)([(0,d.MZ)()],V.prototype,"_rows",void 0),(0,o.Cg)([(0,d.MZ)()],V.prototype,"rows",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"_columns",void 0),(0,o.Cg)([(0,d.MZ)()],V.prototype,"columns",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"eye",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"center",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"_center",void 0),(0,o.Cg)([(0,d.MZ)()],V.prototype,"up",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"_up",void 0),(0,o.Cg)([(0,d.MZ)()],V.prototype,"viewMatrix",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],V.prototype,"viewForward",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],V.prototype,"viewUp",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],V.prototype,"viewRight",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],V.prototype,"nearFar",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"near",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"far",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"viewport",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],V.prototype,"screenViewport",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],V.prototype,"screenPadding",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"x",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"y",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"width",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"height",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"fullWidth",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"fullHeight",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],V.prototype,"_aspect",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"padding",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],V.prototype,"projectionMatrix",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],V.prototype,"inverseProjectionMatrix",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"fov",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"fovX",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"fovY",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"viewInverseTransposeMatrix",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],V.prototype,"_projectionMatrixInternal",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"relativeElevation",void 0),V=C=(0,o.Cg)([(0,h.$)("esri.views.3d.webgl.RenderCamera")],V);const j=(0,z.vt)(),W=(0,S.vt)(),k=(0,A.vt)(),$=(0,A.vt)(),Z=(0,D.r_)();class q{constructor(e=1/0,t=-1/0){this.near=e,this.far=t}set(e,t){this.near=e,this.far=t}union(e){null!=e&&(this.near=Math.min(this.near,e.near),this.far=Math.max(this.far,e.far))}within(e){return this.near<=e&&e<=this.far}equals(e){return this.near===e.near&&this.far===e.far}static{this.Zero=new q(0,0)}static{this.Infinite=new q}}r(49718),r(6867),r(16396),(0,A.vt)(),(0,A.vt)(),(0,A.vt)(),new WeakMap;var Y=r(5443),X=r(39829),J=r(95108);function K(e,t,r,i){const n=function(e,t){const r=0===t||2===t?0:1,i=e[t],n=0===t||1===t?1:-1,o=0===r?1:0;return(e,t,a)=>{if(t[r]<i&&a[r]<i)return 1===n?0:1;if(t[r]>i&&a[r]>i)return 1===n?1:0;const s=(a[o]-t[o])/(a[r]-t[r]),l=t[o]+s*(i-t[r]);return e[r]=i,e[o]=l,(t[r]<i?1:-1)*n>0?2:3}}(r,i);if(e.length=0,t.length){1===n(ee,t[0],t[0])&&Q(e,t[0]);for(let r=0;r<t.length;r++){const i=t[r===t.length-1?0:r+1];switch(n(ee,t[r],i)){case 1:Q(e,i);break;case 3:Q(e,(0,H.o8)(ee));break;case 2:Q(e,(0,H.o8)(ee)),Q(e,i)}}}}function Q(e,t){0!==e.length&&(0,p.aI)(e.at(-1),t)||e.push(t)}const ee=(0,H.vt)();var te=r(11964),re=r(27921);const ie=(0,A.vt)(),ne=(0,A.vt)();function oe(){return{direction:(0,A.vt)(),up:(0,A.vt)()}}function ae(e,t,r,i,n){let o=(0,E.n)(ie,e),s=(0,E.f)(o,i);const l=s>0;s=Math.abs(s),s>.99&&(s=Math.abs((0,E.f)(t,i)),s<.99?((0,E.d)(o,t),l&&(0,E.h)(o,o,-1)):o=null);let c=0;if(o){(0,E.h)(ne,i,(0,E.f)(i,o)),(0,E.e)(o,o,ne);const e=(0,E.f)(o,n)/((0,E.b)(o)*(0,E.b)(n));(0,E.i)(ne,o,n),c=((0,E.f)(ne,i)>0?1:-1)*(0,a.KJ)((0,a.XM)(e))}const d=(0,a.KJ)((0,a.XM)(-(0,E.f)(i,e)/(0,E.b)(e)));return r?(r.heading=c,r.tilt=d,r):{heading:c,tilt:d}}function se(e,t,r,i){(0,E.e)(le,r,t),(0,re.T7)(i,(0,te.LV)(t,le),e)||e===r||(0,E.d)(e,r)}const le=(0,A.vt)(),ce=(0,A.fA)(0,1,0),de=(0,A.fA)(0,0,1),ue=(0,S.vt)(),he=(0,A.vt)(),pe=(0,A.vt)();function me(e,t,r,i=oe()){const{direction:n,up:o}=i;return(0,N.N9)(ue,-(0,a.kU)(t)),(0,N.eL)(ue,ue,(0,a.kU)(r)),(0,E.t)(n,de,ue),(0,E.h)(n,n,-1),(0,E.t)(o,ce,ue),i}function fe(e,t,r,i,n){const o=t.lines[11].direction,a=(n-r.getAltitude(i))/o[2];(0,E.c)(e,i,o,a)}const ge=(0,A.vt)();Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:function(e,t,r,i){return ae(t,r,i,de,ce)},eyeForCenterWithHeadingTilt:function(e,t,r,i){const n=me(0,r,i),o=(0,A.vt)();return(0,E.h)(o,n.direction,-t),(0,E.g)(o,o,e),{up:n.up,eye:o,heading:r,tilt:i}},eyeTiltToLookAtTilt:function(e){return(0,a.kU)(e)},headingTiltToDirectionUp:me,lookAtTiltToEyeTilt:function(e){return(0,a.KJ)(e)},toArea:function(e,t){const r=e.frustum,{renderCoordsHelper:i}=e,n=i.getAltitude(t),o=e.spatialReference,a=e.state.camera.eye,s=[],l=r.planes[5];for(let e=0;e<4;e++){const t=r.lines[e];i.intersectInfiniteManifold((0,G.LV)(t.origin,t.direction),n,ge)||fe(ge,r,i,t.endpoint,n),se(ge,a,ge,l),s.push((0,H.fA)(ge[0],ge[1]))}return function(e,t,r){const i=e.map(e=>((0,E.j)(ge,e[0],e[1],0),t.fromRenderCoords(ge,ge,r),[ge[0],ge[1]]));return i.length<=2?new X.A({spatialReference:r}):(i.push(i[0].slice()),(0,J.$3)(i)||i.reverse(),new X.A({rings:[i],spatialReference:r}))}(function(e,t){const r=[],i=[];return K(r,e,t,0),K(i,r,t,1),K(r,i,t,2),K(i,r,t,3),i}(s,i.extent),i,o)},toExtent:function(e,t,r,i,n){const o=e.renderSpatialReference,a=e.spatialReference??t.spatialReference;return(0,I.g)(t,he,o),(0,I.g)(t,pe,o),he[0]-=r/2,pe[0]+=r/2,he[1]-=i/2,pe[1]+=i/2,(0,F.F)(he,o,he,a),(0,F.F)(pe,o,pe,a),n?(n.xmin=he[0],n.ymin=he[1],n.xmax=pe[0],n.ymax=pe[1],n.spatialReference=a):n=new Y.A(he[0],he[1],pe[0],pe[1],a),n}},Symbol.toStringTag,{value:"Module"}));var ve=r(34304),_e=r(17136),xe=r(97937),we=r(28735);class ye{get planes(){return this.frustum}get points(){return this._points}get mutablePoints(){return this._points}get direction(){return this._direction}get origin(){return this._origin}constructor(e){this.renderCoordsHelper=e,this.frustum=(0,B.vt)(),this._points=(0,B.Qy)(),this.lines=new Array(12),this._origin=(0,A.vt)(),this._direction=(0,A.vt)(),this._altitude=null;for(let e=0;e<12;e++)this.lines[e]={origin:null,direction:(0,A.vt)(),endpoint:null}}update(e){(0,B.ui)(e.viewMatrix,e.projectionMatrix,this.frustum,this._points),(0,E.d)(this._origin,e.eye),(0,E.d)(this._direction,e.viewForward),this._altitude=this.renderCoordsHelper.getAltitude(this._origin),this._updateLines()}updatePoints(e){for(let t=0;t<this._points.length;t++)(0,E.d)(this._points[t],e[t]);(0,B.DV)(this.frustum,this._points),this._updateLines()}get altitude(){return this._altitude}intersectsSphere(e){return(0,B.m7)(this.frustum,e)}intersectsRay(e){return(0,B.pw)(this.frustum,e)}intersectsLineSegment(e,t){return(0,B.ST)(this.frustum,e,t)}intersectsPoint(e){return(0,B.bU)(this.frustum,e)}_updateLines(){const e=this._points;for(let t=0;t<4;t++){const r=t+4;be(this.lines[t],e[t],e[r]),be(this.lines[t+4],e[t],3===t?e[0]:e[t+1]),be(this.lines[t+8],e[r],3===t?e[4]:e[r+1])}}static{this.planePointIndices=B.c8}static{this.nearFarLineIndices=[[0,4],[1,5],[2,6],[3,7]]}}function be(e,t,r){e.origin=t,e.endpoint=r,(0,E.E)(e.direction,t,r)}r(83047);const Me=(0,A.fA)(parseFloat(Number(5802e-9).toFixed(6)),parseFloat(Number(13558e-9).toFixed(6)),parseFloat(Number(331e-7).toFixed(6))),Te=(0,A.fA)(3*parseFloat(Number(65e-8).toFixed(6)),3*parseFloat(Number(1881e-9).toFixed(6)),3*parseFloat(Number(85e-9).toFixed(6)));(0,A.fA)(parseFloat(Number(Me[0]+Te[0]).toFixed(6)),parseFloat(Number(Me[1]+Te[1]).toFixed(6)),parseFloat(Number(Me[2]+Te[2]).toFixed(6)));(0,A.vt)(),(0,A.vt)(),(0,xe.c)(),(0,G.vt)();const Ce=(0,A.vt)(),Se=(0,A.vt)();var Ee=r(32728);const Ae=(0,A.fA)(0,0,1),Re=(0,E.n)((0,A.vt)(),(0,A.fA)(1,1,1)),Ie=(0,S.vt)(),Fe=(0,A.vt)(),Oe=(0,A.vt)();function Pe(e,t,r,i=oe()){(0,E.i)(Fe,e,Ae),0===(0,E.f)(Fe,Fe)&&(0,E.i)(Fe,e,Re),(0,N.$0)(Ie,-(0,a.kU)(t),e),(0,N.e$)(Ie,Ie,-(0,a.kU)(r),Fe);const{up:n,direction:o}=i;return(0,E.i)(n,Fe,e),(0,E.n)(n,n),(0,E.t)(n,n,Ie),(0,E.n)(o,e),(0,E.u)(o,o),(0,E.t)(o,o,Ie),i}function De(e){const t=e[1];e[1]=-e[2],e[2]=t}function Ne(e,t){const r=Pe(t,e.heading,e.tilt);return e.up=r.up,e}function He(e,t){const r=[],i=[],n=(0,ve.FD)();for(let o=0;o<e.length;o++){const a=e[o],s=o===e.length-1?e[0]:e[o+1],l=(0,te.Cr)(a,s,We),c=(0,re.vE)(t,l.origin,l.vector,0,Ve);switch(c){case 2:r.push(a);break;case 3:i.push(a);break;case 0:case 1:{const[e,o,s]=0===c?[1,r,i]:[-1,i,r],l=(0,re.Qj)(t),d=(0,E.c)((0,A.vt)(),Ve,l,e*n),u=(0,E.c)((0,A.vt)(),Ve,l,e*-n);o.push(a),o.push(d),s.push(u)}}}const o=[];return r.length&&o.push(r),i.length&&o.push(i),o}const Le={minCurvature:(0,a.kU)(5),maxCurvature:(0,a.kU)(50),minSamples:1,maxSamples:6},ze=(0,A.fA)(1,0,0),Be=(0,A.fA)(0,1,0),Ge=(0,A.vt)(),Ue=(0,A.vt)(),Ve=(0,A.vt)(),je=(0,xe.c)(),We=(0,te.vt)(),ke=(0,z.vt)();Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:function(e,t,r,i){const n=Fe,o=Oe;return(0,E.n)(n,e),(0,E.i)(Oe,n,Ae),0===(0,E.f)(Oe,Oe)&&(0,E.i)(Oe,n,Re),(0,E.i)(o,Oe,n),ae(t,r,i,n,o)},eyeForCenterWithHeadingTilt:function(e,t,r,i){const n={eye:(0,A.vt)(),up:null,tilt:i,heading:r},o=Fe;o[0]=e[0],o[1]=e[2],o[2]=-e[1];const s=t,l=(0,a.kU)(r),c=(0,a.kU)(i),d=Math.sin(l),u=Math.cos(l),h=Math.sin(c),p=Math.cos(c),m=(0,E.b)(o);let f;if(Math.abs(c)<1e-8)f=s+m;else{const e=m/h,t=(0,a.YN)(s/e),r=Math.PI-c-t;f=e*Math.sin(r)}const g=p*s,v=s*s*(h*h),_=u*u*v,x=f-g,w=x*x,y=_*(_+w-o[1]*o[1]);if(y<0)return(0,E.h)(n.eye,o,f/m),n.tilt=0,Ne(n,e);const b=Math.sqrt(y),M=o[1]*x,T=_+w;let C;if(C=u>0?-b+M:b+M,Math.abs(T)<1e-8)return m<1e-8?(n.eye[0]=0,n.eye[1]=0,n.eye[2]=s):(0,E.h)(n.eye,o,f/m),n.tilt=0,De(n.eye),Ne(n,e);n.eye[1]=C/T;const S=d*d*v,R=h*s,I=u*R*n.eye[1],F=n.eye[1]*n.eye[1],O=1-F,P=Math.sqrt(O),D=_*F+S-2*I*P*x+O*w;return Math.abs(D)<1e-8?((0,E.h)(n.eye,o,f/m),n.tilt=0,De(n.eye),Ne(n,e)):(n.eye[0]=(O*(f*o[0]-g*o[0])-R*P*(o[0]*n.eye[1]*u+o[2]*d))/D,n.eye[2]=(O*(f*o[2]-g*o[2])-R*P*(o[2]*n.eye[1]*u-o[0]*d))/D,(0,E.h)(n.eye,n.eye,f),De(n.eye),Ne(n,e))},eyeTiltToLookAtTilt:function(e,t,r){const i=(0,a.kU)(e),n=(0,E.b)(t);return(0,a.YN)(r/(n/Math.sin(i)))+i},headingTiltToDirectionUp:Pe,lookAtTiltToEyeTilt:function(e,t,r){const i=(0,E.b)(t),n=Math.sqrt(r*r+i*i-2*r*i*Math.cos(Math.PI-e)),o=(0,a.YN)(r/(n/Math.sin(e)));return(0,a.KJ)(e-o)},toArea:function(e,t){const{renderCoordsHelper:r}=e,i=e.state.camera.clone(),n=new ye(r);i.near=2,n.update(i);const o=r.getAltitude(t),s=e.spatialReference,l=r.referenceEllipsoid.radius,c=i.eye,d=1+(0,E.k)(c,t)/(l+o),u=Math.sqrt(d*d-1),{minCurvature:h,maxCurvature:p,minSamples:m,maxSamples:f}=Le,g=function(e){const{renderCoordsHelper:t,state:{camera:r}}=e,{center:i,eye:n}=r,o=Math.abs(t.getAltitude(i)),s=Math.abs(Math.PI/2-function(e,t,r){e.worldUpAtPosition(t,Ce),(0,E.e)(Se,r,t);const i=(0,E.b)(Se);return 0===i?0:(0,a.XM)((0,E.f)(Se,Ce)/i)}(t,i,n));return(0,xe.b)(je,t.referenceEllipsoid.radius+o),(0,xe.d)(je,s,r.distance,r.fovY)}(e),v=(0,a.qE)((u-h)/(p-h),0,1),_=Math.round((0,a.Cc)(m,f,v)),x=i.aboveGround,w=n.planes[5],y=[],b=(0,re.O_)(A.uY,ze,(0,re.vt)()),M=(0,re.O_)(A.uY,Be,(0,re.vt)());(0,L.s)(ke,0,0,0,0);const T=e=>{};for(let e=0;e<4;e++){const t=1===e&&!x||3===e&&x?1-g:0,i=1===e&&x||3===e&&!x?g:1,s=n.lines[e],l=n.lines[3===e?0:e+1];for(let n=0;n<_;n++){const d=n/_,u=0===n?0:(0,a.Cc)(t,i,1===e?1-(1-d)**2:3===e?d**2:d),h=(0,E.l)(Ue,s.origin,l.origin,u),p=(0,Ee.nu)(s.direction,l.direction,u,Ge);r.intersectManifoldClosestSilhouette((0,G.LV)(h,p),o,Ve),se(Ve,c,Ve,w),y.push((0,A.o8)(Ve)),0!==y.length&&T((0,E.x)(y.at(-1),Ve));const m=((0,re.Tj)(b,Ve)?1:0)|((0,re.Tj)(M,Ve)?2:0);ke[m]=1}}y.length>2&&(0,E.x)(y[0],y.at(-1));const C=function(e,t,r){const i=2*(0,ve.FD)();return e.map(e=>{const n=[];let o=!1;for(const a of e)t.fromRenderCoords(a,Ve,r),Math.abs(a[0])<i&&Math.abs(a[1])<i?(n.push([null,Ve[1]]),n.push([null,Ve[1]]),o=!0):n.push([Ve[0],Ve[1]]);if(o)for(let e=0;e<n.length;e++){const t=n[e];if(null!=t[0])continue;const r=n[e+1],i=n.at(0===e?-1:e-1);t[0]=i[0],e++;const o=n.at(e===n.length-1?0:e+1);r[0]=o[0]}return n.push(n[0]),(0,J.$3)(n)||n.reverse(),n})}((0,L.b)(ke)>1?function(e,t){const r=[];for(const i of e)r.push(...He(i,t));return r}(He(y,b),M):[y],r,s);return new X.A({rings:C,spatialReference:s})},toExtent:function(e,t,r,i,n){let o,s,l,c;const d=t.latitude,u=(0,O.tO)(e.spatialReference).radius,h=t.longitude,p=function(e,t,r){const i=t/r,n=(0,a.kU)(e),o=Math.sin(i/2),s=Math.cos(n),l=2*(0,a.YN)(Math.sqrt(o*o/(s*s)));return(0,a.KJ)(l)}(d,r,u)/2;o=h-p,s=h+p;const m=(0,a.kU)(d),f=(1+Math.sin(m))/(1-Math.sin(m)),g=(f+1)*Math.tan(i/u/2),_=g*g;function x(e){const t=Math.PI/2;return(e=v.uC.normalize(e,-t))>t&&(e=Math.PI-e),e}if(l=1.5*Math.PI-2*Math.atan(.5*(g+Math.sqrt(4*f+_))),c=l+i/u,l=x(l),c=x(c),c<l){const e=c;c=l,l=e}if(l=Math.max((0,a.KJ)(l),-90),c=Math.min((0,a.KJ)(c),90),s=_e.Y_.monotonic(o,s),s-o>180){const e=(s-o-180)/2;o+=e,s-=e}const w=e.spatialReference&&e.spatialReference.isGeographic?e.spatialReference:R.A.WGS84;return n?(n.xmin=o,n.ymin=l,n.xmax=s,n.ymax=c,n.spatialReference=w):n=new Y.A(o,l,s,c,w),e.spatialReference&&e.spatialReference.isWebMercator&&(0,we.Gh)(n,!1,n),n}},Symbol.toStringTag,{value:"Module"}));const $e="ssao";(0,A.vt)();var Ze=r(49186);let qe=class extends P.A{constructor(e){super(e),this.view=null,this.consumes={required:[]},this.produces="composite-color",this.requireGeometryDepth=!1,this._dirty=!0}initialize(){this.addHandles([(0,l.wB)(()=>this.view.ready,e=>{e&&this.view.stage?.renderer.addRenderNode(this)},l.Vh)])}destroy(){this.view.stage?.renderer?.removeRenderNode(this)}precompile(){}render(){throw new Ze.A("RenderNode:render-function-not-implemented","render() is not implemented.")}get camera(){return this.view.state.camera.clone()}get sunLight(){return this.bindParameters.lighting.legacy}get gl(){return this.view.stage.renderView.renderingContext.gl}get techniques(){return this.view.stage.renderView.techniques}acquireOutputFramebuffer(){const e=this._frameBuffer?.getTexture()?.descriptor,t=this.view.stage.renderer.fboCache.acquire(e?.width??640,e?.height??480,this.produces);return t.fbo?.initializeAndBind(),t}bindRenderTarget(){return this._frameBuffer?.fbo?.initializeAndBind(),this._frameBuffer}requestRender(e){switch(e){case 2:this.view.state.fading=!0;case 1:this.view.stage?.renderView.requestRender(e);case 0:case void 0:this._dirty=!0}}resetWebGLState(){this.renderingContext.resetState(),this.renderingContext.bindFramebuffer(this._frameBuffer?.fbo)}get fboCache(){return this.view.stage.renderer.fboCache}get bindParameters(){return this.renderContext.bind}get renderingContext(){return this.view.stage.renderView.renderingContext}get renderContext(){return this.view.stage?.renderer.renderContext}updateAnimation(e){return!!this._dirty&&(this._dirty=!1,!0)}doRender(e){this._frameBuffer=e.find(({name:e})=>e===this.produces);try{return this.render(e)}finally{this._frameBuffer=null}}};(0,o.Cg)([(0,d.MZ)({constructOnly:!0})],qe.prototype,"view",void 0),(0,o.Cg)([(0,d.MZ)({constructOnly:!0})],qe.prototype,"consumes",void 0),(0,o.Cg)([(0,d.MZ)()],qe.prototype,"produces",void 0),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],qe.prototype,"techniques",null),qe=(0,o.Cg)([(0,h.$)("esri.views.3d.webgl.RenderNode")],qe);var Ye=r(13840),Xe=r(42958),Je=r(95774),Ke=r(90644);let Qe=class extends Xe.w{constructor(){super(...arguments),this.shader=new Ye.r(Je.S,()=>r.e(9384).then(r.bind(r,59384)))}initializePipeline(){return(0,Ke.Ey)({colorWrite:Ke.kn})}};Qe=(0,o.Cg)([(0,h.$)("esri.views.3d.webgl-engine.effects.ssao.SSAOBlurTechnique")],Qe);var et=r(65786);class tt extends et.Y{constructor(){super(...arguments),this.projScale=1}}class rt extends tt{constructor(){super(...arguments),this.intensity=1}}class it extends et.Y{}class nt extends it{constructor(){super(...arguments),this.blurSize=(0,H.vt)()}}var ot=r(15581);let at=class extends Xe.w{constructor(){super(...arguments),this.shader=new Ye.r(ot.S,()=>r.e(191).then(r.bind(r,90191)))}initializePipeline(){return(0,Ke.Ey)({colorWrite:Ke.kn})}};at=(0,o.Cg)([(0,h.$)("esri.views.3d.webgl-engine.effects.ssao.SSAOTechnique")],at);var st=r(63907),lt=r(76284),ct=r(67171);const dt=2;let ut=class extends qe{constructor(e){super(e),this.consumes={required:["normals"]},this.produces=$e,this.isEnabled=()=>!1,this._enableTime=(0,c.l5)(0),this._passParameters=new rt,this._drawParameters=new nt}initialize(){const e=Uint8Array.from(atob("eXKEvZaUc66cjIKElE1jlJ6MjJ6Ufkl+jn2fcXp5jBx7c6KEflSGiXuXeW6OWs+tfqZ2Yot2Y7Zzfo2BhniEj3xoiXuXj4eGZpqEaHKDWjSMe7palFlzc3BziYOGlFVzg6Zzg7CUY5JrjFF7eYJ4jIKEcyyEonSXe7qUfqZ7j3xofqZ2c4R5lFZ5Y0WUbppoe1l2cIh2ezyUho+BcHN2cG6DbpqJhqp2e1GcezhrdldzjFGUcyxjc3aRjDyEc1h7Sl17c6aMjH92pb6Mjpd4dnqBjMOEhqZleIOBYzB7gYx+fnqGjJuEkWlwnCx7fGl+c4hjfGyRe5qMlNOMfnqGhIWHc6OMi4GDc6aMfqZuc6aMzqJzlKZ+lJ6Me3qRfoFue0WUhoR5UraEa6qMkXiPjMOMlJOGe7JrUqKMjK6MeYRzdod+Sl17boiPc6qEeYBlcIh2c1WEe7GDiWCDa0WMjEmMdod+Y0WcdntzhmN8WjyMjKJjiXtzgYxYaGd+a89zlEV7e2GJfnd+lF1rcK5zc4p5cHuBhL6EcXp5eYB7fnh8iX6HjIKEeaxuiYOGc66RfG2Ja5hzjlGMjEmMe9OEgXuPfHyGhPeEdl6JY02McGuMfnqGhFiMa3WJfnx2l4hwcG1uhmN8c0WMc39og1GBbrCEjE2EZY+JcIh2cIuGhIWHe0mEhIVrc09+gY5+eYBlnCyMhGCDl3drfmmMgX15aGd+gYx+fnuRfnhzY1SMsluJfnd+hm98WtNrcIuGh4SEj0qPdkqOjFF7jNNjdnqBgaqUjMt7boeBhnZ4jDR7c5pze4GGjEFrhLqMjHyMc0mUhKZze4WEa117kWlwbpqJjHZ2eX2Bc09zeId+e0V7WlF7jHJ2l72BfId8l3eBgXyBe897jGl7c66cgW+Xc76EjKNbgaSEjGx4fId8jFFjgZB8cG6DhlFziZhrcIh2fH6HgUqBgXiPY8dahGFzjEmMhEFre2dxhoBzc5SGfleGe6alc7aUeYBlhKqUdlp+cH5za4OEczxza0Gcc4J2jHZ5iXuXjH2Jh5yRjH2JcFx+hImBjH+MpddCl3dreZeJjIt8ZW18bm1zjoSEeIOBlF9oh3N7hlqBY4+UeYFwhLJjeYFwaGd+gUqBYxiEYot2fqZ2ondzhL6EYyiEY02Ea0VjgZB8doaGjHxoc66cjEGEiXuXiXWMiZhreHx8frGMe75rY02Ec5pzfnhzlEp4a3VzjM+EhFFza3mUY7Zza1V5e2iMfGyRcziEhDyEkXZ2Y4OBnCx7g5t2eyBjgV6EhEFrcIh2dod+c4Z+nJ5zjm15jEmUeYxijJp7nL6clIpjhoR5WrZraGd+fnuRa6pzlIiMg6ZzfHx5foh+eX1ufnB5eX1ufnB5aJt7UqKMjIh+e3aBfm5lbYSBhGFze6J4c39oc0mUc4Z+e0V7fKFVe0WEdoaGY02Ec4Z+Y02EZYWBfH6HgU1+gY5+hIWUgW+XjJ57ebWRhFVScHuBfJ6PhBx7WqJzlM+Ujpd4gHZziX6HjHmEgZN+lJt5boiPe2GJgX+GjIGJgHZzeaxufnB5hF2JtdN7jJ57hp57hK6ElFVzg6ZzbmiEbndzhIWHe3uJfoFue3qRhJd2j3xoc65zlE1jc3p8lE1jhniEgXJ7e657vZaUc3qBh52BhIF4aHKDa9drgY5+c52GWqZzbpqJe8tjnM+UhIeMfo2BfGl+hG1zSmmMjKJjZVaGgX15c1lze0mEp4OHa3mUhIWHhDyclJ6MeYOJkXiPc0VzhFiMlKaEboSJa5Jze41re3qRhn+HZYWBe0mEc4p5fnORbox5lEp4hGFjhGGEjJuEc1WEhLZjeHeGa7KlfHx2hLaMeX1ugY5+hIWHhKGPjMN7c1WEho1zhoBzZYx7fnhzlJt5exyUhFFziXtzfmmMa6qMYyiEiXxweV12kZSMeWqXSl17fnhzxmmMrVGEe1mcc4p5eHeGjK6MgY5+doaGa6pzlGV7g1qBh4KHkXiPeW6OaKqafqZ2eXZ5e1V7jGd7boSJc3BzhJd2e0mcYot2h1RoY8dahK6EQmWEWjx7e1l2lL6UgXyBdnR4eU9zc0VreX1umqaBhld7fo2Bc6KEc5Z+hDyEcIeBWtNrfHyGe5qMhMuMe5qMhEGEbVVupcNzg3aHhIF4boeBe0mEdlptc39ofFl5Y8uUlJOGiYt2UmGEcyxjjGx4jFF7a657ZYWBnElzhp57iXtrgZN+tfOEhIOBjE2HgU1+e8tjjKNbiWCDhE15gUqBgYN7fnqGc66ce9d7iYSBj0qPcG6DnGGcT3eGa6qMZY+JlIiMl4hwc3aRdnqBlGV7eHJ2hLZjfnuRhDyEeX6MSk17g6Z+c6aUjHmEhIF4gXyBc76EZW18fGl+fkl+jCxrhoVwhDyUhIqGlL2DlI6EhJd2tdN7eYORhEGMa2Faa6pzc3Bzc4R5lIRznM+UY9eMhDycc5Z+c4p5c4iGY117pb6MgXuPrbJafnx2eYOJeXZ5e657hDyEcziElKZjfoB5eHeGj4WRhGGEe6KGeX1utTStc76EhFGJnCyMa5hzfH6HnNeceYB7hmN8gYuMhIVrczSMgYF8h3N7c5pza5hzjJqEYIRdgYuMlL2DeYRzhGGEeX1uhLaEc4iGeZ1zdl6JhrVteX6Me2iMfm5lWqJzSpqEa6pzdnmchHx2c6OMhNdrhoR5g3aHczxzeW52gV6Ejm15frGMc0Vzc4Z+l3drfniJe+9rWq5rlF1rhGGEhoVwe9OEfoh+e7pac09+c3qBY0lrhDycdnp2lJ6MiYOGhGCDc3aRlL2DlJt5doaGdnp2gYF8gWeOjF2Uc4R5c5Z+jEmMe7KEc4mEeYJ4dmyBe0mcgXiPbqJ7eYB7fmGGiYSJjICGlF1reZ2PnElzbpqJfH6Hc39oe4WEc5eJhK6EhqyJc3qBgZB8c09+hEmEaHKDhFGJc5SGiXWMUpaEa89zc6OMnCyMiXtrho+Be5qMc7KEjJ57dmN+hKGPjICGbmiEe7prdod+hGCDdnmchBx7eX6MkXZ2hGGEa657hm98jFFjY5JreYOJgY2EjHZ2a295Y3FajJ6Mc1J+YzB7e4WBjF2Uc4R5eV12gYxzg1qBeId+c9OUc5pzjFFjgY5+hFiMlIaPhoR5lIpjjIKBlNdSe7KEeX2BfrGMhIqGc65zjE2UhK6EklZ+QmWEeziMWqZza3VzdnR4foh+gYF8n3iJiZhrnKp7gYF8eId+lJ6Me1lrcIuGjKJjhmN8c66MjFF7a6prjJ6UnJ5zezyUfruRWlF7nI5zfHyGe657h4SEe8tjhBx7jFFjc09+c39ojICMeZeJeXt+YzRzjHZ2c0WEcIeBeXZ5onSXkVR+gYJ+eYFwdldzgYF7eX2BjJ6UiXuXlE1jh4SEe1mchLJjc4Z+hqZ7eXZ5bm1zlL6Ue5p7iWeGhKqUY5pzjKJjcIeBe8t7gXyBYIRdlEp4a3mGnK6EfmmMZpqEfFl5gYxzjKZuhGFjhoKGhHx2fnx2eXuMe3aBiWeGvbKMe6KGa5hzYzB7gZOBlGV7hmN8hqZlYot2Y117a6pzc6KEfId8foB5rctrfneJfJ6PcHN2hFiMc5pzjH92c0VzgY2EcElzdmCBlFVzg1GBc65zY4OBboeBcHiBeYJ4ewxzfHx5lIRzlEmEnLKEbk1zfJ6PhmN8eYBljBiEnMOEiXxwezyUcIeBe76EdsKEeX2BdnR4jGWUrXWMjGd7fkl+j4WRlEGMa5Jzho+BhDyEfnqMeXt+g3aHlE1jczClhNN7ZW18eHx8hGFjZW18iXWMjKJjhH57gYuMcIuGWjyMe4ZtjJuExmmMj4WRdntzi4GDhFFzYIRdnGGcjJp7Y0F7e4WEkbCGiX57fnSHa657a6prhBCMe3Z+SmmMjH92eHJ2hK6EY1FzexhrvbKMnI5za4OEfnd+eXuMhImBe897hLaMjN+EfG+BeIOBhF1+eZeJi4GDkXZ2eXKEgZ6Ejpd4c2GHa1V5e5KUfqZuhCx7jKp7lLZrg11+hHx2hFWUoot2nI5zgbh5mo9zvZaUe3qRbqKMfqZ2kbCGhFiM"),e=>e.charCodeAt(0)),t=new ct.R(32);t.wrapMode=33071,t.pixelFormat=6407,t.wrapMode=10497,t.hasMipmap=!0,this._passParameters.noiseTexture=new lt.g(this.renderingContext,t,e),this.techniques.precompile(at),this.techniques.precompile(Qe),this.addHandles((0,l.wB)(()=>this.isEnabled(),()=>this._enableTime=(0,c.l5)(0)))}destroy(){this._passParameters.noiseTexture=(0,s.WD)(this._passParameters.noiseTexture)}render(e){const t=e.find(({name:e})=>"normals"===e),r=t?.getTexture(),i=t?.getTexture(st.nI);if(!r||!i)return;const n=this.techniques.get(at),o=this.techniques.get(Qe);if(!n.compiled||!o.compiled)return this._enableTime=(0,c.l5)(performance.now()),void this.requestRender(1);0===this._enableTime&&(this._enableTime=(0,c.l5)(performance.now()));const s=this.renderingContext,l=this.view.qualitySettings.fadeDuration,d=this.bindParameters,u=d.camera,h=u.relativeElevation,m=(0,a.qE)((5e5-h)/2e5,0,1),f=l>0?Math.min(l,performance.now()-this._enableTime)/l:1,g=f*m;this._passParameters.normalTexture=r,this._passParameters.depthTexture=i,this._passParameters.projScale=1/u.computeScreenPixelSizeAtDist(1),this._passParameters.intensity=4*ht/(0,ot.g)(u)**6*g;const v=u.fullViewport[2],_=u.fullViewport[3],x=this.fboCache.acquire(v,_,"ssao input",2);s.bindFramebuffer(x.fbo),s.setViewport(0,0,v,_),s.bindTechnique(n,d,this._passParameters,this._drawParameters),s.screen.draw();const w=Math.round(v/dt),y=Math.round(_/dt),b=this.fboCache.acquire(w,y,"ssao blur",0);s.bindFramebuffer(b.fbo),this._drawParameters.colorTexture=x.getTexture(),(0,p.hZ)(this._drawParameters.blurSize,0,dt/_),s.bindTechnique(o,d,this._passParameters,this._drawParameters),s.setViewport(0,0,w,y),s.screen.draw(),x.release();const M=this.fboCache.acquire(w,y,$e,0);return s.bindFramebuffer(M.fbo),s.setViewport(0,0,v,_),s.setClearColor(1,1,1,0),s.clear(16384),this._drawParameters.colorTexture=b.getTexture(),(0,p.hZ)(this._drawParameters.blurSize,dt/v,0),s.bindTechnique(o,d,this._passParameters,this._drawParameters),s.setViewport(0,0,w,y),s.screen.draw(),s.setViewport4fv(u.fullViewport),b.release(),f<1&&this.requestRender(2),M}};(0,o.Cg)([(0,d.MZ)()],ut.prototype,"consumes",void 0),(0,o.Cg)([(0,d.MZ)()],ut.prototype,"produces",void 0),(0,o.Cg)([(0,d.MZ)({constructOnly:!0})],ut.prototype,"isEnabled",void 0),ut=(0,o.Cg)([(0,h.$)("esri.views.3d.webgl-engine.effects.ssao.SSAO")],ut);const ht=.5;function pt(e,t){t.receiveAmbientOcclusion?(e.uniforms.add(new n.x("ssaoTex",e=>e.ssao?.getTexture())),e.constants.add("blurSizePixelsInverse","float",1/dt),e.code.add(i.H`float evaluateAmbientOcclusionInverse() {
12
+ vec2 ssaoTextureSizeInverse = 1.0 / vec2(textureSize(ssaoTex, 0));
13
+ return texture(ssaoTex, gl_FragCoord.xy * blurSizePixelsInverse * ssaoTextureSizeInverse).r;
14
+ }
15
+ float evaluateAmbientOcclusion() {
16
+ return 1.0 - evaluateAmbientOcclusionInverse();
17
+ }`)):e.code.add(i.H`float evaluateAmbientOcclusionInverse() { return 1.0; }
18
+ float evaluateAmbientOcclusion() { return 0.0; }`)}},15581:(e,t,r)=>{r.d(t,{S:()=>x,b:()=>g,g:()=>v});var i=r(37585),n=r(48163),o=r(82048),a=r(52540),s=r(34845),l=r(77108),c=r(47286),d=r(33094),u=r(20304),h=r(31821),p=r(63761),m=r(14113);const f=16;function g(){const e=new m.N5,t=e.fragment;return e.include(o.c),e.include(s.Ir),t.include(a.E),t.uniforms.add(new d.U("radius",e=>v(e.camera))).code.add(h.H`vec3 sphere[16] = vec3[16](
12
19
  vec3(0.186937, 0.0, 0.0),
13
20
  vec3(0.700542, 0.0, 0.0),
14
21
  vec3(-0.864858, -0.481795, -0.111713),
@@ -190,7 +197,7 @@ return dpDummy * hiD + loD;
190
197
  // multiply or tint (or something invalid)
191
198
  return allMixed;
192
199
  }
193
- `)}},28491:(e,t,r)=>{r.d(t,{D:()=>V,b:()=>U});var i=r(32680),n=r(49255),o=r(76591),a=r(76597),s=r(24321),l=r(60864),c=r(43519),d=r(96336),u=r(71955),h=r(53466),p=r(92700),m=r(72824),f=r(35640),g=r(40261),v=r(77695),_=r(65836),x=r(89390),w=r(98619),y=r(62602),b=r(22393),M=r(59469),T=r(32482),C=r(96598),S=r(51406),E=r(42398),A=r(58614),R=r(27950),I=r(25178),F=r(33079),O=r(71988),P=r(20304),D=r(31821),N=r(63761),H=r(10906),L=r(43616),z=r(60517),B=r(14113),G=r(49788);function U(e){const t=new B.N5,{attributes:r,vertex:U,fragment:V,varyings:j}=t,{output:W,normalType:k,offsetBackfaces:$,spherical:Z,snowCover:q,pbrMode:Y,textureAlphaPremultiplied:X,instancedDoublePrecision:J,hasVertexColors:K,hasVertexTangents:Q,hasColorTexture:ee,hasNormalTexture:te,hasNormalTextureTransform:re,hasColorTextureTransform:ie}=e;if((0,I.NB)(U,e),r.add("position","vec3"),j.add("vpos","vec3",{invariant:!0}),t.include(E.A,e),t.include(l.B,e),t.include(f.Ge,e),t.include(S.q2,e),!(0,n.RN)(W))return t.include(g.E,e),t;t.include(S.Sx,e),t.include(S.MU,e),t.include(S.O1,e),t.include(S.QM,e),(0,I.yu)(U,e),t.include(d.Y,e),t.include(a.d);const ne=0===k||1===k;return ne&&$&&t.include(i.M),t.include(v.W,e),t.include(m.Mh,e),t.include(s.v,e),j.add("vPositionLocal","vec3"),t.include(h.U,e),t.include(u.K,e),t.include(p.c,e),U.uniforms.add(new O.E("externalColor",e=>e.externalColor,{supportsNaN:!0})),j.add("vcolorExt","vec4"),t.include(C.Z,e),U.include(c.WD),U.include(c.oF),t.include(J?T.G:T.Bz,e),U.main.add(D.H`
200
+ `)}},28491:(e,t,r)=>{r.d(t,{D:()=>V,b:()=>U});var i=r(32680),n=r(49255),o=r(76591),a=r(76597),s=r(24321),l=r(60864),c=r(43519),d=r(96336),u=r(71955),h=r(53466),p=r(92700),m=r(72824),f=r(35640),g=r(40261),v=r(77695),_=r(14527),x=r(89390),w=r(98619),y=r(62602),b=r(22393),M=r(59469),T=r(32482),C=r(96598),S=r(51406),E=r(42398),A=r(58614),R=r(27950),I=r(25178),F=r(33079),O=r(71988),P=r(20304),D=r(31821),N=r(63761),H=r(10906),L=r(43616),z=r(60517),B=r(14113),G=r(49788);function U(e){const t=new B.N5,{attributes:r,vertex:U,fragment:V,varyings:j}=t,{output:W,normalType:k,offsetBackfaces:$,spherical:Z,snowCover:q,pbrMode:Y,textureAlphaPremultiplied:X,instancedDoublePrecision:J,hasVertexColors:K,hasVertexTangents:Q,hasColorTexture:ee,hasNormalTexture:te,hasNormalTextureTransform:re,hasColorTextureTransform:ie}=e;if((0,I.NB)(U,e),r.add("position","vec3"),j.add("vpos","vec3",{invariant:!0}),t.include(E.A,e),t.include(l.B,e),t.include(f.Ge,e),t.include(S.q2,e),!(0,n.RN)(W))return t.include(g.E,e),t;t.include(S.Sx,e),t.include(S.MU,e),t.include(S.O1,e),t.include(S.QM,e),(0,I.yu)(U,e),t.include(d.Y,e),t.include(a.d);const ne=0===k||1===k;return ne&&$&&t.include(i.M),t.include(v.W,e),t.include(m.Mh,e),t.include(s.v,e),j.add("vPositionLocal","vec3"),t.include(h.U,e),t.include(u.K,e),t.include(p.c,e),U.uniforms.add(new O.E("externalColor",e=>e.externalColor,{supportsNaN:!0})),j.add("vcolorExt","vec4"),t.include(C.Z,e),U.include(c.WD),U.include(c.oF),t.include(J?T.G:T.Bz,e),U.main.add(D.H`
194
201
  forwardNormalizedVertexColor();
195
202
 
196
203
  MaskedColor maskedColor =
@@ -304,7 +311,7 @@ posClip.z += 0.0000003 * posClip.w;
304
311
  return posClip;
305
312
  }`)}},32976:(e,t,r)=>{r.d(t,{o:()=>n});var i=r(74333);class n extends i.n{constructor(e,t){super(e,"bool",0,(r,i)=>r.setUniform1b(e,t(i)))}}},33094:(e,t,r)=>{r.d(t,{U:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"float",0,(i,n)=>i.setUniform1f(e,t(n),r))}}},33120:(e,t,r)=>{r.d(t,{i$:()=>a,xJ:()=>o}),r(46686),r(33752);var i=r(77108),n=r(31821);function o(e){e.vertex.uniforms.add(new i.E("nearFar",e=>e.camera.nearFar))}function a(e){e.vertex.code.add(n.H`float calculateLinearDepth(vec2 nearFar,float z) {
306
313
  return (-z - nearFar[0]) / (nearFar[1] - nearFar[0]);
307
- }`)}},33524:(e,t,r)=>{r.d(t,{K_:()=>h,Yf:()=>s,m6:()=>p,mE:()=>u,xt:()=>c,z5:()=>l});var i=r(49255),n=r(63907),o=r(90644);const a=(0,o.p3)(1,0,1,771);function s(e,t=!1){switch(e){case 0:return t?o.RC:o.T8;case 1:return a;case 2:case 3:return null}}function l(e){if(e.draped)return null;switch(e.oitPass){case 0:case 2:return e.writeDepth?o.Uy:null;case 1:case 3:return null}}const c=5e5,d={factor:-1,units:-2};function u({oitPass:e,enableOffset:t}){return t&&1===e?d:null}function h(e,t=513){return 0===e||2===e?t:515}function p(e,t){const r=(0,i.LG)(t);return 1===e?r?{buffers:[n.r6,n.yI,n.Fq]}:{buffers:[n.r6,n.yI]}:r?{buffers:[n.r6,n.yI]}:null}},33752:(e,t,r)=>{r.d(t,{EM:()=>l,dO:()=>s});var i=r(29242),n=r(9093),o=r(51850),a=(r(26425),r(40710),r(33079),r(31821),r(98353),r(35644),r(40095),r(65786));class s extends a.Y{constructor(){super(...arguments),this.transformWorldFromViewTH=(0,o.vt)(),this.transformWorldFromViewTL=(0,o.vt)(),this.transformViewFromCameraRelativeRS=(0,i.vt)(),this.transformProjFromView=(0,n.vt)()}}class l extends a.Y{constructor(){super(...arguments),this.transformWorldFromModelRS=(0,i.vt)(),this.transformWorldFromModelTH=(0,o.vt)(),this.transformWorldFromModelTL=(0,o.vt)()}}},34845:(e,t,r)=>{r.d(t,{Ir:()=>d});var i=r(37585),n=r(48163),o=r(87317),a=r(91829),s=r(77108),l=r(14314),c=r(31821);function d(e){e.fragment.uniforms.add(new l.I("projInfo",e=>function(e){const t=e.projectionMatrix;return 0===t[11]?(0,o.s)(u,2/(e.fullWidth*t[0]),2/(e.fullHeight*t[5]),(1+t[12])/t[0],(1+t[13])/t[5]):(0,o.s)(u,-2/(e.fullWidth*t[0]),-2/(e.fullHeight*t[5]),(1-t[8])/t[0],(1-t[9])/t[5])}(e.camera))),e.fragment.uniforms.add(new s.E("zScale",e=>0===e.camera.projectionMatrix[11]?(0,i.hZ)(h,0,1):(0,i.hZ)(h,1,0))),e.fragment.code.add(c.H`vec3 reconstructPosition(vec2 fragCoord, float depth) {
314
+ }`)}},33524:(e,t,r)=>{r.d(t,{K_:()=>h,Yf:()=>s,m6:()=>p,mE:()=>u,xt:()=>d,z5:()=>l});var i=r(49255),n=r(63907),o=r(90644);const a=(0,o.p3)(1,0,1,771);function s(e,t=!1){switch(e){case 0:return t?o.RC:o.T8;case 1:return a;case 2:case 3:return null}}function l(e){if(e.draped)return null;switch(e.oitPass){case 0:case 2:return e.writeDepth?o.Uy:null;case 1:case 3:return null}}const c={factor:-1,units:-2},d=5e5;function u({oitPass:e,enableOffset:t}){return t&&1===e?c:null}function h(e,t=513){return 0===e||2===e?t:515}function p(e,t){const r=(0,i.LG)(t);return 1===e?r?{buffers:[n.r6,n.yI,n.Fq]}:{buffers:[n.r6,n.yI]}:r?{buffers:[n.r6,n.yI]}:null}},33752:(e,t,r)=>{r.d(t,{EM:()=>l,dO:()=>s});var i=r(29242),n=r(9093),o=r(51850),a=(r(26425),r(40710),r(33079),r(31821),r(98353),r(35644),r(40095),r(65786));class s extends a.Y{constructor(){super(...arguments),this.transformWorldFromViewTH=(0,o.vt)(),this.transformWorldFromViewTL=(0,o.vt)(),this.transformViewFromCameraRelativeRS=(0,i.vt)(),this.transformProjFromView=(0,n.vt)()}}class l extends a.Y{constructor(){super(...arguments),this.transformWorldFromModelRS=(0,i.vt)(),this.transformWorldFromModelTH=(0,o.vt)(),this.transformWorldFromModelTL=(0,o.vt)()}}},34845:(e,t,r)=>{r.d(t,{Ir:()=>d});var i=r(37585),n=r(48163),o=r(87317),a=r(91829),s=r(77108),l=r(14314),c=r(31821);function d(e){e.fragment.uniforms.add(new l.I("projInfo",e=>function(e){const t=e.projectionMatrix;return 0===t[11]?(0,o.s)(u,2/(e.fullWidth*t[0]),2/(e.fullHeight*t[5]),(1+t[12])/t[0],(1+t[13])/t[5]):(0,o.s)(u,-2/(e.fullWidth*t[0]),-2/(e.fullHeight*t[5]),(1-t[8])/t[0],(1-t[9])/t[5])}(e.camera))),e.fragment.uniforms.add(new s.E("zScale",e=>0===e.camera.projectionMatrix[11]?(0,i.hZ)(h,0,1):(0,i.hZ)(h,1,0))),e.fragment.code.add(c.H`vec3 reconstructPosition(vec2 fragCoord, float depth) {
308
315
  return vec3((fragCoord * projInfo.xy + projInfo.zw) * (zScale.x * depth + zScale.y), depth);
309
316
  }`)}const u=(0,a.vt)(),h=(0,n.vt)()},35256:(e,t,r)=>{r.d(t,{E:()=>a});var i=r(31635),n=r(51976);class o extends n.K{constructor(){super(...arguments),this.instancedDoublePrecision=!1,this.hasModelTransformation=!1}}class a extends o{constructor(){super(...arguments),this.output=0,this.oitPass=0,this.hasSlicePlane=!1,this.hasHighlightMixTexture=!1,this.bindType=1,this.instanced=!1,this.writeDepth=!0}}(0,i.Cg)([(0,n.W)({count:11})],a.prototype,"output",void 0),(0,i.Cg)([(0,n.W)({count:3})],a.prototype,"oitPass",void 0),(0,i.Cg)([(0,n.W)()],a.prototype,"hasSlicePlane",void 0),(0,i.Cg)([(0,n.W)()],a.prototype,"hasHighlightMixTexture",void 0)},35640:(e,t,r)=>{r.d(t,{Ge:()=>c,VQ:()=>u});var i=r(87317),n=r(91829),o=r(52587),a=r(25178),s=r(71988),l=r(31821);function c(e,t){const r=e.vertex;t.hasVerticalOffset?(u(r),t.hasScreenSizePerspective&&(e.include(o.Y6),(0,o.OH)(r),(0,a.yu)(e.vertex,t)),r.code.add(l.H`
310
317
  vec3 calculateVerticalOffset(vec3 worldPos, vec3 localOrigin) {
@@ -486,7 +493,7 @@ float sceneDepth = texelFetch(depthTexture, ivec2(gl_FragCoord.xy), 0).x;
486
493
  return gl_FragCoord.z > sceneDepth + 5e-7;
487
494
  }`),r.code.add(i.H`void calculateOcclusionAndOutputHighlight() {
488
495
  outputHighlight(isHighlightOccluded());
489
- }`)):r.code.add(i.H`void calculateOcclusionAndOutputHighlight() {}`)}},43519:(e,t,r)=>{r.d(t,{ML:()=>a,WD:()=>n,Y1:()=>o,oF:()=>s});var i=r(31821);function n(e){e.code.add(i.H`struct MaskedColor {
496
+ }`)):r.code.add(i.H`void calculateOcclusionAndOutputHighlight() {}`)}},42958:(e,t,r)=>{r.d(t,{w:()=>_,L:()=>x});var i=r(31635),n=r(69622),o=r(53966),a=r(97768),s=(r(44208),r(87811),r(49186),r(64108)),l=r(49255),c=r(63907),d=r(85079),u=r(74038);const h=[new u._("position",3,c.pe.FLOAT,0,12)],p=[new u._("position",2,c.pe.FLOAT,0,8)],m=(0,d.Xk)(p);(0,d.Xk)(h),new u._("position",2,c.pe.FLOAT,0,12),new u._("uv0",2,c.pe.HALF_FLOAT,8,12),new u._("position",2,c.pe.FLOAT,0,16),new u._("uv0",2,c.pe.FLOAT,8,16);var f=r(94656);class g{constructor(e,t,r){this._context=e,this.locations=r,this._textures=new Map,this.source=(0,f.en)()?t:null,t.attributeNames.forEach(e=>{r.has(e)||console.error(`Missing VertexAttributeLocation for ${e} used in shader`)}),this._glProgram=e.programCache.acquire(t.generate("vertex",!0),t.generate("fragment",!0),r),this._glProgram.stop=()=>{throw new Error("Wrapped _glProgram used directly")},this.bind=t.generateBind(this),this.bindPass=t.generateBindPass(this),this.bindDraw=t.generateBindDraw(this)}dispose(){this._glProgram.dispose()}get glName(){return this._glProgram.glName}get hasTransformFeedbackVaryings(){return this._glProgram.hasTransformFeedbackVaryings}get compiled(){return this._glProgram.compiled}setUniform1b(e,t){this._glProgram.setUniform1i(e,t?1:0)}setUniform1i(e,t){this._glProgram.setUniform1i(e,t)}setUniform1f(e,t,r){this._glProgram.setUniform1f(e,t,r)}setUniform2fv(e,t,r){this._glProgram.setUniform2fv(e,t,r)}setUniform3fv(e,t,r){this._glProgram.setUniform3fv(e,t,r)}setUniform4fv(e,t,r){this._glProgram.setUniform4fv(e,t,r)}setUniformMatrix3fv(e,t,r){this._glProgram.setUniformMatrix3fv(e,t,!1,r)}setUniformMatrix4fv(e,t,r){this._glProgram.setUniformMatrix4fv(e,t,!1,r)}setUniformMatrices4fv(e,t,r){this._glProgram.setUniformMatrices4fv(e,t,!1,r)}setUniform1fv(e,t,r){this._glProgram.setUniform1fv(e,t,r)}setUniform1iv(e,t){this._glProgram.setUniform1iv(e,t)}setUniform2iv(e,t){this._glProgram.setUniform2iv(e,t)}setUniform3iv(e,t){this._glProgram.setUniform3iv(e,t)}setUniform4iv(e,t){this._glProgram.setUniform4iv(e,t)}assertCompatibleVertexAttributeLocations(e,t){let r=e.locations;if(t){const e=new Map(r);t.forEach((t,i)=>e.set(i,r.size+t)),r=e}r.size!==this.locations.size&&console.error(`VertexAttributeLocations are incompatible: ${r}, ${this.locations}`),this.locations.forEach((e,t)=>{r.get(t)!==e&&console.error(`VertexAttributeLocations are incompatible: Program has ${t} at position ${e}, VAO has it at position ${r.get(t)}.`)})}stop(){this._textures.clear()}bindTexture(e,t){if(!t?.glName){const r=`Texture sampler ${e} in ${this._context.debugBoundTechnique} has no given Texture in ${(new Error).stack}`;(0,f.en)()&&console.error(r),t=this._context.emptyTexture}const r=this._ensureTextureUnit(e,t);this._context.useProgram(this),this.setUniform1i(e,r.unit),this._context.bindTexture(t,r.unit)}_ensureTextureUnit(e,t){let r=this._textures.get(e);return null==r?(r={texture:t,unit:this._textures.size},this._textures.set(e,r)):r.texture=t,r}}var v=r(90644);let _=class extends n.A{constructor(e,t,r=m){super({}),this._context=e,this._configuration=t,this.locations=r,this.primitiveType=c.WR.TRIANGLES,this.key=t.key,this._pipeline=this.initializePipeline(t),this.reload=async i=>{i&&await this.shader.reload(),this.key.equals(t.key)||o.A.getLogger("esri.views.3d.webgl.ShaderTechnique").warn("Configuration was changed after construction, cannot reload shader.",this.shader),(0,a.WD)(this._program),this._program=new g(e.rctx,this.shader.get().build(t),r),this._pipeline=this.initializePipeline(t)}}initialize(){this._program=new g(this._context.rctx,this.shader.get().build(this._configuration),this.locations)}destroy(){this._program=(0,a.WD)(this._program),this._pipeline=null}get program(){return this._program}get compiled(){return this.program.compiled}ensureAttributeLocations(e){this.program.assertCompatibleVertexAttributeLocations(e)}getPipeline(e,t){return this._pipeline}initializePipeline(e){return(0,v.Ey)({blending:v.RC,colorWrite:v.kn})}};function x(e,t){return(0,l.Dz)(e)?{buffers:[c.$0]}:t??null}_=(0,i.Cg)([(0,s.$)("esri.views.3d.webgl-engine.core.shaderTechnique.ShaderTechnique")],_)},43519:(e,t,r)=>{r.d(t,{ML:()=>a,WD:()=>n,Y1:()=>o,oF:()=>s});var i=r(31821);function n(e){e.code.add(i.H`struct MaskedColor {
490
497
  vec4 color;
491
498
  bvec4 mask;
492
499
  };`)}function o(e){e.include(n),e.code.add(i.H`
@@ -509,7 +516,7 @@ return MaskedColor(masked1 * masked2, bvec4(ivec4(color1.mask) & ivec4(color2.ma
509
516
  return MaskedColor(color, isnan(color));
510
517
  }`)}},43616:(e,t,r)=>{r.d(t,{MB:()=>l,Um:()=>c,kE:()=>a});var i=r(4576),n=r(34727),o=r(77194);function a(e,t,r,i,o,a){let s=r.screenLength*e.pixelRatio;null!=o&&(d.update(i,t,o,a),s=d.apply(s));const l=s*Math.tan(.5*e.fovY)/(.5*e.fullHeight);return(0,n.qE)(l*t,r.minWorldLength,r.maxWorldLength)}const s=(0,i.VO)();function l(e,t){let r=!1;for(const i in t){const n=t[i];void 0!==n&&(Array.isArray(n)?Array.isArray(e[i])&&s(n,e[i])||(e[i]=n.slice(),r=!0):e[i]!==n&&(r=!0,e[i]=n))}return r}const c={multiply:1,ignore:2,replace:3,tint:4},d=new o.PS},46686:(e,t,r)=>{r.d(t,{o:()=>n});var i=r(31821);function n(e,t){t&&e.varyings.add("linearDepth","float",{invariant:!0}),e.vertex.code.add(i.H`
511
518
  void forwardLinearDepth(float _linearDepth) { ${(0,i.If)(t,"linearDepth = _linearDepth;")} }
512
- `)}},47286:(e,t,r)=>{r.d(t,{G:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"vec2",1,(i,n,o)=>i.setUniform2fv(e,t(n,o),r))}}},48833:(e,t,r)=>{r.d(t,{g:()=>B}),r(44208);var i=r(49186),n=r(65529),o=r(97768),a=r(74887),s=r(34275),l=r(24326),c=r(84952),d=r(38969),u=r(31217),h=r(95117),p=r(2741);let m;var f=r(63907),g=r(76284),v=r(42293);let _=null,x=null;async function w(){return null==x&&(m??=(async()=>{const e=await r.e(9321).then(r.bind(r,49321)),t=await e.default({locateFile:e=>(0,p.s)(`esri/libs/basisu/${e}`)});return t.initializeBasis(),t})(),x=m,_=await x),x}function y(e,t){if(null==_)return e.byteLength;const r=new _.BasisFile(new Uint8Array(e)),i=T(r)?M(r.getNumLevels(0),r.getHasAlpha(),r.getImageWidth(0,0),r.getImageHeight(0,0),t):0;return r.close(),r.delete(),i}function b(e,t){if(null==_)return e.byteLength;const r=new _.KTX2File(new Uint8Array(e)),i=C(r)?M(r.getLevels(),r.getHasAlpha(),r.getWidth(),r.getHeight(),t):0;return r.close(),r.delete(),i}function M(e,t,r,i,n){const o=(0,v.MW)(t?f.CQ.COMPRESSED_RGBA8_ETC2_EAC:f.CQ.COMPRESSED_RGB8_ETC2),a=n&&e>1?(4**e-1)/(3*4**(e-1)):1;return Math.ceil(r*i*o*a)}function T(e){return e.getNumImages()>=1&&!e.isUASTC()}function C(e){return e.getFaces()>=1&&e.isETC1S()}function S(e,t,r,i,n,o,a,s){const{compressedTextureETC:l,compressedTextureS3TC:c}=e.capabilities,[d,u]=l?i?[1,f.CQ.COMPRESSED_RGBA8_ETC2_EAC]:[0,f.CQ.COMPRESSED_RGB8_ETC2]:c?i?[3,f.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT]:[2,f.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT]:[13,6408],h=t.hasMipmap?r:Math.min(1,r),p=[];for(let e=0;e<h;e++)p.push(new Uint8Array(a(e,d))),s(e,d,p[e]);return t.internalFormat=u,t.hasMipmap=p.length>1,t.samplingMode=t.hasMipmap?9987:9729,t.width=n,t.height=o,new g.g(e,t,{type:"compressed",levels:p})}var E=r(53966);const A=()=>E.A.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil");function R(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}const I=R("DXT1"),F=R("DXT3"),O=R("DXT5");function P(e,t){const r=new Int32Array(e.buffer,e.byteOffset,31);if(542327876!==r[0])return A().error("Invalid magic number in DDS header"),null;if(!(4&r[20]))return A().error("Unsupported format, must contain a FourCC code"),null;const i=r[21];let n,o;switch(i){case I:n=8,o=f.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case F:n=16,o=f.CQ.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case O:n=16,o=f.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return A().error("Unsupported FourCC code:",function(e){return String.fromCharCode(255&e,e>>8&255,e>>16&255,e>>24&255)}(i)),null}let a=1,s=r[4],l=r[3];(3&s||3&l)&&(A().warn("Rounding up compressed texture size to nearest multiple of 4."),s=s+3&-4,l=l+3&-4);const c=s,d=l;let u,h;131072&r[2]&&!1!==t&&(a=Math.max(1,r[7]));let p=e.byteOffset+r[1]+4;const m=[];for(let t=0;t<a;++t)h=(s+3>>2)*(l+3>>2)*n,u=new Uint8Array(e.buffer,p,h),m.push(u),p+=h,s=Math.max(1,s>>1),l=Math.max(1,l>>1);return{textureData:{type:"compressed",levels:m},internalFormat:o,width:c,height:d}}function D(e,t){return t=16*Math.floor(t/16),Math.min(16*Math.round(e/16),t)}function N(e,t){const[r,i]=function({width:e,height:t},{maxPreferredTexturePixels:r,maxTextureSize:i}){const n=Math.max(e,t),o=e*t;if(n<=i&&o<=r)return[e,t];const a=Math.min(Math.sqrt(r/o),i/n);return[D(Math.round(e*a),i),D(Math.round(t*a),i)]}(e,t);return e.width===r&&e.height===i?e:H(e,r,i)}function H(e,t,r){if(e instanceof ImageData)return H(function(e){const t=document.createElement("canvas");t.width=e.width,t.height=e.height;const r=t.getContext("2d");if(null==r)throw new i.A("texture:context-failed","Failed to create 2d context from HTMLCanvasElement");return r.putImageData(e,0,0),t}(e),t,r);const n=document.createElement("canvas");return n.width=t,n.height=r,n.getContext("2d").drawImage(e,0,0,n.width,n.height),n}var L=r(620),z=r(67171);class B{constructor(e,t){this._data=e,this.id=(0,l.c)(),this.events=new n.bk,this._parameters={...U,...t},this._startPreload(e)}dispose(){this.unload(),this._data=this.update=void 0}_startPreload(e){e instanceof HTMLVideoElement?(this.update=t=>this._update(e,t),this._startPreloadVideoElement(e)):e instanceof HTMLImageElement&&this._startPreloadImageElement(e)}_startPreloadVideoElement(e){if(!((0,c.w8)(e.src)||"auto"===e.preload&&e.crossOrigin)&&(e.preload="auto",e.crossOrigin="anonymous",e.src=e.src,e.paused&&e.autoplay)){const t=[];(0,d.i)(e,e=>t.push(e)).then(()=>{e.play()}).finally(()=>t.forEach(e=>e.remove()))}}_startPreloadImageElement(e){(0,c.DB)(e.src)||(0,c.w8)(e.src)||e.crossOrigin||(e.crossOrigin="anonymous",e.src=e.src)}_createDescriptor(e){const t=new z.R;return t.wrapMode=this._parameters.wrap??10497,t.flipped=!this._parameters.noUnpackFlip,t.samplingMode=this._parameters.mipmap?9987:9729,t.hasMipmap=!!this._parameters.mipmap,t.preMultiplyAlpha=!!this._parameters.preMultiplyAlpha,t.maxAnisotropy=this._parameters.maxAnisotropy??(this._parameters.mipmap?e.parameters.maxMaxAnisotropy:1),t.dataType=this._parameters.dataType??t.dataType,t.pixelFormat=this._parameters.pixelFormat??t.pixelFormat,t.internalFormat=this._parameters.internalFormat??t.internalFormat,t}get glTexture(){return this._glTexture??this._emptyTexture}get loaded(){return null!=this._glTexture}get usedMemory(){return this._glTexture?.usedMemory||function(e,t){if(null==e)return 0;if((0,s.mw)(e)||(0,s.mg)(e))return"image/ktx2"===t.encoding?b(e,!!t.mipmap):"image/x.basis"===t.encoding?y(e,!!t.mipmap):e.byteLength;const{width:r,height:i}=e instanceof Image||e instanceof ImageData||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement?G(e):t,n=t.pixelFormat??6408,o=(0,v.wH)(n);return(t.mipmap?4/3:1)*r*i*o||0}(this._data,this._parameters)}load(e){if(this._loadingPromise)return this._loadingPromise;if(this._glTexture)return this._glTexture;const t=this._data;return null==t?(this._glTexture=new g.g(e,this._createDescriptor(e),null),this._glTexture):(this._emptyTexture=e.emptyTexture,this._parameters.reloadable||(this._data=void 0),"string"==typeof t?this._loadFromURL(e,t):t instanceof Image?this._loadFromImageElement(e,t):t instanceof HTMLVideoElement?this._loadFromVideoElement(e,t):t instanceof ImageData||t instanceof HTMLCanvasElement?this._loadFromImage(e,t):(0,s.mg)(t)&&"image/vnd-ms.dds"===this._parameters.encoding?this._loadFromDDSData(e,t):(0,s.mw)(t)&&"image/vnd-ms.dds"===this._parameters.encoding?this._loadFromDDSData(e,new Uint8Array(t)):((0,s.mw)(t)||(0,s.mg)(t))&&"image/ktx2"===this._parameters.encoding?this._loadFromKTX2(e,t):((0,s.mw)(t)||(0,s.mg)(t))&&"image/x.basis"===this._parameters.encoding?this._loadFromBasis(e,t):(0,s.mw)(t)?this._loadFromPixelData(e,new Uint8Array(t)):(0,s.iu)(t)?this._loadFromPixelData(e,t):null)}_update(e,t){return null==this._glTexture||e.readyState<HTMLMediaElement.HAVE_CURRENT_DATA||t===e.currentTime?t:(this._glTexture.setData(e),this._glTexture.descriptor.hasMipmap&&this._glTexture.generateMipmap(),this._parameters.updateCallback&&this._parameters.updateCallback(),e.currentTime)}_loadFromDDSData(e,t){return this._glTexture=function(e,t,r){const i=P(r,t.hasMipmap??!1);if(null==i)throw new Error("DDS texture data is null");const{textureData:n,internalFormat:o,width:a,height:s}=i;return t.samplingMode=n.levels.length>1?9987:9729,t.hasMipmap=n.levels.length>1,t.internalFormat=o,t.width=a,t.height=s,new g.g(e,t,n)}(e,this._createDescriptor(e),t),this._emptyTexture=null,this._glTexture}_loadFromKTX2(e,t){return this._loadAsync(()=>async function(e,t,r){null==_&&(_=await w());const i=new _.KTX2File(new Uint8Array(r));if(!C(i))return null;i.startTranscoding();const n=S(e,t,i.getLevels(),i.getHasAlpha(),i.getWidth(),i.getHeight(),(e,t)=>i.getImageTranscodedSizeInBytes(e,0,0,t),(e,t,r)=>i.transcodeImage(r,e,0,0,t,0,-1,-1));return i.close(),i.delete(),n}(e,this._createDescriptor(e),t).then(e=>(this._glTexture=e,e)))}_loadFromBasis(e,t){return this._loadAsync(()=>async function(e,t,r){null==_&&(_=await w());const i=new _.BasisFile(new Uint8Array(r));if(!T(i))return null;i.startTranscoding();const n=S(e,t,i.getNumLevels(0),i.getHasAlpha(),i.getImageWidth(0,0),i.getImageHeight(0,0),(e,t)=>i.getImageTranscodedSizeInBytes(0,e,t),(e,t,r)=>i.transcodeImage(r,0,e,t,0,0));return i.close(),i.delete(),n}(e,this._createDescriptor(e),t).then(e=>(this._glTexture=e,e)))}_loadFromPixelData(e,t){(0,L.vA)(this._parameters.width>0&&this._parameters.height>0);const r=this._createDescriptor(e);return 6407!==r.pixelFormat&&6408!==r.pixelFormat||(r.compress=this._parameters.compressionOptions),r.width=this._parameters.width??0,r.height=this._parameters.height??0,this._glTexture=new g.g(e,r,t),this._glTexture}_loadFromURL(e,t){return this._loadAsync(async r=>{const i=await(0,u.D)(t,{signal:r});return(0,a.Te)(r),this._loadFromImage(e,i)})}_loadFromImageElement(e,t){return t.complete?this._loadFromImage(e,t):this._loadAsync(async r=>{const i=await(0,h.y)(t,t.src,!1,r);return(0,a.Te)(r),this._loadFromImage(e,i)})}_loadFromVideoElement(e,t){return t.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA?this._loadFromImage(e,t):this._loadFromVideoElementAsync(e,t)}_loadFromVideoElementAsync(e,t){return this._loadAsync(r=>new Promise((n,s)=>{const l=()=>{t.removeEventListener("loadeddata",c),t.removeEventListener("error",d),(0,o.xt)(u)},c=()=>{t.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA&&(l(),n(this._loadFromImage(e,t)))},d=e=>{l(),s(e||new i.A("texture:load-error","Failed to load video"))};t.addEventListener("loadeddata",c),t.addEventListener("error",d);const u=(0,a.u7)(r,()=>d((0,a.NK)()))}))}_loadFromImage(e,t){let r=t;r instanceof HTMLVideoElement||(r=N(r,e.parameters));const i=G(r);this._parameters.width=i.width,this._parameters.height=i.height;const n=this._createDescriptor(e);return n.width=i.width,n.height=i.height,n.compress=this._parameters.compressionOptions,this._glTexture=new g.g(e,n,r),this._emptyTexture=null,this.events.emit("loaded"),this._glTexture}_loadAsync(e){const t=new AbortController;this._loadingController=t;const r=e(t.signal);this._loadingPromise=r;const i=()=>{this._loadingController===t&&(this._loadingController=null),this._loadingPromise===r&&(this._loadingPromise=null),this._emptyTexture=null};return r.then(i,i),r}unload(){if(this._glTexture=(0,o.WD)(this._glTexture),this._emptyTexture=null,null!=this._loadingController){const e=this._loadingController;this._loadingController=null,this._loadingPromise=null,e.abort()}this.events.emit("unloaded")}get parameters(){return this._parameters}}function G(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e}const U={wrap:{s:10497,t:10497},mipmap:!0,noUnpackFlip:!1,preMultiplyAlpha:!1}},49718:(e,t,r)=>{r(51850),r(6867).i},49788:(e,t,r)=>{r.d(t,{Q:()=>i});const i=1/255.5},51406:(e,t,r)=>{r.d(t,{MU:()=>l,O1:()=>c,QM:()=>d,Sx:()=>s,q2:()=>a});var i=r(29242),n=r(31821),o=r(35644);function a(e,t){t.hasColorTextureTransform?(e.varyings.add("colorUV","vec2"),e.vertex.uniforms.add(new o.k("colorTextureTransformMatrix",e=>e.colorTextureTransformMatrix??i.zK)).code.add(n.H`void forwardColorUV(){
519
+ `)}},46859:(e,t,r)=>{r.d(t,{h:()=>B}),r(44208);var i=r(49186),n=r(65529),o=r(97768),a=r(74887),s=r(34275),l=r(24326),c=r(84952),d=r(38969),u=r(31217),h=r(95117),p=r(2741);let m;var f=r(63907),g=r(76284),v=r(42293);let _=null,x=null;async function w(){return null==x&&(m??=(async()=>{const e=await r.e(9321).then(r.bind(r,49321)),t=await e.default({locateFile:e=>(0,p.s)(`esri/libs/basisu/${e}`)});return t.initializeBasis(),t})(),x=m,_=await x),x}function y(e,t){if(null==_)return e.byteLength;const r=new _.BasisFile(new Uint8Array(e)),i=T(r)?M(r.getNumLevels(0),r.getHasAlpha(),r.getImageWidth(0,0),r.getImageHeight(0,0),t):0;return r.close(),r.delete(),i}function b(e,t){if(null==_)return e.byteLength;const r=new _.KTX2File(new Uint8Array(e)),i=C(r)?M(r.getLevels(),r.getHasAlpha(),r.getWidth(),r.getHeight(),t):0;return r.close(),r.delete(),i}function M(e,t,r,i,n){const o=(0,v.MW)(t?f.CQ.COMPRESSED_RGBA8_ETC2_EAC:f.CQ.COMPRESSED_RGB8_ETC2),a=n&&e>1?(4**e-1)/(3*4**(e-1)):1;return Math.ceil(r*i*o*a)}function T(e){return e.getNumImages()>=1&&!e.isUASTC()}function C(e){return e.getFaces()>=1&&e.isETC1S()}function S(e,t,r,i,n,o,a,s){const{compressedTextureETC:l,compressedTextureS3TC:c}=e.capabilities,[d,u]=l?i?[1,f.CQ.COMPRESSED_RGBA8_ETC2_EAC]:[0,f.CQ.COMPRESSED_RGB8_ETC2]:c?i?[3,f.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT]:[2,f.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT]:[13,6408],h=t.hasMipmap?r:Math.min(1,r),p=[];for(let e=0;e<h;e++)p.push(new Uint8Array(a(e,d))),s(e,d,p[e]);return t.internalFormat=u,t.hasMipmap=p.length>1,t.samplingMode=t.hasMipmap?9987:9729,t.width=n,t.height=o,new g.g(e,t,{type:"compressed",levels:p})}var E=r(53966);const A=()=>E.A.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil");function R(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}const I=R("DXT1"),F=R("DXT3"),O=R("DXT5");function P(e,t){const r=new Int32Array(e.buffer,e.byteOffset,31);if(542327876!==r[0])return A().error("Invalid magic number in DDS header"),null;if(!(4&r[20]))return A().error("Unsupported format, must contain a FourCC code"),null;const i=r[21];let n,o;switch(i){case I:n=8,o=f.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case F:n=16,o=f.CQ.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case O:n=16,o=f.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return A().error("Unsupported FourCC code:",function(e){return String.fromCharCode(255&e,e>>8&255,e>>16&255,e>>24&255)}(i)),null}let a=1,s=r[4],l=r[3];(3&s||3&l)&&(A().warn("Rounding up compressed texture size to nearest multiple of 4."),s=s+3&-4,l=l+3&-4);const c=s,d=l;let u,h;131072&r[2]&&!1!==t&&(a=Math.max(1,r[7]));let p=e.byteOffset+r[1]+4;const m=[];for(let t=0;t<a;++t)h=(s+3>>2)*(l+3>>2)*n,u=new Uint8Array(e.buffer,p,h),m.push(u),p+=h,s=Math.max(1,s>>1),l=Math.max(1,l>>1);return{textureData:{type:"compressed",levels:m},internalFormat:o,width:c,height:d}}function D(e,t){return t=16*Math.floor(t/16),Math.min(16*Math.round(e/16),t)}function N(e,t){const[r,i]=function({width:e,height:t},{maxPreferredTexturePixels:r,maxTextureSize:i}){const n=Math.max(e,t),o=e*t;if(n<=i&&o<=r)return[e,t];const a=Math.min(Math.sqrt(r/o),i/n);return[D(Math.round(e*a),i),D(Math.round(t*a),i)]}(e,t);return e.width===r&&e.height===i?e:H(e,r,i)}function H(e,t,r){if(e instanceof ImageData)return H(function(e){const t=document.createElement("canvas");t.width=e.width,t.height=e.height;const r=t.getContext("2d");if(null==r)throw new i.A("texture:context-failed","Failed to create 2d context from HTMLCanvasElement");return r.putImageData(e,0,0),t}(e),t,r);const n=document.createElement("canvas");return n.width=t,n.height=r,n.getContext("2d").drawImage(e,0,0,n.width,n.height),n}var L=r(620),z=r(67171);class B{constructor(e,t){this._data=e,this.id=(0,l.c)(),this.events=new n.bk,this._parameters={...U,...t},this._startPreload(e)}dispose(){this.unload(),this._data=this.update=void 0}_startPreload(e){e instanceof HTMLVideoElement?(this.update=t=>this._update(e,t),this._startPreloadVideoElement(e)):e instanceof HTMLImageElement&&this._startPreloadImageElement(e)}_startPreloadVideoElement(e){if(!((0,c.w8)(e.src)||"auto"===e.preload&&e.crossOrigin)&&(e.preload="auto",e.crossOrigin="anonymous",e.src=e.src,e.paused&&e.autoplay)){const t=[];(0,d.i)(e,e=>t.push(e)).then(()=>{e.play()}).finally(()=>t.forEach(e=>e.remove()))}}_startPreloadImageElement(e){(0,c.DB)(e.src)||(0,c.w8)(e.src)||e.crossOrigin||(e.crossOrigin="anonymous",e.src=e.src)}_createDescriptor(e){const t=new z.R;return t.wrapMode=this._parameters.wrap??10497,t.flipped=!this._parameters.noUnpackFlip,t.samplingMode=this._parameters.mipmap?9987:9729,t.hasMipmap=!!this._parameters.mipmap,t.preMultiplyAlpha=!!this._parameters.preMultiplyAlpha,t.maxAnisotropy=this._parameters.maxAnisotropy??(this._parameters.mipmap?e.parameters.maxMaxAnisotropy:1),t.dataType=this._parameters.dataType??t.dataType,t.pixelFormat=this._parameters.pixelFormat??t.pixelFormat,t.internalFormat=this._parameters.internalFormat??t.internalFormat,t}get texture(){return this._texture??this._emptyTexture}get loaded(){return null!=this._texture}get usedMemory(){return this._texture?.usedMemory||function(e,t){if(null==e)return 0;if((0,s.mw)(e)||(0,s.mg)(e))return"image/ktx2"===t.encoding?b(e,!!t.mipmap):"image/x.basis"===t.encoding?y(e,!!t.mipmap):e.byteLength;const{width:r,height:i}=e instanceof Image||e instanceof ImageData||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement?G(e):t,n=t.pixelFormat??6408,o=(0,v.wH)(n);return(t.mipmap?4/3:1)*r*i*o||0}(this._data,this._parameters)}load(e){if(this._loadingPromise)return this._loadingPromise;if(this._texture)return this._texture;const t=this._data;return null==t?(this._texture=new g.g(e,this._createDescriptor(e),null),this._texture):(this._emptyTexture=e.emptyTexture,this._parameters.reloadable||(this._data=void 0),"string"==typeof t?this._loadFromURL(e,t):t instanceof Image?this._loadFromImageElement(e,t):t instanceof HTMLVideoElement?this._loadFromVideoElement(e,t):t instanceof ImageData||t instanceof HTMLCanvasElement?this._loadFromImage(e,t):(0,s.mg)(t)&&"image/vnd-ms.dds"===this._parameters.encoding?this._loadFromDDSData(e,t):(0,s.mw)(t)&&"image/vnd-ms.dds"===this._parameters.encoding?this._loadFromDDSData(e,new Uint8Array(t)):((0,s.mw)(t)||(0,s.mg)(t))&&"image/ktx2"===this._parameters.encoding?this._loadFromKTX2(e,t):((0,s.mw)(t)||(0,s.mg)(t))&&"image/x.basis"===this._parameters.encoding?this._loadFromBasis(e,t):(0,s.mw)(t)?this._loadFromPixelData(e,new Uint8Array(t)):(0,s.iu)(t)?this._loadFromPixelData(e,t):null)}_update(e,t){return null==this._texture||e.readyState<HTMLMediaElement.HAVE_CURRENT_DATA||t===e.currentTime?t:(this._texture.setData(e),this._texture.descriptor.hasMipmap&&this._texture.generateMipmap(),this._parameters.updateCallback&&this._parameters.updateCallback(),e.currentTime)}_loadFromDDSData(e,t){return this._texture=function(e,t,r){const i=P(r,t.hasMipmap??!1);if(null==i)throw new Error("DDS texture data is null");const{textureData:n,internalFormat:o,width:a,height:s}=i;return t.samplingMode=n.levels.length>1?9987:9729,t.hasMipmap=n.levels.length>1,t.internalFormat=o,t.width=a,t.height=s,new g.g(e,t,n)}(e,this._createDescriptor(e),t),this._emptyTexture=null,this._texture}_loadFromKTX2(e,t){return this._loadAsync(()=>async function(e,t,r){null==_&&(_=await w());const i=new _.KTX2File(new Uint8Array(r));if(!C(i))return null;i.startTranscoding();const n=S(e,t,i.getLevels(),i.getHasAlpha(),i.getWidth(),i.getHeight(),(e,t)=>i.getImageTranscodedSizeInBytes(e,0,0,t),(e,t,r)=>i.transcodeImage(r,e,0,0,t,0,-1,-1));return i.close(),i.delete(),n}(e,this._createDescriptor(e),t).then(e=>(this._texture=e,e)))}_loadFromBasis(e,t){return this._loadAsync(()=>async function(e,t,r){null==_&&(_=await w());const i=new _.BasisFile(new Uint8Array(r));if(!T(i))return null;i.startTranscoding();const n=S(e,t,i.getNumLevels(0),i.getHasAlpha(),i.getImageWidth(0,0),i.getImageHeight(0,0),(e,t)=>i.getImageTranscodedSizeInBytes(0,e,t),(e,t,r)=>i.transcodeImage(r,0,e,t,0,0));return i.close(),i.delete(),n}(e,this._createDescriptor(e),t).then(e=>(this._texture=e,e)))}_loadFromPixelData(e,t){(0,L.vA)(this._parameters.width>0&&this._parameters.height>0);const r=this._createDescriptor(e);return 6407!==r.pixelFormat&&6408!==r.pixelFormat||(r.compress=this._parameters.compressionOptions),r.width=this._parameters.width??0,r.height=this._parameters.height??0,this._texture=new g.g(e,r,t),this._texture}_loadFromURL(e,t){return this._loadAsync(async r=>{const i=await(0,u.D)(t,{signal:r});return(0,a.Te)(r),this._loadFromImage(e,i)})}_loadFromImageElement(e,t){return t.complete?this._loadFromImage(e,t):this._loadAsync(async r=>{const i=await(0,h.y)(t,t.src,!1,r);return(0,a.Te)(r),this._loadFromImage(e,i)})}_loadFromVideoElement(e,t){return t.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA?this._loadFromImage(e,t):this._loadFromVideoElementAsync(e,t)}_loadFromVideoElementAsync(e,t){return this._loadAsync(r=>new Promise((n,s)=>{const l=()=>{t.removeEventListener("loadeddata",c),t.removeEventListener("error",d),(0,o.xt)(u)},c=()=>{t.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA&&(l(),n(this._loadFromImage(e,t)))},d=e=>{l(),s(e||new i.A("texture:load-error","Failed to load video"))};t.addEventListener("loadeddata",c),t.addEventListener("error",d);const u=(0,a.u7)(r,()=>d((0,a.NK)()))}))}_loadFromImage(e,t){let r=t;r instanceof HTMLVideoElement||(r=N(r,e.parameters));const i=G(r);this._parameters.width=i.width,this._parameters.height=i.height;const n=this._createDescriptor(e);return n.width=i.width,n.height=i.height,n.compress=this._parameters.compressionOptions,this._texture=new g.g(e,n,r),this._emptyTexture=null,this.events.emit("loaded"),this._texture}_loadAsync(e){const t=new AbortController;this._loadingController=t;const r=e(t.signal);this._loadingPromise=r;const i=()=>{this._loadingController===t&&(this._loadingController=null),this._loadingPromise===r&&(this._loadingPromise=null),this._emptyTexture=null};return r.then(i,i),r}unload(){if(this._texture=(0,o.WD)(this._texture),this._emptyTexture=null,null!=this._loadingController){const e=this._loadingController;this._loadingController=null,this._loadingPromise=null,e.abort()}this.events.emit("unloaded")}get parameters(){return this._parameters}}function G(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e}const U={wrap:{s:10497,t:10497},mipmap:!0,noUnpackFlip:!1,preMultiplyAlpha:!1}},47286:(e,t,r)=>{r.d(t,{G:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"vec2",1,(i,n,o)=>i.setUniform2fv(e,t(n,o),r))}}},49718:(e,t,r)=>{r(51850),r(6867).i},49788:(e,t,r)=>{r.d(t,{Q:()=>i});const i=1/255.5},51406:(e,t,r)=>{r.d(t,{MU:()=>l,O1:()=>c,QM:()=>d,Sx:()=>s,q2:()=>a});var i=r(29242),n=r(31821),o=r(35644);function a(e,t){t.hasColorTextureTransform?(e.varyings.add("colorUV","vec2"),e.vertex.uniforms.add(new o.k("colorTextureTransformMatrix",e=>e.colorTextureTransformMatrix??i.zK)).code.add(n.H`void forwardColorUV(){
513
520
  colorUV = (colorTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
514
521
  }`)):e.vertex.code.add(n.H`void forwardColorUV(){}`)}function s(e,t){t.hasNormalTextureTransform&&0!==t.textureCoordinateType?(e.varyings.add("normalUV","vec2"),e.vertex.uniforms.add(new o.k("normalTextureTransformMatrix",e=>e.normalTextureTransformMatrix??i.zK)).code.add(n.H`void forwardNormalUV(){
515
522
  normalUV = (normalTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
@@ -555,7 +562,7 @@ screenSizePerspectiveScaleFactor(absCosAngle, distanceToCamera, params)
555
562
  return size * clamp(mix(factor.x, 1.0, factor.y), factor.z, 1.0);
556
563
  }`),e.vertex.code.add(a.H`vec2 screenSizePerspectiveScaleVec2(vec2 size, float absCosAngle, float distanceToCamera, vec3 params) {
557
564
  return applyScreenSizePerspectiveScaleFactorVec2(size, screenSizePerspectiveScaleFactor(absCosAngle, distanceToCamera, params));
558
- }`)}function l(e){e.uniforms.add(new o.t("screenSizePerspective",e=>d(e.screenSizePerspective,e.screenSizePerspectiveMinPixelReferenceSize)))}function c(e){e.uniforms.add(new o.t("screenSizePerspectiveAlignment",e=>d(e.screenSizePerspectiveAlignment||e.screenSizePerspective,e.screenSizePerspectiveAlignment?null:e.screenSizePerspectiveMinPixelReferenceSize)))}function d(e,t){const r=null!=t&&null!=e?Math.min(e.minPixelSize/t,1):0;return e?(0,i.j)(u,e.divisor,e.offset,r):(0,i.j)(u,0,0,0)}const u=(0,n.vt)()},57323:(e,t,r)=>{r.d(t,{R:()=>z,b:()=>L});var i=r(32680),n=r(49255),o=r(76591),a=r(76597),s=r(24321),l=r(60864),c=r(43519),d=r(96336),u=r(71955),h=r(53466),p=r(92700),m=r(35640),f=r(40261),g=r(65836),v=r(89390),_=r(98619),x=r(22393),w=r(59469),y=r(32482),b=r(96598),M=r(42398),T=r(58614),C=r(27950),S=r(25178),E=r(33079),A=r(71988),R=r(20304),I=r(31821),F=r(63761),O=r(10906),P=r(43616),D=r(60517),N=r(14113),H=r(49788);function L(e){const t=new N.N5,{attributes:r,vertex:L,fragment:z,varyings:B}=t,{output:G,offsetBackfaces:U,pbrMode:V,snowCover:j,spherical:W}=e,k=1===V||2===V;if((0,S.NB)(L,e),r.add("position","vec3"),B.add("vpos","vec3",{invariant:!0}),t.include(M.A,e),t.include(l.B,e),t.include(m.Ge,e),t.include(b.Z,e),!(0,n.RN)(G))return t.include(f.E,e),t;(0,S.yu)(t.vertex,e),t.include(d.Y,e),t.include(a.d),U&&t.include(i.M),B.add("vNormalWorld","vec3"),B.add("localvpos","vec3",{invariant:!0}),t.include(h.U,e),t.include(u.K,e),t.include(s.v,e),t.include(p.c,e),L.include(c.WD),L.include(c.oF),L.uniforms.add(new A.E("externalColor",e=>e.externalColor,{supportsNaN:!0})),B.add("vcolorExt","vec4"),t.include(e.instancedDoublePrecision?y.G:y.Bz,e),L.main.add(I.H`
565
+ }`)}function l(e){e.uniforms.add(new o.t("screenSizePerspective",e=>d(e.screenSizePerspective,e.screenSizePerspectiveMinPixelReferenceSize)))}function c(e){e.uniforms.add(new o.t("screenSizePerspectiveAlignment",e=>d(e.screenSizePerspectiveAlignment||e.screenSizePerspective,e.screenSizePerspectiveAlignment?null:e.screenSizePerspectiveMinPixelReferenceSize)))}function d(e,t){const r=null!=t&&null!=e?Math.min(e.minPixelSize/t,1):0;return e?(0,i.j)(u,e.divisor,e.offset,r):(0,i.j)(u,0,0,0)}const u=(0,n.vt)()},57323:(e,t,r)=>{r.d(t,{R:()=>z,b:()=>L});var i=r(32680),n=r(49255),o=r(76591),a=r(76597),s=r(24321),l=r(60864),c=r(43519),d=r(96336),u=r(71955),h=r(53466),p=r(92700),m=r(35640),f=r(40261),g=r(14527),v=r(89390),_=r(98619),x=r(22393),w=r(59469),y=r(32482),b=r(96598),M=r(42398),T=r(58614),C=r(27950),S=r(25178),E=r(33079),A=r(71988),R=r(20304),I=r(31821),F=r(63761),O=r(10906),P=r(43616),D=r(60517),N=r(14113),H=r(49788);function L(e){const t=new N.N5,{attributes:r,vertex:L,fragment:z,varyings:B}=t,{output:G,offsetBackfaces:U,pbrMode:V,snowCover:j,spherical:W}=e,k=1===V||2===V;if((0,S.NB)(L,e),r.add("position","vec3"),B.add("vpos","vec3",{invariant:!0}),t.include(M.A,e),t.include(l.B,e),t.include(m.Ge,e),t.include(b.Z,e),!(0,n.RN)(G))return t.include(f.E,e),t;(0,S.yu)(t.vertex,e),t.include(d.Y,e),t.include(a.d),U&&t.include(i.M),B.add("vNormalWorld","vec3"),B.add("localvpos","vec3",{invariant:!0}),t.include(h.U,e),t.include(u.K,e),t.include(s.v,e),t.include(p.c,e),L.include(c.WD),L.include(c.oF),L.uniforms.add(new A.E("externalColor",e=>e.externalColor,{supportsNaN:!0})),B.add("vcolorExt","vec4"),t.include(e.instancedDoublePrecision?y.G:y.Bz,e),L.main.add(I.H`
559
566
  forwardNormalizedVertexColor();
560
567
 
561
568
  MaskedColor maskedColorExt =
@@ -705,14 +712,7 @@ return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);
705
712
  }
706
713
  float rgb2v(vec3 c) {
707
714
  return max(c.x, max(c.y, c.z));
708
- }`)}},63907:(e,t,r)=>{r.d(t,{$0:()=>u,CQ:()=>g,Fq:()=>m,H0:()=>o,SB:()=>l,WR:()=>i,XN:()=>a,iE:()=>s,ld:()=>c,nI:()=>f,pe:()=>n,r6:()=>h,vt:()=>d,yI:()=>p});const i={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},n={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,HALF_FLOAT:5131},o={RGBA4:32854,R16F:33325,RG16F:33327,RGB32F:34837,RGBA16F:34842,R32F:33326,RG32F:33328,RGBA32F:34836,R11F_G11F_B10F:35898,RGB8:32849,RGBA8:32856,RGB5_A1:32855,R8:33321,RG8:33323,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,RGB16F:34843,RGB9_E5:35901,SRGB8:35905,SRGB8_ALPHA8:35907,RGB565:36194,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,RGB10_A2:32857,RGB10_A2UI:36975},a=Object.values(o),s={DEPTH24_STENCIL8:35056,DEPTH32F_STENCIL8:36013},l={DEPTH_COMPONENT16:33189,DEPTH_COMPONENT24:33190,DEPTH_COMPONENT32F:36012},c={FLOAT:n.FLOAT,UNSIGNED_BYTE:n.UNSIGNED_BYTE,UNSIGNED_INT_24_8:34042,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,BYTE:n.BYTE,UNSIGNED_SHORT:n.UNSIGNED_SHORT,SHORT:n.SHORT,UNSIGNED_INT:n.UNSIGNED_INT,INT:n.INT,HALF_FLOAT:5131,UNSIGNED_INT_2_10_10_10_REV:33640,UNSIGNED_INT_10F_11F_11F_REV:35899,UNSIGNED_INT_5_9_9_9_REV:35902,FLOAT_32_UNSIGNED_INT_24_8_REV:36269},d={Texture:0,TileTexture:1,BufferObject:2,VertexArrayObject:3,Shader:4,Program:5,FramebufferObject:6,Renderbuffer:7,TransformFeedback:8,Sync:9,UNCOUNTED:10,LinesOfCode:10,Uniform:11,COUNT:12},u=0,h=36064,p=36065,m=36066,f=33306,g={COMPRESSED_RGB_S3TC_DXT1_EXT:33776,COMPRESSED_RGBA_S3TC_DXT1_EXT:33777,COMPRESSED_RGBA_S3TC_DXT3_EXT:33778,COMPRESSED_RGBA_S3TC_DXT5_EXT:33779,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497}},65836:(e,t,r)=>{r.d(t,{n:()=>_t});var i=r(31821),n=r(12791),o=r(31635),a=r(34727),s=r(97768),l=r(36708),c=r(78659),d=r(10107),u=(r(44208),r(53966)),h=(r(87811),r(64108)),p=r(37585),m=r(69540);let f=class extends m.Pw{constructor(e){super(e),this.row=0,this.column=0,this.rows=1,this.columns=1}equals(e){return null!=e&&this.row===e.row&&this.rows===e.rows&&this.column===e.column&&this.columns===e.columns}};(0,o.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],f.prototype,"row",void 0),(0,o.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],f.prototype,"column",void 0),(0,o.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],f.prototype,"rows",void 0),(0,o.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],f.prototype,"columns",void 0),f=(0,o.Cg)([(0,h.$)("esri.CameraLayout")],f);const g=f;var v=r(69052),_=r(25482),x=r(79901),w=r(36005),y=r(43937),b=r(56507),M=r(86738);let T=class extends((0,m.OU)(_.o)){constructor(...e){super(...e),this.position=new M.A([0,0,0]),this.heading=0,this.tilt=0,this.fov=55,this.layout=new g}normalizeCtorArgs(e,t,r,i){if(e&&"object"==typeof e&&("x"in e||Array.isArray(e))){const n={position:e};return null!=t&&(n.heading=t),null!=r&&(n.tilt=r),null!=i&&(n.fov=i),n}return e}writePosition(e,t,r,i){const n=e.clone();n.x=(0,b.GB)(e.x||0),n.y=(0,b.GB)(e.y||0),n.z=e.hasZ?(0,b.GB)(e.z||0):e.z,t[r]=n.write({},i)}readPosition(e,t){const r=new M.A;return r.read(e,t),r.x=(0,b.GB)(r.x||0),r.y=(0,b.GB)(r.y||0),r.z=r.hasZ?(0,b.GB)(r.z||0):r.z,r}equals(e){return null!=e&&this.tilt===e.tilt&&this.heading===e.heading&&this.fov===e.fov&&this.position.equals(e.position)&&this.layout.equals(e.layout)}};(0,o.Cg)([(0,d.MZ)({type:M.A,json:{write:{isRequired:!0}}})],T.prototype,"position",void 0),(0,o.Cg)([(0,y.K)("position")],T.prototype,"writePosition",null),(0,o.Cg)([(0,w.w)("position")],T.prototype,"readPosition",null),(0,o.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),(0,x.w)(e=>v.ie.normalize((0,b.GB)(e)))],T.prototype,"heading",void 0),(0,o.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),(0,x.w)(e=>(0,a.qE)((0,b.GB)(e),-180,180))],T.prototype,"tilt",void 0),(0,o.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{default:55,write:!0}}),(0,x.w)(e=>(0,a.qE)((0,b.GB)(e,55),1,170))],T.prototype,"fov",void 0),(0,o.Cg)([(0,d.MZ)({type:g,nonNullable:!0,json:{read:!1,write:!1}})],T.prototype,"layout",void 0),T=(0,o.Cg)([(0,h.$)("esri.Camera")],T);var C,S=r(9093),E=r(38954),A=r(51850),R=r(16930),I=(r(48353),r(9762),r(65806)),F=r(27993),O=r(73941),P=(r(19419),r(69622)),D=r(90629),N=r(58083),H=r(48163),L=r(87317),z=r(91829),B=r(82919),G=r(71351),U=r(44280);let V=C=class extends P.A{constructor(e){super(e),this._ray=(0,G.vt)(),this._viewport=(0,z.fA)(0,0,1,1),this._padding=(0,z.fA)(0,0,0,0),this._fov=55/180*Math.PI,this._nearFar=(0,H.fA)(1,1e3),this._viewDirty=!0,this._viewMatrix=(0,S.vt)(),this._viewProjectionDirty=!0,this._viewProjectionMatrix=(0,S.vt)(),this._viewInverseTransposeMatrixDirty=!0,this._viewInverseTransposeMatrix=(0,S.vt)(),this._frustumDirty=!0,this._frustum=(0,B.vt)(),this._fullViewport=(0,z.vt)(),this._pixelRatio=1,this.row=0,this.column=0,this._rows=1,this._columns=1,this._center=(0,A.vt)(),this._up=(0,A.vt)(),this.relativeElevation=0}get pixelRatio(){return this._pixelRatio}set pixelRatio(e){this._pixelRatio=e>0?e:1}get rows(){return this._rows}set rows(e){this._rows=Math.max(1,e)}get columns(){return this._columns}set columns(e){this._columns=Math.max(1,e)}get eye(){return this._ray.origin}set eye(e){this._compareAndSetView(e,this._ray.origin)}get center(){return this._center}set center(e){this._compareAndSetView(e,this._center,"_center")}get ray(){return(0,E.e)(this._ray.direction,this.center,this.eye),this._ray}get up(){return this._up}set up(e){this._compareAndSetView(e,this._up,"_up")}get viewMatrix(){return this._ensureViewClean(),this._viewMatrix}set viewMatrix(e){(0,N.C)(this._viewMatrix,e),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0}get viewForward(){return this._ensureViewClean(),(0,E.j)((0,A.vt)(),-this._viewMatrix[2],-this._viewMatrix[6],-this._viewMatrix[10])}get viewUp(){return this._ensureViewClean(),(0,E.j)((0,A.vt)(),this._viewMatrix[1],this._viewMatrix[5],this._viewMatrix[9])}get viewRight(){return this._ensureViewClean(),(0,E.j)((0,A.vt)(),this._viewMatrix[0],this._viewMatrix[4],this._viewMatrix[8])}get nearFar(){return this._nearFar}get near(){return this._nearFar[0]}set near(e){this._nearFar[0]!==e&&(this._nearFar[0]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get far(){return this._nearFar[1]}set far(e){this._nearFar[1]!==e&&(this._nearFar[1]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get viewport(){return this._viewport}set viewport(e){this.x=e[0],this.y=e[1],this.width=e[2],this.height=e[3]}get screenViewport(){if(1===this.pixelRatio)return this._viewport;const e=(0,L.c)((0,z.vt)(),this._viewport,1/this.pixelRatio),t=this._get("screenViewport");return t&&(0,L.e)(e,t)?t:e}get screenPadding(){if(1===this.pixelRatio)return this._padding;const e=(0,L.c)((0,z.vt)(),this._padding,1/this.pixelRatio),t=this._get("screenPadding");return t&&(0,L.e)(e,t)?t:e}get x(){return this._viewport[0]}set x(e){e+=this._padding[3],this._viewport[0]!==e&&(this._viewport[0]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get y(){return this._viewport[1]}set y(e){e+=this._padding[2],this._viewport[1]!==e&&(this._viewport[1]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get width(){return this._viewport[2]}set width(e){this._viewport[2]!==e&&(this._viewport[2]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get height(){return this._viewport[3]}set height(e){this._viewport[3]!==e&&(this._viewport[3]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get fullWidth(){return this._viewport[2]+this._padding[1]+this._padding[3]}set fullWidth(e){this.width=e-(this._padding[1]+this._padding[3])}get fullHeight(){return this._viewport[3]+this._padding[0]+this._padding[2]}set fullHeight(e){this.height=e-(this._padding[0]+this._padding[2])}get fullViewport(){return this._fullViewport[0]=this._viewport[0]-this._padding[3],this._fullViewport[1]=this._viewport[1]-this._padding[2],this._fullViewport[2]=this.fullWidth,this._fullViewport[3]=this.fullHeight,this._fullViewport}get _aspect(){return this.width/this.height}get padding(){return this._padding}set padding(e){(0,L.a)(this._padding,e)||(this._viewport[0]+=e[3]-this._padding[3],this._viewport[1]+=e[2]-this._padding[2],this._viewport[2]-=e[1]+e[3]-(this._padding[1]+this._padding[3]),this._viewport[3]-=e[0]+e[2]-(this._padding[0]+this._padding[2]),(0,L.d)(this._padding,e),this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_padding"),this.notifyChange("_viewport"))}get viewProjectionMatrix(){return this._viewProjectionDirty&&((0,N.lw)(this._viewProjectionMatrix,this.projectionMatrix,this.viewMatrix),this._viewProjectionDirty=!1),this._viewProjectionMatrix}get projectionMatrix(){return this._projectionMatrixInternal}get inverseProjectionMatrix(){return(0,N.B8)((0,S.vt)(),this.projectionMatrix)||this._get("inverseProjectionMatrix")||(0,S.vt)()}get fov(){return this._fov}set fov(e){this._fov=e,this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovX(){return e=this._fov,t=this.width,r=this.height,2*Math.atan(t*Math.tan(.5*e)/Math.sqrt(t*t+r*r));var e,t,r}set fovX(e){this._fov=function(e,t,r){return 2*Math.atan(Math.sqrt(t*t+r*r)*Math.tan(.5*e)/t)}(e,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovY(){return e=this._fov,t=this.width,r=this.height,2*Math.atan(r*Math.tan(.5*e)/Math.sqrt(t*t+r*r));var e,t,r}set fovY(e){this._fov=function(e,t,r){return 2*Math.atan(Math.sqrt(t*t+r*r)*Math.tan(.5*e)/r)}(e,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get distance(){return(0,E.k)(this.center,this.eye)}get frustum(){return this._recomputeFrustum(),this._frustum}get viewInverseTransposeMatrix(){return(this._viewInverseTransposeMatrixDirty||this._viewDirty)&&((0,N.B8)(this._viewInverseTransposeMatrix,this.viewMatrix),(0,N.mg)(this._viewInverseTransposeMatrix,this._viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),this._viewInverseTransposeMatrix}depthNDCToWorld(e){const{near:t,far:r}=this;return 2*t*r/(r+t-e*(r-t))}get perRenderPixelRatio(){return Math.tan(this.fovX/2)/(this.width/2)}get perScreenPixelRatio(){return this.perRenderPixelRatio*this.pixelRatio}get aboveGround(){return null!=this.relativeElevation&&this.relativeElevation>=0}get _projectionMatrixInternal(){const e=this.width,t=this.height,r=this.near*Math.tan(this.fovY/2)*2,i=r*this._aspect,n=r/this.rows,o=i/this.columns,a=-i/2+this.column*o,s=a+o,l=-r/2+this.row*n,c=l+n,d=(0,N.$h)((0,S.vt)(),a*(1+2*this._padding[3]/e),s*(1+2*this._padding[1]/e),l*(1+2*this._padding[2]/t),c*(1+2*this._padding[0]/t),this.near,this.far),u=this._get("projectionMatrix");return u&&(0,N.aI)(u,d)?u:d}copyFrom(e){(0,E.d)(this._ray.origin,e.eye),this.center=e.center,this.up=e.up,(0,L.d)(this._viewport,e.viewport),this.notifyChange("_viewport"),(0,L.d)(this._padding,e.padding),this.notifyChange("_padding"),(0,p.C)(this._nearFar,e.nearFar),this.notifyChange("_nearFar"),this._fov=e.fov,this.row=e.row,this.column=e.column,this.rows=e.rows,this.columns=e.columns,this.relativeElevation=e.relativeElevation;const t=e;return this._viewDirty=t._viewDirty,this._viewDirty||((0,N.C)(this._viewMatrix,e.viewMatrix),this.notifyChange("_viewMatrix")),this._viewProjectionDirty=!0,this._frustumDirty=t._frustumDirty,this._frustumDirty||((0,B.C)(this._frustum,e.frustum),this._frustumDirty=!1),t._viewInverseTransposeMatrixDirty?this._viewInverseTransposeMatrixDirty=!0:((0,N.C)(this._viewInverseTransposeMatrix,e.viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),(0,L.d)(this._fullViewport,e.fullViewport),this.pixelRatio=e.pixelRatio,this}copyViewFrom(e){this.eye=e.eye,this.center=e.center,this.up=e.up,this.fov=e.fov}clone(){return(new C).copyFrom(this)}equals(e){return(0,E.q)(this.eye,e.eye)&&(0,E.q)(this.center,e.center)&&(0,E.q)(this.up,e.up)&&(0,L.a)(this._viewport,e.viewport)&&(0,L.a)(this._padding,e.padding)&&(0,p.t2)(this.nearFar,e.nearFar)&&this._fov===e.fov&&this.pixelRatio===e.pixelRatio&&this.relativeElevation===e.relativeElevation&&this.row===e.row&&this.column===e.column&&this.rows===e.rows&&this.columns===e.columns}almostEquals(e){const t=Math.max(1,1/this.pixelRatio,1/e.pixelRatio);if(Math.abs(e.fov-this._fov)>=.001||(0,L.f)(e.screenPadding,this.screenPadding)>=t||(0,L.f)(this.screenViewport,e.screenViewport)>=t||this.row!==e.row||this.column!==e.column||this.rows!==e.rows||this.columns!==e.columns)return!1;(0,E.a)(k,e.eye,e.center),(0,E.a)($,this.eye,this.center);const r=(0,E.f)(k,$),i=(0,E.y)(k),n=(0,E.y)($),o=5e-4;return r*r>=(1-1e-10)*i*n&&(0,E.x)(e.eye,this.eye)<Math.max(i,n)*o*o}computeRenderPixelSizeAt(e){return this.computeRenderPixelSizeAtDist(this._viewDirectionDistance(e))}computeRenderPixelSizeAtDist(e){return e*this.perRenderPixelRatio}computeScreenPixelSizeAt(e){return this.computeScreenPixelSizeAtDist(this._viewDirectionDistance(e))}_viewDirectionDistance(e){return Math.abs((0,U.gr)(this.viewForward,(0,E.e)(k,e,this.eye)))}computeScreenPixelSizeAtDist(e){return e*this.perScreenPixelRatio}computeDistanceFromRadius(e,t){return e/Math.tan(Math.min(this.fovX,this.fovY)/(2*(t||1)))}getScreenCenter(e=(0,D.gs)()){return e[0]=(this.padding[3]+this.width/2)/this.pixelRatio,e[1]=(this.padding[0]+this.height/2)/this.pixelRatio,e}getRenderCenter(e,t=.5,r=.5){return e[0]=this.padding[3]+this.width*t,e[1]=this.padding[2]+this.height*r,e[2]=.5,e}setGLViewport(e){const t=this.viewport,r=this.padding;e.setViewport(t[0]-r[3],t[1]-r[2],t[2]+r[1]+r[3],t[3]+r[0]+r[2])}applyProjection(e,t){e!==j&&(0,E.d)(j,e),j[3]=1,(0,L.t)(j,j,this.projectionMatrix);const r=Math.abs(j[3]);(0,E.h)(j,j,1/r);const i=this.fullViewport;t[0]=(0,a.Cc)(0,i[0]+i[2],.5+.5*j[0]),t[1]=(0,a.Cc)(0,i[1]+i[3],.5+.5*j[1]),t[2]=.5*(j[2]+1),t[3]=r}unapplyProjection(e,t){const r=this.fullViewport;j[0]=(e[0]/(r[0]+r[2])*2-1)*e[3],j[1]=(e[1]/(r[1]+r[3])*2-1)*e[3],j[2]=(2*e[2]-1)*e[3],j[3]=e[3],null!=this.inverseProjectionMatrix&&((0,L.t)(j,j,this.inverseProjectionMatrix),t[0]=j[0],t[1]=j[1],t[2]=j[2])}projectToScreen(e,t){return this.projectToRenderScreen(e,Z),this.renderToScreen(Z,t),t}projectToRenderScreen(e,t){if(j[0]=e[0],j[1]=e[1],j[2]=e[2],j[3]=1,(0,L.t)(j,j,this.viewProjectionMatrix),0===j[3])return null;const r=j;(0,E.h)(r,r,1/Math.abs(j[3]));const i=this.fullViewport,n=(0,a.Cc)(0,i[0]+i[2],.5+.5*r[0]),o=(0,a.Cc)(0,i[1]+i[3],.5+.5*r[1]);return"x"in t?(t.x=n,t.y=o):(t[0]=n,t[1]=o,t.length>2&&(t[2]=.5*(r[2]+1))),t}unprojectFromScreen(e,t){return this.unprojectFromRenderScreen(this.screenToRender(e,Z),t)}unprojectFromRenderScreen(e,t){if((0,N.lw)(W,this.projectionMatrix,this.viewMatrix),!(0,N.B8)(W,W))return null;const r=this.fullViewport;return j[0]=2*(e[0]-r[0])/r[2]-1,j[1]=2*(e[1]-r[1])/r[3]-1,j[2]=2*e[2]-1,j[3]=1,(0,L.t)(j,j,W),0===j[3]?null:(t[0]=j[0]/j[3],t[1]=j[1]/j[3],t[2]=j[2]/j[3],t)}constrainWindowSize(e,t,r,i){const n=e*this.pixelRatio,o=t*this.pixelRatio,a=Math.max(n-r/2,0),s=Math.max(this.fullHeight-o-i/2,0),l=-Math.min(n-r/2,0),c=-Math.min(this.fullHeight-o-i/2,0),d=r-l- -Math.min(this.fullWidth-n-r/2,0),u=i-c- -Math.min(o-i/2,0);return[Math.round(a),Math.round(s),Math.round(d),Math.round(u)]}computeUp(e){1===e?this._computeUpGlobal():this._computeUpLocal()}screenToRender(e,t){const r=e[0]*this.pixelRatio,i=this.fullHeight-e[1]*this.pixelRatio;return t[0]=r,t[1]=i,t}renderToScreen(e,t){const r=e[0]/this.pixelRatio,i=(this.fullHeight-e[1])/this.pixelRatio;t[0]=r,t[1]=i}_computeUpGlobal(){(0,E.e)(k,this.center,this.eye);const e=(0,E.b)(this.center);e<1?(0,E.q)(this._up,A.Cb)&&((0,E.d)(this._up,A.Cb),this._markViewDirty(),this.notifyChange("_up")):Math.abs((0,E.f)(k,this.center))>.9999*(0,E.b)(k)*e||((0,E.i)($,k,this.center),(0,E.i)($,$,k),(0,E.n)($,$),(0,E.q)(this._up,$)||((0,E.d)(this._up,$),this.notifyChange("_up"),this._markViewDirty()))}_computeUpLocal(){(0,E.E)(k,this.eye,this.center),Math.abs(k[2])<=.9999&&((0,E.h)(k,k,k[2]),(0,E.j)(k,-k[0],-k[1],1-k[2]),(0,E.n)(k,k),(0,E.q)(this._up,k)||((0,E.d)(this._up,k),this.notifyChange("_up"),this._markViewDirty()))}_compareAndSetView(e,t,r=""){"number"==typeof e[0]&&isFinite(e[0])&&"number"==typeof e[1]&&isFinite(e[1])&&"number"==typeof e[2]&&isFinite(e[2])?(0,E.q)(e,t)||((0,E.d)(t,e),this._markViewDirty(),r.length&&this.notifyChange(r)):u.A.getLogger("esri.views.3d.webgl-engine.lib.RenderCamera").warn("RenderCamera vector contains invalid number, ignoring value")}_markViewDirty(){this._viewDirty=!0,this._frustumDirty=!0,this._viewProjectionDirty=!0}_recomputeFrustum(){this._frustumDirty&&((0,B.ui)(this.viewMatrix,this.projectionMatrix,this._frustum),this._frustumDirty=!1)}_ensureViewClean(){this._viewDirty&&((0,N.t5)(this._viewMatrix,this.eye,this.center,this.up),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0)}};(0,o.Cg)([(0,d.MZ)()],V.prototype,"_viewport",void 0),(0,o.Cg)([(0,d.MZ)()],V.prototype,"_padding",void 0),(0,o.Cg)([(0,d.MZ)()],V.prototype,"_fov",void 0),(0,o.Cg)([(0,d.MZ)()],V.prototype,"_nearFar",void 0),(0,o.Cg)([(0,d.MZ)()],V.prototype,"_viewDirty",void 0),(0,o.Cg)([(0,d.MZ)()],V.prototype,"_viewMatrix",void 0),(0,o.Cg)([(0,d.MZ)()],V.prototype,"_pixelRatio",void 0),(0,o.Cg)([(0,d.MZ)()],V.prototype,"pixelRatio",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"row",void 0),(0,o.Cg)([(0,d.MZ)()],V.prototype,"column",void 0),(0,o.Cg)([(0,d.MZ)()],V.prototype,"_rows",void 0),(0,o.Cg)([(0,d.MZ)()],V.prototype,"rows",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"_columns",void 0),(0,o.Cg)([(0,d.MZ)()],V.prototype,"columns",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"eye",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"center",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"_center",void 0),(0,o.Cg)([(0,d.MZ)()],V.prototype,"up",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"_up",void 0),(0,o.Cg)([(0,d.MZ)()],V.prototype,"viewMatrix",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],V.prototype,"viewForward",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],V.prototype,"viewUp",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],V.prototype,"viewRight",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],V.prototype,"nearFar",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"near",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"far",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"viewport",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],V.prototype,"screenViewport",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],V.prototype,"screenPadding",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"x",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"y",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"width",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"height",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"fullWidth",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"fullHeight",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],V.prototype,"_aspect",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"padding",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],V.prototype,"projectionMatrix",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],V.prototype,"inverseProjectionMatrix",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"fov",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"fovX",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"fovY",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"viewInverseTransposeMatrix",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],V.prototype,"_projectionMatrixInternal",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"relativeElevation",void 0),V=C=(0,o.Cg)([(0,h.$)("esri.views.3d.webgl.RenderCamera")],V);const j=(0,z.vt)(),W=(0,S.vt)(),k=(0,A.vt)(),$=(0,A.vt)(),Z=(0,D.r_)();class q{constructor(e=1/0,t=-1/0){this.near=e,this.far=t}set(e,t){this.near=e,this.far=t}union(e){null!=e&&(this.near=Math.min(this.near,e.near),this.far=Math.max(this.far,e.far))}within(e){return this.near<=e&&e<=this.far}equals(e){return this.near===e.near&&this.far===e.far}static{this.Zero=new q(0,0)}static{this.Infinite=new q}}r(49718),r(6867),r(16396),(0,A.vt)(),(0,A.vt)(),(0,A.vt)(),new WeakMap;var Y=r(5443),X=r(39829),J=r(95108);function K(e,t,r,i){const n=function(e,t){const r=0===t||2===t?0:1,i=e[t],n=0===t||1===t?1:-1,o=0===r?1:0;return(e,t,a)=>{if(t[r]<i&&a[r]<i)return 1===n?0:1;if(t[r]>i&&a[r]>i)return 1===n?1:0;const s=(a[o]-t[o])/(a[r]-t[r]),l=t[o]+s*(i-t[r]);return e[r]=i,e[o]=l,(t[r]<i?1:-1)*n>0?2:3}}(r,i);if(e.length=0,t.length){1===n(ee,t[0],t[0])&&Q(e,t[0]);for(let r=0;r<t.length;r++){const i=t[r===t.length-1?0:r+1];switch(n(ee,t[r],i)){case 1:Q(e,i);break;case 3:Q(e,(0,H.o8)(ee));break;case 2:Q(e,(0,H.o8)(ee)),Q(e,i)}}}}function Q(e,t){0!==e.length&&(0,p.aI)(e.at(-1),t)||e.push(t)}const ee=(0,H.vt)();var te=r(11964),re=r(27921);const ie=(0,A.vt)(),ne=(0,A.vt)();function oe(){return{direction:(0,A.vt)(),up:(0,A.vt)()}}function ae(e,t,r,i,n){let o=(0,E.n)(ie,e),s=(0,E.f)(o,i);const l=s>0;s=Math.abs(s),s>.99&&(s=Math.abs((0,E.f)(t,i)),s<.99?((0,E.d)(o,t),l&&(0,E.h)(o,o,-1)):o=null);let c=0;if(o){(0,E.h)(ne,i,(0,E.f)(i,o)),(0,E.e)(o,o,ne);const e=(0,E.f)(o,n)/((0,E.b)(o)*(0,E.b)(n));(0,E.i)(ne,o,n),c=((0,E.f)(ne,i)>0?1:-1)*(0,a.KJ)((0,a.XM)(e))}const d=(0,a.KJ)((0,a.XM)(-(0,E.f)(i,e)/(0,E.b)(e)));return r?(r.heading=c,r.tilt=d,r):{heading:c,tilt:d}}function se(e,t,r,i){(0,E.e)(le,r,t),(0,re.T7)(i,(0,te.LV)(t,le),e)||e===r||(0,E.d)(e,r)}const le=(0,A.vt)(),ce=(0,A.fA)(0,1,0),de=(0,A.fA)(0,0,1),ue=(0,S.vt)(),he=(0,A.vt)(),pe=(0,A.vt)();function me(e,t,r,i=oe()){const{direction:n,up:o}=i;return(0,N.N9)(ue,-(0,a.kU)(t)),(0,N.eL)(ue,ue,(0,a.kU)(r)),(0,E.t)(n,de,ue),(0,E.h)(n,n,-1),(0,E.t)(o,ce,ue),i}function fe(e,t,r,i,n){const o=t.lines[11].direction,a=(n-r.getAltitude(i))/o[2];(0,E.c)(e,i,o,a)}const ge=(0,A.vt)();Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:function(e,t,r,i){return ae(t,r,i,de,ce)},eyeForCenterWithHeadingTilt:function(e,t,r,i){const n=me(0,r,i),o=(0,A.vt)();return(0,E.h)(o,n.direction,-t),(0,E.g)(o,o,e),{up:n.up,eye:o,heading:r,tilt:i}},eyeTiltToLookAtTilt:function(e){return(0,a.kU)(e)},headingTiltToDirectionUp:me,lookAtTiltToEyeTilt:function(e){return(0,a.KJ)(e)},toArea:function(e,t){const r=e.frustum,{renderCoordsHelper:i}=e,n=i.getAltitude(t),o=e.spatialReference,a=e.state.camera.eye,s=[],l=r.planes[5];for(let e=0;e<4;e++){const t=r.lines[e];i.intersectInfiniteManifold((0,G.LV)(t.origin,t.direction),n,ge)||fe(ge,r,i,t.endpoint,n),se(ge,a,ge,l),s.push((0,H.fA)(ge[0],ge[1]))}return function(e,t,r){const i=e.map(e=>((0,E.j)(ge,e[0],e[1],0),t.fromRenderCoords(ge,ge,r),[ge[0],ge[1]]));return i.length<=2?new X.A({spatialReference:r}):(i.push(i[0].slice()),(0,J.$3)(i)||i.reverse(),new X.A({rings:[i],spatialReference:r}))}(function(e,t){const r=[],i=[];return K(r,e,t,0),K(i,r,t,1),K(r,i,t,2),K(i,r,t,3),i}(s,i.extent),i,o)},toExtent:function(e,t,r,i,n){const o=e.renderSpatialReference,a=e.spatialReference??t.spatialReference;return(0,I.g)(t,he,o),(0,I.g)(t,pe,o),he[0]-=r/2,pe[0]+=r/2,he[1]-=i/2,pe[1]+=i/2,(0,F.F)(he,o,he,a),(0,F.F)(pe,o,pe,a),n?(n.xmin=he[0],n.ymin=he[1],n.xmax=pe[0],n.ymax=pe[1],n.spatialReference=a):n=new Y.A(he[0],he[1],pe[0],pe[1],a),n}},Symbol.toStringTag,{value:"Module"}));var ve=r(34304),_e=r(17136),xe=r(97937),we=r(28735);class ye{get planes(){return this.frustum}get points(){return this._points}get mutablePoints(){return this._points}get direction(){return this._direction}get origin(){return this._origin}constructor(e){this.renderCoordsHelper=e,this.frustum=(0,B.vt)(),this._points=(0,B.Qy)(),this.lines=new Array(12),this._origin=(0,A.vt)(),this._direction=(0,A.vt)(),this._altitude=null;for(let e=0;e<12;e++)this.lines[e]={origin:null,direction:(0,A.vt)(),endpoint:null}}update(e){(0,B.ui)(e.viewMatrix,e.projectionMatrix,this.frustum,this._points),(0,E.d)(this._origin,e.eye),(0,E.d)(this._direction,e.viewForward),this._altitude=this.renderCoordsHelper.getAltitude(this._origin),this._updateLines()}updatePoints(e){for(let t=0;t<this._points.length;t++)(0,E.d)(this._points[t],e[t]);(0,B.DV)(this.frustum,this._points),this._updateLines()}get altitude(){return this._altitude}intersectsSphere(e){return(0,B.m7)(this.frustum,e)}intersectsRay(e){return(0,B.pw)(this.frustum,e)}intersectsLineSegment(e,t){return(0,B.ST)(this.frustum,e,t)}intersectsPoint(e){return(0,B.bU)(this.frustum,e)}_updateLines(){const e=this._points;for(let t=0;t<4;t++){const r=t+4;be(this.lines[t],e[t],e[r]),be(this.lines[t+4],e[t],3===t?e[0]:e[t+1]),be(this.lines[t+8],e[r],3===t?e[4]:e[r+1])}}static{this.planePointIndices=B.c8}static{this.nearFarLineIndices=[[0,4],[1,5],[2,6],[3,7]]}}function be(e,t,r){e.origin=t,e.endpoint=r,(0,E.E)(e.direction,t,r)}r(83047);const Me=(0,A.fA)(parseFloat(Number(5802e-9).toFixed(6)),parseFloat(Number(13558e-9).toFixed(6)),parseFloat(Number(331e-7).toFixed(6))),Te=(0,A.fA)(3*parseFloat(Number(65e-8).toFixed(6)),3*parseFloat(Number(1881e-9).toFixed(6)),3*parseFloat(Number(85e-9).toFixed(6)));(0,A.fA)(parseFloat(Number(Me[0]+Te[0]).toFixed(6)),parseFloat(Number(Me[1]+Te[1]).toFixed(6)),parseFloat(Number(Me[2]+Te[2]).toFixed(6)));(0,A.vt)(),(0,A.vt)(),(0,xe.c)(),(0,G.vt)();const Ce=(0,A.vt)(),Se=(0,A.vt)();var Ee=r(32728);const Ae=(0,A.fA)(0,0,1),Re=(0,E.n)((0,A.vt)(),(0,A.fA)(1,1,1)),Ie=(0,S.vt)(),Fe=(0,A.vt)(),Oe=(0,A.vt)();function Pe(e,t,r,i=oe()){(0,E.i)(Fe,e,Ae),0===(0,E.f)(Fe,Fe)&&(0,E.i)(Fe,e,Re),(0,N.$0)(Ie,-(0,a.kU)(t),e),(0,N.e$)(Ie,Ie,-(0,a.kU)(r),Fe);const{up:n,direction:o}=i;return(0,E.i)(n,Fe,e),(0,E.n)(n,n),(0,E.t)(n,n,Ie),(0,E.n)(o,e),(0,E.u)(o,o),(0,E.t)(o,o,Ie),i}function De(e){const t=e[1];e[1]=-e[2],e[2]=t}function Ne(e,t){const r=Pe(t,e.heading,e.tilt);return e.up=r.up,e}function He(e,t){const r=[],i=[],n=(0,ve.FD)();for(let o=0;o<e.length;o++){const a=e[o],s=o===e.length-1?e[0]:e[o+1],l=(0,te.Cr)(a,s,We),c=(0,re.vE)(t,l.origin,l.vector,0,Ve);switch(c){case 2:r.push(a);break;case 3:i.push(a);break;case 0:case 1:{const[e,o,s]=0===c?[1,r,i]:[-1,i,r],l=(0,re.Qj)(t),d=(0,E.c)((0,A.vt)(),Ve,l,e*n),u=(0,E.c)((0,A.vt)(),Ve,l,e*-n);o.push(a),o.push(d),s.push(u)}}}const o=[];return r.length&&o.push(r),i.length&&o.push(i),o}const Le={minCurvature:(0,a.kU)(5),maxCurvature:(0,a.kU)(50),minSamples:1,maxSamples:6},ze=(0,A.fA)(1,0,0),Be=(0,A.fA)(0,1,0),Ge=(0,A.vt)(),Ue=(0,A.vt)(),Ve=(0,A.vt)(),je=(0,xe.c)(),We=(0,te.vt)(),ke=(0,z.vt)();Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:function(e,t,r,i){const n=Fe,o=Oe;return(0,E.n)(n,e),(0,E.i)(Oe,n,Ae),0===(0,E.f)(Oe,Oe)&&(0,E.i)(Oe,n,Re),(0,E.i)(o,Oe,n),ae(t,r,i,n,o)},eyeForCenterWithHeadingTilt:function(e,t,r,i){const n={eye:(0,A.vt)(),up:null,tilt:i,heading:r},o=Fe;o[0]=e[0],o[1]=e[2],o[2]=-e[1];const s=t,l=(0,a.kU)(r),c=(0,a.kU)(i),d=Math.sin(l),u=Math.cos(l),h=Math.sin(c),p=Math.cos(c),m=(0,E.b)(o);let f;if(Math.abs(c)<1e-8)f=s+m;else{const e=m/h,t=(0,a.YN)(s/e),r=Math.PI-c-t;f=e*Math.sin(r)}const g=p*s,v=s*s*(h*h),_=u*u*v,x=f-g,w=x*x,y=_*(_+w-o[1]*o[1]);if(y<0)return(0,E.h)(n.eye,o,f/m),n.tilt=0,Ne(n,e);const b=Math.sqrt(y),M=o[1]*x,T=_+w;let C;if(C=u>0?-b+M:b+M,Math.abs(T)<1e-8)return m<1e-8?(n.eye[0]=0,n.eye[1]=0,n.eye[2]=s):(0,E.h)(n.eye,o,f/m),n.tilt=0,De(n.eye),Ne(n,e);n.eye[1]=C/T;const S=d*d*v,R=h*s,I=u*R*n.eye[1],F=n.eye[1]*n.eye[1],O=1-F,P=Math.sqrt(O),D=_*F+S-2*I*P*x+O*w;return Math.abs(D)<1e-8?((0,E.h)(n.eye,o,f/m),n.tilt=0,De(n.eye),Ne(n,e)):(n.eye[0]=(O*(f*o[0]-g*o[0])-R*P*(o[0]*n.eye[1]*u+o[2]*d))/D,n.eye[2]=(O*(f*o[2]-g*o[2])-R*P*(o[2]*n.eye[1]*u-o[0]*d))/D,(0,E.h)(n.eye,n.eye,f),De(n.eye),Ne(n,e))},eyeTiltToLookAtTilt:function(e,t,r){const i=(0,a.kU)(e),n=(0,E.b)(t);return(0,a.YN)(r/(n/Math.sin(i)))+i},headingTiltToDirectionUp:Pe,lookAtTiltToEyeTilt:function(e,t,r){const i=(0,E.b)(t),n=Math.sqrt(r*r+i*i-2*r*i*Math.cos(Math.PI-e)),o=(0,a.YN)(r/(n/Math.sin(e)));return(0,a.KJ)(e-o)},toArea:function(e,t){const{renderCoordsHelper:r}=e,i=e.state.camera.clone(),n=new ye(r);i.near=2,n.update(i);const o=r.getAltitude(t),s=e.spatialReference,l=r.referenceEllipsoid.radius,c=i.eye,d=1+(0,E.k)(c,t)/(l+o),u=Math.sqrt(d*d-1),{minCurvature:h,maxCurvature:p,minSamples:m,maxSamples:f}=Le,g=function(e){const{renderCoordsHelper:t,state:{camera:r}}=e,{center:i,eye:n}=r,o=Math.abs(t.getAltitude(i)),s=Math.abs(Math.PI/2-function(e,t,r){e.worldUpAtPosition(t,Ce),(0,E.e)(Se,r,t);const i=(0,E.b)(Se);return 0===i?0:(0,a.XM)((0,E.f)(Se,Ce)/i)}(t,i,n));return(0,xe.b)(je,t.referenceEllipsoid.radius+o),(0,xe.d)(je,s,r.distance,r.fovY)}(e),v=(0,a.qE)((u-h)/(p-h),0,1),_=Math.round((0,a.Cc)(m,f,v)),x=i.aboveGround,w=n.planes[5],y=[],b=(0,re.O_)(A.uY,ze,(0,re.vt)()),M=(0,re.O_)(A.uY,Be,(0,re.vt)());(0,L.s)(ke,0,0,0,0);const T=e=>{};for(let e=0;e<4;e++){const t=1===e&&!x||3===e&&x?1-g:0,i=1===e&&x||3===e&&!x?g:1,s=n.lines[e],l=n.lines[3===e?0:e+1];for(let n=0;n<_;n++){const d=n/_,u=0===n?0:(0,a.Cc)(t,i,1===e?1-(1-d)**2:3===e?d**2:d),h=(0,E.l)(Ue,s.origin,l.origin,u),p=(0,Ee.nu)(s.direction,l.direction,u,Ge);r.intersectManifoldClosestSilhouette((0,G.LV)(h,p),o,Ve),se(Ve,c,Ve,w),y.push((0,A.o8)(Ve)),0!==y.length&&T((0,E.x)(y.at(-1),Ve));const m=((0,re.Tj)(b,Ve)?1:0)|((0,re.Tj)(M,Ve)?2:0);ke[m]=1}}y.length>2&&(0,E.x)(y[0],y.at(-1));const C=function(e,t,r){const i=2*(0,ve.FD)();return e.map(e=>{const n=[];let o=!1;for(const a of e)t.fromRenderCoords(a,Ve,r),Math.abs(a[0])<i&&Math.abs(a[1])<i?(n.push([null,Ve[1]]),n.push([null,Ve[1]]),o=!0):n.push([Ve[0],Ve[1]]);if(o)for(let e=0;e<n.length;e++){const t=n[e];if(null!=t[0])continue;const r=n[e+1],i=n.at(0===e?-1:e-1);t[0]=i[0],e++;const o=n.at(e===n.length-1?0:e+1);r[0]=o[0]}return n.push(n[0]),(0,J.$3)(n)||n.reverse(),n})}((0,L.b)(ke)>1?function(e,t){const r=[];for(const i of e)r.push(...He(i,t));return r}(He(y,b),M):[y],r,s);return new X.A({rings:C,spatialReference:s})},toExtent:function(e,t,r,i,n){let o,s,l,c;const d=t.latitude,u=(0,O.tO)(e.spatialReference).radius,h=t.longitude,p=function(e,t,r){const i=t/r,n=(0,a.kU)(e),o=Math.sin(i/2),s=Math.cos(n),l=2*(0,a.YN)(Math.sqrt(o*o/(s*s)));return(0,a.KJ)(l)}(d,r,u)/2;o=h-p,s=h+p;const m=(0,a.kU)(d),f=(1+Math.sin(m))/(1-Math.sin(m)),g=(f+1)*Math.tan(i/u/2),_=g*g;function x(e){const t=Math.PI/2;return(e=v.uC.normalize(e,-t))>t&&(e=Math.PI-e),e}if(l=1.5*Math.PI-2*Math.atan(.5*(g+Math.sqrt(4*f+_))),c=l+i/u,l=x(l),c=x(c),c<l){const e=c;c=l,l=e}if(l=Math.max((0,a.KJ)(l),-90),c=Math.min((0,a.KJ)(c),90),s=_e.Y_.monotonic(o,s),s-o>180){const e=(s-o-180)/2;o+=e,s-=e}const w=e.spatialReference&&e.spatialReference.isGeographic?e.spatialReference:R.A.WGS84;return n?(n.xmin=o,n.ymin=l,n.xmax=s,n.ymax=c,n.spatialReference=w):n=new Y.A(o,l,s,c,w),e.spatialReference&&e.spatialReference.isWebMercator&&(0,we.Gh)(n,!1,n),n}},Symbol.toStringTag,{value:"Module"}));const $e="ssao";(0,A.vt)();var Ze=r(49186);let qe=class extends P.A{constructor(e){super(e),this.view=null,this.consumes={required:[]},this.produces="composite-color",this.requireGeometryDepth=!1,this._dirty=!0}initialize(){this.addHandles([(0,l.wB)(()=>this.view.ready,e=>{e&&this.view.stage?.renderer.addRenderNode(this)},l.Vh)])}destroy(){this.view.stage?.renderer?.removeRenderNode(this)}precompile(){}render(){throw new Ze.A("RenderNode:render-function-not-implemented","render() is not implemented.")}get camera(){return this.view.state.camera.clone()}get sunLight(){return this.bindParameters.lighting.legacy}get gl(){return this.view.stage.renderView.renderingContext.gl}get techniques(){return this.view.stage.renderView.techniques}acquireOutputFramebuffer(){const e=this._frameBuffer?.getTexture()?.descriptor,t=this.view.stage.renderer.fboCache.acquire(e?.width??640,e?.height??480,this.produces);return t.fbo?.initializeAndBind(),t}bindRenderTarget(){return this._frameBuffer?.fbo?.initializeAndBind(),this._frameBuffer}requestRender(e){switch(e){case 2:this.view.state.fading=!0;case 1:this.view.stage?.renderView.requestRender(e);case 0:case void 0:this._dirty=!0}}resetWebGLState(){this.renderingContext.resetState(),this.renderingContext.bindFramebuffer(this._frameBuffer?.fbo)}get fboCache(){return this.view.stage.renderer.fboCache}get bindParameters(){return this.renderContext.bind}get renderingContext(){return this.view.stage.renderView.renderingContext}get renderContext(){return this.view.stage?.renderer.renderContext}updateAnimation(e){return!!this._dirty&&(this._dirty=!1,!0)}doRender(e){this._frameBuffer=e.find(({name:e})=>e===this.produces);try{return this.render(e)}finally{this._frameBuffer=null}}};(0,o.Cg)([(0,d.MZ)({constructOnly:!0})],qe.prototype,"view",void 0),(0,o.Cg)([(0,d.MZ)({constructOnly:!0})],qe.prototype,"consumes",void 0),(0,o.Cg)([(0,d.MZ)()],qe.prototype,"produces",void 0),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],qe.prototype,"techniques",null),qe=(0,o.Cg)([(0,h.$)("esri.views.3d.webgl.RenderNode")],qe);var Ye=r(97220),Xe=r(98958),Je=r(63907),Ke=r(85079),Qe=r(74038);const et=[new Qe._("position",3,Je.pe.FLOAT,0,12)],tt=[new Qe._("position",2,Je.pe.FLOAT,0,8)],rt=(0,Ke.Xk)(tt);(0,Ke.Xk)(et),new Qe._("position",2,Je.pe.FLOAT,0,12),new Qe._("uv0",2,Je.pe.HALF_FLOAT,8,12),new Qe._("position",2,Je.pe.FLOAT,0,16),new Qe._("uv0",2,Je.pe.FLOAT,8,16);var it=r(95774),nt=r(90644);class ot extends Xe.w{constructor(e,t){super(e,t,new Ye.$(it.S,()=>r.e(9384).then(r.bind(r,59384))),rt)}initializePipeline(){return(0,nt.Ey)({colorWrite:nt.kn})}}var at=r(65786);class st extends at.Y{constructor(){super(...arguments),this.projScale=1}}class lt extends st{constructor(){super(...arguments),this.intensity=1}}class ct extends at.Y{}class dt extends ct{constructor(){super(...arguments),this.blurSize=(0,H.vt)()}}var ut=r(15581);class ht extends Xe.w{constructor(e,t){super(e,t,new Ye.$(ut.S,()=>r.e(191).then(r.bind(r,90191))),rt)}initializePipeline(){return(0,nt.Ey)({colorWrite:nt.kn})}}var pt=r(76284),mt=r(67171);const ft=2;let gt=class extends qe{constructor(e){super(e),this.consumes={required:["normals"]},this.produces=$e,this.isEnabled=()=>!1,this._enableTime=(0,c.l5)(0),this._passParameters=new lt,this._drawParameters=new dt}initialize(){const e=Uint8Array.from(atob("eXKEvZaUc66cjIKElE1jlJ6MjJ6Ufkl+jn2fcXp5jBx7c6KEflSGiXuXeW6OWs+tfqZ2Yot2Y7Zzfo2BhniEj3xoiXuXj4eGZpqEaHKDWjSMe7palFlzc3BziYOGlFVzg6Zzg7CUY5JrjFF7eYJ4jIKEcyyEonSXe7qUfqZ7j3xofqZ2c4R5lFZ5Y0WUbppoe1l2cIh2ezyUho+BcHN2cG6DbpqJhqp2e1GcezhrdldzjFGUcyxjc3aRjDyEc1h7Sl17c6aMjH92pb6Mjpd4dnqBjMOEhqZleIOBYzB7gYx+fnqGjJuEkWlwnCx7fGl+c4hjfGyRe5qMlNOMfnqGhIWHc6OMi4GDc6aMfqZuc6aMzqJzlKZ+lJ6Me3qRfoFue0WUhoR5UraEa6qMkXiPjMOMlJOGe7JrUqKMjK6MeYRzdod+Sl17boiPc6qEeYBlcIh2c1WEe7GDiWCDa0WMjEmMdod+Y0WcdntzhmN8WjyMjKJjiXtzgYxYaGd+a89zlEV7e2GJfnd+lF1rcK5zc4p5cHuBhL6EcXp5eYB7fnh8iX6HjIKEeaxuiYOGc66RfG2Ja5hzjlGMjEmMe9OEgXuPfHyGhPeEdl6JY02McGuMfnqGhFiMa3WJfnx2l4hwcG1uhmN8c0WMc39og1GBbrCEjE2EZY+JcIh2cIuGhIWHe0mEhIVrc09+gY5+eYBlnCyMhGCDl3drfmmMgX15aGd+gYx+fnuRfnhzY1SMsluJfnd+hm98WtNrcIuGh4SEj0qPdkqOjFF7jNNjdnqBgaqUjMt7boeBhnZ4jDR7c5pze4GGjEFrhLqMjHyMc0mUhKZze4WEa117kWlwbpqJjHZ2eX2Bc09zeId+e0V7WlF7jHJ2l72BfId8l3eBgXyBe897jGl7c66cgW+Xc76EjKNbgaSEjGx4fId8jFFjgZB8cG6DhlFziZhrcIh2fH6HgUqBgXiPY8dahGFzjEmMhEFre2dxhoBzc5SGfleGe6alc7aUeYBlhKqUdlp+cH5za4OEczxza0Gcc4J2jHZ5iXuXjH2Jh5yRjH2JcFx+hImBjH+MpddCl3dreZeJjIt8ZW18bm1zjoSEeIOBlF9oh3N7hlqBY4+UeYFwhLJjeYFwaGd+gUqBYxiEYot2fqZ2ondzhL6EYyiEY02Ea0VjgZB8doaGjHxoc66cjEGEiXuXiXWMiZhreHx8frGMe75rY02Ec5pzfnhzlEp4a3VzjM+EhFFza3mUY7Zza1V5e2iMfGyRcziEhDyEkXZ2Y4OBnCx7g5t2eyBjgV6EhEFrcIh2dod+c4Z+nJ5zjm15jEmUeYxijJp7nL6clIpjhoR5WrZraGd+fnuRa6pzlIiMg6ZzfHx5foh+eX1ufnB5eX1ufnB5aJt7UqKMjIh+e3aBfm5lbYSBhGFze6J4c39oc0mUc4Z+e0V7fKFVe0WEdoaGY02Ec4Z+Y02EZYWBfH6HgU1+gY5+hIWUgW+XjJ57ebWRhFVScHuBfJ6PhBx7WqJzlM+Ujpd4gHZziX6HjHmEgZN+lJt5boiPe2GJgX+GjIGJgHZzeaxufnB5hF2JtdN7jJ57hp57hK6ElFVzg6ZzbmiEbndzhIWHe3uJfoFue3qRhJd2j3xoc65zlE1jc3p8lE1jhniEgXJ7e657vZaUc3qBh52BhIF4aHKDa9drgY5+c52GWqZzbpqJe8tjnM+UhIeMfo2BfGl+hG1zSmmMjKJjZVaGgX15c1lze0mEp4OHa3mUhIWHhDyclJ6MeYOJkXiPc0VzhFiMlKaEboSJa5Jze41re3qRhn+HZYWBe0mEc4p5fnORbox5lEp4hGFjhGGEjJuEc1WEhLZjeHeGa7KlfHx2hLaMeX1ugY5+hIWHhKGPjMN7c1WEho1zhoBzZYx7fnhzlJt5exyUhFFziXtzfmmMa6qMYyiEiXxweV12kZSMeWqXSl17fnhzxmmMrVGEe1mcc4p5eHeGjK6MgY5+doaGa6pzlGV7g1qBh4KHkXiPeW6OaKqafqZ2eXZ5e1V7jGd7boSJc3BzhJd2e0mcYot2h1RoY8dahK6EQmWEWjx7e1l2lL6UgXyBdnR4eU9zc0VreX1umqaBhld7fo2Bc6KEc5Z+hDyEcIeBWtNrfHyGe5qMhMuMe5qMhEGEbVVupcNzg3aHhIF4boeBe0mEdlptc39ofFl5Y8uUlJOGiYt2UmGEcyxjjGx4jFF7a657ZYWBnElzhp57iXtrgZN+tfOEhIOBjE2HgU1+e8tjjKNbiWCDhE15gUqBgYN7fnqGc66ce9d7iYSBj0qPcG6DnGGcT3eGa6qMZY+JlIiMl4hwc3aRdnqBlGV7eHJ2hLZjfnuRhDyEeX6MSk17g6Z+c6aUjHmEhIF4gXyBc76EZW18fGl+fkl+jCxrhoVwhDyUhIqGlL2DlI6EhJd2tdN7eYORhEGMa2Faa6pzc3Bzc4R5lIRznM+UY9eMhDycc5Z+c4p5c4iGY117pb6MgXuPrbJafnx2eYOJeXZ5e657hDyEcziElKZjfoB5eHeGj4WRhGGEe6KGeX1utTStc76EhFGJnCyMa5hzfH6HnNeceYB7hmN8gYuMhIVrczSMgYF8h3N7c5pza5hzjJqEYIRdgYuMlL2DeYRzhGGEeX1uhLaEc4iGeZ1zdl6JhrVteX6Me2iMfm5lWqJzSpqEa6pzdnmchHx2c6OMhNdrhoR5g3aHczxzeW52gV6Ejm15frGMc0Vzc4Z+l3drfniJe+9rWq5rlF1rhGGEhoVwe9OEfoh+e7pac09+c3qBY0lrhDycdnp2lJ6MiYOGhGCDc3aRlL2DlJt5doaGdnp2gYF8gWeOjF2Uc4R5c5Z+jEmMe7KEc4mEeYJ4dmyBe0mcgXiPbqJ7eYB7fmGGiYSJjICGlF1reZ2PnElzbpqJfH6Hc39oe4WEc5eJhK6EhqyJc3qBgZB8c09+hEmEaHKDhFGJc5SGiXWMUpaEa89zc6OMnCyMiXtrho+Be5qMc7KEjJ57dmN+hKGPjICGbmiEe7prdod+hGCDdnmchBx7eX6MkXZ2hGGEa657hm98jFFjY5JreYOJgY2EjHZ2a295Y3FajJ6Mc1J+YzB7e4WBjF2Uc4R5eV12gYxzg1qBeId+c9OUc5pzjFFjgY5+hFiMlIaPhoR5lIpjjIKBlNdSe7KEeX2BfrGMhIqGc65zjE2UhK6EklZ+QmWEeziMWqZza3VzdnR4foh+gYF8n3iJiZhrnKp7gYF8eId+lJ6Me1lrcIuGjKJjhmN8c66MjFF7a6prjJ6UnJ5zezyUfruRWlF7nI5zfHyGe657h4SEe8tjhBx7jFFjc09+c39ojICMeZeJeXt+YzRzjHZ2c0WEcIeBeXZ5onSXkVR+gYJ+eYFwdldzgYF7eX2BjJ6UiXuXlE1jh4SEe1mchLJjc4Z+hqZ7eXZ5bm1zlL6Ue5p7iWeGhKqUY5pzjKJjcIeBe8t7gXyBYIRdlEp4a3mGnK6EfmmMZpqEfFl5gYxzjKZuhGFjhoKGhHx2fnx2eXuMe3aBiWeGvbKMe6KGa5hzYzB7gZOBlGV7hmN8hqZlYot2Y117a6pzc6KEfId8foB5rctrfneJfJ6PcHN2hFiMc5pzjH92c0VzgY2EcElzdmCBlFVzg1GBc65zY4OBboeBcHiBeYJ4ewxzfHx5lIRzlEmEnLKEbk1zfJ6PhmN8eYBljBiEnMOEiXxwezyUcIeBe76EdsKEeX2BdnR4jGWUrXWMjGd7fkl+j4WRlEGMa5Jzho+BhDyEfnqMeXt+g3aHlE1jczClhNN7ZW18eHx8hGFjZW18iXWMjKJjhH57gYuMcIuGWjyMe4ZtjJuExmmMj4WRdntzi4GDhFFzYIRdnGGcjJp7Y0F7e4WEkbCGiX57fnSHa657a6prhBCMe3Z+SmmMjH92eHJ2hK6EY1FzexhrvbKMnI5za4OEfnd+eXuMhImBe897hLaMjN+EfG+BeIOBhF1+eZeJi4GDkXZ2eXKEgZ6Ejpd4c2GHa1V5e5KUfqZuhCx7jKp7lLZrg11+hHx2hFWUoot2nI5zgbh5mo9zvZaUe3qRbqKMfqZ2kbCGhFiM"),e=>e.charCodeAt(0)),t=new mt.R(32);t.wrapMode=33071,t.pixelFormat=6407,t.wrapMode=10497,t.hasMipmap=!0,this._passParameters.noiseTexture=new pt.g(this.renderingContext,t,e),this.techniques.precompile(ht),this.techniques.precompile(ot),this.addHandles((0,l.wB)(()=>this.isEnabled(),()=>this._enableTime=(0,c.l5)(0)))}destroy(){this._passParameters.noiseTexture=(0,s.WD)(this._passParameters.noiseTexture)}render(e){const t=e.find(({name:e})=>"normals"===e),r=t?.getTexture(),i=t?.getTexture(Je.nI);if(!r||!i)return;const n=this.techniques.get(ht),o=this.techniques.get(ot);if(!n.compiled||!o.compiled)return this._enableTime=(0,c.l5)(performance.now()),void this.requestRender(1);0===this._enableTime&&(this._enableTime=(0,c.l5)(performance.now()));const s=this.renderingContext,l=this.view.qualitySettings.fadeDuration,d=this.bindParameters,u=d.camera,h=u.relativeElevation,m=(0,a.qE)((5e5-h)/2e5,0,1),f=l>0?Math.min(l,performance.now()-this._enableTime)/l:1,g=f*m;this._passParameters.normalTexture=r,this._passParameters.depthTexture=i,this._passParameters.projScale=1/u.computeScreenPixelSizeAtDist(1),this._passParameters.intensity=4*vt/(0,ut.g)(u)**6*g;const v=u.fullViewport[2],_=u.fullViewport[3],x=this.fboCache.acquire(v,_,"ssao input",2);s.bindFramebuffer(x.fbo),s.setViewport(0,0,v,_),s.bindTechnique(n,d,this._passParameters,this._drawParameters),s.screen.draw();const w=Math.round(v/ft),y=Math.round(_/ft),b=this.fboCache.acquire(w,y,"ssao blur",0);s.bindFramebuffer(b.fbo),this._drawParameters.colorTexture=x.getTexture(),(0,p.hZ)(this._drawParameters.blurSize,0,ft/_),s.bindTechnique(o,d,this._passParameters,this._drawParameters),s.setViewport(0,0,w,y),s.screen.draw(),x.release();const M=this.fboCache.acquire(w,y,$e,0);return s.bindFramebuffer(M.fbo),s.setViewport(0,0,v,_),s.setClearColor(1,1,1,0),s.clear(16384),this._drawParameters.colorTexture=b.getTexture(),(0,p.hZ)(this._drawParameters.blurSize,ft/v,0),s.bindTechnique(o,d,this._passParameters,this._drawParameters),s.setViewport(0,0,w,y),s.screen.draw(),s.setViewport4fv(u.fullViewport),b.release(),f<1&&this.requestRender(2),M}};(0,o.Cg)([(0,d.MZ)()],gt.prototype,"consumes",void 0),(0,o.Cg)([(0,d.MZ)()],gt.prototype,"produces",void 0),(0,o.Cg)([(0,d.MZ)({constructOnly:!0})],gt.prototype,"isEnabled",void 0),gt=(0,o.Cg)([(0,h.$)("esri.views.3d.webgl-engine.effects.ssao.SSAO")],gt);const vt=.5;function _t(e,t){t.receiveAmbientOcclusion?(e.uniforms.add(new n.x("ssaoTex",e=>e.ssao?.getTexture())),e.constants.add("blurSizePixelsInverse","float",1/ft),e.code.add(i.H`float evaluateAmbientOcclusionInverse() {
709
- vec2 ssaoTextureSizeInverse = 1.0 / vec2(textureSize(ssaoTex, 0));
710
- return texture(ssaoTex, gl_FragCoord.xy * blurSizePixelsInverse * ssaoTextureSizeInverse).r;
711
- }
712
- float evaluateAmbientOcclusion() {
713
- return 1.0 - evaluateAmbientOcclusionInverse();
714
- }`)):e.code.add(i.H`float evaluateAmbientOcclusionInverse() { return 1.0; }
715
- float evaluateAmbientOcclusion() { return 0.0; }`)}},67171:(e,t,r)=>{r.d(t,{R:()=>o,e:()=>a});var i=r(63907),n=r(42293);class o{constructor(e=0,t=e){this.width=e,this.height=t,this.type=0,this.target=3553,this.pixelFormat=6408,this.dataType=i.ld.UNSIGNED_BYTE,this.samplingMode=9729,this.wrapMode=10497,this.maxAnisotropy=1,this.flipped=!1,this.hasMipmap=!1,this.isOpaque=!1,this.unpackAlignment=4,this.preMultiplyAlpha=!1,this.compareEnabled=!1,this.linearFilterDepth=!1,this.depth=1,this.isImmutable=!1}}function a(e){return e.width<=0||e.height<=0||e.depth<=0?0:Math.round(e.width*e.height*e.depth*(e.hasMipmap?4/3:1)*(null==e.internalFormat?4:(0,n.MW)(e.internalFormat))*(34067===e.target?6:1))}},68259:(e,t,r)=>{r.d(t,{t:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"vec2",2,(i,n,o,a)=>i.setUniform2fv(e,t(n,o,a),r))}}},71955:(e,t,r)=>{r.d(t,{K:()=>l});var i=r(43519),n=r(31821),o=r(74333);class a extends o.n{constructor(e,t){super(e,"int",1,(r,i,n)=>r.setUniform1i(e,t(i,n)))}}var s=r(43616);function l(e,t){e.varyings.add("colorMixMode","int"),e.varyings.add("opacityMixMode","int"),e.vertex.uniforms.add(new a("symbolColorMixMode",e=>s.Um[e.colorMixMode])),t.hasSymbolColors?(e.vertex.include(i.WD),e.vertex.include(i.Y1),e.vertex.include(i.ML),e.attributes.add("symbolColor","vec4"),e.vertex.code.add(n.H`
715
+ }`)}},63907:(e,t,r)=>{r.d(t,{$0:()=>u,CQ:()=>g,Fq:()=>m,H0:()=>o,SB:()=>l,WR:()=>i,XN:()=>a,iE:()=>s,ld:()=>c,nI:()=>f,pe:()=>n,r6:()=>h,vt:()=>d,yI:()=>p});const i={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},n={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,HALF_FLOAT:5131},o={RGBA4:32854,R16F:33325,RG16F:33327,RGB32F:34837,RGBA16F:34842,R32F:33326,RG32F:33328,RGBA32F:34836,R11F_G11F_B10F:35898,RGB8:32849,RGBA8:32856,RGB5_A1:32855,R8:33321,RG8:33323,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,RGB16F:34843,RGB9_E5:35901,SRGB8:35905,SRGB8_ALPHA8:35907,RGB565:36194,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,RGB10_A2:32857,RGB10_A2UI:36975},a=Object.values(o),s={DEPTH24_STENCIL8:35056,DEPTH32F_STENCIL8:36013},l={DEPTH_COMPONENT16:33189,DEPTH_COMPONENT24:33190,DEPTH_COMPONENT32F:36012},c={FLOAT:n.FLOAT,UNSIGNED_BYTE:n.UNSIGNED_BYTE,UNSIGNED_INT_24_8:34042,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,BYTE:n.BYTE,UNSIGNED_SHORT:n.UNSIGNED_SHORT,SHORT:n.SHORT,UNSIGNED_INT:n.UNSIGNED_INT,INT:n.INT,HALF_FLOAT:5131,UNSIGNED_INT_2_10_10_10_REV:33640,UNSIGNED_INT_10F_11F_11F_REV:35899,UNSIGNED_INT_5_9_9_9_REV:35902,FLOAT_32_UNSIGNED_INT_24_8_REV:36269},d={Texture:0,TileTexture:1,BufferObject:2,VertexArrayObject:3,Shader:4,Program:5,FramebufferObject:6,Renderbuffer:7,TransformFeedback:8,Sync:9,UNCOUNTED:10,LinesOfCode:10,Uniform:11,COUNT:12},u=0,h=36064,p=36065,m=36066,f=33306,g={COMPRESSED_RGB_S3TC_DXT1_EXT:33776,COMPRESSED_RGBA_S3TC_DXT1_EXT:33777,COMPRESSED_RGBA_S3TC_DXT3_EXT:33778,COMPRESSED_RGBA_S3TC_DXT5_EXT:33779,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497}},67171:(e,t,r)=>{r.d(t,{R:()=>o,e:()=>a});var i=r(63907),n=r(42293);class o{constructor(e=0,t=e){this.width=e,this.height=t,this.type=0,this.target=3553,this.pixelFormat=6408,this.dataType=i.ld.UNSIGNED_BYTE,this.samplingMode=9729,this.wrapMode=10497,this.maxAnisotropy=1,this.flipped=!1,this.hasMipmap=!1,this.isOpaque=!1,this.unpackAlignment=4,this.preMultiplyAlpha=!1,this.compareEnabled=!1,this.linearFilterDepth=!1,this.depth=1,this.isImmutable=!1}}function a(e){return e.width<=0||e.height<=0||e.depth<=0?0:Math.round(e.width*e.height*e.depth*(e.hasMipmap?4/3:1)*(null==e.internalFormat?4:(0,n.MW)(e.internalFormat))*(34067===e.target?6:1))}},68259:(e,t,r)=>{r.d(t,{t:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"vec2",2,(i,n,o,a)=>i.setUniform2fv(e,t(n,o,a),r))}}},71955:(e,t,r)=>{r.d(t,{K:()=>l});var i=r(43519),n=r(31821),o=r(74333);class a extends o.n{constructor(e,t){super(e,"int",1,(r,i,n)=>r.setUniform1i(e,t(i,n)))}}var s=r(43616);function l(e,t){e.varyings.add("colorMixMode","int"),e.varyings.add("opacityMixMode","int"),e.vertex.uniforms.add(new a("symbolColorMixMode",e=>s.Um[e.colorMixMode])),t.hasSymbolColors?(e.vertex.include(i.WD),e.vertex.include(i.Y1),e.vertex.include(i.ML),e.attributes.add("symbolColor","vec4"),e.vertex.code.add(n.H`
716
716
  MaskedColor applySymbolColor(MaskedColor color) {
717
717
  return multiplyMaskedColors(color, createMaskedFromUInt8NaNColor(${"symbolColor"}));
718
718
  }
@@ -726,7 +726,7 @@ return color;
726
726
  `)}},71988:(e,t,r)=>{r.d(t,{E:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"vec4",1,(i,n,o)=>i.setUniform4fv(e,t(n,o),r))}}},72824:(e,t,r)=>{r.d(t,{Mh:()=>u,Zo:()=>h,gy:()=>p});var i=r(21818),n=r(29242),o=r(91829),a=r(96336),s=r(33752),l=r(31821),c=r(98353),d=r(35644);function u(e,t){switch(t.normalType){case 0:case 1:e.include(a.Y,t),e.varyings.add("vNormalWorld","vec3"),e.varyings.add("vNormalView","vec3"),e.vertex.uniforms.add(new c.h("transformNormalGlobalFromModel",e=>e.transformNormalGlobalFromModel),new d.k("transformNormalViewFromGlobal",e=>e.transformNormalViewFromGlobal)).code.add(l.H`void forwardNormal() {
727
727
  vNormalWorld = transformNormalGlobalFromModel * normalModel();
728
728
  vNormalView = transformNormalViewFromGlobal * vNormalWorld;
729
- }`);break;case 2:e.vertex.code.add(l.H`void forwardNormal() {}`);break;default:(0,i.Xb)(t.normalType);case 3:}}class h extends s.dO{constructor(){super(...arguments),this.transformNormalViewFromGlobal=(0,n.vt)()}}class p extends s.EM{constructor(){super(...arguments),this.transformNormalGlobalFromModel=(0,n.vt)(),this.toMapSpace=(0,o.vt)()}}},74038:(e,t,r)=>{r.d(t,{_:()=>i});class i{constructor(e,t,r,i,n,o=!1,a=0){this.name=e,this.count=t,this.type=r,this.offset=i,this.stride=n,this.normalized=o,this.divisor=a}}},74810:(e,t,r)=>{r.d(t,{Bt:()=>s,Jr:()=>o,SY:()=>l,mb:()=>a});var i=r(38954),n=r(51850);function o({normalTexture:e,metallicRoughnessTexture:t,metallicFactor:r,roughnessFactor:o,emissiveTexture:a,emissiveFactor:s,occlusionTexture:l}){return null==e&&null==t&&null==a&&(null==s||(0,i.q)(s,n.uY))&&null==l&&(null==o||1===o)&&(null==r||1===r)}const a=(0,n.CN)(1,1,.5),s=(0,n.CN)(0,.6,.2),l=(0,n.CN)(0,1,.2)},76284:(e,t,r)=>{r.d(t,{g:()=>T});var i=r(49186),n=r(44208),o=r(53966),a=r(97768),s=r(93637),l=r(74887),c=r(94656),d=r(63907),u=r(67171);const h=()=>o.A.getLogger("esri/views/webgl/textureUtils");function p(e){const{width:t,height:r,depth:i}=e;(null!=t&&t<0||null!=r&&r<0||null!=i&&i<0)&&h().error("Negative dimension parameters are not allowed!");const{internalFormat:n}=e;if(n&&(m(n)||f(n))){const{linearFilterDepth:t,compareEnabled:r,samplingMode:i,hasMipmap:n}=e;n&&h().error("Depth textures cannot have mipmaps"),t?9729!==i&&9728!==i&&h().error("Depth textures cannot sample mipmaps"):(9728!==i&&h().error("Depth textures without filtering must use NEAREST filtering"),r&&h().error("Depth textures without filtering cannot use compare function"))}}function m(e){return(0,s.a4)(d.SB,e)}function f(e){return(0,s.a4)(d.iE,e)}function g(e){return null!=e&&"type"in e&&"compressed"===e.type}function v(e){return null!=e&&!g(e)&&!function(e){return null!=e&&"byteLength"in e}(e)}function _(e){return 32879===e||35866===e}function x(e,t,r,i=1){let n=Math.max(t,r);return 32879===e&&(n=Math.max(n,i)),Math.floor(Math.log2(n))+1}function w(e){if(null!=e.internalFormat)return e.internalFormat;switch(e.dataType){case d.ld.FLOAT:switch(e.pixelFormat){case 6408:return d.H0.RGBA32F;case 6407:return d.H0.RGB32F;default:throw new i.A("texture:unknown-format","Unable to derive format")}case d.ld.UNSIGNED_BYTE:switch(e.pixelFormat){case 6408:return d.H0.RGBA8;case 6407:return d.H0.RGB8}}const{pixelFormat:t}=e;return e.internalFormat=34041===t?d.iE.DEPTH24_STENCIL8:6402===t?d.SB.DEPTH_COMPONENT24:t,e.internalFormat}class y extends u.R{constructor(e,t){switch(super(),this.context=e,Object.assign(this,t),this.internalFormat){case d.H0.R16F:case d.H0.R32F:case d.H0.R8_SNORM:case d.H0.R8:this.pixelFormat=6403;break;case d.H0.R8I:case d.H0.R8UI:case d.H0.R16I:case d.H0.R16UI:case d.H0.R32I:case d.H0.R32UI:this.pixelFormat=36244}}static validate(e,t){return new y(e,t)}}const b=!!(0,n.A)("esri-tests-disable-gpu-memory-measurements"),M=()=>o.A.getLogger("esri/views/webgl/Texture");let T=class e{static{this.TEXTURE_UNIT_FOR_UPDATES=0}static{this.compressionWorkerHandle=null}constructor(e,t=null,r=null){if(this.type=1,this._glName=null,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._shadowFilterDirty=!1,this._wasImmutablyAllocated=!1,"context"in e)this._descriptor=e,r=t;else{const r=y.validate(e,t);if(!r)throw new i.A("texture:invalid-descriptor","Texture descriptor invalid");this._descriptor=r}34067===this._descriptor.target?this._setDataCubeMap(r):this.setData(r)}get glName(){return this._glName}get descriptor(){return this._descriptor}get usedMemory(){return b?0:(0,u.e)(this._descriptor)}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty||this._shadowFilterDirty}get hasWebGLTextureObject(){return!!this._glName}dispose(){this.abortCompression(),this.hasWebGLTextureObject&&this._descriptor.context?.gl&&(this._descriptor.context.instanceCounter.decrement(d.vt.Texture,this),this._descriptor.context.unbindTexture(this),this._descriptor.context.gl.deleteTexture(this._glName),this._glName=null,this._descriptor=null)}release(){this.dispose()}[Symbol.dispose](){this.dispose()}resize(e,t){const r=this._descriptor;if(r.width!==e||r.height!==t){if(this._wasImmutablyAllocated)throw new i.A("texture:immutable-resize","Immutable textures can't be resized!");r.width=e,r.height=t,34067===this._descriptor.target?this._setDataCubeMap(null):this.setData(null)}}enableCompression(e){this._descriptor.compress=e}disableCompression(){this._descriptor.compress=void 0}setData(e){this.abortCompression(),!g(e)&&this._descriptor.internalFormat&&(0,s.a4)(d.CQ,this._descriptor.internalFormat)&&(this._descriptor.internalFormat=void 0),this._setData(e),!g(e)&&this._descriptor.compress&&this._compressOnWorker(e)}updateData(t,r,n,o,a,s,l=0){s||M().error("An attempt to use uninitialized data!"),this.hasWebGLTextureObject||M().error("An attempt to update uninitialized texture!");const c=this._descriptor;c.internalFormat=w(c);const{context:d,pixelFormat:u,dataType:h,target:p,isImmutable:m}=c;if(m&&!this._wasImmutablyAllocated)throw new i.A("texture:uninitialized","Cannot update immutable texture before allocation!");const f=d.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES,!0);(r<0||n<0||r+o>c.width||n+a>c.height)&&M().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:_}=d;l&&(o&&a||M().warn("Must pass width and height if `UNPACK_SKIP_ROWS` is used"),_.pixelStorei(_.UNPACK_SKIP_ROWS,l)),v(s)?_.texSubImage2D(p,t,r,n,o,a,u,h,s):g(s)?_.compressedTexSubImage2D(p,t,r,n,o,a,c.internalFormat,s.levels[t]):_.texSubImage2D(p,t,r,n,o,a,u,h,s),l&&_.pixelStorei(_.UNPACK_SKIP_ROWS,0),d.bindTexture(f,e.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(t,r,n,o,a,s,l,c){c||M().error("An attempt to use uninitialized data!"),this.hasWebGLTextureObject||M().error("An attempt to update an uninitialized texture!");const d=this._descriptor;d.internalFormat=w(d);const{context:u,pixelFormat:h,dataType:p,isImmutable:m,target:f}=d;if(m&&!this._wasImmutablyAllocated)throw new i.A("texture:uninitialized","Cannot update immutable texture before allocation!");_(f)||M().warn("Attempting to set 3D texture data on a non-3D texture");const v=u.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES);u.setActiveTexture(e.TEXTURE_UNIT_FOR_UPDATES),(r<0||n<0||o<0||r+a>d.width||n+s>d.height||o+l>d.depth)&&M().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:x}=u;if(g(c))c=c.levels[t],x.compressedTexSubImage3D(f,t,r,n,o,a,s,l,d.internalFormat,c);else{const e=c;x.texSubImage3D(f,t,r,n,o,a,s,l,h,p,e)}u.bindTexture(v,e.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const t=this._descriptor;if(0===t.width||0===t.height)return;if(!t.hasMipmap){if(this._wasImmutablyAllocated)throw new i.A("texture:immutable-change","Cannot add mipmaps to immutable texture after allocation");t.hasMipmap=!0,this._samplingModeDirty=!0,p(t)}9729===t.samplingMode?(this._samplingModeDirty=!0,t.samplingMode=9985):9728===t.samplingMode&&(this._samplingModeDirty=!0,t.samplingMode=9984);const r=this._descriptor.context.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(e.TEXTURE_UNIT_FOR_UPDATES),this._descriptor.context.gl.generateMipmap(t.target),this._descriptor.context.bindTexture(r,e.TEXTURE_UNIT_FOR_UPDATES)}clearMipmap(){const e=this._descriptor;if(e.hasMipmap){if(this._wasImmutablyAllocated)throw new i.A("texture:immutable-change","Cannot delete mipmaps to immutable texture after allocation");e.hasMipmap=!1,this._samplingModeDirty=!0,p(e)}9985===e.samplingMode?(this._samplingModeDirty=!0,e.samplingMode=9729):9984===e.samplingMode&&(this._samplingModeDirty=!0,e.samplingMode=9728)}setSamplingMode(e){e!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=e,this._samplingModeDirty=!0)}setWrapMode(e){e!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=e,p(this._descriptor),this._wrapModeDirty=!0)}setShadowFiltering(e){e!==this._descriptor.linearFilterDepth&&(this._descriptor.linearFilterDepth=this._descriptor.compareEnabled=e,this.setSamplingMode(e?9729:9728),p(this._descriptor),this._shadowFilterDirty=!0)}applyChanges(){this._samplingModeDirty&&(this._applySamplingMode(),this._samplingModeDirty=!1),this._wrapModeDirty&&(this._applyWrapMode(),this._wrapModeDirty=!1),this._shadowFilterDirty&&(this._applyShadowMode(),this._shadowFilterDirty=!1)}abortCompression(){this._compressionAbortController=(0,a.DC)(this._compressionAbortController)}_setData(t,r){const n=this._descriptor,o=n.context?.gl;if(!o)return;(0,c.Y2)(o),this.hasWebGLTextureObject||(this._glName=o.createTexture(),n.context.instanceCounter.increment(d.vt.Texture,this)),p(n);const a=n.context.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES);n.context.setActiveTexture(e.TEXTURE_UNIT_FOR_UPDATES),this._configurePixelStorage(),(0,c.Y2)(o);const l=r??n.target,u=_(l);if(v(t))this._setDataFromTexImageSource(t,l);else{const{width:e,height:r,depth:a}=n;if(null==e||null==r)throw new i.A("texture:missing-size","Width and height must be specified!");if(u&&null==a)throw new i.A("texture:missing-depth","Depth must be specified!");if(n.internalFormat=w(n),n.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(l,n.internalFormat,n.hasMipmap,e,r,a),g(t)){if(!function(e){return null!=e&&(0,s.a4)(d.CQ,e)}(n.internalFormat))throw new i.A("texture:format-mismatch","Attempting to use compressed data with an uncompressed format!");this._setDataFromCompressedSource(t,n.internalFormat,l)}else this._texImage(l,0,n.internalFormat,e,r,a,t),(0,c.Y2)(o),n.hasMipmap&&this.generateMipmap()}this._applySamplingMode(),this._applyWrapMode(),this._applyAnisotropicFilteringParameters(),this._applyShadowMode(),(0,c.Y2)(o),n.context.bindTexture(a,e.TEXTURE_UNIT_FOR_UPDATES)}_setDataCubeMap(e=null){for(let t=34069;t<=34074;t++)this._setData(e,t)}_configurePixelStorage(){const e=this._descriptor.context.gl,{unpackAlignment:t,flipped:r,preMultiplyAlpha:i}=this._descriptor;e.pixelStorei(e.UNPACK_ALIGNMENT,t),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,r?1:0),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i?1:0)}_setDataFromTexImageSource(e,t){const{gl:r}=this._descriptor.context,i=this._descriptor;i.internalFormat=w(i);const n=_(t),{width:o,height:a,depth:s}=function(e){let t="width"in e?e.width:e.codedWidth,r="height"in e?e.height:e.codedHeight;return e instanceof HTMLVideoElement&&(t=e.videoWidth,r=e.videoHeight),{width:t,height:r,depth:1}}(e);i.width&&i.height,i.width||(i.width=o),i.height||(i.height=a),n&&i.depth,n&&(i.depth=s),i.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(t,i.internalFormat,i.hasMipmap,o,a,s),this._texImage(t,0,i.internalFormat,o,a,s,e),(0,c.Y2)(r),i.hasMipmap&&(this.generateMipmap(),(0,c.Y2)(r))}_setDataFromCompressedSource(e,t,r){const i=this._descriptor,{width:n,height:o,depth:a}=i,s=e.levels,l=x(r,n,o,a),c=Math.min(l,s.length)-1;this._descriptor.context.gl.texParameteri(i.target,33085,c),this._forEachMipmapLevel((e,i,n,o)=>{const a=s[Math.min(e,s.length-1)];this._compressedTexImage(r,e,t,i,n,o,a)},c)}_texStorage(e,t,r,n,o,a){const{gl:s}=this._descriptor.context;if(!function(e){return d.XN.includes(e)}(t)&&!m(t)&&!f(t))throw new i.A("texture:missing-format","Immutable textures must have a sized internal format");if(!this._descriptor.isImmutable)return;const l=r?x(e,n,o,a):1;if(_(e)){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");s.texStorage3D(e,l,t,n,o,a)}else s.texStorage2D(e,l,t,n,o);this._wasImmutablyAllocated=!0}_texImage(e,t,r,n,o,a,s){const l=this._descriptor.context.gl,c=_(e),{isImmutable:d,pixelFormat:u,dataType:h}=this._descriptor;if(d){if(null!=s){const r=s;if(c){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");l.texSubImage3D(e,t,0,0,0,n,o,a,u,h,r)}else l.texSubImage2D(e,t,0,0,n,o,u,h,r)}}else{const d=s;if(c){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");l.texImage3D(e,t,r,n,o,a,0,u,h,d)}else l.texImage2D(e,t,r,n,o,0,u,h,d)}}_compressedTexImage(e,t,r,n,o,a,s){const l=this._descriptor.context.gl,c=_(e);if(this._descriptor.isImmutable){if(null!=s)if(c){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");l.compressedTexSubImage3D(e,t,0,0,0,n,o,a,r,s)}else l.compressedTexSubImage2D(e,t,0,0,n,o,r,s)}else if(c){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");l.compressedTexImage3D(e,t,r,n,o,a,0,s)}else l.compressedTexImage2D(e,t,r,n,o,0,s)}async _compressOnWorker(t){const{width:r,height:i,context:n,flipped:o,preMultiplyAlpha:a,hasMipmap:s}=this._descriptor,c=this._descriptor.compress?.compressionTracker,d=this._descriptor.compress?.compressionCallback,{compressedTextureETC:u,compressedTextureS3TC:h}=n.capabilities;if(!e.compressionWorkerHandle?.isCompressible(t,this._descriptor)||!u&&!h)return;this.abortCompression();const p=new AbortController;let m;this._compressionAbortController=p,c?.increment();try{t instanceof Uint8Array?m=t.buffer:(m=await createImageBitmap(t,{imageOrientation:o?"flipY":"none"}),(0,l.Te)(p));const n={data:m,width:r,height:i,needsFlip:t instanceof Uint8Array&&this.descriptor.flipped,components:6408===this._descriptor.pixelFormat?4:3,preMultiplyAlpha:a,hasMipmap:s,hasETC:!!u,hasS3TC:!!h},c=await e.compressionWorkerHandle.invoke(n,p.signal,1);if((0,l.Te)(p),c.compressedTexture&&this.hasWebGLTextureObject){const e=this.usedMemory;this._descriptor.internalFormat=c.internalFormat,this._setData(c.compressedTexture),d?.(e-this.usedMemory)}}catch(e){(0,l.zf)(e)||M().error("Texture compression failed!")}finally{c?.decrement(),this._compressionAbortController?.signal.aborted&&(this._compressionAbortController=null),m instanceof ImageBitmap&&m.close()}}_forEachMipmapLevel(e,t=1/0){let{width:r,height:n,depth:o,hasMipmap:a,target:s}=this._descriptor;const l=32879===s;if(null==r||null==n||l&&null==o)throw new i.A("texture:missing-size","Missing texture dimensions for mipmap calculation");for(let i=0;e(i,r,n,o),a&&(1!==r||1!==n||l&&1!==o)&&!(i>=t);++i)r=Math.max(1,r>>1),n=Math.max(1,n>>1),l&&(o=Math.max(1,o>>1))}_applySamplingMode(){const e=this._descriptor,t=e.context?.gl;let r=e.samplingMode,i=e.samplingMode;9985===r||9987===r?(r=9729,e.hasMipmap||(i=9729)):9984!==r&&9986!==r||(r=9728,e.hasMipmap||(i=9728)),t.texParameteri(e.target,t.TEXTURE_MAG_FILTER,r),t.texParameteri(e.target,t.TEXTURE_MIN_FILTER,i)}_applyWrapMode(){const e=this._descriptor,t=e.context?.gl;"number"==typeof e.wrapMode?(t.texParameteri(e.target,t.TEXTURE_WRAP_S,e.wrapMode),t.texParameteri(e.target,t.TEXTURE_WRAP_T,e.wrapMode)):(t.texParameteri(e.target,t.TEXTURE_WRAP_S,e.wrapMode.s),t.texParameteri(e.target,t.TEXTURE_WRAP_T,e.wrapMode.t))}_applyShadowMode(){const e=this._descriptor,t=e.context?.gl,r=e.compareEnabled?t.COMPARE_REF_TO_TEXTURE:t.NONE;t.texParameteri(e.target,t.TEXTURE_COMPARE_MODE,r),e.compareEnabled&&t.texParameteri(e.target,t.TEXTURE_COMPARE_FUNC,t.GREATER),(0,c.Y2)(t)}_applyAnisotropicFilteringParameters(){const e=this._descriptor,t=e.context.capabilities.textureFilterAnisotropic;t&&e.context.gl.texParameterf(e.target,t.TEXTURE_MAX_ANISOTROPY,e.maxAnisotropy??1)}}},76591:(e,t,r)=>{r.d(t,{HQ:()=>c,rA:()=>d});var i=r(58083),n=r(9093),o=r(38954),a=r(51850),s=r(40710),l=(r(33079),r(31821));function c(e,t){!function(e,t,...r){h(e,t,...r),t.hasSlicePlane?e.code.add("\n void discardBySlice(vec3 pos) {\n if (sliceByPlane(pos)) {\n discard;\n }\n }\n\n vec4 applySliceOutline(vec4 color, vec3 pos) {\n SliceFactors factors = calculateSliceFactors(pos);\n\n factors.front /= 2.0 * fwidth(factors.front);\n factors.side0 /= 2.0 * fwidth(factors.side0);\n factors.side1 /= 2.0 * fwidth(factors.side1);\n factors.side2 /= 2.0 * fwidth(factors.side2);\n factors.side3 /= 2.0 * fwidth(factors.side3);\n\n // return after calling fwidth, to avoid aliasing caused by discontinuities in the input to fwidth\n if (sliceByFactors(factors)) {\n return color;\n }\n\n float outlineFactor = (1.0 - step(0.5, factors.front))\n * (1.0 - step(0.5, factors.side0))\n * (1.0 - step(0.5, factors.side1))\n * (1.0 - step(0.5, factors.side2))\n * (1.0 - step(0.5, factors.side3));\n\n return mix(color, vec4(vec3(0.0), color.a), outlineFactor * 0.3);\n }\n\n vec4 applySlice(vec4 color, vec3 pos) {\n return sliceEnabled() ? applySliceOutline(color, pos) : color;\n }\n "):e.code.add(l.H`void discardBySlice(vec3 pos) { }
729
+ }`);break;case 2:e.vertex.code.add(l.H`void forwardNormal() {}`);break;default:(0,i.Xb)(t.normalType);case 3:}}class h extends s.dO{constructor(){super(...arguments),this.transformNormalViewFromGlobal=(0,n.vt)()}}class p extends s.EM{constructor(){super(...arguments),this.transformNormalGlobalFromModel=(0,n.vt)(),this.toMapSpace=(0,o.vt)()}}},74038:(e,t,r)=>{r.d(t,{_:()=>i});class i{constructor(e,t,r,i,n,o=!1,a=0){this.name=e,this.count=t,this.type=r,this.offset=i,this.stride=n,this.normalized=o,this.divisor=a}}},74810:(e,t,r)=>{r.d(t,{Bt:()=>s,Jr:()=>o,SY:()=>l,mb:()=>a});var i=r(38954),n=r(51850);function o({normalTexture:e,metallicRoughnessTexture:t,metallicFactor:r,roughnessFactor:o,emissiveTexture:a,emissiveFactor:s,occlusionTexture:l}){return null==e&&null==t&&null==a&&(null==s||(0,i.q)(s,n.uY))&&null==l&&(null==o||1===o)&&(null==r||1===r)}const a=(0,n.CN)(1,1,.5),s=(0,n.CN)(0,.6,.2),l=(0,n.CN)(0,1,.2)},76284:(e,t,r)=>{r.d(t,{g:()=>T});var i=r(49186),n=r(44208),o=r(53966),a=r(97768),s=r(93637),l=r(74887),c=r(94656),d=r(63907),u=r(67171);const h=()=>o.A.getLogger("esri/views/webgl/textureUtils");function p(e){const{width:t,height:r,depth:i}=e;(null!=t&&t<0||null!=r&&r<0||null!=i&&i<0)&&h().error("Negative dimension parameters are not allowed!");const{internalFormat:n}=e;if(n&&(m(n)||f(n))){const{linearFilterDepth:t,compareEnabled:r,samplingMode:i,hasMipmap:n}=e;n&&h().error("Depth textures cannot have mipmaps"),t?9729!==i&&9728!==i&&h().error("Depth textures cannot sample mipmaps"):(9728!==i&&h().error("Depth textures without filtering must use NEAREST filtering"),r&&h().error("Depth textures without filtering cannot use compare function"))}}function m(e){return(0,s.a4)(d.SB,e)}function f(e){return(0,s.a4)(d.iE,e)}function g(e){return null!=e&&"type"in e&&"compressed"===e.type}function v(e){return null!=e&&!g(e)&&!function(e){return null!=e&&"byteLength"in e}(e)}function _(e){return 32879===e||35866===e}function x(e,t,r,i=1){let n=Math.max(t,r);return 32879===e&&(n=Math.max(n,i)),Math.floor(Math.log2(n))+1}function w(e){if(null!=e.internalFormat)return e.internalFormat;switch(e.dataType){case d.ld.FLOAT:switch(e.pixelFormat){case 6408:return d.H0.RGBA32F;case 6407:return d.H0.RGB32F;default:throw new i.A("texture:unknown-format","Unable to derive format")}case d.ld.UNSIGNED_BYTE:switch(e.pixelFormat){case 6408:return d.H0.RGBA8;case 6407:return d.H0.RGB8}}const{pixelFormat:t}=e;return e.internalFormat=34041===t?d.iE.DEPTH24_STENCIL8:6402===t?d.SB.DEPTH_COMPONENT24:t,e.internalFormat}class y extends u.R{constructor(e,t){switch(super(),this.context=e,Object.assign(this,t),this.internalFormat){case d.H0.R16F:case d.H0.R32F:case d.H0.R8_SNORM:case d.H0.R8:this.pixelFormat=6403;break;case d.H0.R8I:case d.H0.R8UI:case d.H0.R16I:case d.H0.R16UI:case d.H0.R32I:case d.H0.R32UI:this.pixelFormat=36244}}static validate(e,t){return new y(e,t)}}const b=!!(0,n.A)("esri-tests-disable-gpu-memory-measurements"),M=()=>o.A.getLogger("esri/views/webgl/Texture");class T{static{this.TEXTURE_UNIT_FOR_UPDATES=0}static{this.compressionWorkerHandle=null}constructor(e,t=null,r=null){if(this.type=1,this._glName=null,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._shadowFilterDirty=!1,this._wasImmutablyAllocated=!1,"context"in e)this._descriptor=e,r=t;else{const r=y.validate(e,t);if(!r)throw new i.A("texture:invalid-descriptor","Texture descriptor invalid");this._descriptor=r}34067===this._descriptor.target?this._setDataCubeMap(r):this.setData(r)}get glName(){return this._glName}get descriptor(){return this._descriptor}get usedMemory(){return b?0:(0,u.e)(this._descriptor)}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty||this._shadowFilterDirty}get hasWebGLTextureObject(){return!!this._glName}dispose(){this.abortCompression(),this.hasWebGLTextureObject&&this._descriptor.context?.gl&&(this._descriptor.context.instanceCounter.decrement(d.vt.Texture,this),this._descriptor.context.unbindTexture(this),this._descriptor.context.gl.deleteTexture(this._glName),this._glName=null,this._descriptor=null)}release(){this.dispose()}[Symbol.dispose](){this.dispose()}resize(e,t){const r=this._descriptor;if(r.width!==e||r.height!==t){if(this._wasImmutablyAllocated)throw new i.A("texture:immutable-resize","Immutable textures can't be resized!");r.width=e,r.height=t,34067===this._descriptor.target?this._setDataCubeMap(null):this.setData(null)}}enableCompression(e){this._descriptor.compress=e}disableCompression(){this._descriptor.compress=void 0}setData(e){this.abortCompression(),!g(e)&&this._descriptor.internalFormat&&(0,s.a4)(d.CQ,this._descriptor.internalFormat)&&(this._descriptor.internalFormat=void 0),this._setData(e),!g(e)&&this._descriptor.compress&&this._compressOnWorker(e)}updateData(e,t,r,n,o,a,s=0){a||M().error("An attempt to use uninitialized data!"),this.hasWebGLTextureObject||M().error("An attempt to update uninitialized texture!");const l=this._descriptor;l.internalFormat=w(l);const{context:c,pixelFormat:d,dataType:u,target:h,isImmutable:p}=l;if(p&&!this._wasImmutablyAllocated)throw new i.A("texture:uninitialized","Cannot update immutable texture before allocation!");const m=c.bindTexture(this,T.TEXTURE_UNIT_FOR_UPDATES,!0);(t<0||r<0||t+n>l.width||r+o>l.height)&&M().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:f}=c;s&&(n&&o||M().warn("Must pass width and height if `UNPACK_SKIP_ROWS` is used"),f.pixelStorei(f.UNPACK_SKIP_ROWS,s)),v(a)?f.texSubImage2D(h,e,t,r,n,o,d,u,a):g(a)?f.compressedTexSubImage2D(h,e,t,r,n,o,l.internalFormat,a.levels[e]):f.texSubImage2D(h,e,t,r,n,o,d,u,a),s&&f.pixelStorei(f.UNPACK_SKIP_ROWS,0),c.bindTexture(m,T.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(e,t,r,n,o,a,s,l){l||M().error("An attempt to use uninitialized data!"),this.hasWebGLTextureObject||M().error("An attempt to update an uninitialized texture!");const c=this._descriptor;c.internalFormat=w(c);const{context:d,pixelFormat:u,dataType:h,isImmutable:p,target:m}=c;if(p&&!this._wasImmutablyAllocated)throw new i.A("texture:uninitialized","Cannot update immutable texture before allocation!");_(m)||M().warn("Attempting to set 3D texture data on a non-3D texture");const f=d.bindTexture(this,T.TEXTURE_UNIT_FOR_UPDATES);d.setActiveTexture(T.TEXTURE_UNIT_FOR_UPDATES),(t<0||r<0||n<0||t+o>c.width||r+a>c.height||n+s>c.depth)&&M().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:v}=d;if(g(l))l=l.levels[e],v.compressedTexSubImage3D(m,e,t,r,n,o,a,s,c.internalFormat,l);else{const i=l;v.texSubImage3D(m,e,t,r,n,o,a,s,u,h,i)}d.bindTexture(f,T.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const e=this._descriptor;if(0===e.width||0===e.height)return;if(!e.hasMipmap){if(this._wasImmutablyAllocated)throw new i.A("texture:immutable-change","Cannot add mipmaps to immutable texture after allocation");e.hasMipmap=!0,this._samplingModeDirty=!0,p(e)}9729===e.samplingMode?(this._samplingModeDirty=!0,e.samplingMode=9985):9728===e.samplingMode&&(this._samplingModeDirty=!0,e.samplingMode=9984);const t=this._descriptor.context.bindTexture(this,T.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(T.TEXTURE_UNIT_FOR_UPDATES),this._descriptor.context.gl.generateMipmap(e.target),this._descriptor.context.bindTexture(t,T.TEXTURE_UNIT_FOR_UPDATES)}clearMipmap(){const e=this._descriptor;if(e.hasMipmap){if(this._wasImmutablyAllocated)throw new i.A("texture:immutable-change","Cannot delete mipmaps to immutable texture after allocation");e.hasMipmap=!1,this._samplingModeDirty=!0,p(e)}9985===e.samplingMode?(this._samplingModeDirty=!0,e.samplingMode=9729):9984===e.samplingMode&&(this._samplingModeDirty=!0,e.samplingMode=9728)}setSamplingMode(e){e!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=e,this._samplingModeDirty=!0)}setWrapMode(e){e!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=e,p(this._descriptor),this._wrapModeDirty=!0)}setShadowFiltering(e){e!==this._descriptor.linearFilterDepth&&(this._descriptor.linearFilterDepth=this._descriptor.compareEnabled=e,this.setSamplingMode(e?9729:9728),p(this._descriptor),this._shadowFilterDirty=!0)}applyChanges(){this._samplingModeDirty&&(this._applySamplingMode(),this._samplingModeDirty=!1),this._wrapModeDirty&&(this._applyWrapMode(),this._wrapModeDirty=!1),this._shadowFilterDirty&&(this._applyShadowMode(),this._shadowFilterDirty=!1)}abortCompression(){this._compressionAbortController=(0,a.DC)(this._compressionAbortController)}_setData(e,t){const r=this._descriptor,n=r.context?.gl;if(!n)return;(0,c.Y2)(n),this.hasWebGLTextureObject||(this._glName=n.createTexture(),r.context.instanceCounter.increment(d.vt.Texture,this)),p(r);const o=r.context.bindTexture(this,T.TEXTURE_UNIT_FOR_UPDATES);r.context.setActiveTexture(T.TEXTURE_UNIT_FOR_UPDATES),this._configurePixelStorage(),(0,c.Y2)(n);const a=t??r.target,l=_(a);if(v(e))this._setDataFromTexImageSource(e,a);else{const{width:t,height:o,depth:u}=r;if(null==t||null==o)throw new i.A("texture:missing-size","Width and height must be specified!");if(l&&null==u)throw new i.A("texture:missing-depth","Depth must be specified!");if(r.internalFormat=w(r),r.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(a,r.internalFormat,r.hasMipmap,t,o,u),g(e)){if(!function(e){return null!=e&&(0,s.a4)(d.CQ,e)}(r.internalFormat))throw new i.A("texture:format-mismatch","Attempting to use compressed data with an uncompressed format!");this._setDataFromCompressedSource(e,r.internalFormat,a)}else this._texImage(a,0,r.internalFormat,t,o,u,e),(0,c.Y2)(n),r.hasMipmap&&this.generateMipmap()}this._applySamplingMode(),this._applyWrapMode(),this._applyAnisotropicFilteringParameters(),this._applyShadowMode(),(0,c.Y2)(n),r.context.bindTexture(o,T.TEXTURE_UNIT_FOR_UPDATES)}_setDataCubeMap(e=null){for(let t=34069;t<=34074;t++)this._setData(e,t)}_configurePixelStorage(){const e=this._descriptor.context.gl,{unpackAlignment:t,flipped:r,preMultiplyAlpha:i}=this._descriptor;e.pixelStorei(e.UNPACK_ALIGNMENT,t),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,r?1:0),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i?1:0)}_setDataFromTexImageSource(e,t){const{gl:r}=this._descriptor.context,i=this._descriptor;i.internalFormat=w(i);const n=_(t),{width:o,height:a,depth:s}=function(e){let t="width"in e?e.width:e.codedWidth,r="height"in e?e.height:e.codedHeight;return e instanceof HTMLVideoElement&&(t=e.videoWidth,r=e.videoHeight),{width:t,height:r,depth:1}}(e);i.width&&i.height,i.width||(i.width=o),i.height||(i.height=a),n&&i.depth,n&&(i.depth=s),i.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(t,i.internalFormat,i.hasMipmap,o,a,s),this._texImage(t,0,i.internalFormat,o,a,s,e),(0,c.Y2)(r),i.hasMipmap&&(this.generateMipmap(),(0,c.Y2)(r))}_setDataFromCompressedSource(e,t,r){const i=this._descriptor,{width:n,height:o,depth:a}=i,s=e.levels,l=x(r,n,o,a),c=Math.min(l,s.length)-1;this._descriptor.context.gl.texParameteri(i.target,33085,c),this._forEachMipmapLevel((e,i,n,o)=>{const a=s[Math.min(e,s.length-1)];this._compressedTexImage(r,e,t,i,n,o,a)},c)}_texStorage(e,t,r,n,o,a){const{gl:s}=this._descriptor.context;if(!function(e){return d.XN.includes(e)}(t)&&!m(t)&&!f(t))throw new i.A("texture:missing-format","Immutable textures must have a sized internal format");if(!this._descriptor.isImmutable)return;const l=r?x(e,n,o,a):1;if(_(e)){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");s.texStorage3D(e,l,t,n,o,a)}else s.texStorage2D(e,l,t,n,o);this._wasImmutablyAllocated=!0}_texImage(e,t,r,n,o,a,s){const l=this._descriptor.context.gl,c=_(e),{isImmutable:d,pixelFormat:u,dataType:h}=this._descriptor;if(d){if(null!=s){const r=s;if(c){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");l.texSubImage3D(e,t,0,0,0,n,o,a,u,h,r)}else l.texSubImage2D(e,t,0,0,n,o,u,h,r)}}else{const d=s;if(c){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");l.texImage3D(e,t,r,n,o,a,0,u,h,d)}else l.texImage2D(e,t,r,n,o,0,u,h,d)}}_compressedTexImage(e,t,r,n,o,a,s){const l=this._descriptor.context.gl,c=_(e);if(this._descriptor.isImmutable){if(null!=s)if(c){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");l.compressedTexSubImage3D(e,t,0,0,0,n,o,a,r,s)}else l.compressedTexSubImage2D(e,t,0,0,n,o,r,s)}else if(c){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");l.compressedTexImage3D(e,t,r,n,o,a,0,s)}else l.compressedTexImage2D(e,t,r,n,o,0,s)}async _compressOnWorker(e){const{width:t,height:r,context:i,flipped:n,preMultiplyAlpha:o,hasMipmap:a}=this._descriptor,s=this._descriptor.compress?.compressionTracker,c=this._descriptor.compress?.compressionCallback,{compressedTextureETC:d,compressedTextureS3TC:u}=i.capabilities;if(!T.compressionWorkerHandle?.isCompressible(e,this._descriptor)||!d&&!u)return;this.abortCompression();const h=new AbortController;let p;this._compressionAbortController=h,s?.increment();try{e instanceof Uint8Array?p=e.buffer:(p=await createImageBitmap(e,{imageOrientation:n?"flipY":"none"}),(0,l.Te)(h));const i={data:p,width:t,height:r,needsFlip:e instanceof Uint8Array&&this.descriptor.flipped,components:6408===this._descriptor.pixelFormat?4:3,preMultiplyAlpha:o,hasMipmap:a,hasETC:!!d,hasS3TC:!!u},s=await T.compressionWorkerHandle.invoke(i,h.signal,1);if((0,l.Te)(h),s.compressedTexture&&this.hasWebGLTextureObject){const e=this.usedMemory;this._descriptor.internalFormat=s.internalFormat,this._setData(s.compressedTexture),c?.(e-this.usedMemory)}}catch(e){(0,l.zf)(e)||M().error("Texture compression failed!")}finally{s?.decrement(),this._compressionAbortController?.signal.aborted&&(this._compressionAbortController=null),p instanceof ImageBitmap&&p.close()}}_forEachMipmapLevel(e,t=1/0){let{width:r,height:n,depth:o,hasMipmap:a,target:s}=this._descriptor;const l=32879===s;if(null==r||null==n||l&&null==o)throw new i.A("texture:missing-size","Missing texture dimensions for mipmap calculation");for(let i=0;e(i,r,n,o),a&&(1!==r||1!==n||l&&1!==o)&&!(i>=t);++i)r=Math.max(1,r>>1),n=Math.max(1,n>>1),l&&(o=Math.max(1,o>>1))}_applySamplingMode(){const e=this._descriptor,t=e.context?.gl;let r=e.samplingMode,i=e.samplingMode;9985===r||9987===r?(r=9729,e.hasMipmap||(i=9729)):9984!==r&&9986!==r||(r=9728,e.hasMipmap||(i=9728)),t.texParameteri(e.target,t.TEXTURE_MAG_FILTER,r),t.texParameteri(e.target,t.TEXTURE_MIN_FILTER,i)}_applyWrapMode(){const e=this._descriptor,t=e.context?.gl;"number"==typeof e.wrapMode?(t.texParameteri(e.target,t.TEXTURE_WRAP_S,e.wrapMode),t.texParameteri(e.target,t.TEXTURE_WRAP_T,e.wrapMode)):(t.texParameteri(e.target,t.TEXTURE_WRAP_S,e.wrapMode.s),t.texParameteri(e.target,t.TEXTURE_WRAP_T,e.wrapMode.t))}_applyShadowMode(){const e=this._descriptor,t=e.context?.gl,r=e.compareEnabled?t.COMPARE_REF_TO_TEXTURE:t.NONE;t.texParameteri(e.target,t.TEXTURE_COMPARE_MODE,r),e.compareEnabled&&t.texParameteri(e.target,t.TEXTURE_COMPARE_FUNC,t.GREATER),(0,c.Y2)(t)}_applyAnisotropicFilteringParameters(){const e=this._descriptor,t=e.context.capabilities.textureFilterAnisotropic;t&&e.context.gl.texParameterf(e.target,t.TEXTURE_MAX_ANISOTROPY,e.maxAnisotropy??1)}}},76591:(e,t,r)=>{r.d(t,{HQ:()=>c,rA:()=>d});var i=r(58083),n=r(9093),o=r(38954),a=r(51850),s=r(40710),l=(r(33079),r(31821));function c(e,t){!function(e,t,...r){h(e,t,...r),t.hasSlicePlane?e.code.add("\n void discardBySlice(vec3 pos) {\n if (sliceByPlane(pos)) {\n discard;\n }\n }\n\n vec4 applySliceOutline(vec4 color, vec3 pos) {\n SliceFactors factors = calculateSliceFactors(pos);\n\n factors.front /= 2.0 * fwidth(factors.front);\n factors.side0 /= 2.0 * fwidth(factors.side0);\n factors.side1 /= 2.0 * fwidth(factors.side1);\n factors.side2 /= 2.0 * fwidth(factors.side2);\n factors.side3 /= 2.0 * fwidth(factors.side3);\n\n // return after calling fwidth, to avoid aliasing caused by discontinuities in the input to fwidth\n if (sliceByFactors(factors)) {\n return color;\n }\n\n float outlineFactor = (1.0 - step(0.5, factors.front))\n * (1.0 - step(0.5, factors.side0))\n * (1.0 - step(0.5, factors.side1))\n * (1.0 - step(0.5, factors.side2))\n * (1.0 - step(0.5, factors.side3));\n\n return mix(color, vec4(vec3(0.0), color.a), outlineFactor * 0.3);\n }\n\n vec4 applySlice(vec4 color, vec3 pos) {\n return sliceEnabled() ? applySliceOutline(color, pos) : color;\n }\n "):e.code.add(l.H`void discardBySlice(vec3 pos) { }
730
730
  vec4 applySlice(vec4 color, vec3 pos) { return color; }`)}(e,t,new s.W("slicePlaneOrigin",(e,r)=>g(t,e,r)),new s.W("slicePlaneBasis1",(e,r)=>v(t,e,r,r.slicePlane?.basis1)),new s.W("slicePlaneBasis2",(e,r)=>v(t,e,r,r.slicePlane?.basis2)))}function d(e,t){h(e,t,new s.W("slicePlaneOrigin",(e,r)=>g(t,e,r)),new s.W("slicePlaneBasis1",(e,r)=>v(t,e,r,r.slicePlane?.basis1)),new s.W("slicePlaneBasis2",(e,r)=>v(t,e,r,r.slicePlane?.basis2)))}r(65786).Y;const u=l.H`struct SliceFactors {
731
731
  float front;
732
732
  float side0;
@@ -800,7 +800,7 @@ rawNormal.xy = (normalRotation * vec3(rawNormal.x, rawNormal.y, 1.0)).xy;`),r.co
800
800
  }`))}},78662:(e,t,r)=>{r.d(t,{Gd:()=>l,VC:()=>c}),r(44208);var i=r(34727),n=(r(77690),r(29242),r(58083),r(9093)),o=r(38954),a=r(51850),s=(r(87317),r(91829),r(31756),r(26857),r(16943),r(65786));class l extends s.Y{constructor(e){super(),this.vvSize=e?.size??null,this.vvColor=e?.color??null,this.vvOpacity=e?.opacity??null}get hasVVSize(){return!!this.vvSize}get hasVVColor(){return!!this.vvColor}get hasVVOpacity(){return!!this.vvOpacity}}function c(e,t,r){if(!t.vvSize)return(0,o.j)(e,1,1,1),e;if(Number.isNaN(r[0]))return(0,o.d)(e,t.vvSize.fallback);for(let n=0;n<3;++n){const o=t.vvSize.offset[n]+r[0]*t.vvSize.factor[n];e[n]=(0,i.qE)(o,t.vvSize.minSize[n],t.vvSize.maxSize[n])}return e}(0,n.vt)(),(0,a.vt)(),(0,n.vt)()},78754:(e,t,r)=>{r.d(t,{F:()=>o});var i=r(24326),n=r(97146);class o{constructor(e){this.id=(0,i.c)(),this._attributes=new Map;for(const[t,r]of e)this._attributes.set(t,{...r,indices:(0,n.Dg)(r.indices)})}get attributes(){return this._attributes}}},82048:(e,t,r)=>{r.d(t,{c:()=>n});var i=r(31821);function n(e,t=!0){e.attributes.add("position","vec2"),t&&e.varyings.add("uv","vec2"),e.vertex.main.add(i.H`
801
801
  gl_Position = vec4(position, 0.0, 1.0);
802
802
  ${t?i.H`uv = position * 0.5 + vec2(0.5);`:""}
803
- `)}},82919:(e,t,r)=>{r.d(t,{DV:()=>v,C:()=>f,vt:()=>p,Qy:()=>m,ui:()=>g,ST:()=>w,bU:()=>y,pw:()=>x,m7:()=>_,c8:()=>M});var i=r(4341),n=r(58083),o=r(38954),a=r(51850),s=r(87317),l=r(91829),c=r(71351);function d(e){return e?{ray:(0,c.vt)(e.ray),c0:e.c0,c1:e.c1}:{ray:(0,c.vt)(),c0:0,c1:Number.MAX_VALUE}}new i.I(()=>d());var u=r(27921),h=r(32114);function p(e){return e?[(0,u.vt)(e[0]),(0,u.vt)(e[1]),(0,u.vt)(e[2]),(0,u.vt)(e[3]),(0,u.vt)(e[4]),(0,u.vt)(e[5])]:[(0,u.vt)(),(0,u.vt)(),(0,u.vt)(),(0,u.vt)(),(0,u.vt)(),(0,u.vt)()]}function m(){return[(0,a.vt)(),(0,a.vt)(),(0,a.vt)(),(0,a.vt)(),(0,a.vt)(),(0,a.vt)(),(0,a.vt)(),(0,a.vt)()]}function f(e,t){for(let r=0;r<T;r++)(0,u.C)(e[r],t[r]);return e}function g(e,t,r,i=A){const a=(0,n.lw)(h.Rc.get(),t,e);(0,n.B8)(a,a);for(let e=0;e<C;++e){const t=(0,s.t)(h.Km.get(),S[e],a);(0,o.j)(i[e],t[0]/t[3],t[1]/t[3],t[2]/t[3])}v(r,i)}function v(e,t){(0,u.Cr)(t[4],t[0],t[3],e[0]),(0,u.Cr)(t[1],t[5],t[6],e[1]),(0,u.Cr)(t[4],t[5],t[1],e[2]),(0,u.Cr)(t[3],t[2],t[6],e[3]),(0,u.Cr)(t[0],t[1],t[2],e[4]),(0,u.Cr)(t[5],t[4],t[7],e[5])}function _(e,t){for(let r=0;r<T;r++){const i=e[r];if(i[0]*t[0]+i[1]*t[1]+i[2]*t[2]+i[3]>=t[3])return!1}return!0}function x(e,t){return b(e,function(e,t=d()){return(0,c.C)(e,t.ray),t.c0=0,t.c1=Number.MAX_VALUE,t}(t,E.get()))}function w(e,t,r){return b(e,function(e,t,r=d()){const i=(0,o.b)(e.vector);return(0,c.fA)(e.origin,t,r.ray),r.c0=0,r.c1=i,r}(t,r,E.get()))}function y(e,t){for(let r=0;r<T;r++)if((0,u.mN)(e[r],t)>0)return!1;return!0}function b(e,t){for(let r=0;r<T;r++)if(!(0,u.$Q)(e[r],t))return!1;return!0}const M={bottom:[5,1,0,4],near:[0,1,2,3],far:[5,4,7,6],right:[1,5,6,2],left:[4,0,3,7],top:[7,3,2,6]},T=6,C=8,S=[(0,l.fA)(-1,-1,-1,1),(0,l.fA)(1,-1,-1,1),(0,l.fA)(1,1,-1,1),(0,l.fA)(-1,1,-1,1),(0,l.fA)(-1,-1,1,1),(0,l.fA)(1,-1,1,1),(0,l.fA)(1,1,1,1),(0,l.fA)(-1,1,1,1)],E=new i.I(d),A=m()},85079:(e,t,r)=>{function i(e){let t=0;return new Map(e.map(({name:e,count:r})=>{const i=[e,t];return 16===r?t+=4:9===r?t+=3:++t,i}))}function n(e){const t=new Map;let r=0;return e.forEach(e=>e.forEach(({name:e,count:i})=>{t.set(e,r),16===i?r+=4:9===i?r+=3:++r})),t}r.d(t,{Xk:()=>i,_u:()=>n})},87170:(e,t,r)=>{r.d(t,{V:()=>T});var i=r(9093),n=r(38954),o=r(97146),a=r(57917),s=r(29920),l=r(78754),c=r(51850),d=r(4341),u=r(11964);function h(e,t,r){return(0,n.e)(p,t,e),(0,n.e)(m,r,e),.5*(0,n.b)((0,n.i)(p,p,m))}r(32114),new d.I(u.vt),new d.I(()=>function(e){return e?{p0:(0,c.o8)(e.p0),p1:(0,c.o8)(e.p1),p2:(0,c.o8)(e.p2)}:{p0:(0,c.vt)(),p1:(0,c.vt)(),p2:(0,c.vt)()}}());const p=(0,c.vt)(),m=(0,c.vt)(),f=(0,c.vt)(),g=(0,c.vt)(),v=(0,c.vt)(),_=(0,c.vt)();var x=r(24326);class w{constructor(){this.uid=(0,x.c)()}}class y extends w{constructor(e){super(),this.highlightName=e,this.channel=0}}var b=r(620),M=r(94656);class T extends l.F{constructor(e,t,r=null,i=0,n=null,o=-1,a){super(t),this.material=e,this.mapPositions=r,this.type=i,this.olidColor=n,this.edgeIndicesLength=o,this.baseGeometry=a,this._highlights=null,this._highlightOptionsCounts=null,this.visible=!0,this._boundingInfo=null;const s=this.positionAttribute;null!=s&&this.edgeIndicesLength<0&&(this.edgeIndicesLength=s.indices.length)}instantiate(e={}){const t=new T(e.material||this.material,[],this.mapPositions,this.type,this.olidColor,this.edgeIndicesLength,this.baseGeometry);return this._attributes.forEach((e,r)=>{e.exclusive=!1,t._attributes.set(r,e)}),t._boundingInfo=this._boundingInfo,t.transformation=e.transformation||this.transformation,t}getMutableAttribute(e){let t=this._attributes.get(e);return t&&!t.exclusive&&(t={...t,exclusive:!0,data:(0,a.S)(t.data)},this._attributes.set(e,t)),t}setAttributeData(e,t){const r=this._attributes.get(e);r?this._attributes.set(e,{...r,exclusive:!0,data:t}):(0,M.en)()&&console.warn(`Setting undefined attribute ${e} data`)}get positionAttribute(){return this.attributes.get("position")??this.baseGeometry?.attributes.get("position")}get indexCount(){const e=this._attributes.values().next().value?.indices;return e?.length??0}get faceCount(){return this.indexCount/3}get boundingInfo(){return this._boundingInfo??=this._calculateBoundingInfo(),this._boundingInfo}computeAttachmentOrigin(e){return!!(0===this.type?this._computeAttachmentOriginTriangles(e):2===this.type?this._computeAttachmentOriginLines(e):this._computeAttachmentOriginPoints(e))&&(null!=this._transformation&&(0,n.t)(e,e,this._transformation),!0)}_computeAttachmentOriginTriangles(e){return function(e,t){if(!e)return!1;const{size:r,data:i,indices:o}=e;(0,n.j)(t,0,0,0),(0,n.j)(_,0,0,0);let a=0,s=0;for(let e=0;e<o.length-2;e+=3){const l=o[e]*r,c=o[e+1]*r,d=o[e+2]*r;(0,n.j)(f,i[l],i[l+1],i[l+2]),(0,n.j)(g,i[c],i[c+1],i[c+2]),(0,n.j)(v,i[d],i[d+1],i[d+2]);const u=h(f,g,v);u?((0,n.g)(f,f,g),(0,n.g)(f,f,v),(0,n.h)(f,f,1/3*u),(0,n.g)(t,t,f),a+=u):((0,n.g)(_,_,f),(0,n.g)(_,_,g),(0,n.g)(_,_,v),s+=3)}return!(0===s&&0===a||(0!==a?((0,n.h)(t,t,1/a),0):0===s||((0,n.h)(t,_,1/s),0)))}(this.positionAttribute,e)}_computeAttachmentOriginLines(e){const t=this.positionAttribute;return function(e,t,r){if(!e)return!1;(0,n.j)(r,0,0,0),(0,n.j)(_,0,0,0);let i=0,o=0;const{size:a,data:s,indices:l}=e,c=l.length-1,d=c+(t?2:0);for(let e=0;e<d;e+=2){const t=e<c?e+1:0,d=l[e<c?e:c]*a,u=l[t]*a;f[0]=s[d],f[1]=s[d+1],f[2]=s[d+2],g[0]=s[u],g[1]=s[u+1],g[2]=s[u+2],(0,n.h)(f,(0,n.g)(f,f,g),.5);const h=(0,n.F)(f,g);h>0?((0,n.g)(r,r,(0,n.h)(f,f,h)),i+=h):0===i&&((0,n.g)(_,_,f),o++)}return 0!==i?((0,n.h)(r,r,1/i),!0):0!==o&&((0,n.h)(r,_,1/o),!0)}(t,function(e,t){return!(!("isClosed"in e)||!e.isClosed)&&t.indices.length>2}(this.material.parameters,t),e)}_computeAttachmentOriginPoints(e){return function(e,t){if(!e)return!1;const{size:r,data:i,indices:o}=e;(0,n.j)(t,0,0,0);let a=-1,s=0;for(let e=0;e<o.length;e++){const n=o[e]*r;a!==n&&(t[0]+=i[n],t[1]+=i[n+1],t[2]+=i[n+2],s++),a=n}return s>1&&(0,n.h)(t,t,1/s),s>0}(this.positionAttribute,e)}invalidateBoundingInfo(){this._boundingInfo=null}_calculateBoundingInfo(){const e=this.positionAttribute;if(!e||0===e.indices.length)return null;const t=0===this.type?3:1;(0,b.vA)(e.indices.length%t===0,"Indexing error: "+e.indices.length+" not divisible by "+t);const r=(0,o.tM)(e.indices.length/t);return new s.j(r,t,e)}get transformation(){return this._transformation??i.zK}set transformation(e){this._transformation=e&&e!==i.zK?(0,i.o8)(e):null}get highlights(){return this._highlights||C}get hasHighlights(){return(this._highlightOptionsCounts?.size??0)>0}foreachHighlightOptions(e){this._highlightOptionsCounts?.forEach((t,r)=>e(r))}allocateIdAndHighlight(e){const t=new y(e);return this.addHighlight(t)}addHighlight(e){this._ensureHighlights().add(e);const{highlightName:t}=e,r=(this._highlightOptionsCounts?.get(t)??0)+1;return this._ensureHighlightOptionsCounts().set(t,r),e}_ensureHighlights(){let e=this._highlights;return e||(e=new Set,this._highlights=e),e}_ensureHighlightOptionsCounts(){let e=this._highlightOptionsCounts;return e||(e=new Map,this._highlightOptionsCounts=e),e}removeHighlight(e){if(this._highlights?.delete(e)){const{highlightName:t}=e,r=this._highlightOptionsCounts?.get(t)??0;r<=1?this._highlightOptionsCounts?.delete(t):this._ensureHighlightOptionsCounts().set(t,r-1)}}}const C=new Set},89390:(e,t,r)=>{r.d(t,{kA:()=>C,a8:()=>M,eU:()=>T});var i=r(40876),n=(r(44208),r(38954)),o=r(51850),a=r(87317),s=r(91829),l=r(23205),c=r(14314),d=r(31821);function u(e,t){const r=e.fragment,i=void 0!==t.lightingSphericalHarmonicsOrder?t.lightingSphericalHarmonicsOrder:2;0===i?(r.uniforms.add(new l.d("lightingAmbientSH0",({lighting:e})=>(0,n.j)(h,e.sh.r[0],e.sh.g[0],e.sh.b[0]))),r.code.add(d.H`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) {
803
+ `)}},82919:(e,t,r)=>{r.d(t,{DV:()=>v,C:()=>f,vt:()=>p,Qy:()=>m,ui:()=>g,ST:()=>w,bU:()=>y,pw:()=>x,m7:()=>_,c8:()=>M});var i=r(4341),n=r(58083),o=r(38954),a=r(51850),s=r(87317),l=r(91829),c=r(71351);function d(e){return e?{ray:(0,c.vt)(e.ray),c0:e.c0,c1:e.c1}:{ray:(0,c.vt)(),c0:0,c1:Number.MAX_VALUE}}new i.I(()=>d());var u=r(27921),h=r(32114);function p(e){return e?[(0,u.vt)(e[0]),(0,u.vt)(e[1]),(0,u.vt)(e[2]),(0,u.vt)(e[3]),(0,u.vt)(e[4]),(0,u.vt)(e[5])]:[(0,u.vt)(),(0,u.vt)(),(0,u.vt)(),(0,u.vt)(),(0,u.vt)(),(0,u.vt)()]}function m(){return[(0,a.vt)(),(0,a.vt)(),(0,a.vt)(),(0,a.vt)(),(0,a.vt)(),(0,a.vt)(),(0,a.vt)(),(0,a.vt)()]}function f(e,t){for(let r=0;r<T;r++)(0,u.C)(e[r],t[r]);return e}function g(e,t,r,i=A){const a=(0,n.lw)(h.Rc.get(),t,e);(0,n.B8)(a,a);for(let e=0;e<C;++e){const t=(0,s.t)(h.Km.get(),S[e],a);(0,o.j)(i[e],t[0]/t[3],t[1]/t[3],t[2]/t[3])}v(r,i)}function v(e,t){(0,u.Cr)(t[4],t[0],t[3],e[0]),(0,u.Cr)(t[1],t[5],t[6],e[1]),(0,u.Cr)(t[4],t[5],t[1],e[2]),(0,u.Cr)(t[3],t[2],t[6],e[3]),(0,u.Cr)(t[0],t[1],t[2],e[4]),(0,u.Cr)(t[5],t[4],t[7],e[5])}function _(e,t){for(let r=0;r<T;r++){const i=e[r];if(i[0]*t[0]+i[1]*t[1]+i[2]*t[2]+i[3]>=t[3])return!1}return!0}function x(e,t){return b(e,function(e,t=d()){return(0,c.C)(e,t.ray),t.c0=0,t.c1=Number.MAX_VALUE,t}(t,E.get()))}function w(e,t,r){return b(e,function(e,t,r=d()){const i=(0,o.b)(e.vector);return(0,c.fA)(e.origin,t,r.ray),r.c0=0,r.c1=i,r}(t,r,E.get()))}function y(e,t){for(let r=0;r<T;r++)if((0,u.mN)(e[r],t)>0)return!1;return!0}function b(e,t){for(let r=0;r<T;r++)if(!(0,u.$Q)(e[r],t))return!1;return!0}const M={bottom:[5,1,0,4],near:[0,1,2,3],far:[5,4,7,6],right:[1,5,6,2],left:[4,0,3,7],top:[7,3,2,6]},T=6,C=8,S=[(0,l.fA)(-1,-1,-1,1),(0,l.fA)(1,-1,-1,1),(0,l.fA)(1,1,-1,1),(0,l.fA)(-1,1,-1,1),(0,l.fA)(-1,-1,1,1),(0,l.fA)(1,-1,1,1),(0,l.fA)(1,1,1,1),(0,l.fA)(-1,1,1,1)],E=new i.I(d),A=m()},85079:(e,t,r)=>{r.d(t,{Xk:()=>n,_u:()=>o});var i=r(21818);function n(e){let t=0;return(0,i.zI)(new Map(e.map(({name:e,count:r})=>{const i=[e,t];return 16===r?t+=4:9===r?t+=3:++t,i})))}function o(e){const t=new Map;let r=0;return e.forEach(e=>e.forEach(({name:e,count:i})=>{t.set(e,r),16===i?r+=4:9===i?r+=3:++r})),t}},87170:(e,t,r)=>{r.d(t,{V:()=>T});var i=r(9093),n=r(38954),o=r(97146),a=r(57917),s=r(29920),l=r(78754),c=r(51850),d=r(4341),u=r(11964);function h(e,t,r){return(0,n.e)(p,t,e),(0,n.e)(m,r,e),.5*(0,n.b)((0,n.i)(p,p,m))}r(32114),new d.I(u.vt),new d.I(()=>function(e){return e?{p0:(0,c.o8)(e.p0),p1:(0,c.o8)(e.p1),p2:(0,c.o8)(e.p2)}:{p0:(0,c.vt)(),p1:(0,c.vt)(),p2:(0,c.vt)()}}());const p=(0,c.vt)(),m=(0,c.vt)(),f=(0,c.vt)(),g=(0,c.vt)(),v=(0,c.vt)(),_=(0,c.vt)();var x=r(24326);class w{constructor(){this.uid=(0,x.c)()}}class y extends w{constructor(e){super(),this.highlightName=e,this.channel=0}}var b=r(620),M=r(94656);class T extends l.F{constructor(e,t,r=null,i=0,n=null,o=-1,a){super(t),this.material=e,this.mapPositions=r,this.type=i,this.olidColor=n,this.edgeIndicesLength=o,this.baseGeometry=a,this._highlights=null,this._highlightOptionsCounts=null,this.visible=!0,this._boundingInfo=null;const s=this.positionAttribute;null!=s&&this.edgeIndicesLength<0&&(this.edgeIndicesLength=s.indices.length)}instantiate(e={}){const t=new T(e.material||this.material,[],this.mapPositions,this.type,this.olidColor,this.edgeIndicesLength,this.baseGeometry);return this._attributes.forEach((e,r)=>{e.exclusive=!1,t._attributes.set(r,e)}),t._boundingInfo=this._boundingInfo,t.transformation=e.transformation||this.transformation,t}getMutableAttribute(e){let t=this._attributes.get(e);return t&&!t.exclusive&&(t={...t,exclusive:!0,data:(0,a.S)(t.data)},this._attributes.set(e,t)),t}setAttributeData(e,t){const r=this._attributes.get(e);r?this._attributes.set(e,{...r,exclusive:!0,data:t}):(0,M.en)()&&console.warn(`Setting undefined attribute ${e} data`)}get positionAttribute(){return this.attributes.get("position")??this.baseGeometry?.attributes.get("position")}get indexCount(){const e=this._attributes.values().next().value?.indices;return e?.length??0}get faceCount(){return this.indexCount/3}get boundingInfo(){return this._boundingInfo??=this._calculateBoundingInfo(),this._boundingInfo}computeAttachmentOrigin(e){return!!(0===this.type?this._computeAttachmentOriginTriangles(e):2===this.type?this._computeAttachmentOriginLines(e):this._computeAttachmentOriginPoints(e))&&(null!=this._transformation&&(0,n.t)(e,e,this._transformation),!0)}_computeAttachmentOriginTriangles(e){return function(e,t){if(!e)return!1;const{size:r,data:i,indices:o}=e;(0,n.j)(t,0,0,0),(0,n.j)(_,0,0,0);let a=0,s=0;for(let e=0;e<o.length-2;e+=3){const l=o[e]*r,c=o[e+1]*r,d=o[e+2]*r;(0,n.j)(f,i[l],i[l+1],i[l+2]),(0,n.j)(g,i[c],i[c+1],i[c+2]),(0,n.j)(v,i[d],i[d+1],i[d+2]);const u=h(f,g,v);u?((0,n.g)(f,f,g),(0,n.g)(f,f,v),(0,n.h)(f,f,1/3*u),(0,n.g)(t,t,f),a+=u):((0,n.g)(_,_,f),(0,n.g)(_,_,g),(0,n.g)(_,_,v),s+=3)}return!(0===s&&0===a||(0!==a?((0,n.h)(t,t,1/a),0):0===s||((0,n.h)(t,_,1/s),0)))}(this.positionAttribute,e)}_computeAttachmentOriginLines(e){const t=this.positionAttribute;return function(e,t,r){if(!e)return!1;(0,n.j)(r,0,0,0),(0,n.j)(_,0,0,0);let i=0,o=0;const{size:a,data:s,indices:l}=e,c=l.length-1,d=c+(t?2:0);for(let e=0;e<d;e+=2){const t=e<c?e+1:0,d=l[e<c?e:c]*a,u=l[t]*a;f[0]=s[d],f[1]=s[d+1],f[2]=s[d+2],g[0]=s[u],g[1]=s[u+1],g[2]=s[u+2],(0,n.h)(f,(0,n.g)(f,f,g),.5);const h=(0,n.F)(f,g);h>0?((0,n.g)(r,r,(0,n.h)(f,f,h)),i+=h):0===i&&((0,n.g)(_,_,f),o++)}return 0!==i?((0,n.h)(r,r,1/i),!0):0!==o&&((0,n.h)(r,_,1/o),!0)}(t,function(e,t){return!(!("isClosed"in e)||!e.isClosed)&&t.indices.length>2}(this.material.parameters,t),e)}_computeAttachmentOriginPoints(e){return function(e,t){if(!e)return!1;const{size:r,data:i,indices:o}=e;(0,n.j)(t,0,0,0);let a=-1,s=0;for(let e=0;e<o.length;e++){const n=o[e]*r;a!==n&&(t[0]+=i[n],t[1]+=i[n+1],t[2]+=i[n+2],s++),a=n}return s>1&&(0,n.h)(t,t,1/s),s>0}(this.positionAttribute,e)}invalidateBoundingInfo(){this._boundingInfo=null}_calculateBoundingInfo(){const e=this.positionAttribute;if(!e||0===e.indices.length)return null;const t=0===this.type?3:1;(0,b.vA)(e.indices.length%t===0,"Indexing error: "+e.indices.length+" not divisible by "+t);const r=(0,o.tM)(e.indices.length/t);return new s.j(r,t,e)}get transformation(){return this._transformation??i.zK}set transformation(e){this._transformation=e&&e!==i.zK?(0,i.o8)(e):null}get highlights(){return this._highlights||C}get hasHighlights(){return(this._highlightOptionsCounts?.size??0)>0}foreachHighlightOptions(e){this._highlightOptionsCounts?.forEach((t,r)=>e(r))}allocateIdAndHighlight(e){const t=new y(e);return this.addHighlight(t)}addHighlight(e){this._ensureHighlights().add(e);const{highlightName:t}=e,r=(this._highlightOptionsCounts?.get(t)??0)+1;return this._ensureHighlightOptionsCounts().set(t,r),e}_ensureHighlights(){let e=this._highlights;return e||(e=new Set,this._highlights=e),e}_ensureHighlightOptionsCounts(){let e=this._highlightOptionsCounts;return e||(e=new Map,this._highlightOptionsCounts=e),e}removeHighlight(e){if(this._highlights?.delete(e)){const{highlightName:t}=e,r=this._highlightOptionsCounts?.get(t)??0;r<=1?this._highlightOptionsCounts?.delete(t):this._ensureHighlightOptionsCounts().set(t,r-1)}}}const C=new Set},89390:(e,t,r)=>{r.d(t,{kA:()=>C,a8:()=>M,eU:()=>T});var i=r(40876),n=(r(44208),r(38954)),o=r(51850),a=r(87317),s=r(91829),l=r(23205),c=r(14314),d=r(31821);function u(e,t){const r=e.fragment,i=void 0!==t.lightingSphericalHarmonicsOrder?t.lightingSphericalHarmonicsOrder:2;0===i?(r.uniforms.add(new l.d("lightingAmbientSH0",({lighting:e})=>(0,n.j)(h,e.sh.r[0],e.sh.g[0],e.sh.b[0]))),r.code.add(d.H`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) {
804
804
  vec3 ambientLight = 0.282095 * lightingAmbientSH0;
805
805
  return ambientLight * (1.0 - ambientOcclusion);
806
806
  }`)):1===i?(r.uniforms.add(new c.I("lightingAmbientSH_R",({lighting:e})=>(0,a.s)(p,e.sh.r[0],e.sh.r[1],e.sh.r[2],e.sh.r[3])),new c.I("lightingAmbientSH_G",({lighting:e})=>(0,a.s)(p,e.sh.g[0],e.sh.g[1],e.sh.g[2],e.sh.g[3])),new c.I("lightingAmbientSH_B",({lighting:e})=>(0,a.s)(p,e.sh.b[0],e.sh.b[1],e.sh.b[2],e.sh.b[3]))),r.code.add(d.H`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) {
@@ -846,7 +846,7 @@ vec3 calculateAmbientRadiance(float ambientOcclusion)
846
846
  {
847
847
  vec3 ambientLight = 1.2 * (0.282095 * lightingAmbientSH0) - 0.2;
848
848
  return ambientLight *= (1.0 - ambientOcclusion) * skyTransmittance;
849
- }`))}const h=(0,o.vt)(),p=(0,s.vt)();var m=r(65836),f=r(98619),g=r(22393),v=r(89786),_=r(32976),x=r(33094);r(34727),(0,o.vt)();const w=.4;function y(e){e.code.add(d.H`float mapChannel(float x, vec2 p) {
849
+ }`))}const h=(0,o.vt)(),p=(0,s.vt)();var m=r(14527),f=r(98619),g=r(22393),v=r(89786),_=r(32976),x=r(33094);r(34727),(0,o.vt)();const w=.4;function y(e){e.code.add(d.H`float mapChannel(float x, vec2 p) {
850
850
  return (x < p.x) ? mix(0.0, p.y, x/p.x) : mix(p.y, 1.0, (x - p.x) / (1.0 - p.x) );
851
851
  }`),e.code.add(d.H`vec3 blackLevelSoftCompression(vec3 color, float averageAmbientRadiance) {
852
852
  vec2 p = vec2(0.02, 0.0075) * averageAmbientRadiance;
@@ -982,7 +982,7 @@ return normal;
982
982
  float depth = texelFetch(terrainDepthTexture, ivec2(gl_FragCoord.xy), 0).r;
983
983
  float linearDepth = linearizeDepth(depth);
984
984
  ${t?"return viewPosDepth < linearDepth && depth < 1.0;":`if(viewPosDepth ${a?">":"<="} linearDepth) discard;`}
985
- }`)}},97146:(e,t,r)=>{r.d(t,{Dg:()=>o,my:()=>a,tM:()=>d,uW:()=>n});var i=r(34275);function n(e){return o(e,!0)}function o(e,t){if(Array.isArray(e)){if(e.length<i.y9)return e}else if(e.length<i.y9)return Array.from(e);let r=!0,n=!0;return e.some((e,t)=>(r=r&&0===e,n=n&&e===t,!r&&!n)),r?function(e){if(1===e)return l;if(e<i.y9)return new Array(e).fill(0);if(e>h.length){const t=Math.max(2*h.length,e);h=new Uint8Array(t)}return new Uint8Array(h.buffer,0,e)}(e.length):n?d(e.length):(0,i.iu)(e)&&e.BYTES_PER_ELEMENT===Uint16Array.BYTES_PER_ELEMENT?e:function(e,t){for(const r of e){if(r>=65536)return(0,i.iu)(e)?e:new Uint32Array(e);r>=256&&(t=!1)}return t?new Uint8Array(e):new Uint16Array(e)}(e,!t)}function a(e){return e<=i.y9?new Array(e):e<=65536?new Uint16Array(e):new Uint32Array(e)}let s=u(131072);const l=[0],c=(()=>{const e=new Uint16Array(65536);for(let t=0;t<e.length;++t)e[t]=t;return e})();function d(e){return 1===e?l:e<i.y9?Array.from(new Uint16Array(c.buffer,0,e)):e<c.length?new Uint16Array(c.buffer,0,e):(e>s.length&&(s=u(Math.max(2*s.length,e))),new Uint32Array(s.buffer,0,e))}function u(e){const t=new Uint32Array(e);for(let e=0;e<t.length;e++)t[e]=e;return t}let h=new Uint8Array(65536)},97220:(e,t,r)=>{r.d(t,{$:()=>i});class i{constructor(e,t){this._module=e,this._load=t}get(){return this._module}async reload(){return this._module=await this._load(),this._module}}},98353:(e,t,r)=>{r.d(t,{h:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"mat3",2,(i,n,o)=>i.setUniformMatrix3fv(e,t(n,o),r))}}},98619:(e,t,r)=>{r.d(t,{Gc:()=>o,O4:()=>a,Vt:()=>s});var i=r(23205),n=r(31821);function o(e){e.uniforms.add(new i.d("mainLightDirection",e=>e.lighting.mainLight.direction))}function a(e){e.uniforms.add(new i.d("mainLightIntensity",e=>e.lighting.mainLight.intensity))}function s(e){o(e.fragment),a(e.fragment),e.fragment.code.add(n.H`vec3 applyShading(vec3 shadingNormal, float shadow) {
985
+ }`)}},97146:(e,t,r)=>{r.d(t,{Dg:()=>o,my:()=>a,tM:()=>d,uW:()=>n});var i=r(34275);function n(e){return o(e,!0)}function o(e,t){if(Array.isArray(e)){if(e.length<i.y9)return e}else if(e.length<i.y9)return Array.from(e);let r=!0,n=!0;return e.some((e,t)=>(r=r&&0===e,n=n&&e===t,!r&&!n)),r?function(e){if(1===e)return l;if(e<i.y9)return new Array(e).fill(0);if(e>h.length){const t=Math.max(2*h.length,e);h=new Uint8Array(t)}return new Uint8Array(h.buffer,0,e)}(e.length):n?d(e.length):(0,i.iu)(e)&&e.BYTES_PER_ELEMENT===Uint16Array.BYTES_PER_ELEMENT?e:function(e,t){for(const r of e){if(r>=65536)return(0,i.iu)(e)?e:new Uint32Array(e);r>=256&&(t=!1)}return t?new Uint8Array(e):new Uint16Array(e)}(e,!t)}function a(e){return e<=i.y9?new Array(e):e<=65536?new Uint16Array(e):new Uint32Array(e)}let s=u(131072);const l=[0],c=(()=>{const e=new Uint16Array(65536);for(let t=0;t<e.length;++t)e[t]=t;return e})();function d(e){return 1===e?l:e<i.y9?Array.from(new Uint16Array(c.buffer,0,e)):e<c.length?new Uint16Array(c.buffer,0,e):(e>s.length&&(s=u(Math.max(2*s.length,e))),new Uint32Array(s.buffer,0,e))}function u(e){const t=new Uint32Array(e);for(let e=0;e<t.length;e++)t[e]=e;return t}let h=new Uint8Array(65536)},98353:(e,t,r)=>{r.d(t,{h:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"mat3",2,(i,n,o)=>i.setUniformMatrix3fv(e,t(n,o),r))}}},98619:(e,t,r)=>{r.d(t,{Gc:()=>o,O4:()=>a,Vt:()=>s});var i=r(23205),n=r(31821);function o(e){e.uniforms.add(new i.d("mainLightDirection",e=>e.lighting.mainLight.direction))}function a(e){e.uniforms.add(new i.d("mainLightIntensity",e=>e.lighting.mainLight.intensity))}function s(e){o(e.fragment),a(e.fragment),e.fragment.code.add(n.H`vec3 applyShading(vec3 shadingNormal, float shadow) {
986
986
  float dotVal = clamp(dot(shadingNormal, mainLightDirection), 0.0, 1.0);
987
987
  return mainLightIntensity * ((1.0 - shadow) * dotVal);
988
- }`)}},98958:(e,t,r)=>{r.d(t,{w:()=>d,L:()=>u});var i=r(53966),n=r(97768),o=r(49255),a=(r(44208),r(94656));class s{constructor(e,t,r){this._context=e,this.locations=r,this._textures=new Map,this.source=(0,a.en)()?t:null,t.attributeNames.forEach(e=>{r.has(e)||console.error(`Missing VertexAttributeLocation for ${e} used in shader`)}),this._glProgram=e.programCache.acquire(t.generate("vertex",!0),t.generate("fragment",!0),r),this._glProgram.stop=()=>{throw new Error("Wrapped _glProgram used directly")},this.bind=t.generateBind(this),this.bindPass=t.generateBindPass(this),this.bindDraw=t.generateBindDraw(this)}dispose(){this._glProgram.dispose()}get glName(){return this._glProgram.glName}get hasTransformFeedbackVaryings(){return this._glProgram.hasTransformFeedbackVaryings}get compiled(){return this._glProgram.compiled}setUniform1b(e,t){this._glProgram.setUniform1i(e,t?1:0)}setUniform1i(e,t){this._glProgram.setUniform1i(e,t)}setUniform1f(e,t,r){this._glProgram.setUniform1f(e,t,r)}setUniform2fv(e,t,r){this._glProgram.setUniform2fv(e,t,r)}setUniform3fv(e,t,r){this._glProgram.setUniform3fv(e,t,r)}setUniform4fv(e,t,r){this._glProgram.setUniform4fv(e,t,r)}setUniformMatrix3fv(e,t,r){this._glProgram.setUniformMatrix3fv(e,t,!1,r)}setUniformMatrix4fv(e,t,r){this._glProgram.setUniformMatrix4fv(e,t,!1,r)}setUniformMatrices4fv(e,t,r){this._glProgram.setUniformMatrices4fv(e,t,!1,r)}setUniform1fv(e,t,r){this._glProgram.setUniform1fv(e,t,r)}setUniform1iv(e,t){this._glProgram.setUniform1iv(e,t)}setUniform2iv(e,t){this._glProgram.setUniform2iv(e,t)}setUniform3iv(e,t){this._glProgram.setUniform3iv(e,t)}setUniform4iv(e,t){this._glProgram.setUniform4iv(e,t)}assertCompatibleVertexAttributeLocations(e,t){let r=e.locations;if(t){const e=new Map(r);t.forEach((t,i)=>e.set(i,r.size+t)),r=e}r.size!==this.locations.size&&console.error(`VertexAttributeLocations are incompatible: ${r}, ${this.locations}`),this.locations.forEach((e,t)=>{r.get(t)!==e&&console.error(`VertexAttributeLocations are incompatible: Program has ${t} at position ${e}, VAO has it at position ${r.get(t)}.`)})}stop(){this._textures.clear()}bindTexture(e,t){t?.glName||((0,a.en)()&&console.error(`Texture sampler ${e} has no given Texture in ${(new Error).stack} `),t=this._context.emptyTexture);const r=this._ensureTextureUnit(e,t);this._context.useProgram(this),this.setUniform1i(e,r.unit),this._context.bindTexture(t,r.unit)}_ensureTextureUnit(e,t){let r=this._textures.get(e);return null==r?(r={texture:t,unit:this._textures.size},this._textures.set(e,r)):r.texture=t,r}}var l=r(63907),c=r(90644);class d{constructor(e,t,r,o){this.primitiveType=l.WR.TRIANGLES,this.key=t.key,this._program=new s(e.rctx,r.get().build(t),o),this._pipeline=this.initializePipeline(t),this.reload=async a=>{a&&await r.reload(),this.key.equals(t.key)||i.A.getLogger("esri.views.3d.webgl.ShaderTechnique").warn("Configuration was changed after construction, cannot reload shader.",r),(0,n.WD)(this._program),this._program=new s(e.rctx,r.get().build(t),o),this._pipeline=this.initializePipeline(t)}}destroy(){this._program=(0,n.WD)(this._program),this._pipeline=null}get program(){return this._program}get compiled(){return this.program.compiled}ensureAttributeLocations(e){this.program.assertCompatibleVertexAttributeLocations(e)}getPipeline(e,t){return this._pipeline}initializePipeline(e){return(0,c.Ey)({blending:c.RC,colorWrite:c.kn})}}function u(e,t){return(0,o.Dz)(e)?{buffers:[l.$0]}:t??null}}}]);
988
+ }`)}}}]);