@arcgis/core 4.33.0-next.20250422 → 4.33.0-next.20250424

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 (329) hide show
  1. package/Graphic.js +1 -1
  2. package/WebScene.js +1 -1
  3. package/analysis/Analysis.d.ts +4 -0
  4. package/analysis/Analysis.js +1 -1
  5. package/analysis/SliceAnalysis.js +1 -1
  6. package/analysis/SlicePlane.js +1 -1
  7. package/analysis/support/AnalysisOriginWebScene.d.ts +4 -0
  8. package/analysis/support/AnalysisOriginWebScene.js +5 -0
  9. package/analysis/support/SliceAnalysisExcludedLayer.js +5 -0
  10. package/arcade/geometry/constructors.js +1 -1
  11. package/assets/components/assets/icon/mosaicMethodBlend16.json +1 -0
  12. package/assets/components/assets/icon/mosaicMethodBlend24.json +1 -0
  13. package/assets/components/assets/icon/mosaicMethodBlend32.json +1 -0
  14. package/assets/components/assets/icon/mosaicMethodByAttribute16.json +1 -0
  15. package/assets/components/assets/icon/mosaicMethodByAttribute24.json +1 -0
  16. package/assets/components/assets/icon/mosaicMethodByAttribute32.json +1 -0
  17. package/assets/components/assets/icon/mosaicMethodClosestToCenter16.json +1 -0
  18. package/assets/components/assets/icon/mosaicMethodClosestToCenter24.json +1 -0
  19. package/assets/components/assets/icon/mosaicMethodClosestToCenter32.json +1 -0
  20. package/assets/components/assets/icon/mosaicMethodClosestToNadir16.json +1 -0
  21. package/assets/components/assets/icon/mosaicMethodClosestToNadir24.json +1 -0
  22. package/assets/components/assets/icon/mosaicMethodClosestToNadir32.json +1 -0
  23. package/assets/components/assets/icon/mosaicMethodFirst16.json +1 -0
  24. package/assets/components/assets/icon/mosaicMethodFirst24.json +1 -0
  25. package/assets/components/assets/icon/mosaicMethodFirst32.json +1 -0
  26. package/assets/components/assets/icon/mosaicMethodLast16.json +1 -0
  27. package/assets/components/assets/icon/mosaicMethodLast24.json +1 -0
  28. package/assets/components/assets/icon/mosaicMethodLast32.json +1 -0
  29. package/assets/components/assets/icon/mosaicMethodLockRaster16.json +1 -0
  30. package/assets/components/assets/icon/mosaicMethodLockRaster24.json +1 -0
  31. package/assets/components/assets/icon/mosaicMethodLockRaster32.json +1 -0
  32. package/assets/components/assets/icon/mosaicMethodMaximum16.json +1 -0
  33. package/assets/components/assets/icon/mosaicMethodMaximum24.json +1 -0
  34. package/assets/components/assets/icon/mosaicMethodMaximum32.json +1 -0
  35. package/assets/components/assets/icon/mosaicMethodMean16.json +1 -0
  36. package/assets/components/assets/icon/mosaicMethodMean24.json +1 -0
  37. package/assets/components/assets/icon/mosaicMethodMean32.json +1 -0
  38. package/assets/components/assets/icon/mosaicMethodMinimum16.json +1 -0
  39. package/assets/components/assets/icon/mosaicMethodMinimum24.json +1 -0
  40. package/assets/components/assets/icon/mosaicMethodMinimum32.json +1 -0
  41. package/assets/components/assets/icon/mosaicMethodNone16.json +1 -0
  42. package/assets/components/assets/icon/mosaicMethodNone24.json +1 -0
  43. package/assets/components/assets/icon/mosaicMethodNone32.json +1 -0
  44. package/assets/components/assets/icon/mosaicMethodNorthWest16.json +1 -0
  45. package/assets/components/assets/icon/mosaicMethodNorthWest24.json +1 -0
  46. package/assets/components/assets/icon/mosaicMethodNorthWest32.json +1 -0
  47. package/assets/components/assets/icon/mosaicMethodSeamline16.json +1 -0
  48. package/assets/components/assets/icon/mosaicMethodSeamline24.json +1 -0
  49. package/assets/components/assets/icon/mosaicMethodSeamline32.json +1 -0
  50. package/assets/components/assets/icon/mosaicMethodSum16.json +1 -0
  51. package/assets/components/assets/icon/mosaicMethodSum24.json +1 -0
  52. package/assets/components/assets/icon/mosaicMethodSum32.json +1 -0
  53. package/assets/esri/core/workers/RemoteClient.js +1 -1
  54. package/assets/esri/core/workers/chunks/{b2f9f0767dadf185120c.js → 00612d6e05b1c8647668.js} +1 -1
  55. package/assets/esri/core/workers/chunks/{d4d011eea16a89a5aad9.js → 0219c3f9408d3fa3c9a0.js} +1 -1
  56. package/assets/esri/core/workers/chunks/{f54546c155fba2fd3a7e.js → 05d7d8ff3e4cbad32580.js} +1 -1
  57. package/assets/esri/core/workers/chunks/{b1e275607d9754079f60.js → 079434fe765c53d304f2.js} +1 -1
  58. package/assets/esri/core/workers/chunks/{4f8782b3b6ad414409e8.js → 0a48b9734ab4c64a6f4f.js} +1 -1
  59. package/assets/esri/core/workers/chunks/{0eed612e82a279ac8d1e.js → 11b55e7e76e50fe11bbe.js} +1 -1
  60. package/assets/esri/core/workers/chunks/{ccc50f28f217e50cc2c3.js → 1427e7953c3d8c87c5e8.js} +1 -1
  61. package/assets/esri/core/workers/chunks/{184d7c8ea818bec5c462.js → 146b3699a9e8b1f2dcc2.js} +1 -1
  62. package/assets/esri/core/workers/chunks/{8ba7d44eff348004f084.js → 1a6d2d090b643a87408a.js} +1 -1
  63. package/assets/esri/core/workers/chunks/1b8cc83aa1179245b2dc.js +1 -0
  64. package/assets/esri/core/workers/chunks/{5e5225623977e61fd0ef.js → 213adc87c843d627c5d6.js} +1 -1
  65. package/assets/esri/core/workers/chunks/235efd948ae470a6f238.js +1 -0
  66. package/assets/esri/core/workers/chunks/{60d3b329e69f3cddb7f4.js → 265f69d153b7b6f07e42.js} +1 -1
  67. package/assets/esri/core/workers/chunks/{769b66cca8347f0f84db.js → 279bbd61b32577693a4a.js} +1 -1
  68. package/assets/esri/core/workers/chunks/290b065b377f9d2ee058.js +1 -0
  69. package/assets/esri/core/workers/chunks/29d3245261a7223124ed.js +1 -0
  70. package/assets/esri/core/workers/chunks/{0c6f2808c57ff820bfdd.js → 30551c1d3e4fa7be86c1.js} +2 -2
  71. package/assets/esri/core/workers/chunks/{0c6f2808c57ff820bfdd.js.LICENSE.txt → 30551c1d3e4fa7be86c1.js.LICENSE.txt} +1 -1
  72. package/assets/esri/core/workers/chunks/335b539893569e3d7b82.js +1 -0
  73. package/assets/esri/core/workers/chunks/{78242f2bf742b33d99fa.js → 3795793643f4db64af0e.js} +1 -1
  74. package/assets/esri/core/workers/chunks/{38f9ede26098eb03ca2d.js → 3cf001abca8ad933bccf.js} +2 -2
  75. package/assets/esri/core/workers/chunks/{38f9ede26098eb03ca2d.js.LICENSE.txt → 3cf001abca8ad933bccf.js.LICENSE.txt} +1 -1
  76. package/assets/esri/core/workers/chunks/{dbaa4b8d37aab40d7bd1.js → 543eb46b55cacd6e1dbc.js} +2 -2
  77. package/assets/esri/core/workers/chunks/{dbaa4b8d37aab40d7bd1.js.LICENSE.txt → 543eb46b55cacd6e1dbc.js.LICENSE.txt} +1 -1
  78. package/assets/esri/core/workers/chunks/{93f792f5b94f3745b57d.js → 577f24923fa4d08360e4.js} +2 -2
  79. package/assets/esri/core/workers/chunks/{93f792f5b94f3745b57d.js.LICENSE.txt → 577f24923fa4d08360e4.js.LICENSE.txt} +1 -1
  80. package/assets/esri/core/workers/chunks/5958af341014e13475d2.js +1 -0
  81. package/assets/esri/core/workers/chunks/{f46c4a69ef2f763e905b.js → 5d63dfa5a60c88e03b28.js} +1 -1
  82. package/assets/esri/core/workers/chunks/60f7cd05e88701f43d3f.js +1 -0
  83. package/assets/esri/core/workers/chunks/{26e0a0a13060cd3e4291.js → 626ba3a7dee952308566.js} +1 -1
  84. package/assets/esri/core/workers/chunks/7bfa18dd8771d4932533.js +1 -0
  85. package/assets/esri/core/workers/chunks/7cd32b10ed0e18e44ef2.js +1 -0
  86. package/assets/esri/core/workers/chunks/7ffa68d69c138db1295d.js +1 -0
  87. package/assets/esri/core/workers/chunks/8dd26b12c625d20196ed.js +319 -0
  88. package/assets/esri/core/workers/chunks/91f8547a13f0461045ef.js +1 -0
  89. package/assets/esri/core/workers/chunks/9661ee8569ee208e6237.js +1 -0
  90. package/assets/esri/core/workers/chunks/{c2f38c66fae2cdb57445.js → 96e5d192c8d23c1e324f.js} +1 -1
  91. package/assets/esri/core/workers/chunks/974742af7beb000c4b4a.js +1 -0
  92. package/assets/esri/core/workers/chunks/{e27fa1e84f16b7f19a90.js → 9850ff14bd9c7da81c65.js} +1 -1
  93. package/assets/esri/core/workers/chunks/{796cf1c2ca9955595836.js → 9b2ab27159500315fbc1.js} +1 -1
  94. package/assets/esri/core/workers/chunks/{a276980c06d5d311a37e.js → 9f416cc5673665f8c37c.js} +1 -1
  95. package/assets/esri/core/workers/chunks/a0c51c4c30a5f749dfc6.js +1 -0
  96. package/assets/esri/core/workers/chunks/a79511b926a2830bb160.js +1 -0
  97. package/assets/esri/core/workers/chunks/{fdcbd28f38bc485ac5e3.js → ab6ecd8eeec5ff761b34.js} +1 -1
  98. package/assets/esri/core/workers/chunks/{814d72abbfdd4552e4ec.js → ac9c6779771ec855da79.js} +2 -2
  99. package/assets/esri/core/workers/chunks/{814d72abbfdd4552e4ec.js.LICENSE.txt → ac9c6779771ec855da79.js.LICENSE.txt} +1 -1
  100. package/assets/esri/core/workers/chunks/{ef6e805c49e1afdf966b.js → c054198c6438cb57f188.js} +1 -1
  101. package/assets/esri/core/workers/chunks/c5d786166a5609b85276.js.LICENSE.txt +1 -1
  102. package/assets/esri/core/workers/chunks/{5bdd5ae2d2f23ef6b331.js → c87e2a63b96e0da77dfe.js} +1 -1
  103. package/assets/esri/core/workers/chunks/{601fc99426f0213b0769.js → cbec01223d51cdb9ee79.js} +1 -1
  104. package/assets/esri/core/workers/chunks/cc4dd739c4c7e3ccea3f.js +1 -0
  105. package/assets/esri/core/workers/chunks/{90c893959145827961ac.js → cd9343c78a7c3acdbbcd.js} +1 -1
  106. package/assets/esri/core/workers/chunks/d3a74087e076a3ae76ca.js +1 -0
  107. package/assets/esri/core/workers/chunks/{26fcbe053194bd78fcc3.js → d8474dca270b25705699.js} +1 -1
  108. package/assets/esri/core/workers/chunks/{5db336767959507c07e5.js → d8dc922f7466300b668f.js} +2 -2
  109. package/assets/esri/core/workers/chunks/{5db336767959507c07e5.js.LICENSE.txt → d8dc922f7466300b668f.js.LICENSE.txt} +1 -1
  110. package/assets/esri/core/workers/chunks/{96cddbbeef61a4f33f29.js → db5913824d5e5a2a8365.js} +1 -1
  111. package/assets/esri/core/workers/chunks/{48a1bb1e171dd06a7c6e.js → dd94585508f49863dc15.js} +1 -1
  112. package/assets/esri/core/workers/chunks/e524462c63834fae7e01.js +2 -0
  113. package/assets/esri/core/workers/chunks/{02176f84d6d57f1bc1c8.js.LICENSE.txt → e524462c63834fae7e01.js.LICENSE.txt} +1 -1
  114. package/assets/esri/core/workers/chunks/{e7e987558cf017c62458.js → ebfa4a0334401f5e004a.js} +1 -1
  115. package/assets/esri/core/workers/chunks/{736a11e64e5f03e3936b.js → f2cef954b58c6604642c.js} +64 -64
  116. package/assets/esri/libs/vxl/vxlLayer.wasm +0 -0
  117. package/assets/esri/themes/dark/main.css +1 -1
  118. package/assets/esri/themes/light/main.css +1 -1
  119. package/assets/esri/themes/light/view.css +1 -1
  120. package/chunks/BloomBlur.glsl.js +7 -7
  121. package/chunks/BloomComposition.glsl.js +24 -25
  122. package/chunks/Bufferer-CicaNej1.js +1 -1
  123. package/chunks/Envelope.js +1 -1
  124. package/chunks/GeodeticDistanceCalculator-CcF1gMZX.js +1 -1
  125. package/chunks/Geometry.js +1 -1
  126. package/chunks/OperatorGeodesicBuffer.js +1 -1
  127. package/chunks/OperatorGeodeticArea.js +1 -1
  128. package/chunks/OperatorGeodeticDensifyByLength.js +1 -1
  129. package/chunks/OperatorGeodeticLength.js +1 -1
  130. package/chunks/OperatorMultiPartToSinglePart.js +1 -1
  131. package/chunks/OperatorProximityGeodesic.js +1 -1
  132. package/chunks/OperatorShapePreservingLength.js +1 -1
  133. package/chunks/OperatorShapePreservingProject.js +1 -1
  134. package/chunks/OperatorSimplifyOGC.js +5 -0
  135. package/chunks/Point2D.js +1 -1
  136. package/chunks/ProjectionTransformation.js +1 -1
  137. package/chunks/QuadraticBezier.js +1 -1
  138. package/chunks/cameraUtilsSpherical.js +1 -1
  139. package/chunks/languageUtils.js +1 -1
  140. package/chunks/relateOperator.js +1 -1
  141. package/chunks/sphere.js +1 -1
  142. package/chunks/vxlLayer.js +1 -1
  143. package/core/Collection.js +1 -1
  144. package/core/JSONSupport.js +1 -1
  145. package/core/SetUtils.js +1 -1
  146. package/{views/webgl/GLObjectType.js → core/support/jsonUtils.js} +1 -1
  147. package/core/urlUtils.js +1 -1
  148. package/geometry/Mesh.js +1 -1
  149. package/geometry/operators/extendOperator.js +1 -1
  150. package/geometry/operators/gx/operatorAlphaShape.js +1 -1
  151. package/geometry/operators/gx/operatorAutoComplete.js +1 -1
  152. package/geometry/operators/gx/operatorLabelPoint.js +1 -1
  153. package/geometry/operators/gx/operatorLinesToPolygons.js +1 -1
  154. package/geometry/operators/gx/operatorLocateBetween.js +1 -1
  155. package/geometry/operators/gx/operatorMinimumBoundingCircle.js +1 -1
  156. package/geometry/operators/gx/operatorSimplifyOGC.js +5 -0
  157. package/geometry/operators/gx/operatorSymmetricDifference.js +1 -1
  158. package/geometry/operators/reshapeOperator.js +1 -1
  159. package/geometry/operators/simplifyOGCOperator.d.ts +6 -0
  160. package/geometry/operators/simplifyOGCOperator.js +5 -0
  161. package/geometry/operators/support/jsonConverter.js +1 -1
  162. package/geometry/support/normalizeUtilsSync.js +1 -1
  163. package/geometry/support/sphere.js +1 -1
  164. package/interfaces.d.ts +442 -113
  165. package/layers/DimensionLayer.js +1 -1
  166. package/layers/RouteLayer.js +1 -1
  167. package/layers/SubtypeGroupLayer.js +1 -1
  168. package/layers/ViewshedLayer.js +1 -1
  169. package/layers/graphics/data/QueryEngine.js +1 -1
  170. package/layers/orientedImagery/transformations/imageToWorld.js +1 -1
  171. package/layers/orientedImagery/transformations/utils.js +1 -1
  172. package/layers/support/FieldsIndex.js +1 -1
  173. package/layers/support/VideoElement.js +1 -1
  174. package/layers/support/rasterDatasets/FunctionRaster.js +1 -1
  175. package/layers/support/rasterDatasets/TIFFRaster.js +1 -1
  176. package/layers/support/rasterFormats/TiffDecoder.js +1 -1
  177. package/layers/support/rasterFormats/{TiffTags.js → tiffTag.js} +1 -1
  178. package/layers/support/rasterFunctions/BandArithmeticFunction.js +1 -1
  179. package/layers/support/rasterFunctions/BaseRasterFunction.js +1 -1
  180. package/layers/support/rasterFunctions/ExtractBandFunction.js +1 -1
  181. package/layers/support/rasterFunctions/NDVIFunction.js +1 -1
  182. package/layers/support/rasterFunctions/RemapFunction.js +1 -1
  183. package/layers/support/rasterFunctions/rasterFunctionHelper.js +1 -1
  184. package/layers/support/videoUtils.js +5 -0
  185. package/package.json +2 -2
  186. package/portal/schemas/definitions.js +1 -1
  187. package/renderers/UniqueValueRenderer.js +1 -1
  188. package/renderers/support/colorRampUtils.js +1 -1
  189. package/support/revision.js +1 -1
  190. package/symbols/IconSymbol3DLayer.js +1 -1
  191. package/symbols/cim/effects/EffectTaperedPolygon.js +1 -1
  192. package/versionManagement/utils.js +1 -1
  193. package/views/2d/engine/webgl/meshing/Mesh.js +1 -1
  194. package/views/2d/engine/webgl/shaderGraph/typed/TypedShaderProgram.js +1 -1
  195. package/views/2d/engine/webgl/textureUtils.js +1 -1
  196. package/views/2d/layers/MediaLayerView2D.js +1 -1
  197. package/views/2d/layers/TileLayerView2D.js +1 -1
  198. package/views/2d/layers/support/DebugOverlay.js +1 -1
  199. package/views/3d/analysis/LineOfSightAnalysisView3D.js +1 -1
  200. package/views/3d/analysis/Slice/SliceTool.js +1 -1
  201. package/views/3d/analysis/Slice/SliceVisualization.js +1 -1
  202. package/views/3d/analysis/SliceAnalysisView3D.js +1 -1
  203. package/views/3d/analysis/Viewshed/ViewshedAnalysisVisualization.js +1 -1
  204. package/views/3d/analysis/Viewshed/ViewshedVisualization.js +1 -1
  205. package/views/3d/analysis/ViewshedAnalysisView3D.js +1 -1
  206. package/views/3d/camera/constraintUtils/distance.js +1 -1
  207. package/views/3d/camera/intersectionUtils.js +1 -1
  208. package/views/3d/environment/ChapmanAtmosphere.js +1 -1
  209. package/views/3d/environment/atmosphereUtils.js +1 -1
  210. package/views/3d/interactive/visualElements/DrapedVisualElementResources.js +1 -1
  211. package/views/3d/interactive/visualElements/EngineVisualElement.js +1 -1
  212. package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
  213. package/views/3d/interactive/visualElements/LabelVisualElement.js +1 -1
  214. package/views/3d/interactive/visualElements/LaserlineVisualElement.js +1 -1
  215. package/views/3d/interactive/visualElements/LineVisualElement.js +1 -1
  216. package/views/3d/interactive/visualElements/MarkerVisualElement.js +1 -1
  217. package/views/3d/interactive/visualElements/MeasurementAreaVisualElement.js +1 -1
  218. package/views/3d/interactive/visualElements/MeasurementArrowVisualElement.js +1 -1
  219. package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
  220. package/views/3d/interactive/visualElements/ParallelLineVisualElement.js +1 -1
  221. package/views/3d/interactive/visualElements/PointVisualElement.js +1 -1
  222. package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
  223. package/views/3d/interactive/visualElements/SlicePlaneVisualElement.js +1 -1
  224. package/views/3d/interactive/visualElements/VerticesVisualElement.js +1 -1
  225. package/views/3d/interactive/visualElements/ViewshedShapeVisualElement.js +1 -1
  226. package/views/3d/interactive/visualElements/VisualElement.js +1 -1
  227. package/views/3d/interactive/visualElements/VisualElementResources.js +1 -1
  228. package/views/3d/layers/I3SMeshView3D.js +1 -1
  229. package/views/3d/layers/LineOfSightLayerView3D.js +1 -1
  230. package/views/3d/layers/graphics/Deconflictor.js +1 -1
  231. package/views/3d/layers/graphics/pipeline/Feature3DPipelineWorker.js +1 -1
  232. package/views/3d/layers/graphics/pipeline/PipelineCommand.js +1 -1
  233. package/views/3d/layers/graphics/pipeline/Tile3DManager.js +1 -1
  234. package/views/3d/layers/graphics/pipeline/TileActionSynchronizer.js +5 -0
  235. package/views/3d/layers/i3s/I3SMeshViewFilter.js +1 -1
  236. package/views/3d/state/ConstraintsManager.js +1 -1
  237. package/views/3d/state/NearFarHeuristic.js +1 -1
  238. package/views/3d/state/ViewState.js +1 -1
  239. package/views/3d/state/ViewStateManager.js +1 -1
  240. package/views/3d/state/utils/navigationUtils.js +1 -1
  241. package/views/3d/support/cameraUtilsSpherical.js +1 -1
  242. package/views/3d/support/geometryUtils/sphere.js +1 -1
  243. package/views/3d/terrain/OverlayRenderTargets.js +1 -1
  244. package/views/3d/webgl/ManagedDepthTexture.js +1 -1
  245. package/views/3d/webgl/ManagedFBO.js +1 -1
  246. package/views/3d/webgl-engine/core/FBOCache.js +1 -1
  247. package/views/3d/webgl-engine/core/FBOCacheFormats.js +5 -0
  248. package/views/3d/webgl-engine/core/shaderLibrary/Laserline.glsl.js +12 -14
  249. package/views/3d/webgl-engine/core/shaderLibrary/output/Emissions.glsl.js +1 -1
  250. package/views/3d/webgl-engine/effects/bloom/BloomRenderNode.js +1 -1
  251. package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +1 -1
  252. package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskNode.js +1 -1
  253. package/views/3d/webgl-engine/effects/geometry/RenderOccludedRenderNode.js +1 -1
  254. package/views/3d/webgl-engine/effects/haze/Haze.js +1 -1
  255. package/views/3d/webgl-engine/effects/highlight/Highlight.js +1 -1
  256. package/views/3d/webgl-engine/effects/laserlines/LaserLineRenderer.js +1 -1
  257. package/views/3d/webgl-engine/effects/smaa/SMAA.js +1 -1
  258. package/views/3d/webgl-engine/effects/ssao/SSAO.js +1 -1
  259. package/views/3d/webgl-engine/lib/DepthRange.js +1 -1
  260. package/views/3d/webgl-engine/lib/MainFramebuffer.js +1 -1
  261. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  262. package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
  263. package/views/3d/webgl-engine/lib/Texture.js +1 -1
  264. package/views/3d/webgl-engine/lib/Viewshed.js +1 -1
  265. package/views/3d/webgl-engine/lib/ViewshedShadowMap.js +1 -1
  266. package/views/3d/webgl-engine/lib/depthRangeUtils.js +1 -1
  267. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  268. package/views/SceneView.js +1 -1
  269. package/views/VideoView.js +1 -1
  270. package/views/interactive/Tooltip.js +1 -1
  271. package/views/interactive/tooltip/content/TooltipContent.js +1 -1
  272. package/views/layers/LineOfSightLayerView.d.ts +4 -0
  273. package/views/layers/LineOfSightLayerView.js +5 -0
  274. package/views/webgl/FBOAttachmentType.js +5 -0
  275. package/views/webgl/FramebufferObject.js +1 -1
  276. package/views/webgl/Renderbuffer.js +1 -1
  277. package/views/webgl/RenderbufferDescriptor.js +1 -1
  278. package/views/webgl/Texture.js +1 -1
  279. package/views/webgl/TextureDescriptor.js +1 -1
  280. package/webscene/InitialViewProperties.js +1 -1
  281. package/webscene/Presentation.js +1 -1
  282. package/webscene/Slide.js +1 -1
  283. package/webscene/SlideLegendInfo.js +1 -1
  284. package/webscene/background/ColorBackground.js +1 -1
  285. package/webscene/spec-certification/api.js +1 -1
  286. package/webscene/spec-certification/compare.js +1 -1
  287. package/webscene/spec-certification/index.js +1 -1
  288. package/webscene/spec-certification/spec.js +1 -1
  289. package/webscene/spec-certification/utils.js +1 -1
  290. package/webscene/support/Description.js +1 -1
  291. package/webscene/support/SlideElements.js +1 -1
  292. package/webscene/support/SlideEnvironment.js +1 -1
  293. package/webscene/support/SlideGround.js +1 -1
  294. package/webscene/support/SlideVisibleLayer.js +1 -1
  295. package/webscene/support/Title.js +1 -1
  296. package/webscene/support/analysisUtils.js +5 -0
  297. package/widgets/BatchAttributeForm/expressions/ExpressionsManager.js +1 -1
  298. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  299. package/widgets/Editor/EditorViewModel.js +1 -1
  300. package/widgets/Editor/UpdateWorkflow.js +1 -1
  301. package/widgets/Editor/support/SketchController.js +5 -0
  302. package/widgets/Editor/workflowUtils.js +1 -1
  303. package/widgets/Feature/FeatureUtilityNetworkAssociationList.js +1 -1
  304. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationList.js +1 -1
  305. package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
  306. package/widgets/FeatureTable.js +1 -1
  307. package/widgets/LayerList/LayerListItem.js +1 -1
  308. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  309. package/widgets/Widget.js +1 -1
  310. package/widgets/support/SelectionList.js +1 -1
  311. package/widgets/support/SnappingControls.js +1 -1
  312. package/assets/esri/core/workers/chunks/02176f84d6d57f1bc1c8.js +0 -2
  313. package/assets/esri/core/workers/chunks/244d2196bac5ef279436.js +0 -1
  314. package/assets/esri/core/workers/chunks/32f2e0c88046b39916cc.js +0 -1
  315. package/assets/esri/core/workers/chunks/388a763da712ca71ccf4.js +0 -1
  316. package/assets/esri/core/workers/chunks/5ffc3ca6c6a4d32e1282.js +0 -1
  317. package/assets/esri/core/workers/chunks/642a595353a86f3717e3.js +0 -1
  318. package/assets/esri/core/workers/chunks/82353e59ac6d909dcf41.js +0 -1
  319. package/assets/esri/core/workers/chunks/873327fc41edd3830afa.js +0 -319
  320. package/assets/esri/core/workers/chunks/93e9dfd1ba8f393c6c47.js +0 -1
  321. package/assets/esri/core/workers/chunks/95379fdd6917c8a84c71.js +0 -1
  322. package/assets/esri/core/workers/chunks/9b21dc4659922cc577cb.js +0 -1
  323. package/assets/esri/core/workers/chunks/a197c86d42cc9ce21924.js +0 -1
  324. package/assets/esri/core/workers/chunks/d81bebbb6fe000200d35.js +0 -1
  325. package/assets/esri/core/workers/chunks/daa54c8a317c27881763.js +0 -1
  326. package/assets/esri/core/workers/chunks/dd8e72d6784a8ebc115d.js +0 -1
  327. package/assets/esri/core/workers/chunks/e15c612caadf7bac4ab9.js +0 -1
  328. package/assets/esri/core/workers/chunks/e9fba86036b8fe700a41.js +0 -1
  329. package/views/3d/webgl/formats.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.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Accessor.js";import{indexOf as r,PositionHint as i}from"../../../../core/arrayUtils.js";import s from"../../../../core/Logger.js";import{clamp as n}from"../../../../core/mathUtils.js";import{unwrapUpdating as o,updating as a,isUpdating as l}from"../../../../core/maybeUpdating.js";import{whenOnce as c}from"../../../../core/reactiveUtils.js";import{getUnitString as p}from"../../../../core/unitUtils.js";import{property as u}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import{subclass as d}from"../../../../core/accessorSupport/decorators/subclass.js";import{q as m,g,i as f}from"../../../../chunks/vec32.js";import{fromValues as y}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import h from"../../../../core/sql/WhereClause.js";import{getReferenceEllipsoid as j}from"../../../../geometry/ellipsoidUtils.js";import{load as R,project as S}from"../../../../geometry/projection.js";import w from"../../../../geometry/SpatialReference.js";import{projectBoundingSphere as E}from"../../../../geometry/projection/projectBoundingSphere.js";import{projectVectorToVector as v}from"../../../../geometry/projection/projectVectorToVector.js";import{create as b}from"../../../../geometry/support/aaBoundingBox.js";import{fromValues as F,expandWithNestedArray as I,expand as _}from"../../../../geometry/support/aaBoundingRect.js";import{doubleArrayFrom as k}from"../../../../geometry/support/DoubleArray.js";import{earth as M}from"../../../../geometry/support/Ellipsoid.js";import{isWGS84 as T,isWebMercator as D}from"../../../../geometry/support/spatialReferenceUtils.js";import{f as G}from"../../../../chunks/sphere.js";import{project as C}from"../../../../geometry/support/webMercatorUtils.js";import A from"../../../../layers/support/FeatureFilter.js";import{objectIdFilter as x,filterInPlace as O}from"./I3SUtil.js";const B="esri.views.3d.layers.i3s.I3SMeshViewFilter",L=()=>s.getLogger(B);let P=class extends t{constructor(e){super(e),this._projectionEngineLoaded=!1}initialize(){c((()=>this.viewFilter?.geometry||null!=this.layerFilter)).then((()=>this.loadAsyncModule(import("../../../../geometry/geometryEngine.js").then((e=>{this.destroyed||(this._geometryEngine=e)})))))}get sortedObjectIds(){if(null==this.viewFilter?.objectIds)return null;const e=k(this.viewFilter.objectIds);return e.sort(),e}get parsedWhereClause(){const e=this.viewFilter?.where;if(null==e||!e)return null;try{return h.create(e,{fieldsIndex:this.layerFieldsIndex})}catch(t){L().error(`Failed to parse filter where clause: ${t}`)}return null}addFilters(e,t,r,i){const s=this.sortedObjectIds;null!=s&&e.push((e=>x(s,!0,e))),this.addSqlFilter(e,this.parsedWhereClause),this.addTimeFilter(e,this.viewFilter?.timeExtent);const n=o(this._layerMaskGeometries),a=this._geometryEngine;if(null!=n&&null!=this.layerFilter&&null!=a){const s=this.layerFilter.spatialRelationship;e.push(((e,o)=>N(a,e,o,i,t,r,n,s)))}const l=o(this._viewMaskGeometries);if(null!=l&&null!=this.viewFilter&&null!=a){const s=this.viewFilter.spatialRelationship;e.push(((e,n)=>N(a,e,n,i,t,r,l,s)))}}isMBSGeometryVisible(e,t,r){const i=o(this._layerMaskGeometries),s=this._geometryEngine;if(null!=i&&null!=this.layerFilter&&null!=s){const n=this.layerFilter.spatialRelationship,o=i[0].spatialReference||t;if(!E(e,r,$,o))return L().warnOnce("SceneLayer.mask geometry is using unsupported SpatialReference, skipping geometry filter for MBS"),!0;return q(s,$,i,o,n)}const n=o(this._viewMaskGeometries);if(null!=n&&null!=this.viewFilter&&null!=s){const i=this.viewFilter.spatialRelationship,o=n[0].spatialReference||t;if(!E(e,r,$,o))return L().warnOnce("SceneLayerView.filter.geometry is using unsupported SpatialReference, skipping geometry filter for MBS"),!0;return q(s,$,n,o,i)}return!0}get parsedGeometry(){const e=o(this._viewMaskGeometries),t=o(this._layerMaskGeometries);return null==e||null==t?e||t:t.concat(e)}get _layerMaskGeometries(){const e=this.layerFilter;return null==e?null:null==this._geometryEngine?a:"disjoint"===e.spatialRelationship?e.geometries.map((e=>({type:"polygon",rings:e.rings,spatialReference:e.spatialReference,cache:{}}))):[e.geometries.reduce(((e,t)=>(e.rings=[...e.rings,...t.rings],e)),{type:"polygon",rings:[],spatialReference:e.geometries[0].spatialReference,cache:{}})]}get _viewMaskGeometries(){if(null==this.viewFilter)return null;const{geometry:e}=this.viewFilter;if(null==e)return null;if(null==this.viewFilter||null==this._geometryEngine)return a;const{distance:t,units:r}=this.viewFilter,i=this.viewFilter.spatialRelationship,s="mesh"===e.type?e.extent:e;if(null==t||0===t)return V(this._geometryEngine,s,i);const n=r||p(s.spatialReference);if(s.spatialReference.isWGS84){const e=this._geometryEngine.geodesicBuffer(s,t,n);return V(this._geometryEngine,e,i)}const o=C(s,w.WGS84);if(null!=o){const e=C(this._geometryEngine.geodesicBuffer(o,t,n),s.spatialReference);return V(this._geometryEngine,e,i)}if(!this._projectionEngineLoaded&&(this.loadAsyncModule(R().then((()=>this._projectionEngineLoaded=!0))),!this._projectionEngineLoaded))return null;let l=null;try{l=S(s,w.WGS84)}catch(c){}if(l)try{l=S(this._geometryEngine.geodesicBuffer(l,t,n),s.spatialReference)}catch(c){l=null}return l||L().error(`Filter by geodesic buffer (distance) unsupported, failed to project input geometry (${s.spatialReference.wkid}) to WGS84.`),V(this._geometryEngine,l,i)}get updating(){return l(this._layerMaskGeometries)||l(this._viewMaskGeometries)}static checkSupport(e){return null!=e&&(!!K(e.spatialRelationship)||(L().warn(`Filters with spatialRelationship other than ${U.join(", ")} are not supported for mesh scene layers`),!1))}};e([u()],P.prototype,"layerFilter",void 0),e([u({type:A})],P.prototype,"viewFilter",void 0),e([u()],P.prototype,"layerFieldsIndex",void 0),e([u()],P.prototype,"loadAsyncModule",void 0),e([u()],P.prototype,"addSqlFilter",void 0),e([u()],P.prototype,"addTimeFilter",void 0),e([u({readOnly:!0})],P.prototype,"sortedObjectIds",null),e([u({readOnly:!0})],P.prototype,"parsedWhereClause",null),e([u({readOnly:!0})],P.prototype,"parsedGeometry",null),e([u({readOnly:!0})],P.prototype,"_layerMaskGeometries",null),e([u({readOnly:!0})],P.prototype,"_viewMaskGeometries",null),e([u()],P.prototype,"updating",null),e([u()],P.prototype,"_projectionEngineLoaded",void 0),e([u()],P.prototype,"_geometryEngine",void 0),P=e([d(B)],P);const U=(e=>e)(["contains","intersects","disjoint"]);function K(e){return null!=e&&U.includes(e)}var W;function V(e,t,s){if(null==t)return null;if("disjoint"===s&&"polygon"===t.type){const s=t.rings.length,n=t.spatialReference,o=new Array(s);for(let e=0;e<s;++e){const r=F(1/0,1/0,-1/0,-1/0);I(r,t.rings[e]),o[e]={type:"polygon",rings:[t.rings[e]],spatialReference:n,cache:{},aabr:r}}o.sort(((e,t)=>e.aabr[0]-t.aabr[0]));const a=new Set,l=new i;for(let t=0;t<o.length;++t){const i=o[t],s=i.aabr[0];a.forEach((t=>{if(s>=t.aabr[2])return void a.delete(t);if(i.aabr[1]>t.aabr[3]||i.aabr[3]<t.aabr[1]||!e.intersects(i,t))return;i.rings=i.rings.concat(t.rings),_(i.aabr,t.aabr,i.aabr),i.cache={},a.delete(t);const n=r(o,t,o.length,l);o.splice(n,1)})),a.add(i)}for(const e of o)e.aabr=void 0;return o}return[t]}function q(e,t,r,i,s){if(t[3]>=.5*(t[2]+j(i).radius))return!0;const n=H(e,t,i);return r.every((t=>Z(e,t,n,s)!==W.DISCARD))}function N(e,t,r,i,s,n,o,a){const l=o[0].spatialReference||s.spatialReference;if(!E(r.node.serviceMbsInIndexSR,n,$,l))return void L().warnOnce("SceneLayerView.filter.geometry is using unsupported SpatialReference, skipping geometry filter");const c=H(e,$,l),p=z(a,s,l,i,r.objectHandle),u="intersects"===a;let d=null;for(const m of o){if(0===t.length)return;switch(Z(e,m,c,a)){case W.DISCARD:return u&&(r.weaklyRemovedIds=r.weaklyRemovedIds?.concat(t)??t.slice()),void(t.length=0);case W.KEEP:continue}O(t,r.featureIds,(t=>!!X(e,m,t,p)||(u&&(d||=[],d.push(r.featureIds[t])),!1)))}d&&(r.weaklyRemovedIds=r.weaklyRemovedIds?.concat(d)??d)}!function(e){e[e.KEEP=0]="KEEP",e[e.DISCARD=1]="DISCARD",e[e.TEST=2]="TEST"}(W||(W={}));const $=G(0,0,0,0);function z(e,t,r,i,s){const n=t.renderSpatialReference,o=new Map,a={type:"polygon",rings:[[[0,0,0],[0,0,0],[0,0,0],[0,0,0]]],spatialReference:r};a.rings[0][3]=a.rings[0][0];const l={indices:null,data:null,stride:0,startIndex:0,endIndex:0};let c,p;switch(e){case"intersects":c=(e,t,r)=>e.intersects(t,r)?W.KEEP:W.TEST,p=J;break;case"contains":c=(e,t,r)=>e.contains(t,r)?W.TEST:W.DISCARD,p=J;break;default:c=(e,t,r)=>e.disjoint(t,r)?W.TEST:W.DISCARD,p=Q}return{collection:i,object:s,type:e,maskSR:r,renderSR:n,aabbCache:o,triangle:a,positions:l,triangleTest:c,geometryTest:p}}function H(e,t,r){const i={type:"point",x:t[0],y:t[1],hasZ:!1,hasM:!1,spatialReference:r},s=!T(r)&&!D(r),o=Number.isNaN(t[3])?0:n(t[3],0,2*M.radius),a=s?e.buffer(i,o,1):e.geodesicBuffer(i,o,1);return a.type="polygon",a}function Z(e,t,r,i){switch(i){case"intersects":case"contains":return J(e,t,r);case"disjoint":return Q(e,t,r)}}function J(e,t,r){return e.intersects(t,r)?e.contains(t,r)?W.KEEP:W.TEST:W.DISCARD}function Q(e,t,r){return e.intersects(t,r)?e.contains(t,r)?W.DISCARD:W.TEST:W.KEEP}function X(e,t,r,i){const{collection:s,object:n,renderSR:o,maskSR:a,geometryTest:l,aabbCache:c}=i;let p=c.get(r);if(!p){const e=s.getObjectTransform(n);s.getComponentAabb(n,r,Y);const t=[y(Y[0],Y[1],0),y(Y[0],Y[4],0),y(Y[3],Y[4],0),y(Y[3],Y[1],0)];for(let r=0;r<4;++r)m(t[r],t[r],e.rotationScale),g(t[r],t[r],e.position),v(t[r],o,t[r],a);p={type:"polygon",rings:[t],spatialReference:a,cache:{}},p.rings[0][4]=p.rings[0][0],c.set(r,p)}switch(l(e,t,p)){case W.DISCARD:return!1;case W.KEEP:return!0}const{triangle:u,triangleTest:d,positions:h}=i,j=u.rings[0][0],R=u.rings[0][1],S=u.rings[0][2],w=s.getObjectTransform(n);s.getComponentPositions(n,r,h);const{indices:E,data:b,stride:F,startIndex:I,endIndex:_}=h;for(let y=I;y<_;y+=3){const r=F*E[y],i=F*E[y+1],s=F*E[y+2];switch(f(j,b[r],b[r+1],b[r+2]),f(R,b[i],b[i+1],b[i+2]),f(S,b[s],b[s+1],b[s+2]),m(j,j,w.rotationScale),m(R,R,w.rotationScale),m(S,S,w.rotationScale),g(j,j,w.position),g(R,R,w.position),g(S,S,w.position),v(j,o,j,a),v(R,o,R,a),v(S,o,S,a),d(e,t,u)){case W.DISCARD:return!1;case W.KEEP:return!0}}return"intersects"!==i.type}const Y=b();export{P as I3SMeshViewFilter};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Accessor.js";import{indexOf as r,PositionHint as i}from"../../../../core/arrayUtils.js";import s from"../../../../core/Logger.js";import{clamp as o}from"../../../../core/mathUtils.js";import{unwrapUpdating as n,updating as a,isUpdating as l}from"../../../../core/maybeUpdating.js";import{whenOnce as c}from"../../../../core/reactiveUtils.js";import{getUnitString as p}from"../../../../core/unitUtils.js";import{property as u}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import{subclass as g}from"../../../../core/accessorSupport/decorators/subclass.js";import{q as d,g as m,i as f}from"../../../../chunks/vec32.js";import{fromValues as y}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import h from"../../../../core/sql/WhereClause.js";import{getReferenceEllipsoid as j}from"../../../../geometry/ellipsoidUtils.js";import{load as R,project as S}from"../../../../geometry/projection.js";import w from"../../../../geometry/SpatialReference.js";import{projectBoundingSphere as E}from"../../../../geometry/projection/projectBoundingSphere.js";import{projectVectorToVector as v}from"../../../../geometry/projection/projectVectorToVector.js";import{create as b}from"../../../../geometry/support/aaBoundingBox.js";import{fromValues as F,expandWithNestedArray as I,expand as _}from"../../../../geometry/support/aaBoundingRect.js";import{doubleArrayFrom as k}from"../../../../geometry/support/DoubleArray.js";import{earth as M}from"../../../../geometry/support/Ellipsoid.js";import{isWGS84 as T,isWebMercator as D}from"../../../../geometry/support/spatialReferenceUtils.js";import{f as G}from"../../../../chunks/sphere.js";import{project as C}from"../../../../geometry/support/webMercatorUtils.js";import A from"../../../../layers/support/FeatureFilter.js";import{objectIdFilter as x,filterInPlace as L}from"./I3SUtil.js";let O=class extends t{constructor(e){super(e),this._projectionEngineLoaded=!1}initialize(){c((()=>this.viewFilter?.geometry||null!=this.layerFilter)).then((()=>this.loadAsyncModule(import("../../../../geometry/geometryEngine.js").then((e=>{this.destroyed||(this._geometryEngine=e)})))))}get sortedObjectIds(){if(null==this.viewFilter?.objectIds)return null;const e=k(this.viewFilter.objectIds);return e.sort(),e}get parsedWhereClause(){const e=this.viewFilter?.where;if(null==e||!e)return null;try{return h.create(e,{fieldsIndex:this.layerFieldsIndex})}catch(t){s.getLogger(this).error(`Failed to parse filter where clause: ${t}`)}return null}addFilters(e,t,r,i){const o=this.sortedObjectIds;null!=o&&e.push((e=>x(o,!0,e))),this.addSqlFilter(e,this.parsedWhereClause),this.addTimeFilter(e,this.viewFilter?.timeExtent);const a=n(this._layerMaskGeometries),l=this._geometryEngine,c=()=>s.getLogger(this);if(null!=a&&null!=this.layerFilter&&null!=l){const s=this.layerFilter.spatialRelationship;e.push(((e,o)=>V(c,l,e,o,i,t,r,a,s)))}const p=n(this._viewMaskGeometries);if(null!=p&&null!=this.viewFilter&&null!=l){const s=this.viewFilter.spatialRelationship;e.push(((e,o)=>V(c,l,e,o,i,t,r,p,s)))}}isMBSGeometryVisible(e,t,r){const i=n(this._layerMaskGeometries),o=this._geometryEngine;if(null!=i&&null!=this.layerFilter&&null!=o){const n=this.layerFilter.spatialRelationship,a=i[0].spatialReference||t;if(!E(e,r,q,a))return s.getLogger(this).warnOnce("SceneLayer.mask geometry is using unsupported SpatialReference, skipping geometry filter for MBS"),!0;return W(o,q,i,a,n)}const a=n(this._viewMaskGeometries);if(null!=a&&null!=this.viewFilter&&null!=o){const i=this.viewFilter.spatialRelationship,n=a[0].spatialReference||t;if(!E(e,r,q,n))return s.getLogger(this).warnOnce("SceneLayerView.filter.geometry is using unsupported SpatialReference, skipping geometry filter for MBS"),!0;return W(o,q,a,n,i)}return!0}get parsedGeometry(){const e=n(this._viewMaskGeometries),t=n(this._layerMaskGeometries);return null==e||null==t?e||t:t.concat(e)}get _layerMaskGeometries(){const e=this.layerFilter;return null==e?null:null==this._geometryEngine?a:"disjoint"===e.spatialRelationship?e.geometries.map((e=>({type:"polygon",rings:e.rings,spatialReference:e.spatialReference,cache:{}}))):[e.geometries.reduce(((e,t)=>(e.rings=[...e.rings,...t.rings],e)),{type:"polygon",rings:[],spatialReference:e.geometries[0].spatialReference,cache:{}})]}get _viewMaskGeometries(){if(null==this.viewFilter)return null;const{geometry:e}=this.viewFilter;if(null==e)return null;if(null==this.viewFilter||null==this._geometryEngine)return a;const{distance:t,units:r}=this.viewFilter,i=this.viewFilter.spatialRelationship,o="mesh"===e.type?e.extent:e;if(null==t||0===t)return K(this._geometryEngine,o,i);const n=r||p(o.spatialReference);if(o.spatialReference.isWGS84){const e=this._geometryEngine.geodesicBuffer(o,t,n);return K(this._geometryEngine,e,i)}const l=C(o,w.WGS84);if(null!=l){const e=C(this._geometryEngine.geodesicBuffer(l,t,n),o.spatialReference);return K(this._geometryEngine,e,i)}if(!this._projectionEngineLoaded&&(this.loadAsyncModule(R().then((()=>this._projectionEngineLoaded=!0))),!this._projectionEngineLoaded))return null;let c=null;try{c=S(o,w.WGS84)}catch(u){}if(c)try{c=S(this._geometryEngine.geodesicBuffer(c,t,n),o.spatialReference)}catch(u){c=null}return c||s.getLogger(this).error(`Filter by geodesic buffer (distance) unsupported, failed to project input geometry (${o.spatialReference.wkid}) to WGS84.`),K(this._geometryEngine,c,i)}get updating(){return l(this._layerMaskGeometries)||l(this._viewMaskGeometries)}static checkSupport(e){return null!=e&&(!!P(e.spatialRelationship)||(s.getLogger(this.prototype).warn(`Filters with spatialRelationship other than ${B.join(", ")} are not supported for mesh scene layers`),!1))}};e([u()],O.prototype,"layerFilter",void 0),e([u({type:A})],O.prototype,"viewFilter",void 0),e([u()],O.prototype,"layerFieldsIndex",void 0),e([u()],O.prototype,"loadAsyncModule",void 0),e([u()],O.prototype,"addSqlFilter",void 0),e([u()],O.prototype,"addTimeFilter",void 0),e([u({readOnly:!0})],O.prototype,"sortedObjectIds",null),e([u({readOnly:!0})],O.prototype,"parsedWhereClause",null),e([u({readOnly:!0})],O.prototype,"parsedGeometry",null),e([u({readOnly:!0})],O.prototype,"_layerMaskGeometries",null),e([u({readOnly:!0})],O.prototype,"_viewMaskGeometries",null),e([u()],O.prototype,"updating",null),e([u()],O.prototype,"_projectionEngineLoaded",void 0),e([u()],O.prototype,"_geometryEngine",void 0),O=e([g("esri.views.3d.layers.i3s.I3SMeshViewFilter")],O);const B=(e=>e)(["contains","intersects","disjoint"]);function P(e){return null!=e&&B.includes(e)}var U;function K(e,t,s){if(null==t)return null;if("disjoint"===s&&"polygon"===t.type){const s=t.rings.length,o=t.spatialReference,n=new Array(s);for(let e=0;e<s;++e){const r=F(1/0,1/0,-1/0,-1/0);I(r,t.rings[e]),n[e]={type:"polygon",rings:[t.rings[e]],spatialReference:o,cache:{},aabr:r}}n.sort(((e,t)=>e.aabr[0]-t.aabr[0]));const a=new Set,l=new i;for(let t=0;t<n.length;++t){const i=n[t],s=i.aabr[0];a.forEach((t=>{if(s>=t.aabr[2])return void a.delete(t);if(i.aabr[1]>t.aabr[3]||i.aabr[3]<t.aabr[1]||!e.intersects(i,t))return;i.rings=i.rings.concat(t.rings),_(i.aabr,t.aabr,i.aabr),i.cache={},a.delete(t);const o=r(n,t,n.length,l);n.splice(o,1)})),a.add(i)}for(const e of n)e.aabr=void 0;return n}return[t]}function W(e,t,r,i,s){if(t[3]>=.5*(t[2]+j(i).radius))return!0;const o=$(e,t,i);return r.every((t=>z(e,t,o,s)!==U.DISCARD))}function V(e,t,r,i,s,o,n,a,l){const c=a[0].spatialReference||o.spatialReference;if(!E(i.node.serviceMbsInIndexSR,n,q,c))return void e().warnOnce("SceneLayerView.filter.geometry is using unsupported SpatialReference, skipping geometry filter");const p=$(t,q,c),u=N(l,o,c,s,i.objectHandle),g="intersects"===l;let d=null;for(const m of a){if(0===r.length)return;switch(z(t,m,p,l)){case U.DISCARD:return g&&(i.weaklyRemovedIds=i.weaklyRemovedIds?.concat(r)??r.slice()),void(r.length=0);case U.KEEP:continue}L(r,i.featureIds,(e=>!!J(t,m,e,u)||(g&&(d||=[],d.push(i.featureIds[e])),!1)))}d&&(i.weaklyRemovedIds=i.weaklyRemovedIds?.concat(d)??d)}!function(e){e[e.KEEP=0]="KEEP",e[e.DISCARD=1]="DISCARD",e[e.TEST=2]="TEST"}(U||(U={}));const q=G(0,0,0,0);function N(e,t,r,i,s){const o=t.renderSpatialReference,n=new Map,a={type:"polygon",rings:[[[0,0,0],[0,0,0],[0,0,0],[0,0,0]]],spatialReference:r};a.rings[0][3]=a.rings[0][0];const l={indices:null,data:null,stride:0,startIndex:0,endIndex:0};let c,p;switch(e){case"intersects":c=(e,t,r)=>e.intersects(t,r)?U.KEEP:U.TEST,p=H;break;case"contains":c=(e,t,r)=>e.contains(t,r)?U.TEST:U.DISCARD,p=H;break;default:c=(e,t,r)=>e.disjoint(t,r)?U.TEST:U.DISCARD,p=Z}return{collection:i,object:s,type:e,maskSR:r,renderSR:o,aabbCache:n,triangle:a,positions:l,triangleTest:c,geometryTest:p}}function $(e,t,r){const i={type:"point",x:t[0],y:t[1],hasZ:!1,hasM:!1,spatialReference:r},s=!T(r)&&!D(r),n=Number.isNaN(t[3])?0:o(t[3],0,2*M.radius),a=s?e.buffer(i,n,1):e.geodesicBuffer(i,n,1);return a.type="polygon",a}function z(e,t,r,i){switch(i){case"intersects":case"contains":return H(e,t,r);case"disjoint":return Z(e,t,r)}}function H(e,t,r){return e.intersects(t,r)?e.contains(t,r)?U.KEEP:U.TEST:U.DISCARD}function Z(e,t,r){return e.intersects(t,r)?e.contains(t,r)?U.DISCARD:U.TEST:U.KEEP}function J(e,t,r,i){const{collection:s,object:o,renderSR:n,maskSR:a,geometryTest:l,aabbCache:c}=i;let p=c.get(r);if(!p){const e=s.getObjectTransform(o);s.getComponentAabb(o,r,Q);const t=[y(Q[0],Q[1],0),y(Q[0],Q[4],0),y(Q[3],Q[4],0),y(Q[3],Q[1],0)];for(let r=0;r<4;++r)d(t[r],t[r],e.rotationScale),m(t[r],t[r],e.position),v(t[r],n,t[r],a);p={type:"polygon",rings:[t],spatialReference:a,cache:{}},p.rings[0][4]=p.rings[0][0],c.set(r,p)}switch(l(e,t,p)){case U.DISCARD:return!1;case U.KEEP:return!0}const{triangle:u,triangleTest:g,positions:h}=i,j=u.rings[0][0],R=u.rings[0][1],S=u.rings[0][2],w=s.getObjectTransform(o);s.getComponentPositions(o,r,h);const{indices:E,data:b,stride:F,startIndex:I,endIndex:_}=h;for(let y=I;y<_;y+=3){const r=F*E[y],i=F*E[y+1],s=F*E[y+2];switch(f(j,b[r],b[r+1],b[r+2]),f(R,b[i],b[i+1],b[i+2]),f(S,b[s],b[s+1],b[s+2]),d(j,j,w.rotationScale),d(R,R,w.rotationScale),d(S,S,w.rotationScale),m(j,j,w.position),m(R,R,w.position),m(S,S,w.position),v(j,n,j,a),v(R,n,R,a),v(S,n,S,a),g(e,t,u)){case U.DISCARD:return!1;case U.KEEP:return!0}}return"intersects"!==i.type}const Q=b();export{O as I3SMeshViewFilter};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../../chunks/tslib.es6.js";import i from"../../../core/Accessor.js";import{deg2rad as a,rad2deg as s}from"../../../core/mathUtils.js";import{watch as e,sync as n,initial as r}from"../../../core/reactiveUtils.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as c}from"../../../core/accessorSupport/decorators/subclass.js";import{ViewingMode as l}from"../../ViewingMode.js";import{applyAll as u}from"../camera/constraintUtils.js";import{surfaceElevationBelowRenderLocation as p}from"../camera/intersectionUtils.js";import{ConstraintOptions as h}from"../camera/constraintUtils/ConstraintOptions.js";import{ConstraintTypes as d}from"../camera/constraintUtils/ConstraintTypes.js";import{InteractionType as m}from"../camera/constraintUtils/InteractionType.js";import{createNearFarHeuristic as v}from"./NearFarHeuristic.js";import{SurfaceCollisionConstraint as w}from"./SurfaceCollisionConstraint.js";let _=class extends i{constructor(t){super(t),this.nearFarHeuristic=v(t.view.state.viewingMode,t.view.basemapTerrain,t.view.renderCoordsHelper.spatialReference)}initialize(){this.addHandles([e((()=>[this.view.constraints?.clipDistance?.near,this.view.constraints?.clipDistance?.far]),(()=>this._clipDistanceNearFarChanged())),e((()=>this.view.constraints?.clipDistance?.mode),(()=>this._updateNearFar())),this.view.state.events.on("before-camera-change",(t=>this._updateCameraNearFar(t))),e((()=>this.view.renderDataExtent),(()=>this._updateNearFar()),n),e((()=>[this.view.constraints?.altitude?.min,this.view.constraints?.altitude?.max]),(()=>this._updateAltitude()),n),e((()=>this.view.constraints?.tilt?.max),(()=>this._updateTiltMax()),n),e((()=>this.view.constraints?.tilt?.mode),(()=>this._updateTilt()),n),e((()=>this.view.state?.camera),(()=>this._updateTiltAutoMax()),n),e((()=>[this.view.map?.ground?.navigationConstraint?.type,this.view.state?.constraints?.collision?.enabled]),(()=>this._updateCollision()),n)]),this.view.state.isLocal&&this.addHandles(e((()=>this.view.renderDataExtent),(t=>this._updateLocalSurfaceDistance(t)),r)),this._updateNearFar(),this.view.state.viewingMode!==l.Local&&this._updateAltitude(),this._updateTilt(),this._updateCollision(),this._set("surfaceCollisionConstraint",new w({view:this.view}))}destroy(){this.surfaceCollisionConstraint&&(this.surfaceCollisionConstraint.destroy(),this._set("surfaceCollisionConstraint",null))}_clipDistanceNearFarChanged(){const t=this.view.constraints?.clipDistance;t&&"auto"!==t.mode&&this.view.state.updateCamera((i=>C(i,t)))}_updateNearFar(){this.view.state.updateCamera((t=>this._updateCameraNearFar(t)))}_updateCameraNearFar(t){const i=this.view.constraints&&this.view.constraints.clipDistance;"manual"===(i?i.mode:"auto")?C(t,i):this._updateCameraNearFarAuto(t,i)}_updateCameraNearFarAuto(t,i){this.nearFarHeuristic.compute(t.eye,t.center,this.view.renderDataExtent,p(this.view,t.eye),t),i&&i.autoUpdate(t.near,t.far)}_updateCollision(){const t=this.view.map?.ground?.navigationConstraint?.type,i=!t||"stay-above"===t,a=this.view.state.constraints.collision;if(i!==a.enabled){a.enabled=i,i&&this._reapplyConstraints(d.COLLISION);const t=this.view.constraints&&this.view.constraints.tilt;t&&"auto"!==t.mode||this._updateTiltAuto()}}_updateAltitude(){const t=this.view.constraints&&this.view.constraints.altitude;t&&this.view.state.viewingMode!==l.Local?this.view.state.constraints.altitude={min:t.min,max:t.max}:this.view.state.constraints.altitude=null,this._reapplyConstraints()}_updateTiltMax(){const t=this.view.constraints&&this.view.constraints.tilt;t&&"auto"!==t.mode&&(this._updateTiltManual(t),this._reapplyConstraints())}_updateTilt(){const t=this.view.constraints&&this.view.constraints.tilt;"manual"===(t?t.mode:"auto")?this._updateTiltManual(t):this._updateTiltAuto(),this._reapplyConstraints()}_updateTiltManual(t){const i=this.view.state.constraints;i.tilt=i.createConstantMaxTilt(a(t.max))}_updateTiltAuto(){const t=this.view.state.constraints;t.tilt=t.createDefaultTilt(),this._updateTiltAutoMax()}_updateTiltAutoMax(){const t=this.view.constraints&&this.view.constraints.tilt;if(!t||"auto"!==t.mode)return;const i=this.view.state.constraints;if(i.tilt){const a=i.tilt(this.view.state.camera.distance).max;t.autoUpdate(s(a))}}_updateLocalSurfaceDistance(t){if(null==t)return;let i=Math.max(t.width,t.height);if(i<=0)return;null!=t.zmax&&null!=t.zmin&&(i=Math.max(i,t.zmax-t.zmin));const a=this.view.state,s=3*i/Math.atan(a.camera.fov/2);s!==a.constraints.distance&&(a.constraints.distance=s)}_reapplyConstraints(t=d.ALL){this.view.state.updateCamera((i=>u(this.view,i,new h(t,m.NONE,null))))}};function C(t,i){i&&(t.near=i.near,t.far=i.far)}t([o({constructOnly:!0})],_.prototype,"view",void 0),t([o({readOnly:!0})],_.prototype,"surfaceCollisionConstraint",void 0),_=t([c("esri.views.3d.state.ConstraintsManager")],_);export{_ as ConstraintsManager};
5
+ import{_ as t}from"../../../chunks/tslib.es6.js";import i from"../../../core/Accessor.js";import{deg2rad as a,rad2deg as e}from"../../../core/mathUtils.js";import{watch as s,sync as r,initial as n}from"../../../core/reactiveUtils.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as c}from"../../../core/accessorSupport/decorators/subclass.js";import{ViewingMode as l}from"../../ViewingMode.js";import{applyAll as u}from"../camera/constraintUtils.js";import{surfaceElevationBelowRenderLocation as p}from"../camera/intersectionUtils.js";import{ConstraintOptions as h}from"../camera/constraintUtils/ConstraintOptions.js";import{ConstraintTypes as d}from"../camera/constraintUtils/ConstraintTypes.js";import{InteractionType as m}from"../camera/constraintUtils/InteractionType.js";import{createNearFarHeuristic as v}from"./NearFarHeuristic.js";import{SurfaceCollisionConstraint as w}from"./SurfaceCollisionConstraint.js";let _=class extends i{constructor(t){super(t),this.nearFarHeuristic=v(t.view.state.viewingMode,t.view.basemapTerrain,t.view.renderCoordsHelper.spatialReference)}initialize(){this.addHandles([s((()=>[this.view.constraints?.clipDistance?.near,this.view.constraints?.clipDistance?.far]),(()=>this._clipDistanceNearFarChanged())),s((()=>this.view.constraints?.clipDistance?.mode),(()=>this._updateNearFar())),this.view.state.events.on("before-camera-change",(({camera:t,sceneDepthRange:i})=>this._updateCameraNearFar(t,i))),s((()=>this.view.stage.renderer.sceneDepthRange.value),(()=>this._updateNearFar()),r),s((()=>this.view.renderDataExtent),(()=>this._updateNearFar()),r),s((()=>[this.view.constraints?.altitude?.min,this.view.constraints?.altitude?.max]),(()=>this._updateAltitude()),r),s((()=>this.view.constraints?.tilt?.max),(()=>this._updateTiltMax()),r),s((()=>this.view.constraints?.tilt?.mode),(()=>this._updateTilt()),r),s((()=>this.view.state?.camera),(()=>this._updateTiltAutoMax()),r),s((()=>[this.view.map?.ground?.navigationConstraint?.type,this.view.state?.constraints?.collision?.enabled]),(()=>this._updateCollision()),r)]),this.view.state.isLocal&&this.addHandles(s((()=>this.view.renderDataExtent),(t=>this._updateLocalSurfaceDistance(t)),n)),this._updateNearFar(),this.view.state.viewingMode!==l.Local&&this._updateAltitude(),this._updateTilt(),this._updateCollision(),this._set("surfaceCollisionConstraint",new w({view:this.view}))}destroy(){this.surfaceCollisionConstraint&&(this.surfaceCollisionConstraint.destroy(),this._set("surfaceCollisionConstraint",null))}_clipDistanceNearFarChanged(){const t=this.view.constraints?.clipDistance;t&&"auto"!==t.mode&&this.view.state.updateCamera((i=>C(i,t)))}_updateNearFar(){this.view.state.updateCamera((t=>this._updateCameraNearFar(t)))}_updateCameraNearFar(t,i){const a=this.view.constraints&&this.view.constraints.clipDistance;"manual"===(a?a.mode:"auto")?C(t,a):this._updateCameraNearFarAuto(t,a,i)}_updateCameraNearFarAuto(t,i,a){const e=p(this.view,t.eye),s=this.nearFarHeuristic.compute(t,this.view.renderDataExtent,a??this.view.stage.renderer.sceneDepthRange.value,e);t.near=s.near,t.far=s.far,i&&i.autoUpdate(t.near,t.far)}_updateCollision(){const t=this.view.map?.ground?.navigationConstraint?.type,i=!t||"stay-above"===t,a=this.view.state.constraints.collision;if(i!==a.enabled){a.enabled=i,i&&this._reapplyConstraints(d.COLLISION);const t=this.view.constraints&&this.view.constraints.tilt;t&&"auto"!==t.mode||this._updateTiltAuto()}}_updateAltitude(){const t=this.view.constraints&&this.view.constraints.altitude;t&&this.view.state.viewingMode!==l.Local?this.view.state.constraints.altitude={min:t.min,max:t.max}:this.view.state.constraints.altitude=null,this._reapplyConstraints()}_updateTiltMax(){const t=this.view.constraints&&this.view.constraints.tilt;t&&"auto"!==t.mode&&(this._updateTiltManual(t),this._reapplyConstraints())}_updateTilt(){const t=this.view.constraints&&this.view.constraints.tilt;"manual"===(t?t.mode:"auto")?this._updateTiltManual(t):this._updateTiltAuto(),this._reapplyConstraints()}_updateTiltManual(t){const i=this.view.state.constraints;i.tilt=i.createConstantMaxTilt(a(t.max))}_updateTiltAuto(){const t=this.view.state.constraints;t.tilt=t.createDefaultTilt(),this._updateTiltAutoMax()}_updateTiltAutoMax(){const t=this.view.constraints&&this.view.constraints.tilt;if(!t||"auto"!==t.mode)return;const i=this.view.state.constraints;if(i.tilt){const a=i.tilt(this.view.state.camera.distance).max;t.autoUpdate(e(a))}}_updateLocalSurfaceDistance(t){if(null==t)return;let i=Math.max(t.width,t.height);if(i<=0)return;null!=t.zmax&&null!=t.zmin&&(i=Math.max(i,t.zmax-t.zmin));const a=this.view.state,e=3*i/Math.atan(a.camera.fov/2);e!==a.constraints.distance&&(a.constraints.distance=e)}_reapplyConstraints(t=d.ALL){this.view.state.updateCamera((i=>u(this.view,i,new h(t,m.NONE,null))))}};function C(t,i){i&&(t.near=i.near,t.far=i.far)}t([o({constructOnly:!0})],_.prototype,"view",void 0),t([o({readOnly:!0})],_.prototype,"surfaceCollisionConstraint",void 0),_=t([c("esri.views.3d.state.ConstraintsManager")],_);export{_ as ConstraintsManager};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{lerp as t,clamp as e}from"../../../core/mathUtils.js";import{getMetersPerUnitForSR as i}from"../../../core/unitUtils.js";import{d as r,n as s,f as n,l as a}from"../../../chunks/vec32.js";import{create as m}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as o}from"../../../geometry/ellipsoidUtils.js";import h from"../../../geometry/Extent.js";import{ViewingMode as l}from"../../ViewingMode.js";import{computeInnerAltitudeFade as x}from"../environment/atmosphereUtils.js";function c(t,e,i){return t===l.Global?new M(i):new u(e,i)}class u{constructor(t,e){this._elevationProvider=t,this._referenceEllipsoid=o(e),this._unitInMeters=i(e,this._referenceEllipsoid.metersPerDegree)}compute(i,a,m,o,l){l||(l={near:0,far:0});let x=i[2]*this._unitInMeters;const c=x,u=x-o,M=this._elevationProvider?.visibleElevationBounds;M&&(x=u>=0?c-this._unitInMeters*M.min:this._unitInMeters*M.max-c);const p={x:(m=null!=m?m:new h({xmin:0,ymin:0,zmin:0,xmax:0,ymax:0,zmax:0})).xmax-m.xmin,y:m.ymax-m.ymin,z:4*Math.max(m.xmax-m.xmin,m.ymax-m.ymin)},_=Math.max(p.x,p.y,p.z);r(g,a,i),j[0]=g[0]>0?m.xmax:m.xmin,j[1]=g[1]>0?m.ymax:m.ymin,j[2]=g[2]>0?_/2:-_/2,r(j,j,i),s(g,g);const y=1.1*n(j,g)*this._unitInMeters,v=Math.sqrt(x*(x+2*this._referenceEllipsoid.radius)),b=Math.max(m.xmax-m.xmin,m.ymax-m.ymin),w=b*E*this._unitInMeters,z=b*I*this._unitInMeters,U=e((x-z)/(w-z),0,1)**3,P=Math.min(t(v,y,U),v)*Math.max(Math.log(Math.abs(u)),1);return f(Math.min(P,Math.max(34064e4,_))/this._unitInMeters,d,this._unitInMeters,l)}}class M{constructor(t){this._referenceEllipsoid=o(t)}compute(i,r,s,n,m){m||(m={near:0,far:0});const o=a(i),h=o-this._referenceEllipsoid.radius,l=this._referenceEllipsoid.radius+Math.min(0,n),c=Math.abs(h-n),u=Math.max(c,Math.abs(h)),M=Math.sqrt(u*(u+2*l)),v=o+this._referenceEllipsoid.radius,E=1.2*t(M,v,x(u)),I=(Math.log(u)-p)/(_-p);return f(E,e(d-I*(d-y),y,d),1,m)}}function f(t,e,i,r){const s=v/i,n=t/e;return n>s?(r.far=t,r.near=n):(r.near=s,r.far=r.near*e),r}const p=7.983,_=16.994,d=2e4,y=100,v=2,E=.001,I=1e-4,j=m(),g=m();export{c as createNearFarHeuristic};
5
+ import{acosClamped as e,lerp as t,clamp as i}from"../../../core/mathUtils.js";import{getMetersPerUnitForSR as r}from"../../../core/unitUtils.js";import{d as s,n,f as a,l as o,h as m}from"../../../chunks/vec32.js";import{create as h}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as l}from"../../../geometry/ellipsoidUtils.js";import c from"../../../geometry/Extent.js";import{create as f,fromValues as x}from"../../../geometry/support/ray.js";import{b as p,h as u,c as M}from"../../../chunks/sphere.js";import{ViewingMode as d}from"../../ViewingMode.js";import{computeInnerAltitudeFade as _}from"../environment/atmosphereUtils.js";import{DepthRange as y}from"../webgl-engine/lib/DepthRange.js";function v(e,t,i){return e===d.Global?new g(t,i):new E(t,i)}class E{constructor(e,t){this._elevationProvider=e,this._referenceEllipsoid=l(t),this._unitInMeters=r(t,this._referenceEllipsoid.metersPerDegree)}compute(e,r,o,m){const{eye:h,center:l}=e;let f=h[2]*this._unitInMeters;const x=f,p=f-m,u=this._elevationProvider?.visibleElevationBounds;u&&(f=p>=0?x-this._unitInMeters*u.min:this._unitInMeters*u.max-x),r??=new c({xmin:0,ymin:0,zmin:0,xmax:0,ymax:0,zmax:0});const M={x:r.xmax-r.xmin,y:r.ymax-r.ymin,z:4*Math.max(r.xmax-r.xmin,r.ymax-r.ymin)},d=Math.max(M.x,M.y,M.z);s(B,l,h),q[0]=B[0]>0?r.xmax:r.xmin,q[1]=B[1]>0?r.ymax:r.ymin,q[2]=B[2]>0?d/2:-d/2,s(q,q,h),n(B,B);const _=1.1*a(q,B)*this._unitInMeters,y=Math.sqrt(f*(f+2*this._referenceEllipsoid.radius)),v=Math.max(r.xmax-r.xmin,r.ymax-r.ymin),E=v*z*this._unitInMeters,g=v*k*this._unitInMeters,b=i((f-g)/(E-g),0,1)**3,I=Math.min(t(y,_,b),y)*Math.max(Math.log(Math.abs(p)),1);return j(Math.min(I,Math.max(34064e4,d))/this._unitInMeters,w,this._unitInMeters,D)}}class g{constructor(e,t){this._elevationProvider=e,this._referenceEllipsoid=l(t)}compute(r,h,l,c){const{eye:f}=r,M=o(f),d=M-this._referenceEllipsoid.radius,v=this._referenceEllipsoid.radius+Math.min(0,c),E=Math.abs(d-c),g=Math.max(E,Math.abs(d)),z=this._elevationProvider?.visibleElevationBounds.max??0,k=_(g),H=Math.sqrt(g*(g+2*v)),R=M+this._referenceEllipsoid.radius,V=1.2*t(H,R,k),Y=(Math.log(g)-b)/(I-b);j(V,i(w-Y*(w-P),P,w),1,D);const A=this._referenceEllipsoid.radius+z,C=this._referenceEllipsoid.radius+this._referenceEllipsoid.atmosphereHeight,J=Math.max(A,C),K=M-J;if(k>0&&K>U){const i=n(q,m(q,r.eye,-1)),h=n(B,r.viewForward),c=e(a(i,h)),f=.5*r.fovY,M=Math.cos(f);let d=y.infinite.near;if(c<=f)d=K*M;else{const e=n(q,r.viewUp),t=Math.tan(f),i=m(q,e,t),a=n(q,s(q,h,i)),l=x(r.eye,a,G),c=p(F,J);if(u(c,l,q)){const e=s(q,q,r.eye);d=o(e)*M}}const _=.99*Math.min(l.near,d);if(_<y.infinite.near&&_>D.near){const e=t(D.near,_,k);D.near=e}}return D}}function j(e,t,i,r){const s=U/i,n=e/t;return n>s?(r.far=e,r.near=n):(r.near=s,r.far=r.near*t),r}const b=7.983,I=16.994,w=2e4,P=100,U=2,z=.001,k=1e-4,q=h(),B=h(),D={near:0,far:0},F=M(),G=f();export{v as createNearFarHeuristic,U as minNearDistanceInMeters};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Accessor.js";import r from"../../../core/Evented.js";import{when as o}from"../../../core/reactiveUtils.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as i}from"../../../core/accessorSupport/decorators/subclass.js";import{afterDispatch as s}from"../../../core/accessorSupport/watch.js";import{fromValues as n}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as l}from"../../../geometry/ellipsoidUtils.js";import p from"../../ViewAnimation.js";import{ViewingMode as c,viewingModeFromString as m}from"../../ViewingMode.js";import{Constraints as h}from"./Constraints.js";import{AnimationController as d}from"./controllers/AnimationController.js";import{State as u}from"./controllers/CameraController.js";import g from"../webgl/RenderCamera.js";import{PaddingSide as C}from"../webgl-engine/lib/rendererUtils.js";import{maximumHighlights as y}from"../../support/HighlightDefaults.js";import{PropertiesPool as f}from"../../support/PropertiesPool.js";import{RenderState as w}from"../../support/RenderState.js";let _=class extends t{constructor(e){super(e),this._propertiesPool=new f({camera:g},this),this._lastSeenCameraProjectionValues=new g,this.mode=w.ANIMATING,this._cssCamera=new g,this._camera=new g,this.rasterPixelRatio=1,this.contentPixelRatio=1,this.constraints=new h({state:this}),this.events=new r,this._cameraChanged=!1,this._updateQueue=new Array,this._processingUpdates=!1}reset(){this.cameraController=null,this._propertiesPool.destroy(),this._propertiesPool=new f({camera:g},this)}destroy(){this.cameraController=null,this._propertiesPool?.destroy(),this._propertiesPool=null}createInitialCamera(){if(this.viewingMode===c.Global){const e=l(this.spatialReference).radius;this.camera=new g({eye:n(4*e,0,0),center:n(e,0,0),up:n(0,0,1)})}else this.camera=new g({eye:n(0,0,100),center:n(0,0,0),up:n(0,1,0)})}get animation(){return this.cameraController instanceof d&&null!=this.cameraController.viewAnimation?this.cameraController.viewAnimation:null}get cssCamera(){const e=this._cssCamera.copyFrom(this.camera),{height:t,width:r,pixelRatio:o}=this.camera;return e.pixelRatio=1,e.height=Math.round(t/o),e.width=Math.round(r/o),e}get camera(){return this._camera}set camera(e){e!==O&&O.copyFrom(e),O.computeUp(this.viewingMode),this.events.emit("before-camera-change",O);const t=this._camera;if(j(this._lastSeenCameraProjectionValues,O)&&(this._lastSeenCameraProjectionValues.copyFrom(O),this.events.emit("camera-projection-changed",this._lastSeenCameraProjectionValues)),!t.equals(O)&&(this._camera=this._propertiesPool.get("camera").copyFrom(O),this._cameraChanged=!t.almostEquals(O),this._cameraChanged)){const e=s((()=>{this._cameraChanged=!1,e.remove()}))}}get pixelRatio(){return this.camera.pixelRatio}get alignPixelEnabled(){return this.pixelRatio===this.rasterPixelRatio&&this.mode===w.IDLE}get updating(){return this.mode!==w.IDLE}get contentCamera(){return this._contentCamera??this.camera}set contentCamera(e){if(null==e)return void(this._contentCamera=null);const t=e.clone();this.view.state.events.emit("before-camera-change",t),this._contentCamera=t}get fixedContentCamera(){return null!=this._contentCamera}get isGlobal(){return this.viewingMode===c.Global}get isLocal(){return this.viewingMode===c.Local}get viewingMode(){return m(this.view.viewingMode)}get spatialReference(){return this.view.spatialReference}get highlights(){const e=this.view.highlights.items.slice(0,y);for(let t=0;t<e.length;){const r=e[t],o=e.findIndex((e=>e.name===r.name));o>=0&&t>o?e.splice(t,1):++t}return e}get highlightOrderMap(){const e=new Map;return this.highlights.forEach(((t,r)=>e.set(t.name,r))),e}get navigating(){return!!this.cameraController?.isInteractive}get stationary(){return!this._cameraChanged&&!this.navigating}get cameraController(){return this._get("cameraController")}set cameraController(e){this.stopActiveCameraController()?(this.cameraController?.destroy(),e&&(this.removeHandles(P),this.addHandles(o((()=>e.state===u.Finished||e.state===u.Stopped),(()=>{this._set("cameraController",null),this.updateCamera((t=>e.onControllerEnd(t)))}),{sync:!0,once:!0}),P),e.onControllerStart(this.camera)),this._set("cameraController",e)):e&&(e.state=u.Rejected)}switchCameraController(e){this.cameraController=e}stopActiveCameraController(){return!this.cameraController||this.cameraController.stopController()}updateCamera(e){this._updateQueue.push(e),this._processUpdateQueue()}_processUpdateQueue(){if(0===this._updateQueue.length||this._processingUpdates)return;this._processingUpdates=!0;const e=this._updateQueue.shift();O.copyFrom(this._get("camera")),e(O),this.camera=O,this._processingUpdates=!1,this._processUpdateQueue()}};e([a({constructOnly:!0})],_.prototype,"view",void 0),e([a()],_.prototype,"mode",void 0),e([a({readOnly:!0,type:p})],_.prototype,"animation",null),e([a({type:g})],_.prototype,"cssCamera",null),e([a()],_.prototype,"_cssCamera",void 0),e([a({type:g})],_.prototype,"camera",null),e([a()],_.prototype,"_camera",void 0),e([a({readOnly:!0})],_.prototype,"pixelRatio",null),e([a()],_.prototype,"rasterPixelRatio",void 0),e([a()],_.prototype,"contentPixelRatio",void 0),e([a({readOnly:!0})],_.prototype,"alignPixelEnabled",null),e([a({readOnly:!0})],_.prototype,"updating",null),e([a({})],_.prototype,"_contentCamera",void 0),e([a({type:g})],_.prototype,"contentCamera",null),e([a({readOnly:!0})],_.prototype,"fixedContentCamera",null),e([a({readOnly:!0})],_.prototype,"events",void 0),e([a({readOnly:!0})],_.prototype,"isGlobal",null),e([a({readOnly:!0})],_.prototype,"isLocal",null),e([a({readOnly:!0})],_.prototype,"viewingMode",null),e([a({readOnly:!0})],_.prototype,"highlights",null),e([a({readOnly:!0})],_.prototype,"highlightOrderMap",null),e([a({readOnly:!0})],_.prototype,"navigating",null),e([a({readOnly:!0})],_.prototype,"stationary",null),e([a()],_.prototype,"_cameraChanged",void 0),e([a()],_.prototype,"cameraController",null),_=e([i("esri.views.3d.state.ViewState")],_);const v=_;function j(e,t){return e.fov!==t.fov||(e.fullViewport[0]!==t.fullViewport[0]||e.fullViewport[1]!==t.fullViewport[1]||e.fullViewport[2]!==t.fullViewport[2]||e.fullViewport[3]!==t.fullViewport[3]||(e.padding[C.TOP]!==t.padding[C.TOP]||e.padding[C.RIGHT]!==t.padding[C.RIGHT]||e.padding[C.BOTTOM]!==t.padding[C.BOTTOM]||e.padding[C.LEFT]!==t.padding[C.LEFT]))}const O=new g,P="ViewStateHandles";export{v as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Accessor.js";import r from"../../../core/Evented.js";import{when as o}from"../../../core/reactiveUtils.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as i}from"../../../core/accessorSupport/decorators/subclass.js";import{afterDispatch as s}from"../../../core/accessorSupport/watch.js";import{fromValues as n}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as l}from"../../../geometry/ellipsoidUtils.js";import p from"../../ViewAnimation.js";import{ViewingMode as c,viewingModeFromString as m}from"../../ViewingMode.js";import{Constraints as h}from"./Constraints.js";import{AnimationController as d}from"./controllers/AnimationController.js";import{State as u}from"./controllers/CameraController.js";import g from"../webgl/RenderCamera.js";import{DepthRange as C}from"../webgl-engine/lib/DepthRange.js";import{PaddingSide as y}from"../webgl-engine/lib/rendererUtils.js";import{maximumHighlights as f}from"../../support/HighlightDefaults.js";import{PropertiesPool as w}from"../../support/PropertiesPool.js";import{RenderState as _}from"../../support/RenderState.js";let v=class extends t{constructor(e){super(e),this._propertiesPool=new w({camera:g},this),this._lastSeenCameraProjectionValues=new g,this.mode=_.ANIMATING,this._cssCamera=new g,this._camera=new g,this.rasterPixelRatio=1,this.contentPixelRatio=1,this.constraints=new h({state:this}),this.events=new r,this._cameraChanged=!1,this._updateQueue=new Array,this._processingUpdates=!1}reset(){this.cameraController=null,this._propertiesPool.destroy(),this._propertiesPool=new w({camera:g},this)}destroy(){this.cameraController=null,this._propertiesPool?.destroy(),this._propertiesPool=null}createInitialCamera(){if(this.viewingMode===c.Global){const e=l(this.spatialReference).radius;this.camera=new g({eye:n(4*e,0,0),center:n(e,0,0),up:n(0,0,1)})}else this.camera=new g({eye:n(0,0,100),center:n(0,0,0),up:n(0,1,0)})}get animation(){return this.cameraController instanceof d&&null!=this.cameraController.viewAnimation?this.cameraController.viewAnimation:null}get cssCamera(){const e=this._cssCamera.copyFrom(this.camera),{height:t,width:r,pixelRatio:o}=this.camera;return e.pixelRatio=1,e.height=Math.round(t/o),e.width=Math.round(r/o),e}get camera(){return this._camera}set camera(e){e!==R&&R.copyFrom(e),R.computeUp(this.viewingMode),this.events.emit("before-camera-change",{camera:R});const t=this._camera;if(O(this._lastSeenCameraProjectionValues,R)&&(this._lastSeenCameraProjectionValues.copyFrom(R),this.events.emit("camera-projection-changed",this._lastSeenCameraProjectionValues)),!t.equals(R)&&(this._camera=this._propertiesPool.get("camera").copyFrom(R),this._cameraChanged=!t.almostEquals(R),this._cameraChanged)){const e=s((()=>{this._cameraChanged=!1,e.remove()}))}}get pixelRatio(){return this.camera.pixelRatio}get alignPixelEnabled(){return this.pixelRatio===this.rasterPixelRatio&&this.mode===_.IDLE}get updating(){return this.mode!==_.IDLE}get contentCamera(){return this._contentCamera??this.camera}set contentCamera(e){if(null==e)return void(this._contentCamera=null);const t=e.clone();this.events.emit("before-camera-change",{camera:t,sceneDepthRange:C.infinite}),this._contentCamera=t}get fixedContentCamera(){return null!=this._contentCamera}get isGlobal(){return this.viewingMode===c.Global}get isLocal(){return this.viewingMode===c.Local}get viewingMode(){return m(this.view.viewingMode)}get spatialReference(){return this.view.spatialReference}get highlights(){const e=this.view.highlights.items.slice(0,f);for(let t=0;t<e.length;){const r=e[t],o=e.findIndex((e=>e.name===r.name));o>=0&&t>o?e.splice(t,1):++t}return e}get highlightOrderMap(){const e=new Map;return this.highlights.forEach(((t,r)=>e.set(t.name,r))),e}get navigating(){return!!this.cameraController?.isInteractive}get stationary(){return!this._cameraChanged&&!this.navigating}get cameraController(){return this._get("cameraController")}set cameraController(e){this.stopActiveCameraController()?(this.cameraController?.destroy(),e&&(this.removeHandles(P),this.addHandles(o((()=>e.state===u.Finished||e.state===u.Stopped),(()=>{this._set("cameraController",null),this.updateCamera((t=>e.onControllerEnd(t)))}),{sync:!0,once:!0}),P),e.onControllerStart(this.camera)),this._set("cameraController",e)):e&&(e.state=u.Rejected)}switchCameraController(e){this.cameraController=e}stopActiveCameraController(){return!this.cameraController||this.cameraController.stopController()}updateCamera(e){this._updateQueue.push(e),this._processUpdateQueue()}_processUpdateQueue(){if(0===this._updateQueue.length||this._processingUpdates)return;this._processingUpdates=!0;const e=this._updateQueue.shift();R.copyFrom(this._get("camera")),e(R),this.camera=R,this._processingUpdates=!1,this._processUpdateQueue()}};e([a({constructOnly:!0})],v.prototype,"view",void 0),e([a()],v.prototype,"mode",void 0),e([a({readOnly:!0,type:p})],v.prototype,"animation",null),e([a({type:g})],v.prototype,"cssCamera",null),e([a()],v.prototype,"_cssCamera",void 0),e([a({type:g})],v.prototype,"camera",null),e([a()],v.prototype,"_camera",void 0),e([a({readOnly:!0})],v.prototype,"pixelRatio",null),e([a()],v.prototype,"rasterPixelRatio",void 0),e([a()],v.prototype,"contentPixelRatio",void 0),e([a({readOnly:!0})],v.prototype,"alignPixelEnabled",null),e([a({readOnly:!0})],v.prototype,"updating",null),e([a({})],v.prototype,"_contentCamera",void 0),e([a({type:g})],v.prototype,"contentCamera",null),e([a({readOnly:!0})],v.prototype,"fixedContentCamera",null),e([a({readOnly:!0})],v.prototype,"events",void 0),e([a({readOnly:!0})],v.prototype,"isGlobal",null),e([a({readOnly:!0})],v.prototype,"isLocal",null),e([a({readOnly:!0})],v.prototype,"viewingMode",null),e([a({readOnly:!0})],v.prototype,"highlights",null),e([a({readOnly:!0})],v.prototype,"highlightOrderMap",null),e([a({readOnly:!0})],v.prototype,"navigating",null),e([a({readOnly:!0})],v.prototype,"stationary",null),e([a()],v.prototype,"_cameraChanged",void 0),e([a()],v.prototype,"cameraController",null),v=e([i("esri.views.3d.state.ViewState")],v);const j=v;function O(e,t){return e.fov!==t.fov||(e.fullViewport[0]!==t.fullViewport[0]||e.fullViewport[1]!==t.fullViewport[1]||e.fullViewport[2]!==t.fullViewport[2]||e.fullViewport[3]!==t.fullViewport[3]||(e.padding[y.TOP]!==t.padding[y.TOP]||e.padding[y.RIGHT]!==t.padding[y.RIGHT]||e.padding[y.BOTTOM]!==t.padding[y.BOTTOM]||e.padding[y.LEFT]!==t.padding[y.LEFT]))}const R=new g,P="ViewStateHandles";export{j 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.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../Camera.js";import i from"../../../Viewpoint.js";import r from"../../../core/Accessor.js";import a from"../../../core/Logger.js";import{destroyMaybe as s}from"../../../core/maybe.js";import{on as n,watch as o,sync as h,when as l}from"../../../core/reactiveUtils.js";import{addFrameTask as p}from"../../../core/scheduling.js";import{createScreenPoint as c}from"../../../core/screenUtils.js";import{property as m}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as d}from"../../../core/accessorSupport/decorators/subclass.js";import{s as v}from"../../../chunks/vec32.js";import{fromArray as u}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{s as w}from"../../../chunks/vec42.js";import{create as g}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import y from"../../../geometry/Extent.js";import _ from"../../../geometry/Point.js";import f from"../../../geometry/Polygon.js";import{isLoadedOrLoadFor as C,requiresLoad as x}from"../../../geometry/projection.js";import{ViewingMode as R}from"../../ViewingMode.js";import{applyAll as P}from"../camera/constraintUtils.js";import{cameraOnContentAlongViewDirection as S,surfaceElevationBelowRenderLocation as O}from"../camera/intersectionUtils.js";import{ConstraintsManager as T}from"./ConstraintsManager.js";import{Frustum as b}from"./Frustum.js";import{GoToOperation as j}from"./GoToOperation.js";import{SurfaceCollisionCorrectionController as I}from"./controllers/SurfaceCollisionCorrectionController.js";import{internalToExternal as M,externalToInternal as z,toArea as A,toExtent as E,applyTiltAdjustToScale as L,scaleToZoom as H,fromExtentSync as N,OrientationMode as V,getObserverForPointAtDistanceSync as B,viewScaleToCameraDistance as D,zoomToScale as G}from"../support/cameraUtils.js";import{fromCamera as U,toCameraSync as F}from"../support/viewpointUtils.js";import k from"../webgl/RenderCamera.js";import{PaddingSide as q}from"../webgl-engine/lib/rendererUtils.js";import{RenderFeature as W}from"../webgl-engine/lib/RenderFeature.js";import{PropertiesPool as J}from"../../support/PropertiesPool.js";import{RenderState as K}from"../../support/RenderState.js";import{ensureAttachmentMaxSize as Z}from"../../webgl/FramebufferObject.js";let Q=class extends r{constructor(e){super(e),this.ready=!1,this._windowDevicePixelRatio=1,this._devicePixelRatioOverride=null,this._idleTimeout=ne,this.test={viewStateManager:this,contentCameraResetState:new Map,setDevicePixelRatio:e=>this._devicePixelRatioOverride=e,renderState:null,get maximumPixelRatio(){return this.viewStateManager.view.qualitySettings.maximumPixelRatio},get updatingIgnoreRenderState(){return null!=this.renderState},get idleTimeoutEnabled(){return this.viewStateManager._idleTimeout>0},set idleTimeoutEnabled(e){this.viewStateManager._idleTimeout=e?ne:0}},this._propertiesPool=new J({frustum:b},this),this._cameraSetByUser=!1,this._gotoOperation=null,this._cameraChangeTime=0,this._tmpCanvasSize=new X}initialize(){this._cameraChangeTime=performance.now(),this.addHandles([n((()=>this.view.state.events),"before-camera-change",(e=>e&&this._updateElevation(e))),o((()=>this.view.state?.camera),((e,t)=>this._cameraChangedHandler(e,t)),h)]),l((()=>this.view.state?.camera),(e=>this._updateElevation(e)),{once:!0,sync:!0}),this.addHandles([p({prepare:()=>this._prepareFrame()}),o((()=>this.view.state.cameraController),(()=>{this._cameraSetByUser=!0,this.removeHandles(ae)})),n((()=>this.view.state.events),"camera-projection-changed",(()=>this.notifyChange("scale")))])}destroy(){this.exit(),this._propertiesPool=s(this._propertiesPool)}get camera(){const e=this._get("camera");if(!this.ready)return e;const t=M(this.view,this.view.state.camera,te);return t&&e&&t.equals(e)?e:t.clone()}set camera(e){this._updatePropertyBeforeReady("camera",e)||(this.view.elevationProvider?.enableCache(!0),this.setStateCamera(z(this.view,e),{applyConstraints:!1})||a.getLogger(this).error("#camera=","Invalid camera",e),this.view.elevationProvider?.enableCache(!1))}get contentCamera(){const e=this._get("contentCamera");if(!this.ready)return e;const t=M(this.view,this.view.state.contentCamera,te);return t&&e&&t.equals(e)?e:t.clone()}set contentCamera(e){if(this._updatePropertyBeforeReady("contentCamera",e))return;const t=z(this.view,e);this.view.state.contentCamera=null!=t?t:null}installContentCameraReset(e){if(this.removeHandles(se),this.test.contentCameraResetState.clear(),!this.view.state.fixedContentCamera)return!1;const t=this.zoom,i=this.view.state.camera.distance**2,r=u(this.view.state.camera.center),a=e.sticky?this.contentCamera.clone():null;return this.addHandles([o((()=>this.contentCamera),(()=>{e.sticky||(this.removeHandles(se),this.test.contentCameraResetState.clear())})),o((()=>this.zoom),(e=>{void 0!==e&&void 0!==t&&(this.test.contentCameraResetState.set("view.zoom",Math.abs(e-t)/2),Math.abs(e-t)>2?this.contentCamera=null:this.view.state.fixedContentCamera||(this.contentCamera=a))})),o((()=>this.view.state.camera),(e=>{const t=v(r,e.center);this.test.contentCameraResetState.set("camera.center",t/i),t>i?this.contentCamera=null:this.view.state.fixedContentCamera||(this.contentCamera=a)}))],se),!0}get center(){return this.ready?this.view.pointsOfInterest.centerOnContent.location:this._get("center")}set center(e){this._updatePropertyBeforeReady("center",e)||(e?this.isCompatible(e)?this.setStateCamera(this._centerToCamera(e),{applyConstraints:!0})?this.view.pointsOfInterest.centerOnContent.runTask():a.getLogger(this).error("#center=","Invalid center",e):a.getLogger(this).error("#center=","Center has an incompatible spatial reference (center: "+(e.spatialReference?e.spatialReference.wkid:"none")+", view: "+this.view.spatialReference?.wkid+")",e):a.getLogger(this).error("#center=","Center may not be null or undefined"))}get visibleArea(){if(!this.ready){const e=this._get("extent");return e?f.fromExtent(e):null}return A(this.view,this.view.pointsOfInterest.focus.renderLocation)}get extent(){if(!this.ready)return this._get("extent");const e=this.view,t=E(e,e.state.camera,e.pointsOfInterest.centerOnContent.renderLocation);return null!=t?t:this._get("extent")}set extent(e){this._updatePropertyBeforeReady("extent",e)||(e?this.isCompatible(e)?this.setStateCamera(this._extentToCamera(e),{applyConstraints:!0})||a.getLogger(this).error("#extent=","Invalid extent",e):a.getLogger(this).error("#extent=","Extent has an incompatible spatial reference (extent: "+(e.spatialReference?e.spatialReference.wkid:"none")+", view: "+this.view.spatialReference?.wkid+")",e):a.getLogger(this).error("#extent=","Extent may not be null or undefined"))}get frustum(){const e=this._propertiesPool.get("frustum");return e.renderCoordsHelper=this.view.renderCoordsHelper,e.update(this.view.state.camera),e}get constraintsManager(){return this._constraintsManager}get _initialViewpoint(){const e=this.view.map;return e&&"initialViewProperties"in e?e.initialViewProperties?.viewpoint:void 0}get hasInitialView(){return!!this._initialViewpoint}get scale(){if(!this.ready)return this._get("scale");const e=this.view.basemapTerrain.tilingScheme,t=this.view.pointsOfInterest.cameraOnSurface.scale;return e&&t?L(this.view,t,this.view.state.contentCamera,e):this._get("scale")}set scale(e){this._updatePropertyBeforeReady("scale",e)||this.setStateCamera(this._scaleToCamera(e),{applyConstraints:!0})||a.getLogger(this).error("#scale=","Invalid scale",e)}get padding(){if(!this.ready)return this._get("padding");const e=this.view.state.camera,t=e.padding,i=e.pixelRatio,r=this._get("padding"),a=Math.round(t[q.TOP]/i),s=Math.round(t[q.RIGHT]/i),n=Math.round(t[q.BOTTOM]/i),o=Math.round(t[q.LEFT]/i);return null!=r&&r.top===a&&r.right===s&&r.bottom===n&&r.left===o?r:{top:a,right:s,bottom:n,left:o}}set padding(e){this._updatePropertyBeforeReady("padding",e)||(this._paddingToArray(e,this.view.state.camera.pixelRatio,re),this.view.state.updateCamera((e=>e.padding=re)))}_paddingToArray(e,t,i){e?w(i,e.top||0,e.right||0,e.bottom||0,e.left||0):w(i,0,0,0,0);for(let r=0;r<4;r++)i[r]=Math.round(i[r]*t)}get screenCenter(){const e=this.padding;return c((this.view.width-(e.left+e.right))/2+e.left,(this.view.height-(e.top+e.bottom))/2+e.top)}get viewpoint(){return this.ready?U(this.view,this.camera):this._get("viewpoint")}set viewpoint(e){if(!this._updatePropertyBeforeReady("viewpoint",e))if(e)if(this.isCompatible(e))this.setStateCamera(this._viewpointToCamera(e),{applyConstraints:!e.camera})||a.getLogger(this).error("#viewpoint=","Invalid viewpoint",e);else{const t=null!=e.camera?e.camera.position:e.targetGeometry,i=null!=t&&t.spatialReference;a.getLogger(this).error("#viewpoint=","Viewpoint has an incompatible spatial reference (viewpoint: "+(i?i.wkid:"none")+", view: "+this.view.spatialReference?.wkid+")",e)}else a.getLogger(this).error("#viewpoint=","Viewpoint may not be null or undefined")}get zoom(){return this.ready?H(this.view,this.scale):this._get("zoom")}set zoom(e){this._updatePropertyBeforeReady("zoom",e)||void 0===e||this.setStateCamera(this._zoomToCamera(e),{applyConstraints:!0})||a.getLogger(this).error("#zoom=","Invalid zoom",e)}_computeCanvasSize(){if(this._devicePixelRatioOverride)return this.view.state.contentPixelRatio=this._devicePixelRatioOverride,this._tmpCanvasSize.width=Math.round(this.view.surface.clientWidth*this._devicePixelRatioOverride),this._tmpCanvasSize.height=Math.round(this.view.surface.clientHeight*this._devicePixelRatioOverride),this._tmpCanvasSize.pixelRatio=this._devicePixelRatioOverride,this._tmpCanvasSize;const e=Math.min(this._windowDevicePixelRatio,this.view.qualitySettings.maximumPixelRatio),t=(this._usePhysicalPixelRendering?this._windowDevicePixelRatio:e)*this.view.resolutionScale;this._tmpCanvasSize.width=Math.round(this.view.surface.clientWidth*t),this._tmpCanvasSize.height=Math.round(this.view.surface.clientHeight*t);const i=this.view.stage.renderView.renderingContext?.parameters.maxTextureSize;return i&&Z(this._tmpCanvasSize,i),this._tmpCanvasSize.pixelRatio=this._tmpCanvasSize.width>0?this._tmpCanvasSize.width/this.view.surface.clientWidth*.5+this._tmpCanvasSize.height/this.view.surface.clientHeight*.5:t,this.view.state&&(this.view.state.contentPixelRatio=Math.min(this._windowDevicePixelRatio,this.view.qualitySettings.maximumPixelRatio)),this._tmpCanvasSize}get _rasterPixelRatio(){return null!=this._devicePixelRatioOverride?this._devicePixelRatioOverride:this._usePhysicalPixelRenderingAny?this._windowDevicePixelRatio:Math.min(this._windowDevicePixelRatio,this.view.qualitySettings.maximumPixelRatio)}get _usePhysicalPixelRendering(){return this.view?.stage?.renderer.isFeatureEnabled(W.PhysicalPixelRendering)??!1}get _usePhysicalPixelRenderingAny(){const e=this.view?.stage?.renderer;return e&&(e.isFeatureEnabled(W.PhysicalPixelRendering,K.IDLE)||e.isFeatureEnabled(W.PhysicalPixelRendering,K.INTERACTING)||e.isFeatureEnabled(W.PhysicalPixelRendering,K.ANIMATING))}preinit(e){return!(this._isOverridden("center")&&!C(this.center.spatialReference,e))&&(!(this._isOverridden("camera")&&!C(this.camera.position.spatialReference,e))&&(!(this._isOverridden("extent")&&!C(this.extent.spatialReference,e))&&!!(!this._isOverridden("viewpoint")||C(this.viewpoint.targetGeometry?.spatialReference,e)&&C(this.viewpoint.camera?.position?.spatialReference,e))))}init(){this._constraintsManager=new T({view:this.view}),this._prepareFrame();const e=this._getInitialProperties();this._cameraSetByUser=!1,this._set("ready",!0);for(const t of e)this.set(t.name,t.value);if(!this._cameraSetByUser){const e=this._initialViewpoint||this.view.initialExtent;e&&this.isCompatible(e)?this._setInitialView(e):this.view.state.viewingMode===R.Local&&this.addHandles(l((()=>this.view.basemapTerrain.ready),(()=>{this.removeHandles(ae),this._setInitialView(this.view.dataExtent)}),{once:!0,initial:!0}),ae)}}exit(){this._cancelGoToOperation(),this.ready&&(this._override("padding",this.padding),this._set("ready",!1),this._clearOverride("hasInitialView"),this._cameraSetByUser=!1,this.removeHandles(ae),this._constraintsManager=s(this._constraintsManager))}async goTo(e,t){return t={animate:!0,...t},null!=this._gotoOperation&&this._gotoOperation.abort(t.animate),this._gotoOperation=new j(e,t,this.view),this.view.resourceController.scheduler.stopFrame(),this._gotoOperation.promise}debugSetCameraOnContent(){this.setStateCamera(S(this.view),{applyConstraints:!1})}step(e){const t=this.view.state,i=t?.cameraController;i&&(t.updateCamera((t=>i.stepController(e,t))),i.steppingFinished&&i.finishController())}_cancelGoToOperation(){null!=this._gotoOperation&&(this._gotoOperation.abort(),this._gotoOperation=null)}_getInitialProperties(){const e=new Set,t=[];for(const{propertyName:i,overrides:r}of $){const a=e.has(i),s=this._isOverridden(i);!a&&s&&t.push({name:i,value:this._get(i)}),this._clearOverride(i),(a||s)&&r.forEach((t=>e.add(t)))}return t}_setInitialView(e){if(null==e||this._cameraSetByUser)return;if(e instanceof t)return void this.setStateCamera(z(this.view,e),{applyConstraints:!1});if(e instanceof i){if(e.targetGeometry instanceof y){const t=N(this.view,e.targetGeometry,0,.5,V.LOCKED);return void(null!=t&&this.setStateCamera(z(this.view,t),{applyConstraints:!0}))}const t={applyConstraints:!e.camera},i=this._viewpointToCamera(e);return void this.setStateCamera(i,t)}const r=N(this.view,e,0,.5,V.LOCKED);null!=r&&this.setStateCamera(z(this.view,r),{applyConstraints:!0})}_updatePropertyBeforeReady(e,t){return!this.ready&&(this._override(e,t),t&&Y.has(e)&&this._override("hasInitialView",!0),!0)}isCompatible(e){return null!=e&&(e instanceof i?e.camera?this.isCompatible(e.camera):this.isCompatible(e.targetGeometry):e instanceof t?this.isCompatible(e.position):e.spatialReference&&!x(e.spatialReference,this.view.spatialReference))}_getPreservingHeadingTilt(e=ee){return this._cameraSetByUser?(e.heading=this.camera.heading,e.tilt=this.camera.tilt):(e.heading=0,e.tilt=.5),e}_centerPointAtDistanceToCamera(e,t,i=ie){const{heading:r,tilt:a}=this._getPreservingHeadingTilt(),s=B(this.view,r,a,e,t,V.ADJUST);return null==s?null:(i.copyFrom(this.view.state.camera),i.eye=s.eye,i.center=s.center,i.up=s.up,i)}_centerToCamera(e){let t;if(e.hasZ)t=this.view.state.camera.distance;else{const{centerOnContent:e}=this.view.pointsOfInterest;e.runTask(),t=e.distance}return this._centerPointAtDistanceToCamera(e,t)}_extentToCamera(e){const{heading:t,tilt:i}=this._getPreservingHeadingTilt(),r=N(this.view,e,t,i,V.ADJUST,te);return r?z(this.view,r):null}_scaleToCamera(e){if(null==e)return null;const t=this.view,i=t.pointsOfInterest.centerOnContent;i.runTask();const r=i.renderLocation,a=t.pointsOfInterest.cameraOnSurface.renderLocation,s=D(t,e,t.state.contentCamera,r,a);return this._centerPointAtDistanceToCamera(r,s)}_zoomToCamera(e){return this._scaleToCamera(G(this.view,e))}_viewpointToCamera(e){return z(this.view,F(this.view,e))}setStateCamera(e,t){return!(null==e||!this.view.state.stopActiveCameraController())&&(this._cameraSetByUser=!0,t.doNotCancelGoToOperation||this._cancelGoToOperation(),this.view.state.updateCamera((i=>{t.positionAndOrientationOnly?(i.eye=e.eye,i.center=e.center,i.up=e.up,i.fov=e.fov):i.copyFrom(e),t.applyConstraints&&P(this.view,i)})),t.applyConstraints||(this.view.state.cameraController=new I({view:this.view,desiredCamera:e})),!0)}_prepareFrame(){const{surface:e,canvas:t}=this.view;if(!e||!t)return;this._windowDevicePixelRatio=window.devicePixelRatio;const i=this._computeCanvasSize();if(0!==i.width&&0!==i.height&&(t.width===i.width&&t.height===i.height||(t.width=i.width,t.height=i.height),this.view.state)){const e=this.view.state.camera;e.fullWidth===i.width&&e.fullHeight===i.height&&e.pixelRatio===i.pixelRatio||(ie.copyFrom(e),ie.pixelRatio!==i.pixelRatio&&(this._paddingToArray(this.padding,i.pixelRatio,re),ie.padding=re),ie.fullWidth=i.width,ie.fullHeight=i.height,ie.pixelRatio=i.pixelRatio,this.view.state.camera=ie),this._updateViewState()}}_updateElevation(e){const t=this.view.basemapTerrain?.spatialReference,i=this.view.renderCoordsHelper?.getAltitude(e.eye)??0,r=t?O(this.view,e.eye):0;e.relativeElevation=i-r}_updateViewState(){null!=this.test.renderState?this.view.state.mode=this.test.renderState:this.view.animation?this.view.state.mode=K.ANIMATING:this.view.interacting?this.view.state.mode=K.INTERACTING:(this.view.state.mode===K.ANIMATING&&(this._cameraChangeTime=0),performance.now()-this._cameraChangeTime<this._idleTimeout?this.view.state.mode=K.INTERACTING:this.view.state.mode=K.IDLE),this.view.state.rasterPixelRatio=this._rasterPixelRatio}_cameraChangedHandler(e,t){e&&t&&e.almostEquals(t)||(this._cameraChangeTime=performance.now(),this._updateViewState())}};e([m({type:t,dependsOn:["view.state.camera","ready"]})],Q.prototype,"camera",null),e([m({type:t,dependsOn:["view.state.contentCamera","ready"]})],Q.prototype,"contentCamera",null),e([m({type:_})],Q.prototype,"center",null),e([m()],Q.prototype,"visibleArea",null),e([m({type:y})],Q.prototype,"extent",null),e([m({readOnly:!0})],Q.prototype,"frustum",null),e([m()],Q.prototype,"_constraintsManager",void 0),e([m({readOnly:!0})],Q.prototype,"constraintsManager",null),e([m()],Q.prototype,"_initialViewpoint",null),e([m({readOnly:!0})],Q.prototype,"hasInitialView",null),e([m({readOnly:!0,type:Boolean})],Q.prototype,"ready",void 0),e([m({type:Number})],Q.prototype,"scale",null),e([m()],Q.prototype,"padding",null),e([m({readOnly:!0})],Q.prototype,"screenCenter",null),e([m({constructOnly:!0})],Q.prototype,"view",void 0),e([m({type:i})],Q.prototype,"viewpoint",null),e([m({type:Number})],Q.prototype,"zoom",null),e([m({readOnly:!0})],Q.prototype,"_rasterPixelRatio",null),e([m({readOnly:!0})],Q.prototype,"_usePhysicalPixelRendering",null),e([m({readOnly:!0})],Q.prototype,"_usePhysicalPixelRenderingAny",null),e([m()],Q.prototype,"_windowDevicePixelRatio",void 0),e([m()],Q.prototype,"_devicePixelRatioOverride",void 0),Q=e([d("esri.views.3d.state.ViewStateManager")],Q);class X{constructor(){this.width=0,this.height=0,this.pixelRatio=1}}const Y=new Set(["camera","viewpoint","extent","scale","center","zoom"]),$=[{propertyName:"camera",overrides:["viewpoint"]},{propertyName:"viewpoint",overrides:["extent"]},{propertyName:"extent",overrides:["center","scale"]},{propertyName:"center",overrides:[]},{propertyName:"scale",overrides:["zoom"]},{propertyName:"zoom",overrides:[]},{propertyName:"padding",overrides:[]}],ee={heading:0,tilt:0},te=new t,ie=new k,re=g(),ae="pending-initial-view",se="content-camera-reset",ne=300,oe=100;export{Q as ViewStateManager,oe as interactingTimeout};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../Camera.js";import i from"../../../Viewpoint.js";import r from"../../../core/Accessor.js";import a from"../../../core/Logger.js";import{destroyMaybe as s}from"../../../core/maybe.js";import{on as n,watch as o,sync as h,when as l}from"../../../core/reactiveUtils.js";import{addFrameTask as p}from"../../../core/scheduling.js";import{createScreenPoint as c}from"../../../core/screenUtils.js";import{property as m}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as d}from"../../../core/accessorSupport/decorators/subclass.js";import{s as v}from"../../../chunks/vec32.js";import{fromArray as u}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{s as w}from"../../../chunks/vec42.js";import{create as g}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import y from"../../../geometry/Extent.js";import _ from"../../../geometry/Point.js";import f from"../../../geometry/Polygon.js";import{isLoadedOrLoadFor as C,requiresLoad as x}from"../../../geometry/projection.js";import{ViewingMode as R}from"../../ViewingMode.js";import{applyAll as P}from"../camera/constraintUtils.js";import{cameraOnContentAlongViewDirection as S,surfaceElevationBelowRenderLocation as O}from"../camera/intersectionUtils.js";import{ConstraintsManager as T}from"./ConstraintsManager.js";import{Frustum as b}from"./Frustum.js";import{GoToOperation as j}from"./GoToOperation.js";import{SurfaceCollisionCorrectionController as I}from"./controllers/SurfaceCollisionCorrectionController.js";import{internalToExternal as M,externalToInternal as z,toArea as A,toExtent as E,applyTiltAdjustToScale as L,scaleToZoom as H,fromExtentSync as N,OrientationMode as V,getObserverForPointAtDistanceSync as B,viewScaleToCameraDistance as D,zoomToScale as G}from"../support/cameraUtils.js";import{fromCamera as U,toCameraSync as F}from"../support/viewpointUtils.js";import k from"../webgl/RenderCamera.js";import{PaddingSide as q}from"../webgl-engine/lib/rendererUtils.js";import{RenderFeature as W}from"../webgl-engine/lib/RenderFeature.js";import{PropertiesPool as J}from"../../support/PropertiesPool.js";import{RenderState as K}from"../../support/RenderState.js";import{ensureAttachmentMaxSize as Z}from"../../webgl/FramebufferObject.js";let Q=class extends r{constructor(e){super(e),this.ready=!1,this._windowDevicePixelRatio=1,this._devicePixelRatioOverride=null,this._idleTimeout=ne,this.test={viewStateManager:this,contentCameraResetState:new Map,setDevicePixelRatio:e=>this._devicePixelRatioOverride=e,renderState:null,get maximumPixelRatio(){return this.viewStateManager.view.qualitySettings.maximumPixelRatio},get updatingIgnoreRenderState(){return null!=this.renderState},get idleTimeoutEnabled(){return this.viewStateManager._idleTimeout>0},set idleTimeoutEnabled(e){this.viewStateManager._idleTimeout=e?ne:0}},this._propertiesPool=new J({frustum:b},this),this._cameraSetByUser=!1,this._gotoOperation=null,this._cameraChangeTime=0,this._tmpCanvasSize=new X}initialize(){this._cameraChangeTime=performance.now(),this.addHandles([n((()=>this.view.state.events),"before-camera-change",(({camera:e})=>e&&this._updateElevation(e))),o((()=>this.view.state?.camera),((e,t)=>this._cameraChangedHandler(e,t)),h)]),l((()=>this.view.state?.camera),(e=>this._updateElevation(e)),{once:!0,sync:!0}),this.addHandles([p({prepare:()=>this._prepareFrame()}),o((()=>this.view.state.cameraController),(()=>{this._cameraSetByUser=!0,this.removeHandles(ae)})),n((()=>this.view.state.events),"camera-projection-changed",(()=>this.notifyChange("scale")))])}destroy(){this.exit(),this._propertiesPool=s(this._propertiesPool)}get camera(){const e=this._get("camera");if(!this.ready)return e;const t=M(this.view,this.view.state.camera,te);return t&&e&&t.equals(e)?e:t.clone()}set camera(e){this._updatePropertyBeforeReady("camera",e)||(this.view.elevationProvider?.enableCache(!0),this.setStateCamera(z(this.view,e),{applyConstraints:!1})||a.getLogger(this).error("#camera=","Invalid camera",e),this.view.elevationProvider?.enableCache(!1))}get contentCamera(){const e=this._get("contentCamera");if(!this.ready)return e;const t=M(this.view,this.view.state.contentCamera,te);return t&&e&&t.equals(e)?e:t.clone()}set contentCamera(e){if(this._updatePropertyBeforeReady("contentCamera",e))return;const t=z(this.view,e);this.view.state.contentCamera=null!=t?t:null}installContentCameraReset(e){if(this.removeHandles(se),this.test.contentCameraResetState.clear(),!this.view.state.fixedContentCamera)return!1;const t=this.zoom,i=this.view.state.camera.distance**2,r=u(this.view.state.camera.center),a=e.sticky?this.contentCamera.clone():null;return this.addHandles([o((()=>this.contentCamera),(()=>{e.sticky||(this.removeHandles(se),this.test.contentCameraResetState.clear())})),o((()=>this.zoom),(e=>{void 0!==e&&void 0!==t&&(this.test.contentCameraResetState.set("view.zoom",Math.abs(e-t)/2),Math.abs(e-t)>2?this.contentCamera=null:this.view.state.fixedContentCamera||(this.contentCamera=a))})),o((()=>this.view.state.camera),(e=>{const t=v(r,e.center);this.test.contentCameraResetState.set("camera.center",t/i),t>i?this.contentCamera=null:this.view.state.fixedContentCamera||(this.contentCamera=a)}))],se),!0}get center(){return this.ready?this.view.pointsOfInterest.centerOnContent.location:this._get("center")}set center(e){this._updatePropertyBeforeReady("center",e)||(e?this.isCompatible(e)?this.setStateCamera(this._centerToCamera(e),{applyConstraints:!0})?this.view.pointsOfInterest.centerOnContent.runTask():a.getLogger(this).error("#center=","Invalid center",e):a.getLogger(this).error("#center=","Center has an incompatible spatial reference (center: "+(e.spatialReference?e.spatialReference.wkid:"none")+", view: "+this.view.spatialReference?.wkid+")",e):a.getLogger(this).error("#center=","Center may not be null or undefined"))}get visibleArea(){if(!this.ready){const e=this._get("extent");return e?f.fromExtent(e):null}return A(this.view,this.view.pointsOfInterest.focus.renderLocation)}get extent(){if(!this.ready)return this._get("extent");const e=this.view,t=E(e,e.state.camera,e.pointsOfInterest.centerOnContent.renderLocation);return null!=t?t:this._get("extent")}set extent(e){this._updatePropertyBeforeReady("extent",e)||(e?this.isCompatible(e)?this.setStateCamera(this._extentToCamera(e),{applyConstraints:!0})||a.getLogger(this).error("#extent=","Invalid extent",e):a.getLogger(this).error("#extent=","Extent has an incompatible spatial reference (extent: "+(e.spatialReference?e.spatialReference.wkid:"none")+", view: "+this.view.spatialReference?.wkid+")",e):a.getLogger(this).error("#extent=","Extent may not be null or undefined"))}get frustum(){const e=this._propertiesPool.get("frustum");return e.renderCoordsHelper=this.view.renderCoordsHelper,e.update(this.view.state.camera),e}get constraintsManager(){return this._constraintsManager}get _initialViewpoint(){const e=this.view.map;return e&&"initialViewProperties"in e?e.initialViewProperties?.viewpoint:void 0}get hasInitialView(){return!!this._initialViewpoint}get scale(){if(!this.ready)return this._get("scale");const e=this.view.basemapTerrain.tilingScheme,t=this.view.pointsOfInterest.cameraOnSurface.scale;return e&&t?L(this.view,t,this.view.state.contentCamera,e):this._get("scale")}set scale(e){this._updatePropertyBeforeReady("scale",e)||this.setStateCamera(this._scaleToCamera(e),{applyConstraints:!0})||a.getLogger(this).error("#scale=","Invalid scale",e)}get padding(){if(!this.ready)return this._get("padding");const e=this.view.state.camera,t=e.padding,i=e.pixelRatio,r=this._get("padding"),a=Math.round(t[q.TOP]/i),s=Math.round(t[q.RIGHT]/i),n=Math.round(t[q.BOTTOM]/i),o=Math.round(t[q.LEFT]/i);return null!=r&&r.top===a&&r.right===s&&r.bottom===n&&r.left===o?r:{top:a,right:s,bottom:n,left:o}}set padding(e){this._updatePropertyBeforeReady("padding",e)||(this._paddingToArray(e,this.view.state.camera.pixelRatio,re),this.view.state.updateCamera((e=>e.padding=re)))}_paddingToArray(e,t,i){e?w(i,e.top||0,e.right||0,e.bottom||0,e.left||0):w(i,0,0,0,0);for(let r=0;r<4;r++)i[r]=Math.round(i[r]*t)}get screenCenter(){const e=this.padding;return c((this.view.width-(e.left+e.right))/2+e.left,(this.view.height-(e.top+e.bottom))/2+e.top)}get viewpoint(){return this.ready?U(this.view,this.camera):this._get("viewpoint")}set viewpoint(e){if(!this._updatePropertyBeforeReady("viewpoint",e))if(e)if(this.isCompatible(e))this.setStateCamera(this._viewpointToCamera(e),{applyConstraints:!e.camera})||a.getLogger(this).error("#viewpoint=","Invalid viewpoint",e);else{const t=null!=e.camera?e.camera.position:e.targetGeometry,i=null!=t&&t.spatialReference;a.getLogger(this).error("#viewpoint=","Viewpoint has an incompatible spatial reference (viewpoint: "+(i?i.wkid:"none")+", view: "+this.view.spatialReference?.wkid+")",e)}else a.getLogger(this).error("#viewpoint=","Viewpoint may not be null or undefined")}get zoom(){return this.ready?H(this.view,this.scale):this._get("zoom")}set zoom(e){this._updatePropertyBeforeReady("zoom",e)||void 0===e||this.setStateCamera(this._zoomToCamera(e),{applyConstraints:!0})||a.getLogger(this).error("#zoom=","Invalid zoom",e)}_computeCanvasSize(){if(this._devicePixelRatioOverride)return this.view.state.contentPixelRatio=this._devicePixelRatioOverride,this._tmpCanvasSize.width=Math.round(this.view.surface.clientWidth*this._devicePixelRatioOverride),this._tmpCanvasSize.height=Math.round(this.view.surface.clientHeight*this._devicePixelRatioOverride),this._tmpCanvasSize.pixelRatio=this._devicePixelRatioOverride,this._tmpCanvasSize;const e=Math.min(this._windowDevicePixelRatio,this.view.qualitySettings.maximumPixelRatio),t=(this._usePhysicalPixelRendering?this._windowDevicePixelRatio:e)*this.view.resolutionScale;this._tmpCanvasSize.width=Math.round(this.view.surface.clientWidth*t),this._tmpCanvasSize.height=Math.round(this.view.surface.clientHeight*t);const i=this.view.stage.renderView.renderingContext?.parameters.maxTextureSize;return i&&Z(this._tmpCanvasSize,i),this._tmpCanvasSize.pixelRatio=this._tmpCanvasSize.width>0?this._tmpCanvasSize.width/this.view.surface.clientWidth*.5+this._tmpCanvasSize.height/this.view.surface.clientHeight*.5:t,this.view.state&&(this.view.state.contentPixelRatio=Math.min(this._windowDevicePixelRatio,this.view.qualitySettings.maximumPixelRatio)),this._tmpCanvasSize}get _rasterPixelRatio(){return null!=this._devicePixelRatioOverride?this._devicePixelRatioOverride:this._usePhysicalPixelRenderingAny?this._windowDevicePixelRatio:Math.min(this._windowDevicePixelRatio,this.view.qualitySettings.maximumPixelRatio)}get _usePhysicalPixelRendering(){return this.view?.stage?.renderer.isFeatureEnabled(W.PhysicalPixelRendering)??!1}get _usePhysicalPixelRenderingAny(){const e=this.view?.stage?.renderer;return e&&(e.isFeatureEnabled(W.PhysicalPixelRendering,K.IDLE)||e.isFeatureEnabled(W.PhysicalPixelRendering,K.INTERACTING)||e.isFeatureEnabled(W.PhysicalPixelRendering,K.ANIMATING))}preinit(e){return!(this._isOverridden("center")&&!C(this.center.spatialReference,e))&&(!(this._isOverridden("camera")&&!C(this.camera.position.spatialReference,e))&&(!(this._isOverridden("extent")&&!C(this.extent.spatialReference,e))&&!!(!this._isOverridden("viewpoint")||C(this.viewpoint.targetGeometry?.spatialReference,e)&&C(this.viewpoint.camera?.position?.spatialReference,e))))}init(){this._constraintsManager=new T({view:this.view}),this._prepareFrame();const e=this._getInitialProperties();this._cameraSetByUser=!1,this._set("ready",!0);for(const t of e)this.set(t.name,t.value);if(!this._cameraSetByUser){const e=this._initialViewpoint||this.view.initialExtent;e&&this.isCompatible(e)?this._setInitialView(e):this.view.state.viewingMode===R.Local&&this.addHandles(l((()=>this.view.basemapTerrain.ready),(()=>{this.removeHandles(ae),this._setInitialView(this.view.dataExtent)}),{once:!0,initial:!0}),ae)}}exit(){this._cancelGoToOperation(),this.ready&&(this._override("padding",this.padding),this._set("ready",!1),this._clearOverride("hasInitialView"),this._cameraSetByUser=!1,this.removeHandles(ae),this._constraintsManager=s(this._constraintsManager))}async goTo(e,t){return t={animate:!0,...t},null!=this._gotoOperation&&this._gotoOperation.abort(t.animate),this._gotoOperation=new j(e,t,this.view),this.view.resourceController.scheduler.stopFrame(),this._gotoOperation.promise}debugSetCameraOnContent(){this.setStateCamera(S(this.view),{applyConstraints:!1})}step(e){const t=this.view.state,i=t?.cameraController;i&&(t.updateCamera((t=>i.stepController(e,t))),i.steppingFinished&&i.finishController())}_cancelGoToOperation(){null!=this._gotoOperation&&(this._gotoOperation.abort(),this._gotoOperation=null)}_getInitialProperties(){const e=new Set,t=[];for(const{propertyName:i,overrides:r}of $){const a=e.has(i),s=this._isOverridden(i);!a&&s&&t.push({name:i,value:this._get(i)}),this._clearOverride(i),(a||s)&&r.forEach((t=>e.add(t)))}return t}_setInitialView(e){if(null==e||this._cameraSetByUser)return;if(e instanceof t)return void this.setStateCamera(z(this.view,e),{applyConstraints:!1});if(e instanceof i){if(e.targetGeometry instanceof y){const t=N(this.view,e.targetGeometry,0,.5,V.LOCKED);return void(null!=t&&this.setStateCamera(z(this.view,t),{applyConstraints:!0}))}const t={applyConstraints:!e.camera},i=this._viewpointToCamera(e);return void this.setStateCamera(i,t)}const r=N(this.view,e,0,.5,V.LOCKED);null!=r&&this.setStateCamera(z(this.view,r),{applyConstraints:!0})}_updatePropertyBeforeReady(e,t){return!this.ready&&(this._override(e,t),t&&Y.has(e)&&this._override("hasInitialView",!0),!0)}isCompatible(e){return null!=e&&(e instanceof i?e.camera?this.isCompatible(e.camera):this.isCompatible(e.targetGeometry):e instanceof t?this.isCompatible(e.position):e.spatialReference&&!x(e.spatialReference,this.view.spatialReference))}_getPreservingHeadingTilt(e=ee){return this._cameraSetByUser?(e.heading=this.camera.heading,e.tilt=this.camera.tilt):(e.heading=0,e.tilt=.5),e}_centerPointAtDistanceToCamera(e,t,i=ie){const{heading:r,tilt:a}=this._getPreservingHeadingTilt(),s=B(this.view,r,a,e,t,V.ADJUST);return null==s?null:(i.copyFrom(this.view.state.camera),i.eye=s.eye,i.center=s.center,i.up=s.up,i)}_centerToCamera(e){let t;if(e.hasZ)t=this.view.state.camera.distance;else{const{centerOnContent:e}=this.view.pointsOfInterest;e.runTask(),t=e.distance}return this._centerPointAtDistanceToCamera(e,t)}_extentToCamera(e){const{heading:t,tilt:i}=this._getPreservingHeadingTilt(),r=N(this.view,e,t,i,V.ADJUST,te);return r?z(this.view,r):null}_scaleToCamera(e){if(null==e)return null;const t=this.view,i=t.pointsOfInterest.centerOnContent;i.runTask();const r=i.renderLocation,a=t.pointsOfInterest.cameraOnSurface.renderLocation,s=D(t,e,t.state.contentCamera,r,a);return this._centerPointAtDistanceToCamera(r,s)}_zoomToCamera(e){return this._scaleToCamera(G(this.view,e))}_viewpointToCamera(e){return z(this.view,F(this.view,e))}setStateCamera(e,t){return!(null==e||!this.view.state.stopActiveCameraController())&&(this._cameraSetByUser=!0,t.doNotCancelGoToOperation||this._cancelGoToOperation(),this.view.state.updateCamera((i=>{t.positionAndOrientationOnly?(i.eye=e.eye,i.center=e.center,i.up=e.up,i.fov=e.fov):i.copyFrom(e),t.applyConstraints&&P(this.view,i)})),t.applyConstraints||(this.view.state.cameraController=new I({view:this.view,desiredCamera:e})),!0)}_prepareFrame(){const{surface:e,canvas:t}=this.view;if(!e||!t)return;this._windowDevicePixelRatio=window.devicePixelRatio;const i=this._computeCanvasSize();if(0!==i.width&&0!==i.height&&(t.width===i.width&&t.height===i.height||(t.width=i.width,t.height=i.height),this.view.state)){const e=this.view.state.camera;e.fullWidth===i.width&&e.fullHeight===i.height&&e.pixelRatio===i.pixelRatio||(ie.copyFrom(e),ie.pixelRatio!==i.pixelRatio&&(this._paddingToArray(this.padding,i.pixelRatio,re),ie.padding=re),ie.fullWidth=i.width,ie.fullHeight=i.height,ie.pixelRatio=i.pixelRatio,this.view.state.camera=ie),this._updateViewState()}}_updateElevation(e){const t=this.view.basemapTerrain?.spatialReference,i=this.view.renderCoordsHelper?.getAltitude(e.eye)??0,r=t?O(this.view,e.eye):0;e.relativeElevation=i-r}_updateViewState(){null!=this.test.renderState?this.view.state.mode=this.test.renderState:this.view.animation?this.view.state.mode=K.ANIMATING:this.view.interacting?this.view.state.mode=K.INTERACTING:(this.view.state.mode===K.ANIMATING&&(this._cameraChangeTime=0),performance.now()-this._cameraChangeTime<this._idleTimeout?this.view.state.mode=K.INTERACTING:this.view.state.mode=K.IDLE),this.view.state.rasterPixelRatio=this._rasterPixelRatio}_cameraChangedHandler(e,t){e&&t&&e.almostEquals(t)||(this._cameraChangeTime=performance.now(),this._updateViewState())}};e([m({type:t,dependsOn:["view.state.camera","ready"]})],Q.prototype,"camera",null),e([m({type:t,dependsOn:["view.state.contentCamera","ready"]})],Q.prototype,"contentCamera",null),e([m({type:_})],Q.prototype,"center",null),e([m()],Q.prototype,"visibleArea",null),e([m({type:y})],Q.prototype,"extent",null),e([m({readOnly:!0})],Q.prototype,"frustum",null),e([m()],Q.prototype,"_constraintsManager",void 0),e([m({readOnly:!0})],Q.prototype,"constraintsManager",null),e([m()],Q.prototype,"_initialViewpoint",null),e([m({readOnly:!0})],Q.prototype,"hasInitialView",null),e([m({readOnly:!0,type:Boolean})],Q.prototype,"ready",void 0),e([m({type:Number})],Q.prototype,"scale",null),e([m()],Q.prototype,"padding",null),e([m({readOnly:!0})],Q.prototype,"screenCenter",null),e([m({constructOnly:!0})],Q.prototype,"view",void 0),e([m({type:i})],Q.prototype,"viewpoint",null),e([m({type:Number})],Q.prototype,"zoom",null),e([m({readOnly:!0})],Q.prototype,"_rasterPixelRatio",null),e([m({readOnly:!0})],Q.prototype,"_usePhysicalPixelRendering",null),e([m({readOnly:!0})],Q.prototype,"_usePhysicalPixelRenderingAny",null),e([m()],Q.prototype,"_windowDevicePixelRatio",void 0),e([m()],Q.prototype,"_devicePixelRatioOverride",void 0),Q=e([d("esri.views.3d.state.ViewStateManager")],Q);class X{constructor(){this.width=0,this.height=0,this.pixelRatio=1}}const Y=new Set(["camera","viewpoint","extent","scale","center","zoom"]),$=[{propertyName:"camera",overrides:["viewpoint"]},{propertyName:"viewpoint",overrides:["extent"]},{propertyName:"extent",overrides:["center","scale"]},{propertyName:"center",overrides:[]},{propertyName:"scale",overrides:["zoom"]},{propertyName:"zoom",overrides:[]},{propertyName:"padding",overrides:[]}],ee={heading:0,tilt:0},te=new t,ie=new k,re=g(),ae="pending-initial-view",se="content-camera-reset",ne=300,oe=100;export{Q as ViewStateManager,oe as interactingTimeout};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{cyclicalPI as t}from"../../../../core/Cyclical.js";import{deg2rad as e,clamp as n,acosClamped as o,asinClamped as r}from"../../../../core/mathUtils.js";import{createScreenPointArray as a}from"../../../../core/screenUtils.js";import{fromRotation as i,exactEquals as s,multiply as c,rotate as l}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as m,create as u}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as f}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as p}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{d as h,t as M,g,l as y,h as b,m as d,i as x,f as v,n as j,s as z,c as P,e as w}from"../../../../chunks/vec32.js";import{create as I}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as H,axis as S,fromPoints as k,wrapAxisAngle as A}from"../../../../geometry/support/axisAngle.js";import{coordinateSystemFromOneAxisAndNormalVector as E,vectorCoordinates as T}from"../../../../geometry/support/coordinateSystem.js";import{create as U,intersectRay as G,fromNormalAndOffset as R}from"../../../../geometry/support/plane.js";import{k as q,j as C,a as F,c as V}from"../../../../chunks/sphere.js";import{sm4d as O,sv3d as W}from"../../../../geometry/support/vectorStacks.js";import{fromScreen as B,fromScreenAtEye as D}from"../../support/geometryUtils/ray.js";import{intersectScreen as J}from"../../support/geometryUtils/sphere.js";import K from"../../webgl/RenderCamera.js";import{terrainId as L}from"../../webgl-engine/lib/verticalOffsetUtils.js";var N;!function(t){t[t.Ellipsoid=0]="Ellipsoid",t[t.Silhouette=1]="Silhouette"}(N||(N={}));const Q=30,X=[1,3e8],Y=80,Z=8,$=200,_=1508e5,tt=5,et=50,nt=5,ot=10,rt=90,at={exclude:new Set([L])};function it(t,e,n){return n[0]=e[0]/(t.fullWidth/t.pixelRatio),n[1]=e[1]/(t.fullHeight/t.pixelRatio),n}function st(t){for(;t>Math.PI;)t-=2*Math.PI;for(;t<-Math.PI;)t+=2*Math.PI;return t}function ct(t,e,n){const o=i(O.get(),n[3],S(n));null==o||s(o,m)||(h(re,t.eye,e),M(re,re,o),t.eye=g(re,re,e),h(re,t.center,e),M(re,re,o),t.center=g(re,re,e),t.up=M(re,t.up,o))}function lt(t,e,n,o){return G(t,B(e,n,le),o)}function mt(t,e,n,o){return G(t,D(e,n,le),o)}function ut(t,e,n,o){const r=W.get();let a=1-n;h(r,e,t.eye);const i=y(r);let s=i*(1-a);a>=0&&s<o&&(s=o,a=-(s-i)/i),Math.abs(i-s)<1e-6||(b(r,r,a),t.eye=g(re,t.eye,r),t.center=d(re,t.center,e,a))}function ft(t,e,n){e.getScreenCenter(pt),J(t,e,pt,re)&&(e.center=re);const o=e.distance,r=o*n;if(Math.abs(o-r)<1e-6)return;const a=b(W.get(),e.viewForward,r);e.eye=h(re,e.center,a)}const pt=a();function ht(t,e){x(e,0,0,0);for(const n of t)g(e,e,n);b(e,e,1/t.length)}function Mt(t,e,n,o){return Math.sin(t/y(e))*(n+o.radius)}function gt(t,e,n,o){return Mt(Math.PI/2,e,n,o)+(t-Math.PI/2)}var yt;!function(t){t[t.Vertical=0]="Vertical",t[t.Horizontal=1]="Horizontal"}(yt||(yt={}));const bt={Elevation:3e4,Angle:e(16)},dt=e(80);function xt(t,e,n,o,r,a){const i=I(),s=V();let c=!0,l=!0;return t.intersectScreen(n,i,a)?s[3]=y(i):(l=!1,e.aboveGround&&r!==N.Ellipsoid?s[3]=Math.max(y(e.center),.9*o.radius):s[3]=y(e.eye)-e.relativeElevation,r===N.Silhouette?Pt(s,e,n,i):c=J(s,e,n,i)),{sphere:s,scenePickPoint:c?i:null,hasGeometryIntersection:l}}function vt(t,e,n,o){const r=t.relativeElevation;if(r>bt.Elevation&&"global"===o)return yt.Horizontal;D(t,e,me);const a=Math.sign(r),i=n.worldUpAtPosition(t.eye,re);return-a*v(i,me.direction)<Math.sin(bt.Angle)*y(me.direction)?yt.Vertical:yt.Horizontal}function jt(t,e,n){h(zt,n,e),t.eye=h(re,t.eye,zt),t.center=h(re,t.center,zt)}const zt=I();function Pt(t,e,n,o){const r=D(e,n,le);return null!=r&&(q(t,r,wt),C(t,r,o)?!(z(wt,r.origin)<z(o,r.origin))||(P(o,wt),!1):(h(It,e.eye,e.center),j(It,It),R(It,-v(j(It,It),wt),Ht),G(Ht,r,o),!1))}const wt=I(),It=I(),Ht=U();function St(a,i,s,c,l,m){let u=0;if(w(se,a,i),h(ae,a,i),y(a)<=l||!c.aboveGround){w(s,ae,c.eye);const f=v(a,i)/(y(a)*y(i));if(f<.9999)u=o(f);else{const t=y(w(I(),a,i))/(y(a)*y(i));u=r(t)}const p=Math.cos(n(t.normalize(e(m)),0,dt));u=-u-Math.max(0,y(i)-l)/(p*l)}else h(kt,c.eye,c.center),w(s,ae,kt),u=-y(ae)/l;return j(s,s),b(s,s,y(se)),u}const kt=I();function At(r,a,i,s){let c,l;const m=Math.cos(n(t.normalize(e(s)),0,dt));return c=a>i?-(a-i)/(m*i):a<-i?Math.PI-(a+i)/(m*i):o(a/i),l=r>i?-(r-i)/(m*i):r<-i?Math.PI-(r+i)/(m*i):o(r/i),(l-c)*i}function Et(t,e,n,o,r,a,i,s,c,l){const m=At(t[2],e[2],a[3],s),u=c?At(t[0],e[0],a[3],180):e[0]-t[0],p=Math.sin(i)*u-Math.cos(i)*m,h=Math.cos(i)*u+Math.sin(i)*m;j(re,r);const M=c?p/Math.sqrt(Math.abs(a[3]**2-v(n,re)**2)):p/a[3],g=h/Math.sqrt(Math.abs(a[3]**2-v(n,o)**2));f(l,M,g)}function Tt(t,e,n,o,r,a,i,s,c,l){w(se,t,e),E(a.up,a.eye,Nt,Qt,Xt),E([0,0,1],a.eye,Jt,Kt,Lt),P(n,Kt),P(o,Jt),j(n,n),b(n,n,y(se)),T(t,j(Qt,Qt),j(Xt,Xt),j(Nt,Nt),Yt),T(e,Qt,Xt,Nt,Zt),Et(Yt,Zt,t,Jt,Kt,i,s,c,l,r)}function Ut(t,e,n,o,r,a,s){i(te,r,o),i(ee,s,a),c(ne,te,ee),h(e,t,n),M(e,e,ne),g(e,e,n)}function Gt(t,e,n,o,r,a){i(te,o,n),i(ee,a,r),c(ne,te,ee),h(re,t.eye,e),M(re,re,ne),t.eye=g(re,re,e),h(re,t.center,e),M(re,re,ne),t.center=g(re,re,e),h(re,t.up,e),M(re,re,ne),t.up=g(re,re,e)}const Rt={Pole:.95,Angle:e(18),Tilt:45,TiltHysteresisMargin:1e-7};let qt=!1;function Ct(t,e,n,o,r,a){const i=Math.abs(o)>Math.PI-Rt.Angle||Math.abs(o)<Rt.Angle,s=(Math.abs(t[2])<n*Rt.Pole||Math.abs(e)>n)&&a;return i&&s?!qt&&r<Rt.Tilt-Rt.TiltHysteresisMargin?qt=!0:qt&&r>Rt.Tilt+Rt.TiltHysteresisMargin&&(qt=!1):qt=!1,qt}function Ft(t,e,n,o,r,a){if(a)k(n,o,_t),ct(e,F(t),_t);else{const a=St(n,o,ce,e,t[3],r);ct(e,F(t),A(ce,a))}}function Vt(t,e,n,o,r,a,i){const s=i?20:1,c=1e-12;let l,m;P(oe,o),ie.copyFrom(e);for(let u=0;u<s&&z(n,oe)>c&&(l=z(n,oe),Tt(n,oe,Kt,Jt,$t,ie,t,r,a,i),Gt(ie,F(t),Jt,$t[1],Kt,$t[0]),Ut(oe,oe,F(t),Jt,$t[1],Kt,$t[0]),m=z(n,oe),m<l||0===u);u++)e.copyFrom(ie)}function Ot(n,o,r,a,i,s,c){Ct(r,v(o.up,r),n[3],-t.normalize(e(i)),s,o.aboveGround)?Vt(n,o,r,a,-t.normalize(e(i)),s,c):Ft(n,o,r,a,s,c)}function Wt(t,e,n,o,r,a){const{eye:i}=t;E([0,0,1],i,Jt,Kt,Lt);const s=e.translation[0]*n.pan,c="zoom"===r.mode?0:e.translation[1]*n.pan,m=Math.max(Math.sqrt(Math.abs(1-v(t.center,Jt)**2/y(t.center)**2)),.5),u=(Math.sin(a)*c+Math.cos(a)*s)/m,f=-Math.cos(a)*c+Math.sin(a)*s;switch(l(o.pan.matrix,o.pan.matrix,u,Jt),o.pan.enabled=!0,r.mode){case"pan":l(o.pan.matrix,o.pan.matrix,f,Kt),o.pan.enabled=!0;break;case"zoom":o.zoom=-e.translation[1]*n.zoom}}function Bt(t,e,n,o,r){const{eye:a,viewRight:i}=t,s=w(W.get(),i,a),c=e.translation[0]*n.pan;switch(0!==c&&(l(o.pan.matrix,o.pan.matrix,-c,s),o.pan.enabled=!0),r.mode){case"pan":{const t=e.translation[1]*n.pan;0!==t&&(l(o.pan.matrix,o.pan.matrix,t,i),o.pan.enabled=!0);break}case"zoom":o.zoom=-e.translation[1]*n.zoom}}function Dt(n,o,r,a,i,s,c,l,m){Ct(n.center,v(n.up,n.center),y(n.center),-t.normalize(e(s)),c,o.aboveGround)?Wt(o,r,a,l,m,-t.normalize(e(i))):Bt(o,r,a,l,m)}const Jt=I(),Kt=I(),Lt=I(),Nt=I(),Qt=I(),Xt=I(),Yt=I(),Zt=I(),$t=p(),_t=H(),te=u(),ee=u(),ne=u(),oe=I(),re=I(),ae=I(),ie=new K,se=I(),ce=I(),le={origin:I(),direction:I()},me={origin:I(),direction:I()};export{yt as NavigationMode,N as SpherePickPointFallback,dt as TiltThresholdPanningSpeed,bt as VerticalPanTresholds,jt as applyPanPlanar,Ft as applyPanSphericalDirectRotation,Vt as applyPanSphericalPreserveHeading,ct as applyRotation,Gt as applyRotationWithTwoAxes,ft as applyZoomOnSphere,ut as applyZoomToPoint,ht as centroid,at as contentIntersectorOptions,X as distanceClampValues,lt as intersectPlaneFromScreenPoint,mt as intersectPlaneFromScreenPointAtEye,At as lengthFromPoints,et as minHeightLimit,vt as navigationMode,it as normalizeCoordinate,st as normalizeRotationDelta,gt as offSurfaceTiltToEyeTiltGlobal,Mt as onSurfaceTiltToEyeTiltGlobal,tt as panDistanceModifier,Dt as panMotionToRotationMatrix,Ot as panToPosition,xt as pickPointAndInitSphere,Q as pivotDistanceModifier,Rt as preservingHeadingThresholds,nt as rotatePivotDistanceModifier,ot as rotatePivotMinDistanceModifier,Ut as rotatePointAroundTwoAxes,rt as rotateScreenPixelArea,St as rotationAngleAndAxisDirectRotation,Tt as rotationAnglesAndAxesHeadingPreserving,Et as rotationAnglesHeadingPreserving,Y as screenPixelArea,Ct as shouldPreserveHeading,Pt as sphereOrPlanePointFromScreenPoint,Z as zoomDistanceModifier,_ as zoomMaxDistanceModifier,$ as zoomMinDistanceModifier};
5
+ import{cyclicalPI as t}from"../../../../core/Cyclical.js";import{deg2rad as e,clamp as n,acosClamped as o,asinClamped as r}from"../../../../core/mathUtils.js";import{createScreenPointArray as a}from"../../../../core/screenUtils.js";import{fromRotation as i,exactEquals as s,multiply as c,rotate as l}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as m,create as u}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as f}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as p}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{d as h,t as M,g,l as y,h as b,m as d,i as x,f as v,n as j,s as z,c as P,e as w}from"../../../../chunks/vec32.js";import{create as I}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as H,axis as S,fromPoints as k,wrapAxisAngle as A}from"../../../../geometry/support/axisAngle.js";import{coordinateSystemFromOneAxisAndNormalVector as E,vectorCoordinates as T}from"../../../../geometry/support/coordinateSystem.js";import{create as U,intersectRay as G,fromNormalAndOffset as R}from"../../../../geometry/support/plane.js";import{k as q,h as C,a as F,c as V}from"../../../../chunks/sphere.js";import{sm4d as O,sv3d as W}from"../../../../geometry/support/vectorStacks.js";import{fromScreen as B,fromScreenAtEye as D}from"../../support/geometryUtils/ray.js";import{intersectScreen as J}from"../../support/geometryUtils/sphere.js";import K from"../../webgl/RenderCamera.js";import{terrainId as L}from"../../webgl-engine/lib/verticalOffsetUtils.js";var N;!function(t){t[t.Ellipsoid=0]="Ellipsoid",t[t.Silhouette=1]="Silhouette"}(N||(N={}));const Q=30,X=[1,3e8],Y=80,Z=8,$=200,_=1508e5,tt=5,et=50,nt=5,ot=10,rt=90,at={exclude:new Set([L])};function it(t,e,n){return n[0]=e[0]/(t.fullWidth/t.pixelRatio),n[1]=e[1]/(t.fullHeight/t.pixelRatio),n}function st(t){for(;t>Math.PI;)t-=2*Math.PI;for(;t<-Math.PI;)t+=2*Math.PI;return t}function ct(t,e,n){const o=i(O.get(),n[3],S(n));null==o||s(o,m)||(h(re,t.eye,e),M(re,re,o),t.eye=g(re,re,e),h(re,t.center,e),M(re,re,o),t.center=g(re,re,e),t.up=M(re,t.up,o))}function lt(t,e,n,o){return G(t,B(e,n,le),o)}function mt(t,e,n,o){return G(t,D(e,n,le),o)}function ut(t,e,n,o){const r=W.get();let a=1-n;h(r,e,t.eye);const i=y(r);let s=i*(1-a);a>=0&&s<o&&(s=o,a=-(s-i)/i),Math.abs(i-s)<1e-6||(b(r,r,a),t.eye=g(re,t.eye,r),t.center=d(re,t.center,e,a))}function ft(t,e,n){e.getScreenCenter(pt),J(t,e,pt,re)&&(e.center=re);const o=e.distance,r=o*n;if(Math.abs(o-r)<1e-6)return;const a=b(W.get(),e.viewForward,r);e.eye=h(re,e.center,a)}const pt=a();function ht(t,e){x(e,0,0,0);for(const n of t)g(e,e,n);b(e,e,1/t.length)}function Mt(t,e,n,o){return Math.sin(t/y(e))*(n+o.radius)}function gt(t,e,n,o){return Mt(Math.PI/2,e,n,o)+(t-Math.PI/2)}var yt;!function(t){t[t.Vertical=0]="Vertical",t[t.Horizontal=1]="Horizontal"}(yt||(yt={}));const bt={Elevation:3e4,Angle:e(16)},dt=e(80);function xt(t,e,n,o,r,a){const i=I(),s=V();let c=!0,l=!0;return t.intersectScreen(n,i,a)?s[3]=y(i):(l=!1,e.aboveGround&&r!==N.Ellipsoid?s[3]=Math.max(y(e.center),.9*o.radius):s[3]=y(e.eye)-e.relativeElevation,r===N.Silhouette?Pt(s,e,n,i):c=J(s,e,n,i)),{sphere:s,scenePickPoint:c?i:null,hasGeometryIntersection:l}}function vt(t,e,n,o){const r=t.relativeElevation;if(r>bt.Elevation&&"global"===o)return yt.Horizontal;D(t,e,me);const a=Math.sign(r),i=n.worldUpAtPosition(t.eye,re);return-a*v(i,me.direction)<Math.sin(bt.Angle)*y(me.direction)?yt.Vertical:yt.Horizontal}function jt(t,e,n){h(zt,n,e),t.eye=h(re,t.eye,zt),t.center=h(re,t.center,zt)}const zt=I();function Pt(t,e,n,o){const r=D(e,n,le);return null!=r&&(q(t,r,wt),C(t,r,o)?!(z(wt,r.origin)<z(o,r.origin))||(P(o,wt),!1):(h(It,e.eye,e.center),j(It,It),R(It,-v(j(It,It),wt),Ht),G(Ht,r,o),!1))}const wt=I(),It=I(),Ht=U();function St(a,i,s,c,l,m){let u=0;if(w(se,a,i),h(ae,a,i),y(a)<=l||!c.aboveGround){w(s,ae,c.eye);const f=v(a,i)/(y(a)*y(i));if(f<.9999)u=o(f);else{const t=y(w(I(),a,i))/(y(a)*y(i));u=r(t)}const p=Math.cos(n(t.normalize(e(m)),0,dt));u=-u-Math.max(0,y(i)-l)/(p*l)}else h(kt,c.eye,c.center),w(s,ae,kt),u=-y(ae)/l;return j(s,s),b(s,s,y(se)),u}const kt=I();function At(r,a,i,s){let c,l;const m=Math.cos(n(t.normalize(e(s)),0,dt));return c=a>i?-(a-i)/(m*i):a<-i?Math.PI-(a+i)/(m*i):o(a/i),l=r>i?-(r-i)/(m*i):r<-i?Math.PI-(r+i)/(m*i):o(r/i),(l-c)*i}function Et(t,e,n,o,r,a,i,s,c,l){const m=At(t[2],e[2],a[3],s),u=c?At(t[0],e[0],a[3],180):e[0]-t[0],p=Math.sin(i)*u-Math.cos(i)*m,h=Math.cos(i)*u+Math.sin(i)*m;j(re,r);const M=c?p/Math.sqrt(Math.abs(a[3]**2-v(n,re)**2)):p/a[3],g=h/Math.sqrt(Math.abs(a[3]**2-v(n,o)**2));f(l,M,g)}function Tt(t,e,n,o,r,a,i,s,c,l){w(se,t,e),E(a.up,a.eye,Nt,Qt,Xt),E([0,0,1],a.eye,Jt,Kt,Lt),P(n,Kt),P(o,Jt),j(n,n),b(n,n,y(se)),T(t,j(Qt,Qt),j(Xt,Xt),j(Nt,Nt),Yt),T(e,Qt,Xt,Nt,Zt),Et(Yt,Zt,t,Jt,Kt,i,s,c,l,r)}function Ut(t,e,n,o,r,a,s){i(te,r,o),i(ee,s,a),c(ne,te,ee),h(e,t,n),M(e,e,ne),g(e,e,n)}function Gt(t,e,n,o,r,a){i(te,o,n),i(ee,a,r),c(ne,te,ee),h(re,t.eye,e),M(re,re,ne),t.eye=g(re,re,e),h(re,t.center,e),M(re,re,ne),t.center=g(re,re,e),h(re,t.up,e),M(re,re,ne),t.up=g(re,re,e)}const Rt={Pole:.95,Angle:e(18),Tilt:45,TiltHysteresisMargin:1e-7};let qt=!1;function Ct(t,e,n,o,r,a){const i=Math.abs(o)>Math.PI-Rt.Angle||Math.abs(o)<Rt.Angle,s=(Math.abs(t[2])<n*Rt.Pole||Math.abs(e)>n)&&a;return i&&s?!qt&&r<Rt.Tilt-Rt.TiltHysteresisMargin?qt=!0:qt&&r>Rt.Tilt+Rt.TiltHysteresisMargin&&(qt=!1):qt=!1,qt}function Ft(t,e,n,o,r,a){if(a)k(n,o,_t),ct(e,F(t),_t);else{const a=St(n,o,ce,e,t[3],r);ct(e,F(t),A(ce,a))}}function Vt(t,e,n,o,r,a,i){const s=i?20:1,c=1e-12;let l,m;P(oe,o),ie.copyFrom(e);for(let u=0;u<s&&z(n,oe)>c&&(l=z(n,oe),Tt(n,oe,Kt,Jt,$t,ie,t,r,a,i),Gt(ie,F(t),Jt,$t[1],Kt,$t[0]),Ut(oe,oe,F(t),Jt,$t[1],Kt,$t[0]),m=z(n,oe),m<l||0===u);u++)e.copyFrom(ie)}function Ot(n,o,r,a,i,s,c){Ct(r,v(o.up,r),n[3],-t.normalize(e(i)),s,o.aboveGround)?Vt(n,o,r,a,-t.normalize(e(i)),s,c):Ft(n,o,r,a,s,c)}function Wt(t,e,n,o,r,a){const{eye:i}=t;E([0,0,1],i,Jt,Kt,Lt);const s=e.translation[0]*n.pan,c="zoom"===r.mode?0:e.translation[1]*n.pan,m=Math.max(Math.sqrt(Math.abs(1-v(t.center,Jt)**2/y(t.center)**2)),.5),u=(Math.sin(a)*c+Math.cos(a)*s)/m,f=-Math.cos(a)*c+Math.sin(a)*s;switch(l(o.pan.matrix,o.pan.matrix,u,Jt),o.pan.enabled=!0,r.mode){case"pan":l(o.pan.matrix,o.pan.matrix,f,Kt),o.pan.enabled=!0;break;case"zoom":o.zoom=-e.translation[1]*n.zoom}}function Bt(t,e,n,o,r){const{eye:a,viewRight:i}=t,s=w(W.get(),i,a),c=e.translation[0]*n.pan;switch(0!==c&&(l(o.pan.matrix,o.pan.matrix,-c,s),o.pan.enabled=!0),r.mode){case"pan":{const t=e.translation[1]*n.pan;0!==t&&(l(o.pan.matrix,o.pan.matrix,t,i),o.pan.enabled=!0);break}case"zoom":o.zoom=-e.translation[1]*n.zoom}}function Dt(n,o,r,a,i,s,c,l,m){Ct(n.center,v(n.up,n.center),y(n.center),-t.normalize(e(s)),c,o.aboveGround)?Wt(o,r,a,l,m,-t.normalize(e(i))):Bt(o,r,a,l,m)}const Jt=I(),Kt=I(),Lt=I(),Nt=I(),Qt=I(),Xt=I(),Yt=I(),Zt=I(),$t=p(),_t=H(),te=u(),ee=u(),ne=u(),oe=I(),re=I(),ae=I(),ie=new K,se=I(),ce=I(),le={origin:I(),direction:I()},me={origin:I(),direction:I()};export{yt as NavigationMode,N as SpherePickPointFallback,dt as TiltThresholdPanningSpeed,bt as VerticalPanTresholds,jt as applyPanPlanar,Ft as applyPanSphericalDirectRotation,Vt as applyPanSphericalPreserveHeading,ct as applyRotation,Gt as applyRotationWithTwoAxes,ft as applyZoomOnSphere,ut as applyZoomToPoint,ht as centroid,at as contentIntersectorOptions,X as distanceClampValues,lt as intersectPlaneFromScreenPoint,mt as intersectPlaneFromScreenPointAtEye,At as lengthFromPoints,et as minHeightLimit,vt as navigationMode,it as normalizeCoordinate,st as normalizeRotationDelta,gt as offSurfaceTiltToEyeTiltGlobal,Mt as onSurfaceTiltToEyeTiltGlobal,tt as panDistanceModifier,Dt as panMotionToRotationMatrix,Ot as panToPosition,xt as pickPointAndInitSphere,Q as pivotDistanceModifier,Rt as preservingHeadingThresholds,nt as rotatePivotDistanceModifier,ot as rotatePivotMinDistanceModifier,Ut as rotatePointAroundTwoAxes,rt as rotateScreenPixelArea,St as rotationAngleAndAxisDirectRotation,Tt as rotationAnglesAndAxesHeadingPreserving,Et as rotationAnglesHeadingPreserving,Y as screenPixelArea,Ct as shouldPreserveHeading,Pt as sphereOrPlanePointFromScreenPoint,Z as zoomDistanceModifier,_ as zoomMaxDistanceModifier,$ as zoomMinDistanceModifier};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import"../../../core/Cyclical.js";import"../../../core/mathUtils.js";import"../../../core/libs/gl-matrix-2/math/mat4.js";import"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import"../../../chunks/vec32.js";import"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import"../../../chunks/vec42.js";import"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import"../../../core/libs/gl-matrix-2/math/common.js";import"../../../geometry/ellipsoidUtils.js";import"../../../geometry/Extent.js";import"../../../geometry/Polygon.js";import"../../../geometry/SpatialReference.js";import"../../../geometry/support/coordsUtils.js";import"../../../geometry/support/frustum.js";import"../../../geometry/support/lineSegment.js";import"../../../geometry/support/plane.js";import"../../../geometry/support/ray.js";import"../../../chunks/sphere.js";import"../../../geometry/support/webMercatorUtils.js";import"../state/Frustum.js";import"../state/utils/viewUtils.js";import"./cameraUtilsInternal.js";import"./earthUtils.js";import"./mathUtils.js";export{d as directionToHeadingTilt,e as eyeForCenterWithHeadingTilt,a as eyeTiltToLookAtTilt,h as headingTiltToDirectionUp,l as lookAtTiltToEyeTilt,b as toArea,t as toExtent}from"../../../chunks/cameraUtilsSpherical.js";
5
+ import"../../../core/Cyclical.js";import"../../../core/mathUtils.js";import"../../../core/libs/gl-matrix-2/math/mat4.js";import"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import"../../../chunks/vec32.js";import"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import"../../../chunks/vec42.js";import"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import"../../../core/libs/gl-matrix-2/math/common.js";import"../../../geometry/ellipsoidUtils.js";import"../../../geometry/Extent.js";import"../../../geometry/Polygon.js";import"../../../geometry/SpatialReference.js";import"../../../geometry/support/coordsUtils.js";import"../../../geometry/support/frustum.js";import"../../../geometry/support/lineSegment.js";import"../../../geometry/support/plane.js";import"../../../geometry/support/ray.js";import"../../../chunks/sphere.js";import"../../../geometry/support/webMercatorUtils.js";import"../state/Frustum.js";import"../state/NearFarHeuristic.js";import"../state/utils/viewUtils.js";import"./cameraUtilsInternal.js";import"./earthUtils.js";import"./mathUtils.js";export{d as directionToHeadingTilt,e as eyeForCenterWithHeadingTilt,a as eyeTiltToLookAtTilt,h as headingTiltToDirectionUp,l as lookAtTiltToEyeTilt,b as toArea,t as toExtent}from"../../../chunks/cameraUtilsSpherical.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.33/esri/copyright.txt for details.
4
4
  */
5
- import{create as r}from"../../../../geometry/support/ray.js";import{j as o}from"../../../../chunks/sphere.js";import{fromScreenAtEye as t}from"./ray.js";function s(r,s,p,e){const n=t(s,p,m);return o(r,n,e)}const m=r();export{s as intersectScreen};
5
+ import{create as r}from"../../../../geometry/support/ray.js";import{h as o}from"../../../../chunks/sphere.js";import{fromScreenAtEye as t}from"./ray.js";function s(r,s,p,e){const n=t(s,p,m);return o(r,n,e)}const m=r();export{s as intersectScreen};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{OverlayContent as e}from"./OverlayContent.js";import{OverlayFramebufferObject as r}from"./OverlayFramebufferObject.js";import{ColorFormat as o}from"../webgl/formats.js";import{ShaderOutput as t}from"../webgl-engine/core/shaderLibrary/ShaderOutput.js";import{olidEnabled as l}from"../webgl-engine/effects/geometry/olidUtils.js";class s{constructor(e,t,l,s,i=o.RGBA8_MIPMAP){this.output=l,this.content=s,this.fbo=new r(e,i,t)}get valid(){return this.fbo.valid}}class i{constructor(r){this.targets=[new s(r,"overlay color",t.Color,e.Color),new s(r,"overlay IM color",t.Color,e.ColorNoRasterImage),new s(r,"overlay highlight",t.Highlight,e.Highlight,o.RG8UI),new s(r,"overlay water",t.Normal,e.WaterNormal),new s(r,"overlay occluded",t.Color,e.Occluded)],l()&&this.targets.push(new s(r,"overlay olid",t.ObjectAndLayerIdColor,e.ObjectAndLayerIdColor,o.RGBA8))}getTexture(e){return this.targets[e]?.fbo.texture}dispose(){for(const e of this.targets)e.fbo.dispose()}computeValidity(){return this.targets.reduce(((e,r,o)=>r.valid?e|=1<<o:e),0)}}export{i as OverlayRenderTargets,s as RenderTargetDescriptor};
5
+ import{OverlayContent as e}from"./OverlayContent.js";import{OverlayFramebufferObject as r}from"./OverlayFramebufferObject.js";import{ColorFormat as o}from"../webgl-engine/core/FBOCacheFormats.js";import{ShaderOutput as t}from"../webgl-engine/core/shaderLibrary/ShaderOutput.js";import{olidEnabled as l}from"../webgl-engine/effects/geometry/olidUtils.js";class s{constructor(e,t,l,s,i=o.RGBA8UNORM_MIPMAP){this.output=l,this.content=s,this.fbo=new r(e,i,t)}get valid(){return this.fbo.valid}}class i{constructor(r){this.targets=[new s(r,"overlay color",t.Color,e.Color),new s(r,"overlay IM color",t.Color,e.ColorNoRasterImage),new s(r,"overlay highlight",t.Highlight,e.Highlight,o.RG8UINT),new s(r,"overlay water",t.Normal,e.WaterNormal),new s(r,"overlay occluded",t.Color,e.Occluded)],l()&&this.targets.push(new s(r,"overlay olid",t.ObjectAndLayerIdColor,e.ObjectAndLayerIdColor,o.RGBA8UNORM))}getTexture(e){return this.targets[e]?.fbo.texture}dispose(){for(const e of this.targets)e.fbo.dispose()}computeValidity(){return this.targets.reduce(((e,r,o)=>r.valid?e|=1<<o:e),0)}}export{i as OverlayRenderTargets,s as RenderTargetDescriptor};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{GLObjectType as t}from"../../webgl/GLObjectType.js";function e(e){return e?.attachment.type===t.Texture}export{e as isManagedDepthTexture};
5
+ import{FBOAttachmentType as t}from"../../webgl/FBOAttachmentType.js";function e(e){return e?.attachment.type===t.Texture}export{e as isManagedDepthTexture};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{someMap as t}from"../../../core/MapUtils.js";import{releaseMaybe as e}from"../../../core/maybe.js";import{RenderCategory as h}from"../webgl.js";import{isManagedDepthTexture as r}from"./ManagedDepthTexture.js";import{ManagedFBOResource as s,AttachmentType as o}from"./ManagedFBOResource.js";import{DepthStencilAttachment as i,ColorAttachment0 as a}from"../../webgl/enums.js";class c extends s{constructor(t,e,r,s,i,a){super(t,a),this.type=o.FBO,this._colors=new Map,this._name=h.COMPOSITE,this.acquireDepth=null,this.acquireColor=null,this._name=e,this.fbo=r,this.acquireDepth=s,this.acquireColor=i}dispose(){this.fbo?.dispose()}get cachedMemory(){return this.fbo?.usedMemory||0}get numberOfColorAttachments(){return this._colors.size}get name(){return this._name}setName(t){this._name=t}getTexture(t=a){return t===i?this.fbo?.depthStencilTexture:this.fbo?.getColorTexture(t)}getAttachment(t=a){return t===i?this._depth:this._colors.get(t)}hasAttachment(e){return t(this._colors,(t=>t.name===e))}attachDepth(t){return t?.retain(),this.detachDepth(),t&&this.fbo?.attachDepthStencil(t.attachment),this._depth=t,this}detachDepth(){this.fbo?.detachDepthStencilTexture(),this.fbo?.detachDepthStencilBuffer(),this._depth=e(this._depth)}obtainDepthTexture(){const t=this._depth;return r(t)?(this.fbo?.detachDepthStencilTexture(),this._depth=null,t):null}attachColor(t,e){return t.retain(),this.detachColor(e),this.fbo?.attachColorTexture(t.attachment,e),this._colors.set(e,t),this}detachColor(t){this.fbo?.detachColorTexture(t);const e=this._colors.get(t);this._colors.delete(t),e?.release()}detachAll(){this._colors.forEach(((t,e)=>this.detachColor(e))),this.detachDepth()}}export{c as default};
5
+ import{someMap as t}from"../../../core/MapUtils.js";import{releaseMaybe as e}from"../../../core/maybe.js";import{RenderCategory as h}from"../webgl.js";import{isManagedDepthTexture as o}from"./ManagedDepthTexture.js";import{ManagedFBOResource as r,AttachmentType as s}from"./ManagedFBOResource.js";import{DepthStencilAttachment as i,ColorAttachment0 as a}from"../../webgl/enums.js";class c extends r{constructor(t,e,o,r,i,a){super(t,a),this.fbo=o,this.type=s.FBO,this._colors=new Map,this._name=h.COMPOSITE,this.acquireColor=null,this.acquireDepth=null,this._name=e,this.acquireDepth=r,this.acquireColor=i}dispose(){this.fbo?.dispose()}get cachedMemory(){return this.fbo?.usedMemory||0}get numberOfColorAttachments(){return this._colors.size}get name(){return this._name}setName(t){this._name=t}getTexture(t=a){return t===i?this.fbo?.depthStencilTexture:this.fbo?.getColorTexture(t)}getAttachment(t=a){return t===i?this._depth:this._colors.get(t)}hasAttachment(e){return t(this._colors,(t=>t.name===e))}attachDepth(t){return t?.retain(),this.detachDepth(),t&&this.fbo?.attachDepthStencil(t.attachment),this._depth=t,this}detachDepth(){this.fbo?.detachDepthStencilTexture(),this.fbo?.detachDepthStencilBuffer(),this._depth=e(this._depth)}obtainDepthTexture(){const t=this._depth;return o(t)?(this.fbo?.detachDepthStencilTexture(),this._depth=null,t):null}attachColor(t,e){return t.retain(),this.detachColor(e),this.fbo?.attachColorTexture(t.attachment,e),this._colors.set(e,t),this}detachColor(t){this.fbo?.detachColorTexture(t);const e=this._colors.get(t);this._colors.delete(t),e?.release()}detachAll(){this._colors.forEach(((t,e)=>this.detachColor(e))),this.detachDepth()}detachAllButColor0(){this._colors.forEach(((t,e)=>{e!==a&&this.detachColor(e)})),this.detachDepth()}}export{c 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.33/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../core/Error.js";import{ColorFormat as t,DepthRenderbuffer16f as r}from"../../webgl/formats.js";import{ManagedColorAttachment as a}from"../../webgl/ManagedColorAttachment.js";import{ManagedDepthAttachment as o}from"../../webgl/ManagedDepthAttachment.js";import n from"../../webgl/ManagedFBO.js";import{AttachmentType as i}from"../../webgl/ManagedFBOResource.js";import{FBOPool as c}from"./FBOPool.js";import{PixelFormat as h,SizedPixelFormat as s,TextureWrapMode as m,TextureSamplingMode as l,PixelType as d,UnsizedDepthFormat as _,SizedDepthStencilFormat as p,DepthStencilAttachment as u,SizedDepthFormat as f,ColorAttachment0 as w}from"../../../webgl/enums.js";import{FramebufferObject as E}from"../../../webgl/FramebufferObject.js";import{Renderbuffer as A}from"../../../webgl/Renderbuffer.js";import{RenderbufferDescriptor as C}from"../../../webgl/RenderbufferDescriptor.js";import{Texture as T}from"../../../webgl/Texture.js";import{TextureDescriptor as b}from"../../../webgl/TextureDescriptor.js";class M{constructor(e){this.rctx=e,this._acquired=new Set,this._cache=new c(e.newCache,"FBOCache"),this._depthCache=new c(e.newCache,"DepthAttachmentCache"),this._colorCache=new c(e.newCache,"ColorAttachmentCache")}destroy(){this._cache.destroy(),this._depthCache.destroy(),this._colorCache.destroy()}clean(){this._cache.clean(),this._colorCache.clean(),this._depthCache.clean()}frameStart(){this._cache.frame(),this._colorCache.frame(),this._depthCache.frame(),this.debugCallback?.()}frameEnd(){const e=this.debugCallback;e&&this._acquired.forEach((t=>t.type===i.FBO&&e(t.name,t.fbo,t.numberOfColorAttachments)))}get usedMemory(){return Array.from(this._acquired.values()).reduce(((e,t)=>e+("getTexture"in t?t.getTexture()?.usedMemory??0:t.cachedMemory)),this._cache.usedMemory+this._colorCache.usedMemory+this._depthCache.usedMemory)}set interactive(e){this._cache.interactive=this._colorCache.interactive=this._depthCache.interactive=e}acquire(r,a,o,i=t.RGBA8){const c=F(i,r,a);let h=this._cache.pop(c);if(h){h.retain(),h.setName(o);const t=this.rctx.getBoundFramebufferObject();if(this.rctx.bindFramebuffer(h.fbo),this.rctx.setDrawBuffers([w]),!h.fbo)throw new e("internal:renderer","attempt to use an empty framebuffer");this.rctx.unbindTexture(h.fbo.colorTexture),this.rctx.bindFramebuffer(t)}else h=new n(c,o,new E(this.rctx,{...j[i],width:r,height:a}),(e=>{e??=u;const t=this._acquireDepth(e,h.fbo.width,h.fbo.height,`${h.name} depth`);return h.attachDepth(t),t.release(),h}),((e,o,n)=>{o??=t.RGBA8;const i=this._acquireColor(o,r,a,n??`${h.name} color ${e}`);return this.rctx.unbindTexture(i.attachment),h.attachColor(i,e),i.release(),h}),(()=>{this.debugCallback?.(h.name,h.fbo,h.numberOfColorAttachments),h.fbo?.invalidateAttachments([w],!0),this._acquired.delete(h),h.detachAll(),this._cache.put(h)}));return this._trackHandle(h)}acquireDepth(e,t,r,a){return this._acquireDepth(e,t,r,a)}_acquireDepth(e,t,r,a){const n=F(e,t,r),i=this._depthCache.pop(n);if(i)return i.retain(),i.name=a,this._trackHandle(i);const c=new o(n,e===u?new T(this.rctx,{...q[e],width:t,height:r}):new A(this.rctx,{...q[e],width:t,height:r}),(()=>{this._acquired.delete(c),this._depthCache.put(c)}));return c.name=a,this._trackHandle(c)}_acquireColor(e,t,r,o){const n=F(e,t,r),i=this._colorCache.pop(n);if(i)return i.retain(),i.name=o,this._trackHandle(i);const c=new a(n,new T(this.rctx,{...j[e],width:t,height:r}),(()=>{this._acquired.delete(c),this._colorCache.put(c)}));return c.name=o,this._trackHandle(c)}_trackHandle(e){return this._acquired.add(e),e}}const R=new n("default","default",null,(()=>R),(()=>R),(()=>{}));function F(e,t,r){return`${e}x${t}x${r}`}R.release=()=>!1;const g=new b;g.pixelFormat=h.RED,g.internalFormat=s.R8,g.wrapMode=m.CLAMP_TO_EDGE;const x=new b;x.pixelFormat=h.RED_INTEGER,x.internalFormat=s.R8UI,x.wrapMode=m.CLAMP_TO_EDGE,x.samplingMode=l.NEAREST;const G=new b;G.pixelFormat=h.RG,G.internalFormat=s.RG8,G.wrapMode=m.CLAMP_TO_EDGE;const D=new b;D.pixelFormat=h.RG_INTEGER,D.internalFormat=s.RG8UI,D.wrapMode=m.CLAMP_TO_EDGE,D.samplingMode=l.NEAREST;const O=new b;O.internalFormat=s.RGBA4,O.dataType=d.UNSIGNED_SHORT_4_4_4_4,O.wrapMode=m.CLAMP_TO_EDGE;const N=new b;N.wrapMode=m.CLAMP_TO_EDGE;const y=new b;y.wrapMode=m.CLAMP_TO_EDGE,y.samplingMode=l.LINEAR_MIPMAP_LINEAR,y.hasMipmap=!0,y.maxAnisotropy=8;const L=new b;L.pixelFormat=h.RED,L.dataType=d.HALF_FLOAT,L.internalFormat=s.R16F,L.samplingMode=l.NEAREST;const P=new b;P.dataType=d.HALF_FLOAT,P.internalFormat=s.RGBA16F,P.samplingMode=l.NEAREST;const B=new b;B.dataType=d.HALF_FLOAT,B.internalFormat=s.RGBA16F,B.wrapMode=m.CLAMP_TO_EDGE;const j={[t.R8]:g,[t.R8UI]:x,[t.RG8]:G,[t.RG8UI]:D,[t.RGBA4]:O,[t.RGBA8]:N,[t.RGBA8_MIPMAP]:y,[t.R16F]:L,[t.RGBA16F_NEAREST]:P,[t.RGBA16F]:B},I=new b;I.pixelFormat=_.DEPTH_STENCIL,I.dataType=d.UNSIGNED_INT_24_8,I.samplingMode=l.NEAREST,I.wrapMode=m.CLAMP_TO_EDGE,I.internalFormat=p.DEPTH24_STENCIL8;const q={[u]:I,[r]:new C(f.DEPTH_COMPONENT16,4)};export{M as FBOCache,R as defaultWebGLFBO};
5
+ import e from"../../../../core/Error.js";import{ManagedColorAttachment as t}from"../../webgl/ManagedColorAttachment.js";import{ManagedDepthAttachment as r}from"../../webgl/ManagedDepthAttachment.js";import a from"../../webgl/ManagedFBO.js";import{AttachmentType as c}from"../../webgl/ManagedFBOResource.js";import{DepthTextureFormat as h,ColorFormat as o,isDepthFormat as i,isDepthTextureFormat as s,DepthTextureFormats as n,DepthRenderbufferFormats as u,ColorFormats as l}from"./FBOCacheFormats.js";import{FBOPool as m}from"./FBOPool.js";import{ColorAttachment0 as d}from"../../../webgl/enums.js";import{FramebufferObject as f}from"../../../webgl/FramebufferObject.js";import{Renderbuffer as p}from"../../../webgl/Renderbuffer.js";import{Texture as _}from"../../../webgl/Texture.js";class C{constructor(e){this.rctx=e,this._acquired=new Set,this._cache=new m(e.newCache,"FBOCache"),this._depthCache=new m(e.newCache,"DepthAttachmentCache"),this._colorCache=new m(e.newCache,"ColorAttachmentCache")}destroy(){this._cache.destroy(),this._depthCache.destroy(),this._colorCache.destroy()}clean(){this._cache.clean(),this._colorCache.clean(),this._depthCache.clean()}frameStart(){this._cache.frame(),this._colorCache.frame(),this._depthCache.frame(),this.debugCallback?.()}frameEnd(){const e=this.debugCallback;e&&this._acquired.forEach((t=>t.type===c.FBO&&e(t.name,t.fbo,t.numberOfColorAttachments)))}get usedMemory(){return Array.from(this._acquired.values()).reduce(((e,t)=>e+t.cachedMemory),this._cache.usedMemory+this._colorCache.usedMemory+this._depthCache.usedMemory)}set interactive(e){this._cache.interactive=this._colorCache.interactive=this._depthCache.interactive=e}acquire(t,r,c,s=o.RGBA8UNORM){const n=b(s,t,r);let u=this._cache.pop(n);const{rctx:l}=this;if(u){u.retain(),u.setName(c);const{fbo:t}=u;if(!t)throw new e("renderer","attempt to use a not existing framebuffer");l.temporaryBindFramebufferObject(t,(()=>{l.setDrawBuffers([d]),l.unbindTexture(t.colorTexture)}))}else{const e=new f(l);u=new a(n,c,e,(e=>{e??=h.DEPTH24_STENCIL8;const a=this._acquireDepth(e,t,r,`${u.name} depth`);return u.attachDepth(a),a.release(),u}),((e,a,c)=>{a??=o.RGBA8UNORM;const h=this._acquireColor(a,t,r,c??`${u.name} color ${e}`);return this.rctx.unbindTexture(h.attachment),u.attachColor(h,e),h.release(),u}),(()=>{this.debugCallback?.(u.name,u.fbo,u.numberOfColorAttachments),this._acquired.delete(u),null!=u?.getAttachment(d)?(u.fbo?.invalidateAttachments([d],!0),u.detachAllButColor0(),this._cache.put(u)):u?.dispose()})),i(s)?u.acquireDepth(s):u.acquireColor(d,s,c)}return this._trackHandle(u)}acquireDepth(e,t,r,a){return this._acquireDepth(e,t,r,a)}_acquireDepth(e,t,a,c){const h=b(e,t,a);let o=this._depthCache.pop(h);if(o)o.retain();else{const c=s(e)?new _(this.rctx,{...n[e],width:t,height:a}):new p(this.rctx,{...u[e],width:t,height:a}),i=new r(h,c,(()=>this._depthCache.put(i)));o=i}return o.name=c,o}_acquireColor(e,r,a,c){const h=b(e,r,a),o=this._colorCache.pop(h);if(o)return o.retain(),o.name=c,o;const i=new t(h,new _(this.rctx,{...l[e],width:r,height:a}),(()=>{this._colorCache.put(i)}));return i.name=c,i}_trackHandle(e){return this._acquired.add(e),e}}const w=new a("default","default",null,(()=>w),(()=>w),(()=>{}));function b(e,t,r){return`${e}x${t}x${r}`}w.release=()=>!1;export{C as FBOCache,w as defaultWebGLFBO};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
+ */
5
+ import{PixelFormat as T,SizedPixelFormat as E,TextureWrapMode as N,TextureSamplingMode as R,PixelType as n,SizedDepthFormat as e,SizedDepthStencilFormat as t,UnsizedDepthFormat as o}from"../../../webgl/enums.js";import{RenderbufferDescriptor as r}from"../../../webgl/RenderbufferDescriptor.js";import{TextureDescriptor as _}from"../../../webgl/TextureDescriptor.js";import{isSizedDepthFormat as O}from"../../../webgl/textureUtils.js";var M,a,A;function G(T){return T>=M.COUNT}function P(T){return T>=a.COUNT}!function(T){T[T.R8UNORM=0]="R8UNORM",T[T.R8UINT=1]="R8UINT",T[T.RG8UNORM=2]="RG8UNORM",T[T.RG8UINT=3]="RG8UINT",T[T.RGBA4UNORM=4]="RGBA4UNORM",T[T.RGBA8UNORM=5]="RGBA8UNORM",T[T.RGBA8UNORM_MIPMAP=6]="RGBA8UNORM_MIPMAP",T[T.R16FLOAT=7]="R16FLOAT",T[T.RGBA16FLOAT=8]="RGBA16FLOAT",T[T.COUNT=9]="COUNT"}(M||(M={})),function(T){T[T.DEPTH16=9]="DEPTH16",T[T.COUNT=10]="COUNT"}(a||(a={})),function(T){T[T.DEPTH24_STENCIL8=10]="DEPTH24_STENCIL8"}(A||(A={}));const U=new _;U.pixelFormat=T.RED,U.internalFormat=E.R8,U.wrapMode=N.CLAMP_TO_EDGE;const i=new _;i.pixelFormat=T.RED_INTEGER,i.internalFormat=E.R8UI,i.wrapMode=N.CLAMP_TO_EDGE,i.samplingMode=R.NEAREST;const p=new _;p.pixelFormat=T.RG,p.internalFormat=E.RG8,p.wrapMode=N.CLAMP_TO_EDGE;const D=new _;D.pixelFormat=T.RG_INTEGER,D.internalFormat=E.RG8UI,D.wrapMode=N.CLAMP_TO_EDGE,D.samplingMode=R.NEAREST;const m=new _;m.internalFormat=E.RGBA4,m.dataType=n.UNSIGNED_SHORT_4_4_4_4,m.wrapMode=N.CLAMP_TO_EDGE;const I=new _;I.wrapMode=N.CLAMP_TO_EDGE;const F=new _;F.wrapMode=N.CLAMP_TO_EDGE,F.samplingMode=R.LINEAR_MIPMAP_LINEAR,F.hasMipmap=!0,F.maxAnisotropy=8;const L=new _;L.pixelFormat=T.RED,L.dataType=n.HALF_FLOAT,L.internalFormat=E.R16F,L.samplingMode=R.NEAREST;const l=new _;l.dataType=n.HALF_FLOAT,l.internalFormat=E.RGBA16F,l.wrapMode=N.CLAMP_TO_EDGE;const C={[M.R8UNORM]:U,[M.R8UINT]:i,[M.RG8UNORM]:p,[M.RG8UINT]:D,[M.RGBA4UNORM]:m,[M.RGBA8UNORM]:I,[M.RGBA8UNORM_MIPMAP]:F,[M.R16FLOAT]:L,[M.RGBA16FLOAT]:l,[M.COUNT]:null},s={[e.DEPTH_COMPONENT16]:n.UNSIGNED_SHORT,[e.DEPTH_COMPONENT24]:n.UNSIGNED_INT,[e.DEPTH_COMPONENT32F]:n.FLOAT,[t.DEPTH24_STENCIL8]:n.UNSIGNED_INT_24_8,[t.DEPTH32F_STENCIL8]:n.FLOAT_32_UNSIGNED_INT_24_8_REV},w={[a.DEPTH16]:new r(e.DEPTH_COMPONENT16),[a.COUNT]:null},c={[A.DEPTH24_STENCIL8]:d(t.DEPTH24_STENCIL8)};function d(T){const E=new _;return E.pixelFormat=O(T)?o.DEPTH_COMPONENT:o.DEPTH_STENCIL,E.dataType=s[T],E.samplingMode=R.NEAREST,E.wrapMode=N.CLAMP_TO_EDGE,E.internalFormat=T,E.hasMipmap=!1,E.isImmutable=!0,E}export{M as ColorFormat,C as ColorFormats,a as DepthRenderbufferFormat,w as DepthRenderbufferFormats,A as DepthTextureFormat,c as DepthTextureFormats,G as isDepthFormat,P as isDepthTextureFormat};
@@ -2,15 +2,15 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{ReadDepth as e}from"./output/ReadDepth.glsl.js";import{CameraSpace as o}from"./util/CameraSpace.glsl.js";import{Float3PassUniform as l}from"../shaderModules/Float3PassUniform.js";import{FloatPassUniform as t}from"../shaderModules/FloatPassUniform.js";import{glsl as r}from"../shaderModules/glsl.js";import{Texture2DBindUniform as a}from"../shaderModules/Texture2DBindUniform.js";import{Texture2DPassUniform as n}from"../shaderModules/Texture2DPassUniform.js";function i(i,p){const d=i.fragment;d.include(e),i.include(o),d.uniforms.add(new t("globalAlpha",(e=>e.globalAlpha)),new l("glowColor",(e=>e.glowColor)),new t("glowWidth",((e,o)=>e.glowWidth*o.camera.pixelRatio)),new t("glowFalloff",(e=>e.glowFalloff)),new l("innerColor",(e=>e.innerColor)),new t("innerWidth",((e,o)=>e.innerWidth*o.camera.pixelRatio)),new a("depthMap",(e=>e.depth?.attachment)),new n("normalMap",(e=>e.normals))),d.code.add(r`vec4 blendPremultiplied(vec4 source, vec4 dest) {
5
+ import{ReadDepth as o}from"./output/ReadDepth.glsl.js";import{CameraSpace as e}from"./util/CameraSpace.glsl.js";import{Float3PassUniform as l}from"../shaderModules/Float3PassUniform.js";import{FloatPassUniform as t}from"../shaderModules/FloatPassUniform.js";import{glsl as r}from"../shaderModules/glsl.js";import{Texture2DBindUniform as a}from"../shaderModules/Texture2DBindUniform.js";import{Texture2DPassUniform as n}from"../shaderModules/Texture2DPassUniform.js";function d(d,i){const p=d.fragment;p.include(o),d.include(e),p.uniforms.add(new t("globalAlpha",(o=>o.globalAlpha)),new l("glowColor",(o=>o.glowColor)),new t("glowWidth",((o,e)=>o.glowWidth*e.camera.pixelRatio)),new t("glowFalloff",(o=>o.glowFalloff)),new l("innerColor",(o=>o.innerColor)),new t("innerWidth",((o,e)=>o.innerWidth*e.camera.pixelRatio)),new a("depthMap",(o=>o.depth?.attachment)),new n("normalMap",(o=>o.normals))),p.code.add(r`vec4 blendPremultiplied(vec4 source, vec4 dest) {
6
6
  float oneMinusSourceAlpha = 1.0 - source.a;
7
7
  return vec4(
8
8
  source.rgb + dest.rgb * oneMinusSourceAlpha,
9
9
  source.a + dest.a * oneMinusSourceAlpha
10
10
  );
11
- }`),d.code.add(r`vec4 premultipliedColor(vec3 rgb, float alpha) {
11
+ }`),p.code.add(r`vec4 premultipliedColor(vec3 rgb, float alpha) {
12
12
  return vec4(rgb * alpha, alpha);
13
- }`),d.code.add(r`vec4 laserlineProfile(float dist) {
13
+ }`),p.code.add(r`vec4 laserlineProfile(float dist) {
14
14
  if (dist > glowWidth) {
15
15
  return vec4(0.0);
16
16
  }
@@ -20,7 +20,7 @@ return blendPremultiplied(
20
20
  premultipliedColor(innerColor, innerAlpha),
21
21
  premultipliedColor(glowColor, glowAlpha)
22
22
  );
23
- }`),d.code.add(r`bool laserlineReconstructFromDepth(out vec3 pos, out vec3 normal, out float angleCutoffAdjust, out float depthDiscontinuityAlpha) {
23
+ }`),p.code.add(r`bool laserlineReconstructFromDepth(out vec3 pos, out vec3 normal, out float angleCutoffAdjust, out float depthDiscontinuityAlpha) {
24
24
  float depth = depthFromTexture(depthMap, uv);
25
25
  if (depth == 1.0) {
26
26
  return false;
@@ -31,23 +31,21 @@ float minStep = 6e-8;
31
31
  float depthStep = clamp(depth + minStep, 0.0, 1.0);
32
32
  float linearDepthStep = linearizeDepth(depthStep);
33
33
  float depthError = abs(linearDepthStep - linearDepth);
34
- if (depthError > 0.2) {
35
- normal = normalize(texture(normalMap, uv).xyz * 2.0 - 1.0);
36
- angleCutoffAdjust = 0.004;
37
- } else {
38
- normal = normalize(cross(dFdx(pos), dFdy(pos)));
39
- angleCutoffAdjust = 0.0;
40
- }
34
+ vec3 normalReconstructed = normalize(cross(dFdx(pos), dFdy(pos)));
35
+ vec3 normalFromTexture = normalize(texture(normalMap, uv).xyz * 2.0 - 1.0);
36
+ float blendFactor = smoothstep(0.15, 0.2, depthError);
37
+ normal = normalize(mix(normalReconstructed, normalFromTexture, blendFactor));
38
+ angleCutoffAdjust = mix(0.0, 0.004, blendFactor);
41
39
  float ddepth = fwidth(linearDepth);
42
40
  depthDiscontinuityAlpha = 1.0 - smoothstep(0.0, 0.01, -ddepth / linearDepth);
43
41
  return true;
44
- }`),p.contrastControlEnabled?d.uniforms.add(new n("frameColor",((e,o)=>e.colors)),new t("globalAlphaContrastBoost",(e=>e.globalAlphaContrastBoost))).code.add(r`float rgbToLuminance(vec3 color) {
42
+ }`),i.contrastControlEnabled?p.uniforms.add(new n("frameColor",((o,e)=>o.colors)),new t("globalAlphaContrastBoost",(o=>o.globalAlphaContrastBoost))).code.add(r`float rgbToLuminance(vec3 color) {
45
43
  return dot(vec3(0.2126, 0.7152, 0.0722), color);
46
44
  }
47
45
  vec4 laserlineOutput(vec4 color) {
48
46
  float backgroundLuminance = rgbToLuminance(texture(frameColor, uv).rgb);
49
47
  float alpha = clamp(globalAlpha * max(backgroundLuminance * globalAlphaContrastBoost, 1.0), 0.0, 1.0);
50
48
  return color * alpha;
51
- }`):d.code.add(r`vec4 laserlineOutput(vec4 color) {
49
+ }`):p.code.add(r`vec4 laserlineOutput(vec4 color) {
52
50
  return color * globalAlpha;
53
- }`)}export{i as Laserline};
51
+ }`)}export{d as Laserline};
@@ -6,7 +6,7 @@ import{isColorOrColorEmission as s}from"../ShaderOutput.js";import{VertexTexture
6
6
  vec4 getEmissions(vec3 symbolColor) {
7
7
  vec4 emissions = ${g?"vec4(emissiveBaseColor, 1.0)":T?"vec4(symbolColor, 1.0)":"vec4(0.0)"};
8
8
  ${n(C,`emissions *= textureLookup(texEmission, ${p?"emissiveUV":"vuv0"});\n emissions.w = emissions.rgb == vec3(0.0) ? 0.0: emissions.w;`)}
9
- ${n(h,"emissions *= emissiveStrength;")}
9
+ ${n(h,"emissions.rgb *= emissiveStrength;")}
10
10
  return emissions;
11
11
  }
12
12
  `)}export{f as EmissionSource,c as Emissions,v as EmissionsParameters};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../../chunks/tslib.es6.js";import{lerp as t}from"../../../../../core/mathUtils.js";import{watch as r,syncAndInitial as o}from"../../../../../core/reactiveUtils.js";import{property as s}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as i}from"../../../../../core/accessorSupport/decorators/subclass.js";import{InternalRenderCategory as a}from"../../../webgl.js";import{ColorFormat as m}from"../../../webgl/formats.js";import{TransparentEnvironment as n}from"../TransparentEnvironment.js";import{B as l,a as u}from"../../../../../chunks/BloomBlur.glsl.js";import{BloomBlurTechnique as c}from"./BloomBlurTechnique.js";import{BloomBlurTechniqueConfiguration as h}from"./BloomBlurTechniqueConfiguration.js";import{B as p}from"../../../../../chunks/BloomComposition.glsl.js";import{BloomCompositionTechnique as b}from"./BloomCompositionTechnique.js";import{BloomCompositionTechniqueConfiguration as _}from"./BloomCompositionTechniqueConfiguration.js";import{blurRadiusPresets as f,lodFactorsPresets as d,normalizePreset as g}from"./BloomPresets.glsl.js";import{RenderRequestType as P}from"../../lib/basicInterfaces.js";import{ColorAttachment1 as T,DepthStencilAttachment as R,FramebufferBit as C}from"../../../../webgl/enums.js";let j=class extends n{constructor(e){super(e),this.consumes={required:[a.TRANSPARENT_ENVIRONMENT,"emissive"]},this._blurHorizontalConfiguration=new h,this._blurVerticalConfiguration=new h,this._compositionConfiguration=new _,this._compositionParameters=new p,this._blurParameters=new l,this._blurScale=3.06,this._bloomResults=new Array}initialize(){this.addHandles([r((()=>this._updateFogParameters()),(()=>{}),o),r((()=>this.view.qualitySettings.bloom),(e=>{e?(this._enable(),this.precompile()):this._disable()}),o)])}destroy(){}_updateFogParameters(){const e=this.view.environment.weather;if("sunny"===e.type||"cloudy"===e.type)this._blurParameters.blurRadius=f[e.type];else{const r="foggy"===e.type?e.fogStrength:e.precipitation;this._blurParameters.blurRadius=t(f.cloudy,f[e.type],r)}this._compositionParameters.lodFactors=d[e.type].far,this._compositionParameters.lodFactorsFront=d[e.type].near,this.requestRender(P.UPDATE)}precompile(){this.techniques.precompile(c,this._blurHorizontalConfiguration),this._blurVerticalConfiguration.bloomStage=u.Vertical,this.techniques.precompile(c,this._blurVerticalConfiguration),this.techniques.precompile(b,this._compositionConfiguration)}render(e){const t=e.find((({name:e})=>e===a.TRANSPARENT_ENVIRONMENT)),r=t.getAttachment(T)?.attachment;if(!r)return t;const o=this.techniques.get(c,this._blurHorizontalConfiguration),s=this.techniques.get(c,this._blurVerticalConfiguration),i=this.techniques.get(b,this._compositionConfiguration);if(!o.compiled||!s.compiled||!i.compiled)return this.requestRender(P.UPDATE),t;const n=t.getTexture(),l=this.fboCache,{fullWidth:u,fullHeight:h}=this.bindParameters.camera,p=this.renderingContext;let _=r,f=u,d=h;const g=5,C=this._blurParameters.blurRadius;for(let a=0;a<g;a++){const e=l.acquire(f,d,"bloomHorizontal",m.RGBA16F);this._blurParameters.color=_,this._prepareFBO(e,f,d),p.bindTechnique(o,this.bindParameters,this._blurParameters),p.screen.draw();const t=l.acquire(f,d,"bloomVertical",m.RGBA16F);this._blurParameters.color=e.getTexture(),this._prepareFBO(t,f,d),p.bindTechnique(s,this.bindParameters,this._blurParameters),p.screen.draw(),e.release(),this._bloomResults[a]=t,f=Math.ceil(f/2),d=Math.ceil(d/2),_=this._bloomResults[a].getTexture(),this._blurParameters.blurRadius*=this._blurScale}this._blurParameters.blurRadius=C,this._compositionParameters.color=n,this._compositionParameters.bloomTexture0=this._bloomResults[0].getTexture(),this._compositionParameters.bloomTexture1=this._bloomResults[1].getTexture(),this._compositionParameters.bloomTexture2=this._bloomResults[2].getTexture(),this._compositionParameters.bloomTexture3=this._bloomResults[3].getTexture(),this._compositionParameters.bloomTexture4=this._bloomResults[4].getTexture();const j=this.acquireOutputFramebuffer();return this._prepareFBO(j,u,h),p.bindTechnique(i,this.bindParameters,this._compositionParameters),p.screen.draw(),this._bloomResults.forEach((e=>e.release())),j.attachDepth(t.getAttachment(R)),j.attachColor(t.getAttachment(T),T),j}_prepareFBO(e,t,r){const o=this.renderingContext;o.bindFramebuffer(e.fbo),o.setViewport(0,0,t,r),o.setClearColor(0,0,0,0),o.clear(C.COLOR)}get test(){return{compositionParameters:this._compositionParameters,blurParameters:this._blurParameters,setLodFactors:e=>{this._compositionParameters.lodFactors=g(e)}}}};e([s()],j.prototype,"consumes",void 0),j=e([i("esri.views.3d.webgl-engine.effects.bloom.BloomRenderNode")],j);export{j as BloomRenderNode};
5
+ import{_ as e}from"../../../../../chunks/tslib.es6.js";import{lerp as t}from"../../../../../core/mathUtils.js";import{watch as r,syncAndInitial as o}from"../../../../../core/reactiveUtils.js";import{property as s}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as i}from"../../../../../core/accessorSupport/decorators/subclass.js";import{InternalRenderCategory as a}from"../../../webgl.js";import{ColorFormat as m}from"../../core/FBOCacheFormats.js";import{TransparentEnvironment as n}from"../TransparentEnvironment.js";import{B as l,a as u}from"../../../../../chunks/BloomBlur.glsl.js";import{BloomBlurTechnique as c}from"./BloomBlurTechnique.js";import{BloomBlurTechniqueConfiguration as h}from"./BloomBlurTechniqueConfiguration.js";import{B as p}from"../../../../../chunks/BloomComposition.glsl.js";import{BloomCompositionTechnique as b}from"./BloomCompositionTechnique.js";import{BloomCompositionTechniqueConfiguration as _}from"./BloomCompositionTechniqueConfiguration.js";import{blurRadiusPresets as f,lodFactorsPresets as d,normalizePreset as g}from"./BloomPresets.glsl.js";import{RenderRequestType as P}from"../../lib/basicInterfaces.js";import{ColorAttachment1 as T,DepthStencilAttachment as R,FramebufferBit as C}from"../../../../webgl/enums.js";let j=class extends n{constructor(e){super(e),this.consumes={required:[a.TRANSPARENT_ENVIRONMENT,"emissive"]},this._blurHorizontalConfiguration=new h,this._blurVerticalConfiguration=new h,this._compositionConfiguration=new _,this._compositionParameters=new p,this._blurParameters=new l,this._blurScale=3.06,this._bloomResults=new Array}initialize(){this.addHandles([r((()=>this._updateFogParameters()),(()=>{}),o),r((()=>this.view.qualitySettings.bloom),(e=>{e?(this._enable(),this.precompile()):this._disable()}),o)])}destroy(){}_updateFogParameters(){const e=this.view.environment.weather;if("sunny"===e.type||"cloudy"===e.type)this._blurParameters.blurRadius=f[e.type];else{const r="foggy"===e.type?e.fogStrength:e.precipitation;this._blurParameters.blurRadius=t(f.cloudy,f[e.type],r)}this._compositionParameters.lodFactors=d[e.type].far,this._compositionParameters.lodFactorsFront=d[e.type].near,this.requestRender(P.UPDATE)}precompile(){this.techniques.precompile(c,this._blurHorizontalConfiguration),this._blurVerticalConfiguration.bloomStage=u.Vertical,this.techniques.precompile(c,this._blurVerticalConfiguration),this.techniques.precompile(b,this._compositionConfiguration)}render(e){const t=e.find((({name:e})=>e===a.TRANSPARENT_ENVIRONMENT)),r=t.getAttachment(T)?.attachment;if(!r)return t;const o=this.techniques.get(c,this._blurHorizontalConfiguration),s=this.techniques.get(c,this._blurVerticalConfiguration),i=this.techniques.get(b,this._compositionConfiguration);if(!o.compiled||!s.compiled||!i.compiled)return this.requestRender(P.UPDATE),t;const n=t.getTexture(),l=this.fboCache,{fullWidth:u,fullHeight:h}=this.bindParameters.camera,p=this.renderingContext;let _=r,f=u/2,d=h/2;const g=5,C=this._blurParameters.blurRadius;for(let a=0;a<g;a++){const e=l.acquire(f,d,"bloomHorizontal",m.RGBA16FLOAT);this._blurParameters.color=_,this._prepareFBO(e,f,d),p.bindTechnique(o,this.bindParameters,this._blurParameters),p.screen.draw();const t=l.acquire(f,d,"bloomVertical",m.RGBA16FLOAT);this._blurParameters.color=e.getTexture(),this._prepareFBO(t,f,d),p.bindTechnique(s,this.bindParameters,this._blurParameters),p.screen.draw(),e.release(),this._bloomResults[a]=t,f=Math.ceil(f/2),d=Math.ceil(d/2),_=this._bloomResults[a].getTexture(),this._blurParameters.blurRadius*=this._blurScale}this._blurParameters.blurRadius=C,this._compositionParameters.color=n,this._compositionParameters.emission=r,this._compositionParameters.bloomTexture0=this._bloomResults[0].getTexture(),this._compositionParameters.bloomTexture1=this._bloomResults[1].getTexture(),this._compositionParameters.bloomTexture2=this._bloomResults[2].getTexture(),this._compositionParameters.bloomTexture3=this._bloomResults[3].getTexture(),this._compositionParameters.bloomTexture4=this._bloomResults[4].getTexture();const j=this.acquireOutputFramebuffer();return this._prepareFBO(j,u,h),p.bindTechnique(i,this.bindParameters,this._compositionParameters),p.screen.draw(),this._bloomResults.forEach((e=>e.release())),j.attachDepth(t.getAttachment(R)),j.attachColor(t.getAttachment(T),T),j}_prepareFBO(e,t,r){const o=this.renderingContext;o.bindFramebuffer(e.fbo),o.setViewport(0,0,t,r),o.setClearColor(0,0,0,0),o.clear(C.COLOR)}get test(){return{compositionParameters:this._compositionParameters,blurParameters:this._blurParameters,setLodFactors:e=>{this._compositionParameters.lodFactors=g(e)}}}};e([s()],j.prototype,"consumes",void 0),j=e([i("esri.views.3d.webgl-engine.effects.bloom.BloomRenderNode")],j);export{j as BloomRenderNode};