@arcgis/core 4.34.0-next.92 → 4.34.0-next.94

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 (348) hide show
  1. package/Color.js +1 -1
  2. package/Ground.js +1 -1
  3. package/WebScene.js +1 -1
  4. package/analysis/ElevationProfile/ElevationProfileDisplayUnits.d.ts +4 -0
  5. package/analysis/ElevationProfile/{ElevationProfileUnits.js → ElevationProfileDisplayUnits.js} +1 -1
  6. package/analysis/ElevationProfile/ElevationProfileUnits.d.ts +1 -1
  7. package/analysis/ElevationProfile/ElevationProfileViewOptions.js +1 -1
  8. package/analysis/ElevationProfileAnalysis.js +1 -1
  9. package/assets/esri/core/workers/RemoteClient.js +1 -1
  10. package/assets/esri/core/workers/chunks/004b13c1db79c9e668b1.js +1 -0
  11. package/assets/esri/core/workers/chunks/{700b5a536f97233bc4af.js → 03b455e9405a8b6fec68.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{a244afea77127e54dd3a.js → 08b0fc6bfe9640ee2525.js} +1 -1
  13. package/assets/esri/core/workers/chunks/0a981061df08da19372c.js +1 -0
  14. package/assets/esri/core/workers/chunks/{db5a985ccc6b7d0ad855.js → 176f56de787bf486be9f.js} +1 -1
  15. package/assets/esri/core/workers/chunks/1fc7df018c8f802565a6.js +1 -0
  16. package/assets/esri/core/workers/chunks/20003728a679479b14dc.js +1 -0
  17. package/assets/esri/core/workers/chunks/20f4c6d8b310ecab97be.js +1 -0
  18. package/assets/esri/core/workers/chunks/25639559336109ff3df1.js +1 -0
  19. package/assets/esri/core/workers/chunks/26081b6486c623735657.js +1 -0
  20. package/assets/esri/core/workers/chunks/2698f656405876f4bd20.js +1 -0
  21. package/assets/esri/core/workers/chunks/{4660798b3b45dcb5cecb.js → 2b9c9a35a6e1f56920b5.js} +2 -2
  22. package/assets/esri/core/workers/chunks/352511dbc67166face40.js +1 -0
  23. package/assets/esri/core/workers/chunks/3acd79a6a0572926a799.js +1 -0
  24. package/assets/esri/core/workers/chunks/3d7923d25734d03a4d27.js +1 -0
  25. package/assets/esri/core/workers/chunks/48133effac2eacc2196e.js +1 -0
  26. package/assets/esri/core/workers/chunks/4dfcd03082be83600f3a.js +1 -0
  27. package/assets/esri/core/workers/chunks/503c81dda242e6077317.js +1 -0
  28. package/assets/esri/core/workers/chunks/{06aed0a5464965be8d52.js → 56b3bb68b61b77138186.js} +1 -1
  29. package/assets/esri/core/workers/chunks/5746c4861af83c1d57a8.js +1 -0
  30. package/assets/esri/core/workers/chunks/5aacd1c6b171c99b41f5.js +1 -0
  31. package/assets/esri/core/workers/chunks/6810ecdeccf4b7eae5e2.js +1 -0
  32. package/assets/esri/core/workers/chunks/6b208f5d423da64c8559.js +1 -0
  33. package/assets/esri/core/workers/chunks/{7a240ab31d9ff2d2c5af.js → 73db6c070b049fe05147.js} +1 -1
  34. package/assets/esri/core/workers/chunks/801451fb572bc5f1f270.js +1 -0
  35. package/assets/esri/core/workers/chunks/82e0d22619dc26920ca9.js +1 -0
  36. package/assets/esri/core/workers/chunks/8f426cb210a4250517d5.js +1 -0
  37. package/assets/esri/core/workers/chunks/94ddf029698991d853b9.js +1 -0
  38. package/assets/esri/core/workers/chunks/97eb2cfc1f036feea9a9.js +1 -0
  39. package/assets/esri/core/workers/chunks/98381404f2d99a1f9341.js +1 -0
  40. package/assets/esri/core/workers/chunks/9adecee0ed2f1df3b0d2.js +1 -0
  41. package/assets/esri/core/workers/chunks/a0fab8cd791c33d3895d.js +1 -0
  42. package/assets/esri/core/workers/chunks/{a85acb948cc7d22be592.js → a410dcf80d17a2383337.js} +1 -1
  43. package/assets/esri/core/workers/chunks/{d9d86cf0500fa29d1d43.js → a98b284b147258629947.js} +1 -1
  44. package/assets/esri/core/workers/chunks/b1ccbc2fef7f7e5e04f7.js +1 -0
  45. package/assets/esri/core/workers/chunks/b5c829e904bc9cb5347d.js +1 -0
  46. package/assets/esri/core/workers/chunks/bec9ddd38c9ab9f2561b.js +1 -0
  47. package/assets/esri/core/workers/chunks/bf9031749d10e7d457b6.js +1 -0
  48. package/assets/esri/core/workers/chunks/bf9d09493fd849ea69fd.js +1 -0
  49. package/assets/esri/core/workers/chunks/c4641c2c130c7b8bcdee.js +1 -0
  50. package/assets/esri/core/workers/chunks/{58e2652810143f509fe1.js → c473b15d4d52f0a63d20.js} +1 -1
  51. package/assets/esri/core/workers/chunks/c8e4fe0e3b109eb80e8e.js +1 -0
  52. package/assets/esri/core/workers/chunks/c9159ebf930af3f336f3.js +1 -0
  53. package/assets/esri/core/workers/chunks/cd0c222a36caa7f80860.js +1 -0
  54. package/assets/esri/core/workers/chunks/ce2fcaa21d6efcdf4da5.js +1 -0
  55. package/assets/esri/core/workers/chunks/d2df6e685d6cffc5f486.js +1 -0
  56. package/assets/esri/core/workers/chunks/{c27783ce7ea51a5e49c5.js → e153b61560a7a869db63.js} +1 -1
  57. package/assets/esri/core/workers/chunks/e2c293331515f3bd0355.js +1 -0
  58. package/assets/esri/core/workers/chunks/{100a0041ee42b0b2fa32.js → e5d974593043d5e2b502.js} +1 -1
  59. package/assets/esri/core/workers/chunks/ec7b156425f25d231078.js +1 -0
  60. package/assets/esri/core/workers/chunks/{1194c2432c31def87db1.js → f71b76c9506178124fa3.js} +1 -1
  61. package/assets/esri/core/workers/chunks/fb456e7425e09df17d8c.js +1 -0
  62. package/assets/esri/core/workers/chunks/{f6806780ca2aa591475a.js → fe1dcf9f81da4adbb1fe.js} +1 -1
  63. package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
  64. package/assets/esri/themes/base/_core.scss +0 -2
  65. package/assets/esri/themes/base/widgets/_OrientedImageryViewerNavigationUI.scss +10 -7
  66. package/assets/esri/themes/dark/main.css +1 -1
  67. package/assets/esri/themes/light/main.css +1 -1
  68. package/assets/esri/themes/light/view.css +1 -1
  69. package/chunks/CutFillComposition.glsl.js +15 -3
  70. package/chunks/CutFillMask.glsl.js +1 -1
  71. package/chunks/WaterSurface.glsl.js +0 -1
  72. package/chunks/bundle.js +1 -1
  73. package/chunks/languageUtils.js +1 -1
  74. package/colorUtils.js +1 -1
  75. package/config.js +1 -1
  76. package/core/CollectionFlattener.js +1 -1
  77. package/editing/sharedTemplates/executor/support/createPresetServiceEdit.js +1 -1
  78. package/geometry/operators/json/graphicBufferOperator.js +1 -1
  79. package/geometry/support/aaBoundingRect.js +1 -1
  80. package/geometry/support/geometryUtils.js +1 -1
  81. package/geometry/support/meshUtils/elevationSampler.js +1 -1
  82. package/geometry/support/meshUtils.js +1 -1
  83. package/geometry/support/triangle.js +1 -1
  84. package/interfaces.d.ts +262 -339
  85. package/kernel.js +1 -1
  86. package/layers/BaseElevationLayer.js +1 -1
  87. package/layers/BaseTileLayer.js +1 -1
  88. package/layers/ElevationLayer.js +1 -1
  89. package/layers/FeatureLayer.js +1 -1
  90. package/layers/GaussianSplatLayer.js +1 -1
  91. package/layers/ImageryTileLayer.js +1 -1
  92. package/layers/ParquetLayer.js +1 -1
  93. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  94. package/layers/graphics/dehydratedFeatureComparison.js +1 -1
  95. package/layers/graphics/sources/ParquetSource.js +1 -1
  96. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  97. package/layers/orientedImagery/transformations/imageToWorld.js +1 -1
  98. package/layers/orientedImagery/transformations/updateElevationUtils.js +1 -1
  99. package/layers/support/ElevationQuery.js +1 -1
  100. package/layers/support/ElevationQueryContext.js +5 -0
  101. package/layers/support/ElevationSampler.js +1 -1
  102. package/layers/support/ElevationTile.js +1 -1
  103. package/layers/support/GeometryDescriptor.js +1 -1
  104. package/layers/support/ParquetEncodingLocation.js +1 -1
  105. package/layers/support/ParquetEncodingWkb.js +1 -1
  106. package/layers/support/RasterBandInfo.js +1 -1
  107. package/layers/support/TileElevationSampler.js +5 -0
  108. package/layers/support/TileInfo.js +1 -1
  109. package/layers/support/TileKey.js +1 -1
  110. package/layers/support/TilemapCache.js +1 -1
  111. package/layers/support/layerUtils.js +1 -1
  112. package/layers/support/parquetEncodingUtils.js +5 -0
  113. package/layers/support/parquetUtils.js +1 -1
  114. package/layers/support/rasterDatasets/InMemoryRaster.js +1 -1
  115. package/networks/UtilityNetwork.js +1 -1
  116. package/networks/support/NetworkSystemLayers.js +1 -1
  117. package/networks/support/typeUtils.js +1 -1
  118. package/package.json +3 -2
  119. package/popup/FieldInfo.js +1 -1
  120. package/popup/content/AttachmentsContent.js +1 -1
  121. package/portal/schemas/definitions.js +1 -1
  122. package/rest/knowledgeGraphService.js +1 -1
  123. package/rest/networks/support/Association.js +1 -1
  124. package/rest/print.js +1 -1
  125. package/support/revision.js +1 -1
  126. package/symbols/cim/CIMSymbolHelper.js +1 -1
  127. package/symbols/cim/cimAnalyzer.js +1 -1
  128. package/symbols/cim/effects/EffectOffset.js +1 -1
  129. package/views/2d/analysis/ElevationProfile/ElevationProfileInputVisualization2D.js +1 -1
  130. package/views/2d/analysis/ElevationProfile/ElevationProfileLineVisualization2D.js +1 -1
  131. package/views/2d/analysis/ElevationProfileAnalysisView2D.js +1 -1
  132. package/views/2d/engine/Stage.js +1 -1
  133. package/views/2d/engine/flow/BrushFlow.js +1 -1
  134. package/views/2d/engine/vectorTiles/VectorTileRendererHelper3D.js +1 -1
  135. package/views/2d/engine/webgl/Overlay.js +1 -1
  136. package/views/2d/engine/webgl/OverlayMultipoint.js +1 -1
  137. package/views/2d/engine/webgl/SpriteMosaic.js +1 -1
  138. package/views/2d/engine/webgl/TextureManager.js +1 -1
  139. package/views/2d/engine/webgl/animatedFormats/AnimatableTextureResource.js +1 -1
  140. package/views/2d/engine/webgl/animatedFormats/utils.js +1 -1
  141. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerMeshWriter.js +1 -1
  142. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedTechnique.js +1 -1
  143. package/views/2d/engine/webgl/shaderGraph/techniques/fill/ComplexFillTechnique.js +1 -1
  144. package/views/2d/engine/webgl/shaderGraph/techniques/fill/ComplexOutlineFillTechnique.js +1 -1
  145. package/views/2d/engine/webgl/shaderGraph/techniques/fill/GradientFillTechnique.js +1 -1
  146. package/views/2d/engine/webgl/shaderGraph/techniques/fill/PatternFillTechnique.js +1 -1
  147. package/views/2d/engine/webgl/shaderGraph/techniques/fill/PatternOutlineFillTechnique.js +1 -1
  148. package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelTechnique.js +1 -1
  149. package/views/2d/engine/webgl/shaderGraph/techniques/line/GradientStrokeTechnique.js +1 -1
  150. package/views/2d/engine/webgl/shaderGraph/techniques/line/TexturedLineTechnique.js +1 -1
  151. package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerTechnique.js +1 -1
  152. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextTechnique.js +1 -1
  153. package/views/2d/engine/webgl/shaderGraph/utils.js +1 -1
  154. package/views/2d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles2D.js +1 -1
  155. package/views/2d/layers/VideoLayerView2D.js +1 -1
  156. package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
  157. package/views/2d/layers/imagery/ImageryTileView2D.js +1 -1
  158. package/views/2d/navigation/actions/Pan.js +1 -1
  159. package/views/3d/analysis/ElevationProfile/ElevationProfileInputVisualization3D.js +1 -1
  160. package/views/3d/analysis/ElevationProfile/ElevationProfileLineSceneComputation.js +1 -1
  161. package/views/3d/analysis/ElevationProfile/ElevationProfileLineVisualization3D.js +1 -1
  162. package/views/3d/analysis/ElevationProfile/ElevationProfileVisualization3D.js +1 -1
  163. package/views/3d/analysis/ElevationProfileAnalysisView3D.js +1 -1
  164. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillVisualization.js +1 -1
  165. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementTool.js +1 -1
  166. package/views/3d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles3D.js +1 -1
  167. package/views/3d/layers/FlowSubView3D.js +1 -1
  168. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  169. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  170. package/views/3d/support/GaussianSplatSortWorker.js +1 -1
  171. package/views/3d/support/flow/FlowSubViewTiles3D.js +1 -1
  172. package/views/3d/support/gaussianSplatting/GaussianSplatDataStore.js +1 -1
  173. package/views/3d/support/hitTest.js +1 -1
  174. package/views/3d/support/pointsOfInterest/StableSurfaceCenter.js +1 -1
  175. package/views/3d/support/popupHitTest.js +1 -1
  176. package/views/3d/terrain/ExtentHelper.js +1 -1
  177. package/views/3d/webgl-engine/core/shaderTechnique/ShaderTechnique.js +1 -1
  178. package/views/3d/webgl-engine/effects/blit/Blit.js +1 -1
  179. package/views/3d/webgl-engine/effects/transparency/OITBlendTechnique.js +1 -1
  180. package/views/3d/webgl-engine/lib/CompositingHelper.js +1 -1
  181. package/views/3d/webgl-engine/lib/CutFillColor.js +1 -1
  182. package/views/3d/webgl-engine/shaders/CutFillComposition.glsl.js +1 -1
  183. package/views/3d/webgl-engine/shaders/GaussianSplatDepthCompositionTechnique.js +1 -1
  184. package/views/PopupView.js +1 -1
  185. package/views/SceneView.js +1 -1
  186. package/views/View.js +1 -1
  187. package/views/View2D.js +1 -1
  188. package/views/Viewport2DMixin.js +1 -1
  189. package/views/analysis/ElevationProfile/ElevationProfileChart.js +1 -1
  190. package/views/analysis/ElevationProfile/ElevationProfileController.js +1 -1
  191. package/views/analysis/ElevationProfile/ElevationProfileHoveredPointsVisualization.js +1 -1
  192. package/views/analysis/ElevationProfile/ElevationProfileLineComputation.js +1 -1
  193. package/views/analysis/ElevationProfile/ElevationProfileLineInputComputation.js +1 -1
  194. package/views/analysis/ElevationProfile/ElevationProfileLineQueryComputation.js +1 -1
  195. package/views/analysis/ElevationProfile/ElevationProfileResult.js +1 -1
  196. package/views/analysis/ElevationProfile/ElevationProfileTool.js +1 -1
  197. package/views/analysis/ElevationProfile/elevationProfileGeometryUtils.js +1 -1
  198. package/views/analysis/ElevationProfile/elevationProfileInputVisualizationUtils.js +1 -1
  199. package/views/analysis/ExclusiveOperationManager.js +5 -0
  200. package/views/interactive/snapping/LineSnapper.js +1 -1
  201. package/views/interactive/snapping/ParallelLineSnapper.js +1 -1
  202. package/views/interactive/snapping/RightAngleSnapper.js +1 -1
  203. package/views/interactive/snapping/RightAngleTriangleSnapper.js +1 -1
  204. package/views/interactive/snapping/featureSources/FeatureServiceSnappingSource.js +1 -1
  205. package/views/interactive/snapping/featureSources/WorkerTileTreeDebugger.js +1 -1
  206. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorker.js +1 -1
  207. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorkerHandle.js +1 -1
  208. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTileStore.js +1 -1
  209. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiledFetcher.js +1 -1
  210. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTilesSimple.js +1 -1
  211. package/views/interactive/snapping/featureSources/featureServiceSource/PendingFeatureTile.js +1 -1
  212. package/views/interactive/snapping/featureSources/queryEngineUtils.js +1 -1
  213. package/views/interactive/snapping/snappingUtils.js +1 -1
  214. package/views/navigation/Navigation.js +1 -1
  215. package/views/popupAdapter.js +5 -0
  216. package/views/support/GroundViewElevationSampler.js +1 -1
  217. package/views/video/VideoOperationalDataView.js +1 -1
  218. package/views/webgl/ContextState.js +1 -1
  219. package/views/webgl/RenderingContext.js +1 -1
  220. package/views/webgl/enums.js +1 -1
  221. package/widgets/Attachments/AttachmentsViewModel.js +1 -1
  222. package/widgets/Attachments.js +1 -1
  223. package/widgets/BasemapGallery/support/basemapCompatibilityUtils.js +1 -1
  224. package/widgets/ElevationProfile/support/chartUtils.js +1 -1
  225. package/widgets/Feature/FeatureExpression.js +1 -1
  226. package/widgets/Feature/FeatureMedia/chartCommon.js +1 -1
  227. package/widgets/Feature/FeatureMedia/pieChart.js +1 -1
  228. package/widgets/Feature/FeatureMedia/xyChart.js +1 -1
  229. package/widgets/Feature/FeatureMedia.js +1 -1
  230. package/widgets/Feature/FeatureViewModel.js +1 -1
  231. package/widgets/Feature.js +1 -1
  232. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  233. package/widgets/FeatureTable/support/ColumnTemplateBase.js +1 -1
  234. package/widgets/FeatureTable/support/TableTemplate.js +1 -1
  235. package/widgets/FeatureTable.js +1 -1
  236. package/widgets/Features/FeaturesViewModel.js +1 -1
  237. package/widgets/Legend/LegendViewModel.js +1 -1
  238. package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
  239. package/widgets/Legend.js +1 -1
  240. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  241. package/widgets/OrientedImageryViewer/components/ImageViewer.js +1 -1
  242. package/widgets/OrientedImageryViewer/components/NavigationUI360.js +1 -1
  243. package/widgets/OrientedImageryViewer/components/NavigationUIPanoramicViewModel.js +1 -1
  244. package/widgets/OrientedImageryViewer/services/DepthImageService.js +5 -0
  245. package/widgets/PanoramicViewer.js +1 -1
  246. package/widgets/Search/SearchResultRenderer.js +1 -1
  247. package/widgets/Search/SearchViewModel.js +1 -1
  248. package/widgets/Search.js +1 -1
  249. package/widgets/Sketch/SketchViewModel.js +1 -1
  250. package/widgets/support/chartUtilsAm5.js +1 -1
  251. package/assets/esri/core/workers/chunks/08374e5805fcedc1cb57.js +0 -1
  252. package/assets/esri/core/workers/chunks/0b24a6c06d1becbb6815.js +0 -1
  253. package/assets/esri/core/workers/chunks/14114be3afd6d292f89c.js +0 -1
  254. package/assets/esri/core/workers/chunks/19f1bfe815896d4983af.js +0 -1
  255. package/assets/esri/core/workers/chunks/22c3a21bc9f32c429c48.js +0 -1
  256. package/assets/esri/core/workers/chunks/2605062e44f2d4e73f14.js +0 -1
  257. package/assets/esri/core/workers/chunks/282c4f3484c605ce7d5e.js +0 -1
  258. package/assets/esri/core/workers/chunks/2e1cc11462846febb3b2.js +0 -1
  259. package/assets/esri/core/workers/chunks/37b5007660535f1c91c6.js +0 -1
  260. package/assets/esri/core/workers/chunks/393274af1804e5b6046a.js +0 -1
  261. package/assets/esri/core/workers/chunks/3b2ef975831eb75b40fb.js +0 -1
  262. package/assets/esri/core/workers/chunks/3ff3e1507220d3869c76.js +0 -1
  263. package/assets/esri/core/workers/chunks/4133ab8720e7e4afa9a6.js +0 -1
  264. package/assets/esri/core/workers/chunks/4d807bfe75108438db83.js +0 -1
  265. package/assets/esri/core/workers/chunks/5ad1985a9e66fb2232ae.js +0 -1
  266. package/assets/esri/core/workers/chunks/5b7a2ee44883b1fb2a5f.js +0 -1
  267. package/assets/esri/core/workers/chunks/614a00a3179f8fe23f45.js +0 -1
  268. package/assets/esri/core/workers/chunks/6aa349e1adf844df4b5b.js +0 -1
  269. package/assets/esri/core/workers/chunks/83065bef261314f9b2c5.js +0 -1
  270. package/assets/esri/core/workers/chunks/8bdbd94a59269e216fba.js +0 -1
  271. package/assets/esri/core/workers/chunks/8cae725e631d922853c8.js +0 -1
  272. package/assets/esri/core/workers/chunks/8f4cfef97716c3502b0f.js +0 -1
  273. package/assets/esri/core/workers/chunks/8ff2daef892881ff2019.js +0 -1
  274. package/assets/esri/core/workers/chunks/9bb6984f24cd5461a754.js +0 -1
  275. package/assets/esri/core/workers/chunks/9f2a3f37fe9b19ef1209.js +0 -1
  276. package/assets/esri/core/workers/chunks/a1196637268b89281780.js +0 -1
  277. package/assets/esri/core/workers/chunks/a6a2d4602dfeb62e0ecc.js +0 -1
  278. package/assets/esri/core/workers/chunks/b240298b8b643a323d34.js +0 -1
  279. package/assets/esri/core/workers/chunks/b47f26d6aa9a2848a677.js +0 -1
  280. package/assets/esri/core/workers/chunks/b661ea374fe38c8e29ca.js +0 -1
  281. package/assets/esri/core/workers/chunks/b8997ae5893afa0298d1.js +0 -1
  282. package/assets/esri/core/workers/chunks/baa48614d9567d5f240d.js +0 -1
  283. package/assets/esri/core/workers/chunks/c20862fe15295a294bbd.js +0 -1
  284. package/assets/esri/core/workers/chunks/c3020747f9001ca6a6e7.js +0 -1
  285. package/assets/esri/core/workers/chunks/c7c76a8a1c47eb62bef1.js +0 -1
  286. package/assets/esri/core/workers/chunks/c95e6bef8c97cf647869.js +0 -1
  287. package/assets/esri/core/workers/chunks/d71836cf70b9604832f1.js +0 -1
  288. package/assets/esri/core/workers/chunks/e99fc64b67bb0c71dc34.js +0 -1
  289. package/assets/esri/core/workers/chunks/eea9d49d55c2d1355497.js +0 -1
  290. package/assets/esri/core/workers/chunks/fb6ebb780bb59e252887.js +0 -1
  291. package/assets/esri/core/workers/chunks/ff6d189ba78980d40bb5.js +0 -1
  292. package/assets/esri/themes/base/widgets/_ButtonMenu.scss +0 -87
  293. package/chunks/Button.js +0 -5
  294. package/chunks/ColorSet.js +0 -5
  295. package/chunks/DefaultTheme.js +0 -5
  296. package/chunks/LineSeries.js +0 -5
  297. package/chunks/ResponsiveTheme.js +0 -5
  298. package/chunks/Theme.js +0 -5
  299. package/chunks/Tick.js +0 -5
  300. package/chunks/Tooltip.js +0 -5
  301. package/chunks/ar.js +0 -5
  302. package/chunks/bg_BG.js +0 -5
  303. package/chunks/bs_BA.js +0 -5
  304. package/chunks/ca_ES.js +0 -5
  305. package/chunks/chartUtilsAm5.js +0 -5
  306. package/chunks/cs_CZ.js +0 -5
  307. package/chunks/da_DK.js +0 -5
  308. package/chunks/de_CH.js +0 -5
  309. package/chunks/de_DE.js +0 -5
  310. package/chunks/el_GR.js +0 -5
  311. package/chunks/en_CA.js +0 -5
  312. package/chunks/en_US.js +0 -5
  313. package/chunks/es_ES.js +0 -5
  314. package/chunks/et_EE.js +0 -5
  315. package/chunks/fi_FI.js +0 -5
  316. package/chunks/fr_FR.js +0 -5
  317. package/chunks/he_IL.js +0 -5
  318. package/chunks/hr_HR.js +0 -5
  319. package/chunks/hu_HU.js +0 -5
  320. package/chunks/id_ID.js +0 -5
  321. package/chunks/it_IT.js +0 -5
  322. package/chunks/ja_JP.js +0 -5
  323. package/chunks/ko_KR.js +0 -5
  324. package/chunks/lt_LT.js +0 -5
  325. package/chunks/lv_LV.js +0 -5
  326. package/chunks/nb_NO.js +0 -5
  327. package/chunks/nl_NL.js +0 -5
  328. package/chunks/pl_PL.js +0 -5
  329. package/chunks/pt_BR.js +0 -5
  330. package/chunks/pt_PT.js +0 -5
  331. package/chunks/ro_RO.js +0 -5
  332. package/chunks/ru_RU.js +0 -5
  333. package/chunks/sk_SK.js +0 -5
  334. package/chunks/sl_SL.js +0 -5
  335. package/chunks/sr_RS.js +0 -5
  336. package/chunks/sv_SE.js +0 -5
  337. package/chunks/th_TH.js +0 -5
  338. package/chunks/tr_TR.js +0 -5
  339. package/chunks/uk_UA.js +0 -5
  340. package/chunks/vi_VN.js +0 -5
  341. package/chunks/zh_Hans.js +0 -5
  342. package/chunks/zh_Hant.js +0 -5
  343. package/widgets/FeatureTable/Grid/support/ButtonMenu.d.ts +0 -4
  344. package/widgets/FeatureTable/Grid/support/ButtonMenu.js +0 -5
  345. package/widgets/FeatureTable/Grid/support/ButtonMenuItem.d.ts +0 -4
  346. package/widgets/FeatureTable/Grid/support/ButtonMenuItem.js +0 -5
  347. package/widgets/FeatureTable/Grid/support/ButtonMenuViewModel.d.ts +0 -4
  348. package/widgets/FeatureTable/Grid/support/ButtonMenuViewModel.js +0 -5
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../../../../../core/Accessor.js";import{equals as r}from"../../../../../../core/arrayUtils.js";import{watch as i}from"../../../../../../core/reactiveUtils.js";import{property as o}from"../../../../../../core/accessorSupport/decorators/property.js";import"../../../../../../core/has.js";import"../../../../../../core/Logger.js";import{subclass as s}from"../../../../../../core/accessorSupport/decorators/subclass.js";import{TileKey as n}from"../../../../../../layers/support/TileKey.js";import{distanceToTile as l}from"../../../../../interactive/snapping/featureSources/featureServiceSource/tileUtils.js";let p=class extends t{get _sortedTilesCoveringView(){const e=(this.view.featureTiles?.tiles?.toArray()??[]).map(c),t=this._effectivePointOfInterest;return null!=t&&e.sort((e,r)=>l(t,e)-l(t,r)),e}get tileInfo(){return this.view.featureTiles?.tilingScheme?.toTileInfo()??null}get tileSize(){return this.view.featureTiles?.tileSize??256}get _effectivePointOfInterest(){const e=this.pointOfInterest;return null!=e?e:this.view.pointsOfInterest?.focus.location}constructor(e){super(e),this.tiles=[],this.pointOfInterest=null}initialize(){this.addHandles([this.view.enableFeatureTiles(),i(()=>this._sortedTilesCoveringView,e=>this._set("tiles",e),{initial:!0,equals:(e,t)=>r(e,t,(e,t)=>e.id===t.id)})])}};function c({lij:[e,t,r],extent:i}){return new n(`${e}/${t}/${r}`,e,t,r,i)}e([o({readOnly:!0})],p.prototype,"tiles",void 0),e([o({readOnly:!0})],p.prototype,"_sortedTilesCoveringView",null),e([o({readOnly:!0})],p.prototype,"tileInfo",null),e([o({readOnly:!0})],p.prototype,"tileSize",null),e([o({constructOnly:!0})],p.prototype,"view",void 0),e([o()],p.prototype,"pointOfInterest",void 0),e([o()],p.prototype,"_effectivePointOfInterest",null),p=e([s("esri.views.3d.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTiles3D")],p);export{p as FeatureServiceTiles3D};
5
+ import{__decorate as e}from"tslib";import t from"../../../../../../core/Accessor.js";import{equals as r}from"../../../../../../core/arrayUtils.js";import{watch as i}from"../../../../../../core/reactiveUtils.js";import{property as o}from"../../../../../../core/accessorSupport/decorators/property.js";import"../../../../../../core/has.js";import"../../../../../../core/Logger.js";import{subclass as s}from"../../../../../../core/accessorSupport/decorators/subclass.js";import{create as n}from"../../../../../../geometry/support/aaBoundingRect.js";import{TileKey as l}from"../../../../../../layers/support/TileKey.js";import{distanceToTile as p}from"../../../../../interactive/snapping/featureSources/featureServiceSource/tileUtils.js";let c=class extends t{get _sortedTilesCoveringView(){const e=(this.view.featureTiles?.tiles?.toArray()??[]).map(a),t=this._effectivePointOfInterest;return null!=t&&e.sort((e,r)=>p(t,e)-p(t,r)),e}get tileInfo(){return this.view.featureTiles?.tilingScheme?.toTileInfo()??null}get tileSize(){return this.view.featureTiles?.tileSize??256}get _effectivePointOfInterest(){const e=this.pointOfInterest;return null!=e?e:this.view.pointsOfInterest?.focus.location}constructor(e){super(e),this.tiles=[],this.pointOfInterest=null}initialize(){this.addHandles([this.view.enableFeatureTiles(),i(()=>this._sortedTilesCoveringView,e=>this._set("tiles",e),{initial:!0,equals:(e,t)=>r(e,t,(e,t)=>e.id===t.id)})])}};function a({lij:[e,t,r],extent:i}){return new l(e,t,r,i??n())}e([o({readOnly:!0})],c.prototype,"tiles",void 0),e([o({readOnly:!0})],c.prototype,"_sortedTilesCoveringView",null),e([o({readOnly:!0})],c.prototype,"tileInfo",null),e([o({readOnly:!0})],c.prototype,"tileSize",null),e([o({constructOnly:!0})],c.prototype,"view",void 0),e([o()],c.prototype,"pointOfInterest",void 0),e([o()],c.prototype,"_effectivePointOfInterest",null),c=e([s("esri.views.3d.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTiles3D")],c);export{c as FeatureServiceTiles3D};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{equals as t}from"../../../core/arrayUtils.js";import"../../../core/has.js";import{removeMaybe as i,abortMaybe as r}from"../../../core/maybe.js";import{debounce as s,ignoreAbortErrors as o,throwIfAborted as n}from"../../../core/promiseUtils.js";import{watch as l,when as a,sync as u,whenOnce as p}from"../../../core/reactiveUtils.js";import{addFrameTask as d}from"../../../core/scheduling.js";import{Seconds as h,secondsFromMilliseconds as c}from"../../../core/time.js";import{getMetersPerVerticalUnitForSR as m}from"../../../core/unitUtils.js";import{property as f}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import{subclass as _}from"../../../core/accessorSupport/decorators/subclass.js";import{getReferenceEllipsoid as g}from"../../../geometry/ellipsoidUtils.js";import{projectOrLoad as y}from"../../../geometry/projectionUtils.js";import{fromExtent as w,intersection as v,toExtent as T,intersects as b}from"../../../geometry/support/aaBoundingRect.js";import{getInfo as R}from"../../../geometry/support/spatialReferenceUtils.js";import S from"../../../symbols/support/ElevationInfo.js";import{simulationSettingsEqual as j,getPositions as L,getFlowSimulationSettings as A}from"../../2d/engine/flow/utils.js";import U from"./SubView3D.js";import{makeScheduleFunction as P}from"./support/makeScheduleFunction.js";import{thresholdForLoadingAllTiles as x,fadeOutTime as E,fadeInTime as I,defaultTransitionDuration as k,transitionDurationFactor as M,averageLoadingTimeSmoothingFactor as V}from"../support/flow/constants.js";import{isFullExtent as C,FlowQuery3D as q,wrappedWidth as z}from"../support/flow/FlowQuery3D.js";import{FlowWorkerHandle as F}from"../support/flow/FlowWorkerHandle.js";import{materialParametersFromRenderer as D,createStreamlineGeometry as B}from"../support/flow/geometryUtils.js";import{boundingRectOfTiles as W}from"../support/flow/loadUtils.js";import{StreamlineResources3DOverlay as G}from"../support/flow/StreamlineResources3DOverlay.js";import{StreamlineResources3DShape as H}from"../support/flow/StreamlineResources3DShape.js";import{tilesAreRelated as O}from"../terrain/tileUtils.js";import{isScreenSizePerspectiveEnabled as N}from"../webgl-engine/lib/screenSizePerspectiveUtils.js";import{RibbonLineMaterial as Q}from"../webgl-engine/materials/RibbonLineMaterial.js";import{isInEffectiveScaleRange as J,hasLayerBasedScaleVisibility as K}from"../../support/layerViewUtils.js";import{TaskPriority as X}from"../../support/Scheduler.js";let Y=class extends U{constructor(e){super(e),this.type="flow",this.renderedTiles=null,this.requireLoad=!1,this.workerHandle=null,this._averageLoadingTime=h(0),this._abortController=null,this._frameTask=null,this._tilesUpdateIsWaiting=!1,this._transitionEnabled=!0,this._debugAllowAutoLoading=!0,this.emissiveStrength=0,this._overrideMaterialParameters=null,this._overrideSimulationSettings=null,this._updateTask=null,this._debouncedTileUpdate=s(async()=>{const{allTiles:e}=this.surface,t=this._getTileFilterFunction(),i=new Set;function*r(r){for(let s=0;s<e.length;++s){const o=e.at(s);t(o)&&i.add(o),r.madeProgress(),r.done&&(r=yield)}}await this._frameTask.scheduleGenerator(r),this.renderedTiles=i}),this._transitionEnabled=!0}initialize(){const{surface:e,view:t}=this,{resourceController:i}=t;this.workerHandle=new F(P(i)),this._frameTask=i.scheduler.registerTask(X.FLOW_GENERATOR),this._updateTask=d({update:this._update.bind(this)}),this.addHandles([l(()=>this._simulationSettings,()=>this.triggerLoad(),{sync:!0,equals:(e,t)=>null==e&&null==t||null!=e&&null!=t&&j(e,t)}),l(()=>{const{elevationInfo:e}=this;return[this._clippingArea,this._visible,this._draped,this.view.state.contentPixelRatio,this.view.viewingMode,e?.mode,e?.offset,e?.unit]},()=>this.triggerLoad(),u),l(()=>this._materialParameters,e=>{this._resources?.setMaterialParameters(e),this._lastResources?.setMaterialParameters(e)}),e.on("tiles-changed",()=>this._triggerTilesUpdate()),t.enableFeatureTiles(),l(()=>[this._dataBounds,this._featureTilesBounds,this._loadAllTiles],()=>this._triggerTilesUpdate()),l(()=>this._flowRenderer,(e,t)=>{const i=t?.visualVariables??[],r=e?.visualVariables??[];r.length===i.length&&r.every((e,t)=>e.type===i[t].type)||this.clear()}),a(()=>!t.featureTiles?.updating,()=>this._triggerTilesUpdate())]),this._triggerTilesUpdate()}destroy(){this._updateTask=i(this._updateTask),this.abort(),this.clear()}abort(){this._abortController=r(this._abortController),this.requireLoad=!1}get _clippingArea(){const e=y(this.view.clippingArea,this.surface.spatialReference).geometry;return null==e?null:w(e)}get _dataBounds(){const e=y(this.layer.fullExtent,this.surface.spatialReference).geometry;return null==e?null:w(e)}get _draped(){return"on-the-ground"===this.elevationInfo.mode}get _ellipsoidRadius(){return g(this.view.spatialReference).radius}get _loadAllTiles(){const{position:e}=this.view.camera,t=e.z;if(null==t)return!1;return t*m(e.spatialReference)/this._ellipsoidRadius>=x}get _featureTilesBounds(){const e=this.view.featureTiles?.filterExtent,t=y(e,this.surface.spatialReference).geometry;return null==t?null:w(t)}get _flowRenderer(){const e=this.layer.renderer;return"flow"!==e?.type?null:e}get _materialParameters(){return{...D(this._flowRenderer,this.layerView.fullOpacity,this.emissiveStrength),fadeInTime:I,fadeOutTime:E,...this._overrideMaterialParameters,hasSlicePlane:this.layerView.slicePlaneEnabled,screenSizePerspective:!this._draped&&N(this.layer.screenSizePerspectiveEnabled)?this.view.screenSizePerspective.parameters:null}}get _opacity(){return this.layerView.fullOpacity}get _transitionDuration(){const{_averageLoadingTime:e}=this;return h(0===e?k:this._averageLoadingTime*M)}get _visible(){const e=this._flowRenderer?.color;return this.visibleAtCurrentScale&&this.layer.effectiveVisible&&this._opacity>0&&(null==e||e.a>0)}get elevationInfo(){return this.layer.elevationInfo??Z}startPositions(e){if(!this._transitionEnabled)return[];const{_flowRenderer:t,_resources:i}=this;return null==t||null==i?[]:L(i.streamlines,i.query,e,t.flowSpeed)}get needsMagnitude(){return this._flowRenderer?.hasVisualVariables()??!1}get spatialReferenceInfo(){return R(this.surface.spatialReference)}get layer(){return this.layerView.layer}get updating(){return this.updatingHandles.updating||this.requireLoad}get visibleAtCurrentScale(){return!K()||J(this.layer.effectiveScaleRange,this.view.scale)}get _simulationSettings(){const{_flowRenderer:e,_overrideSimulationSettings:t}=this;if(null==e)return null;let i=A(e);return i.segmentLength=i.lineCollisionWidth/2,i.onlyForwardTracing=!1,null!=t&&(i={...i,...t}),i}getSimulationSettings(e){const{_simulationSettings:t,spatialReferenceInfo:i}=this;if(null==t)return null;const r="global"===this.view.viewingMode&&null!=i&&C(e.extent.xmin,e.extent.xmax,i);return{...t,wrapAround:r}}get surface(){return this.view.basemapTerrain}doRefresh(){this.triggerLoad()}clear(){this._resources?.detach(),this._resources=null,this._lastResources?.detach(),this._lastResources=null}_update(e){if(!this.requireLoad||this.updatingHandles.updating)return;const t=c(e.time);if(this._transitionEnabled&&!this._lastResourceIsTransitioned(t))return;const{renderedTiles:i}=this;if(null==i||0===i.size)return;const r=async()=>{const e=performance.now();await this._load(i,t,this._transitionDuration);const r=h((performance.now()-e)/1e3);this._updateAverageLoadingTime(r)};this.updatingHandles.addPromise(o(r())),this.requireLoad=!1}_updateAverageLoadingTime(e){const t=V;this._averageLoadingTime=h(t*e+(1-t)*this._averageLoadingTime)}triggerLoad(){this._debugAllowAutoLoading&&(this.requireLoad=!0)}async _load(e,t,i){const{view:r}=this;if(!this._visible)return void this.clear();if(0===e.size)return;const s=this._computeExtent(e);if(null==s)return;const o=this._transitionEnabled&&null!=this._resources?h(t+i):t,l=new q(s,this.layerView.timeExtent,this._viewSizeWithEqualRatio(s),r.state.contentPixelRatio,o);null==this._abortController&&(this._abortController=new AbortController);const a=this._abortController,u=await this._loadStreamlines(l,a.signal);if(n(a.signal),this._visible&&null!=u){u.attach(),this._lastResources?.detach(),this._transitionEnabled?this._lastResources=this._resources:this._resources?.detach(),this._resources=u;const e=performance.now()/1e3,t=this._transitionEnabled&&e>o?e:o;null!=this._lastResources&&(this._lastResources.endTime=t),this._resources.startTime=t}}async _loadStreamlines(e,t){const i=await this.fetchDataAndGenerateStreamlines(e,t);if(null==i||0===i.length)return null;const{geometries:r,material:s}=await this._createGeometry(e,i);return this._draped?new G(e,i,s,r,this.view.overlayManager):new H(e,i,s,r,this.view.stage)}async fetchDataAndGenerateStreamlines(e,t){return null}async _createGeometry(e,t){const i=new Q(this._materialParameters,this.view.state.isGlobal),r=new Array,{elevationInfo:s,_draped:o,view:n}=this;function*l(l){for(let a=0;a<t.length;++a)r.push(B(n,e,t[a],s,i,o)),l.madeProgress(),l.done&&(l=yield)}return await this._frameTask.scheduleGenerator(l),{geometries:r,material:i}}_computeExtent(e){const{spatialReference:t}=this.surface;if(null==t)return null;const i=W(e,this.spatialReferenceInfo);return null==i?null:(v(i,this._clippingArea,i),T(i,t))}_triggerTilesUpdate(){if(this._tilesUpdateIsWaiting)return;this._tilesUpdateIsWaiting=!0;const e=async()=>{await p(()=>this.view.stationary),this._tilesUpdateIsWaiting=!1,await this._debouncedTileUpdate()};this.updatingHandles.addPromise(o(e()))}_getTileFilterFunction(){const{_dataBounds:e,view:i,_featureTilesBounds:r}=this;if(this._loadAllTiles)return t=>t.leaf&&$(e,t.extent);const s=t=>t.rendered&&t.visible&&$(e,t.extent),{featureTiles:o}=i;if(!o)return s;const n=o.tiles.filter(e=>e.measures.visible);return e=>s(e)&&$(r,e.extent)&&n.some(({lij:i})=>t(i,e.lij)||O(i,e.lij))}_viewSizeWithEqualRatio(e){const t=z(e.xmin,e.xmax,this.spatialReferenceInfo?.valid)/(e.ymax-e.ymin),[i,r]=this.view.size;return i<r?[i,Math.floor(i/t)]:[Math.floor(r*t),r]}_lastResourceIsTransitioned(e){const{_lastResources:t,_resources:i,_flowRenderer:r}=this;if(null==t||null==i||null==r)return!0;return i.startTime+E<e}get test(){}};e([f()],Y.prototype,"type",void 0),e([f()],Y.prototype,"renderedTiles",void 0),e([f()],Y.prototype,"_resources",void 0),e([f()],Y.prototype,"_lastResources",void 0),e([f()],Y.prototype,"requireLoad",void 0),e([f()],Y.prototype,"_averageLoadingTime",void 0),e([f()],Y.prototype,"emissiveStrength",void 0),e([f()],Y.prototype,"_clippingArea",null),e([f()],Y.prototype,"_dataBounds",null),e([f()],Y.prototype,"_draped",null),e([f()],Y.prototype,"_ellipsoidRadius",null),e([f()],Y.prototype,"_loadAllTiles",null),e([f()],Y.prototype,"_featureTilesBounds",null),e([f()],Y.prototype,"_flowRenderer",null),e([f()],Y.prototype,"_materialParameters",null),e([f()],Y.prototype,"_opacity",null),e([f()],Y.prototype,"_transitionDuration",null),e([f()],Y.prototype,"_visible",null),e([f()],Y.prototype,"elevationInfo",null),e([f()],Y.prototype,"needsMagnitude",null),e([f()],Y.prototype,"spatialReferenceInfo",null),e([f()],Y.prototype,"layer",null),e([f()],Y.prototype,"updating",null),e([f()],Y.prototype,"visibleAtCurrentScale",null),e([f()],Y.prototype,"_overrideMaterialParameters",void 0),e([f()],Y.prototype,"_overrideSimulationSettings",void 0),e([f()],Y.prototype,"_simulationSettings",null),e([f()],Y.prototype,"surface",null),Y=e([_("esri.views.3d.layers.FlowSubView3D")],Y);const Z=new S({mode:"on-the-ground"});function $(e,t){return null==e||null==t||b(e,t)}export{Y as default};
5
+ import{__decorate as e}from"tslib";import{equals as t}from"../../../core/arrayUtils.js";import"../../../core/has.js";import{removeMaybe as i,abortMaybe as r}from"../../../core/maybe.js";import{debounce as s,ignoreAbortErrors as o,throwIfAborted as n}from"../../../core/promiseUtils.js";import{watch as l,when as a,sync as u,whenOnce as d}from"../../../core/reactiveUtils.js";import{addFrameTask as p}from"../../../core/scheduling.js";import{Seconds as h,secondsFromMilliseconds as c}from"../../../core/time.js";import{getMetersPerVerticalUnitForSR as m}from"../../../core/unitUtils.js";import{property as f}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import{subclass as _}from"../../../core/accessorSupport/decorators/subclass.js";import{getReferenceEllipsoid as g}from"../../../geometry/ellipsoidUtils.js";import{projectOrLoad as y}from"../../../geometry/projectionUtils.js";import{fromExtent as w,intersection as v,toExtent as T,intersects as b}from"../../../geometry/support/aaBoundingRect.js";import{getInfo as R}from"../../../geometry/support/spatialReferenceUtils.js";import S from"../../../symbols/support/ElevationInfo.js";import{simulationSettingsEqual as j,getPositions as L,getFlowSimulationSettings as A}from"../../2d/engine/flow/utils.js";import U from"./SubView3D.js";import{makeScheduleFunction as P}from"./support/makeScheduleFunction.js";import{thresholdForLoadingAllTiles as x,fadeOutTime as E,fadeInTime as I,defaultTransitionDuration as k,transitionDurationFactor as M,averageLoadingTimeSmoothingFactor as V}from"../support/flow/constants.js";import{isFullExtent as C,FlowQuery3D as q,wrappedWidth as z}from"../support/flow/FlowQuery3D.js";import{FlowWorkerHandle as F}from"../support/flow/FlowWorkerHandle.js";import{materialParametersFromRenderer as D,createStreamlineGeometry as B}from"../support/flow/geometryUtils.js";import{boundingRectOfTiles as W}from"../support/flow/loadUtils.js";import{StreamlineResources3DOverlay as G}from"../support/flow/StreamlineResources3DOverlay.js";import{StreamlineResources3DShape as H}from"../support/flow/StreamlineResources3DShape.js";import{tilesAreRelated as O}from"../terrain/tileUtils.js";import{isScreenSizePerspectiveEnabled as N}from"../webgl-engine/lib/screenSizePerspectiveUtils.js";import{RibbonLineMaterial as Q}from"../webgl-engine/materials/RibbonLineMaterial.js";import{isInEffectiveScaleRange as J,hasLayerBasedScaleVisibility as K}from"../../support/layerViewUtils.js";import{TaskPriority as X}from"../../support/Scheduler.js";let Y=class extends U{constructor(e){super(e),this.type="flow",this.renderedTiles=null,this.requireLoad=!1,this.workerHandle=null,this._averageLoadingTime=h(0),this._abortController=null,this._frameTask=null,this._tilesUpdateIsWaiting=!1,this._transitionEnabled=!0,this._debugAllowAutoLoading=!0,this.emissiveStrength=0,this._overrideMaterialParameters=null,this._overrideSimulationSettings=null,this._updateTask=null,this._debouncedTileUpdate=s(async()=>{const{allTiles:e}=this.surface,t=this._getTileFilterFunction(),i=new Set;function*r(r){for(let s=0;s<e.length;++s){const o=e.at(s);t(o)&&i.add(o),r.madeProgress(),r.done&&(r=yield)}}await this._frameTask.scheduleGenerator(r),this.renderedTiles=i}),this._transitionEnabled=!0}initialize(){const{surface:e,view:t}=this,{resourceController:i}=t;this.workerHandle=new F(P(i)),this._frameTask=i.scheduler.registerTask(X.FLOW_GENERATOR),this._updateTask=p({update:this._update.bind(this)}),this.addHandles([l(()=>this._simulationSettings,()=>this.triggerLoad(),{sync:!0,equals:(e,t)=>null==e&&null==t||null!=e&&null!=t&&j(e,t)}),l(()=>{const{elevationInfo:e}=this;return[this._clippingArea,this._visible,this._draped,this.view.state.contentPixelRatio,this.view.viewingMode,e?.mode,e?.offset,e?.unit]},()=>this.triggerLoad(),u),l(()=>this._materialParameters,e=>{this._resources?.setMaterialParameters(e),this._lastResources?.setMaterialParameters(e)}),e.on("tiles-changed",()=>this._triggerTilesUpdate()),t.enableFeatureTiles(),l(()=>[this._dataBounds,this._featureTilesBounds,this._loadAllTiles],()=>this._triggerTilesUpdate()),l(()=>this._flowRenderer,(e,t)=>{const i=t?.visualVariables??[],r=e?.visualVariables??[];r.length===i.length&&r.every((e,t)=>e.type===i[t].type)||this.clear()}),a(()=>!t.featureTiles?.updating,()=>this._triggerTilesUpdate())]),this._triggerTilesUpdate()}destroy(){this._updateTask=i(this._updateTask),this.abort(),this.clear()}abort(){this._abortController=r(this._abortController),this.requireLoad=!1}get _clippingArea(){const e=y(this.view.clippingArea,this.surface.spatialReference).geometry;return null==e?null:w(e)}get _dataBounds(){const e=y(this.layer.fullExtent,this.surface.spatialReference).geometry;return null==e?null:w(e)}get _draped(){return"on-the-ground"===this.elevationInfo.mode}get _ellipsoidRadius(){return g(this.view.spatialReference).radius}get _loadAllTiles(){const{position:e}=this.view.camera,t=e.z;if(null==t)return!1;return t*m(e.spatialReference)/this._ellipsoidRadius>=x}get _featureTilesBounds(){const e=this.view.featureTiles?.filterExtent,t=y(e,this.surface.spatialReference).geometry;return null==t?null:w(t)}get _flowRenderer(){const e=this.layer.renderer;return"flow"!==e?.type?null:e}get _materialParameters(){return{...D(this._flowRenderer,this.layerView.fullOpacity,this.emissiveStrength),fadeInTime:I,fadeOutTime:E,...this._overrideMaterialParameters,hasSlicePlane:this.layerView.slicePlaneEnabled,screenSizePerspective:!this._draped&&N(this.layer.screenSizePerspectiveEnabled)?this.view.screenSizePerspective.parameters:null}}get _opacity(){return this.layerView.fullOpacity}get _transitionDuration(){const{_averageLoadingTime:e}=this;return h(0===e?k:this._averageLoadingTime*M)}get _visible(){const e=this._flowRenderer?.color;return this.visibleAtCurrentScale&&this.layer.effectiveVisible&&this._opacity>0&&(null==e||e.a>0)}get elevationInfo(){return this.layer.elevationInfo??Z}startPositions(e){if(!this._transitionEnabled)return[];const{_flowRenderer:t,_resources:i}=this;return null==t||null==i?[]:L(i.streamlines,i.query,e,t.flowSpeed)}get needsMagnitude(){return this._flowRenderer?.hasVisualVariables()??!1}get spatialReferenceInfo(){return R(this.surface.spatialReference)}get layer(){return this.layerView.layer}get readyToLoad(){return null!=this.renderedTiles&&this.renderedTiles.size>0}get updating(){return this.updatingHandles.updating||this.requireLoad}get visibleAtCurrentScale(){return!K()||J(this.layer.effectiveScaleRange,this.view.scale)}get _simulationSettings(){const{_flowRenderer:e,_overrideSimulationSettings:t}=this;if(null==e)return null;let i=A(e);return i.segmentLength=i.lineCollisionWidth/2,i.onlyForwardTracing=!1,null!=t&&(i={...i,...t}),i}getSimulationSettings(e){const{_simulationSettings:t,spatialReferenceInfo:i}=this;if(null==t)return null;const r="global"===this.view.viewingMode&&null!=i&&C(e.extent.xmin,e.extent.xmax,i);return{...t,wrapAround:r}}get surface(){return this.view.basemapTerrain}doRefresh(){this.triggerLoad()}clear(){this._resources?.detach(),this._resources=null,this._lastResources?.detach(),this._lastResources=null}_update(e){if(!this.requireLoad||this.updatingHandles.updating)return;const t=c(e.time);if(this._transitionEnabled&&!this._lastResourceIsTransitioned(t))return;if(!this.readyToLoad)return;const i=async()=>{const e=performance.now();await this._load(this.renderedTiles,t,this._transitionDuration);const i=h((performance.now()-e)/1e3);this._updateAverageLoadingTime(i)};this.updatingHandles.addPromise(o(i())),this.requireLoad=!1}_updateAverageLoadingTime(e){const t=V;this._averageLoadingTime=h(t*e+(1-t)*this._averageLoadingTime)}triggerLoad(){this._debugAllowAutoLoading&&(this.requireLoad=!0)}async _load(e,t,i){const{view:r}=this;if(!this._visible)return void this.clear();if(0===e.size)return;const s=this._computeExtent(e);if(null==s)return;const o=this._transitionEnabled&&null!=this._resources?h(t+i):t,l=new q(s,this.layerView.timeExtent,this._viewSizeWithEqualRatio(s),r.state.contentPixelRatio,o);null==this._abortController&&(this._abortController=new AbortController);const a=this._abortController,u=await this._loadStreamlines(l,a.signal);if(n(a.signal),this._visible&&null!=u){u.attach(),this._lastResources?.detach(),this._transitionEnabled?this._lastResources=this._resources:this._resources?.detach(),this._resources=u;const e=performance.now()/1e3,t=this._transitionEnabled&&e>o?e:o;null!=this._lastResources&&(this._lastResources.endTime=t),this._resources.startTime=t}}async _loadStreamlines(e,t){const i=await this.fetchDataAndGenerateStreamlines(e,t);if(null==i||0===i.length)return null;const{geometries:r,material:s}=await this._createGeometry(e,i);return this._draped?new G(e,i,s,r,this.view.overlayManager):new H(e,i,s,r,this.view.stage)}async fetchDataAndGenerateStreamlines(e,t){return null}async _createGeometry(e,t){const i=new Q(this._materialParameters,this.view.state.isGlobal),r=new Array,{elevationInfo:s,_draped:o,view:n}=this;function*l(l){for(let a=0;a<t.length;++a)r.push(B(n,e,t[a],s,i,o)),l.madeProgress(),l.done&&(l=yield)}return await this._frameTask.scheduleGenerator(l),{geometries:r,material:i}}_computeExtent(e){const{spatialReference:t}=this.surface;if(null==t)return null;const i=W(e,this.spatialReferenceInfo);return null==i?null:(v(i,this._clippingArea,i),T(i,t))}_triggerTilesUpdate(){if(this._tilesUpdateIsWaiting)return;this._tilesUpdateIsWaiting=!0;const e=async()=>{await d(()=>this.view.stationary),this._tilesUpdateIsWaiting=!1,await this._debouncedTileUpdate()};this.updatingHandles.addPromise(o(e()))}_getTileFilterFunction(){const{_dataBounds:e,view:i,_featureTilesBounds:r}=this;if(this._loadAllTiles)return t=>t.leaf&&$(e,t.extent);const s=t=>t.rendered&&t.visible&&$(e,t.extent),{featureTiles:o}=i;if(!o)return s;const n=o.tiles.filter(e=>e.measures.visible);return e=>s(e)&&$(r,e.extent)&&n.some(({lij:i})=>t(i,e.lij)||O(i,e.lij))}_viewSizeWithEqualRatio(e){const t=z(e.xmin,e.xmax,this.spatialReferenceInfo?.valid)/(e.ymax-e.ymin),[i,r]=this.view.size;return i<r?[i,Math.floor(i/t)]:[Math.floor(r*t),r]}_lastResourceIsTransitioned(e){const{_lastResources:t,_resources:i,_flowRenderer:r}=this;if(null==t||null==i||null==r)return!0;return i.startTime+E<e}get test(){}};e([f()],Y.prototype,"type",void 0),e([f()],Y.prototype,"renderedTiles",void 0),e([f()],Y.prototype,"_resources",void 0),e([f()],Y.prototype,"_lastResources",void 0),e([f()],Y.prototype,"requireLoad",void 0),e([f()],Y.prototype,"_averageLoadingTime",void 0),e([f()],Y.prototype,"emissiveStrength",void 0),e([f()],Y.prototype,"_clippingArea",null),e([f()],Y.prototype,"_dataBounds",null),e([f()],Y.prototype,"_draped",null),e([f()],Y.prototype,"_ellipsoidRadius",null),e([f()],Y.prototype,"_loadAllTiles",null),e([f()],Y.prototype,"_featureTilesBounds",null),e([f()],Y.prototype,"_flowRenderer",null),e([f()],Y.prototype,"_materialParameters",null),e([f()],Y.prototype,"_opacity",null),e([f()],Y.prototype,"_transitionDuration",null),e([f()],Y.prototype,"_visible",null),e([f()],Y.prototype,"elevationInfo",null),e([f()],Y.prototype,"needsMagnitude",null),e([f()],Y.prototype,"spatialReferenceInfo",null),e([f()],Y.prototype,"layer",null),e([f()],Y.prototype,"updating",null),e([f()],Y.prototype,"visibleAtCurrentScale",null),e([f()],Y.prototype,"_overrideMaterialParameters",void 0),e([f()],Y.prototype,"_overrideSimulationSettings",void 0),e([f()],Y.prototype,"_simulationSettings",null),e([f()],Y.prototype,"surface",null),Y=e([_("esri.views.3d.layers.FlowSubView3D")],Y);const Z=new S({mode:"on-the-ground"});function $(e,t){return null==e||null==t||b(e,t)}export{Y as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../Color.js";import"../../../../core/has.js";import{deg2rad as t}from"../../../../core/mathUtils.js";import{releaseMaybe as r}from"../../../../core/maybe.js";import{isPromiseLike as o}from"../../../../core/promiseUtils.js";import{normalFromMat4 as n,fromMat4 as a}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{fromTranslation as i,multiply as l,invert as c,getTranslation as u}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as m,IDENTITY as f,clone as p}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{ONES as h}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{i as d,f as g,g as x,t as _,o as y,n as T,b,d as v,h as w,e as C}from"../../../../chunks/vec32.js";import{create as M,ONES as j,ZEROS as A}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as R}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{canProjectWithoutEngine as P}from"../../../../geometry/projectionUtils.js";import{computeTranslationToOriginAndRotation as S}from"../../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{projectBuffer as I}from"../../../../geometry/projection/projectBuffer.js";import{projectVectorToVector as B}from"../../../../geometry/projection/projectVectorToVector.js";import{fromBuffer as U,create as E,intersectsClippingArea as O}from"../../../../geometry/support/aaBoundingBox.js";import{newFloatArray as F}from"../../../../geometry/support/FloatArray.js";import{getZeroIndexArray as V,getContinuousIndexArray as $}from"../../../../geometry/support/Indices.js";import G from"../../../../geometry/support/MeshComponent.js";import D from"../../../../geometry/support/MeshMaterialMetallicRoughness.js";import L from"../../../../geometry/support/MeshTextureTransform.js";import{isRelativeVertexSpace as N,isAbsoluteVertexSpace as H}from"../../../../geometry/support/meshVertexSpaceUtils.js";import{equals as k,isPlateCarree as z}from"../../../../geometry/support/spatialReferenceUtils.js";import{t as q}from"../../../../chunks/vec3.js";import{transformNormal as W,transformVectorENUPlateCarree as Y,transformVectorWMPlateCarree as J,projectNormalToPCPF as K,transformTangent as Q,projectTangentToPCPF as X}from"../../../../geometry/support/meshUtils/projection.js";import{projectMeshVertexPositions as Z}from"../../../../geometry/support/meshUtils/projectMeshVertexPositions.js";import{getEmissiveMode as ee}from"../../../../symbols/support/materialUtils.js";import{isEncodedMeshTexture as te}from"../../glTF/internal/resourceUtils.js";import{getTransformMatrix as re}from"../../glTF/internal/TextureTransformUtils.js";import{defaultSymbolLayerMemoryComplexity as oe}from"./defaultSymbolComplexity.js";import{perObjectElevationAligner as ne}from"./ElevationAligners.js";import{needsElevationUpdates3D as ae,evaluateElevationInfoAtPoint as se}from"./elevationAlignmentUtils.js";import{Graphics3DMeshObject3DGraphicLayer as ie}from"./Graphics3DMeshObject3DGraphicLayer.js";import{Object3DEdgeState as le}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as ce,nanFallbackColor as ue}from"./Graphics3DSymbolLayer.js";import{MaterialInfoCache as me,MeshFastUpdateProcessor as fe}from"./MeshFastUpdateProcessor.js";import{SymbolComplexity as pe}from"./SymbolComplexity.js";import{hasEdges as he,createMaterial as de}from"../support/edgeUtils.js";import{debugFlags as ge}from"../../support/debugFlags.js";import{Attribute as xe}from"../../webgl-engine/lib/Attribute.js";import{Geometry as _e}from"../../webgl-engine/lib/Geometry.js";import{Object3D as ye}from"../../webgl-engine/lib/Object3D.js";import{Texture as Te}from"../../webgl-engine/lib/Texture.js";import{DefaultMaterial as be}from"../../webgl-engine/materials/DefaultMaterial.js";import{NativeLineMaterial as ve}from"../../webgl-engine/materials/NativeLineMaterial.js";import{useSchematicPBR as we,advancedMRRFactors as Ce,schematicMRRFactors as Me}from"../../webgl-engine/materials/pbrUtils.js";const je=["mesh"];class Ae extends ce{constructor(e,t,r,o){super(e,t,r,o,ze(t)),this._materialInfoCache=new me,this._fastUpdateProcessor=new fe,this._textures=new Map,this.ensureDrapedStatus(!1)}async doLoad(){ge.DRAW_MESH_GEOMETRY_NORMALS&&(this._debugVertexNormalMaterial=new ve({color:[1,0,1,1]}),this._debugTangentNormalMaterial=new ve({color:[1,.5,0,1]}),this._debugFaceNormalMaterial=new ve({color:[0,1,1,1]})),this.updateComplexity()}destroy(){super.destroy(),this._textures.forEach(e=>e.unload()),this._context.stage.removeTextures(Array.from(this._textures.values())),this._materialInfoCache.clear(),this._textures.clear(),this._fastUpdateProcessor.destroy()}get materials(){return this._materialInfoCache.materials}createGraphics3DGraphic(e){const t=e.graphic;if(!this._validateGeometry(t.geometry,je,"fill on mesh-3d"))return null;const r=this.createElevationContextForGraphic(t),o=e.renderingInfo;return this._createAs3DShape(t,o,r,t.uid)}onRemoveGraphic(e){this._fastUpdateProcessor.onRemoveGraphic(e,this._materialInfoCache)}layerOpacityChanged(e,t){const r=this._getLayerOpacity();this._updateMaterialParameters(e=>{e.material.setParameters({layerOpacity:r});const t=e.material.parameters;this._setMaterialTextureAlphaMode(t,e)}),e?.forEach(e=>t(e)?.layerOpacityChanged(r,this._context.isAsync))}layerScreenSizePerspectiveChanged(){}layerElevationInfoChanged(e,t){return this.updateGraphics3DGraphicElevationInfo(e,t,ae)}slicePlaneEnabledChanged(e,t){return this._updateMaterialParameters(({material:e})=>{e.setParameters({hasSlicePlane:this._context.slicePlaneEnabled})}),e?.forEach(e=>t(e)?.slicePlaneEnabledChanged(this._context.slicePlaneEnabled,this._context.isAsync)),!0}physicalBasedRenderingChanged(){const e=this._usePBR();return this._updateMaterialParameters(({material:t})=>t.setParameters({usePBR:e})),!0}updateTransform(e,t,r,o){if(!e.fastTransformUpdatesAllowed)return!1;const n=e.fastTransformUpdatesEnabled;switch(o){case 0:if(n)return!0;break;case 1:if(!n)return!0;break;default:if(!n)return!!this.updateTransform(e,t,r,0)&&(e.autoDisableFastTransformUpdates(()=>this.updateTransform(e,t,r,1)),!0)}const a=this._context.renderCoordsHelper.spatialReference,s=Ze,{origin:i,transform:l}=r;if(!S(t,d(Ye,i.x,i.y,i.z??0),s,a))return!1;switch(o){case 0:this._fastUpdateProcessor.enable(e,this._materialInfoCache,this._context);break;case 1:this._fastUpdateProcessor.disable(e,this._materialInfoCache);break;case 2:e.updateFastLocalOrigin(s,l,this._context.localOriginFactory)}const{elevationContext:c}=e;c.centerInElevationSR=this._getCenterInElevationSR(s);const{elevationProvider:u,renderCoordsHelper:m}=this._context,f=(e,t)=>se(e,u,c,m,t);return e.alignedSampledElevation=ne(e,c,u.spatialReference,f,m,s),e.updateTransform(s,l,this._context.isAsync),e.updateAutoDisableFastTransformUpdates(()=>this.updateTransform(e,t,r,1)),!0}computeComplexity(){if(!this._textures||0===this._textures.size)return super.computeComplexity();let e=0;for(const o of this._textures.values())e+=o.usedMemory;const t={...oe(this.symbol,this.symbolLayer),resourceBytes:e},r=he(this.symbolLayer)?2:0;return new pe({drawCallsPerFeature:r,memory:t})}_requiresSymbolVertexColors(){return this._hasDrivenColorOrOpacity}_materialPropertiesDefault(e,t){const r=this._requiresSymbolVertexColors(),o=!!e.vertexAttributes.color,n=!!e.vertexAttributes.tangent;return{hasSymbolVertexColors:r,hasVertexColors:o,hasVertexTangents:n,uid:`vc:${o},vt:${n},vct${t},svc:${r}`}}_materialProperties(e,t,r){const o=this._materialPropertiesDefault(e,r);if(!t.material)return o;const{color:n,colorTexture:a,colorTextureTransform:s,normalTexture:i,normalTextureTransform:l,doubleSided:c,alphaCutoff:u,alphaMode:m}=t.material,f=Ne(n),p=Ne(a),h=He(s),d=Ne(i),g=He(l);if(o.color=n,o.colorTexture=a,o.normalTexture=i,o.uid=`${o.uid},cmuid:${f},ctmuid:${p},cttuid:${h},ntmuid:${d},nttuid:${g},ds:${c},ac:${u},am:${m}`,t.material instanceof D){const{metallic:e,roughness:r,metallicRoughnessTexture:n,metallicRoughnessTextureTransform:a,emissiveColor:i,emissiveTexture:c,emissiveTextureTransform:u,occlusionTexture:m,occlusionTextureTransform:f}=t.material,p=Ne(n),h=He(a),d=Ne(i),g=Ne(c),x=He(u),_=Ne(m),y=He(f);o.metallic=e,o.roughness=r,o.metallicRoughnessTexture=n,o.emissiveColor=i,o.emissiveTexture=c,o.occlusionTexture=m,o.colorTextureTransform=Fe(s),o.normalTextureTransform=Fe(l),o.emissiveTextureTransform=Fe(u),o.occlusionTextureTransform=Fe(f),o.metallicRoughnessTextureTransform=Fe(a),o.uid=`${o.uid},mrm:${e},mrr:${r},mrt:${p},mrtt:${h},emuid:${d},etmuid:${g},ett:${x},otmuid:${_},ott:${y}`}return o}_getInternalTexture(e,t=!1,n=1){const a=Le(e);if(!a)return null;const s=`${e.contentHash}/${n}`;let i=this._textures.get(s);if(i){const e=this._context.stage.renderView.textures;let t=null;const n=e.acquire(i.id);return null==n||o(n)||(i.events.on("unloaded",()=>t=r(t)),t=n),i}let l=null;const c=this._context.stage.renderView.renderingContext.parameters.maxMaxAnisotropy,u={wrap:Ve(e.wrap),noUnpackFlip:!0,maxAnisotropy:c,mipmap:c>1};return te(a)?(l=a.data,u.preMultiplyAlpha=!1,u.encoding=a.encoding):(l=a,u.preMultiplyAlpha=1!==n,u.compressionOptions=t?{compressionTracker:this._context.compressionTracker,compressionCallback:()=>this.updateComplexity()}:void 0),i=new Te(l,u),this._textures.set(s,i),i.events.on("loaded",()=>this.updateComplexity()),i.load(this._context.stage.renderView.renderingContext),this._context.stage.addTexture(i),i.events.on("unloaded",()=>{this._textures.delete(s)}),i}_setInternalMaterialTextureParameters(t,r){if(null!=t.colorTexture){const e=1!==r.textureAlphaMode,o=this._getInternalTexture(t.colorTexture,e,r.textureAlphaMode);o?(r.textureId=o.id,r.textureAlphaPremultiplied=!!o.parameters.preMultiplyAlpha):r.textureId=void 0}t.normalTexture&&(r.normalTextureId=this._getInternalTexture(t.normalTexture)?.id),t.emissiveColor&&(r.emissiveBaseColor=e.toUnitRGB(t.emissiveColor)),t.emissiveTexture&&(r.emissiveTextureId=this._getInternalTexture(t.emissiveTexture)?.id),t.occlusionTexture&&(r.occlusionTextureId=this._getInternalTexture(t.occlusionTexture,!0)?.id),t.metallicRoughnessTexture&&(r.metallicRoughnessTextureId=this._getInternalTexture(t.metallicRoughnessTexture,!0)?.id)}_setInternalMaterialParameters(e,t,r){null!=e.color&&De(e.color,t,r),this._setInternalMaterialTextureParameters(e,t),t.colorTextureTransformMatrix=re(e.colorTextureTransform),t.normalTextureTransformMatrix=re(e.normalTextureTransform);const o=null!=e.normalTextureTransform?.scale?e.normalTextureTransform?.scale:h;t.scale=[o[0],o[1]],t.occlusionTextureTransformMatrix=re(e.occlusionTextureTransform),t.emissiveTextureTransformMatrix=re(e.emissiveTextureTransform),t.metallicRoughnessTextureTransformMatrix=re(e.metallicRoughnessTextureTransform)}_setExternalMaterialParameters(t,r=this._materialColor){const o=this._drivenProperties.color,n=this._drivenProperties.opacity;if(o)t.externalColor=R;else{const o=r??null;if(o){const r=e.toUnitRGBA(o);n&&(r[3]=1),t.externalColor=r}else t.externalColor=ue}t.colorMixMode=this.symbolLayer.material?.colorMixMode??"multiply",t.castShadows=!!this.symbolLayer.castShadows,t.emissiveStrength=this.symbolLayer?.material?.emissive?.strength??1,t.emissiveSource=ee(this.symbolLayer?.material?.emissive?.source??"emissive")}_getOrCreateMaterial(t,r){const o=r.material?.color,n=r.material?.colorTexture,a=r.material?.alphaMode,s="blend"===a,i=!("opaque"===a)&&(Ge(t)||null!=o&&o.a<1||n?.transparent||s),l=this._materialProperties(t,r,i),c=this._materialInfoCache.byUid(l.uid);if(c)return this._setInternalMaterialTextureParameters(l,c.material.parameters),c.material;const u={uid:l.uid,material:null,isComponentTransparent:i,alphaMode:r.material?r.material.alphaMode:"opaque"},m=we({normalTexture:l.normalTexture,metallicRoughnessTexture:l.metallicRoughnessTexture,metallicFactor:l.metallic,roughnessFactor:l.roughness,emissiveTexture:l.emissiveTexture,emissiveFactor:e.toUnitRGB(l.emissiveColor),occlusionTexture:l.occlusionTexture}),f={usePBR:this._usePBR(),isSchematic:m,hasVertexColors:l.hasVertexColors,hasSymbolColors:l.hasSymbolVertexColors,hasVertexTangents:l.hasVertexTangents,ambient:A,diffuse:j,opacity:1,doubleSided:!0,doubleSidedType:"winding-order",cullFace:0,layerOpacity:this._getLayerOpacity(),hasSlicePlane:this._context.slicePlaneEnabled,drivenOpacity:this.needsDrivenTransparentPass||u.isComponentTransparent};f.mrrFactors=m?Me:[l.metallic,l.roughness,Ce[2]],r.material&&(f.doubleSided=r.material.doubleSided,f.cullFace=r.material.doubleSided?0:2,f.textureAlphaCutoff=r.material.alphaCutoff),this._setExternalMaterialParameters(f),this._setMaterialTextureAlphaMode(f,u),this._setInternalMaterialParameters(l,f,u);const p=new be(f,this._context);return u.material=p,this._materialInfoCache.set(l.uid,u),p}prepareSymbolLayerPatch(e){if("partial"!==e.diff.type)return;const t=e.diff.diff;this._preparePatchColor(e,t)}_preparePatchColor(e,t){if(!t.material||"partial"!==t.material.type)return;const r=t.material.diff;if(!r.color||"complete"!==r.color.type||null==r.color.newValue||null==r.color.oldValue)return;const o=r.color.newValue;delete r.color,e.symbolLayerStatePatches.push(()=>{this._updateMaterialParameters(e=>{const t=e.material.parameters;this._setExternalMaterialParameters(t,o),this._setMaterialTextureAlphaMode(t,e),e.material.setParameters({externalColor:t.externalColor})})})}_usePBR(){return this._context.physicalBasedRenderingEnabled}_setMaterialTextureAlphaMode(e,t){if("auto"===t.alphaMode){const r=this.needsDrivenTransparentPass||t.isComponentTransparent||(e.layerOpacity??1)<1||(e.opacity??1)<1||(e.externalColor?.[3]??1)<1;e.textureAlphaMode=r?3:1}else e.textureAlphaMode="opaque"===t.alphaMode?1:"mask"===t.alphaMode?2:0}_createFaceDebugNormals(e,t){const r=t.length,o=e.spatialReference.isGeographic?20015077/180:1,a=.1*Math.max(e.extent.width*o,e.extent.height*o,e.extent.zmax-e.extent.zmin),i=[],l=[],c=t[0].transformation,u=n(s(),c);for(let n=0;n<r;n++){const e=t[n].attributes.get("position");if(!e)continue;const r=e.data,o=e.indices;for(let t=0;t<o.length;t+=3)Oe(r,o,t,Qe),Ee(r,o,t,Ye,Je,Ke),g(Ye,Ye,Je),g(Ye,Ye,Ke),x(Ye,Ye,1/3),_(Ye,Ye,c),i.push(...Ye),y(Qe,Qe,u),T(Qe,Qe),b(Ye,Ye,Qe,a),i.push(...Ye),l.push(l.length),l.push(l.length)}return i.length?new _e(this._debugFaceNormalMaterial,[["position",new xe(i,l,3,!0)]],null,2):null}_createPerVertexDebugVectors(e,t,r,o,i){const l=t.length,c=e.spatialReference.isGeographic?20015077/180:1,u=.1*i*Math.max(e.extent.width*c,e.extent.height*c,e.extent.zmax-e.extent.zmin),m=[],f=[],p=t[0].transformation,h=n(s(),p);"tangent"===r&&a(h,p);for(let n=0;n<l;n++){const e=t[n],o=e.attributes.get("position"),a=e.attributes.get(r);if(!o||!a)continue;const s=o.data,i=o.indices,l=a.data,c=a.indices;for(let t=0;t<i.length;t++){const e=3*i[t],r=c[t]*a.stride;d(Ye,s[e+0],s[e+1],s[e+2]),_(Ye,Ye,p),m.push(...Ye),d(Je,l[r+0],l[r+1],l[r+2]),y(Je,Je,h),T(Je,Je),b(Ye,Ye,Je,u),m.push(...Ye),f.push(f.length),f.push(f.length)}}return m.length?new _e(o,[["position",new xe(m,f,3,!0)]],null,2):null}_createAs3DShape(e,t,r,o){const n=e.geometry;if("mesh"!==n.type)return null;const a=this._createGeometryInfo(n,t,o);if(null==a)return null;const{geometries:s,objectTransformation:i}=a;if(ge.DRAW_MESH_GEOMETRY_NORMALS){const e=this._createPerVertexDebugVectors(n,s,"normal",this._debugVertexNormalMaterial,1),t=this._createPerVertexDebugVectors(n,s,"tangent",this._debugTangentNormalMaterial,.5),r=this._createFaceDebugNormals(n,s);e&&s.push(e),t&&s.push(t),r&&s.push(r)}const l=this._context.layerViewUid,c=new ye({geometries:s,layerViewUid:l,graphicUid:o,isElevationSource:!0});c.transformation=i;const u=de(this.symbolLayer,{opacity:this._getLayerOpacity()}),m=u?new le(s[0].material,u,this._context.slicePlaneEnabled):null,f=new ie(this,c,null,ne,r,m);this._fastUpdateProcessor.onAddGraphic(),f.needsElevationUpdates=ae(r.mode),f.useObjectOriginAsAttachmentOrigin=!0,f.fastTransformUpdatesAllowed=this._fastTransformUpdatesAllowed(n),r.centerInElevationSR=this._getCenterInElevationSR(c.transformation);const{elevationProvider:p,renderCoordsHelper:h}=this._context,d=(e,t)=>se(e,p,r,h,t);return f.alignedSampledElevation=ne(f,r,p.spatialReference,d,h),f}_fastTransformUpdatesAllowed(e){const{vertexSpace:t,spatialReference:r}=e;if(!N(t))return!1;const{type:o}=t,{view:n}=this._context.graphicsCoreOwner,{viewingMode:a}=n.state,s=n.spatialReference;return 1===a&&"local"===o||2===a&&k(s,r)&&"georeferenced"===o&&!r.isGeographic}_getElevationSR(){return this._context.elevationProvider.spatialReference??null}_getCenterInElevationSR(e){const t=M(),r=d(rt,e[12],e[13],e[14]);return B(r,this._context.renderCoordsHelper.spatialReference,t,this._getElevationSR()),t}_passthroughReprojectionInfo(e){return 0===e.reprojection&&!!e.objectTransformation}_createPositionBuffer(e,t){const r=e.vertexAttributes.position;let o,n=r;if(0===t.reprojection)return{position:n,georeferencedPositionBuffer:o};const a=1===t.reprojection?t.transformBeforeProject:null;a&&(n=q(new Float64Array(n.length),n,a));const{normal:s,tangent:i}=e.vertexAttributes;this._passthroughReprojectionInfo(t)||!s&&!i||(o=n);const l=n===r||n===o?new Float64Array(n.length):n;return I(n,e.spatialReference,0,l,this._context.renderCoordsHelper.spatialReference,0),{position:l,georeferencedPositionBuffer:o}}_createNormalBuffer(e,t,r,o){const n=e.vertexAttributes.normal;if(null==n)return null;let a=n;const s=1===o.reprojection?o.transformBeforeProject:null;s&&(a=W(a,new Float32Array(a.length),s));const i=this._context.graphicsCoreOwner.view.viewingMode;if(0===o.reprojection)return a;if("local"===i){if(!z(this._context.renderCoordsHelper.spatialReference))return a;if(null==r)return null;if(e.spatialReference.isGeographic){const e=a===n?new Float32Array(a.length):a;return Y(a,0,r,e)}if(e.spatialReference.isWebMercator){const e=a===n?new Float32Array(a.length):a;return J(a,0,r,e)}return a}if(null==r)return null;const l=a===n?new Float32Array(a.length):a,c=this._context.renderCoordsHelper.spatialReference;return K(a,r,e.spatialReference,t,c,l)}_createTangentBuffer(e,t,r,o){const n=e.vertexAttributes.tangent;if(null==n)return null;let a=n;const s=1===o.reprojection?o.transformBeforeProject:null;s&&(a=Q(a,new Float32Array(a.length),s));const i=this._context.graphicsCoreOwner.view.viewingMode;if(0===o.reprojection)return a;if("local"===i){if(!z(this._context.renderCoordsHelper.spatialReference))return a;if(null==r)return null;if(e.spatialReference.isGeographic){const e=a===n?new Float32Array(a.length):a;return Y(a,1,r,e)}if(e.spatialReference.isWebMercator){const e=a===n?new Float32Array(a.length):a;return J(a,1,r,e)}return a}if(null==r)return null;const l=a===n?new Float32Array(a.length):a,c=this._context.renderCoordsHelper.spatialReference;return X(a,r,e.spatialReference,t,c,l)}_createSymbolColorBuffer(e){return this._requiresSymbolVertexColors()?new Uint8Array(this._getDrivenUInt8ColorWithNaNSupport(e,this._materialColor,!0)):null}_createBuffers(e,t){const r=e.vertexAttributes&&e.vertexAttributes.position;if(!r)return this.logger.warn("Mesh geometry must contain position vertex attributes"),null;const o=e.vertexAttributes.normal,n=e.vertexAttributes.uv,a=e.vertexAttributes.tangent;if(o&&o.length!==r.length)return this.logger.warn("Mesh normal vertex buffer must contain the same number of elements as the position buffer"),null;if(a&&a.length/4!=r.length/3)return this.logger.warn("Mesh tangent vertex buffer must contain the same number of elements as the position buffer"),null;if(n&&n.length/2!=r.length/3)return this.logger.warn("Mesh uv vertex buffer must contain the same number of elements as the position buffer"),null;const s=this._computeReprojectionInfo(e),{position:i,georeferencedPositionBuffer:l}=this._createPositionBuffer(e,s),c=ke(e),u=this._createSymbolColorBuffer(t),f=this._createNormalBuffer(e,i,l,s),p=this._createTangentBuffer(e,i,l,s),h=n,{transformation:d,position:g,normal:x,tangent:_}=this._passthroughReprojectionInfo(s)?{transformation:s.objectTransformation,position:i,normal:f,tangent:p}:this._transformOriginLocal(e,i,f,p);return{positionBuffer:g,normalBuffer:x,tangentBuffer:_,uvBuffer:h,colorBuffer:c,symbolColorBuffer:u,objectTransformation:d,geometryTransformation:0===s.reprojection&&s.geometryTransformation?s.geometryTransformation:m()}}_computeReprojectionInfo(e){const{vertexSpace:t}=e,r="georeferenced"===t.type?k(this._context.renderCoordsHelper.spatialReference,e.spatialReference)?0:1:0;if(H(t))return{reprojection:r};const o=t.origin,n=m(),a=e.transform?.localMatrix??f;if(0===r){S(e.spatialReference,o,n,this._context.renderCoordsHelper.spatialReference);return{reprojection:r,objectTransformation:n,geometryTransformation:p(a)}}const s=i(m(),o);return l(s,s,a),{reprojection:r,transformBeforeProject:s}}_transformOriginLocal(e,t,r,o){const n=this._context.renderCoordsHelper.spatialReference,a=e.origin;We[0]=a.x,We[1]=a.y,We[2]=a.z??0;const s=m();S(e.spatialReference,We,s,n),c(Xe,s);const{position:i,normal:l,tangent:u}=e.vertexAttributes,f=t===i?new Float64Array(t.length):t;q(f,t,Xe);const p=r?r===l?new Float32Array(r.length):r:null,h=o?o===u?new Float32Array(o.length):o:null;return r&&p&&W(r,p,Xe),o&&h&&Q(o,h,Xe),{transformation:s,position:f,normal:p,tangent:h}}_validateFaces(e,t){const r=e.vertexAttributes.position.length/3,o=t.faces;if(o){let e=-1;for(let t=0;t<o.length;t++){const r=o[t];r>e&&(e=r)}if(r<=e)return this.logger.warn(`Vertex index ${e} is out of bounds of the mesh position buffer`),!1}else if(r%3!=0)return this.logger.warn("Mesh position buffer length must be a multiple of 9 if no component faces are defined (3 values per vertex * 3 vertices per triangle)"),!1;return!0}_isOutsideClippingArea(e){if(!this._context.clippingExtent)return!1;const t=e.vertexAttributes?.position;if(!t)return!1;const r=this._context.elevationProvider.spatialReference,o=Z(e,r??e.spatialReference);return!!o&&(U(o,et),!O(et,this._context.clippingExtent))}_createGeometryInfo(e,t,r){if(!P(e.spatialReference,this._context.renderCoordsHelper.spatialReference))return this.logger.warn("Geometry spatial reference is not compatible with the view"),null;if(!this._validateVertexSpace(e))return null;if(this._isOutsideClippingArea(e))return null;const o=this._createBuffers(e,t);if(null==o)return null;const{positionBuffer:n,uvBuffer:a,colorBuffer:s,symbolColorBuffer:i,normalBuffer:l,tangentBuffer:c,objectTransformation:m,geometryTransformation:f}=o,p=e.components??tt,h=new Array;let d=!1;const g=u(Ye,m),x=this._context.localOriginFactory.getOrigin(g);for(const u of p){if(!this._validateFaces(e,u))return null;const t=Pe(e,u);if(0===t.length)continue;const o=Se(n,l,u,t);o.didFlipNormals&&(d=!0);const m=[["position",new xe(n,t,3,!0)],["normal",new xe(o.normals,o.indices,3,!0)]];s&&m.push(["color",new xe(s,t,4,!0)]),i&&m.push(["symbolColor",new xe(i,V(t.length),4,!0)]),a&&m.push(["uv0",new xe(a,t,2,!0)]),c&&m.push(["tangent",new xe(c,t,4,!0)]);const p=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:r,layerViewUid:this._context.layerViewUid}),g=this._getOrCreateMaterial(e,u),_=new _e(g,m,null,0,p);_.transformation=f,_.localOrigin=x,h.push(_)}return d&&this.logger.warn("Normals have been automatically flipped to be consistent with the counter clock wise face winding order. It is better to generate mesh geometries that have consistent normals."),{geometries:h,objectTransformation:m}}_updateMaterialParameters(e){this._materialInfoCache.forEachMaterialInfo(e),this._fastUpdateProcessor.forEachMaterialInfo(e),this._fastUpdateProcessor.forEachClonedMaterial((e,t)=>{t.setParameters(e.parameters)})}_validateVertexSpace(e){const{_context:{graphicsCoreOwner:{view:{state:{viewingMode:t}}}}}=this,{vertexSpace:r}=e;return 2!==t||"local"!==r.type||(this.logger.warn("Displaying a mesh with a local vertex space in a view in local viewing mode is not supported."),!1)}test(){return{...super.test(),materials:this._materialInfoCache.materials}}get _materialColor(){return this.symbolLayer.material?.color}}class Re{constructor(e,t,r){this.normals=e,this.indices=t,this.didFlipNormals=r}}function Pe(e,t){return t.faces??$(e.vertexAttributes.position.length/3)}function Se(e,t,r,o){switch(r.shading||"flat"){default:case"source":return Be(e,t,r,o);case"flat":return Ie(e,o);case"smooth":return Ue(e,o)}}function Ie(e,t){const r=F(t.length),o=new Array(3*t.length);for(let n=0;n<t.length;n+=3){const a=Oe(e,t,n,Qe);for(let e=0;e<3;e++)r[n+e]=a[e],o[n+e]=n/3}return new Re(r,o,!1)}function Be(e,t,r,o){if(null==t)return Ie(e,o);let n=!1;if(!r.trustSourceNormals)for(let a=0;a<o.length;a+=3){Oe(e,o,a,Qe);for(let e=0;e<3;e++){const r=3*o[a+e];Ye[0]=t[r],Ye[1]=t[r+1],Ye[2]=t[r+2],C(Qe,Ye)<0&&(t[r]=-t[r],t[r+1]=-t[r+1],t[r+2]=-t[r+2],n=!0)}}return new Re(t,o,n)}function Ue(e,t){const r={};for(let a=0;a<t.length;a+=3){const o=Oe(e,t,a,Qe);for(let e=0;e<3;e++){const n=t[a+e];let s=r[n];s||(s={normal:M(),count:0},r[n]=s),g(s.normal,s.normal,o),s.count++}}const o=F(3*t.length),n=new Array(3*t.length);for(let a=0;a<t.length;a++){const e=r[t[a]];1!==e.count&&(T(e.normal,e.normal),e.count=1);for(let t=0;t<3;t++)o[3*a+t]=e.normal[t];n[a]=a}return new Re(o,n,!1)}function Ee(e,t,r,o,n,a){const s=3*t[r],i=3*t[r+1],l=3*t[r+2];o[0]=e[s],o[1]=e[s+1],o[2]=e[s+2],n[0]=e[i],n[1]=e[i+1],n[2]=e[i+2],a[0]=e[l],a[1]=e[l+1],a[2]=e[l+2]}function Oe(e,t,r,o){return Ee(e,t,r,Ye,Je,Ke),v(Je,Je,Ye),v(Ke,Ke,Ye),w(Ye,Je,Ke),T(o,Ye),o}function Fe(e){if(!e)return null;const{scale:r,offset:o,rotation:n}=e;return{scale:r,offset:o,rotation:t(n)}}function Ve(e="repeat"){if("string"==typeof e){const t=$e(e);return{s:t,t}}return{s:$e(e.horizontal),t:$e(e.vertical)}}function $e(e){switch(e){case"clamp":return 33071;case"mirror":return 33648;default:return 10497}}function Ge(e){const t=e.vertexAttributes.color;if(null==t)return!1;for(let r=3;r<t.length;r+=4)if(255!==t[r])return!0;return!1}function De(t,r,o){r.diffuse=e.toUnitRGB(t),r.opacity="opaque"===o.alphaMode?1:t.a}function Le(e){return e.data??e.url}function Ne(t){return null==t?"-":t instanceof e?t.toHex():t.contentHash}function He(e){const{offset:t,scale:r,rotation:o}=e??qe;return`${t[0]},${t[1]},${o},${r[0]},${r[1]}`}function ke(e){return e.vertexAttributes.color}function ze(e){return 1===(e.material?.color?.a??0)}const qe=new L,We=M(),Ye=M(),Je=M(),Ke=M(),Qe=M(),Xe=m(),Ze=m(),et=E(),tt=[new G],rt=M();export{Ae as Graphics3DMeshFillSymbolLayer};
5
+ import e from"../../../../Color.js";import{linearize as t}from"../../../../colorUtils.js";import"../../../../core/has.js";import{deg2rad as r}from"../../../../core/mathUtils.js";import{releaseMaybe as o}from"../../../../core/maybe.js";import{isPromiseLike as n}from"../../../../core/promiseUtils.js";import{normalFromMat4 as a,fromMat4 as s}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{fromTranslation as l,multiply as c,invert as u,getTranslation as m}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as f,IDENTITY as p,clone as h}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{ONES as d}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{i as g,f as x,g as _,t as y,o as T,n as b,b as v,d as w,h as C,e as j}from"../../../../chunks/vec32.js";import{create as M,fromValues as A,ONES as R,ZEROS as P}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as S}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{canProjectWithoutEngine as I}from"../../../../geometry/projectionUtils.js";import{computeTranslationToOriginAndRotation as B}from"../../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{projectBuffer as U}from"../../../../geometry/projection/projectBuffer.js";import{projectVectorToVector as E}from"../../../../geometry/projection/projectVectorToVector.js";import{fromBuffer as O,create as F,intersectsClippingArea as V}from"../../../../geometry/support/aaBoundingBox.js";import{newFloatArray as $}from"../../../../geometry/support/FloatArray.js";import{getZeroIndexArray as G,getContinuousIndexArray as D}from"../../../../geometry/support/Indices.js";import L from"../../../../geometry/support/MeshComponent.js";import N from"../../../../geometry/support/MeshMaterialMetallicRoughness.js";import H from"../../../../geometry/support/MeshTextureTransform.js";import{isRelativeVertexSpace as k,isAbsoluteVertexSpace as z}from"../../../../geometry/support/meshVertexSpaceUtils.js";import{equals as q,isPlateCarree as W}from"../../../../geometry/support/spatialReferenceUtils.js";import{t as Y}from"../../../../chunks/vec3.js";import{transformNormal as J,transformVectorENUPlateCarree as K,transformVectorWMPlateCarree as Q,projectNormalToPCPF as X,transformTangent as Z,projectTangentToPCPF as ee}from"../../../../geometry/support/meshUtils/projection.js";import{projectMeshVertexPositions as te}from"../../../../geometry/support/meshUtils/projectMeshVertexPositions.js";import{getEmissiveMode as re}from"../../../../symbols/support/materialUtils.js";import{isEncodedMeshTexture as oe}from"../../glTF/internal/resourceUtils.js";import{getTransformMatrix as ne}from"../../glTF/internal/TextureTransformUtils.js";import{defaultSymbolLayerMemoryComplexity as ae}from"./defaultSymbolComplexity.js";import{perObjectElevationAligner as se}from"./ElevationAligners.js";import{needsElevationUpdates3D as ie,evaluateElevationInfoAtPoint as le}from"./elevationAlignmentUtils.js";import{Graphics3DMeshObject3DGraphicLayer as ce}from"./Graphics3DMeshObject3DGraphicLayer.js";import{Object3DEdgeState as ue}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as me,nanFallbackColor as fe}from"./Graphics3DSymbolLayer.js";import{MaterialInfoCache as pe,MeshFastUpdateProcessor as he}from"./MeshFastUpdateProcessor.js";import{SymbolComplexity as de}from"./SymbolComplexity.js";import{hasEdges as ge,createMaterial as xe}from"../support/edgeUtils.js";import{debugFlags as _e}from"../../support/debugFlags.js";import{Attribute as ye}from"../../webgl-engine/lib/Attribute.js";import{Geometry as Te}from"../../webgl-engine/lib/Geometry.js";import{Object3D as be}from"../../webgl-engine/lib/Object3D.js";import{Texture as ve}from"../../webgl-engine/lib/Texture.js";import{DefaultMaterial as we}from"../../webgl-engine/materials/DefaultMaterial.js";import{NativeLineMaterial as Ce}from"../../webgl-engine/materials/NativeLineMaterial.js";import{useSchematicPBR as je,advancedMRRFactors as Me,schematicMRRFactors as Ae}from"../../webgl-engine/materials/pbrUtils.js";const Re=["mesh"];class Pe extends me{constructor(e,t,r,o){super(e,t,r,o,We(t)),this._materialInfoCache=new pe,this._fastUpdateProcessor=new he,this._textures=new Map,this.ensureDrapedStatus(!1)}async doLoad(){_e.DRAW_MESH_GEOMETRY_NORMALS&&(this._debugVertexNormalMaterial=new Ce({color:[1,0,1,1]}),this._debugTangentNormalMaterial=new Ce({color:[1,.5,0,1]}),this._debugFaceNormalMaterial=new Ce({color:[0,1,1,1]})),this.updateComplexity()}destroy(){super.destroy(),this._textures.forEach(e=>e.unload()),this._context.stage.removeTextures(Array.from(this._textures.values())),this._materialInfoCache.clear(),this._textures.clear(),this._fastUpdateProcessor.destroy()}get materials(){return this._materialInfoCache.materials}createGraphics3DGraphic(e){const t=e.graphic;if(!this._validateGeometry(t.geometry,Re,"fill on mesh-3d"))return null;const r=this.createElevationContextForGraphic(t),o=e.renderingInfo;return this._createAs3DShape(t,o,r,t.uid)}onRemoveGraphic(e){this._fastUpdateProcessor.onRemoveGraphic(e,this._materialInfoCache)}layerOpacityChanged(e,t){const r=this._getLayerOpacity();this._updateMaterialParameters(e=>{e.material.setParameters({layerOpacity:r});const t=e.material.parameters;this._setMaterialTextureAlphaMode(t,e)}),e?.forEach(e=>t(e)?.layerOpacityChanged(r,this._context.isAsync))}layerScreenSizePerspectiveChanged(){}layerElevationInfoChanged(e,t){return this.updateGraphics3DGraphicElevationInfo(e,t,ie)}slicePlaneEnabledChanged(e,t){return this._updateMaterialParameters(({material:e})=>{e.setParameters({hasSlicePlane:this._context.slicePlaneEnabled})}),e?.forEach(e=>t(e)?.slicePlaneEnabledChanged(this._context.slicePlaneEnabled,this._context.isAsync)),!0}physicalBasedRenderingChanged(){const e=this._usePBR();return this._updateMaterialParameters(({material:t})=>t.setParameters({usePBR:e})),!0}updateTransform(e,t,r,o){if(!e.fastTransformUpdatesAllowed)return!1;const n=e.fastTransformUpdatesEnabled;switch(o){case 0:if(n)return!0;break;case 1:if(!n)return!0;break;default:if(!n)return!!this.updateTransform(e,t,r,0)&&(e.autoDisableFastTransformUpdates(()=>this.updateTransform(e,t,r,1)),!0)}const a=this._context.renderCoordsHelper.spatialReference,s=tt,{origin:i,transform:l}=r;if(!B(t,g(Ke,i.x,i.y,i.z??0),s,a))return!1;switch(o){case 0:this._fastUpdateProcessor.enable(e,this._materialInfoCache,this._context);break;case 1:this._fastUpdateProcessor.disable(e,this._materialInfoCache);break;case 2:e.updateFastLocalOrigin(s,l,this._context.localOriginFactory)}const{elevationContext:c}=e;c.centerInElevationSR=this._getCenterInElevationSR(s);const{elevationProvider:u,renderCoordsHelper:m}=this._context,f=(e,t)=>le(e,u,c,m,t);return e.alignedSampledElevation=se(e,c,u.spatialReference,f,m,s),e.updateTransform(s,l,this._context.isAsync),e.updateAutoDisableFastTransformUpdates(()=>this.updateTransform(e,t,r,1)),!0}computeComplexity(){if(!this._textures||0===this._textures.size)return super.computeComplexity();let e=0;for(const o of this._textures.values())e+=o.usedMemory;const t={...ae(this.symbol,this.symbolLayer),resourceBytes:e},r=ge(this.symbolLayer)?2:0;return new de({drawCallsPerFeature:r,memory:t})}_requiresSymbolVertexColors(){return this._hasDrivenColorOrOpacity}_materialPropertiesDefault(e,t){const r=this._requiresSymbolVertexColors(),o=!!e.vertexAttributes.color,n=!!e.vertexAttributes.tangent;return{hasSymbolVertexColors:r,hasVertexColors:o,hasVertexTangents:n,uid:`vc:${o},vt:${n},vct${t},svc:${r}`}}_materialProperties(e,t,r){const o=this._materialPropertiesDefault(e,r);if(!t.material)return o;const{color:n,colorTexture:a,colorTextureTransform:s,normalTexture:i,normalTextureTransform:l,doubleSided:c,alphaCutoff:u,alphaMode:m}=t.material,f=ke(n),p=ke(a),h=ze(s),d=ke(i),g=ze(l);if(o.color=n,o.colorTexture=a,o.normalTexture=i,o.uid=`${o.uid},cmuid:${f},ctmuid:${p},cttuid:${h},ntmuid:${d},nttuid:${g},ds:${c},ac:${u},am:${m}`,t.material instanceof N){const{metallic:e,roughness:r,metallicRoughnessTexture:n,metallicRoughnessTextureTransform:a,emissiveColor:i,emissiveTexture:c,emissiveTextureTransform:u,occlusionTexture:m,occlusionTextureTransform:f}=t.material,p=ke(n),h=ze(a),d=ke(i),g=ke(c),x=ze(u),_=ke(m),y=ze(f);o.uid=`${o.uid},mrm:${e},mrr:${r},mrt:${p},mrtt:${h},emuid:${d},etmuid:${g},ett:${x},otmuid:${_},ott:${y}`,o.metallic=e,o.roughness=r,o.metallicRoughnessTexture=n,o.emissiveColor=i,o.emissiveTexture=c,o.occlusionTexture=m,o.colorTextureTransform=$e(s),o.normalTextureTransform=$e(l),o.emissiveTextureTransform=$e(u),o.occlusionTextureTransform=$e(f),o.metallicRoughnessTextureTransform=$e(a)}return o}_getInternalTexture(e,t=!1,r=1){const a=He(e);if(!a)return null;const s=`${e.contentHash}/${r}`;let i=this._textures.get(s);if(i){const e=this._context.stage.renderView.textures;let t=null;const r=e.acquire(i.id);return null==r||n(r)||(i.events.on("unloaded",()=>t=o(t)),t=r),i}let l=null;const c=this._context.stage.renderView.renderingContext.parameters.maxMaxAnisotropy,u={wrap:Ge(e.wrap),noUnpackFlip:!0,maxAnisotropy:c,mipmap:c>1};return oe(a)?(l=a.data,u.preMultiplyAlpha=!1,u.encoding=a.encoding):(l=a,u.preMultiplyAlpha=1!==r,u.compressionOptions=t?{compressionTracker:this._context.compressionTracker,compressionCallback:()=>this.updateComplexity()}:void 0),i=new ve(l,u),this._textures.set(s,i),i.events.on("loaded",()=>this.updateComplexity()),i.load(this._context.stage.renderView.renderingContext),this._context.stage.addTexture(i),i.events.on("unloaded",()=>{this._textures.delete(s)}),i}_setInternalMaterialTextureParameters(r,o){if(null!=r.colorTexture){const e=1!==o.textureAlphaMode,t=this._getInternalTexture(r.colorTexture,e,o.textureAlphaMode);t?(o.textureId=t.id,o.textureAlphaPremultiplied=!!t.parameters.preMultiplyAlpha):o.textureId=void 0}if(r.normalTexture&&(o.normalTextureId=this._getInternalTexture(r.normalTexture)?.id),r.emissiveColor){const n=e.toUnitRGB(r.emissiveColor);o.emissiveBaseColor=A(t(n[0]),t(n[1]),t(n[2]))}r.emissiveTexture&&(o.emissiveTextureId=this._getInternalTexture(r.emissiveTexture)?.id),r.occlusionTexture&&(o.occlusionTextureId=this._getInternalTexture(r.occlusionTexture,!0)?.id),r.metallicRoughnessTexture&&(o.metallicRoughnessTextureId=this._getInternalTexture(r.metallicRoughnessTexture,!0)?.id)}_setInternalMaterialParameters(e,t,r){null!=e.color&&Ne(e.color,t,r),this._setInternalMaterialTextureParameters(e,t),t.colorTextureTransformMatrix=ne(e.colorTextureTransform),t.normalTextureTransformMatrix=ne(e.normalTextureTransform);const o=null!=e.normalTextureTransform?.scale?e.normalTextureTransform?.scale:d;t.scale=[o[0],o[1]],t.occlusionTextureTransformMatrix=ne(e.occlusionTextureTransform),t.emissiveTextureTransformMatrix=ne(e.emissiveTextureTransform),t.metallicRoughnessTextureTransformMatrix=ne(e.metallicRoughnessTextureTransform)}_setExternalMaterialParameters(t,r=this._materialColor){const o=this._drivenProperties.color,n=this._drivenProperties.opacity;if(o)t.externalColor=S;else{const o=r??null;if(o){const r=e.toUnitRGBA(o);n&&(r[3]=1),t.externalColor=r}else t.externalColor=fe}t.colorMixMode=this.symbolLayer.material?.colorMixMode??"multiply",t.castShadows=!!this.symbolLayer.castShadows,t.emissiveStrength=this.symbolLayer?.material?.emissive?.strength??1,t.emissiveSource=re(this.symbolLayer?.material?.emissive?.source??"emissive")}_getOrCreateMaterial(t,r){const o=r.material?.color,n=r.material?.colorTexture,a=r.material?.alphaMode,s="blend"===a,i=!("opaque"===a)&&(Le(t)||null!=o&&o.a<1||n?.transparent||s),l=this._materialProperties(t,r,i),c=this._materialInfoCache.byUid(l.uid);if(c)return this._setInternalMaterialTextureParameters(l,c.material.parameters),c.material;const u={uid:l.uid,material:null,isComponentTransparent:i,alphaMode:r.material?r.material.alphaMode:"opaque"},m=je({normalTexture:l.normalTexture,metallicRoughnessTexture:l.metallicRoughnessTexture,metallicFactor:l.metallic,roughnessFactor:l.roughness,emissiveTexture:l.emissiveTexture,emissiveFactor:e.toUnitRGB(l.emissiveColor),occlusionTexture:l.occlusionTexture}),f={usePBR:this._usePBR(),isSchematic:m,hasVertexColors:l.hasVertexColors,hasSymbolColors:l.hasSymbolVertexColors,hasVertexTangents:l.hasVertexTangents,ambient:P,diffuse:R,opacity:1,doubleSided:!0,doubleSidedType:"winding-order",cullFace:0,layerOpacity:this._getLayerOpacity(),hasSlicePlane:this._context.slicePlaneEnabled,drivenOpacity:this.needsDrivenTransparentPass||u.isComponentTransparent};f.mrrFactors=m?Ae:[l.metallic,l.roughness,Me[2]],r.material&&(f.doubleSided=r.material.doubleSided,f.cullFace=r.material.doubleSided?0:2,f.textureAlphaCutoff=r.material.alphaCutoff),this._setExternalMaterialParameters(f),this._setMaterialTextureAlphaMode(f,u),this._setInternalMaterialParameters(l,f,u);const p=new we(f,this._context);return u.material=p,this._materialInfoCache.set(l.uid,u),p}prepareSymbolLayerPatch(e){if("partial"!==e.diff.type)return;const t=e.diff.diff;this._preparePatchColor(e,t)}_preparePatchColor(e,t){if(!t.material||"partial"!==t.material.type)return;const r=t.material.diff;if(!r.color||"complete"!==r.color.type||null==r.color.newValue||null==r.color.oldValue)return;const o=r.color.newValue;delete r.color,e.symbolLayerStatePatches.push(()=>{this._updateMaterialParameters(e=>{const t=e.material.parameters;this._setExternalMaterialParameters(t,o),this._setMaterialTextureAlphaMode(t,e),e.material.setParameters({externalColor:t.externalColor})})})}_usePBR(){return this._context.physicalBasedRenderingEnabled}_setMaterialTextureAlphaMode(e,t){if("auto"===t.alphaMode){const r=this.needsDrivenTransparentPass||t.isComponentTransparent||(e.layerOpacity??1)<1||(e.opacity??1)<1||(e.externalColor?.[3]??1)<1;e.textureAlphaMode=r?3:1}else e.textureAlphaMode="opaque"===t.alphaMode?1:"mask"===t.alphaMode?2:0}_createFaceDebugNormals(e,t){const r=t.length,o=e.spatialReference.isGeographic?20015077/180:1,n=.1*Math.max(e.extent.width*o,e.extent.height*o,e.extent.zmax-e.extent.zmin),s=[],l=[],c=t[0].transformation,u=a(i(),c);for(let a=0;a<r;a++){const e=t[a].attributes.get("position");if(!e)continue;const r=e.data,o=e.indices;for(let t=0;t<o.length;t+=3)Ve(r,o,t,Ze),Fe(r,o,t,Ke,Qe,Xe),x(Ke,Ke,Qe),x(Ke,Ke,Xe),_(Ke,Ke,1/3),y(Ke,Ke,c),s.push(...Ke),T(Ze,Ze,u),b(Ze,Ze),v(Ke,Ke,Ze,n),s.push(...Ke),l.push(l.length),l.push(l.length)}return s.length?new Te(this._debugFaceNormalMaterial,[["position",new ye(s,l,3,!0)]],null,2):null}_createPerVertexDebugVectors(e,t,r,o,n){const l=t.length,c=e.spatialReference.isGeographic?20015077/180:1,u=.1*n*Math.max(e.extent.width*c,e.extent.height*c,e.extent.zmax-e.extent.zmin),m=[],f=[],p=t[0].transformation,h=a(i(),p);"tangent"===r&&s(h,p);for(let a=0;a<l;a++){const e=t[a],o=e.attributes.get("position"),n=e.attributes.get(r);if(!o||!n)continue;const s=o.data,i=o.indices,l=n.data,c=n.indices;for(let t=0;t<i.length;t++){const e=3*i[t],r=c[t]*n.stride;g(Ke,s[e+0],s[e+1],s[e+2]),y(Ke,Ke,p),m.push(...Ke),g(Qe,l[r+0],l[r+1],l[r+2]),T(Qe,Qe,h),b(Qe,Qe),v(Ke,Ke,Qe,u),m.push(...Ke),f.push(f.length),f.push(f.length)}}return m.length?new Te(o,[["position",new ye(m,f,3,!0)]],null,2):null}_createAs3DShape(e,t,r,o){const n=e.geometry;if("mesh"!==n.type)return null;const a=this._createGeometryInfo(n,t,o);if(null==a)return null;const{geometries:s,objectTransformation:i}=a;if(_e.DRAW_MESH_GEOMETRY_NORMALS){const e=this._createPerVertexDebugVectors(n,s,"normal",this._debugVertexNormalMaterial,1),t=this._createPerVertexDebugVectors(n,s,"tangent",this._debugTangentNormalMaterial,.5),r=this._createFaceDebugNormals(n,s);e&&s.push(e),t&&s.push(t),r&&s.push(r)}const l=this._context.layerViewUid,c=new be({geometries:s,layerViewUid:l,graphicUid:o,isElevationSource:!0});c.transformation=i;const u=xe(this.symbolLayer,{opacity:this._getLayerOpacity()}),m=u?new ue(s[0].material,u,this._context.slicePlaneEnabled):null,f=new ce(this,c,null,se,r,m);this._fastUpdateProcessor.onAddGraphic(),f.needsElevationUpdates=ie(r.mode),f.useObjectOriginAsAttachmentOrigin=!0,f.fastTransformUpdatesAllowed=this._fastTransformUpdatesAllowed(n),r.centerInElevationSR=this._getCenterInElevationSR(c.transformation);const{elevationProvider:p,renderCoordsHelper:h}=this._context,d=(e,t)=>le(e,p,r,h,t);return f.alignedSampledElevation=se(f,r,p.spatialReference,d,h),f}_fastTransformUpdatesAllowed(e){const{vertexSpace:t,spatialReference:r}=e;if(!k(t))return!1;const{type:o}=t,{view:n}=this._context.graphicsCoreOwner,{viewingMode:a}=n.state,s=n.spatialReference;return 1===a&&"local"===o||2===a&&q(s,r)&&"georeferenced"===o&&!r.isGeographic}_getElevationSR(){return this._context.elevationProvider.spatialReference??null}_getCenterInElevationSR(e){const t=M(),r=g(nt,e[12],e[13],e[14]);return E(r,this._context.renderCoordsHelper.spatialReference,t,this._getElevationSR()),t}_passthroughReprojectionInfo(e){return 0===e.reprojection&&!!e.objectTransformation}_createPositionBuffer(e,t){const r=e.vertexAttributes.position;let o,n=r;if(0===t.reprojection)return{position:n,georeferencedPositionBuffer:o};const a=1===t.reprojection?t.transformBeforeProject:null;a&&(n=Y(new Float64Array(n.length),n,a));const{normal:s,tangent:i}=e.vertexAttributes;this._passthroughReprojectionInfo(t)||!s&&!i||(o=n);const l=n===r||n===o?new Float64Array(n.length):n;return U(n,e.spatialReference,0,l,this._context.renderCoordsHelper.spatialReference,0),{position:l,georeferencedPositionBuffer:o}}_createNormalBuffer(e,t,r,o){const n=e.vertexAttributes.normal;if(null==n)return null;let a=n;const s=1===o.reprojection?o.transformBeforeProject:null;s&&(a=J(a,new Float32Array(a.length),s));const i=this._context.graphicsCoreOwner.view.viewingMode;if(0===o.reprojection)return a;if("local"===i){if(!W(this._context.renderCoordsHelper.spatialReference))return a;if(null==r)return null;if(e.spatialReference.isGeographic){const e=a===n?new Float32Array(a.length):a;return K(a,0,r,e)}if(e.spatialReference.isWebMercator){const e=a===n?new Float32Array(a.length):a;return Q(a,0,r,e)}return a}if(null==r)return null;const l=a===n?new Float32Array(a.length):a,c=this._context.renderCoordsHelper.spatialReference;return X(a,r,e.spatialReference,t,c,l)}_createTangentBuffer(e,t,r,o){const n=e.vertexAttributes.tangent;if(null==n)return null;let a=n;const s=1===o.reprojection?o.transformBeforeProject:null;s&&(a=Z(a,new Float32Array(a.length),s));const i=this._context.graphicsCoreOwner.view.viewingMode;if(0===o.reprojection)return a;if("local"===i){if(!W(this._context.renderCoordsHelper.spatialReference))return a;if(null==r)return null;if(e.spatialReference.isGeographic){const e=a===n?new Float32Array(a.length):a;return K(a,1,r,e)}if(e.spatialReference.isWebMercator){const e=a===n?new Float32Array(a.length):a;return Q(a,1,r,e)}return a}if(null==r)return null;const l=a===n?new Float32Array(a.length):a,c=this._context.renderCoordsHelper.spatialReference;return ee(a,r,e.spatialReference,t,c,l)}_createSymbolColorBuffer(e){return this._requiresSymbolVertexColors()?new Uint8Array(this._getDrivenUInt8ColorWithNaNSupport(e,this._materialColor,!0)):null}_createBuffers(e,t){const r=e.vertexAttributes&&e.vertexAttributes.position;if(!r)return this.logger.warn("Mesh geometry must contain position vertex attributes"),null;const o=e.vertexAttributes.normal,n=e.vertexAttributes.uv,a=e.vertexAttributes.tangent;if(o&&o.length!==r.length)return this.logger.warn("Mesh normal vertex buffer must contain the same number of elements as the position buffer"),null;if(a&&a.length/4!=r.length/3)return this.logger.warn("Mesh tangent vertex buffer must contain the same number of elements as the position buffer"),null;if(n&&n.length/2!=r.length/3)return this.logger.warn("Mesh uv vertex buffer must contain the same number of elements as the position buffer"),null;const s=this._computeReprojectionInfo(e),{position:i,georeferencedPositionBuffer:l}=this._createPositionBuffer(e,s),c=qe(e),u=this._createSymbolColorBuffer(t),m=this._createNormalBuffer(e,i,l,s),p=this._createTangentBuffer(e,i,l,s),h=n,{transformation:d,position:g,normal:x,tangent:_}=this._passthroughReprojectionInfo(s)?{transformation:s.objectTransformation,position:i,normal:m,tangent:p}:this._transformOriginLocal(e,i,m,p);return{positionBuffer:g,normalBuffer:x,tangentBuffer:_,uvBuffer:h,colorBuffer:c,symbolColorBuffer:u,objectTransformation:d,geometryTransformation:0===s.reprojection&&s.geometryTransformation?s.geometryTransformation:f()}}_computeReprojectionInfo(e){const{vertexSpace:t}=e,r="georeferenced"===t.type?q(this._context.renderCoordsHelper.spatialReference,e.spatialReference)?0:1:0;if(z(t))return{reprojection:r};const o=t.origin,n=f(),a=e.transform?.localMatrix??p;if(0===r){B(e.spatialReference,o,n,this._context.renderCoordsHelper.spatialReference);return{reprojection:r,objectTransformation:n,geometryTransformation:h(a)}}const s=l(f(),o);return c(s,s,a),{reprojection:r,transformBeforeProject:s}}_transformOriginLocal(e,t,r,o){const n=this._context.renderCoordsHelper.spatialReference,a=e.origin;Je[0]=a.x,Je[1]=a.y,Je[2]=a.z??0;const s=f();B(e.spatialReference,Je,s,n),u(et,s);const{position:i,normal:l,tangent:c}=e.vertexAttributes,m=t===i?new Float64Array(t.length):t;Y(m,t,et);const p=r?r===l?new Float32Array(r.length):r:null,h=o?o===c?new Float32Array(o.length):o:null;return r&&p&&J(r,p,et),o&&h&&Z(o,h,et),{transformation:s,position:m,normal:p,tangent:h}}_validateFaces(e,t){const r=e.vertexAttributes.position.length/3,o=t.faces;if(o){let e=-1;for(let t=0;t<o.length;t++){const r=o[t];r>e&&(e=r)}if(r<=e)return this.logger.warn(`Vertex index ${e} is out of bounds of the mesh position buffer`),!1}else if(r%3!=0)return this.logger.warn("Mesh position buffer length must be a multiple of 9 if no component faces are defined (3 values per vertex * 3 vertices per triangle)"),!1;return!0}_isOutsideClippingArea(e){if(!this._context.clippingExtent)return!1;const t=e.vertexAttributes?.position;if(!t)return!1;const r=this._context.elevationProvider.spatialReference,o=te(e,r??e.spatialReference);return!!o&&(O(o,rt),!V(rt,this._context.clippingExtent))}_createGeometryInfo(e,t,r){if(!I(e.spatialReference,this._context.renderCoordsHelper.spatialReference))return this.logger.warn("Geometry spatial reference is not compatible with the view"),null;if(!this._validateVertexSpace(e))return null;if(this._isOutsideClippingArea(e))return null;const o=this._createBuffers(e,t);if(null==o)return null;const{positionBuffer:n,uvBuffer:a,colorBuffer:s,symbolColorBuffer:i,normalBuffer:l,tangentBuffer:c,objectTransformation:u,geometryTransformation:f}=o,p=e.components??ot,h=new Array;let d=!1;const g=m(Ke,u),x=this._context.localOriginFactory.getOrigin(g);for(const m of p){if(!this._validateFaces(e,m))return null;const t=Ie(e,m);if(0===t.length)continue;const o=Be(n,l,m,t);o.didFlipNormals&&(d=!0);const u=[["position",new ye(n,t,3,!0)],["normal",new ye(o.normals,o.indices,3,!0)]];s&&u.push(["color",new ye(s,t,4,!0)]),i&&u.push(["symbolColor",new ye(i,G(t.length),4,!0)]),a&&u.push(["uv0",new ye(a,t,2,!0)]),c&&u.push(["tangent",new ye(c,t,4,!0)]);const p=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:r,layerViewUid:this._context.layerViewUid}),g=this._getOrCreateMaterial(e,m),_=new Te(g,u,null,0,p);_.transformation=f,_.localOrigin=x,h.push(_)}return d&&this.logger.warn("Normals have been automatically flipped to be consistent with the counter clock wise face winding order. It is better to generate mesh geometries that have consistent normals."),{geometries:h,objectTransformation:u}}_updateMaterialParameters(e){this._materialInfoCache.forEachMaterialInfo(e),this._fastUpdateProcessor.forEachMaterialInfo(e),this._fastUpdateProcessor.forEachClonedMaterial((e,t)=>{t.setParameters(e.parameters)})}_validateVertexSpace(e){const{_context:{graphicsCoreOwner:{view:{state:{viewingMode:t}}}}}=this,{vertexSpace:r}=e;return 2!==t||"local"!==r.type||(this.logger.warn("Displaying a mesh with a local vertex space in a view in local viewing mode is not supported."),!1)}test(){return{...super.test(),materials:this._materialInfoCache.materials}}get _materialColor(){return this.symbolLayer.material?.color}}class Se{constructor(e,t,r){this.normals=e,this.indices=t,this.didFlipNormals=r}}function Ie(e,t){return t.faces??D(e.vertexAttributes.position.length/3)}function Be(e,t,r,o){switch(r.shading||"flat"){default:case"source":return Ee(e,t,r,o);case"flat":return Ue(e,o);case"smooth":return Oe(e,o)}}function Ue(e,t){const r=$(t.length),o=new Array(3*t.length);for(let n=0;n<t.length;n+=3){const a=Ve(e,t,n,Ze);for(let e=0;e<3;e++)r[n+e]=a[e],o[n+e]=n/3}return new Se(r,o,!1)}function Ee(e,t,r,o){if(null==t)return Ue(e,o);let n=!1;if(!r.trustSourceNormals)for(let a=0;a<o.length;a+=3){Ve(e,o,a,Ze);for(let e=0;e<3;e++){const r=3*o[a+e];Ke[0]=t[r],Ke[1]=t[r+1],Ke[2]=t[r+2],j(Ze,Ke)<0&&(t[r]=-t[r],t[r+1]=-t[r+1],t[r+2]=-t[r+2],n=!0)}}return new Se(t,o,n)}function Oe(e,t){const r={};for(let a=0;a<t.length;a+=3){const o=Ve(e,t,a,Ze);for(let e=0;e<3;e++){const n=t[a+e];let s=r[n];s||(s={normal:M(),count:0},r[n]=s),x(s.normal,s.normal,o),s.count++}}const o=$(3*t.length),n=new Array(3*t.length);for(let a=0;a<t.length;a++){const e=r[t[a]];1!==e.count&&(b(e.normal,e.normal),e.count=1);for(let t=0;t<3;t++)o[3*a+t]=e.normal[t];n[a]=a}return new Se(o,n,!1)}function Fe(e,t,r,o,n,a){const s=3*t[r],i=3*t[r+1],l=3*t[r+2];o[0]=e[s],o[1]=e[s+1],o[2]=e[s+2],n[0]=e[i],n[1]=e[i+1],n[2]=e[i+2],a[0]=e[l],a[1]=e[l+1],a[2]=e[l+2]}function Ve(e,t,r,o){return Fe(e,t,r,Ke,Qe,Xe),w(Qe,Qe,Ke),w(Xe,Xe,Ke),C(Ke,Qe,Xe),b(o,Ke),o}function $e(e){if(!e)return null;const{scale:t,offset:o,rotation:n}=e;return{scale:t,offset:o,rotation:r(n)}}function Ge(e="repeat"){if("string"==typeof e){const t=De(e);return{s:t,t}}return{s:De(e.horizontal),t:De(e.vertical)}}function De(e){switch(e){case"clamp":return 33071;case"mirror":return 33648;default:return 10497}}function Le(e){const t=e.vertexAttributes.color;if(null==t)return!1;for(let r=3;r<t.length;r+=4)if(255!==t[r])return!0;return!1}function Ne(t,r,o){r.diffuse=e.toUnitRGB(t),r.opacity="opaque"===o.alphaMode?1:t.a}function He(e){return e.data??e.url}function ke(t){return null==t?"-":t instanceof e?t.toHex():t.contentHash}function ze(e){const{offset:t,scale:r,rotation:o}=e??Ye;return`${t[0]},${t[1]},${o},${r[0]},${r[1]}`}function qe(e){return e.vertexAttributes.color}function We(e){return 1===(e.material?.color?.a??0)}const Ye=new H,Je=M(),Ke=M(),Qe=M(),Xe=M(),Ze=M(),et=f(),tt=f(),rt=F(),ot=[new L],nt=M();export{Pe as Graphics3DMeshFillSymbolLayer};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{colorGamma as e}from"../../../../colorUtils.js";import{adjustStaticAGOUrl as r}from"../../../../core/devEnvironmentUtils.js";import{hasScaling as t}from"../../../../core/mathUtils.js";import{normalFromMat4 as o,fromMat4 as s}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{invert as n}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{ONES as a}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{t as u,d as c,D as m,l as f,n as d,m as p}from"../../../../chunks/vec32.js";import{create as g}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{empty as x,expandWithVec3 as T}from"../../../../geometry/support/aaBoundingBox.js";import{newFloatArray as b}from"../../../../geometry/support/FloatArray.js";import{BufferViewVec3f as h,BufferViewVec4f as y,BufferViewVec4u8 as w,BufferViewVec4u16 as v,BufferViewVec3u8 as R,BufferViewVec3u16 as B}from"../../../../geometry/support/buffer/BufferView.js";import{t as j,b as S,n as M,f as F}from"../../../../chunks/vec3.js";import{t as A,b as E}from"../../../../chunks/vec4.js";import{a as C}from"../../../../chunks/vec2.js";import{DefaultLoadingContext as I}from"../../glTF/DefaultLoadingContext.js";import{convertPrimitiveToTriangles as L}from"../../glTF/internal/indexUtils.js";import{isEncodedMeshTexture as P}from"../../glTF/internal/resourceUtils.js";import{getTransformMatrix as U}from"../../glTF/internal/TextureTransformUtils.js";import{ProcessedObjectResource as O}from"./ProcessedObjectResource.js";import{load as k,processLoadResult as D}from"./wosrLoader.js";import{Attribute as V}from"../../webgl-engine/lib/Attribute.js";import{Geometry as _}from"../../webgl-engine/lib/Geometry.js";import{Texture as G}from"../../webgl-engine/lib/Texture.js";import{DefaultMaterial as W}from"../../webgl-engine/materials/DefaultMaterial.js";import{useSchematicPBR as H,schematicMRRFactors as N,esriSymbologyMRRFactors as Q,advancedMRRFactors as $}from"../../webgl-engine/materials/pbrUtils.js";async function q(e,t){const o=z(r(e));if("wosr"===o.fileType){const e=await(t.cache?t.cache.loadWOSR(o.url,t):k(o.url,t)),{engineResources:r,referenceBoundingBox:s}=D(e,t);return{lods:r,referenceBoundingBox:s,isEsriSymbolResource:!1,isWosr:!0}}let s;if(t.cache)s=await t.cache.loadGLTF(o.url,t,!!t.usePBR);else{const{loadGLTF:e}=await import("../../glTF/loader.js");s=await e(new I(t.streamDataRequester),o.url,t,t.usePBR)}const i=s.model.meta?.ESRI_proxyEllipsoid,n=s.meta.isEsriSymbolResource&&null!=i&&"EsriRealisticTreesStyle"===s.meta.ESRI_webstyle;n&&!s.customMeta.esriTreeRendering&&(s.customMeta.esriTreeRendering=!0,ee(s,i));const l=!!t.usePBR,a=s.meta.isEsriSymbolResource?{usePBR:l,isSchematic:!1,treeRendering:n,mrrFactors:Q}:{usePBR:l,isSchematic:!1,treeRendering:!1,mrrFactors:$},u={...t.materialParameters,treeRendering:n},{engineResources:c,referenceBoundingBox:m}=K(s,a,u,t,o.specifiedLodIndex,n);return{lods:c,referenceBoundingBox:m,isEsriSymbolResource:s.meta.isEsriSymbolResource,isWosr:!1}}function z(e){const r=e.match(/(.*\.(gltf|glb))(\?lod=([0-9]+))?$/);if(r)return{fileType:"gltf",url:r[1],specifiedLodIndex:null!=r[4]?Number(r[4]):null};return e.match(/(.*\.(json|json\.gz))$/)?{fileType:"wosr",url:e,specifiedLodIndex:null}:{fileType:"unknown",url:e,specifiedLodIndex:null}}function K(e,r,t,o,s,i){const n=e.model,l=new Array,a=new Map,u=new Map,c=n.lods.length,m=x();return n.lods.forEach((e,f)=>{const d=!0===o.skipHighLods&&(c>1&&0===f||c>3&&1===f)||!1===o.skipHighLods&&null!=s&&f!==s;if(d&&0!==f)return;const p=new O(e.name,e.lodThreshold,[0,0,0]);e.parts.forEach(e=>{const s=d?new W({},o):J(n,e,p,r,t,a,u,o,i),{geometry:l,vertexCount:c}=X(e,s??new W({},o)),g=l.boundingInfo;null!=g&&0===f&&(T(m,g.bbMin),T(m,g.bbMax)),null!=s&&(p.stageResources.geometries.push(l),p.numberOfVertices+=c)}),d||l.push(p)}),{engineResources:l,referenceBoundingBox:m}}function J(r,t,o,s,i,n,l,u,c){const m=r.materials.get(t.material);if(null==m)return null;const{normal:f,color:d,texCoord0:p,tangent:g}=t.attributes,x=t.material+(f?"_normal":"")+(d?"_color":"")+(p?"_texCoord0":"")+(g?"_tangent":""),T=null!=t.attributes.texCoord0,b=null!=t.attributes.normal,h=Z(m.alphaMode);if(!n.has(x)){if(T){const e=(e,t=!1,o=!1)=>{if(null!=e&&!l.has(e)){const s=r.textures.get(e);if(s){const r=s.data,i=t&&!P(r)?u.compressionOptions:void 0;l.set(e,new G(P(r)?r.data:r,{...s.parameters,preMultiplyAlpha:!P(r)&&o,encoding:P(r)?r.encoding:void 0,compressionOptions:i}))}}},t=1!==h&&!c;e(m.colorTexture,t,1!==h),e(m.normalTexture),e(m.occlusionTexture,!0),e(m.emissiveTexture),e(m.metallicRoughnessTexture,!0)}const o=1/e,f=m.color[0]**o,d=m.color[1]**o,p=m.color[2]**o,g=m.emissiveFactor[0]**o,y=m.emissiveFactor[1]**o,w=m.emissiveFactor[2]**o,v=null!=m.colorTexture&&T?l.get(m.colorTexture):null,R=H(m),B=null!=m.normalTextureTransform?.scale?m.normalTextureTransform?.scale:a;n.set(x,new W({...s,customDepthTest:1,textureAlphaMode:h,textureAlphaCutoff:m.alphaCutoff,diffuse:[f,d,p],ambient:[f,d,p],opacity:"OPAQUE"===m.alphaMode?1:m.opacity,doubleSided:m.doubleSided,doubleSidedType:"winding-order",cullFace:m.doubleSided?0:2,hasVertexColors:!!t.attributes.color,hasVertexTangents:!!t.attributes.tangent,normalType:b?0:2,castShadows:!0,receiveShadows:m.receiveShadows,receiveAmbientOcclusion:m.receiveAmbientOcclusion,textureId:null!=v?v.id:void 0,colorMixMode:m.colorMixMode,normalTextureId:null!=m.normalTexture&&T?l.get(m.normalTexture).id:void 0,textureAlphaPremultiplied:null!=v&&!!v.parameters.preMultiplyAlpha,occlusionTextureId:null!=m.occlusionTexture&&T?l.get(m.occlusionTexture).id:void 0,emissiveTextureId:null!=m.emissiveTexture&&T?l.get(m.emissiveTexture).id:void 0,metallicRoughnessTextureId:null!=m.metallicRoughnessTexture&&T?l.get(m.metallicRoughnessTexture).id:void 0,emissiveBaseColor:[g,y,w],mrrFactors:R?N:[m.metallicFactor,m.roughnessFactor,s.mrrFactors[2]],isSchematic:R,colorTextureTransformMatrix:U(m.colorTextureTransform),normalTextureTransformMatrix:U(m.normalTextureTransform),scale:[B[0],B[1]],occlusionTextureTransformMatrix:U(m.occlusionTextureTransform),emissiveTextureTransformMatrix:U(m.emissiveTextureTransform),metallicRoughnessTextureTransformMatrix:U(m.metallicRoughnessTextureTransform),...i},u))}const y=n.get(x);if(o.stageResources.materials.push(y),T){const e=e=>{null!=e&&o.stageResources.textures.push(l.get(e))};e(m.colorTexture),e(m.normalTexture),e(m.occlusionTexture),e(m.emissiveTexture),e(m.metallicRoughnessTexture)}return y}function X(e,r){const i=e.attributes.position.count,n=L(e.indices||i,e.primitiveType),l=b(3*i),{typedBuffer:a,typedBufferStride:u}=e.attributes.position;j(l,a,e.transform,3,u);const c=[["position",new V(l,n,3,!0)]];if(null!=e.attributes.normal){const r=b(3*i),{typedBuffer:s,typedBufferStride:l}=e.attributes.normal;o(Y,e.transform),S(r,s,Y,3,l),t(Y)&&M(r,r),c.push(["normal",new V(r,n,3,!0)])}if(null!=e.attributes.tangent){const r=b(4*i),{typedBuffer:o,typedBufferStride:l}=e.attributes.tangent;s(Y,e.transform),A(r,o,Y,4,l),t(Y)&&M(r,r,4),c.push(["tangent",new V(r,n,4,!0)])}if(null!=e.attributes.texCoord0){const r=b(2*i),{typedBuffer:t,typedBufferStride:o}=e.attributes.texCoord0;C(r,t,2,o),c.push(["uv0",new V(r,n,2,!0)])}const m=e.attributes.color;if(null!=m){const r=new Uint8Array(4*i);4===m.elementCount?m instanceof y?E(r,m,1,255):(m instanceof w||m instanceof v)&&E(r,m,1/255,255):(r.fill(255),m instanceof h?F(r,m.typedBuffer,1,255,4,m.typedBufferStride):(e.attributes.color instanceof R||e.attributes.color instanceof B)&&F(r,m.typedBuffer,1/255,255,4,e.attributes.color.typedBufferStride)),c.push(["color",new V(r,n,4,!0)])}return{geometry:new _(r,c),vertexCount:i}}const Y=i();function Z(e){switch(e){case"BLEND":return 0;case"MASK":return 2;case"OPAQUE":case null:case void 0:return 1}}function ee(r,t){for(let o=0;o<r.model.lods.length;++o){const s=r.model.lods[o];for(const i of s.parts){const s=i.attributes.normal;if(null==s)return;const a=i.attributes.position,x=a.count,T=g(),b=g(),w=g(),v=new Float32Array(4*x),R=new Float32Array(3*x),B=n(l(),i.transform);let j=0,S=0;for(let n=0;n<x;n++){a.getVec(n,b),s.getVec(n,T),u(b,b,i.transform),c(w,b,t.center),m(w,w,t.radius);const l=w[2],g=f(w),x=Math.min(.45+.55*g*g,1)**e;m(w,w,t.radius),null!==B&&u(w,w,B),d(w,w),o+1!==r.model.lods.length&&r.model.lods.length>1&&p(w,w,T,l>-1?.2:Math.min(-4*l-3.8,1)),R[j]=w[0],R[j+1]=w[1],R[j+2]=w[2],j+=3,v[S]=x,v[S+1]=x,v[S+2]=x,v[S+3]=1,S+=4}i.attributes.normal=new h(R.buffer),i.attributes.color=new y(v.buffer)}}}export{q as fetch,z as parseUrl};
5
+ import{colorGamma as e,delinearize as r}from"../../../../colorUtils.js";import{adjustStaticAGOUrl as t}from"../../../../core/devEnvironmentUtils.js";import{hasScaling as o}from"../../../../core/mathUtils.js";import{normalFromMat4 as s,fromMat4 as i}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{invert as l}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{ONES as u}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{t as c,d as m,D as f,l as d,n as p,m as g}from"../../../../chunks/vec32.js";import{create as x}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{empty as T,expandWithVec3 as b}from"../../../../geometry/support/aaBoundingBox.js";import{newFloatArray as h}from"../../../../geometry/support/FloatArray.js";import{BufferViewVec3f as y,BufferViewVec4f as w,BufferViewVec4u8 as v,BufferViewVec4u16 as R,BufferViewVec3u8 as B,BufferViewVec3u16 as j}from"../../../../geometry/support/buffer/BufferView.js";import{t as S,b as M,n as F,f as A}from"../../../../chunks/vec3.js";import{t as E,b as C}from"../../../../chunks/vec4.js";import{a as I}from"../../../../chunks/vec2.js";import{DefaultLoadingContext as L}from"../../glTF/DefaultLoadingContext.js";import{convertPrimitiveToTriangles as P}from"../../glTF/internal/indexUtils.js";import{isEncodedMeshTexture as U}from"../../glTF/internal/resourceUtils.js";import{getTransformMatrix as O}from"../../glTF/internal/TextureTransformUtils.js";import{ProcessedObjectResource as k}from"./ProcessedObjectResource.js";import{load as D,processLoadResult as V}from"./wosrLoader.js";import{Attribute as _}from"../../webgl-engine/lib/Attribute.js";import{Geometry as G}from"../../webgl-engine/lib/Geometry.js";import{Texture as W}from"../../webgl-engine/lib/Texture.js";import{DefaultMaterial as H}from"../../webgl-engine/materials/DefaultMaterial.js";import{useSchematicPBR as N,schematicMRRFactors as Q,esriSymbologyMRRFactors as $,advancedMRRFactors as q}from"../../webgl-engine/materials/pbrUtils.js";async function z(e,r){const o=K(t(e));if("wosr"===o.fileType){const e=await(r.cache?r.cache.loadWOSR(o.url,r):D(o.url,r)),{engineResources:t,referenceBoundingBox:s}=V(e,r);return{lods:t,referenceBoundingBox:s,isEsriSymbolResource:!1,isWosr:!0}}let s;if(r.cache)s=await r.cache.loadGLTF(o.url,r,!!r.usePBR);else{const{loadGLTF:e}=await import("../../glTF/loader.js");s=await e(new L(r.streamDataRequester),o.url,r,r.usePBR)}const i=s.model.meta?.ESRI_proxyEllipsoid,n=s.meta.isEsriSymbolResource&&null!=i&&"EsriRealisticTreesStyle"===s.meta.ESRI_webstyle;n&&!s.customMeta.esriTreeRendering&&(s.customMeta.esriTreeRendering=!0,re(s,i));const l=!!r.usePBR,a=s.meta.isEsriSymbolResource?{usePBR:l,isSchematic:!1,treeRendering:n,mrrFactors:$}:{usePBR:l,isSchematic:!1,treeRendering:!1,mrrFactors:q},u={...r.materialParameters,treeRendering:n},{engineResources:c,referenceBoundingBox:m}=J(s,a,u,r,o.specifiedLodIndex,n);return{lods:c,referenceBoundingBox:m,isEsriSymbolResource:s.meta.isEsriSymbolResource,isWosr:!1}}function K(e){const r=e.match(/(.*\.(gltf|glb))(\?lod=([0-9]+))?$/);if(r)return{fileType:"gltf",url:r[1],specifiedLodIndex:null!=r[4]?Number(r[4]):null};return e.match(/(.*\.(json|json\.gz))$/)?{fileType:"wosr",url:e,specifiedLodIndex:null}:{fileType:"unknown",url:e,specifiedLodIndex:null}}function J(e,r,t,o,s,i){const n=e.model,l=new Array,a=new Map,u=new Map,c=n.lods.length,m=T();return n.lods.forEach((e,f)=>{const d=!0===o.skipHighLods&&(c>1&&0===f||c>3&&1===f)||!1===o.skipHighLods&&null!=s&&f!==s;if(d&&0!==f)return;const p=new k(e.name,e.lodThreshold,[0,0,0]);e.parts.forEach(e=>{const s=d?new H({},o):X(n,e,p,r,t,a,u,o,i),{geometry:l,vertexCount:c}=Y(e,s??new H({},o)),g=l.boundingInfo;null!=g&&0===f&&(b(m,g.bbMin),b(m,g.bbMax)),null!=s&&(p.stageResources.geometries.push(l),p.numberOfVertices+=c)}),d||l.push(p)}),{engineResources:l,referenceBoundingBox:m}}function X(e,t,o,s,i,n,l,a,c){const m=e.materials.get(t.material);if(null==m)return null;const{normal:f,color:d,texCoord0:p,tangent:g}=t.attributes,x=t.material+(f?"_normal":"")+(d?"_color":"")+(p?"_texCoord0":"")+(g?"_tangent":""),T=null!=t.attributes.texCoord0,b=null!=t.attributes.normal,h=ee(m.alphaMode);if(!n.has(x)){if(T){const r=(r,t=!1,o=!1)=>{if(null!=r&&!l.has(r)){const s=e.textures.get(r);if(s){const e=s.data,i=t&&!U(e)?a.compressionOptions:void 0;l.set(r,new W(U(e)?e.data:e,{...s.parameters,preMultiplyAlpha:!U(e)&&o,encoding:U(e)?e.encoding:void 0,compressionOptions:i}))}}},t=1!==h&&!c;r(m.colorTexture,t,1!==h),r(m.normalTexture),r(m.occlusionTexture,!0),r(m.emissiveTexture),r(m.metallicRoughnessTexture,!0)}const o=r(m.color[0]),f=r(m.color[1]),d=r(m.color[2]),p=null!=m.colorTexture&&T?l.get(m.colorTexture):null,g=N(m),y=null!=m.normalTextureTransform?.scale?m.normalTextureTransform?.scale:u;n.set(x,new H({...s,customDepthTest:1,textureAlphaMode:h,textureAlphaCutoff:m.alphaCutoff,diffuse:[o,f,d],ambient:[o,f,d],opacity:"OPAQUE"===m.alphaMode?1:m.opacity,doubleSided:m.doubleSided,doubleSidedType:"winding-order",cullFace:m.doubleSided?0:2,hasVertexColors:!!t.attributes.color,hasVertexTangents:!!t.attributes.tangent,normalType:b?0:2,castShadows:!0,receiveShadows:m.receiveShadows,receiveAmbientOcclusion:m.receiveAmbientOcclusion,textureId:null!=p?p.id:void 0,colorMixMode:m.colorMixMode,normalTextureId:null!=m.normalTexture&&T?l.get(m.normalTexture).id:void 0,textureAlphaPremultiplied:null!=p&&!!p.parameters.preMultiplyAlpha,occlusionTextureId:null!=m.occlusionTexture&&T?l.get(m.occlusionTexture).id:void 0,emissiveTextureId:null!=m.emissiveTexture&&T?l.get(m.emissiveTexture).id:void 0,metallicRoughnessTextureId:null!=m.metallicRoughnessTexture&&T?l.get(m.metallicRoughnessTexture).id:void 0,emissiveBaseColor:[m.emissiveFactor[0],m.emissiveFactor[1],m.emissiveFactor[2]],mrrFactors:g?Q:[m.metallicFactor,m.roughnessFactor,s.mrrFactors[2]],isSchematic:g,colorTextureTransformMatrix:O(m.colorTextureTransform),normalTextureTransformMatrix:O(m.normalTextureTransform),scale:[y[0],y[1]],occlusionTextureTransformMatrix:O(m.occlusionTextureTransform),emissiveTextureTransformMatrix:O(m.emissiveTextureTransform),metallicRoughnessTextureTransformMatrix:O(m.metallicRoughnessTextureTransform),...i},a))}const y=n.get(x);if(o.stageResources.materials.push(y),T){const e=e=>{null!=e&&o.stageResources.textures.push(l.get(e))};e(m.colorTexture),e(m.normalTexture),e(m.occlusionTexture),e(m.emissiveTexture),e(m.metallicRoughnessTexture)}return y}function Y(e,r){const t=e.attributes.position.count,n=P(e.indices||t,e.primitiveType),l=h(3*t),{typedBuffer:a,typedBufferStride:u}=e.attributes.position;S(l,a,e.transform,3,u);const c=[["position",new _(l,n,3,!0)]];if(null!=e.attributes.normal){const r=h(3*t),{typedBuffer:i,typedBufferStride:l}=e.attributes.normal;s(Z,e.transform),M(r,i,Z,3,l),o(Z)&&F(r,r),c.push(["normal",new _(r,n,3,!0)])}if(null!=e.attributes.tangent){const r=h(4*t),{typedBuffer:s,typedBufferStride:l}=e.attributes.tangent;i(Z,e.transform),E(r,s,Z,4,l),o(Z)&&F(r,r,4),c.push(["tangent",new _(r,n,4,!0)])}if(null!=e.attributes.texCoord0){const r=h(2*t),{typedBuffer:o,typedBufferStride:s}=e.attributes.texCoord0;I(r,o,2,s),c.push(["uv0",new _(r,n,2,!0)])}const m=e.attributes.color;if(null!=m){const r=new Uint8Array(4*t);4===m.elementCount?m instanceof w?C(r,m,1,255):(m instanceof v||m instanceof R)&&C(r,m,1/255,255):(r.fill(255),m instanceof y?A(r,m.typedBuffer,1,255,4,m.typedBufferStride):(e.attributes.color instanceof B||e.attributes.color instanceof j)&&A(r,m.typedBuffer,1/255,255,4,e.attributes.color.typedBufferStride)),c.push(["color",new _(r,n,4,!0)])}return{geometry:new G(r,c),vertexCount:t}}const Z=n();function ee(e){switch(e){case"BLEND":return 0;case"MASK":return 2;case"OPAQUE":case null:case void 0:return 1}}function re(r,t){for(let o=0;o<r.model.lods.length;++o){const s=r.model.lods[o];for(const i of s.parts){const s=i.attributes.normal;if(null==s)return;const n=i.attributes.position,u=n.count,T=x(),b=x(),h=x(),v=new Float32Array(4*u),R=new Float32Array(3*u),B=l(a(),i.transform);let j=0,S=0;for(let l=0;l<u;l++){n.getVec(l,b),s.getVec(l,T),c(b,b,i.transform),m(h,b,t.center),f(h,h,t.radius);const a=h[2],u=d(h),x=Math.min(.45+.55*u*u,1)**e;f(h,h,t.radius),null!==B&&c(h,h,B),p(h,h),o+1!==r.model.lods.length&&r.model.lods.length>1&&g(h,h,T,a>-1?.2:Math.min(-4*a-3.8,1)),R[j]=h[0],R[j+1]=h[1],R[j+2]=h[2],j+=3,v[S]=x,v[S+1]=x,v[S+2]=x,v[S+3]=1,S+=4}i.attributes.normal=new y(R.buffer),i.attributes.color=new w(v.buffer)}}}export{z as fetch,K as parseUrl};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- class t{constructor(t,n){this.distances=t,this.sortOrderIndices=n}}class n{constructor(t,n){this.distances=t,this.sortedOrderIndices=n}}let e=null,s=null;const r=10,l=20,o=.25;function c(t,n){e?.length!==t&&(e=new Uint32Array(t)),s&&s.length===1+(1<<n)?s.fill(0):s=new Uint32Array(1+(1<<n))}function i(t,n){const i=t.length,a=Math.max(r,Math.min(l,Math.round(Math.log2(i/o)))),f=1+(1<<a);c(i,a);let h=t[0],u=t[0];for(let e=0;e<t.length;e++)h=Math.min(h,t[e]),u=Math.max(u,t[e]);const d=u-h;if(d<1e-6)for(let r=0;r<i;++r)e[r]=0,s[0]++;else{const n=(1<<a)/d;for(let r=0;r<i;r++){const l=(t[r]-h)*n>>>0;e[r]=l,s[l]++}}for(let e=1;e<f;e++)s[e]+=s[e-1];for(let r=0;r<i;r++){const t=e[r];n[--s[t]]=r}}async function a(t){const{distances:e,sortOrderIndices:s}=t;return 0===e.length||0===s.length||i(e,s),{result:new n(e,s),transferList:[e.buffer,s.buffer]}}function f(){e=null,s=null}export{t as SplatSortWorkerInput,n as SplatSortWorkerOutput,f as destroy,a as sort};
5
+ class t{constructor(t,s,n,r=!1){this.distances=t,this.sortOrderIndices=s,this.numGaussians=n,this.preciseSort=r}}class s{constructor(t,s){this.distances=t,this.sortedOrderIndices=s}}let n=null,r=null;const e=10,o=20,i=.25;function l(t,s){n?.length!==t&&(n=new Uint32Array(t)),r&&r.length===1+(1<<s)?r.fill(0):r=new Uint32Array(1+(1<<s))}function a(t,s){const a=t.length,c=Math.max(e,Math.min(o,Math.round(Math.log2(a/i)))),u=1+(1<<c);l(a,c);let f=t[0],h=t[0];for(let n=0;n<t.length;n++)f=Math.min(f,t[n]),h=Math.max(h,t[n]);const d=h-f;if(d<1e-6)for(let e=0;e<a;++e)n[e]=0,r[0]++;else{const s=(1<<c)/d;for(let e=0;e<a;e++){const o=(t[e]-f)*s>>>0;n[e]=o,r[o]++}}for(let n=1;n<u;n++)r[n]+=r[n-1];for(let e=0;e<a;e++){const t=n[e];s[--r[t]]=e}}async function c(t){const{distances:n,sortOrderIndices:r,preciseSort:e,numGaussians:o}=t,i=n.subarray(0,o),l=r.subarray(0,o);if(0===i.length||0===l.length)return{result:new s(n,r),transferList:[n.buffer,r.buffer]};if(e){const t=Array.from(l.keys());t.sort((t,s)=>i[t]-i[s]||t-s);const s=t.map(t=>l[t]);l.set(s)}else a(i,l);return{result:new s(n,r),transferList:[n.buffer,r.buffer]}}function u(){n=null,r=null}export{t as SplatSortWorkerInput,s as SplatSortWorkerOutput,u as destroy,c as sort};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import{throttle as e}from"../../../../core/throttle.js";import{property as r}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{clone as i}from"../../../../geometry/support/aaBoundingRect.js";import{toFlowData as a}from"../../../2d/engine/flow/dataUtils.js";import o from"../../layers/FlowSubView3D.js";import{tilesWaitingTime as l}from"./constants.js";import{tileToKey as n,FlowDataTile as d}from"./loadUtils.js";import{isRasterTile as h}from"../../terrain/TerrainData.js";let u=class extends o{constructor(t){super(t),this._flowDataTiles=g(),this._resetTileData=!0,this._throttledTriggerLoad=null,this._throttling=!1}initialize(){this.addHandles([this.surface.on("tile-data-changed",({tile:t,layerIndex:e,layerClass:r})=>{const{renderedTiles:s}=this;null!=s&&e===this._layerIndex&&1===r&&this._updateFlowDataTile(t)})]),this._throttledTriggerLoad=e(()=>{super.triggerLoad(),this._throttling=!1},()=>this._throttling=!0,l,this),this.addHandles(this._throttledTriggerLoad),this.updatingHandles.add(()=>this.renderedTiles,t=>{const e=g();t?.forEach(t=>{const r=this._flowDataTiles.get(n(t)),s=null==r||"delete"===r?this._getFlowDataCopy(t):r;null!=s&&e.set(n(t),s)}),this._flowDataTiles=e,this._resetTileData=!0,this.triggerLoad()})}abort(){super.abort(),this._throttling=!1}get _layerIndex(){return this.surface.getLayerIndexByUID(1,this.layerView.uid)}get updating(){return this.requireLoad||this.updatingHandles.updating||this._throttling}triggerLoad(){const t=this._numberLoadedTiles===this.renderedTiles?.size,{_throttledTriggerLoad:e}=this;t?(e.hasPendingUpdates()||e(),e.forceUpdate()):e()}async fetchDataAndGenerateStreamlines(t,e){const{_flowDataTiles:r,needsMagnitude:s,workerHandle:i}=this,a=this.getSimulationSettings(t);if(null==a||null==i)return;const o=this._resetTileData;this._resetTileData=!1;const l=g();r.forEach((t,e)=>{"delete"===t?(l.set(e,"delete"),r.delete(e)):(o||"on-worker"!==t)&&(l.set(e,t),r.set(e,"on-worker"))});const n={simulationSettings:a,flowExtentInfo:t.flowExtentInfo,flowDataTiles:l,pixelSize:this.surface.tilingScheme.pixelSize,reset:o,needsMagnitude:s,startPositions:this.startPositions(t)},{streamlines:d}=await i.generateTiledStreamlines(n,e);return d}_getFlowDataCopy(t){const{_layerIndex:e}=this,r=null==t.surface;if(null==e||r)return null;const s=t.getLayerInfo(e,1);if(null==s)return null;if(!t.visible&&null==s.requestAbort)return s.requestAbort=new AbortController,this.surface.requestTileData(t,e,1,s.requestAbort),null;if(s.dataMissing||!t.hasLayerData(e,1))return null;const{data:o}=s;if(!h(o))return null;const l=a(this.layer.serviceRasterInfo.dataType,o.source),n=new Uint8Array(l.width*l.height);for(let i=0;i<n.length;i++)n[i]=l.mask[i];return new d(l.data,n,l.width,l.height,t.lij,i(t.extent))}_updateFlowDataTile(t){const e=this.renderedTiles?.has(t)?this._getFlowDataCopy(t)??"delete":"delete";this._setTileData(t,e)&&this.triggerLoad()}_setTileData(t,e){const r=n(t);return(null!=this._flowDataTiles.get(r)||"delete"!==e)&&(this._flowDataTiles.set(r,e),!0)}get _numberLoadedTiles(){let t=0;for(const e of this._flowDataTiles.values())"delete"!==e&&t++;return t}get test(){return{...super.test,loadedTiles:this._flowDataTiles}}};function g(){return new Map}t([r()],u.prototype,"_throttling",void 0),t([r()],u.prototype,"updating",null),u=t([s("esri.views.3d.support.flow.FlowSubViewTiles3D")],u);export{u as default};
5
+ import{__decorate as t}from"tslib";import{throttle as e}from"../../../../core/throttle.js";import{property as r}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{clone as i}from"../../../../geometry/support/aaBoundingRect.js";import{toFlowData as a}from"../../../2d/engine/flow/dataUtils.js";import o from"../../layers/FlowSubView3D.js";import{tilesWaitingTime as l}from"./constants.js";import{tileToKey as n,FlowDataTile as d}from"./loadUtils.js";import{isRasterTile as u}from"../../terrain/TerrainData.js";let h=class extends o{constructor(t){super(t),this._resetTileData=!0,this._throttledTriggerLoad=null,this._throttling=!1}initialize(){this.addHandles([this.surface.on("tile-data-changed",({tile:t,layerIndex:e,layerClass:r})=>{const{renderedTiles:s}=this;null!=s&&e===this._layerIndex&&1===r&&this._updateFlowDataTile(t)})]),this._throttledTriggerLoad=e(()=>{super.triggerLoad(),this._throttling=!1},()=>this._throttling=!0,l,this),this.addHandles(this._throttledTriggerLoad),this.updatingHandles.add(()=>this.renderedTiles,t=>{const e=g();t?.forEach(t=>{const r=this._flowDataTiles?.get(n(t)),s=null==r||"delete"===r?this._getFlowDataCopy(t):r;null!=s&&e.set(n(t),s)}),this._flowDataTiles=e,this._resetTileData=!0,this.triggerLoad()})}abort(){super.abort(),this._throttling=!1}get _layerIndex(){return this.surface.getLayerIndexByUID(1,this.layerView.uid)}get updating(){return this.requireLoad||this.updatingHandles.updating||this._throttling}get readyToLoad(){return super.readyToLoad&&null!=this._flowDataTiles}triggerLoad(){const t=this._numberLoadedTiles===this.renderedTiles?.size,{_throttledTriggerLoad:e}=this;t?(e.hasPendingUpdates()||e(),e.forceUpdate()):e()}async fetchDataAndGenerateStreamlines(t,e){const{_flowDataTiles:r,needsMagnitude:s,workerHandle:i}=this,a=this.getSimulationSettings(t);if(null==a||null==i||null==r)return;const o=this._resetTileData;this._resetTileData=!1;const l=g();r.forEach((t,e)=>{"delete"===t?(l.set(e,"delete"),r.delete(e)):(o||"on-worker"!==t)&&(l.set(e,t),r.set(e,"on-worker"))});const n={simulationSettings:a,flowExtentInfo:t.flowExtentInfo,flowDataTiles:l,pixelSize:this.surface.tilingScheme.pixelSize,reset:o,needsMagnitude:s,startPositions:this.startPositions(t)},{streamlines:d}=await i.generateTiledStreamlines(n,e);return d}_getFlowDataCopy(t){const{_layerIndex:e}=this,r=null==t.surface;if(null==e||r)return null;const s=t.getLayerInfo(e,1);if(null==s)return null;if(!t.visible&&null==s.requestAbort)return s.requestAbort=new AbortController,this.surface.requestTileData(t,e,1,s.requestAbort),null;if(s.dataMissing||!t.hasLayerData(e,1))return null;const{data:o}=s;if(!u(o))return null;const l=a(this.layer.serviceRasterInfo.dataType,o.source),n=new Uint8Array(l.width*l.height);for(let i=0;i<n.length;i++)n[i]=l.mask[i];return new d(l.data,n,l.width,l.height,t.lij,i(t.extent))}_updateFlowDataTile(t){const e=this.renderedTiles?.has(t)?this._getFlowDataCopy(t)??"delete":"delete";this._setTileData(t,e)&&this.triggerLoad()}_setTileData(t,e){const{_flowDataTiles:r}=this;if(null==r)return!1;const s=n(t);return(null!=r.get(s)||"delete"!==e)&&(r.set(s,e),!0)}get _numberLoadedTiles(){let t=0;for(const e of this._flowDataTiles?.values()??[])"delete"!==e&&t++;return t}get test(){return{...super.test,loadedTiles:this._flowDataTiles??g()}}};function g(){return new Map}t([r()],h.prototype,"_throttling",void 0),t([r()],h.prototype,"updating",null),h=t([s("esri.views.3d.support.flow.FlowSubViewTiles3D")],h);export{h as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{reallocGrowthFactor as e}from"../../../../core/arrayUtils.js";import{signal as t}from"../../../../core/signal.js";import{makeScheduleFunction as s}from"../../layers/support/makeScheduleFunction.js";import{GaussianSplatSortWorkerHandle as r}from"../GaussianSplatWorkerHandle.js";import{GaussianSplatOrderTexture as i}from"./GaussianSplatOrderTexture.js";import{GaussianSplatTextureAtlas as a}from"./GaussianSplatTextureAtlas.js";class n{constructor(e){this._updating=t(!1),this.visibleGaussians=0,this._visibleGaussianTiles=new Array,this._workerHandle=null,this._isSorting=!1,this._pendingSortTask=!1,this._bufferCapacity=0,this._renderer=e,this._orderTexture=new i(this._renderer.renderingContext),this._textureAtlas=new a(this._renderer.renderingContext,this._renderer.view.resourceController.memoryController,this._renderer.fboCache);const{resourceController:n}=this._renderer.view;this._workerHandle=new r(s(n))}get textureAtlas(){return this._textureAtlas}get orderTexture(){return this._orderTexture}get visibleGaussianTiles(){return this._visibleGaussianTiles}updateGaussianVisibility(e){this._visibleGaussianTiles=e,this.requestSort()}requestSort(){this._updating.value=!0,this._isSorting?this._pendingSortTask=!0:(this._isSorting=!0,this._pendingSortTask=!1,this._sortOnWorker().then(()=>{this._isSorting=!1,this._pendingSortTask?this.requestSort():this._updating.value=!1}).catch(()=>{this._isSorting=!1,this._pendingSortTask?this.requestSort():this._updating.value=!1}))}isUpdating(){return this._updating.value}destroy(){this._workerHandle?.destroyWorkerAndSelf(),this._textureAtlas.destroy(),this._orderTexture.destroy()}_clearBuffersAndTextures(){this._bufferCapacity=0,this._orderTexture.clear(),this._textureAtlas.clear()}_ensureBufferCapacity(t){if(this._bufferCapacity<t){const s=Math.ceil(t*e);this._atlasIndicesBuffer=new Uint32Array(s),this._sortedAtlasIndicesBuffer=new Uint32Array(s),this._bufferCapacity=s}}async _sortOnWorker(){let e=0;if(this._visibleGaussianTiles.forEach(t=>e+=t.gaussianAtlasIndices.length),0===e)return this.visibleGaussians=0,this._clearBuffersAndTextures(),void this._renderer.requestRender(1);this._ensureBufferCapacity(e),this._textureAtlas.ensureTextureAtlas();const t=this._renderer.camera.ray.direction,s=t[0],r=t[1],i=t[2],a=1/Math.sqrt(s*s+r*r+i*i),n=s*a,o=r*a,u=i*a,l=this._atlasIndicesBuffer.subarray(0,e),h=new Float64Array(e);let d=0;this._visibleGaussianTiles.forEach(e=>{const t=e.gaussianAtlasIndices,s=e.positions;for(let r=0;r<t.length;r++){l[d]=t[r];const e=3*r,i=s[e],a=s[e+1],_=s[e+2];h[d]=i*n+a*o+_*u,d++}});const _=new Uint32Array(e);for(let f=0;f<e;f++)_[f]=f;const c={distances:h,sortOrderIndices:_};await(this._workerHandle?.sort(c).then(t=>{const s=this._sortedAtlasIndicesBuffer.subarray(0,e);for(let i=0;i<e;i++)s[i]=l[t.sortedOrderIndices[i]];this._orderTexture.setData(s,e);const r=this._renderer.view.qualitySettings.gaussianSplat.maxAllowedVisibleGaussians;this.visibleGaussians=Math.min(e,r),this._renderer.requestRender(1)}))}}export{n as GaussianSplatDataStore};
5
+ import{reallocGrowthFactor as e}from"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{signal as s}from"../../../../core/signal.js";import{makeScheduleFunction as t}from"../../layers/support/makeScheduleFunction.js";import{GaussianSplatSortWorkerHandle as r}from"../GaussianSplatWorkerHandle.js";import{GaussianSplatOrderTexture as i}from"./GaussianSplatOrderTexture.js";import{GaussianSplatTextureAtlas as a}from"./GaussianSplatTextureAtlas.js";class n{constructor(e){this._updating=s(!1),this.visibleGaussians=0,this._visibleGaussianTiles=new Array,this._workerHandle=null,this._isSorting=!1,this._pendingSortTask=!1,this._bufferCapacity=0,this._renderer=e,this._orderTexture=new i(this._renderer.renderingContext),this._textureAtlas=new a(this._renderer.renderingContext,this._renderer.view.resourceController.memoryController,this._renderer.fboCache);const{resourceController:n}=this._renderer.view;this._workerHandle=new r(t(n))}get textureAtlas(){return this._textureAtlas}get orderTexture(){return this._orderTexture}get visibleGaussianTiles(){return this._visibleGaussianTiles}updateGaussianVisibility(e){this._visibleGaussianTiles=e,this.requestSort()}isUpdating(){return this._updating.value}destroy(){this._pendingSortTask=!1,this._workerHandle?.destroyWorkerAndSelf(),this._textureAtlas.destroy(),this._orderTexture.destroy()}requestSort(){this._updating.value=!0,this._isSorting?this._pendingSortTask=!0:(this._isSorting=!0,this._pendingSortTask=!1,this._sortOnWorker().then(()=>this._handleSortComplete()).catch(()=>this._handleSortComplete()))}_handleSortComplete(){this._isSorting=!1,this._pendingSortTask?this.requestSort():this._updating.value=!1}_clearBuffersAndTextures(){this._bufferCapacity=0,this._orderTexture.clear(),this._textureAtlas.clear()}_ensureBufferCapacity(s){if(this._bufferCapacity<s){const t=Math.ceil(s*e);this._atlasIndicesBuffer=new Uint32Array(t),this._sortedAtlasIndicesBuffer=new Uint32Array(t),this._distancesBuffer=new Float64Array(t),this._sortOrderBuffer=new Uint32Array(t),this._bufferCapacity=t}}async _sortOnWorker(){let e=0;if(this._visibleGaussianTiles.forEach(s=>e+=s.gaussianAtlasIndices.length),0===e)return this.visibleGaussians=0,this._clearBuffersAndTextures(),void this._renderer.requestRender(1);this._ensureBufferCapacity(e),this._textureAtlas.ensureTextureAtlas();const s=this._renderer.camera.eye,t=s[0],r=s[1],i=s[2],a=this._atlasIndicesBuffer.subarray(0,e);let n=0;this._visibleGaussianTiles.forEach(e=>{const s=e.gaussianAtlasIndices,o=e.positions;for(let u=0;u<s.length;u++){a[n]=s[u];const e=3*u,h=o[e],l=o[e+1],d=o[e+2],_=h-t,f=l-r,c=d-i;this._distancesBuffer[n]=_*_+f*f+c*c,n++}});for(let u=0;u<e;u++)this._sortOrderBuffer[u]=u;const o={distances:this._distancesBuffer,sortOrderIndices:this._sortOrderBuffer,numGaussians:e,preciseSort:!1};await(this._workerHandle?.sort(o).then(s=>{this._distancesBuffer=s.distances,this._sortOrderBuffer=s.sortedOrderIndices;const t=this._sortedAtlasIndicesBuffer.subarray(0,e);for(let i=0;i<e;i++)t[i]=a[s.sortedOrderIndices[i]];this._orderTexture.setData(t,e);const r=this._renderer.view.qualitySettings.gaussianSplat.maxAllowedVisibleGaussians;this.visibleGaussians=Math.min(e,r),this._renderer.requestRender(1)}))}}export{n as GaussianSplatDataStore};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../Graphic.js";import{isIterable as n}from"../../../core/iteratorUtils.js";import{screenPointObjectToArray as i,createScreenPointArray as t}from"../../../core/screenUtils.js";import{create as r}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import s from"../../../geometry/Point.js";import l from"../../../geometry/SpatialReference.js";import{projectVectorToVector as o}from"../../../geometry/projection/projectVectorToVector.js";import{fallbackObjectIDAttribute as c}from"../../../layers/LayerConstants.js";import{isIntegratedMeshLayer as a}from"../../../layers/support/layerUtils.js";import{debugFlags as u}from"./debugFlags.js";import{getElevationAtPoint as d}from"./ElevationProvider.js";import{Intersector as p}from"../webgl-engine/lib/Intersector.js";import{isValidIntersectorResult as m}from"../webgl-engine/lib/IntersectorResult.js";import{toHit as f,toOwner as g}from"../webgl-engine/lib/intersectorUtilsConversions.js";import{terrainId as y}from"../webgl-engine/lib/verticalOffsetUtils.js";async function h(e,n,i,r){const s=i?x(e,i):r,l=t(n.x,n.y);s.requiresGroundFeedback=!0,s.enableDraped=!0;const o=new p(e.state.viewingMode);o.options.selectionMode=!0,o.options.store=2,e.sceneIntersectionHelper.intersectIntersectorScreen(l,o,s);const c=await b(e,o.results.all,s.graphics),d=o.results.ground,f=g(d,e),y=null!=f&&"type"in f&&a(f.type)?f:null,h={screenPoint:n,results:c,ground:{mapPoint:U(e,d),distance:m(d)?d.distanceInRenderSpace:0,layer:y}};return u.SCENEVIEW_HITTEST_RETURN_INTERSECTOR&&(h.intersector=o),h}function w(e,n,t,r){const s=t?x(e,t):r,l=!(!s.graphics?.include&&!s.graphics?.exclude),o=!(!s.mediaElements?.include&&!s.mediaElements?.exclude),c=i(n);s.enableDraped=s.include&&!s.include.has(y)||s.exclude?.has(y);const a=e.sceneIntersectionHelper,u=new p(e.state.viewingMode);if(u.options.selectionMode=!0,u.options.store=l||o?2:0,u.options.excludeLabels=t?.excludeLabels??!1,a.intersectIntersectorScreen(c,u,s),l||o){for(const n of u.results.all){const i=f(n,e);if(null==i)return U(e,n);if(l&&("graphic"!==i.type||E(s.graphics,i.graphic)))return U(e,n);if(o&&("media"!==i.type||S(s.mediaElements,i.element)))return U(e,n)}return null}return U(e,u.results.min)}async function b(e,n,i){const t=new Array;let r,s=null;const l={defer(e){r=e()}};for(let o=0;o<n.length;o++){const c=n[o],u=g(c,e);if(null!=u&&(u===e.map.ground||"type"in u&&a(u.type)))break;const d=f(c,e,l)??await r;if(r=null,null==d)continue;if("graphic"===d.type){if(null==s&&o!==n.length-1&&(s=new Set),null!=s){const e=j(d.graphic);if(s.has(e))continue;s.add(e)}if(!E(i,d.graphic))continue}const p=U(e,c),m=c.distanceInRenderSpace;if("media"===d.type){const e=d.element.toSource(p);t.push({...d,mapPoint:p,distance:m,sourcePoint:e})}else t.push({...d,mapPoint:p,distance:m})}return t}function U(e,n,i){return n.getIntersectionPoint(C)?(i=V(e,C,i),7===n.intersector&&e.basemapTerrain&&(i.z=d(e.basemapTerrain,i)??0),i):null}function j(e){const n=e.getObjectId()??e.attributes?.[c];return e.origin&&null!=n?`o-${e.origin.id}-${n}`:`u-${e.uid}`}function E(e,n){return S(e,j(n))}function S(e,n){return null==e||(null==e.include||e.include.has(n))&&(null==e.exclude||!e.exclude.has(n))}function V(e,n,i){let t=e.spatialReference||l.WGS84;return o(n,e.renderSpatialReference,C,t)?n=C:(t=l.WGS84,o(n,e.renderSpatialReference,C,t)&&(n=C)),i?(i.x=n[0],i.y=n[1],i.z=n[2],i.spatialReference=t):i=new s(n,t),i}function x(e,n){const i=I(e,n.include,0),t=I(e,n.exclude,1);return{include:i.layerViewUids,exclude:t.layerViewUids,graphics:{include:i.graphicUids,exclude:t.graphicUids},mediaElements:{include:i.mediaElements,exclude:t.mediaElements}}}function I(i,t,r,s=new R){if(!t)return s;if(t instanceof e)M(s,j(t)),0===r&&(null!=i.graphicsView&&t.layer===i?P(s,i.graphicsView.uid):t.layer&&T(s,i,t.layer.uid));else if("layer"in t&&"element"in t)L(s,t.element),0===r&&T(s,i,t.layer.uid);else if(n(t))for(const e of t)e===i.graphics&&null!=i.graphicsView?P(s,i.graphicsView.uid):e===i.map.ground?P(s,y):I(i,e,r,s);else"layer"in t&&v(s,i,t),"uid"in t&&T(s,i,t.uid);return s}class R{constructor(){this.layerViewUids=null,this.graphicUids=null,this.mediaElements=null}}function T(e,n,i){const t=n.allLayerViews.find(e=>e.layer.uid===i);t&&P(e,t.uid)}function P(e,n){e.layerViewUids??=new Map,e.layerViewUids.set(n,!0)}function v(e,n,i){const t=n.allLayerViews.find(e=>e.layer.uid===i.layer.uid);if(!t)return;e.layerViewUids??=new Map;const r=e.layerViewUids.get(t.uid);!0!==r&&(r?r.add(i.id):e.layerViewUids.set(t.uid,new Set([i.id])))}function M(e,n){e.graphicUids??=new Set,e.graphicUids.add(n)}function L(e,n){e.mediaElements??=new Set,e.mediaElements.add(n)}const C=r();export{V as computeMapPointFromVec3d,x as externalToInternalIntersectOptions,h as hitTest,U as intersectResultToMapPoint,w as toMap};
5
+ import e from"../../../Graphic.js";import{isIterable as n}from"../../../core/iteratorUtils.js";import{screenPointObjectToArray as i,createScreenPointArray as t}from"../../../core/screenUtils.js";import{create as r}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import s from"../../../geometry/Point.js";import l from"../../../geometry/SpatialReference.js";import{projectVectorToVector as o}from"../../../geometry/projection/projectVectorToVector.js";import{fallbackObjectIDAttribute as c}from"../../../layers/LayerConstants.js";import{isIntegratedMeshLayer as a}from"../../../layers/support/layerUtils.js";import{debugFlags as u}from"./debugFlags.js";import{getElevationAtPoint as d}from"./ElevationProvider.js";import{Intersector as p}from"../webgl-engine/lib/Intersector.js";import{isValidIntersectorResult as m}from"../webgl-engine/lib/IntersectorResult.js";import{toHit as f,toOwner as g}from"../webgl-engine/lib/intersectorUtilsConversions.js";import{terrainId as y}from"../webgl-engine/lib/verticalOffsetUtils.js";async function h(e,n,i,r){const s=i?x(e,i):r,l=t(n.x,n.y);s.requiresGroundFeedback=!0,s.enableDraped=!0;const o=new p(e.state.viewingMode);o.options.selectionMode=!0,o.options.store=2,e.sceneIntersectionHelper.intersectIntersectorScreen(l,o,s);const c=await b(e,o.results.all,s.graphics),d=o.results.ground,f=g(d,e),y=null!=f&&"type"in f&&a(f)?f:null,h={screenPoint:n,results:c,ground:{mapPoint:U(e,d),distance:m(d)?d.distanceInRenderSpace:0,layer:y}};return u.SCENEVIEW_HITTEST_RETURN_INTERSECTOR&&(h.intersector=o),h}function w(e,n,t,r){const s=t?x(e,t):r,l=!(!s.graphics?.include&&!s.graphics?.exclude),o=!(!s.mediaElements?.include&&!s.mediaElements?.exclude),c=i(n);s.enableDraped=s.include&&!s.include.has(y)||s.exclude?.has(y);const a=e.sceneIntersectionHelper,u=new p(e.state.viewingMode);if(u.options.selectionMode=!0,u.options.store=l||o?2:0,u.options.excludeLabels=t?.excludeLabels??!1,a.intersectIntersectorScreen(c,u,s),l||o){for(const n of u.results.all){const i=f(n,e);if(null==i)return U(e,n);if(l&&("graphic"!==i.type||E(s.graphics,i.graphic)))return U(e,n);if(o&&("media"!==i.type||S(s.mediaElements,i.element)))return U(e,n)}return null}return U(e,u.results.min)}async function b(e,n,i){const t=new Array;let r,s=null;const l={defer(e){r=e()}};for(let o=0;o<n.length;o++){const c=n[o],u=g(c,e);if(null!=u&&(u===e.map.ground||"type"in u&&a(u)))break;const d=f(c,e,l)??await r;if(r=null,null==d)continue;if("graphic"===d.type){if(null==s&&o!==n.length-1&&(s=new Set),null!=s){const e=j(d.graphic);if(s.has(e))continue;s.add(e)}if(!E(i,d.graphic))continue}const p=U(e,c),m=c.distanceInRenderSpace;if("media"===d.type){const e=d.element.toSource(p);t.push({...d,mapPoint:p,distance:m,sourcePoint:e})}else t.push({...d,mapPoint:p,distance:m})}return t}function U(e,n,i){return n.getIntersectionPoint(C)?(i=V(e,C,i),7===n.intersector&&e.basemapTerrain&&(i.z=d(e.basemapTerrain,i)??0),i):null}function j(e){const n=e.getObjectId()??e.attributes?.[c];return e.origin&&null!=n?`o-${e.origin.id}-${n}`:`u-${e.uid}`}function E(e,n){return S(e,j(n))}function S(e,n){return null==e||(null==e.include||e.include.has(n))&&(null==e.exclude||!e.exclude.has(n))}function V(e,n,i){let t=e.spatialReference||l.WGS84;return o(n,e.renderSpatialReference,C,t)?n=C:(t=l.WGS84,o(n,e.renderSpatialReference,C,t)&&(n=C)),i?(i.x=n[0],i.y=n[1],i.z=n[2],i.spatialReference=t):i=new s(n,t),i}function x(e,n){const i=I(e,n.include,0),t=I(e,n.exclude,1);return{include:i.layerViewUids,exclude:t.layerViewUids,graphics:{include:i.graphicUids,exclude:t.graphicUids},mediaElements:{include:i.mediaElements,exclude:t.mediaElements}}}function I(i,t,r,s=new R){if(!t)return s;if(t instanceof e)M(s,j(t)),0===r&&(null!=i.graphicsView&&t.layer===i?P(s,i.graphicsView.uid):t.layer&&T(s,i,t.layer.uid));else if("layer"in t&&"element"in t)L(s,t.element),0===r&&T(s,i,t.layer.uid);else if(n(t))for(const e of t)e===i.graphics&&null!=i.graphicsView?P(s,i.graphicsView.uid):e===i.map.ground?P(s,y):I(i,e,r,s);else"layer"in t&&v(s,i,t),"uid"in t&&T(s,i,t.uid);return s}class R{constructor(){this.layerViewUids=null,this.graphicUids=null,this.mediaElements=null}}function T(e,n,i){const t=n.allLayerViews.find(e=>e.layer.uid===i);t&&P(e,t.uid)}function P(e,n){e.layerViewUids??=new Map,e.layerViewUids.set(n,!0)}function v(e,n,i){const t=n.allLayerViews.find(e=>e.layer.uid===i.layer.uid);if(!t)return;e.layerViewUids??=new Map;const r=e.layerViewUids.get(t.uid);!0!==r&&(r?r.add(i.id):e.layerViewUids.set(t.uid,new Set([i.id])))}function M(e,n){e.graphicUids??=new Set,e.graphicUids.add(n)}function L(e,n){e.mediaElements??=new Set,e.mediaElements.add(n)}const C=r();export{V as computeMapPointFromVec3d,x as externalToInternalIntersectOptions,h as hitTest,U as intersectResultToMapPoint,w as toMap};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import"../../../../core/has.js";import"../../../../core/Error.js";import"../../../../core/Logger.js";import{watch as r,on as o}from"../../../../core/reactiveUtils.js";import{property as s}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/RandomLCG.js";import{subclass as i}from"../../../../core/accessorSupport/decorators/subclass.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import l from"../../../../geometry/Point.js";import{center as n}from"../../../../geometry/support/aaBoundingRect.js";import"../../../../core/asyncUtils.js";import"../../../../core/unitUtils.js";import"../../../../geometry/ellipsoidUtils.js";import"../../../../geometry/Extent.js";import"../../../../geometry/Geometry.js";import"../../../../geometry/Multipoint.js";import"../../../../geometry/Polygon.js";import"../../../../geometry/Polyline.js";import"../../../../geometry/SpatialReference.js";import"../../../../geometry/operators/support/GeographicTransformation.js";import"../../../../geometry/projection/projectors.js";import"../../../../geometry/support/spatialReferenceUtils.js";import"../../../../layers/support/ElevationSampler.js";let p=class extends t{get surface(){return this.view.map?.ground}get surfaceView(){return this.view.basemapTerrain}get renderLocation(){if(!this.location)return null;const e=a();return this.view.renderCoordsHelper.toRenderCoords(this.location,e),e}constructor(e){super(e),this.location=null,this._updateController=null}initialize(){this.view.state.isLocal&&(this.addHandles([r(()=>[this.surfaceView?.spatialReference,this.surfaceView?.extent],()=>this._update()),o(()=>this.surface?.layers,"change",()=>this._update())]),this._update())}_update(){if(this._updateController&&(this._updateController.abort(),this._updateController=null),null==this.surfaceView?.extent||null==this.surfaceView.spatialReference)return void this._set("location",null);const e=n(this.surfaceView.extent),t=new l({x:e[0],y:e[1],z:0,spatialReference:this.surfaceView.spatialReference});this.surface&&this.surface.layers.length>0?(this._set("location",null),this._updateController=new AbortController,this.surface.queryElevation(t,{noDataValue:0,signal:this._updateController.signal,cache:this.cache}).then(e=>{this._updateController=null,this._set("location",e.geometry)}).catch(e=>{})):this._set("location",t)}};e([s({constructOnly:!0})],p.prototype,"view",void 0),e([s({constructOnly:!0})],p.prototype,"cache",void 0),e([s()],p.prototype,"surface",null),e([s()],p.prototype,"surfaceView",null),e([s({readOnly:!0})],p.prototype,"location",void 0),e([s({readOnly:!0})],p.prototype,"renderLocation",null),p=e([i("esri.views.3d.support.pointsOfInterest.StableSurfaceCenter")],p);export{p as StableSurfaceCenter};
5
+ import{__decorate as t}from"tslib";import e from"../../../../core/Accessor.js";import"../../../../core/has.js";import{abortMaybe as r}from"../../../../core/maybe.js";import"../../../../core/Error.js";import"../../../../core/Logger.js";import{watch as o,on as i}from"../../../../core/reactiveUtils.js";import{property as s}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/RandomLCG.js";import{subclass as n}from"../../../../core/accessorSupport/decorators/subclass.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import a from"../../../../geometry/Point.js";import{center as p}from"../../../../geometry/support/aaBoundingRect.js";import"../../../../core/asyncUtils.js";import"../../../../core/unitUtils.js";import"../../../../geometry/ellipsoidUtils.js";import"../../../../geometry/Extent.js";import"../../../../geometry/Geometry.js";import"../../../../geometry/Multipoint.js";import"../../../../geometry/Polygon.js";import"../../../../geometry/Polyline.js";import"../../../../geometry/SpatialReference.js";import"../../../../geometry/operators/support/GeographicTransformation.js";import"../../../../geometry/projection/projectors.js";import"../../../../geometry/support/spatialReferenceUtils.js";import"../../../../layers/support/TileElevationSampler.js";let c=class extends e{constructor(t){super(t),this.location=null,this._updateController=null}initialize(){this.view.state.isLocal&&(this.addHandles([o(()=>[this._terrain?.spatialReference,this._terrain?.extent],()=>this._update()),i(()=>this._ground?.layers,"change",()=>this._update())]),this._update())}destroy(){this._updateController=r(this._updateController)}get renderLocation(){if(!this.location)return null;const t=l();return this.view.renderCoordsHelper.toRenderCoords(this.location,t),t}get _ground(){return this.view.map?.ground}get _terrain(){return this.view.basemapTerrain}_update(){if(this._updateController=r(this._updateController),null==this._terrain?.extent||null==this._terrain?.spatialReference)return void this._set("location",null);const t=p(this._terrain.extent),e=new a({x:t[0],y:t[1],z:0,spatialReference:this._terrain.spatialReference});this._ground&&this._ground.layers.length>0?(this._set("location",null),this._updateController=new AbortController,this._ground.queryElevation(e,{noDataValue:0,signal:this._updateController.signal,cache:this.cache}).then(t=>{this._updateController=null,this._set("location",t.geometry)}).catch(t=>{})):this._set("location",e)}};t([s({constructOnly:!0})],c.prototype,"view",void 0),t([s({constructOnly:!0})],c.prototype,"cache",void 0),t([s({readOnly:!0})],c.prototype,"location",void 0),t([s({readOnly:!0})],c.prototype,"renderLocation",null),t([s()],c.prototype,"_ground",null),t([s()],c.prototype,"_terrain",null),c=t([n("esri.views.3d.support.pointsOfInterest.StableSurfaceCenter")],c);export{c as StableSurfaceCenter};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{isIntegratedMeshLayer as e}from"../../../layers/support/layerUtils.js";import{hitTestSelectSimilarDistance as a}from"../../support/hitTestSelectUtils.js";async function t(t,i){const{results:o,ground:l}=await a(t,i),y=(!l.layer||!e(l.layer.type))&&l.mapPoint,c=[],p=s(t),d=y?r(t,p):n;let u=0,f=0;const m=()=>{const e=d.layerViews[f];y&&e&&"fetchPopupFeaturesAtLocation"in e&&c.push({mapPoint:l.mapPoint,layerView:e}),++f};let w=null;for(;u<o.length||f<d.layerViews.length;){const e=o[u];if(e&&"graphic"!==e.type)++u;else if("scene"!==e?.layer?.type||e?.layer?.parent!==t?.map?.basemap)if(e){const a=e.layer?.uid,t=d.layerUids.has(a)&&e.distance===l.distance,r=p.get(e.layer?.uid);if(w??=e.mapPoint,f<d.layerViews.length&&(t||(e.distance??0)>l.distance)&&d.layerViews[f]!==r){m();continue}c.push({graphic:e.graphic,layerView:r}),++u}else m();else++u}return w??=l.mapPoint,{hits:c,location:w}}function r(e,a){const t=new Set,r=new Set;for(let s=e.basemapTerrain.numLayers(1)-1;s>=0;s--){const a=e.basemapTerrain.layerViewByIndex(s,1);t.add(a.layer.uid),r.add(a)}const n=e.overlayManager.renderer.layers;for(const{uid:s}of n){const e=a.get(s);e&&(t.add(s),r.add(e))}return{layerUids:t,layerViews:Array.from(r).reverse()}}const n={layerUids:new Set,layerViews:[]};function s(e){const a=new Map;for(const t of e.allLayerViews){const e=t.layer.uid;a.set(e,t)}return a}export{t as popupHitTest};
5
+ import{isIntegratedMeshLayer as e}from"../../../layers/support/layerUtils.js";import{hitTestSelectSimilarDistance as a}from"../../support/hitTestSelectUtils.js";async function r(r,i){const{results:o,ground:l}=await a(r,i),c=(!l.layer||!e(l.layer))&&l.mapPoint,y=[],p=s(r),d=c?t(r,p):n;let u=0,f=0;const m=()=>{const e=d.layerViews[f];c&&e&&"fetchPopupFeaturesAtLocation"in e&&y.push({mapPoint:l.mapPoint,layerView:e}),++f};let w=null;for(;u<o.length||f<d.layerViews.length;){const e=o[u];if(e&&"graphic"!==e.type)++u;else if("scene"!==e?.layer?.type||e?.layer?.parent!==r?.map?.basemap)if(e){const a=e.layer?.uid,r=d.layerUids.has(a)&&e.distance===l.distance,t=p.get(e.layer?.uid);if(w??=e.mapPoint,f<d.layerViews.length&&(r||(e.distance??0)>l.distance)&&d.layerViews[f]!==t){m();continue}y.push({graphic:e.graphic,layerView:t}),++u}else m();else++u}return w??=l.mapPoint,{hits:y,location:w}}function t(e,a){const r=new Set,t=new Set;for(let s=e.basemapTerrain.numLayers(1)-1;s>=0;s--){const a=e.basemapTerrain.layerViewByIndex(s,1);r.add(a.layer.uid),t.add(a)}const n=e.overlayManager.renderer.layers;for(const{uid:s}of n){const e=a.get(s);e&&(r.add(s),t.add(e))}return{layerUids:r,layerViews:Array.from(t).reverse()}}const n={layerUids:new Set,layerViews:[]};function s(e){const a=new Map;for(const r of e.allLayerViews){const e=r.layer.uid;a.set(e,r)}return a}export{r as popupHitTest};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import{property as r}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as n}from"../../../core/accessorSupport/decorators/subclass.js";import{projectWithoutEngine as i}from"../../../geometry/projectionUtils.js";import{fromExtent as l,empty as s,expand as o,allFinite as a,equals as c}from"../../../geometry/support/aaBoundingRect.js";import{isIntegratedMeshOperationalLayer as p,isTiledLayer as u}from"../../../layers/support/layerUtils.js";import{webMercatorWorldExtent as y,geographicWorldExtent as f}from"./TerrainConst.js";import{getTiledLayerInfo as d,isProjectableRasterLayer as E}from"./terrainUtils.js";let m=class extends t{constructor(e){super(e)}initialize(){this.addHandles([this.layerViews.on("change",()=>this.notifyChange("stencilEnabledExtents"))])}destroy(){}get layerViewsExtent(){return this._computeLayerViewsExtent()}get tiledLayersExtent(){return this._computeTiledLayersExtent()}get stencilEnabledExtents(){return this._computeStencilEnabledExtents()}_computeStencilEnabledExtents(){const e=[];return this.layerViews.forEach(t=>{const r=t.layer;if("operationalLayerType"in r&&p(r.operationalLayerType)&&null!=this.viewSpatialReference){const t=g(r.fullExtent,this.viewSpatialReference);null!=t&&e.push(l(t))}}),e}};function x(e,t){return 1===e?new h(t):new w(t)}e([r({readOnly:!0})],m.prototype,"layerViewsExtent",null),e([r({readOnly:!0})],m.prototype,"tiledLayersExtent",null),e([r({readOnly:!0})],m.prototype,"stencilEnabledExtents",null),e([r()],m.prototype,"viewSpatialReference",void 0),e([r()],m.prototype,"tilingScheme",void 0),e([r()],m.prototype,"defaultTiledLayersExtent",void 0),e([r({constructOnly:!0})],m.prototype,"layers",void 0),e([r({constructOnly:!0})],m.prototype,"layerViews",void 0),m=e([n("esri.views.3d.terrain.ExtentHelper")],m);let h=class extends m{_computeLayerViewsExtent(){return this._globalExtent}_computeTiledLayersExtent(){return this._globalExtent}get _globalExtent(){return this.viewSpatialReference.isWebMercator?y:f}};h=e([n("esri.views.3d.terrain.ExtentHelper.ExtentHelperGlobal")],h);let w=class extends m{_computeLayerViewsExtent(){const e=s(),t=this.viewSpatialReference;this.layerViews.forEach(r=>{const n=r.layer;if(r.isResolved()&&("graphics"!==n.type||!n.internal)){const n=g("fullExtentInLocalViewSpatialReference"in r&&r.fullExtentInLocalViewSpatialReference||r.layer.fullExtent,t);o(e,n,e)}});const r=a(e)?e:null,n=this._get("layerViewsExtent");return c(r,n)?n:r}_computeTiledLayersExtent(){const e=this.tilingScheme;if(!e)return null;const t=this.viewSpatialReference,r=s();this.layers.forEach(n=>{if(n.loaded&&u(n)){const i=d(n,t,2);if(null==i)return;const{tileInfo:l,fullExtent:s}=i,a="tilemapCache"in n?n.tilemapCache?.effectiveMaxLOD:void 0;null!=l&&null!=s&&(E(n)||e.compatibleWith(l,a)&&s.spatialReference.equals(e.spatialReference))&&o(r,s,r)}}),o(r,this.defaultTiledLayersExtent,r);const n=a(r)?r:null,i=this._get("tiledLayersExtent");return c(n,i)?i:n}};function g(e,t){return null==e||e.spatialReference.equals(t)?e:i(e,e.spatialReference,t)}w=e([n("esri.views.3d.terrain.ExtentHelper.ExtentHelperLocal")],w);export{m as ExtentHelper,x as create};
5
+ import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import{property as r}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as n}from"../../../core/accessorSupport/decorators/subclass.js";import{projectWithoutEngine as i}from"../../../geometry/projectionUtils.js";import{fromExtent as l,empty as s,expand as o,allFinite as a,equals as c}from"../../../geometry/support/aaBoundingRect.js";import{isIntegratedMeshLayer as p,isTiledLayer as u}from"../../../layers/support/layerUtils.js";import{webMercatorWorldExtent as y,geographicWorldExtent as f}from"./TerrainConst.js";import{getTiledLayerInfo as d,isProjectableRasterLayer as E}from"./terrainUtils.js";let m=class extends t{constructor(e){super(e)}initialize(){this.addHandles([this.layerViews.on("change",()=>this.notifyChange("stencilEnabledExtents"))])}destroy(){}get layerViewsExtent(){return this._computeLayerViewsExtent()}get tiledLayersExtent(){return this._computeTiledLayersExtent()}get stencilEnabledExtents(){return this._computeStencilEnabledExtents()}_computeStencilEnabledExtents(){const e=[];return this.layerViews.forEach(t=>{const r=t.layer;if(p(r)&&null!=this.viewSpatialReference){const t=g(r.fullExtent,this.viewSpatialReference);null!=t&&e.push(l(t))}}),e}};function x(e,t){return 1===e?new h(t):new w(t)}e([r({readOnly:!0})],m.prototype,"layerViewsExtent",null),e([r({readOnly:!0})],m.prototype,"tiledLayersExtent",null),e([r({readOnly:!0})],m.prototype,"stencilEnabledExtents",null),e([r()],m.prototype,"viewSpatialReference",void 0),e([r()],m.prototype,"tilingScheme",void 0),e([r()],m.prototype,"defaultTiledLayersExtent",void 0),e([r({constructOnly:!0})],m.prototype,"layers",void 0),e([r({constructOnly:!0})],m.prototype,"layerViews",void 0),m=e([n("esri.views.3d.terrain.ExtentHelper")],m);let h=class extends m{_computeLayerViewsExtent(){return this._globalExtent}_computeTiledLayersExtent(){return this._globalExtent}get _globalExtent(){return this.viewSpatialReference.isWebMercator?y:f}};h=e([n("esri.views.3d.terrain.ExtentHelper.ExtentHelperGlobal")],h);let w=class extends m{_computeLayerViewsExtent(){const e=s(),t=this.viewSpatialReference;this.layerViews.forEach(r=>{const n=r.layer;if(r.isResolved()&&("graphics"!==n.type||!n.internal)){const n=g("fullExtentInLocalViewSpatialReference"in r&&r.fullExtentInLocalViewSpatialReference||r.layer.fullExtent,t);o(e,n,e)}});const r=a(e)?e:null,n=this._get("layerViewsExtent");return c(r,n)?n:r}_computeTiledLayersExtent(){const e=this.tilingScheme;if(!e)return null;const t=this.viewSpatialReference,r=s();this.layers.forEach(n=>{if(n.loaded&&u(n)){const i=d(n,t,2);if(null==i)return;const{tileInfo:l,fullExtent:s}=i,a="tilemapCache"in n?n.tilemapCache?.effectiveMaxLOD:void 0;null!=l&&null!=s&&(E(n)||e.compatibleWith(l,a)&&s.spatialReference.equals(e.spatialReference))&&o(r,s,r)}}),o(r,this.defaultTiledLayersExtent,r);const n=a(r)?r:null,i=this._get("tiledLayersExtent");return c(n,i)?i:n}};function g(e,t){return null==e||e.spatialReference.equals(t)?e:i(e,e.spatialReference,t)}w=e([n("esri.views.3d.terrain.ExtentHelper.ExtentHelperLocal")],w);export{m as ExtentHelper,x as create};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../../core/Logger.js";import{disposeMaybe as r}from"../../../../../core/maybe.js";import{isDepthOnlyOutput as i}from"../shaderLibrary/ShaderOutput.js";import{Program as t}from"../../lib/Program.js";import{PrimitiveType as o}from"../../../../webgl/enums.js";import{makePipelineState as s,defaultColorWrite as n,premultipliedAlpha as a}from"../../../../webgl/renderState.js";const p=()=>e.getLogger("esri.views.3d.webgl.ShaderTechnique");class l{constructor(e,i,s,n){this.primitiveType=o.TRIANGLES,this.key=i.key,this._program=new t(e.rctx,s.get().build(i),n),this._pipeline=this.initializePipeline(i),this.reload=async o=>{o&&await s.reload(),this.key.equals(i.key)||p().warn("Configuration was changed after construction, cannot reload shader.",s),r(this._program),this._program=new t(e.rctx,s.get().build(i),n),this._pipeline=this.initializePipeline(i)}}destroy(){this._program=r(this._program),this._pipeline=null}get program(){return this._program}get compiled(){return this.program.compiled}ensureAttributeLocations(e){this.program.assertCompatibleVertexAttributeLocations(e)}getPipeline(e,r){return this._pipeline}initializePipeline(e){return s({blending:a,colorWrite:n})}}function m(e,r){return i(e)?{buffers:[0]}:r??null}export{l as ShaderTechnique,m as depthOnlyOutputBuffersOr};
5
+ import e from"../../../../../core/Logger.js";import{disposeMaybe as r}from"../../../../../core/maybe.js";import{isDepthOnlyOutput as i}from"../shaderLibrary/ShaderOutput.js";import{Program as t}from"../../lib/Program.js";import{PrimitiveType as o,DrawBufferNone as s}from"../../../../webgl/enums.js";import{makePipelineState as n,defaultColorWrite as a,premultipliedAlpha as p}from"../../../../webgl/renderState.js";const l=()=>e.getLogger("esri.views.3d.webgl.ShaderTechnique");class m{constructor(e,i,s,n){this.primitiveType=o.TRIANGLES,this.key=i.key,this._program=new t(e.rctx,s.get().build(i),n),this._pipeline=this.initializePipeline(i),this.reload=async o=>{o&&await s.reload(),this.key.equals(i.key)||l().warn("Configuration was changed after construction, cannot reload shader.",s),r(this._program),this._program=new t(e.rctx,s.get().build(i),n),this._pipeline=this.initializePipeline(i)}}destroy(){this._program=r(this._program),this._pipeline=null}get program(){return this._program}get compiled(){return this.program.compiled}ensureAttributeLocations(e){this.program.assertCompatibleVertexAttributeLocations(e)}getPipeline(e,r){return this._pipeline}initializePipeline(e){return n({blending:p,colorWrite:a})}}function g(e,r){return i(e)?{buffers:[s]}:r??null}export{m as ShaderTechnique,g as depthOnlyOutputBuffersOr};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{C as e}from"../../../../../chunks/Compositing.glsl.js";import{CompositingTechnique as t}from"../../shaders/CompositingTechnique.js";import{CompositingTechniqueConfiguration as i}from"../../shaders/CompositingTechniqueConfiguration.js";class r{constructor(r,s=0){this._techniques=r,this._parameters=new e,this._configuration=new i,this._configuration.blitMode=s,r.precompile(t,this._configuration)}blit(e,t,i,r){this.blitTexture(e,t.getTexture(),i,r)}blitTexture(e,i,r,s){e.bindFramebuffer(r.fbo),e.setClearColor(0,0,0,1),e.clear(16384),this._parameters.texture=i;const o=this._techniques.get(t,this._configuration);e.bindTechnique(o,s,this._parameters),e.screen.draw()}blend(e,i,r,s,o=1){this._configuration.hasOpacityFactor=o<1;const n=this._techniques.get(t,this._configuration);return!!n.compiled&&(e.bindFramebuffer(r.fbo),this._parameters.texture=i.getTexture(),this._parameters.opacity=o,e.bindTechnique(n,s,this._parameters),e.screen.draw(),!0)}}export{r as Blit};
5
+ import{C as t}from"../../../../../chunks/Compositing.glsl.js";import{CompositingTechnique as i}from"../../shaders/CompositingTechnique.js";import{CompositingTechniqueConfiguration as e}from"../../shaders/CompositingTechniqueConfiguration.js";class r{constructor(r,s=0){this._techniques=r,this._parameters=new t,this._configuration=new e,this._configuration.blitMode=s,r.precompile(i,this._configuration),this._configuration.hasOpacityFactor=!0,r.precompile(i,this._configuration),this._configuration.hasOpacityFactor=!1}blit(t,i,e,r){this.blitTexture(t,i.getTexture(),e,r)}blitTexture(t,e,r,s){t.bindFramebuffer(r.fbo),t.setClearColor(0,0,0,1),t.clear(16384),this._parameters.texture=e;const o=this._techniques.get(i,this._configuration);t.bindTechnique(o,s,this._parameters),t.screen.draw()}blend(t,e,r,s,o=1){this._configuration.hasOpacityFactor=o<1;const n=this._techniques.get(i,this._configuration);return!!n.compiled&&(t.bindFramebuffer(r.fbo),this._parameters.texture=e.getTexture(),this._parameters.opacity=o,t.bindTechnique(n,s,this._parameters),t.screen.draw(),!0)}}export{r as Blit};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{ReloadableShaderModule as e}from"../../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as r}from"../../core/shaderTechnique/ShaderTechnique.js";import{a as s}from"../../../../../chunks/OITBlend.glsl.js";import{Pos2Locations as i}from"../../lib/DefaultVertexBufferLayouts.js";import{ColorAttachmentDisabled as o,ColorAttachment1 as t,ColorAttachment0 as m}from"../../../../webgl/enums.js";import{makePipelineState as l,defaultColorWrite as f,modulateDestination as n,unpremultipliedAlphaToPremultipliedAlpha as u}from"../../../../webgl/renderState.js";class a extends r{constructor(r,o){super(r,o,new e(s,()=>import("./OITBlend.glsl.js")),i)}initializePipeline(e){return l({blending:e.dimEmissive?n:u,colorWrite:f,drawBuffers:e.dimEmissive?{buffers:[o,t]}:e.hasEmitters?{buffers:[m,t]}:{buffers:[m]}})}}export{a as OITBlendTechnique};
5
+ import{ReloadableShaderModule as e}from"../../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as r}from"../../core/shaderTechnique/ShaderTechnique.js";import{a as s}from"../../../../../chunks/OITBlend.glsl.js";import{Pos2Locations as i}from"../../lib/DefaultVertexBufferLayouts.js";import{DrawBufferNone as o,ColorAttachment1 as t,ColorAttachment0 as m}from"../../../../webgl/enums.js";import{makePipelineState as l,defaultColorWrite as f,modulateDestination as n,unpremultipliedAlphaToPremultipliedAlpha as u}from"../../../../webgl/renderState.js";class a extends r{constructor(r,o){super(r,o,new e(s,()=>import("./OITBlend.glsl.js")),i)}initializePipeline(e){return l({blending:e.dimEmissive?n:u,colorWrite:f,drawBuffers:e.dimEmissive?{buffers:[o,t]}:e.hasEmitters?{buffers:[m,t]}:{buffers:[m]}})}}export{a as OITBlendTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{C as i}from"../../../../chunks/Compositing.glsl.js";import{CompositingTechnique as t}from"../shaders/CompositingTechnique.js";import{CompositingTechniqueConfiguration as s}from"../shaders/CompositingTechniqueConfiguration.js";import{H as e}from"../../../../chunks/HUDCompositing.glsl.js";import{HUDCompositingTechnique as o}from"../shaders/HUDCompositingTechnique.js";class r{constructor(r,h){this._rctx=r,this._techniques=h,this._configuration=new s,this._passParameters=new i,this._hudParameters=new e,this._configuration.blitMode=2,this._techniques.precompile(t,this._configuration),this._configuration.hasOpacityFactor=!0,this._techniques.precompile(t,this._configuration),this._configuration.hasOpacityFactor=!1,this._configuration.blitMode=1,this._techniques.precompile(t,this._configuration),this._configuration.blitEmissiveMode=1,this._techniques.precompile(t,this._configuration),this._configuration.blitEmissiveMode=0,this._configuration.blitMode=3,this._techniques.precompile(t,this._configuration),this._techniques.precompile(o)}compositeHUD(i,t){this._hudParameters.texture=t;const s=this._techniques.get(o);this._rctx.bindTechnique(s,i,this._hudParameters),this._rctx.screen.draw()}compositePreMultipliedAlpha(i,t,s=1){this._composite(i,t,2,s)}composite(i,t,s){this._composite(i,t,1,1,s)}blitDepthToLinearDepth(i,t){this._composite(i,t,3,1)}_composite(i,s,e,o,r=0){this._configuration.blitMode=e,this._configuration.hasOpacityFactor=1!==o,this._configuration.blitEmissiveMode=r,this._passParameters.texture=s,this._passParameters.opacity=o;const h=this._techniques.get(t,this._configuration);this._rctx.bindTechnique(h,i,this._passParameters),this._rctx.screen.draw()}}export{r as default};
5
+ import{C as i}from"../../../../chunks/Compositing.glsl.js";import{CompositingTechnique as t}from"../shaders/CompositingTechnique.js";import{CompositingTechniqueConfiguration as s}from"../shaders/CompositingTechniqueConfiguration.js";import{H as e}from"../../../../chunks/HUDCompositing.glsl.js";import{HUDCompositingTechnique as o}from"../shaders/HUDCompositingTechnique.js";class r{constructor(r,h){this._rctx=r,this._techniques=h,this._configuration=new s,this._passParameters=new i,this._hudParameters=new e,this._configuration.blitMode=2,this._techniques.precompile(t,this._configuration),this._configuration.blitMode=1,this._techniques.precompile(t,this._configuration),this._configuration.blitEmissiveMode=1,this._techniques.precompile(t,this._configuration),this._configuration.blitEmissiveMode=0,this._configuration.blitMode=3,this._techniques.precompile(t,this._configuration),this._techniques.precompile(o)}compositeHUD(i,t){this._hudParameters.texture=t;const s=this._techniques.get(o);this._rctx.bindTechnique(s,i,this._hudParameters),this._rctx.screen.draw()}compositePreMultipliedAlpha(i,t){this._composite(i,t,2)}composite(i,t,s){this._composite(i,t,1,s)}blitDepthToLinearDepth(i,t){this._composite(i,t,3)}_composite(i,s,e,o=0){this._configuration.blitMode=e,this._configuration.blitEmissiveMode=o,this._passParameters.texture=s;const r=this._techniques.get(t,this._configuration);this._rctx.bindTechnique(r,i,this._passParameters),this._rctx.screen.draw()}}export{r as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../../../Color.js";import{disposeMaybe as i}from"../../../../core/maybe.js";import{watch as s,syncAndInitial as o}from"../../../../core/reactiveUtils.js";import{property as r}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as l}from"../../../../core/accessorSupport/decorators/subclass.js";import{RenderCategory as a,InternalRenderCategory as n}from"../../webgl.js";import{glLayout as u}from"../../support/buffer/glUtil.js";import{newLayout as c}from"../../support/buffer/InterleavedLayout.js";import h from"../../webgl/RenderNode.js";import{VertexArrayObject as m}from"./VertexArrayObject.js";import{C as d}from"../../../../chunks/CutFillComposition.glsl.js";import{CutFillCompositionTechnique as f}from"../shaders/CutFillCompositionTechnique.js";import{C as p}from"../../../../chunks/CutFillMask.glsl.js";import{CutFillMaskTechnique as C}from"../shaders/CutFillMaskTechnique.js";import{DefaultMaterialPassParameters as _,DefaultMaterialTechnique as g}from"../shaders/DefaultMaterialTechnique.js";import{DefaultMaterialTechniqueConfiguration as b}from"../shaders/DefaultMaterialTechniqueConfiguration.js";import{DepthStencilAttachment as q,PrimitiveType as T}from"../../../webgl/enums.js";import{noParameters as F}from"../../../webgl/NoParameters.js";import{VertexBuffer as v}from"../../../webgl/VertexBuffer.js";let V=class extends h{constructor(e){super(e),this.consumes={required:[a.OPAQUE]},this.produces=n.CUTFILL_COLOR,this._vaoCut=null,this._vaoFill=null,this._countCut=0,this._countFill=0,this._maskParameters=new p,this._cutVolumeParameters=new _,this._fillVolumeParameters=new _,this._compositeParameters=new d;const t=1===e.view.state.viewingMode;this._cutVolumeTechniqueConfiguration=new b(t),this._cutVolumeTechniqueConfiguration.customDepthTest=2,this._cutVolumeTechniqueConfiguration.writeDepth=!1,this._cutVolumeTechniqueConfiguration.cullFace=1,this._cutVolumeTechniqueConfiguration.doubleSidedMode=1,this._fillVolumeTechniqueConfiguration=new b(t),this._fillVolumeTechniqueConfiguration.cullFace=2}initialize(){this.addHandles([s(()=>[this.cutColor,this.fillColor],()=>this._updateColors(),o)])}destroy(){this._vaoCut=i(this._vaoCut),this._vaoFill=i(this._vaoFill)}precompile(){this.techniques.precompile(g,this._cutVolumeTechniqueConfiguration),this.techniques.precompile(g,this._fillVolumeTechniqueConfiguration),this.techniques.precompile(C),this.techniques.precompile(f)}render(e){const t=this.techniques.get(g,this._cutVolumeTechniqueConfiguration),i=this.techniques.get(g,this._fillVolumeTechniqueConfiguration),s=this.techniques.get(C),o=this.techniques.get(f),r=e.find(({name:e})=>e===this.produces);if(!this._vaoCut||!this._vaoFill)return r;if(!(t&&i&&s.compiled&&o.compiled))return this.requestRender(1),r;const l=this.bindParameters,a=l.camera,n=a.fullViewport[2],u=a.fullViewport[3],c=this.renderingContext,h=this.fboCache,m=h.acquire(n,u,"cutfill color mask",2);m.attachDepth(r.getAttachment(q)),c.bindFramebuffer(m.fbo),c.setClearColor(0,0,0,1),c.clear(17408),c.setViewport(0,0,n,u);c.bindTechnique(s,l).bindDraw(l,F,this._maskParameters),c.setFaceCullingEnabled(!1),c.setStencilTestEnabled(!0),c.setStencilOpSeparate(1028,7680,34055,7680),c.setStencilOpSeparate(1029,7680,34056,7680),c.setDepthWriteEnabled(!1),c.bindVAO(this._vaoCut),c.setDepthTestEnabled(!0),c.setStencilWriteMask(255),c.setStencilFunction(519,0,255),c.setColorMask(!1,!1,!1,!1),c.drawArrays(T.TRIANGLES,0,this._countCut),c.setDepthTestEnabled(!1),c.setStencilWriteMask(0),c.setStencilFunction(517,0,255),c.setColorMask(!0,!0,!0,!0),c.drawArrays(T.TRIANGLES,0,this._countCut),c.bindVAO(this._vaoFill),c.setDepthTestEnabled(!0),c.setStencilWriteMask(255),c.setStencilFunction(519,0,255),c.setColorMask(!0,!0,!0,!0),c.drawArrays(T.TRIANGLES,0,this._countFill);const d=h.acquire(n,u,"cutfill color volumes",5);d.attachDepth(r.getAttachment(q)),c.bindFramebuffer(d.fbo),c.setClearColor(0,0,0,0),c.clear(16384),c.bindTechnique(t,this.bindParameters,this._cutVolumeParameters,this._maskParameters),c.setPolygonOffset(1,1),c.setPolygonOffsetFillEnabled(!0),c.bindVAO(this._vaoCut),c.drawArrays(T.TRIANGLES,0,this._countCut),c.bindTechnique(i,this.bindParameters,this._fillVolumeParameters,this._maskParameters),c.setPolygonOffset(0,0),c.setPolygonOffsetFillEnabled(!1),c.bindVAO(this._vaoFill),c.drawArrays(T.TRIANGLES,0,this._countFill);const p=this.fboCache.acquire(n,u,this.produces);return c.bindFramebuffer(p.fbo),this._compositeParameters.color=r.getTexture(),this._compositeParameters.cutFillVolumes=d.getTexture(),this._compositeParameters.cutFillMask=m.getTexture(),c.bindTechnique(o,l,this._compositeParameters),c.screen.draw(),m.release(),d.release(),p.attachDepth(r.getAttachment(q)),p}enable(){this.produces=n.CUTFILL_COLOR,this.requestRender(1)}disable(){this.produces="disabled",this.requestRender(1)}updateGeometries(e,t,s){this._vaoCut=i(this._vaoCut),this._vaoCut=this._createVao(e),this._countCut=e.indicesBottom.length+e.indicesExtruded.length,this._vaoFill=i(this._vaoFill),this._vaoFill=this._createVao(t),this._countFill=t.indicesBottom.length+t.indicesExtruded.length,this._maskParameters.origin=s,this.requestRender(1)}_updateColors(){this._cutVolumeParameters.diffuse=t.toUnitRGB(this.cutColor),this._cutVolumeParameters.opacity=this.cutColor.a,this._fillVolumeParameters.diffuse=t.toUnitRGB(this.fillColor),this._fillVolumeParameters.opacity=this.fillColor.a,this.requestRender(1)}_createVao(e){const t=this.renderingContext,{vertices:i,normals:s,indicesBottom:o,indicesExtruded:r}=e,l=w.createBuffer(o.length+r.length),{position:a,normal:n}=l;for(let u=0;u<o.length;u++){const e=3*o[u];a.set(u,0,i[e]),a.set(u,1,i[e+1]),a.set(u,2,i[e+2]),n.set(u,0,s[e]),n.set(u,1,s[e+1]),n.set(u,2,s[e+2])}for(let u=0;u<r.length;u++){const e=u+o.length,t=3*r[u];a.set(e,0,i[t]),a.set(e,1,i[t+1]),a.set(e,2,i[t+2]),n.set(e,0,s[t]),n.set(e,1,s[t+1]),n.set(e,2,s[t+2])}const c=new v(t,u(w),l.buffer);return new m(t,c)}};e([r()],V.prototype,"consumes",void 0),e([r()],V.prototype,"produces",void 0),e([r()],V.prototype,"cutColor",void 0),e([r()],V.prototype,"fillColor",void 0),V=e([l("esri.views.3d.webgl-engine.lib.CutFillColor")],V);const w=c().vec3f("position").vec3f("normal").freeze();class P{constructor(e,t,i,s){this.vertices=e,this.indicesBottom=t,this.indicesExtruded=i,this.normals=s}}export{V as CutFillColor,P as VolumeGeometry};
5
+ import{__decorate as e}from"tslib";import t from"../../../../Color.js";import{disposeMaybe as i}from"../../../../core/maybe.js";import{watch as s,syncAndInitial as o}from"../../../../core/reactiveUtils.js";import{property as r}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as l}from"../../../../core/accessorSupport/decorators/subclass.js";import{c as a}from"../../../../chunks/vec32.js";import{RenderCategory as n,InternalRenderCategory as u}from"../../webgl.js";import{glLayout as c}from"../../support/buffer/glUtil.js";import{newLayout as h}from"../../support/buffer/InterleavedLayout.js";import m from"../../webgl/RenderNode.js";import{VertexArrayObject as d}from"./VertexArrayObject.js";import{C as p}from"../../../../chunks/CutFillComposition.glsl.js";import{CutFillCompositionTechnique as f}from"../shaders/CutFillCompositionTechnique.js";import{C}from"../../../../chunks/CutFillMask.glsl.js";import{CutFillMaskTechnique as _}from"../shaders/CutFillMaskTechnique.js";import{DefaultMaterialPassParameters as g,DefaultMaterialDrawParameters as b,DefaultMaterialTechnique as q}from"../shaders/DefaultMaterialTechnique.js";import{DefaultMaterialTechniqueConfiguration as v}from"../shaders/DefaultMaterialTechniqueConfiguration.js";import{DepthStencilAttachment as T,PrimitiveType as F}from"../../../webgl/enums.js";import{noParameters as w}from"../../../webgl/NoParameters.js";import{VertexBuffer as V}from"../../../webgl/VertexBuffer.js";let P=class extends m{constructor(e){super(e),this.consumes={required:[n.OPAQUE]},this.produces=u.CUTFILL_COLOR,this._vaoCut=null,this._vaoFill=null,this._countCut=0,this._countFill=0,this._maskParameters=new C,this._cutVolumeParameters=new g,this._fillVolumeParameters=new g,this._compositeParameters=new p,this._drawParameters=new b;const t=1===e.view.state.viewingMode;this._cutVolumeTechniqueConfiguration=new v(t),this._cutVolumeTechniqueConfiguration.customDepthTest=2,this._cutVolumeTechniqueConfiguration.writeDepth=!1,this._cutVolumeTechniqueConfiguration.cullFace=1,this._cutVolumeTechniqueConfiguration.doubleSidedMode=1,this._fillVolumeTechniqueConfiguration=new v(t),this._fillVolumeTechniqueConfiguration.cullFace=2}initialize(){this.addHandles([s(()=>[this.cutColor,this.fillColor],()=>this._updateColors(),o)])}destroy(){this._vaoCut=i(this._vaoCut),this._vaoFill=i(this._vaoFill)}precompile(){this.techniques.precompile(q,this._cutVolumeTechniqueConfiguration),this.techniques.precompile(q,this._fillVolumeTechniqueConfiguration),this.techniques.precompile(_),this.techniques.precompile(f)}render(e){const i=this.techniques.get(q,this._cutVolumeTechniqueConfiguration),s=this.techniques.get(q,this._fillVolumeTechniqueConfiguration),o=this.techniques.get(_),r=this.techniques.get(f),l=e.find(({name:e})=>e===this.produces);if(!this._vaoCut||!this._vaoFill)return l;if(!(i&&s&&o.compiled&&r.compiled))return this.requestRender(1),l;const a=this.bindParameters,n=a.camera,u=n.fullViewport[2],c=n.fullViewport[3],h=this.renderingContext,m=this.fboCache,d=m.acquire(u,c,"cutfill color mask",2);d.attachDepth(l.getAttachment(T)),h.bindFramebuffer(d.fbo),h.setClearColor(0,0,0,1),h.clear(17408),h.setViewport(0,0,u,c),h.bindTechnique(o,a,w,this._maskParameters),h.setFaceCullingEnabled(!1),h.setStencilTestEnabled(!0),h.setStencilOpSeparate(1028,7680,34055,7680),h.setStencilOpSeparate(1029,7680,34056,7680),h.setDepthWriteEnabled(!1),h.bindVAO(this._vaoCut),h.setDepthTestEnabled(!0),h.setStencilWriteMask(255),h.setStencilFunction(519,0,255),h.setColorMask(!1,!1,!1,!1),h.drawArrays(F.TRIANGLES,0,this._countCut),h.setDepthTestEnabled(!1),h.setStencilWriteMask(0),h.setStencilFunction(517,0,255),h.setColorMask(!0,!1,!1,!1),h.drawArrays(F.TRIANGLES,0,this._countCut),h.bindVAO(this._vaoFill),h.setDepthTestEnabled(!0),h.setStencilWriteMask(255),h.setStencilFunction(519,0,255),h.setColorMask(!1,!0,!1,!1),h.drawArrays(F.TRIANGLES,0,this._countFill);const p=m.acquire(u,c,"cutfill color volumes",5);p.attachDepth(l.getAttachment(T)),h.bindFramebuffer(p.fbo),h.setClearColor(0,0,0,0),h.clear(16384),h.setColorMask(!0,!0,!0,!0),h.bindTechnique(i,this.bindParameters,this._cutVolumeParameters,this._drawParameters),h.setPolygonOffset(1,1),h.setPolygonOffsetFillEnabled(!0),h.bindVAO(this._vaoCut),h.drawArrays(F.TRIANGLES,0,this._countCut),h.bindTechnique(s,this.bindParameters,this._fillVolumeParameters,this._drawParameters),h.setPolygonOffset(0,0),h.setPolygonOffsetFillEnabled(!1),h.bindVAO(this._vaoFill),h.drawArrays(F.TRIANGLES,0,this._countFill);const C=this.fboCache.acquire(u,c,this.produces);return h.bindFramebuffer(C.fbo),this._compositeParameters.color=l.getTexture(),this._compositeParameters.cutFillVolumes=p.getTexture(),this._compositeParameters.cutFillMask=d.getTexture(),t.toUnitRGBA(this.borderColor,this._compositeParameters.borderColor),h.bindTechnique(r,a,this._compositeParameters),h.screen.draw(),d.release(),p.release(),C.attachDepth(l.getAttachment(T)),C}enable(){this.produces=u.CUTFILL_COLOR,this.requestRender(1)}disable(){this.produces="disabled",this.requestRender(1)}updateGeometries(e,t,s){this._vaoCut=i(this._vaoCut),this._vaoCut=this._createVao(e),this._countCut=e.indicesBottom.length+e.indicesExtruded.length,this._vaoFill=i(this._vaoFill),this._vaoFill=this._createVao(t),this._countFill=t.indicesBottom.length+t.indicesExtruded.length,this._maskParameters.origin=s,a(this._drawParameters.origin,s),this.requestRender(1)}_updateColors(){this._cutVolumeParameters.diffuse=t.toUnitRGB(this.cutColor),this._cutVolumeParameters.opacity=this.cutColor.a,this._fillVolumeParameters.diffuse=t.toUnitRGB(this.fillColor),this._fillVolumeParameters.opacity=this.fillColor.a,this.requestRender(1)}_createVao(e){const t=this.renderingContext,{vertices:i,normals:s,indicesBottom:o,indicesExtruded:r}=e,l=j.createBuffer(o.length+r.length),{position:a,normal:n}=l;for(let c=0;c<o.length;c++){const e=3*o[c];a.set(c,0,i[e]),a.set(c,1,i[e+1]),a.set(c,2,i[e+2]),n.set(c,0,s[e]),n.set(c,1,s[e+1]),n.set(c,2,s[e+2])}for(let c=0;c<r.length;c++){const e=c+o.length,t=3*r[c];a.set(e,0,i[t]),a.set(e,1,i[t+1]),a.set(e,2,i[t+2]),n.set(e,0,s[t]),n.set(e,1,s[t+1]),n.set(e,2,s[t+2])}const u=new V(t,c(j),l.buffer);return new d(t,u)}};e([r()],P.prototype,"consumes",void 0),e([r()],P.prototype,"produces",void 0),e([r()],P.prototype,"cutColor",void 0),e([r()],P.prototype,"fillColor",void 0),e([r()],P.prototype,"borderColor",void 0),P=e([l("esri.views.3d.webgl-engine.lib.CutFillColor")],P);const j=h().vec3f("position").vec3f("normal").freeze();class y{constructor(e,t,i,s){this.vertices=e,this.indicesBottom=t,this.indicesExtruded=i,this.normals=s}}export{P as CutFillColor,y as VolumeGeometry};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import"../core/shaderLibrary/ScreenSpacePass.glsl.js";import"../core/shaderModules/glsl.js";import"../core/shaderModules/Texture2DPassUniform.js";import"../../../webgl/NoParameters.js";import"../../../webgl/ShaderBuilder.js";export{C as CutFillCompositionPassParameters,b as build}from"../../../../chunks/CutFillComposition.glsl.js";
5
+ import"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import"../core/shaderLibrary/ScreenSpacePass.glsl.js";import"../core/shaderModules/Float4PassUniform.js";import"../core/shaderModules/FloatPassUniform.js";import"../core/shaderModules/glsl.js";import"../core/shaderModules/Texture2DPassUniform.js";import"../../../webgl/NoParameters.js";import"../../../webgl/ShaderBuilder.js";export{C as CutFillCompositionPassParameters,b as build}from"../../../../chunks/CutFillComposition.glsl.js";
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{ReloadableShaderModule as e}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as r}from"../core/shaderTechnique/ShaderTechnique.js";import{Pos2Locations as t}from"../lib/DefaultVertexBufferLayouts.js";import{S as o}from"../../../../chunks/GaussianSplatDepthComposition.glsl.js";import{makePipelineState as s,defaultDepthWrite as i}from"../../../webgl/renderState.js";class a extends r{constructor(r,s){super(r,s,new e(o,()=>import("./GaussianSplatDepthComposition.glsl.js")),t)}initializePipeline(){return s({colorWrite:null,depthTest:{func:515},depthWrite:i,drawBuffers:{buffers:[0]}})}}export{a as GaussianSplatDepthCompositionTechnique};
5
+ import{ReloadableShaderModule as e}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as r}from"../core/shaderTechnique/ShaderTechnique.js";import{Pos2Locations as o}from"../lib/DefaultVertexBufferLayouts.js";import{S as s}from"../../../../chunks/GaussianSplatDepthComposition.glsl.js";import{DrawBufferNone as t}from"../../../webgl/enums.js";import{makePipelineState as i,defaultDepthWrite as a}from"../../../webgl/renderState.js";class l extends r{constructor(r,t){super(r,t,new e(s,()=>import("./GaussianSplatDepthComposition.glsl.js")),o)}initializePipeline(){return i({colorWrite:null,depthTest:{func:515},depthWrite:a,drawBuffers:{buffers:[t]}})}}export{l as GaussianSplatDepthCompositionTechnique};