@arcgis/core 4.23.0-next.20220127 → 4.23.0-next.20220128

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 (312) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/0463ba46df855a92b9c0.js +1 -0
  3. package/assets/esri/core/workers/chunks/{e657ba0cab29f05d02da.js → 0cd0a6eef51fc5b9ea61.js} +1 -1
  4. package/assets/esri/core/workers/chunks/{e4896cf85fb2da8a9cc7.js → 17de7a324dfa7f57ad5d.js} +1 -1
  5. package/assets/esri/core/workers/chunks/{c36f84daa7736878418d.js → 197ec52641aed20029c6.js} +1 -1
  6. package/assets/esri/core/workers/chunks/{0317f37b6c8705b363fd.js → 1c733b7db092a2a88ef3.js} +1 -1
  7. package/assets/esri/core/workers/chunks/{9387db408f496e7dd003.js → 214910032945dd2d86b0.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{d835b2a683fcd8aeeed8.js → 27474b007988855bea9d.js} +1 -1
  9. package/assets/esri/core/workers/chunks/{8001b0e514bfffe9d7f8.js → 357033117dfe61eb81ea.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{5948923e07bd1662c24a.js → 37c03cfc19086ce631c6.js} +1 -1
  11. package/assets/esri/core/workers/chunks/3c673495e5f507c4a9e5.js +1 -0
  12. package/assets/esri/core/workers/chunks/44f0c3663b293afbd172.js +1 -0
  13. package/assets/esri/core/workers/chunks/483d5d8593d96d0f0b15.js +1 -0
  14. package/assets/esri/core/workers/chunks/49a1a633bb0d93764aae.js +1 -0
  15. package/assets/esri/core/workers/chunks/{5f1dcb6556820cd0aa31.js → 4be35af7d6babbfe9d84.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{f9ff3eaf4eb324429fbd.js → 5457962a70bd3c557a75.js} +1 -1
  17. package/assets/esri/core/workers/chunks/57856b4a9b8784a69844.js +1 -0
  18. package/assets/esri/core/workers/chunks/{56274b37ff74ca0d68a6.js → 5d11b97b667921d67ae7.js} +1 -1
  19. package/assets/esri/core/workers/chunks/{ba5eb394f098968c22d2.js → 655b55ac0cd533d7e9d7.js} +1 -1
  20. package/assets/esri/core/workers/chunks/7903a3e2e0faff0f86c0.js +1 -0
  21. package/assets/esri/core/workers/chunks/918bb7a7d901544a7367.js +1 -0
  22. package/assets/esri/core/workers/chunks/949b2269457302ffc64b.js +1 -0
  23. package/assets/esri/core/workers/chunks/{601e697dc7414bda128a.js → 952980635afc7ec81804.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{e8741bf421f80213f1d3.js → 9876a1bae350795fab36.js} +1 -1
  25. package/assets/esri/core/workers/chunks/99619fcb772807c74f3b.js +1 -0
  26. package/assets/esri/core/workers/chunks/{3f343f792fd9f44d6f25.js → b3f5e91116112b0b612a.js} +1 -1
  27. package/assets/esri/core/workers/chunks/{4c76146014dc15143ba3.js → be588873c16770ceb9ef.js} +1 -1
  28. package/assets/esri/core/workers/chunks/d1fe53b597351dc58305.js +1 -0
  29. package/assets/esri/core/workers/chunks/{b62e3dccd9f662c0afeb.js → db3c729ce0c0b2690dc9.js} +1 -1
  30. package/assets/esri/core/workers/chunks/{199670a3a564ebe3bd79.js → e218bde41ffbcc5194f5.js} +1 -1
  31. package/assets/esri/core/workers/chunks/e21b211913aefde47e30.js +1 -0
  32. package/assets/esri/core/workers/chunks/{c9cbf8135e95f0f42cd9.js → e287f49184d076af17e2.js} +1 -1
  33. package/assets/esri/core/workers/chunks/{bde1d5b0a7717350986e.js → e4019b63a1fe74e2c842.js} +1 -1
  34. package/assets/esri/core/workers/chunks/{6e6a3c5866e8d8820457.js → eb82ff10cef2bde6e57f.js} +1 -1
  35. package/assets/esri/core/workers/chunks/ebc6f4764b82d4104c65.js +1 -0
  36. package/assets/esri/core/workers/chunks/{842db82733635dbf25cb.js → ee6e0db58dc64410e687.js} +1 -1
  37. package/assets/esri/core/workers/chunks/f0a9f161805fc7a30fc5.js +1 -0
  38. package/assets/esri/core/workers/chunks/ff6abdc72076f3994659.js +981 -0
  39. package/chunks/BlendLayers.glsl.js +2 -2
  40. package/chunks/ChapmanAtmosphere.glsl.js +17 -17
  41. package/chunks/CheckerBoard.glsl.js +3 -3
  42. package/chunks/Clouds.glsl.js +2 -2
  43. package/chunks/CloudsComposition.glsl.js +1 -1
  44. package/chunks/ColorMaterial.glsl.js +12 -12
  45. package/chunks/ComponentShader.glsl.js +3 -3
  46. package/chunks/Compositing.glsl.js +1 -1
  47. package/chunks/DefaultMaterial.glsl.js +33 -33
  48. package/chunks/EdgeShaderProgram.glsl.js +7 -7
  49. package/chunks/Fog.glsl.js +10 -12
  50. package/chunks/HUDMaterial.glsl.js +2 -2
  51. package/chunks/HighlightComposition.glsl.js +5 -5
  52. package/chunks/ImageMaterial.glsl.js +6 -6
  53. package/chunks/LaserlinePath.glsl.js +8 -8
  54. package/chunks/LineCallout.glsl.js +6 -6
  55. package/chunks/MeasurementArrow.glsl.js +1 -1
  56. package/chunks/NativeLine.glsl.js +1 -1
  57. package/chunks/Path.glsl.js +5 -5
  58. package/chunks/Pattern.glsl.js +9 -9
  59. package/chunks/PointRenderer.glsl.js +14 -14
  60. package/chunks/Precipitation.glsl.js +2 -2
  61. package/chunks/RealisticTree.glsl.js +21 -21
  62. package/chunks/RibbonLine.glsl.js +11 -11
  63. package/chunks/SMAA.glsl.js +40 -40
  64. package/chunks/ShadedColorMaterial.glsl.js +12 -12
  65. package/chunks/ShadowCast.glsl.js +6 -6
  66. package/chunks/ShadowHighlight.glsl.js +4 -4
  67. package/chunks/SimpleAtmosphere.glsl.js +3 -3
  68. package/chunks/SlicePlaneMaterial.glsl.js +3 -3
  69. package/chunks/Stars.glsl.js +3 -3
  70. package/chunks/Terrain.glsl.js +11 -11
  71. package/chunks/TextureOnly.glsl.js +2 -2
  72. package/chunks/WaterSurface.glsl.js +5 -5
  73. package/chunks/boundedPlane.js +1 -1
  74. package/core/accessorSupport/watch.js +1 -1
  75. package/core/loadAll.js +1 -1
  76. package/geometry/support/frustum.js +1 -1
  77. package/geometry/support/plane.js +1 -1
  78. package/interfaces.d.ts +204 -10
  79. package/layers/VectorTileLayer.js +1 -1
  80. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  81. package/layers/graphics/featureConversionUtils.js +1 -1
  82. package/layers/support/LayerContingentValuesCache.js +1 -1
  83. package/layers/support/TileInfo.js +1 -1
  84. package/package.json +1 -1
  85. package/smartMapping/statistics/support/predominanceUtils.d.ts +4 -0
  86. package/support/revision.js +1 -1
  87. package/symbols/FillSymbol3DLayer.js +1 -1
  88. package/symbols/IconSymbol3DLayer.js +1 -1
  89. package/symbols/ObjectSymbol3DLayer.js +1 -1
  90. package/symbols/Symbol3D.js +1 -1
  91. package/symbols/WebStyleSymbol.js +1 -1
  92. package/symbols/cim/CIMSymbolRasterizer.js +1 -1
  93. package/symbols/support/IconSymbol3DLayerResource.js +1 -1
  94. package/symbols/support/ObjectSymbol3DLayerResource.js +1 -1
  95. package/symbols/support/Symbol3DAnchorPosition2D.js +1 -1
  96. package/symbols/support/Symbol3DAnchorPosition3D.js +1 -1
  97. package/symbols/support/Symbol3DFillMaterial.js +1 -1
  98. package/symbols/support/Symbol3DIconOutline.js +1 -1
  99. package/symbols/support/Symbol3DOutline.js +1 -1
  100. package/symbols/support/Thumbnail.js +1 -1
  101. package/symbols/support/webStyleSymbolUtils.js +1 -1
  102. package/views/2d/engine/vectorTiles/SchemaHelper.js +1 -1
  103. package/views/3d/environment/ChapmanAtmosphere.glsl.js +1 -1
  104. package/views/3d/environment/ChapmanAtmosphere.js +1 -1
  105. package/views/3d/environment/CloudsComposition.glsl.js +1 -1
  106. package/views/3d/environment/CloudsGenerator.js +1 -1
  107. package/views/3d/environment/Fog.glsl.js +1 -1
  108. package/views/3d/environment/Fog.js +1 -1
  109. package/views/3d/environment/PanoramicAtmosphere.js +1 -1
  110. package/views/3d/environment/Precipitation.glsl.js +1 -1
  111. package/views/3d/environment/Precipitation.js +1 -1
  112. package/views/3d/environment/PrecipitationTechnique.js +1 -1
  113. package/views/3d/environment/SimpleAtmosphere.glsl.js +1 -1
  114. package/views/3d/environment/SimpleAtmosphere.js +1 -1
  115. package/views/3d/environment/Stars.glsl.js +1 -1
  116. package/views/3d/environment/Stars.js +1 -1
  117. package/views/3d/interactive/analysisTools/slice/sliceToolUtils.js +1 -1
  118. package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
  119. package/views/3d/interactive/visualElements/MeasurementAreaVisualElement.js +1 -1
  120. package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
  121. package/views/3d/interactive/visualElements/ParallelLineVisualElement.js +1 -1
  122. package/views/3d/interactive/visualElements/PointVisualElement.js +1 -1
  123. package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
  124. package/views/3d/layers/FeatureLayerViewBase3D.js +1 -1
  125. package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
  126. package/views/3d/layers/I3SMeshView3D.js +1 -1
  127. package/views/3d/layers/VectorTileLayerView3D.js +1 -1
  128. package/views/3d/layers/graphics/Deconflictor.js +1 -1
  129. package/views/3d/layers/graphics/ElevationAligners.js +1 -1
  130. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  131. package/views/3d/layers/graphics/Graphics3DFeatureProcessor.js +1 -1
  132. package/views/3d/layers/graphics/Graphics3DLineCalloutSymbolLayer.js +1 -1
  133. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  134. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  135. package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
  136. package/views/3d/layers/graphics/graphicUtils.js +1 -1
  137. package/views/3d/layers/graphics/lineUtils.js +1 -1
  138. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  139. package/views/3d/layers/graphics/polygonUtils.js +1 -1
  140. package/views/3d/layers/graphics/symbolComplexity.js +1 -1
  141. package/views/3d/layers/i3s/I3SBinaryReader.js +1 -1
  142. package/views/3d/layers/i3s/PointRenderer.js +1 -1
  143. package/views/3d/layers/support/HeatmapFeatureProcessor.js +5 -0
  144. package/views/3d/layers/support/overlayImageUtils.js +1 -1
  145. package/views/3d/layers/support/patternUtils.js +1 -1
  146. package/views/3d/state/controllers/local/PinchAndPanController.js +1 -1
  147. package/views/3d/support/FrustumExtentIntersection.js +1 -1
  148. package/views/3d/support/LaserLineRenderer.js +1 -1
  149. package/views/3d/support/LaserlinePathData.js +1 -1
  150. package/views/3d/terrain/OverlayRenderer.js +1 -1
  151. package/views/3d/terrain/PatchGeometryFactory.js +1 -1
  152. package/views/3d/terrain/TerrainRenderer.js +1 -1
  153. package/views/3d/terrain/TerrainSurface.js +1 -1
  154. package/views/3d/terrain/Tile.js +1 -1
  155. package/views/3d/terrain/terrainUtils.js +1 -1
  156. package/views/3d/terrain/tileUtils.js +1 -1
  157. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  158. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  159. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechnique.js +1 -1
  160. package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentData.glsl.js +10 -10
  161. package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentShader.glsl.js +1 -1
  162. package/views/3d/webgl-engine/collections/Component/SourceGeometry.js +1 -1
  163. package/views/3d/webgl-engine/core/renderPasses/AllRenderPasses.js +1 -1
  164. package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
  165. package/views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepth.glsl.js +2 -2
  166. package/views/3d/webgl-engine/core/shaderLibrary/ScreenSizeScaling.glsl.js +2 -2
  167. package/views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.js +2 -2
  168. package/views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js +2 -2
  169. package/views/3d/webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl.js +4 -4
  170. package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexPosition.glsl.js +1 -1
  171. package/views/3d/webgl-engine/core/shaderLibrary/attributes/PositionAttribute.glsl.js +1 -1
  172. package/views/3d/webgl-engine/core/shaderLibrary/attributes/RibbonVertexPosition.glsl.js +1 -1
  173. package/views/3d/webgl-engine/core/shaderLibrary/attributes/SymbolColor.glsl.js +1 -1
  174. package/views/3d/webgl-engine/core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js +3 -3
  175. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexColor.glsl.js +1 -1
  176. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexNormal.glsl.js +6 -6
  177. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexPosition.glsl.js +12 -12
  178. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexTextureCoordinates.glsl.js +4 -4
  179. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VerticalOffset.glsl.js +1 -1
  180. package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +16 -16
  181. package/views/3d/webgl-engine/core/shaderLibrary/default/RealisticTree.glsl.js +1 -1
  182. package/views/3d/webgl-engine/core/shaderLibrary/hud/HUD.glsl.js +5 -5
  183. package/views/3d/webgl-engine/core/shaderLibrary/hud/HUDOcclusionPass.glsl.js +3 -3
  184. package/views/3d/webgl-engine/core/shaderLibrary/raster/BasicGrid.glsl.js +2 -2
  185. package/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeMaterialColor.glsl.js +6 -6
  186. package/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeNormalTexture.glsl.js +2 -2
  187. package/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeShadingNormal.glsl.js +10 -11
  188. package/views/3d/webgl-engine/core/shaderLibrary/shading/LineStipple.glsl.js +2 -2
  189. package/views/3d/webgl-engine/core/shaderLibrary/shading/MultipassGeometryTest.glsl.js +2 -2
  190. package/views/3d/webgl-engine/core/shaderLibrary/shading/MultipassTerrainTest.glsl.js +2 -2
  191. package/views/3d/webgl-engine/core/shaderLibrary/shading/Normals.glsl.js +6 -6
  192. package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadBaseColorTexture.glsl.js +4 -4
  193. package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js +6 -6
  194. package/views/3d/webgl-engine/core/shaderLibrary/shading/Reprojection.glsl.js +4 -4
  195. package/views/3d/webgl-engine/core/shaderLibrary/shading/ScreenSpaceReflections.glsl.js +5 -5
  196. package/views/3d/webgl-engine/core/shaderLibrary/shading/VisualVariables.glsl.js +1 -1
  197. package/views/3d/webgl-engine/core/shaderLibrary/shading/Water.glsl.js +10 -10
  198. package/views/3d/webgl-engine/core/shaderLibrary/terrain/Terrain.glsl.js +1 -1
  199. package/views/3d/webgl-engine/core/shaderLibrary/util/BlendLayers.glsl.js +1 -1
  200. package/views/3d/webgl-engine/core/shaderLibrary/util/CloudsParallaxShading.glsl.js +4 -4
  201. package/views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js +1 -1
  202. package/views/3d/webgl-engine/lib/Camera.js +1 -1
  203. package/views/3d/webgl-engine/lib/DefaultVertexAttributeLocations.js +1 -1
  204. package/views/3d/webgl-engine/lib/DefaultVertexBufferLayouts.js +1 -1
  205. package/views/3d/webgl-engine/lib/Geometry.js +1 -1
  206. package/views/3d/webgl-engine/lib/GeometryUtil.js +1 -1
  207. package/views/3d/webgl-engine/lib/GridLocalOriginFactory.js +1 -1
  208. package/views/3d/webgl-engine/lib/MagnifierHelper.js +1 -1
  209. package/views/3d/webgl-engine/lib/Material.js +1 -1
  210. package/views/3d/webgl-engine/lib/RenderGeometry.js +1 -1
  211. package/views/3d/webgl-engine/lib/SSAOHelper.js +1 -1
  212. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  213. package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
  214. package/views/3d/webgl-engine/lib/SmaaRenderPass.js +1 -1
  215. package/views/3d/webgl-engine/lib/TextTextureAtlas.js +1 -1
  216. package/views/3d/webgl-engine/lib/Texture.js +1 -1
  217. package/views/3d/webgl-engine/lib/TextureUniformName.js +4 -0
  218. package/views/3d/webgl-engine/lib/UniformName.js +4 -0
  219. package/views/3d/webgl-engine/lib/VertexAttribute.js +5 -0
  220. package/views/3d/webgl-engine/lib/basicInterfaces.js +1 -1
  221. package/views/3d/webgl-engine/lib/depthRangeUtils.js +1 -1
  222. package/views/3d/webgl-engine/lib/edgeRendering/EdgeRenderer.js +1 -1
  223. package/views/3d/webgl-engine/lib/edgeRendering/EdgeShaderTechnique.js +1 -1
  224. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  225. package/views/3d/webgl-engine/lib/edgeRendering/bufferLayouts.js +1 -1
  226. package/views/3d/webgl-engine/lib/lodRendering/InstanceData.js +1 -1
  227. package/views/3d/webgl-engine/lib/lodRendering/RenderInstanceData.js +1 -1
  228. package/views/3d/webgl-engine/lib/pathGeometryUtils.js +1 -1
  229. package/views/3d/webgl-engine/materials/CheckerBoardMaterial.js +1 -1
  230. package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
  231. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  232. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  233. package/views/3d/webgl-engine/materials/ImageMaterial.js +1 -1
  234. package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
  235. package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
  236. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
  237. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  238. package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
  239. package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
  240. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  241. package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
  242. package/views/3d/webgl-engine/materials/SlicePlaneMaterial.js +1 -1
  243. package/views/3d/webgl-engine/materials/VisualVariableMaterialParameters.js +1 -1
  244. package/views/3d/webgl-engine/materials/WaterTechnique.js +1 -1
  245. package/views/3d/webgl-engine/materials/internal/DefaultBufferWriter.js +1 -1
  246. package/views/3d/webgl-engine/materials/internal/MaterialUtil.js +1 -1
  247. package/views/3d/webgl-engine/materials/internal/bufferWriterUtils.js +1 -1
  248. package/views/3d/webgl-engine/materials/internal/waterMaterialUtils.js +1 -1
  249. package/views/3d/webgl-engine/shaders/CheckerBoard.glsl.js +1 -1
  250. package/views/3d/webgl-engine/shaders/CheckerBoardTechnique.js +1 -1
  251. package/views/3d/webgl-engine/shaders/ColorMaterial.glsl.js +1 -1
  252. package/views/3d/webgl-engine/shaders/ColorMaterialTechnique.js +1 -1
  253. package/views/3d/webgl-engine/shaders/DefaultMaterial.glsl.js +1 -1
  254. package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
  255. package/views/3d/webgl-engine/shaders/HUDMaterial.glsl.js +1 -1
  256. package/views/3d/webgl-engine/shaders/HUDMaterialTechnique.js +1 -1
  257. package/views/3d/webgl-engine/shaders/HighlightComposition.glsl.js +1 -1
  258. package/views/3d/webgl-engine/shaders/HighlightTechnique.js +1 -1
  259. package/views/3d/webgl-engine/shaders/ImageMaterial.glsl.js +1 -1
  260. package/views/3d/webgl-engine/shaders/ImageMaterialTechnique.js +1 -1
  261. package/views/3d/webgl-engine/shaders/LaserlinePath.glsl.js +1 -1
  262. package/views/3d/webgl-engine/shaders/LaserlinePathTechnique.js +1 -1
  263. package/views/3d/webgl-engine/shaders/LineCallout.glsl.js +1 -1
  264. package/views/3d/webgl-engine/shaders/LineCalloutTechnique.js +1 -1
  265. package/views/3d/webgl-engine/shaders/Magnifier.glsl.js +1 -1
  266. package/views/3d/webgl-engine/shaders/MeasurementArrow.glsl.js +1 -1
  267. package/views/3d/webgl-engine/shaders/NativeLine.glsl.js +1 -1
  268. package/views/3d/webgl-engine/shaders/Pattern.glsl.js +1 -1
  269. package/views/3d/webgl-engine/shaders/PatternTechnique.js +1 -1
  270. package/views/3d/webgl-engine/shaders/PointRenderer.glsl.js +1 -1
  271. package/views/3d/webgl-engine/shaders/RealisticTreeTechnique.js +1 -1
  272. package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
  273. package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
  274. package/views/3d/webgl-engine/shaders/SMAA.glsl.js +1 -1
  275. package/views/3d/webgl-engine/shaders/ShadedColorMaterial.glsl.js +1 -1
  276. package/views/3d/webgl-engine/shaders/ShadedColorMaterialTechnique.js +1 -1
  277. package/views/3d/webgl-engine/shaders/ShadowCastTechnique.js +1 -1
  278. package/views/3d/webgl-engine/shaders/ShadowHighlightTechnique.js +1 -1
  279. package/views/3d/webgl-engine/shaders/SlicePlaneMaterial.glsl.js +1 -1
  280. package/views/3d/webgl-engine/shaders/WaterSurface.glsl.js +1 -1
  281. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/AdjustProjectedPosition.glsl.js +10 -10
  282. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/DiscardShortEdges.glsl.js +1 -1
  283. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/EdgeShaderProgram.glsl.js +1 -1
  284. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/EdgeUtil.glsl.js +21 -21
  285. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/LineAmplitude.glsl.js +6 -6
  286. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/LineOffset.glsl.js +13 -13
  287. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/UnpackAttributes.glsl.js +6 -6
  288. package/views/SceneView.js +1 -1
  289. package/views/interactive/editGeometry/operations/OffsetEdgeVertex.js +1 -1
  290. package/views/support/WatchUpdatingTracking.js +1 -1
  291. package/views/webgl/BufferObject.js +1 -1
  292. package/views/webgl/InstanceCounter.js +1 -1
  293. package/views/webgl/Program.js +1 -1
  294. package/widgets/BasemapGallery/support/basemapCompatibilityUtils.js +1 -1
  295. package/widgets/FeatureTemplates/FeatureTemplatesViewModel.js +1 -1
  296. package/widgets/Search/support/locatorUtils.js +1 -1
  297. package/widgets/Search.js +1 -1
  298. package/assets/esri/core/workers/chunks/12c0cabb6c59e65d8546.js +0 -1
  299. package/assets/esri/core/workers/chunks/322d917e8cb398816a93.js +0 -1
  300. package/assets/esri/core/workers/chunks/392b6382e06652dd4c80.js +0 -1
  301. package/assets/esri/core/workers/chunks/3aa73119b055e05bbbeb.js +0 -1
  302. package/assets/esri/core/workers/chunks/52ea678ba1da0e349919.js +0 -1
  303. package/assets/esri/core/workers/chunks/5ee497d5d7b0e580526a.js +0 -1
  304. package/assets/esri/core/workers/chunks/663ad15b86936eb06b69.js +0 -1
  305. package/assets/esri/core/workers/chunks/83b8fec1650e061aaa56.js +0 -1
  306. package/assets/esri/core/workers/chunks/9796d54ff12b6429164a.js +0 -1
  307. package/assets/esri/core/workers/chunks/d07440469fe7d181c4fd.js +0 -1
  308. package/assets/esri/core/workers/chunks/dbf192b4ce7e608610f6.js +0 -1
  309. package/assets/esri/core/workers/chunks/de6cff7b6cbbf99b20d1.js +0 -981
  310. package/assets/esri/core/workers/chunks/dee9929d95e9fe26929c.js +0 -1
  311. package/assets/esri/core/workers/chunks/e12d91ef44d6f879a02a.js +0 -1
  312. package/assets/esri/core/workers/chunks/e59764ee8cf25d4f74e2.js +0 -1
@@ -2,15 +2,15 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{DoublePrecision as o}from"../../../core/shaderLibrary/util/DoublePrecision.glsl.js";import{glsl as e}from"../../../core/shaderModules/interfaces.js";import{VertexAttribute as t}from"../../../lib/basicInterfaces.js";function n(n,r){const a=n.vertex;a.uniforms.add("uDistanceFalloffFactor","float"),a.code.add(e`float distanceBasedPerspectiveFactor(float distance) {
6
- return clamp(sqrt(uDistanceFalloffFactor / distance), 0.0, 1.0);
7
- }`),a.uniforms.add("uComponentDataTex","sampler2D"),a.uniforms.add("uComponentDataTexInvDim","vec2"),n.attributes.add(t.COMPONENTINDEX,"float"),a.constants.add("componentColorFieldOffset","float",0),a.constants.add("componentOtherFieldOffset","float",1),a.constants.add("componentFieldCount","float",2),a.constants.add("lineWidthFractionFactor","float",8),a.constants.add("extensionLengthOffset","float",128),a.constants.add("componentTexWidth","float",4096),a.code.add(e`vec2 _componentTextureCoords(float componentIndex, float fieldOffset) {
5
+ import{DoublePrecision as o}from"../../../core/shaderLibrary/util/DoublePrecision.glsl.js";import{glsl as e}from"../../../core/shaderModules/interfaces.js";import{VertexAttribute as t}from"../../../lib/VertexAttribute.js";function n(n,r){const a=n.vertex;a.uniforms.add("distanceFalloffFactor","float"),a.code.add(e`float distanceBasedPerspectiveFactor(float distance) {
6
+ return clamp(sqrt(distanceFalloffFactor / distance), 0.0, 1.0);
7
+ }`),a.uniforms.add("componentDataTex","sampler2D"),a.uniforms.add("componentDataTexInvDim","vec2"),n.attributes.add(t.COMPONENTINDEX,"float"),a.constants.add("componentColorFieldOffset","float",0),a.constants.add("componentOtherFieldOffset","float",1),a.constants.add("componentFieldCount","float",2),a.constants.add("lineWidthFractionFactor","float",8),a.constants.add("extensionLengthOffset","float",128),a.constants.add("componentTexWidth","float",4096),a.code.add(e`vec2 _componentTextureCoords(float componentIndex, float fieldOffset) {
8
8
  float fieldIndex = componentFieldCount * componentIndex + fieldOffset;
9
9
  float rowIndex = floor(fieldIndex / componentTexWidth);
10
10
  float colIndex = mod(fieldIndex, componentTexWidth);
11
11
  vec2 linearIndex = vec2(
12
12
  (colIndex + 0.5) / componentTexWidth,
13
- (rowIndex + 0.5) * uComponentDataTexInvDim.y
13
+ (rowIndex + 0.5) * componentDataTexInvDim.y
14
14
  );
15
15
  return linearIndex;
16
16
  }
@@ -23,8 +23,8 @@ float type;
23
23
  ComponentData readComponentData() {
24
24
  vec2 colorIndex = _componentTextureCoords(componentIndex, componentColorFieldOffset);
25
25
  vec2 otherIndex = _componentTextureCoords(componentIndex, componentOtherFieldOffset);
26
- vec4 colorValue = texture2D(uComponentDataTex, colorIndex);
27
- vec4 otherValue = texture2D(uComponentDataTex, otherIndex);
26
+ vec4 colorValue = texture2D(componentDataTex, colorIndex);
27
+ vec4 otherValue = texture2D(componentDataTex, otherIndex);
28
28
  return ComponentData(
29
29
  vec4(colorValue.rgb, colorValue.a * otherValue.w),
30
30
  otherValue.x * (255.0 / lineWidthFractionFactor),
@@ -32,39 +32,39 @@ otherValue.y * 255.0 - extensionLengthOffset,
32
32
  -(otherValue.z * 255.0) + 0.5
33
33
  );
34
34
  }`),r.legacy?a.code.add(e`vec3 _modelToWorldNormal(vec3 normal) {
35
- return (uModel * vec4(normal, 0.0)).xyz;
35
+ return (model * vec4(normal, 0.0)).xyz;
36
36
  }
37
37
  vec3 _modelToViewNormal(vec3 normal) {
38
- return (uView * uModel * vec4(normal, 0.0)).xyz;
39
- }`):(a.uniforms.add("uTransformNormal_GlobalFromModel ","mat3"),a.code.add(e`vec3 _modelToWorldNormal(vec3 normal) {
40
- return uTransformNormal_GlobalFromModel * normal;
38
+ return (view * model * vec4(normal, 0.0)).xyz;
39
+ }`):(a.uniforms.add("transformNormalGlobalFromModel","mat3"),a.code.add(e`vec3 _modelToWorldNormal(vec3 normal) {
40
+ return transformNormalGlobalFromModel * normal;
41
41
  }`)),r.silhouette?(n.attributes.add(t.NORMALA,"vec3"),n.attributes.add(t.NORMALB,"vec3"),a.code.add(e`vec3 worldNormal() {
42
42
  return _modelToWorldNormal(normalize(normalA + normalB));
43
43
  }`)):(n.attributes.add(t.NORMAL,"vec3"),a.code.add(e`vec3 worldNormal() {
44
44
  return _modelToWorldNormal(normal);
45
45
  }`)),r.legacy?a.code.add(e`vec3 worldFromModelPosition(vec3 position) {
46
- return (uModel * vec4(position, 1.0)).xyz;
46
+ return (model * vec4(position, 1.0)).xyz;
47
47
  }
48
48
  vec3 viewFromModelPosition(vec3 position) {
49
- return (uView * vec4(worldFromModelPosition(position), 1.0)).xyz;
49
+ return (view * vec4(worldFromModelPosition(position), 1.0)).xyz;
50
50
  }
51
51
  vec4 projFromViewPosition(vec3 position) {
52
- return uProj * vec4(position, 1.0);
52
+ return proj * vec4(position, 1.0);
53
53
  }`):(n.vertex.include(o,r),a.code.add(e`vec3 worldFromModelPosition(vec3 position) {
54
- vec3 rotatedModelPosition = uTransform_WorldFromModel_RS * position;
54
+ vec3 rotatedModelPosition = transformWorldFromModelRS * position;
55
55
  vec3 transform_CameraRelativeFromModel = dpAdd(
56
- uTransform_WorldFromModel_TL,
57
- uTransform_WorldFromModel_TH,
58
- -uTransform_WorldFromView_TL,
59
- -uTransform_WorldFromView_TH
56
+ transformWorldFromModelTL,
57
+ transformWorldFromModelTH,
58
+ -transformWorldFromViewTL,
59
+ -transformWorldFromViewTH
60
60
  );
61
61
  return transform_CameraRelativeFromModel + rotatedModelPosition;
62
62
  }
63
63
  vec3 viewFromModelPosition(vec3 position) {
64
- return uTransform_ViewFromCameraRelative_RS * worldFromModelPosition(position);
64
+ return transformViewFromCameraRelativeRS * worldFromModelPosition(position);
65
65
  }
66
66
  vec4 projFromViewPosition(vec3 position) {
67
- return uTransform_ProjFromView * vec4(position, 1.0);
67
+ return transformProjFromView * vec4(position, 1.0);
68
68
  }`)),a.code.add(e`float calculateExtensionLength(float extensionLength, float lineLength) {
69
69
  return extensionLength / (log2(max(1.0, 256.0 / lineLength)) * 0.2 + 1.0);
70
- }`)}!function(o){function e(e){return e.mode===o.Mode.SKETCH||e.mode===o.Mode.MIXED}function t(e){return e.mode===o.Mode.SOLID||e.mode===o.Mode.MIXED}var n;o.usesSketchLogic=e,o.usesSolidLogic=t,(n=o.Mode||(o.Mode={}))[n.SOLID=0]="SOLID",n[n.SKETCH=1]="SKETCH",n[n.MIXED=2]="MIXED",n[n.COUNT=3]="COUNT"}(n||(n={}));export{n as EdgeUtil};
70
+ }`)}function r(o){return o.mode===d.SKETCH||o.mode===d.MIXED}function a(o){return o.mode===d.SOLID||o.mode===d.MIXED}var d;!function(o){o[o.SOLID=0]="SOLID",o[o.SKETCH=1]="SKETCH",o[o.MIXED=2]="MIXED",o[o.COUNT=3]="COUNT"}(d||(d={}));export{n as EdgeUtil,d as EdgeUtilMode,r as usesSketchLogic,a as usesSolidLogic};
@@ -2,16 +2,16 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{glsl as e}from"../../../core/shaderModules/interfaces.js";import{EdgeUtil as t}from"./EdgeUtil.glsl.js";import{UnpackAttributes as r}from"./UnpackAttributes.glsl.js";function u(u,d){const a=u.vertex;switch(u.include(r,d),t.usesSketchLogic(d)&&a.uniforms.add("uStrokesAmplitude","float"),d.mode){case t.Mode.SOLID:a.code.add(e`float calculateLineAmplitude(UnpackedAttributes unpackedAttributes) {
5
+ import{glsl as e}from"../../../core/shaderModules/interfaces.js";import{usesSketchLogic as t,EdgeUtilMode as r}from"./EdgeUtil.glsl.js";import{UnpackAttributes as a}from"./UnpackAttributes.glsl.js";function d(d,s){const u=d.vertex;switch(d.include(a,s),t(s)&&u.uniforms.add("strokesAmplitude","float"),s.mode){case r.SOLID:u.code.add(e`float calculateLineAmplitude(UnpackedAttributes unpackedAttributes) {
6
6
  return 0.0;
7
- }`);break;case t.Mode.SKETCH:a.code.add(e`float calculateLineAmplitude(UnpackedAttributes unpackedAttributes) {
8
- return uStrokesAmplitude;
9
- }`);break;case t.Mode.MIXED:a.code.add(e`float calculateLineAmplitude(UnpackedAttributes unpackedAttributes) {
7
+ }`);break;case r.SKETCH:u.code.add(e`float calculateLineAmplitude(UnpackedAttributes unpackedAttributes) {
8
+ return strokesAmplitude;
9
+ }`);break;case r.MIXED:u.code.add(e`float calculateLineAmplitude(UnpackedAttributes unpackedAttributes) {
10
10
  float type = unpackedAttributes.type;
11
11
  if (type <= 0.0) {
12
- return uStrokesAmplitude;
12
+ return strokesAmplitude;
13
13
  }
14
14
  else {
15
15
  return 0.0;
16
16
  }
17
- }`)}}export{u as LineAmplitude};
17
+ }`)}}export{d as LineAmplitude};
@@ -2,37 +2,37 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{RgbaFloatEncoding as e}from"../../../core/shaderLibrary/util/RgbaFloatEncoding.glsl.js";import{glsl as t}from"../../../core/shaderModules/interfaces.js";import{EdgeUtil as a}from"./EdgeUtil.glsl.js";import{UnpackAttributes as r}from"./UnpackAttributes.glsl.js";function u(u,s){const c=u.vertex;u.include(r,s);const l=u.fragment;switch(a.usesSketchLogic(s)&&(c.uniforms.add("uStrokesTextureScale","vec2"),c.uniforms.add("uStrokesLog2Resolution","float"),c.uniforms.add("uStrokeVariants","float"),u.varyings.add("vStrokeUV","vec2"),l.uniforms.add("uStrokesTexture","sampler2D"),l.uniforms.add("uStrokesNormalizationScale","float"),c.code.add(t`void calculateStyleOutputsSketch(float lineLength, UnpackedAttributes unpackedAttributes) {
5
+ import{RgbaFloatEncoding as e}from"../../../core/shaderLibrary/util/RgbaFloatEncoding.glsl.js";import{glsl as t}from"../../../core/shaderModules/interfaces.js";import{usesSketchLogic as a,EdgeUtilMode as r}from"./EdgeUtil.glsl.js";import{UnpackAttributes as s}from"./UnpackAttributes.glsl.js";function l(l,c){const u=l.vertex;l.include(s,c);const o=l.fragment;switch(a(c)&&(u.uniforms.add("strokesTextureScale","vec2"),u.uniforms.add("strokesLog2Resolution","float"),u.uniforms.add("strokeVariants","float"),l.varyings.add("vStrokeUV","vec2"),o.uniforms.add("strokesTexture","sampler2D"),o.uniforms.add("strokesNormalizationScale","float"),u.code.add(t`void calculateStyleOutputsSketch(float lineLength, UnpackedAttributes unpackedAttributes) {
6
6
  vec2 sidenessNorm = unpackedAttributes.sidenessNorm;
7
- float lineIndex = clamp(ceil(log2(lineLength)), 0.0, uStrokesLog2Resolution);
8
- vStrokeUV = vec2(exp2(lineIndex) * sidenessNorm.y, lineIndex * uStrokeVariants + variantStroke + 0.5) * uStrokesTextureScale;
7
+ float lineIndex = clamp(ceil(log2(lineLength)), 0.0, strokesLog2Resolution);
8
+ vStrokeUV = vec2(exp2(lineIndex) * sidenessNorm.y, lineIndex * strokeVariants + variantStroke + 0.5) * strokesTextureScale;
9
9
  vStrokeUV.x += variantOffset;
10
- }`),u.fragment.include(e),l.code.add(t`float calculateLineOffsetSketch() {
11
- float offsetNorm = rgba2float(texture2D(uStrokesTexture, vStrokeUV));
12
- return (offsetNorm - 0.5) * uStrokesNormalizationScale;
10
+ }`),l.fragment.include(e),o.code.add(t`float calculateLineOffsetSketch() {
11
+ float offsetNorm = rgba2float(texture2D(strokesTexture, vStrokeUV));
12
+ return (offsetNorm - 0.5) * strokesNormalizationScale;
13
13
  }
14
14
  float calculateLinePressureSketch() {
15
- return rgba2float(texture2D(uStrokesTexture, vStrokeUV + vec2(0.0, 0.5)));
16
- }`)),s.mode){case a.Mode.SOLID:c.code.add(t`void calculateStyleOutputs(UnpackedAttributes unpackedAttributes) {}`),l.code.add(t`float calculateLineOffset() {
15
+ return rgba2float(texture2D(strokesTexture, vStrokeUV + vec2(0.0, 0.5)));
16
+ }`)),c.mode){case r.SOLID:u.code.add(t`void calculateStyleOutputs(UnpackedAttributes unpackedAttributes) {}`),o.code.add(t`float calculateLineOffset() {
17
17
  return 0.0;
18
18
  }
19
19
  float calculateLinePressure() {
20
20
  return 1.0;
21
- }`);break;case a.Mode.SKETCH:c.code.add(t`void calculateStyleOutputs(UnpackedAttributes unpackedAttributes)
21
+ }`);break;case r.SKETCH:u.code.add(t`void calculateStyleOutputs(UnpackedAttributes unpackedAttributes)
22
22
  {
23
23
  calculateStyleOutputsSketch(vLineLengthPixels, unpackedAttributes);
24
- }`),l.code.add(t`float calculateLineOffset() {
24
+ }`),o.code.add(t`float calculateLineOffset() {
25
25
  return calculateLineOffsetSketch();
26
26
  }
27
27
  float calculateLinePressure() {
28
28
  return calculateLinePressureSketch();
29
- }`);break;case a.Mode.MIXED:u.varyings.add("vType","float"),c.code.add(t`void calculateStyleOutputs(UnpackedAttributes unpackedAttributes)
29
+ }`);break;case r.MIXED:l.varyings.add("vType","float"),u.code.add(t`void calculateStyleOutputs(UnpackedAttributes unpackedAttributes)
30
30
  {
31
31
  vType = unpackedAttributes.type;
32
32
  if (unpackedAttributes.type <= 0.0) {
33
33
  calculateStyleOutputsSketch(vLineLengthPixels, unpackedAttributes);
34
34
  }
35
- }`),l.code.add(t`float calculateLineOffset() {
35
+ }`),o.code.add(t`float calculateLineOffset() {
36
36
  if (vType <= 0.0) {
37
37
  return calculateLineOffsetSketch();
38
38
  }
@@ -47,4 +47,4 @@ return calculateLinePressureSketch();
47
47
  else {
48
48
  return 1.0;
49
49
  }
50
- }`)}}export{u as LineOffset};
50
+ }`)}}export{l as LineOffset};
@@ -2,18 +2,18 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{glsl as e}from"../../../core/shaderModules/interfaces.js";import{VertexAttribute as t}from"../../../lib/basicInterfaces.js";import{EdgeUtil as n}from"./EdgeUtil.glsl.js";function s(s,i){const o=s.vertex;switch(s.include(n,i),s.attributes.add(t.SIDENESS,"vec2"),i.mode===n.Mode.MIXED?o.code.add(e`struct UnpackedAttributes {
5
+ import{neverReached as e}from"../../../../../../core/compilerUtils.js";import{glsl as t}from"../../../core/shaderModules/interfaces.js";import{VertexAttribute as n}from"../../../lib/VertexAttribute.js";import{EdgeUtil as s,EdgeUtilMode as i}from"./EdgeUtil.glsl.js";function o(o,d){const r=o.vertex;switch(o.include(s,d),o.attributes.add(n.SIDENESS,"vec2"),d.mode===i.MIXED?r.code.add(t`struct UnpackedAttributes {
6
6
  vec2 sideness;
7
7
  vec2 sidenessNorm;
8
8
  float lineWidthPixels;
9
9
  float extensionLengthPixels;
10
10
  float type;
11
- };`):o.code.add(e`struct UnpackedAttributes {
11
+ };`):r.code.add(t`struct UnpackedAttributes {
12
12
  vec2 sideness;
13
13
  vec2 sidenessNorm;
14
14
  float lineWidthPixels;
15
15
  float extensionLengthPixels;
16
- };`),i.mode){case n.Mode.MIXED:o.code.add(e`UnpackedAttributes unpackAttributes(ComponentData component) {
16
+ };`),d.mode){case i.MIXED:r.code.add(t`UnpackedAttributes unpackAttributes(ComponentData component) {
17
17
  vec2 sidenessNorm = sideness;
18
18
  vec2 sideness = sidenessNorm * 2.0 - 1.0;
19
19
  float fType = component.type;
@@ -23,17 +23,17 @@ if (fType <= 0.0) {
23
23
  extensionLengthPixels *= variantExtension * 2.0 - 1.0;
24
24
  }
25
25
  return UnpackedAttributes(sideness, sidenessNorm, lineWidth, extensionLengthPixels, fType);
26
- }`);break;case n.Mode.SKETCH:o.code.add(e`UnpackedAttributes unpackAttributes(ComponentData component) {
26
+ }`);break;case i.SKETCH:r.code.add(t`UnpackedAttributes unpackAttributes(ComponentData component) {
27
27
  vec2 sidenessNorm = sideness;
28
28
  vec2 sideness = sidenessNorm * 2.0 - 1.0;
29
29
  float extensionLengthPixels = component.extensionLength;
30
30
  extensionLengthPixels *= variantExtension * 2.0 - 1.0;
31
31
  float lineWidth = component.lineWidth;
32
32
  return UnpackedAttributes(sideness, sidenessNorm, lineWidth, extensionLengthPixels);
33
- }`);break;case n.Mode.SOLID:o.code.add(e`UnpackedAttributes unpackAttributes(ComponentData component) {
33
+ }`);break;case i.SOLID:r.code.add(t`UnpackedAttributes unpackAttributes(ComponentData component) {
34
34
  vec2 sidenessNorm = sideness;
35
35
  vec2 sideness = sidenessNorm * 2.0 - 1.0;
36
36
  float extensionLengthPixels = component.extensionLength;
37
37
  float lineWidth = component.lineWidth;
38
38
  return UnpackedAttributes(sideness, sidenessNorm, lineWidth, extensionLengthPixels);
39
- }`)}}export{s as UnpackAttributes};
39
+ }`);break;case i.COUNT:break;default:e(d.mode)}}export{o as UnpackAttributes};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import t from"../Camera.js";import"../geometry.js";import i from"../Graphic.js";import r from"../Ground.js";import s from"../Viewpoint.js";import n from"../core/Collection.js";import{byId as a}from"../core/domUtils.js";import o from"../core/Error.js";import{on as l}from"../core/events.js";import{handlesGroup as p,makeHandle as h}from"../core/handleUtils.js";import d from"../core/has.js";import{isIterable as c}from"../core/iteratorUtils.js";import u from"../core/Logger.js";import{destroyMaybe as g,isNone as m,isSome as f,unwrapOr as y}from"../core/maybe.js";import{ObservableChangesType as w}from"../core/ObservableChangesType.js";import{throwIfAborted as v}from"../core/promiseUtils.js";import{initial as _,syncAndInitial as b}from"../core/reactiveUtils.js";import{setFrameDuration as M}from"../core/scheduling.js";import{on as R,whenOnce as S,init as x,whenTrueOnce as V}from"../core/watchUtils.js";import{initialize as C}from"../core/workers/workers.js";import{screenPointObjectToArray as T,createScreenPoint as O,createScreenPointArray as P}from"../core/screenUtils.js";import{property as E}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import{cast as j}from"../core/accessorSupport/decorators/cast.js";import{subclass as I}from"../core/accessorSupport/decorators/subclass.js";import{ensureType as G}from"../core/accessorSupport/ensureType.js";import{c as H}from"../chunks/vec3f64.js";import L from"../geometry/HeightModelInfo.js";import{canProjectWithoutEngine as U,project as A,projectPointToVector as D,projectVectorToVector as F,projectBoundingRect as W}from"../geometry/projection.js";import{create as q,toExtent as z}from"../geometry/support/aaBoundingRect.js";import{B as k,a as N}from"../chunks/boundedPlane.js";import{renderSRFromViewSR as B}from"../geometry/support/coordinateSystem.js";import{getResolutionForScale as Q}from"../geometry/support/scaleUtils.js";import $ from"../layers/VoxelWasmManager.js";import{isTiledLayer as X}from"../layers/support/layerUtils.js";import{BreakpointsOwner as K}from"./BreakpointsOwner.js";import{DOMContainer as Z}from"./DOMContainer.js";import J from"./GroundView.js";import{PopupView as Y}from"./PopupView.js";import ee from"./View.js";import te from"./ViewAnimation.js";import{ViewingMode as ie,stringFromViewingMode as re,viewingModeFromString as se}from"./ViewingMode.js";import{layerView3DImporter as ne}from"./3d/layerViewModuleImportUtils.js";import ae from"./3d/analysis/AnalysisViewManager3D.js";import oe from"./3d/constraints/Constraints.js";import le from"./3d/environment/SceneViewEnvironment.js";import{SceneViewEnvironmentManager as pe}from"./3d/environment/SceneViewEnvironmentManager.js";import he from"./3d/input/SceneInputManager.js";import{GraphicsDeconflictor as de}from"./3d/layers/graphics/GraphicsDeconflictor.js";import{Labeler as ce}from"./3d/layers/graphics/Labeler.js";import{ObjectResourceCache as ue}from"./3d/layers/graphics/ObjectResourceCache.js";import ge from"./3d/layers/support/FeatureTileTree3D.js";import me from"./3d/state/ViewState.js";import fe from"./3d/state/ViewStateManager.js";import{SceneIntersectionHelper as ye}from"./3d/state/helpers/SceneIntersectionHelper.js";import{CombinedElevationProvider as we}from"./3d/support/CombinedElevationProvider.js";import ve from"./3d/support/debugFlags.js";import _e from"./3d/support/DisplayQualityProfile.js";import{getElevationAtPoint as be}from"./3d/support/ElevationProvider.js";import Me from"./3d/support/HighlightOptions.js";import{MapCoordsHelper as Re}from"./3d/support/MapCoordsHelper.js";import{PropertiesPool as Se}from"./3d/support/PropertiesPool.js";import xe from"./3d/support/QualitySettings.js";import{RenderCoordsHelper as Ve}from"./3d/support/RenderCoordsHelper.js";import{newResourceController as Ce}from"./3d/support/ResourceController.js";import Te from"./3d/support/SceneViewPerformanceInfo.js";import{SharedSymbolResources as Oe}from"./3d/support/SharedSymbolResources.js";import Pe from"./3d/support/pointsOfInterest/PointsOfInterest.js";import Ee from"./3d/terrain/TerrainSurface.js";import{isSurfaceLayerView as je,getTiledLayerInfo as Ie}from"./3d/terrain/terrainUtils.js";import{Stage as Ge}from"./3d/webgl-engine/Stage.js";import{newIntersector as He,DEFAULT_TOLERANCE as Le}from"./3d/webgl-engine/lib/Intersector.js";import{StoreResults as Ue,IntersectorType as Ae}from"./3d/webgl-engine/lib/IntersectorInterfaces.js";import{isValidIntersectorResult as De}from"./3d/webgl-engine/lib/intersectorUtils.js";import{toGraphic as Fe,toOwner as We}from"./3d/webgl-engine/lib/intersectorUtilsConversions.js";import{TERRAIN_ID as qe}from"./3d/webgl-engine/lib/verticalOffsetUtils.js";import{hitTestSelectSameDistance as ze}from"./support/hitTestSelectUtils.js";import{occludeesSupported as ke}from"./support/layerViewUtils.js";import{toRenderSettings as Ne,screenshotSuperSampleSettings as Be}from"./support/screenshotUtils.js";import{isSupportedScreenPointEvent as Qe,createScreenPointFromSupportedEvent as $e}from"./support/screenUtils.js";import{isSpatialReferenceSupported as Xe}from"./support/spatialReferenceSupport.js";import{check as Ke}from"./support/WebGLRequirements.js";import Ze from"./ui/3d/DefaultUI3D.js";import Je from"../webscene/Environment.js";import Ye from"../geometry/Extent.js";import et from"../geometry/SpatialReference.js";import tt from"../geometry/Point.js";const it=u.getLogger("esri.views.SceneView");let rt=class extends(K(Z(Y(ee)))){constructor(e){super(e),this._userClippingArea=null,this._clippingArea=null,this._initialDefaultSpatialReference=null,this._defaults={},this._externallySet={environment:!1},this._createGraphicsViewController=null,this._resolveWhenReady=[],this.propertiesPool=new Se({slicePlane:k},this),this._resourceController=Ce(this),this._defaultToMapOptions={include:new Set},this._defaultHitTestOptions={exclude:new Set},this.deconflictor=new de({view:this}),this.labeler=new ce({view:this,deconflictor:this.deconflictor.labels}),this.sharedSymbolResources=null,this.basemapTerrain=null,this.elevationProvider=null,this.camera=null,this.canvas=null,this.center=null,this.constraints=new oe,this.environmentManager=new pe,this.extent=null,this.floors=new n,this.windowDevicePixelRatio=1,this.fullOpacity=1,this.graphicsView=null,this.analysisViewManager=new ae({view:this}),this.groundView=null,this.navigating=!1,this.map=null,this.screenSizePerspectiveEnabled=!0,this.state=new me,this.scale=null,this.spatialReference=null,this.alphaCompositingEnabled=!1,this.supersampleScreenshotsEnabled=!0,this.type="3d",this.ui=new Ze,this._numUpdating=0,this._lastUpdateTime=0,this.updatingProgress=.5,this.viewpoint=null,this.zoom=null,this.highlightOptions=new Me,C(),e&&e.environment||(this._defaults.environment=new le,this.environment=this._defaults.environment);const t=e=>{f(e)&&e.type===w.MOVE||(this._updatingChanged(),this.map&&this.map.allLayers.forEach((async e=>{try{await e.when()}catch{}this._updatingChanged()})))};this.handles.add([R(this,"map.allLayers","after-changes",t,t,t,!0),this.allLayerViews.on("after-changes",(e=>this._updateUpdatingMonitors(e))),this.watch("map",(e=>{e&&e.load&&e.load().catch((()=>{}))}))]),this.inputManager=new he({view:this});const i=()=>{const e=window.devicePixelRatio;e!==this.windowDevicePixelRatio&&(this.windowDevicePixelRatio=e,this.notifyChange("pixelRatio"))};this.stateManager=new fe({view:this,updateDevicePixelRatio:i})}initialize(){this.groundView=new J({view:this}),this._updateUpdatingMonitors();const e=()=>this._updateDefaultToMapOptions();this.handles.add(R(this,"map.allLayers","after-changes",e,e,e)),this.updatingHandles.add((()=>this.qualitySettings.memoryLimit),(e=>{this.resourceController&&(this.resourceController.memoryController.maxMemory=e)}),_),this.updatingHandles.add((()=>this.qualitySettings.additionalCacheMemory),(e=>{this.resourceController&&(this.resourceController.memoryController.additionalCacheMemory=e)}),_),this.updatingHandles.add((()=>this.qualitySettings.frameRate),(e=>M(e>0?1e3/Math.ceil(e):0)),_),this.updatingHandles.add((()=>ve.SCENEVIEW_LOCKING_LOG),(e=>this.defaultsFromMap.logDebugInformation=e),_),this.updatingHandles.add((()=>{var e;return null==(e=this.map)?void 0:e.ground}),e,b),this.updatingHandles.add((()=>{var e,t;return null==(e=this.map)||null==(t=e.ground)?void 0:t.opacity}),(()=>this._updateDefaultHitTestOptions()),b),this.handles.add(this.watch("spatialReference",(()=>this.notifyChange("clippingArea")),!0))}destroy(){this.destroyed||(this.invalidate(),this.activeTool=null,this.layerViewManager.clear(),this._exitSurface(),this._disposeGraphicsView(),this.sharedSymbolResources=g(this.sharedSymbolResources),this.labeler.destroy(),this._set("labeler",null),this.deconflictor.destroy(),this._set("deconflictor",null),this._resourceController=g(this._resourceController),this.stateManager.destroy(),this._set("stateManager",null),this.inputManager.destroy(),this._set("inputManager",null),this.propertiesPool.destroy(),this.handles.remove("updatingMonitors"),this.environmentManager.destroy(),this._set("environmentManager",null),this.groundView=g(this.groundView))}get renderSpatialReference(){return this.renderCoordsHelper&&this.renderCoordsHelper.spatialReference}get basemapSpatialReference(){return this.basemapTerrain&&this.basemapTerrain.spatialReference}installContentCameraReset(e={sticky:!1}){return this.stateManager.installContentCameraReset(e)}get clippingArea(){if("global"===this.viewingMode)return null;let e=this._userClippingArea||this.get("map.clippingArea");return!(!!this._userClippingArea||this.get("map.clippingEnabled"))||m(e)?(this._clippingArea=null,null):e instanceof Ye?this.spatialReference&&(e=at(e,this.spatialReference),m(e))?(it.error("#clippingArea","setting clippingArea with incompatible SpatialReference"),this._clippingArea):(e=e.clone(),m(e.intersection(this.groundAndLayersExtent))&&(e.xmin=e.xmax,e.ymin=e.ymax),e.zmin=void 0,e.zmax=void 0,e.equals(this._clippingArea)||(this._clippingArea=e),this._clippingArea):(it.error("#clippingArea","only clippingArea geometries of type Extent are supported"),this._clippingArea)}set clippingArea(e){this.ready&&"global"===this.viewingMode&&f(e)?it.error("#clippingArea=","Clipping area is only supported in local viewingMode"):this._userClippingArea=e}get renderDataExtent(){if(this.state.viewingMode===ie.Global)return null;const e=this.renderSpatialReference,t=this.dataExtent;return m(t)||m(e)||t.spatialReference.equals(e)?t:at(t,e)}get dataExtent(){let e=this.groundAndLayersExtent;const t=this.spatialReference||et.WGS84,i=at(this.clippingArea,t);f(i)&&(e=f(e)?e.intersection(i):i);const r=this._get("dataExtent");return f(e)&&e.equals(r)?r:e}get groundAndLayersExtent(){const e=this.spatialReference||et.WGS84;let t;const i=i=>{const r=at(i,e);m(r)||(f(t)?t.union(r):t=r.clone())},r=this.basemapTerrain;if(null!=r&&r.spatialReference){const e=r.groundExtent;i(new Ye({xmin:e[0],ymin:e[1],zmin:0,xmax:e[2],ymax:e[3],zmax:0,spatialReference:r.spatialReference}))}if(this.map){const e=e=>{!f(e.fullExtent)||"graphics"===e.type&&e.internal||i(e.fullExtent)};this.map.allLayers.forEach((t=>e(t)))}if(m(t))return null;t.hasZ?(t.zmin=Math.min(0,t.zmin),t.zmax=Math.max(0,t.zmax)):(t.zmin=0,t.zmax=0);const s=this._get("groundAndLayersExtent");return t.equals(s)?s:t}set environment(e){e!==this._defaults.environment&&(this._externallySet.environment=!0),this._set("environment",e)}castEnvironment(e){return e?e instanceof le?e:e instanceof Je?null!=this.environment?this.environment.cloneWithWebsceneEnvironment(e):le.fromWebsceneEnvironment(e):G(le,e):new le}get pixelRatio(){return Math.min(this.windowDevicePixelRatio,this.maximumPixelRatio)}set pixelRatio(e){f(e)?this._override("pixelRatio",e):this._clearOverride("pixelRatio")}get maximumPixelRatio(){let e=1/0;const{maximumPixelRatio:t,maximumRenderResolution:i}=this.qualitySettings;if(null!=t&&(e=Math.min(e,t)),null!=i){const t=i/Math.max(this.width,this.height);e=Math.min(e,t)}return e}set maximumPixelRatio(e){f(e)?this._override("maximumPixelRatio",e):this._clearOverride("maximumPixelRatio")}get initialExtentRequired(){return this.stateManager&&!this.stateManager.hasInitialView}get _defaultsFromMapSettings(){return{required:{tileInfo:!1,heightModelInfo:!0,extent:!1}}}get interacting(){return this.navigating||f(this.activeTool)}get stationary(){return!this.animation&&!this.resizing&&(m(this.state)||this.state.stationary)}set qualityProfile(e){_e.isValidProfile(e)&&(_e.apply(e,this.qualitySettings),this._set("qualityProfile",e))}get qualityProfile(){return this._get("qualityProfile")||_e.getDefaultProfile()}set slicePlane(e){if(f(this._stage)&&this._stage.renderView.setRenderParameters({slicePlane:e}),m(e))return void this._set("slicePlane",null);const t=this.propertiesPool.get("slicePlane");N(e,t),this._set("slicePlane",t)}get typeSpecificPreconditionsReady(){return!!this.viewingMode}get resolution(){return null!=this.spatialReference?Q(this.scale,this.spatialReference):0}get heightModelInfo(){const e=this.getDefaultHeightModelInfo();return null!=e?L.deriveUnitFromSR(e,this.spatialReference):null}get updating(){var e,t,i;if(this.destroyed)return!1;let r=0,s=this.layerViewManager.updating,n=s?this.layerViewManager.updatingRemaining:0;this.allLayerViews.forEach((e=>{if(e.isFulfilled()){if(e.updating){if(s=!0,e.suspended||je(e))return;++n,r+=e.updatingProgress}}else++n}));for(const a of[this.graphicsView,this.basemapView,this._resourceController,this._stage,this.featureTiles,this.pointsOfInterest,this.environmentManager,this.overlay,this.featureTreeDebugger,this.toolViewManager,this.analysisViewManager])if(f(a)&&a.updating){const e=.1;n+=e,r+=.5*e}for(const a of[this.deconflictor,this.labeler,this.basemapTerrain])f(a)&&a.updating&&(++n,r+=a.updatingProgress);if(s=!!(s||n>0||this.updatingHandles.updating||!this.ready||!this.stationary||this._createGraphicsViewController||null!=(e=this.inputManager)&&e.hasPendingInputs||null!=(t=this.map)&&null!=(i=t.allLayers)&&i.some((e=>!e.isFulfilled()))),s?(this._numUpdating=Math.max(n,this._numUpdating),r+=this._numUpdating-n):this._numUpdating=0,this._numUpdating>0?r/=this._numUpdating:r=s?0:1,this._get("updatingProgress")!==r){const e=this._resourceController.scheduler.now;if(r<1){const t=Math.min((e-this._lastUpdateTime)/2e3,1);r=this.updatingProgress*(1-t)+r*t}this._set("updatingProgress",r),this._lastUpdateTime=s&&r<1?e:0}return s}get viewingMode(){var e;const t=this._predeterminedViewingMode;if(f(t))return re(t);const i=this.spatialReference;return f(null==(e=this.defaultsFromMap)?void 0:e.viewingMode)&&i&&i.equals(this.defaultsFromMap.spatialReference)?re(this.defaultsFromMap.viewingMode):!i||Xe(i,ie.Global)?"global":"local"}set viewingMode(e){this.ready?it.error("#viewingMode","viewingMode cannot be set once view is ready"):e?this._override("viewingMode",e):void 0===e&&this._clearOverride("viewingMode")}get resourceController(){return this._resourceController}get performanceInfo(){return new Te(this)}forceAnimationTime(e){this._stage.renderView.forcedAnimationTime=this.basemapTerrain.overlayManager.forcedAnimationTime=e}on(e,t,i,r){const s=this.viewEvents.on(e,t,i,r);return s||super.on(e,t)}hasEventListener(e){return super.hasEventListener(e)||this.viewEvents.hasHandler(e)}toMap(e,t){if(!this.ready)return it.error("#toMap()","Scene view cannot be used before it is ready"),null;const i=t?this.externalToInternalIntersectOptions(t):this._defaultToMapOptions,r=f(i.graphics)&&(f(i.graphics.include)||f(i.graphics.exclude)),s=Qe(e)?$e(this,e):e,n=T(s);i.enableDraped=i.include&&!i.include.has(qe)||i.exclude&&i.exclude.has(qe);const a=this.sceneIntersectionHelper,o=He(this.state.viewingMode);if(o.options.selectionMode=!0,o.options.store=r?Ue.ALL:Ue.MIN,a.intersectIntersectorScreen(n,o,i),r){for(const e of o.results.all){const t=Fe(e,this);if(m(t))return this._intersectResultToMapPoint(e);if(this._testGraphicUidFilter(i.graphics,t))return this._intersectResultToMapPoint(e)}return null}return this._intersectResultToMapPoint(o.results.min)}toScreen(e){if(!this.ready)return it.error("#toScreen()","Scene view cannot be used before it is ready"),null;const t=y(null==e.z&&be(this.elevationProvider,e),0);return D(e,lt,this.renderSpatialReference,t),this.state.camera.projectToScreen(lt,pt),O(pt[0],pt[1])}pixelSizeAt(e){return this.ready?e?(D(e,lt,this.renderSpatialReference),this.state.camera.computeScreenPixelSizeAt(lt)):0:(it.error("#pixelSizeAt()","Scene view cannot be used before it is ready"),null)}overlayPixelSizeInMapUnits(e){const t=this.basemapTerrain.overlayManager;return t?t.overlayPixelSizeInMapUnits(e):1}hitTest(e,t){if(!this.ready)return it.error("#hitTest()","Scene view cannot be used before it is ready"),null;const i=Qe(e)?$e(this,e):e,r=P(i.x,i.y),s=t?this.externalToInternalIntersectOptions(t):this._defaultHitTestOptions;s.requiresGroundFeedback=!0,s.enableDraped=!0;const n=He(this.state.viewingMode);n.options.selectionMode=!0,n.options.store=Ue.ALL,this.sceneIntersectionHelper.intersectIntersectorScreen(r,n,s);const a=this._intersectResultsToHits(n.results.all,s.graphics),o=n.results.ground,l=We(o,this),p=f(l)&&"type"in l&&"integrated-mesh"===l.type?l:null,h={screenPoint:i,results:a,ground:{mapPoint:this._intersectResultToMapPoint(o),distance:De(o)?o.distanceInRenderSpace:0,layer:p}};return ve.SCENEVIEW_HITTEST_RETURN_INTERSECTOR&&(h.intersector=n),Promise.resolve(h)}popupHitTest(e){return ze(this,e).then((({results:t,ground:i})=>{let r=null;return!(0===t.length||Math.abs(y(t[0].distance,0)-i.distance)<1e-5)||i.layer&&"integrated-mesh"===i.layer.type||(r=i.mapPoint),{results:t,screenPoint:e,mapPoint:r}}))}goTo(e,t){return this.updatingHandles.addPromise(this.stateManager.goTo(e,t))}async whenAnalysisView(e){if(m(e.parent))throw new o("view:no-analysisview-for-analysis","The analysis has not been added to an AnalysisLayer or SceneView.analyses",{analysis:e});if("analysis"===e.parent.type){return(await this.whenLayerView(e.parent)).whenAnalysisView(e)}return this.analysisViewManager.whenAnalysisView(e)}whenLayerView(e){return super.whenLayerView(e)}takeScreenshot(e){return this.whenReady().then((()=>{const t=Ne(e,this);return t.pixelRatio/=this.pixelRatio,this._stage.renderView.takeScreenshot(Be(t,this.supersampleScreenshotsEnabled,this.padding))}))}addUpdatingPromise(e){return this.updatingHandles.addPromise(e)}importLayerView(e){return ne.importLayerView(e)}hasLayerViewModule(e){return ne.hasLayerViewModule(e)}forceDOMReadyCycle(){this.forceReadyCycle()}getDefaultSpatialReference(){var e,t,i,r;return this.map&&"initialViewProperties"in this.map&&(null==(e=this.map)||null==(t=e.initialViewProperties)?void 0:t.spatialReference)||(null==(i=this.defaultsFromMap)?void 0:i.spatialReference)||(null==(r=this.defaultsFromMap)?void 0:r.ready)&&this._initialDefaultSpatialReference||null}async validate(){let e=Ke(this.type);if(d("safari")&&d("safari")<9&&(e=new o("sceneview:browser-not-supported","This browser is not supported by SceneView (Safari < 9)",{type:"safari",requiredVersion:9,detectedVersion:d("safari")})),f(e))throw it.warn("#validate()",e.message),e}get _predeterminedViewingMode(){var e,t;const i=this._isOverridden("viewingMode")?this._get("viewingMode"):null!=(e=this.map&&"initialViewProperties"in this.map?null==(t=this.map.initialViewProperties)?void 0:t.viewingMode:null)?e:null;return f(i)?se(i):null}getSpatialReferenceSupport({spatialReference:e,layer:t}){const i=this._predeterminedViewingMode;if(f(i))return this._validateSpatialReferenceForViewingMode(e,t,i)?{constraints:this._makeSpatialReferenceConstraints(e,t,i)}:null;const r=this._validateSpatialReferenceForViewingMode(e,t,ie.Local),s=this._validateSpatialReferenceForViewingMode(e,t,ie.Global);return r||s?r&&s?{constraints:this._makeSpatialReferenceConstraints(e,t,null)}:r?{constraints:this._makeSpatialReferenceConstraints(e,t,ie.Local)}:{constraints:this._makeSpatialReferenceConstraints(e,t,ie.Global)}:null}_validateSpatialReferenceForViewingMode(e,t,i){return!!Xe(e,i)&&(!!m(t)||(!X(t)||!m(Ie(t,e,i)))&&("voxel"!==t.type||i===ie.Local))}_makeSpatialReferenceConstraints(e,t,i){return t&&!X(t)&&"voxel"!==t.type&&(e.isWebMercator||e.isWGS84)?[{spatialReference:e,viewingMode:i},{spatialReference:e.isWebMercator?et.WGS84:et.WebMercator,viewingMode:i}]:t&&X(t)&&e.isWebMercator&&i!==ie.Global?[{spatialReference:e,viewingMode:i},{spatialReference:et.WGS84,viewingMode:ie.Local}]:[{spatialReference:e,viewingMode:i}]}_validateSpatialReference(e){const t=f(this.getSpatialReferenceSupport({spatialReference:e})),i=this._predeterminedViewingMode;return t||(f(i)?it.warnOnce(`Spatial reference defined on view not supported in ${re(i)} viewing mode.`):e.isGeographic&&it.warnOnce("Spatial reference is geographic but not supported.")),t}whenReady(){return new Promise((e=>{this.ready?e(this):this._resolveWhenReady.push(e)}))}computeMapPointFromVec3d(e,t){let i=this.spatialReference||et.WGS84;return F(e,this.renderSpatialReference,e,i)||(i=et.WGS84,F(e,this.renderSpatialReference,e,i)),t?(t.x=e[0],t.y=e[1],t.z=e[2],t.spatialReference=i):t=new tt(e,i),t}trackGraphicState(e){if(!e.graphic)return it.error("trackGraphicState","GraphicState.graphic must not be null or undefined to start tracking"),null;const t=this.getViewForGraphic(e.graphic);let i=null,r=!1;const s=t=>{!r&&f(t)&&"processor"in t&&t.processor&&t.processor.graphicsCore&&(i=t.processor.graphicsCore.trackGraphicState(e))};return f(t)?s(t):this.whenViewForGraphic(e.graphic,{waitForLayer:!0}).then((e=>s(e)),(()=>{})).catch((()=>{})),{remove:()=>{r=!0,f(i)&&(i.remove(),i=null)}}}highlight(e){if(Array.isArray(e))return p(e.map((e=>this.highlight(e))));if(n.isCollection(e))return p(e.toArray().map((e=>this.highlight(e))));const t=this.getViewForGraphic(e);return t&&"highlight"in t?t.highlight(e):h()}maskOccludee(e){if(!e)return it.error("maskOccludee","GraphicState.graphic must not be null or undefined to mask an occludee"),null;const t=this.getViewForGraphic(e);let i=null,r=!1;const s=t=>{!r&&f(t)&&ke(t)&&(i=t.maskOccludee(e))};return f(t)?s(t):this.whenViewForGraphic(e,{waitForLayer:!0}).then((e=>s(e)),(()=>{})).catch((()=>{})),{remove:()=>{r=!0,f(i)&&(i.remove(),i=null)}}}getViewForGraphic(e){return e.layer===this.graphics?this.graphicsView:e.layer?this.allLayerViews.find((t=>t.layer===e.layer)):null}graphicChanged(e){f(this.graphicsView)&&this.graphicsView.graphicChanged(e)}async whenViewForGraphic(e,t){if(e.layer===this)return await S(this,"graphicsView"),this.graphicsView;if(!e.layer||!this.map)throw new o("no-view-for-graphic");return t&&t.waitForLayer&&!this.map.allLayers.includes(e.layer)?new Promise(((t,i)=>{const r=this.map.allLayers.on("change",(s=>{-1!==s.added.indexOf(e.layer)&&(r.remove(),this.whenLayerView(e.layer).then(t,i))}))})):this.whenLayerView(e.layer)}externalToInternalIntersectOptions(e){const t=this._externalToInternalRenderItems(e.include,ot.INCLUDE),i=this._externalToInternalRenderItems(e.exclude,ot.EXCLUDE);return{include:t.layerUids,exclude:i.layerUids,graphics:{include:t.graphicUids,exclude:i.graphicUids}}}_intersectResultToMapPoint(e,t){return e.getIntersectionPoint(lt)?(t=this.computeMapPointFromVec3d(lt,t),e.intersector===Ae.TERRAIN&&this.basemapTerrain&&(t.z=y(be(this.basemapTerrain,t),0)),t):null}_intersectResultsToHits(e,t){const i=new Array;let r=null;for(let s=0;s<e.length;s++){const n=e[s],a=We(n,this);if(f(a)&&(a===this.map.ground||"type"in a&&"integrated-mesh"===a.type))break;const o=Fe(n,this);if(!f(o))continue;if(m(r)&&s!==e.length-1&&(r=new Set),f(r)){const e=this._getGraphicFilterUid(o);if(r.has(e))continue;r.add(e)}if(!this._testGraphicUidFilter(t,o))continue;const l=this._intersectResultToMapPoint(n),p=n.distanceInRenderSpace;i.push({graphic:o,mapPoint:l,distance:p})}return i}_getGraphicFilterUid(e){if(e.layer&&"objectIdField"in e.layer){const t=e.attributes[e.layer.objectIdField];if(t)return`o-${e.layer.id}-${t}`}return`u-${e.uid}`}_testGraphicUidFilter(e,t){const i=this._getGraphicFilterUid(t);return m(e)||(m(e.include)||e.include.has(i))&&(m(e.exclude)||!e.exclude.has(i))}_externalToInternalRenderItems(e,t,s={layerUids:null,graphicUids:null}){if(!e)return s;if(e instanceof i)nt(s,this._getGraphicFilterUid(e)),t===ot.INCLUDE&&(f(this.graphicsView)&&e.layer===this?st(s,this.graphicsView.processor.layer.id):e.layer&&st(s,e.layer.uid));else if(c(e))for(const i of e)i===this.graphics&&f(this.graphicsView)?st(s,this.graphicsView.processor.layer.id):i instanceof r?i===this.map.ground&&st(s,qe):this._externalToInternalRenderItems(i,t,s);else st(s,e.uid);return s}_initBasemapTerrain(){this._set("basemapTerrain",new Ee({view:this})),this._set("elevationProvider",new we({view:this})),this.elevationProvider.register("ground",this.basemapTerrain)}_exitBasemapTerrain(){this.basemapTerrain&&(this.elevationProvider.unregister(this.basemapTerrain),this.elevationProvider.destroy(),this._set("elevationProvider",null),this.basemapTerrain.destroy(),this._set("basemapTerrain",null))}_initGlobe(){this._initCoordinateSystem(),this.state.createInitialCamera(),this._initBasemapTerrain(),this._set("pointsOfInterest",new Pe({view:this})),this._set("featureTiles",new ge({renderCoordsHelper:this.renderCoordsHelper,cameraOnSurface:this.pointsOfInterest.contentCameraOnSurface,focus:this.pointsOfInterest.focus,tilingSchemeOwner:this.basemapTerrain,viewState:this.state,scheduler:this._resourceController.scheduler,terrain:this.basemapTerrain}));const e=()=>{const e=this.basemapTerrain&&this.basemapTerrain.extent;if(this.clippingArea||e)if(e&&this.basemapTerrain.spatialReference){const e=f(this.basemapTerrain.extent)?A(z(this.basemapTerrain.extent,this.basemapTerrain.spatialReference),this.spatialReference):null;f(this.clippingArea)?this.featureTiles.filterExtent=this.clippingArea.intersection(e):this.featureTiles.filterExtent=e}else this.featureTiles.filterExtent=this.clippingArea;else this.featureTiles.filterExtent=null};this.handles.add([this.updatingHandles.add((()=>ve.FEATURE_TILE_TREE_SHOW_TILES),(e=>{e&&this.featureTiles&&!this.featureTreeDebugger?this.updatingHandles.addPromise(import("./3d/layers/support/FeatureTileTree3DDebugger.js")).then((({FeatureTileTree3DDebugger:e})=>{!this.featureTreeDebugger&&ve.FEATURE_TILE_TREE_SHOW_TILES&&(this.featureTreeDebugger=new e({view:this}))})):e||!this.featureTreeDebugger||ve.FEATURE_TILE_TREE_SHOW_TILES||(this.featureTreeDebugger.destroy(),this.featureTreeDebugger=null)}),b),this.updatingHandles.add((()=>this.clippingArea),e,b),this.updatingHandles.add((()=>this.basemapTerrain.extent),e,b)],"feature-tiles"),this.stateManager.init()}_exitGlobe(){this.state&&(this.stateManager.deinit(),this.handles.remove("render-coords-helper"),this.handles.remove("feature-tiles"),this.featureTiles.destroy(),this._set("featureTiles",null),this.pointsOfInterest.destroy(),this._set("pointsOfInterest",null),this._exitBasemapTerrain(),this.state.exit(),this._exitCoordinateSystem())}_initCoordinateSystem(){if(this.spatialReference){const e=this.spatialReference;this.mapCoordsHelper&&this.mapCoordsHelper.spatialReference.equals(e)||this._set("mapCoordsHelper",new Re(this.map,e));const t=this.state.isGlobal,i=B(t,e);i!==this.renderSpatialReference&&(this._set("renderCoordsHelper",Ve.create(this.state.viewingMode,i)),t||this.handles.add(this.watch("basemapTerrain.extent",(e=>{const t=this.renderCoordsHelper.spatialReference;0===e[0]&&0===e[1]&&0===e[2]&&0===e[3]||!W(e,this.basemapTerrain.spatialReference,ht,t)||(this.renderCoordsHelper.extent=ht)}),!0),"render-coords-helper"),this.sceneIntersectionHelper&&this.sceneIntersectionHelper.setTolerance(Le/this.renderCoordsHelper.unitInMeters))}else this._set("mapCoordsHelper",null),this._set("renderCoordsHelper",null)}_exitCoordinateSystem(){this.mapCoordsHelper&&(this.handles.remove("render-coords-helper"),this._set("renderCoordsHelper",null),this._set("mapCoordsHelper",null))}_updatingChanged(){this.notifyChange("updating")}_updateUpdatingMonitors(e=null){f(e)&&e.type===w.MOVE||(this.handles.remove("updatingMonitors"),this.allLayerViews.forEach((e=>{e.destroyed||(this.handles.add([e.watch(["updating","updatingProgress"],(()=>this._updatingChanged()),!0)],"updatingMonitors"),e.when((()=>this._updatingChanged()),(()=>this._updatingChanged())))})),this._updatingChanged())}_renderScreenshotOverlay(e,t){if(!this.overlay||!this.overlay.hasVisibleItems)return t;const i=e.getContext("2d");return i.putImageData(t,0,0),this.overlay.renderCanvas(e),i.getImageData(0,0,t.width,t.height)}_initStage(){const e={deactivatedWebGLExtensions:this.deactivatedWebGLExtensions,debugWebGLExtensions:this.debugWebGLExtensions,alpha:this.alphaCompositingEnabled,canvas:this.renderCanvas,screenshot:{renderOverlay:(e,t)=>this._renderScreenshotOverlay(e,t)}},t=new ye(this.state.viewingMode,(e=>this._stage.layers.forAll(e)),this);this._set("sceneIntersectionHelper",t);const i=a(this.surface),{resourceController:r,state:s,renderSpatialReference:n}=this;this._stage=new Ge({options:e,container:i,resourceController:r,state:s,sceneIntersectionHelper:t,renderSR:n}),this._stage.renderView.setRenderParameters({slicePlane:this.slicePlane}),this._lostWebGLContextHandle=l(this._stage.renderView.canvas,"webglcontextlost",(()=>this.fatalError=new o("webgl-context-lost"))),this.handles.add([this.updatingHandles.add((()=>this.qualitySettings.antialiasingEnabled),(()=>this._stage.renderView.setRenderParameters({antialiasingEnabled:this.qualitySettings.antialiasingEnabled})),_),this.updatingHandles.add((()=>this.qualitySettings.highQualityTransparency),(()=>this._stage.renderView.setRenderParameters({highQualityTransparency:this.qualitySettings.highQualityTransparency})),_),x(this,"magnifier",(e=>this._stage.renderView.magnifier=e),!0)],"stage");const p=()=>{this._stage.renderView.setRenderParameters({defaultHighlightOptions:Me.toEngineOptions(this.highlightOptions)})};this.handles.add(this.updatingHandles.add((()=>[this.highlightOptions.color,this.highlightOptions.haloColor,this.highlightOptions.haloOpacity,this.highlightOptions.fillOpacity,this.highlightOptions.shadowOpacity,this.highlightOptions.shadowColor,this.highlightOptions.shadowDifference]),p),"stage"),p(),this.renderCoordsHelper&&this.sceneIntersectionHelper.setTolerance(Le/this.renderCoordsHelper.unitInMeters),this._set("canvas",this._stage.renderView.canvas)}_exitStage(){this._set("sceneIntersectionHelper",null),this._stage.destroy(),this._stage=null,this._lostWebGLContextHandle.remove(),this._lostWebGLContextHandle=null,this.handles.remove("stage"),this._set("canvas",null)}_initSurface(e){this._exitSurface(),this.state.init(e,this.spatialReference),this._initStage(),this._initGlobe(),this.sharedSymbolResources=new Oe({view:this,viewingMode:e,resourceController:this._resourceController,pointsOfInterest:this.pointsOfInterest,viewState:this.state,objectResourceCache:new ue})}_exitSurface(){this.sharedSymbolResources&&(this.sharedSymbolResources.objectResourceCache.destroy(),this.sharedSymbolResources.destroy(),this.sharedSymbolResources=null,this._exitGlobe(),this._exitStage())}_createGraphicsViewIfNeeded(){if(this.graphicsView||this._createGraphicsViewController)return;if(0===this.graphics.length)return;this.handles.remove("graphics-view"),this._createGraphicsViewController=new AbortController;const e=()=>{this._createGraphicsViewController=null,this._updatingChanged()};this._createGraphicsViewAsync(this._createGraphicsViewController.signal).then(e,e),this._updatingChanged()}async _createGraphicsViewAsync(e){const t=(await import("./3d/layers/GraphicsView3D.js")).default;v(e),await V(this.basemapTerrain,"ready",e),this._set("graphicsView",new t({view:this}))}_disposeGraphicsView(){this._createGraphicsViewController&&(this._createGraphicsViewController.abort(),this._createGraphicsViewController=null),this.handles.remove("graphics-view"),f(this.graphicsView)&&(this.handles.remove(this.graphicsView.processor.layer.id),this.graphicsView.destroy(),this._set("graphicsView",null))}_startup(){const e=se(this.viewingMode);if(e===ie.Global&&(this._clippingArea=null),this._initSurface(e),this._set("ready",!0),this.handles.add(R(this,"graphics","after-changes",(()=>this._createGraphicsViewIfNeeded())),"graphics-view"),this._createGraphicsViewIfNeeded(),!this._externallySet.environment){const e=this.get("map.initialViewProperties.environment");e&&(this.environment=e)}this.labeler.setup(),this.environmentManager.connectView(this),this.inputManager.connect();const t=this._resolveWhenReady;this._resolveWhenReady=[],t.forEach((e=>e(this)))}_teardown(){this._initialDefaultSpatialReference=null,this.inputManager.disconnect(),this.environmentManager.disconnectView(),this.labeler.dispose(),this._disposeGraphicsView(),this.handles.remove("graphics-view"),this._exitSurface(),this._set("ready",!1)}_updateDefaultToMapOptions(){if(this._defaultToMapOptions.include.clear(),this.map){this.map.ground&&this._defaultToMapOptions.include.add(qe);for(const e of this.map.allLayers.items)"integrated-mesh"===e.type&&this._defaultToMapOptions.include.add(e.uid)}}_updateDefaultHitTestOptions(){if(this._defaultHitTestOptions.exclude.clear(),this.map){this.map.ground&&this.map.ground.opacity<1&&this._defaultHitTestOptions.exclude.add(qe);for(const e of this.map.allLayers.items)"integrated-mesh"===e.type&&e.opacity<1&&this._defaultToMapOptions.exclude.add(e.uid)}}getVoxelWasmPerSceneView(){return $.getInstance().getVoxelWasmPerSceneView(this)}};function st(e,t){e.layerUids||(e.layerUids=new Set),e.layerUids.add(t)}function nt(e,t){e.graphicUids||(e.graphicUids=new Set),e.graphicUids.add(t)}function at(e,t){return f(e)&&U(e.spatialReference,t)?A(e,t):null}var ot;e([E()],rt.prototype,"_userClippingArea",void 0),e([E()],rt.prototype,"_resourceController",void 0),e([E()],rt.prototype,"_stage",void 0),e([E({readOnly:!0})],rt.prototype,"deconflictor",void 0),e([E({readOnly:!0})],rt.prototype,"labeler",void 0),e([E({type:te,readOnly:!0,aliasOf:"state.animation"})],rt.prototype,"animation",void 0),e([E({readOnly:!0})],rt.prototype,"basemapTerrain",void 0),e([E({readOnly:!0})],rt.prototype,"elevationProvider",void 0),e([E({type:t,aliasOf:"stateManager.camera"})],rt.prototype,"camera",void 0),e([E({type:t,aliasOf:"stateManager.contentCamera"})],rt.prototype,"contentCamera",void 0),e([E({readOnly:!0})],rt.prototype,"canvas",void 0),e([E({type:tt,aliasOf:"stateManager.center"})],rt.prototype,"center",void 0),e([E({type:Ye})],rt.prototype,"clippingArea",null),e([E({type:oe})],rt.prototype,"constraints",void 0),e([E({type:Ye,readOnly:!0})],rt.prototype,"renderDataExtent",null),e([E({type:Ye,readOnly:!0})],rt.prototype,"dataExtent",null),e([E({type:Ye,readOnly:!0})],rt.prototype,"groundAndLayersExtent",null),e([E({value:null,type:le})],rt.prototype,"environment",null),e([j("environment")],rt.prototype,"castEnvironment",null),e([E({readOnly:!0})],rt.prototype,"environmentManager",void 0),e([E({type:Ye,aliasOf:"stateManager.extent"})],rt.prototype,"extent",void 0),e([E()],rt.prototype,"floors",void 0),e([E({readOnly:!0,aliasOf:"stateManager.screenCenter"})],rt.prototype,"screenCenter",void 0),e([E({type:Number})],rt.prototype,"pixelRatio",null),e([E({type:Number,dependsOn:["qualitySettings.maximumPixelRatio","qualitySettings.maximumRenderResolution","size"]})],rt.prototype,"maximumPixelRatio",null),e([E({aliasOf:"stateManager.frustum"})],rt.prototype,"frustum",void 0),e([E({type:Number,readOnly:!0})],rt.prototype,"fullOpacity",void 0),e([E({readOnly:!0})],rt.prototype,"graphicsView",void 0),e([E({readOnly:!0})],rt.prototype,"analysisViewManager",void 0),e([E()],rt.prototype,"groundView",void 0),e([E({type:Boolean})],rt.prototype,"initialExtentRequired",null),e([E()],rt.prototype,"_defaultsFromMapSettings",null),e([E({type:Boolean,readOnly:!0})],rt.prototype,"interacting",null),e([E()],rt.prototype,"stationary",null),e([E({aliasOf:"state.navigating"})],rt.prototype,"navigating",void 0),e([E()],rt.prototype,"map",void 0),e([E({readOnly:!0})],rt.prototype,"mapCoordsHelper",void 0),e([E({aliasOf:"stateManager.padding"})],rt.prototype,"padding",void 0),e([E({type:Pe,readOnly:!0})],rt.prototype,"pointsOfInterest",void 0),e([E({type:ge,readOnly:!0})],rt.prototype,"featureTiles",void 0),e([E()],rt.prototype,"featureTreeDebugger",void 0),e([E({type:Boolean})],rt.prototype,"screenSizePerspectiveEnabled",void 0),e([E({constructOnly:!0})],rt.prototype,"deactivatedWebGLExtensions",void 0),e([E({constructOnly:!0})],rt.prototype,"debugWebGLExtensions",void 0),e([E({constructOnly:!0})],rt.prototype,"renderCanvas",void 0),e([E({constructOnly:!0})],rt.prototype,"state",void 0),e([E({readOnly:!0})],rt.prototype,"inputManager",void 0),e([E({readOnly:!0})],rt.prototype,"stateManager",void 0),e([E({type:["low","medium","high"]})],rt.prototype,"qualityProfile",null),e([E({type:xe,get(){let e=this._get("qualitySettings");return e||(e=new xe,_e.apply(this.qualityProfile,e)),e}})],rt.prototype,"qualitySettings",void 0),e([E()],rt.prototype,"slicePlane",null),e([E({readOnly:!0})],rt.prototype,"typeSpecificPreconditionsReady",null),e([E({readOnly:!0})],rt.prototype,"renderCoordsHelper",void 0),e([E({readOnly:!0})],rt.prototype,"sceneIntersectionHelper",void 0),e([E({type:Number,dependsOn:["scale","spatialReference"],readOnly:!0})],rt.prototype,"resolution",null),e([E({type:Number,aliasOf:"stateManager.scale"})],rt.prototype,"scale",void 0),e([E()],rt.prototype,"heightModelInfo",null),e([E()],rt.prototype,"spatialReference",void 0),e([E({type:Boolean,constructOnly:!0})],rt.prototype,"alphaCompositingEnabled",void 0),e([E({type:Boolean})],rt.prototype,"supersampleScreenshotsEnabled",void 0),e([E({readOnly:!0})],rt.prototype,"type",void 0),e([E({type:Ze})],rt.prototype,"ui",void 0),e([E({type:Boolean,readOnly:!0,dependsOn:["graphicsView.updating","basemapView.updating","basemapTerrain.updating","layerViewManager.updating","layerViewManager.updatingRemaining","_resourceController.updating","_stage.updating","featureTiles.updating","pointsOfInterest.updating","environmentManager.updating","overlay.updating","updatingHandles.updating","featureTreeDebugger.updating","labeler.updating","deconflictor.updating","ready","stationary","inputManager.hasPendingInputs","toolViewManager.updating","analysisViewManager.updating"]})],rt.prototype,"updating",null),e([E({type:Number,readOnly:!0,dependsOn:["updating"]})],rt.prototype,"updatingProgress",void 0),e([E({type:["global","local"]})],rt.prototype,"viewingMode",null),e([E({type:s,aliasOf:"stateManager.viewpoint"})],rt.prototype,"viewpoint",void 0),e([E({type:Number,aliasOf:"stateManager.zoom"})],rt.prototype,"zoom",void 0),e([E({type:Me})],rt.prototype,"highlightOptions",void 0),rt=e([I("esri.views.SceneView")],rt),function(e){e[e.INCLUDE=0]="INCLUDE",e[e.EXCLUDE=1]="EXCLUDE"}(ot||(ot={}));const lt=H(),pt=P(),ht=q(),dt=rt;export{dt as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import t from"../Camera.js";import"../geometry.js";import i from"../Graphic.js";import r from"../Ground.js";import s from"../Viewpoint.js";import n from"../core/Collection.js";import{byId as a}from"../core/domUtils.js";import o from"../core/Error.js";import{on as l}from"../core/events.js";import{handlesGroup as p,makeHandle as h}from"../core/handleUtils.js";import d from"../core/has.js";import{isIterable as c}from"../core/iteratorUtils.js";import u from"../core/Logger.js";import{destroyMaybe as g,isNone as m,isSome as f,unwrapOr as y}from"../core/maybe.js";import{ObservableChangesType as w}from"../core/ObservableChangesType.js";import{throwIfAborted as v}from"../core/promiseUtils.js";import{initial as _,syncAndInitial as b}from"../core/reactiveUtils.js";import{setFrameDuration as M}from"../core/scheduling.js";import{on as R,whenOnce as S,init as x,whenTrueOnce as V}from"../core/watchUtils.js";import{initialize as C}from"../core/workers/workers.js";import{screenPointObjectToArray as T,createScreenPoint as O,createScreenPointArray as P}from"../core/screenUtils.js";import{property as E}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import{cast as j}from"../core/accessorSupport/decorators/cast.js";import{subclass as I}from"../core/accessorSupport/decorators/subclass.js";import{ensureType as G}from"../core/accessorSupport/ensureType.js";import{c as H}from"../chunks/vec3f64.js";import L from"../geometry/HeightModelInfo.js";import{canProjectWithoutEngine as U,project as A,projectPointToVector as D,projectVectorToVector as F,projectBoundingRect as W}from"../geometry/projection.js";import{create as q,toExtent as z}from"../geometry/support/aaBoundingRect.js";import{B as k,a as N}from"../chunks/boundedPlane.js";import{renderSRFromViewSR as B}from"../geometry/support/coordinateSystem.js";import{getResolutionForScale as Q}from"../geometry/support/scaleUtils.js";import $ from"../layers/VoxelWasmManager.js";import{isTiledLayer as X}from"../layers/support/layerUtils.js";import{BreakpointsOwner as K}from"./BreakpointsOwner.js";import{DOMContainer as Z}from"./DOMContainer.js";import J from"./GroundView.js";import{PopupView as Y}from"./PopupView.js";import ee from"./View.js";import te from"./ViewAnimation.js";import{ViewingMode as ie,stringFromViewingMode as re,viewingModeFromString as se}from"./ViewingMode.js";import{layerView3DImporter as ne}from"./3d/layerViewModuleImportUtils.js";import ae from"./3d/analysis/AnalysisViewManager3D.js";import oe from"./3d/constraints/Constraints.js";import le from"./3d/environment/SceneViewEnvironment.js";import{SceneViewEnvironmentManager as pe}from"./3d/environment/SceneViewEnvironmentManager.js";import he from"./3d/input/SceneInputManager.js";import{GraphicsDeconflictor as de}from"./3d/layers/graphics/GraphicsDeconflictor.js";import{Labeler as ce}from"./3d/layers/graphics/Labeler.js";import{ObjectResourceCache as ue}from"./3d/layers/graphics/ObjectResourceCache.js";import ge from"./3d/layers/support/FeatureTileTree3D.js";import me from"./3d/state/ViewState.js";import fe from"./3d/state/ViewStateManager.js";import{SceneIntersectionHelper as ye}from"./3d/state/helpers/SceneIntersectionHelper.js";import{CombinedElevationProvider as we}from"./3d/support/CombinedElevationProvider.js";import ve from"./3d/support/debugFlags.js";import _e from"./3d/support/DisplayQualityProfile.js";import{getElevationAtPoint as be}from"./3d/support/ElevationProvider.js";import Me from"./3d/support/HighlightOptions.js";import{MapCoordsHelper as Re}from"./3d/support/MapCoordsHelper.js";import{PropertiesPool as Se}from"./3d/support/PropertiesPool.js";import xe from"./3d/support/QualitySettings.js";import{RenderCoordsHelper as Ve}from"./3d/support/RenderCoordsHelper.js";import{newResourceController as Ce}from"./3d/support/ResourceController.js";import Te from"./3d/support/SceneViewPerformanceInfo.js";import{SharedSymbolResources as Oe}from"./3d/support/SharedSymbolResources.js";import Pe from"./3d/support/pointsOfInterest/PointsOfInterest.js";import Ee from"./3d/terrain/TerrainSurface.js";import{isSurfaceLayerView as je,getTiledLayerInfo as Ie}from"./3d/terrain/terrainUtils.js";import{Stage as Ge}from"./3d/webgl-engine/Stage.js";import{newIntersector as He,DEFAULT_TOLERANCE as Le}from"./3d/webgl-engine/lib/Intersector.js";import{StoreResults as Ue,IntersectorType as Ae}from"./3d/webgl-engine/lib/IntersectorInterfaces.js";import{isValidIntersectorResult as De}from"./3d/webgl-engine/lib/intersectorUtils.js";import{toGraphic as Fe,toOwner as We}from"./3d/webgl-engine/lib/intersectorUtilsConversions.js";import{TERRAIN_ID as qe}from"./3d/webgl-engine/lib/verticalOffsetUtils.js";import{hitTestSelectSameDistance as ze}from"./support/hitTestSelectUtils.js";import{occludeesSupported as ke}from"./support/layerViewUtils.js";import{toRenderSettings as Ne,screenshotSuperSampleSettings as Be}from"./support/screenshotUtils.js";import{isSupportedScreenPointEvent as Qe,createScreenPointFromSupportedEvent as $e}from"./support/screenUtils.js";import{isSpatialReferenceSupported as Xe}from"./support/spatialReferenceSupport.js";import{check as Ke}from"./support/WebGLRequirements.js";import Ze from"./ui/3d/DefaultUI3D.js";import Je from"../webscene/Environment.js";import Ye from"../geometry/Extent.js";import et from"../geometry/SpatialReference.js";import tt from"../geometry/Point.js";const it=u.getLogger("esri.views.SceneView");let rt=class extends(K(Z(Y(ee)))){constructor(e){super(e),this._userClippingArea=null,this._clippingArea=null,this._initialDefaultSpatialReference=null,this._defaults={},this._externallySet={environment:!1},this._createGraphicsViewController=null,this._resolveWhenReady=[],this.propertiesPool=new Se({slicePlane:k},this),this._resourceController=Ce(this),this._defaultToMapOptions={include:new Set},this._defaultHitTestOptions={exclude:new Set},this.deconflictor=new de({view:this}),this.labeler=new ce({view:this,deconflictor:this.deconflictor.labels}),this.sharedSymbolResources=null,this.basemapTerrain=null,this.elevationProvider=null,this.camera=null,this.canvas=null,this.center=null,this.constraints=new oe,this.environmentManager=new pe,this.extent=null,this.floors=new n,this.windowDevicePixelRatio=1,this.fullOpacity=1,this.graphicsView=null,this.analysisViewManager=new ae({view:this}),this.groundView=null,this.navigating=!1,this.map=null,this.screenSizePerspectiveEnabled=!0,this.state=new me,this.scale=null,this.spatialReference=null,this.alphaCompositingEnabled=!1,this.supersampleScreenshotsEnabled=!0,this.type="3d",this.ui=new Ze,this._numUpdating=0,this._lastUpdateTime=0,this.updatingProgress=.5,this.viewpoint=null,this.zoom=null,this.highlightOptions=new Me,C(),e&&e.environment||(this._defaults.environment=new le,this.environment=this._defaults.environment);const t=e=>{f(e)&&e.type===w.MOVE||(this._updatingChanged(),this.map&&this.map.allLayers.forEach((async e=>{try{await e.when()}catch{}this._updatingChanged()})))};this.handles.add([R(this,"map.allLayers","after-changes",t,t,t,!0),this.allLayerViews.on("after-changes",(e=>this._updateUpdatingMonitors(e))),this.watch("map",(e=>{e&&e.load&&e.load().catch((()=>{}))}))]),this.inputManager=new he({view:this});const i=()=>{const e=window.devicePixelRatio;e!==this.windowDevicePixelRatio&&(this.windowDevicePixelRatio=e,this.notifyChange("pixelRatio"))};this.stateManager=new fe({view:this,updateDevicePixelRatio:i})}initialize(){this.groundView=new J({view:this}),this._updateUpdatingMonitors();const e=()=>this._updateDefaultToMapOptions();this.handles.add(R(this,"map.allLayers","after-changes",e,e,e)),this.updatingHandles.add((()=>this.qualitySettings.memoryLimit),(e=>{this.resourceController&&(this.resourceController.memoryController.maxMemory=e)}),_),this.updatingHandles.add((()=>this.qualitySettings.additionalCacheMemory),(e=>{this.resourceController&&(this.resourceController.memoryController.additionalCacheMemory=e)}),_),this.updatingHandles.add((()=>this.qualitySettings.frameRate),(e=>M(e>0?1e3/Math.ceil(e):0)),_),this.updatingHandles.add((()=>ve.SCENEVIEW_LOCKING_LOG),(e=>this.defaultsFromMap.logDebugInformation=e),_),this.updatingHandles.add((()=>{var e;return null==(e=this.map)?void 0:e.ground}),e,b),this.updatingHandles.add((()=>{var e,t;return null==(e=this.map)||null==(t=e.ground)?void 0:t.opacity}),(()=>this._updateDefaultHitTestOptions()),b),this.handles.add(this.watch("spatialReference",(()=>this.notifyChange("clippingArea")),!0))}destroy(){this.destroyed||(this.invalidate(),this.activeTool=null,this.layerViewManager.clear(),this._exitSurface(),this._disposeGraphicsView(),this.sharedSymbolResources=g(this.sharedSymbolResources),this.labeler.destroy(),this._set("labeler",null),this.deconflictor.destroy(),this._set("deconflictor",null),this._resourceController=g(this._resourceController),this.stateManager.destroy(),this._set("stateManager",null),this.inputManager.destroy(),this._set("inputManager",null),this.propertiesPool.destroy(),this.handles.remove("updatingMonitors"),this.environmentManager.destroy(),this._set("environmentManager",null),this.groundView=g(this.groundView))}get renderSpatialReference(){return this.renderCoordsHelper&&this.renderCoordsHelper.spatialReference}get basemapSpatialReference(){return this.basemapTerrain&&this.basemapTerrain.spatialReference}installContentCameraReset(e={sticky:!1}){return this.stateManager.installContentCameraReset(e)}get clippingArea(){if("global"===this.viewingMode)return null;let e=this._userClippingArea||this.get("map.clippingArea");return!(!!this._userClippingArea||this.get("map.clippingEnabled"))||m(e)?(this._clippingArea=null,null):e instanceof Ye?this.spatialReference&&(e=at(e,this.spatialReference),m(e))?(it.error("#clippingArea","setting clippingArea with incompatible SpatialReference"),this._clippingArea):(e=e.clone(),m(e.intersection(this.groundAndLayersExtent))&&(e.xmin=e.xmax,e.ymin=e.ymax),e.zmin=void 0,e.zmax=void 0,e.equals(this._clippingArea)||(this._clippingArea=e),this._clippingArea):(it.error("#clippingArea","only clippingArea geometries of type Extent are supported"),this._clippingArea)}set clippingArea(e){this.ready&&"global"===this.viewingMode&&f(e)?it.error("#clippingArea=","Clipping area is only supported in local viewingMode"):this._userClippingArea=e}get renderDataExtent(){if(this.state.viewingMode===ie.Global)return null;const e=this.renderSpatialReference,t=this.dataExtent;return m(t)||m(e)||t.spatialReference.equals(e)?t:at(t,e)}get dataExtent(){let e=this.groundAndLayersExtent;const t=this.spatialReference||et.WGS84,i=at(this.clippingArea,t);f(i)&&(e=f(e)?e.intersection(i):i);const r=this._get("dataExtent");return f(e)&&e.equals(r)?r:e}get groundAndLayersExtent(){const e=this.spatialReference||et.WGS84;let t;const i=i=>{const r=at(i,e);m(r)||(f(t)?t.union(r):t=r.clone())},r=this.basemapTerrain;if(null!=r&&r.spatialReference){const e=r.groundExtent;i(new Ye({xmin:e[0],ymin:e[1],zmin:0,xmax:e[2],ymax:e[3],zmax:0,spatialReference:r.spatialReference}))}if(this.map){const e=e=>{!f(e.fullExtent)||"graphics"===e.type&&e.internal||i(e.fullExtent)};this.map.allLayers.forEach((t=>e(t)))}if(m(t))return null;t.hasZ?(t.zmin=Math.min(0,t.zmin),t.zmax=Math.max(0,t.zmax)):(t.zmin=0,t.zmax=0);const s=this._get("groundAndLayersExtent");return t.equals(s)?s:t}set environment(e){e!==this._defaults.environment&&(this._externallySet.environment=!0),this._set("environment",e)}castEnvironment(e){return e?e instanceof le?e:e instanceof Je?null!=this.environment?this.environment.cloneWithWebsceneEnvironment(e):le.fromWebsceneEnvironment(e):G(le,e):new le}get pixelRatio(){return Math.min(this.windowDevicePixelRatio,this.maximumPixelRatio)}set pixelRatio(e){f(e)?this._override("pixelRatio",e):this._clearOverride("pixelRatio")}get maximumPixelRatio(){let e=1/0;const{maximumPixelRatio:t,maximumRenderResolution:i}=this.qualitySettings;if(null!=t&&(e=Math.min(e,t)),null!=i){const t=i/Math.max(this.width,this.height);e=Math.min(e,t)}return e}set maximumPixelRatio(e){f(e)?this._override("maximumPixelRatio",e):this._clearOverride("maximumPixelRatio")}get initialExtentRequired(){return this.stateManager&&!this.stateManager.hasInitialView}get _defaultsFromMapSettings(){return{required:{tileInfo:!1,heightModelInfo:!0,extent:!1}}}get interacting(){return this.navigating||f(this.activeTool)}get stationary(){return!this.animation&&!this.resizing&&(m(this.state)||this.state.stationary)}set qualityProfile(e){_e.isValidProfile(e)&&(_e.apply(e,this.qualitySettings),this._set("qualityProfile",e))}get qualityProfile(){return this._get("qualityProfile")||_e.getDefaultProfile()}set slicePlane(e){if(f(this._stage)&&this._stage.renderView.setRenderParameters({slicePlane:e}),m(e))return void this._set("slicePlane",null);const t=this.propertiesPool.get("slicePlane");N(e,t),this._set("slicePlane",t)}get typeSpecificPreconditionsReady(){return!!this.viewingMode}get resolution(){return null!=this.spatialReference?Q(this.scale,this.spatialReference):0}get heightModelInfo(){const e=this.getDefaultHeightModelInfo();return null!=e?L.deriveUnitFromSR(e,this.spatialReference):null}get updating(){var e,t,i;if(this.destroyed)return!1;let r=0,s=this.layerViewManager.updating,n=s?this.layerViewManager.updatingRemaining:0;this.allLayerViews.forEach((e=>{if(e.isFulfilled()){if(e.updating){if(s=!0,e.suspended||je(e))return;++n,r+=e.updatingProgress}}else++n}));for(const a of[this.graphicsView,this.basemapView,this._resourceController,this._stage,this.featureTiles,this.pointsOfInterest,this.environmentManager,this.overlay,this.featureTreeDebugger,this.toolViewManager,this.analysisViewManager])if(f(a)&&a.updating){const e=.1;n+=e,r+=.5*e}for(const a of[this.deconflictor,this.labeler,this.basemapTerrain])f(a)&&a.updating&&(++n,r+=a.updatingProgress);if(s=!!(s||n>0||this.updatingHandles.updating||!this.ready||!this.stationary||this._createGraphicsViewController||null!=(e=this.inputManager)&&e.hasPendingInputs||null!=(t=this.map)&&null!=(i=t.allLayers)&&i.some((e=>!e.isFulfilled()))),s?(this._numUpdating=Math.max(n,this._numUpdating),r+=this._numUpdating-n):this._numUpdating=0,this._numUpdating>0?r/=this._numUpdating:r=s?0:1,this._get("updatingProgress")!==r){const e=this._resourceController.scheduler.now;if(r<1){const t=Math.min((e-this._lastUpdateTime)/2e3,1);r=this.updatingProgress*(1-t)+r*t}this._set("updatingProgress",r),this._lastUpdateTime=s&&r<1?e:0}return s}get viewingMode(){var e;const t=this._predeterminedViewingMode;if(f(t))return re(t);const i=this.spatialReference;return f(null==(e=this.defaultsFromMap)?void 0:e.viewingMode)&&i&&i.equals(this.defaultsFromMap.spatialReference)?re(this.defaultsFromMap.viewingMode):!i||Xe(i,ie.Global)?"global":"local"}set viewingMode(e){this.ready?it.error("#viewingMode","viewingMode cannot be set once view is ready"):e?this._override("viewingMode",e):void 0===e&&this._clearOverride("viewingMode")}get resourceController(){return this._resourceController}get performanceInfo(){return new Te(this)}forceAnimationTime(e){this._stage.renderView.forcedAnimationTime=this.basemapTerrain.overlayManager.forcedAnimationTime=e}on(e,t,i,r){const s=this.viewEvents.on(e,t,i,r);return s||super.on(e,t)}hasEventListener(e){return super.hasEventListener(e)||this.viewEvents.hasHandler(e)}toMap(e,t){if(!this.ready)return it.error("#toMap()","Scene view cannot be used before it is ready"),null;const i=t?this.externalToInternalIntersectOptions(t):this._defaultToMapOptions,r=f(i.graphics)&&(f(i.graphics.include)||f(i.graphics.exclude)),s=Qe(e)?$e(this,e):e,n=T(s);i.enableDraped=i.include&&!i.include.has(qe)||i.exclude&&i.exclude.has(qe);const a=this.sceneIntersectionHelper,o=He(this.state.viewingMode);if(o.options.selectionMode=!0,o.options.store=r?Ue.ALL:Ue.MIN,a.intersectIntersectorScreen(n,o,i),r){for(const e of o.results.all){const t=Fe(e,this);if(m(t))return this._intersectResultToMapPoint(e);if(this._testGraphicUidFilter(i.graphics,t))return this._intersectResultToMapPoint(e)}return null}return this._intersectResultToMapPoint(o.results.min)}toScreen(e){if(!this.ready)return it.error("#toScreen()","Scene view cannot be used before it is ready"),null;const t=y(null==e.z&&be(this.elevationProvider,e),0);return D(e,lt,this.renderSpatialReference,t),this.state.camera.projectToScreen(lt,pt),O(pt[0],pt[1])}pixelSizeAt(e){return this.ready?e?(D(e,lt,this.renderSpatialReference),this.state.camera.computeScreenPixelSizeAt(lt)):0:(it.error("#pixelSizeAt()","Scene view cannot be used before it is ready"),null)}overlayPixelSizeInMapUnits(e){const t=this.basemapTerrain.overlayManager;return t?t.overlayPixelSizeInMapUnits(e):1}hitTest(e,t){if(!this.ready)return it.error("#hitTest()","Scene view cannot be used before it is ready"),null;const i=Qe(e)?$e(this,e):e,r=P(i.x,i.y),s=t?this.externalToInternalIntersectOptions(t):this._defaultHitTestOptions;s.requiresGroundFeedback=!0,s.enableDraped=!0;const n=He(this.state.viewingMode);n.options.selectionMode=!0,n.options.store=Ue.ALL,this.sceneIntersectionHelper.intersectIntersectorScreen(r,n,s);const a=this._intersectResultsToHits(n.results.all,s.graphics),o=n.results.ground,l=We(o,this),p=f(l)&&"type"in l&&"integrated-mesh"===l.type?l:null,h={screenPoint:i,results:a,ground:{mapPoint:this._intersectResultToMapPoint(o),distance:De(o)?o.distanceInRenderSpace:0,layer:p}};return ve.SCENEVIEW_HITTEST_RETURN_INTERSECTOR&&(h.intersector=n),Promise.resolve(h)}popupHitTest(e){return ze(this,e).then((({results:t,ground:i})=>{let r=null;return!(0===t.length||Math.abs(y(t[0].distance,0)-i.distance)<1e-5)||i.layer&&"integrated-mesh"===i.layer.type||(r=i.mapPoint),{results:t,screenPoint:e,mapPoint:r}}))}goTo(e,t){return this.updatingHandles.addPromise(this.stateManager.goTo(e,t))}async whenAnalysisView(e){if(m(e.parent))throw new o("view:no-analysisview-for-analysis","The analysis has not been added to an AnalysisLayer or SceneView.analyses",{analysis:e});if("analysis"===e.parent.type){return(await this.whenLayerView(e.parent)).whenAnalysisView(e)}return this.analysisViewManager.whenAnalysisView(e)}whenLayerView(e){return super.whenLayerView(e)}takeScreenshot(e){return this.whenReady().then((()=>{const t=Ne(e,this);return t.pixelRatio/=this.pixelRatio,this._stage.renderView.takeScreenshot(Be(t,this.supersampleScreenshotsEnabled,this.padding))}))}addUpdatingPromise(e){return this.updatingHandles.addPromise(e)}importLayerView(e){return ne.importLayerView(e)}hasLayerViewModule(e){return ne.hasLayerViewModule(e)}forceDOMReadyCycle(){this.forceReadyCycle()}getDefaultSpatialReference(){var e,t,i,r;return this.map&&"initialViewProperties"in this.map&&(null==(e=this.map)||null==(t=e.initialViewProperties)?void 0:t.spatialReference)||(null==(i=this.defaultsFromMap)?void 0:i.spatialReference)||(null==(r=this.defaultsFromMap)?void 0:r.ready)&&this._initialDefaultSpatialReference||null}async validate(){let e=Ke(this.type);if(d("safari")&&d("safari")<9&&(e=new o("sceneview:browser-not-supported","This browser is not supported by SceneView (Safari < 9)",{type:"safari",requiredVersion:9,detectedVersion:d("safari")})),f(e))throw it.warn("#validate()",e.message),e}get _predeterminedViewingMode(){var e,t;const i=this._isOverridden("viewingMode")?this._get("viewingMode"):null!=(e=this.map&&"initialViewProperties"in this.map?null==(t=this.map.initialViewProperties)?void 0:t.viewingMode:null)?e:null;return f(i)?se(i):null}getSpatialReferenceSupport({spatialReference:e,layer:t}){const i=this._predeterminedViewingMode;if(f(i))return this._validateSpatialReferenceForViewingMode(e,t,i)?{constraints:this._makeSpatialReferenceConstraints(e,t,i)}:null;const r=this._validateSpatialReferenceForViewingMode(e,t,ie.Local),s=this._validateSpatialReferenceForViewingMode(e,t,ie.Global);return r||s?r&&s?{constraints:this._makeSpatialReferenceConstraints(e,t,null)}:r?{constraints:this._makeSpatialReferenceConstraints(e,t,ie.Local)}:{constraints:this._makeSpatialReferenceConstraints(e,t,ie.Global)}:null}_validateSpatialReferenceForViewingMode(e,t,i){return!!Xe(e,i)&&(!!m(t)||(!X(t)||!m(Ie(t,e,i)))&&("voxel"!==t.type||i===ie.Local))}_makeSpatialReferenceConstraints(e,t,i){return t&&!X(t)&&"voxel"!==t.type&&(e.isWebMercator||e.isWGS84)?[{spatialReference:e,viewingMode:i},{spatialReference:e.isWebMercator?et.WGS84:et.WebMercator,viewingMode:i}]:t&&X(t)&&e.isWebMercator&&i!==ie.Global?[{spatialReference:e,viewingMode:i},{spatialReference:et.WGS84,viewingMode:ie.Local}]:[{spatialReference:e,viewingMode:i}]}_validateSpatialReference(e){const t=f(this.getSpatialReferenceSupport({spatialReference:e})),i=this._predeterminedViewingMode;return t||(f(i)?it.warnOnce(`Spatial reference defined on view not supported in ${re(i)} viewing mode.`):e.isGeographic&&it.warnOnce("Spatial reference is geographic but not supported.")),t}whenReady(){return new Promise((e=>{this.ready?e(this):this._resolveWhenReady.push(e)}))}computeMapPointFromVec3d(e,t){let i=this.spatialReference||et.WGS84;return F(e,this.renderSpatialReference,e,i)||(i=et.WGS84,F(e,this.renderSpatialReference,e,i)),t?(t.x=e[0],t.y=e[1],t.z=e[2],t.spatialReference=i):t=new tt(e,i),t}trackGraphicState(e){if(!e.graphic)return it.error("trackGraphicState","GraphicState.graphic must not be null or undefined to start tracking"),null;const t=this.getViewForGraphic(e.graphic);let i=null,r=!1;const s=t=>{var s;!r&&f(t)&&"processor"in t&&"graphics-3d"===(null==(s=t.processor)?void 0:s.type)&&t.processor.graphicsCore&&(i=t.processor.graphicsCore.trackGraphicState(e))};return f(t)?s(t):this.whenViewForGraphic(e.graphic,{waitForLayer:!0}).then((e=>s(e)),(()=>{})).catch((()=>{})),{remove:()=>{r=!0,f(i)&&(i.remove(),i=null)}}}highlight(e){if(Array.isArray(e))return p(e.map((e=>this.highlight(e))));if(n.isCollection(e))return p(e.toArray().map((e=>this.highlight(e))));const t=this.getViewForGraphic(e);return t&&"highlight"in t?t.highlight(e):h()}maskOccludee(e){if(!e)return it.error("maskOccludee","GraphicState.graphic must not be null or undefined to mask an occludee"),null;const t=this.getViewForGraphic(e);let i=null,r=!1;const s=t=>{!r&&f(t)&&ke(t)&&(i=t.maskOccludee(e))};return f(t)?s(t):this.whenViewForGraphic(e,{waitForLayer:!0}).then((e=>s(e)),(()=>{})).catch((()=>{})),{remove:()=>{r=!0,f(i)&&(i.remove(),i=null)}}}getViewForGraphic(e){return e.layer===this.graphics?this.graphicsView:e.layer?this.allLayerViews.find((t=>t.layer===e.layer)):null}graphicChanged(e){f(this.graphicsView)&&this.graphicsView.graphicChanged(e)}async whenViewForGraphic(e,t){if(e.layer===this)return await S(this,"graphicsView"),this.graphicsView;if(!e.layer||!this.map)throw new o("no-view-for-graphic");return t&&t.waitForLayer&&!this.map.allLayers.includes(e.layer)?new Promise(((t,i)=>{const r=this.map.allLayers.on("change",(s=>{-1!==s.added.indexOf(e.layer)&&(r.remove(),this.whenLayerView(e.layer).then(t,i))}))})):this.whenLayerView(e.layer)}externalToInternalIntersectOptions(e){const t=this._externalToInternalRenderItems(e.include,ot.INCLUDE),i=this._externalToInternalRenderItems(e.exclude,ot.EXCLUDE);return{include:t.layerUids,exclude:i.layerUids,graphics:{include:t.graphicUids,exclude:i.graphicUids}}}_intersectResultToMapPoint(e,t){return e.getIntersectionPoint(lt)?(t=this.computeMapPointFromVec3d(lt,t),e.intersector===Ae.TERRAIN&&this.basemapTerrain&&(t.z=y(be(this.basemapTerrain,t),0)),t):null}_intersectResultsToHits(e,t){const i=new Array;let r=null;for(let s=0;s<e.length;s++){const n=e[s],a=We(n,this);if(f(a)&&(a===this.map.ground||"type"in a&&"integrated-mesh"===a.type))break;const o=Fe(n,this);if(!f(o))continue;if(m(r)&&s!==e.length-1&&(r=new Set),f(r)){const e=this._getGraphicFilterUid(o);if(r.has(e))continue;r.add(e)}if(!this._testGraphicUidFilter(t,o))continue;const l=this._intersectResultToMapPoint(n),p=n.distanceInRenderSpace;i.push({graphic:o,mapPoint:l,distance:p})}return i}_getGraphicFilterUid(e){if(e.layer&&"objectIdField"in e.layer){const t=e.attributes[e.layer.objectIdField];if(t)return`o-${e.layer.id}-${t}`}return`u-${e.uid}`}_testGraphicUidFilter(e,t){const i=this._getGraphicFilterUid(t);return m(e)||(m(e.include)||e.include.has(i))&&(m(e.exclude)||!e.exclude.has(i))}_externalToInternalRenderItems(e,t,s={layerUids:null,graphicUids:null}){if(!e)return s;if(e instanceof i)nt(s,this._getGraphicFilterUid(e)),t===ot.INCLUDE&&(f(this.graphicsView)&&e.layer===this?st(s,this.graphicsView.processor.layer.id):e.layer&&st(s,e.layer.uid));else if(c(e))for(const i of e)i===this.graphics&&f(this.graphicsView)?st(s,this.graphicsView.processor.layer.id):i instanceof r?i===this.map.ground&&st(s,qe):this._externalToInternalRenderItems(i,t,s);else st(s,e.uid);return s}_initBasemapTerrain(){this._set("basemapTerrain",new Ee({view:this})),this._set("elevationProvider",new we({view:this})),this.elevationProvider.register("ground",this.basemapTerrain)}_exitBasemapTerrain(){this.basemapTerrain&&(this.elevationProvider.unregister(this.basemapTerrain),this.elevationProvider.destroy(),this._set("elevationProvider",null),this.basemapTerrain.destroy(),this._set("basemapTerrain",null))}_initGlobe(){this._initCoordinateSystem(),this.state.createInitialCamera(),this._initBasemapTerrain(),this._set("pointsOfInterest",new Pe({view:this})),this._set("featureTiles",new ge({renderCoordsHelper:this.renderCoordsHelper,cameraOnSurface:this.pointsOfInterest.contentCameraOnSurface,focus:this.pointsOfInterest.focus,tilingSchemeOwner:this.basemapTerrain,viewState:this.state,scheduler:this._resourceController.scheduler,terrain:this.basemapTerrain}));const e=()=>{const e=this.basemapTerrain&&this.basemapTerrain.extent;if(this.clippingArea||e)if(e&&this.basemapTerrain.spatialReference){const e=f(this.basemapTerrain.extent)?A(z(this.basemapTerrain.extent,this.basemapTerrain.spatialReference),this.spatialReference):null;f(this.clippingArea)?this.featureTiles.filterExtent=this.clippingArea.intersection(e):this.featureTiles.filterExtent=e}else this.featureTiles.filterExtent=this.clippingArea;else this.featureTiles.filterExtent=null};this.handles.add([this.updatingHandles.add((()=>ve.FEATURE_TILE_TREE_SHOW_TILES),(e=>{e&&this.featureTiles&&!this.featureTreeDebugger?this.updatingHandles.addPromise(import("./3d/layers/support/FeatureTileTree3DDebugger.js")).then((({FeatureTileTree3DDebugger:e})=>{!this.featureTreeDebugger&&ve.FEATURE_TILE_TREE_SHOW_TILES&&(this.featureTreeDebugger=new e({view:this}))})):e||!this.featureTreeDebugger||ve.FEATURE_TILE_TREE_SHOW_TILES||(this.featureTreeDebugger.destroy(),this.featureTreeDebugger=null)}),b),this.updatingHandles.add((()=>this.clippingArea),e,b),this.updatingHandles.add((()=>this.basemapTerrain.extent),e,b)],"feature-tiles"),this.stateManager.init()}_exitGlobe(){this.state&&(this.stateManager.deinit(),this.handles.remove("render-coords-helper"),this.handles.remove("feature-tiles"),this.featureTiles.destroy(),this._set("featureTiles",null),this.pointsOfInterest.destroy(),this._set("pointsOfInterest",null),this._exitBasemapTerrain(),this.state.exit(),this._exitCoordinateSystem())}_initCoordinateSystem(){if(this.spatialReference){const e=this.spatialReference;this.mapCoordsHelper&&this.mapCoordsHelper.spatialReference.equals(e)||this._set("mapCoordsHelper",new Re(this.map,e));const t=this.state.isGlobal,i=B(t,e);i!==this.renderSpatialReference&&(this._set("renderCoordsHelper",Ve.create(this.state.viewingMode,i)),t||this.handles.add(this.watch("basemapTerrain.extent",(e=>{const t=this.renderCoordsHelper.spatialReference;0===e[0]&&0===e[1]&&0===e[2]&&0===e[3]||!W(e,this.basemapTerrain.spatialReference,ht,t)||(this.renderCoordsHelper.extent=ht)}),!0),"render-coords-helper"),this.sceneIntersectionHelper&&this.sceneIntersectionHelper.setTolerance(Le/this.renderCoordsHelper.unitInMeters))}else this._set("mapCoordsHelper",null),this._set("renderCoordsHelper",null)}_exitCoordinateSystem(){this.mapCoordsHelper&&(this.handles.remove("render-coords-helper"),this._set("renderCoordsHelper",null),this._set("mapCoordsHelper",null))}_updatingChanged(){this.notifyChange("updating")}_updateUpdatingMonitors(e=null){f(e)&&e.type===w.MOVE||(this.handles.remove("updatingMonitors"),this.allLayerViews.forEach((e=>{e.destroyed||(this.handles.add([e.watch(["updating","updatingProgress"],(()=>this._updatingChanged()),!0)],"updatingMonitors"),e.when((()=>this._updatingChanged()),(()=>this._updatingChanged())))})),this._updatingChanged())}_renderScreenshotOverlay(e,t){if(!this.overlay||!this.overlay.hasVisibleItems)return t;const i=e.getContext("2d");return i.putImageData(t,0,0),this.overlay.renderCanvas(e),i.getImageData(0,0,t.width,t.height)}_initStage(){const e={deactivatedWebGLExtensions:this.deactivatedWebGLExtensions,debugWebGLExtensions:this.debugWebGLExtensions,alpha:this.alphaCompositingEnabled,canvas:this.renderCanvas,screenshot:{renderOverlay:(e,t)=>this._renderScreenshotOverlay(e,t)}},t=new ye(this.state.viewingMode,(e=>this._stage.layers.forAll(e)),this);this._set("sceneIntersectionHelper",t);const i=a(this.surface),{resourceController:r,state:s,renderSpatialReference:n}=this;this._stage=new Ge({options:e,container:i,resourceController:r,state:s,sceneIntersectionHelper:t,renderSR:n}),this._stage.renderView.setRenderParameters({slicePlane:this.slicePlane}),this._lostWebGLContextHandle=l(this._stage.renderView.canvas,"webglcontextlost",(()=>this.fatalError=new o("webgl-context-lost"))),this.handles.add([this.updatingHandles.add((()=>this.qualitySettings.antialiasingEnabled),(()=>this._stage.renderView.setRenderParameters({antialiasingEnabled:this.qualitySettings.antialiasingEnabled})),_),this.updatingHandles.add((()=>this.qualitySettings.highQualityTransparency),(()=>this._stage.renderView.setRenderParameters({highQualityTransparency:this.qualitySettings.highQualityTransparency})),_),x(this,"magnifier",(e=>this._stage.renderView.magnifier=e),!0)],"stage");const p=()=>{this._stage.renderView.setRenderParameters({defaultHighlightOptions:Me.toEngineOptions(this.highlightOptions)})};this.handles.add(this.updatingHandles.add((()=>[this.highlightOptions.color,this.highlightOptions.haloColor,this.highlightOptions.haloOpacity,this.highlightOptions.fillOpacity,this.highlightOptions.shadowOpacity,this.highlightOptions.shadowColor,this.highlightOptions.shadowDifference]),p),"stage"),p(),this.renderCoordsHelper&&this.sceneIntersectionHelper.setTolerance(Le/this.renderCoordsHelper.unitInMeters),this._set("canvas",this._stage.renderView.canvas)}_exitStage(){this._set("sceneIntersectionHelper",null),this._stage.destroy(),this._stage=null,this._lostWebGLContextHandle.remove(),this._lostWebGLContextHandle=null,this.handles.remove("stage"),this._set("canvas",null)}_initSurface(e){this._exitSurface(),this.state.init(e,this.spatialReference),this._initStage(),this._initGlobe(),this.sharedSymbolResources=new Oe({view:this,viewingMode:e,resourceController:this._resourceController,pointsOfInterest:this.pointsOfInterest,viewState:this.state,objectResourceCache:new ue})}_exitSurface(){this.sharedSymbolResources&&(this.sharedSymbolResources.objectResourceCache.destroy(),this.sharedSymbolResources.destroy(),this.sharedSymbolResources=null,this._exitGlobe(),this._exitStage())}_createGraphicsViewIfNeeded(){if(this.graphicsView||this._createGraphicsViewController)return;if(0===this.graphics.length)return;this.handles.remove("graphics-view"),this._createGraphicsViewController=new AbortController;const e=()=>{this._createGraphicsViewController=null,this._updatingChanged()};this._createGraphicsViewAsync(this._createGraphicsViewController.signal).then(e,e),this._updatingChanged()}async _createGraphicsViewAsync(e){const t=(await import("./3d/layers/GraphicsView3D.js")).default;v(e),await V(this.basemapTerrain,"ready",e),this._set("graphicsView",new t({view:this}))}_disposeGraphicsView(){this._createGraphicsViewController&&(this._createGraphicsViewController.abort(),this._createGraphicsViewController=null),this.handles.remove("graphics-view"),f(this.graphicsView)&&(this.handles.remove(this.graphicsView.processor.layer.id),this.graphicsView.destroy(),this._set("graphicsView",null))}_startup(){const e=se(this.viewingMode);if(e===ie.Global&&(this._clippingArea=null),this._initSurface(e),this._set("ready",!0),this.handles.add(R(this,"graphics","after-changes",(()=>this._createGraphicsViewIfNeeded())),"graphics-view"),this._createGraphicsViewIfNeeded(),!this._externallySet.environment){const e=this.get("map.initialViewProperties.environment");e&&(this.environment=e)}this.labeler.setup(),this.environmentManager.connectView(this),this.inputManager.connect();const t=this._resolveWhenReady;this._resolveWhenReady=[],t.forEach((e=>e(this)))}_teardown(){this._initialDefaultSpatialReference=null,this.inputManager.disconnect(),this.environmentManager.disconnectView(),this.labeler.dispose(),this._disposeGraphicsView(),this.handles.remove("graphics-view"),this._exitSurface(),this._set("ready",!1)}_updateDefaultToMapOptions(){if(this._defaultToMapOptions.include.clear(),this.map){this.map.ground&&this._defaultToMapOptions.include.add(qe);for(const e of this.map.allLayers.items)"integrated-mesh"===e.type&&this._defaultToMapOptions.include.add(e.uid)}}_updateDefaultHitTestOptions(){if(this._defaultHitTestOptions.exclude.clear(),this.map){this.map.ground&&this.map.ground.opacity<1&&this._defaultHitTestOptions.exclude.add(qe);for(const e of this.map.allLayers.items)"integrated-mesh"===e.type&&e.opacity<1&&this._defaultToMapOptions.exclude.add(e.uid)}}getVoxelWasmPerSceneView(){return $.getInstance().getVoxelWasmPerSceneView(this)}};function st(e,t){e.layerUids||(e.layerUids=new Set),e.layerUids.add(t)}function nt(e,t){e.graphicUids||(e.graphicUids=new Set),e.graphicUids.add(t)}function at(e,t){return f(e)&&U(e.spatialReference,t)?A(e,t):null}var ot;e([E()],rt.prototype,"_userClippingArea",void 0),e([E()],rt.prototype,"_resourceController",void 0),e([E()],rt.prototype,"_stage",void 0),e([E({readOnly:!0})],rt.prototype,"deconflictor",void 0),e([E({readOnly:!0})],rt.prototype,"labeler",void 0),e([E({type:te,readOnly:!0,aliasOf:"state.animation"})],rt.prototype,"animation",void 0),e([E({readOnly:!0})],rt.prototype,"basemapTerrain",void 0),e([E({readOnly:!0})],rt.prototype,"elevationProvider",void 0),e([E({type:t,aliasOf:"stateManager.camera"})],rt.prototype,"camera",void 0),e([E({type:t,aliasOf:"stateManager.contentCamera"})],rt.prototype,"contentCamera",void 0),e([E({readOnly:!0})],rt.prototype,"canvas",void 0),e([E({type:tt,aliasOf:"stateManager.center"})],rt.prototype,"center",void 0),e([E({type:Ye})],rt.prototype,"clippingArea",null),e([E({type:oe})],rt.prototype,"constraints",void 0),e([E({type:Ye,readOnly:!0})],rt.prototype,"renderDataExtent",null),e([E({type:Ye,readOnly:!0})],rt.prototype,"dataExtent",null),e([E({type:Ye,readOnly:!0})],rt.prototype,"groundAndLayersExtent",null),e([E({value:null,type:le})],rt.prototype,"environment",null),e([j("environment")],rt.prototype,"castEnvironment",null),e([E({readOnly:!0})],rt.prototype,"environmentManager",void 0),e([E({type:Ye,aliasOf:"stateManager.extent"})],rt.prototype,"extent",void 0),e([E()],rt.prototype,"floors",void 0),e([E({readOnly:!0,aliasOf:"stateManager.screenCenter"})],rt.prototype,"screenCenter",void 0),e([E({type:Number})],rt.prototype,"pixelRatio",null),e([E({type:Number,dependsOn:["qualitySettings.maximumPixelRatio","qualitySettings.maximumRenderResolution","size"]})],rt.prototype,"maximumPixelRatio",null),e([E({aliasOf:"stateManager.frustum"})],rt.prototype,"frustum",void 0),e([E({type:Number,readOnly:!0})],rt.prototype,"fullOpacity",void 0),e([E({readOnly:!0})],rt.prototype,"graphicsView",void 0),e([E({readOnly:!0})],rt.prototype,"analysisViewManager",void 0),e([E()],rt.prototype,"groundView",void 0),e([E({type:Boolean})],rt.prototype,"initialExtentRequired",null),e([E()],rt.prototype,"_defaultsFromMapSettings",null),e([E({type:Boolean,readOnly:!0})],rt.prototype,"interacting",null),e([E()],rt.prototype,"stationary",null),e([E({aliasOf:"state.navigating"})],rt.prototype,"navigating",void 0),e([E()],rt.prototype,"map",void 0),e([E({readOnly:!0})],rt.prototype,"mapCoordsHelper",void 0),e([E({aliasOf:"stateManager.padding"})],rt.prototype,"padding",void 0),e([E({type:Pe,readOnly:!0})],rt.prototype,"pointsOfInterest",void 0),e([E({type:ge,readOnly:!0})],rt.prototype,"featureTiles",void 0),e([E()],rt.prototype,"featureTreeDebugger",void 0),e([E({type:Boolean})],rt.prototype,"screenSizePerspectiveEnabled",void 0),e([E({constructOnly:!0})],rt.prototype,"deactivatedWebGLExtensions",void 0),e([E({constructOnly:!0})],rt.prototype,"debugWebGLExtensions",void 0),e([E({constructOnly:!0})],rt.prototype,"renderCanvas",void 0),e([E({constructOnly:!0})],rt.prototype,"state",void 0),e([E({readOnly:!0})],rt.prototype,"inputManager",void 0),e([E({readOnly:!0})],rt.prototype,"stateManager",void 0),e([E({type:["low","medium","high"]})],rt.prototype,"qualityProfile",null),e([E({type:xe,get(){let e=this._get("qualitySettings");return e||(e=new xe,_e.apply(this.qualityProfile,e)),e}})],rt.prototype,"qualitySettings",void 0),e([E()],rt.prototype,"slicePlane",null),e([E({readOnly:!0})],rt.prototype,"typeSpecificPreconditionsReady",null),e([E({readOnly:!0})],rt.prototype,"renderCoordsHelper",void 0),e([E({readOnly:!0})],rt.prototype,"sceneIntersectionHelper",void 0),e([E({type:Number,dependsOn:["scale","spatialReference"],readOnly:!0})],rt.prototype,"resolution",null),e([E({type:Number,aliasOf:"stateManager.scale"})],rt.prototype,"scale",void 0),e([E()],rt.prototype,"heightModelInfo",null),e([E()],rt.prototype,"spatialReference",void 0),e([E({type:Boolean,constructOnly:!0})],rt.prototype,"alphaCompositingEnabled",void 0),e([E({type:Boolean})],rt.prototype,"supersampleScreenshotsEnabled",void 0),e([E({readOnly:!0})],rt.prototype,"type",void 0),e([E({type:Ze})],rt.prototype,"ui",void 0),e([E({type:Boolean,readOnly:!0,dependsOn:["graphicsView.updating","basemapView.updating","basemapTerrain.updating","layerViewManager.updating","layerViewManager.updatingRemaining","_resourceController.updating","_stage.updating","featureTiles.updating","pointsOfInterest.updating","environmentManager.updating","overlay.updating","updatingHandles.updating","featureTreeDebugger.updating","labeler.updating","deconflictor.updating","ready","stationary","inputManager.hasPendingInputs","toolViewManager.updating","analysisViewManager.updating"]})],rt.prototype,"updating",null),e([E({type:Number,readOnly:!0,dependsOn:["updating"]})],rt.prototype,"updatingProgress",void 0),e([E({type:["global","local"]})],rt.prototype,"viewingMode",null),e([E({type:s,aliasOf:"stateManager.viewpoint"})],rt.prototype,"viewpoint",void 0),e([E({type:Number,aliasOf:"stateManager.zoom"})],rt.prototype,"zoom",void 0),e([E({type:Me})],rt.prototype,"highlightOptions",void 0),rt=e([I("esri.views.SceneView")],rt),function(e){e[e.INCLUDE=0]="INCLUDE",e[e.EXCLUDE=1]="EXCLUDE"}(ot||(ot={}));const lt=H(),pt=P(),ht=q(),dt=rt;export{dt 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.23/esri/copyright.txt for details.
4
4
  */
5
- import{deg2rad as t}from"../../../../core/mathUtils.js";import{isSome as i,isNone as e}from"../../../../core/maybe.js";import{f as s,i as n,k as r}from"../../../../chunks/vec2.js";import{a as h}from"../../../../chunks/vec2f64.js";import{r as a,d as o,o as c,c as _,n as l,b as p,a as d,y as g,g as f}from"../../../../chunks/vec3.js";import{c as u,f as m}from"../../../../chunks/vec3f64.js";import{create as D,fromPositionAndNormal as E,signedDistance as x,copy as b,intersectLine as I,normal as V}from"../../../../geometry/support/plane.js";import{angle as M,projectPointSignedLength as y}from"../../../../geometry/support/vector.js";import{intersectLineAndRay as N,LineType as P}from"../../../support/geometry2dUtils.js";class X{constructor(t,i,e,s=0,n=v.IMMEDIATE){this.helper=t,this.planeType=i,this.edge=e,this.distance=s,this._plane=D(),this._offsetPlane=D(),this._minDistance=-1/0,this._maxDistance=1/0,n===v.IMMEDIATE&&this._initialize()}get plane(){return this._plane}get requiresSplitEdgeLeft(){return!this._left.isOriginalDirection}get requiresSplitEdgeRight(){return!this._right.isOriginalDirection}get edgeDirection(){return this._edgeDirection}_initialize(){this._initializeNeighbors(),this._initializePlane(),this._initializeDistanceConstraints()}_initializeNeighbors(){var t,i,e,s;const n=this._toXYZ(this.edge.leftVertex.pos),r=this._toXYZ(null==(t=this.edge.leftVertex.leftEdge)||null==(i=t.leftVertex)?void 0:i.pos),h=this._toXYZ(this.edge.rightVertex.pos),o=this._toXYZ(null==(e=this.edge.rightVertex.rightEdge)||null==(s=e.rightVertex)?void 0:s.pos);this._edgeDirection=a(u(),n,h),this._left=this._computeNeighbor(n,r,this._edgeDirection),this._right=this._computeNeighbor(h,o,this._edgeDirection)}_toXYZ(t){return i(t)?this.helper.toXYZ(t):null}_computeNeighbor(t,i,s){if(e(i))return{start:t,end:i,direction:m(-s[1],s[0],0),isOriginalDirection:!0};const n=a(u(),t,i),r=!this._passesBisectingAngleThreshold(n,s);return{start:t,end:i,direction:r?this._bisectVectorsPerpendicular(s,n):n,isOriginalDirection:!r}}_passesBisectingAngleThreshold(t,i){const e=Math.abs(M(i,t));return e>=Y&&e<=Math.PI-Y}_bisectVectorsPerpendicular(t,i){const e=o(t,i)<0?t:c(u(),t),s=Math.abs(o(e,i));if(!(s<.001||s>.999))return this._bisectDirection(e,i);const n=_(u(),e,[0,0,1]);return l(n,n)}_bisectDirection(t,i){const e=p(u(),t,i);return l(e,e)}_initializePlane(){const t=this._computeNormalDirection(this._left),i=this._computeNormalDirection(this._right);o(t,i)<0&&c(i,i),E(this._left.start,this._bisectDirection(t,i),this._plane)}_computeNormalDirection(t){const i=_(u(),t.direction,this._edgeDirection);l(i,i);const e=_(u(),this._edgeDirection,i);return this.planeType===T.XY&&(e[2]=0),l(e,e)}_initializeDistanceConstraints(){i(this._left.end)&&!this.requiresSplitEdgeLeft&&this._updateDistanceConstraint(x(this._plane,this._left.end)),i(this._right.end)&&!this.requiresSplitEdgeRight&&this._updateDistanceConstraint(x(this._plane,this._right.end)),this._updateIntersectDistanceConstraint(this._plane)}_updateDistanceConstraint(t){t<=0&&(this._minDistance=Math.max(this._minDistance,t)),t>=0&&(this._maxDistance=Math.min(this._maxDistance,t))}_updateIntersectDistanceConstraint(t){const i=V(t),e=this._edgeDirection,a=p(u(),this._left.start,this._left.direction),o=p(u(),this._right.start,this._right.direction),c=this._pointInBasis2D(h(),i,e,this._left.start),_=this._pointInBasis2D(h(),i,e,a),l=this._pointInBasis2D(h(),i,e,this._right.start),g=this._pointInBasis2D(h(),i,e,o),[f]=N({start:_,end:c,type:P.LINE},{start:g,end:l,type:P.LINE});if(!f)return;const m=s(h(),c,_);n(m,m);const D=s(h(),f,_),E=r(m,D),b=p(u(),a,d(u(),this._left.direction,-E)),I=x(t,b);this._updateDistanceConstraint(I)}_pointInBasis2D(t,i,e,s){return t[0]=y(i,s),t[1]=y(e,s),t}_offset(t,e){Number.isFinite(this._minDistance)&&(e=Math.max(this._minDistance,e)),Number.isFinite(this._maxDistance)&&(e=Math.min(this._maxDistance,e)),b(this._plane,this._offsetPlane),this._offsetPlane[3]-=e;const s=(t,e,s)=>i(e)&&I(this._offsetPlane,t,p(u(),t,e),s),n=u();(t===this.edge.leftVertex?s(this._left.start,this._left.direction,n):s(this._right.start,this._right.direction,n))&&this.helper.copy(this.helper.fromXYZ(n,void 0,this.helper.getM(t.pos)),t.pos)}signedDistanceToPoint(t){return x(this.plane,this.helper.toXYZ(this.helper.pointToVector(t)))}apply(t){this._offset(t,this.distance)}undo(t){this._offset(t,0)}canAccumulate(t){return t instanceof X&&this.edge.leftVertex.index===t.edge.leftVertex.index&&this.edge.rightVertex.index===t.edge.rightVertex.index&&this.edge.component===t.edge.component&&this._maybeEqualsVec3(this._left.direction,t._left.direction)&&this._maybeEqualsVec3(this._right.direction,t._right.direction)&&g(V(this._plane),V(t._plane))}accumulate(t,i){const e=this._plane[3]-i._plane[3]+i.distance;this._offset(t,e)}accumulateParams(t){const i=t.distance-t._plane[3];this.distance=i+this._plane[3]}clone(){const t=new X(this.helper,this.planeType,this.edge,this.distance,v.DEFERRED);return b(this._plane,t._plane),b(this._offsetPlane,t._offsetPlane),t._maxDistance=this._maxDistance,t._minDistance=this._minDistance,t._left=this._cloneNeighbor(this._left),t._right=this._cloneNeighbor(this._right),t._edgeDirection=f(u(),this._edgeDirection),t}_maybeEqualsVec3(t,s){return e(t)&&e(s)||i(t)&&i(s)&&g(t,s)}_cloneNeighbor({start:t,end:e,direction:s,isOriginalDirection:n}){return{start:f(u(),t),end:i(e)?f(u(),e):null,direction:f(u(),s),isOriginalDirection:n}}}const Y=t(15);var T,v;!function(t){t[t.XYZ=0]="XYZ",t[t.XY=1]="XY"}(T||(T={})),function(t){t[t.IMMEDIATE=0]="IMMEDIATE",t[t.DEFERRED=1]="DEFERRED"}(v||(v={}));export{X as OffsetEdgeVertex,T as PlaneType};
5
+ import{deg2rad as t}from"../../../../core/mathUtils.js";import{isSome as i,isNone as e}from"../../../../core/maybe.js";import{f as s,i as n,k as r}from"../../../../chunks/vec2.js";import{a as h}from"../../../../chunks/vec2f64.js";import{r as a,d as o,o as c,c as _,n as l,b as p,a as d,y as g,g as f}from"../../../../chunks/vec3.js";import{c as u,f as m}from"../../../../chunks/vec3f64.js";import{create as D,fromPositionAndNormal as E,signedDistance as x,copy as b,intersectLine as I,normal as V}from"../../../../geometry/support/plane.js";import{angle as M,projectPointSignedLength as y}from"../../../../geometry/support/vector.js";import{intersectLineAndRay as N,LineType as P}from"../../../support/geometry2dUtils.js";class X{constructor(t,i,e,s=0,n=v.IMMEDIATE){this.helper=t,this.planeType=i,this.edge=e,this.distance=s,this._plane=D(),this._offsetPlane=D(),this._minDistance=-1/0,this._maxDistance=1/0,n===v.IMMEDIATE&&this._initialize()}get plane(){return this._plane}get requiresSplitEdgeLeft(){return!this._left.isOriginalDirection}get requiresSplitEdgeRight(){return!this._right.isOriginalDirection}get edgeDirection(){return this._edgeDirection}_initialize(){this._initializeNeighbors(),this._initializePlane(),this._initializeDistanceConstraints()}_initializeNeighbors(){var t,i,e,s;const n=this._toXYZ(this.edge.leftVertex.pos),r=this._toXYZ(null==(t=this.edge.leftVertex.leftEdge)||null==(i=t.leftVertex)?void 0:i.pos),h=this._toXYZ(this.edge.rightVertex.pos),o=this._toXYZ(null==(e=this.edge.rightVertex.rightEdge)||null==(s=e.rightVertex)?void 0:s.pos);this._edgeDirection=a(u(),n,h),this._left=this._computeNeighbor(n,r,this._edgeDirection),this._right=this._computeNeighbor(h,o,this._edgeDirection)}_toXYZ(t){return i(t)?this.helper.toXYZ(t):null}_computeNeighbor(t,i,s){if(e(i))return{start:t,end:i,direction:m(-s[1],s[0],0),isOriginalDirection:!0};const n=a(u(),t,i),r=!this._passesBisectingAngleThreshold(n,s);return{start:t,end:i,direction:r?this._bisectVectorsPerpendicular(s,n):n,isOriginalDirection:!r}}_passesBisectingAngleThreshold(t,i){const e=Math.abs(M(i,t));return e>=Y&&e<=Math.PI-Y}_bisectVectorsPerpendicular(t,i){const e=o(t,i)<0?t:c(u(),t),s=Math.abs(o(e,i));if(!(s<.001||s>.999))return this._bisectDirection(e,i);const n=_(u(),e,[0,0,1]);return l(n,n)}_bisectDirection(t,i){const e=p(u(),t,i);return l(e,e)}_initializePlane(){const t=this._computeNormalDirection(this._left),i=this._computeNormalDirection(this._right);o(t,i)<0&&c(i,i),E(this._left.start,this._bisectDirection(t,i),this._plane)}_computeNormalDirection(t){const i=_(u(),t.direction,this._edgeDirection);l(i,i);const e=_(u(),this._edgeDirection,i);return this.planeType===T.XY&&(e[2]=0),l(e,e)}_initializeDistanceConstraints(){i(this._left.end)&&!this.requiresSplitEdgeLeft&&this._updateDistanceConstraint(x(this._plane,this._left.end)),i(this._right.end)&&!this.requiresSplitEdgeRight&&this._updateDistanceConstraint(x(this._plane,this._right.end)),this._updateIntersectDistanceConstraint(this._plane)}_updateDistanceConstraint(t){t<=0&&(this._minDistance=Math.max(this._minDistance,t)),t>=0&&(this._maxDistance=Math.min(this._maxDistance,t))}_updateIntersectDistanceConstraint(t){const i=V(t),e=this._edgeDirection,a=p(u(),this._left.start,this._left.direction),o=p(u(),this._right.start,this._right.direction),c=this._pointInBasis2D(h(),i,e,this._left.start),_=this._pointInBasis2D(h(),i,e,a),l=this._pointInBasis2D(h(),i,e,this._right.start),g=this._pointInBasis2D(h(),i,e,o),[f]=N({start:_,end:c,type:P.LINE},{start:g,end:l,type:P.LINE});if(!f)return;const m=s(h(),c,_);n(m,m);const D=s(h(),f,_),E=r(m,D),b=p(u(),a,d(u(),this._left.direction,-E)),I=x(t,b);this._updateDistanceConstraint(I)}_pointInBasis2D(t,i,e,s){return t[0]=y(i,s),t[1]=y(e,s),t}_offset(t,e){Number.isFinite(this._minDistance)&&(e=Math.max(this._minDistance,e)),Number.isFinite(this._maxDistance)&&(e=Math.min(this._maxDistance,e)),b(this._offsetPlane,this._plane),this._offsetPlane[3]-=e;const s=(t,e,s)=>i(e)&&I(this._offsetPlane,t,p(u(),t,e),s),n=u();(t===this.edge.leftVertex?s(this._left.start,this._left.direction,n):s(this._right.start,this._right.direction,n))&&this.helper.copy(this.helper.fromXYZ(n,void 0,this.helper.getM(t.pos)),t.pos)}signedDistanceToPoint(t){return x(this.plane,this.helper.toXYZ(this.helper.pointToVector(t)))}apply(t){this._offset(t,this.distance)}undo(t){this._offset(t,0)}canAccumulate(t){return t instanceof X&&this.edge.leftVertex.index===t.edge.leftVertex.index&&this.edge.rightVertex.index===t.edge.rightVertex.index&&this.edge.component===t.edge.component&&this._maybeEqualsVec3(this._left.direction,t._left.direction)&&this._maybeEqualsVec3(this._right.direction,t._right.direction)&&g(V(this._plane),V(t._plane))}accumulate(t,i){const e=this._plane[3]-i._plane[3]+i.distance;this._offset(t,e)}accumulateParams(t){const i=t.distance-t._plane[3];this.distance=i+this._plane[3]}clone(){const t=new X(this.helper,this.planeType,this.edge,this.distance,v.DEFERRED);return b(t._plane,this._plane),b(t._offsetPlane,this._offsetPlane),t._maxDistance=this._maxDistance,t._minDistance=this._minDistance,t._left=this._cloneNeighbor(this._left),t._right=this._cloneNeighbor(this._right),t._edgeDirection=f(u(),this._edgeDirection),t}_maybeEqualsVec3(t,s){return e(t)&&e(s)||i(t)&&i(s)&&g(t,s)}_cloneNeighbor({start:t,end:e,direction:s,isOriginalDirection:n}){return{start:f(u(),t),end:i(e)?f(u(),e):null,direction:f(u(),s),isOriginalDirection:n}}}const Y=t(15);var T,v;!function(t){t[t.XYZ=0]="XYZ",t[t.XY=1]="XY"}(T||(T={})),function(t){t[t.IMMEDIATE=0]="IMMEDIATE",t[t.DEFERRED=1]="DEFERRED"}(v||(v={}));export{X as OffsetEdgeVertex,T as PlaneType};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import s from"../../core/Accessor.js";import t from"../../core/Handles.js";import{isNone as i}from"../../core/maybe.js";import{watch as n,on as d,sync as r}from"../../core/reactiveUtils.js";import{schedule as a}from"../../core/scheduling.js";import{property as o}from"../../core/accessorSupport/decorators/property.js";import{subclass as h}from"../../core/accessorSupport/decorators/subclass.js";let c=class extends s{constructor(){super(...arguments),this.updating=!1,this.handleId=0,this.handles=new t,this.scheduleHandleId=0,this.pendingPromises=new Set}destroy(){this.removeAll(),this.handles.destroy()}add(e,s,t={}){const i=++this.handleId;t.sync||this._installSyncUpdatingWatch(e,i);const d=n(e,s,t);return this.handles.add(d,i),{remove:()=>this.handles.remove(i)}}addOnCollectionChange(e,s,{initial:t=!1}={}){const i=++this.handleId;return this.handles.add([d(e,"after-changes",this._createSyncUpdatingCallback(),r),d(e,"change",s,{onListenerAdd:t?e=>s({added:e.items,removed:[],moved:[],target:e}):void 0})],i),{remove:()=>this.handles.remove(i)}}addPromise(e){if(i(e))return e;const s=++this.handleId;this.handles.add({remove:()=>{this.pendingPromises.delete(e)&&(0!==this.pendingPromises.size||this.handles.has(l)||this._set("updating",!1))}},s),this.pendingPromises.add(e),this._set("updating",!0);const t=()=>this.handles.remove(s);return e.then(t,t),e}removeAll(){this.pendingPromises.clear(),this.handles.removeAll(),this._set("updating",!1)}_installSyncUpdatingWatch(e,s){const t=this._createSyncUpdatingCallback(),i=n(e,t,{sync:!0,equals:()=>!1});return this.handles.add(i,s),i}_createSyncUpdatingCallback(){return()=>{this.handles.remove(l),++this.scheduleHandleId;const e=this.scheduleHandleId;this._get("updating")||this._set("updating",!0),this.handles.add(a((()=>{e===this.scheduleHandleId&&(this._set("updating",this.pendingPromises.size>0),this.handles.remove(l))})),l)}}};e([o({readOnly:!0})],c.prototype,"updating",void 0),c=e([h("esri.views.support.WatchUpdatingTracking")],c);const l=-42;var p;!function(e){e[e.NONE=0]="NONE",e[e.SYNC=1]="SYNC",e[e.INIT=2]="INIT"}(p||(p={}));export{p as WatchFlags,c as WatchUpdatingTracking};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import s from"../../core/Accessor.js";import t from"../../core/Handles.js";import{isNone as i}from"../../core/maybe.js";import{watch as n,on as d,sync as r}from"../../core/reactiveUtils.js";import{schedule as a}from"../../core/scheduling.js";import{property as o}from"../../core/accessorSupport/decorators/property.js";import{subclass as h}from"../../core/accessorSupport/decorators/subclass.js";let c=class extends s{constructor(){super(...arguments),this.updating=!1,this.handleId=0,this.handles=new t,this.scheduleHandleId=0,this.pendingPromises=new Set}destroy(){this.removeAll(),this.handles.destroy()}add(e,s,t={}){const i=++this.handleId;t.sync||this._installSyncUpdatingWatch(e,i);const d=n(e,s,t);return this.handles.add(d,i),{remove:()=>this.handles.remove(i)}}addOnCollectionChange(e,s,{initial:t=!1}={}){const i=++this.handleId;return this.handles.add([d(e,"after-changes",this._createSyncUpdatingCallback(),r),d(e,"change",s,{onListenerAdd:t?e=>s({added:e.toArray(),removed:[]}):void 0})],i),{remove:()=>this.handles.remove(i)}}addPromise(e){if(i(e))return e;const s=++this.handleId;this.handles.add({remove:()=>{this.pendingPromises.delete(e)&&(0!==this.pendingPromises.size||this.handles.has(l)||this._set("updating",!1))}},s),this.pendingPromises.add(e),this._set("updating",!0);const t=()=>this.handles.remove(s);return e.then(t,t),e}removeAll(){this.pendingPromises.clear(),this.handles.removeAll(),this._set("updating",!1)}_installSyncUpdatingWatch(e,s){const t=this._createSyncUpdatingCallback(),i=n(e,t,{sync:!0,equals:()=>!1});return this.handles.add(i,s),i}_createSyncUpdatingCallback(){return()=>{this.handles.remove(l),++this.scheduleHandleId;const e=this.scheduleHandleId;this._get("updating")||this._set("updating",!0),this.handles.add(a((()=>{e===this.scheduleHandleId&&(this._set("updating",this.pendingPromises.size>0),this.handles.remove(l))})),l)}}};e([o({readOnly:!0})],c.prototype,"updating",void 0),c=e([h("esri.views.support.WatchUpdatingTracking")],c);const l=-42;var p;!function(e){e[e.NONE=0]="NONE",e[e.SYNC=1]="SYNC",e[e.INIT=2]="INIT"}(p||(p={}));export{p as WatchFlags,c as WatchUpdatingTracking};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import t from"../../core/Logger.js";import{isSome as e}from"../../core/maybe.js";import{isUint16Array as i,isUint32Array as s}from"../../core/typedArrayUtil.js";import{checkWebGLError as r}from"./checkWebGLError.js";import{ContextType as n}from"./context-util.js";import{BufferType as f,ResourceType as o,Usage as _,DataType as h}from"./enums.js";const a=t.getLogger("esri.views.webgl.BufferObject");class u{constructor(t,e,i,s){this._context=t,this.bufferType=e,this.usage=i,this._glName=null,this._size=-1,this._indexType=void 0,t.instanceCounter.increment(o.Buffer,this),this._glName=this._context.gl.createBuffer(),r(this._context.gl),s&&this.setData(s)}static createIndex(t,e,i){return new u(t,f.ELEMENT_ARRAY_BUFFER,e,i)}static createVertex(t,e,i){return new u(t,f.ARRAY_BUFFER,e,i)}static createUniform(t,e,i){return new u(t,f.UNIFORM_BUFFER,e,i)}static createPixelPack(t,e=_.STREAM_READ,i){const s=new u(t,f.PIXEL_PACK_BUFFER,e);return i&&s.setSize(i),s}static createPixelUnpack(t,e=_.STREAM_DRAW,i){return new u(t,f.PIXEL_UNPACK_BUFFER,e,i)}get glName(){return this._glName}get size(){return this._size}get indexType(){return this._indexType}get byteSize(){return this.bufferType===f.ELEMENT_ARRAY_BUFFER?this._indexType===h.UNSIGNED_INT?4*this._size:2*this._size:this._size}get _isVAOAware(){return this.bufferType===f.ELEMENT_ARRAY_BUFFER||this.bufferType===f.ARRAY_BUFFER}dispose(){var t;if(null!=(t=this._context)&&t.gl){if(this._glName){this._context.gl.deleteBuffer(this._glName),this._glName=null}this._context.instanceCounter.decrement(o.Buffer,this),this._context=null}else this._glName&&a.warn("Leaked WebGL buffer object")}setSize(t,i=null){if(t<=0&&a.error("Buffer size needs to be positive!"),this.bufferType===f.ELEMENT_ARRAY_BUFFER&&e(i))switch(this._indexType=i,i){case h.UNSIGNED_SHORT:t*=2;break;case h.UNSIGNED_INT:t*=4}this._setBufferData(t)}setData(t){if(!t)return;let e=t.byteLength;this.bufferType===f.ELEMENT_ARRAY_BUFFER&&(i(t)&&(e/=2,this._indexType=h.UNSIGNED_SHORT),s(t)&&(e/=4,this._indexType=h.UNSIGNED_INT)),this._setBufferData(e,t)}_setBufferData(t,i=null){this._size=t;const s=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const n=this._context.gl;e(i)?n.bufferData(this.bufferType,i,this.usage):n.bufferData(this.bufferType,t,this.usage),r(n),this._isVAOAware&&this._context.bindVAO(s)}setSubData(t,e=0,n=0,o=t.byteLength){if(!t)return;(e<0||e>=this._size)&&a.error("offset is out of range!");let _=e,h=n,u=o,c=t.byteLength;this.bufferType===f.ELEMENT_ARRAY_BUFFER&&(i(t)?(c/=2,_*=2,h*=2,u*=2):s(t)&&(c/=4,_*=4,h*=4,u*=4)),void 0===o&&(o=c-1),n>=o&&a.error("end must be bigger than start!"),e+n-o>this._size&&a.error("An attempt to write beyond the end of the buffer!");const b=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const E=this._context.gl,A=ArrayBuffer.isView(t)?t.buffer:t,l=0===h&&u===t.byteLength?A:A.slice(h,u);E.bufferSubData(this.bufferType,_,l),r(E),this._isVAOAware&&this._context.bindVAO(b)}setSubDataFromView(t,e,i,s){if(!t)return;(e<0||e>=this._size)&&a.error("offset is out of range!"),i>=s&&a.error("end must be bigger than start!"),e+i-s>this._size&&a.error("An attempt to write beyond the end of the buffer!");const f=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const o=this._context.gl;if(this._context.type===n.WEBGL2)o.bufferSubData(this.bufferType,e*t.BYTES_PER_ELEMENT,t,i,s-i);else{const r=0===i&&s===t.length?t:t.subarray(i,s);o.bufferSubData(this.bufferType,e*t.BYTES_PER_ELEMENT,r)}r(o),this._isVAOAware&&this._context.bindVAO(f)}getSubData(t,e=0,i,s){if(this._context.type!==n.WEBGL2)return void a.error("Get buffer subdata is only supported in WebGL2!");const r=this._context.gl;this._context.bindBuffer(this,f.COPY_READ_BUFFER),r.getBufferSubData(f.COPY_READ_BUFFER,e,t,i,s),this._context.unbindBuffer(f.COPY_READ_BUFFER)}async getSubDataAsync(t,e=0,i,s){this._context.type===n.WEBGL2?(await this._context.clientWaitAsync(),this.getSubData(t,e,i,s)):a.error("Get buffer subdata is only supported in WebGL2!")}}export{u as BufferObject};
5
+ import{isArrayLike as e}from"../../core/arrayUtils.js";import t from"../../core/Logger.js";import{isSome as r}from"../../core/maybe.js";import{isUint16Array as i,isUint32Array as s}from"../../core/typedArrayUtil.js";import{checkWebGLError as n}from"./checkWebGLError.js";import{ContextType as o}from"./context-util.js";import{BufferType as f,ResourceType as a,Usage as u,DataType as h}from"./enums.js";const _=t.getLogger("esri.views.webgl.BufferObject");function b(t){return e(t)}class c{constructor(e,t,r,i){this._context=e,this.bufferType=t,this.usage=r,this._glName=null,this._size=-1,this._indexType=void 0,e.instanceCounter.increment(a.Buffer,this),this._glName=this._context.gl.createBuffer(),n(this._context.gl),i&&this.setData(i)}static createIndex(e,t,r){return new c(e,f.ELEMENT_ARRAY_BUFFER,t,r)}static createVertex(e,t,r){return new c(e,f.ARRAY_BUFFER,t,r)}static createUniform(e,t,r){if(e.type!==o.WEBGL2)throw new Error("Uniform buffers are supported in WebGL2 only!");return new c(e,f.UNIFORM_BUFFER,t,r)}static createPixelPack(e,t=u.STREAM_READ,r){if(e.type!==o.WEBGL2)throw new Error("Pixel pack buffers are supported in WebGL2 only!");const i=new c(e,f.PIXEL_PACK_BUFFER,t);return r&&i.setSize(r),i}static createPixelUnpack(e,t=u.STREAM_DRAW,r){if(e.type!==o.WEBGL2)throw new Error("Pixel unpack buffers are supported in WebGL2 only!");return new c(e,f.PIXEL_UNPACK_BUFFER,t,r)}get glName(){return this._glName}get size(){return this._size}get indexType(){return this._indexType}get byteSize(){return this.bufferType===f.ELEMENT_ARRAY_BUFFER?this._indexType===h.UNSIGNED_INT?4*this._size:2*this._size:this._size}get _isVAOAware(){return this.bufferType===f.ELEMENT_ARRAY_BUFFER||this.bufferType===f.ARRAY_BUFFER}dispose(){var e;if(null!=(e=this._context)&&e.gl){if(this._glName){this._context.gl.deleteBuffer(this._glName),this._glName=null}this._context.instanceCounter.decrement(a.Buffer,this),this._context=null}else this._glName&&_.warn("Leaked WebGL buffer object")}setSize(e,t=null){if(e<=0&&_.error("Buffer size needs to be positive!"),this.bufferType===f.ELEMENT_ARRAY_BUFFER&&r(t))switch(this._indexType=t,t){case h.UNSIGNED_SHORT:e*=2;break;case h.UNSIGNED_INT:e*=4}this._setBufferData(e)}setData(e){if(!e)return;let t=e.byteLength;this.bufferType===f.ELEMENT_ARRAY_BUFFER&&(i(e)&&(t/=2,this._indexType=h.UNSIGNED_SHORT),s(e)&&(t/=4,this._indexType=h.UNSIGNED_INT)),this._setBufferData(t,e)}_setBufferData(e,t=null){this._size=e;const i=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const s=this._context.gl;r(t)?s.bufferData(this.bufferType,t,this.usage):s.bufferData(this.bufferType,e,this.usage),n(s),this._isVAOAware&&this._context.bindVAO(i)}setSubData(e,t=0,r=0,o=e.byteLength){if(!e)return;(t<0||t>=this._size)&&_.error("offset is out of range!");let a=t,u=r,h=o,b=e.byteLength;this.bufferType===f.ELEMENT_ARRAY_BUFFER&&(i(e)?(b/=2,a*=2,u*=2,h*=2):s(e)&&(b/=4,a*=4,u*=4,h*=4)),void 0===o&&(o=b-1),r>=o&&_.error("end must be bigger than start!"),t+r-o>this._size&&_.error("An attempt to write beyond the end of the buffer!");const c=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const E=this._context.gl,l=ArrayBuffer.isView(e)?e.buffer:e,d=0===u&&h===e.byteLength?l:l.slice(u,h);E.bufferSubData(this.bufferType,a,d),n(E),this._isVAOAware&&this._context.bindVAO(c)}setSubDataFromView(e,t,r,i){if(!e)return;(t<0||t>=this._size)&&_.error("offset is out of range!"),r>=i&&_.error("end must be bigger than start!"),t+r-i>this._size&&_.error("An attempt to write beyond the end of the buffer!");const s=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const f=this._context.gl;if(this._context.type===o.WEBGL2)f.bufferSubData(this.bufferType,t*e.BYTES_PER_ELEMENT,e,r,i-r);else{const s=0===r&&i===e.length?e:e.subarray(r,i);f.bufferSubData(this.bufferType,t*e.BYTES_PER_ELEMENT,s)}n(f),this._isVAOAware&&this._context.bindVAO(s)}getSubData(e,t=0,r,i){if(this._context.type!==o.WEBGL2)return void _.error("Get buffer subdata is supported in WebGL2 only!");if(r<0||i<0)return void _.error("Problem getting subdata: offset and length were less than zero!");const s=b(e)?e.BYTES_PER_ELEMENT:1;if(s*((null!=r?r:0)+(null!=i?i:0))>e.byteLength)return void _.error("Problem getting subdata: offset and length exceeded destination size!");t+s*(null!=i?i:0)>this.byteSize&&_.warn("Potential problem getting subdata: requested data exceeds buffer size!");const n=this._context.gl;this._context.bindBuffer(this,f.COPY_READ_BUFFER),n.getBufferSubData(f.COPY_READ_BUFFER,t,e,r,i),this._context.unbindBuffer(f.COPY_READ_BUFFER)}async getSubDataAsync(e,t=0,r,i){this._context.type===o.WEBGL2?(await this._context.clientWaitAsync(),this.getSubData(e,t,r,i)):_.error("Get buffer subdata is supported in WebGL2 only!")}}export{c as BufferObject};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{AllocationTracer as t}from"../support/AllocationTracer.js";import{ResourceType as r}from"./enums.js";const e=!1;class s{constructor(){for(this._current=new Array,this._max=new Array,this._allocations=new t(e);this._current.length<r.COUNT;)this._current.push(0),this._max.push(0)}resetMax(){for(this._max.length=0;this._max.length<this._current.length;)this._max.push(0)}increment(t,r){const e=++this._current[t];this._max[t]=Math.max(e,this._max[t]),this._allocations.add(r)}decrement(t,r){--this._current[t],this._allocations.remove(r)}get max(){return this._max}get current(){return this._current}get total(){return this.current.reduce(((t,r)=>t+r),0)}printResourceCount(){if(this.total>0){console.log("Live objects:");for(let t=0;t<r.COUNT;++t){const e=this._current[t];e>0&&console.log(`${r[t]}: ${e}`)}}this._allocations.print()}}export{s as InstanceCounter};
5
+ import{AllocationTracer as t}from"../support/AllocationTracer.js";import{ResourceType as r}from"./enums.js";class s{constructor(){this.RECORD_ALLOCATIONS=!1}}const e=new s;class n{constructor(){for(this._current=new Array,this._max=new Array,this._allocations=new t(e.RECORD_ALLOCATIONS);this._current.length<r.COUNT;)this._current.push(0),this._max.push(0)}resetMax(){for(this._max.length=0;this._max.length<this._current.length;)this._max.push(0)}increment(t,r){const s=++this._current[t];this._max[t]=Math.max(s,this._max[t]),this._allocations.add(r)}decrement(t,r){--this._current[t],this._allocations.remove(r)}get max(){return this._max}get current(){return this._current}get total(){return this.current.reduce(((t,r)=>t+r),0)}printResourceCount(){if(this.total>0){console.log("Live objects:");for(let t=0;t<r.COUNT;++t){const s=this._current[t];s>0&&console.log(`${r[t]}: ${s}`)}}this._allocations.print()}}export{n as InstanceCounter,e as test};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import"../../core/has.js";import{isSome as t,isNone as o}from"../../core/maybe.js";import{webglValidateShadersEnabled as i}from"./checkWebGLError.js";import{ContextType as n}from"./context-util.js";import{ShaderType as r,ResourceType as e}from"./enums.js";import{transpileShader as s}from"./ShaderTranspiler.js";const m=4294967295;class f{constructor(t,o,i,n,s=new Map){this._context=t,this._locations=n,this._uniformBlockBindings=s,this._refCount=1,this._nameToUniformLocation={},this._nameToUniform1={},this._nameToUniform1v={},this._nameToUniform2={},this._nameToUniform3={},this._nameToUniform4={},this._nameToUniformMatrix3={},this._nameToUniformMatrix4={},t||console.error("RenderingContext isn't initialized!"),0===o.length&&console.error("Shaders source should not be empty!"),this._vShader=h(this._context,r.VERTEX_SHADER,o),this._fShader=h(this._context,r.FRAGMENT_SHADER,i),this._vShader&&this._fShader||console.error("Error loading shaders!"),this._context.instanceCounter.increment(e.Shader,this)}get glName(){if(t(this._glName))return this._glName;if(o(this._vShader))return null;const r=this._context.gl,s=r.createProgram();if(r.attachShader(s,this._vShader),r.attachShader(s,this._fShader),this._locations.forEach(((t,o)=>r.bindAttribLocation(s,t,o))),r.linkProgram(s),i()&&!r.getProgramParameter(s,r.LINK_STATUS)&&console.error(`Could not link shader\nvalidated: ${r.getProgramParameter(s,r.VALIDATE_STATUS)}, gl error ${r.getError()}, vertex: ${r.getShaderParameter(this._vShader,r.COMPILE_STATUS)}, fragment: ${r.getShaderParameter(this._fShader,r.COMPILE_STATUS)}, info log: ${r.getProgramInfoLog(s)}`),this._context.type===n.WEBGL2){const t=r;for(const[o,i]of this._uniformBlockBindings){const n=t.getUniformBlockIndex(s,o);n<m&&t.uniformBlockBinding(s,n,i)}}return this._glName=s,this._context.instanceCounter.increment(e.Program,this),s}get hasGLName(){return t(this._glName)}dispose(){if(--this._refCount>0)return;const t=this._context.gl;this._vShader&&(t.deleteShader(this._vShader),this._vShader=null,this._context.instanceCounter.decrement(e.Shader,this)),this._fShader&&(t.deleteShader(this._fShader),this._fShader=null),this._glName&&(t.deleteProgram(this._glName),this._glName=null,this._context.instanceCounter.decrement(e.Program,this))}ref(){++this._refCount}_getUniformLocation(t){return void 0===this._nameToUniformLocation[t]&&(this._nameToUniformLocation[t]=this._context.gl.getUniformLocation(this.glName,t)),this._nameToUniformLocation[t]}hasUniform(t){return null!==this._getUniformLocation(t)}setUniform1i(t,o){const i=this._nameToUniform1[t];if(void 0===i||o!==i){this._context.gl.uniform1i(this._getUniformLocation(t),o),this._nameToUniform1[t]=o}}setUniform1iv(t,o){const i=this._nameToUniform1v[t];if(a(i,o)){this._context.gl.uniform1iv(this._getUniformLocation(t),o),void 0===i?this._nameToUniform1v[t]=Array.from(o):g(o,i)}}setUniform2iv(t,o){const i=this._nameToUniform2[t];if(a(i,o)){this._context.gl.uniform2iv(this._getUniformLocation(t),o),void 0===i?this._nameToUniform2[t]=Array.from(o):g(o,i)}}setUniform3iv(t,o){const i=this._nameToUniform3[t];if(a(i,o)){this._context.gl.uniform3iv(this._getUniformLocation(t),o),void 0===i?this._nameToUniform3[t]=Array.from(o):g(o,i)}}setUniform4iv(t,o){const i=this._nameToUniform4[t];if(a(i,o)){this._context.gl.uniform4iv(this._getUniformLocation(t),o),void 0===i?this._nameToUniform4[t]=Array.from(o):g(o,i)}}setUniform1f(t,o){const i=this._nameToUniform1[t];if(void 0===i||o!==i){this._context.gl.uniform1f(this._getUniformLocation(t),o),this._nameToUniform1[t]=o}}setUniform1fv(t,o){const i=this._nameToUniform1v[t];if(a(i,o)){this._context.gl.uniform1fv(this._getUniformLocation(t),o),void 0===i?this._nameToUniform1v[t]=Array.from(o):g(o,i)}}setUniform2f(t,o,i){const n=this._nameToUniform2[t];if(void 0===n||o!==n[0]||i!==n[1]){this._context.gl.uniform2f(this._getUniformLocation(t),o,i),void 0===n?this._nameToUniform2[t]=[o,i]:(n[0]=o,n[1]=i)}}setUniform2fv(t,o){const i=this._nameToUniform2[t];if(a(i,o)){this._context.gl.uniform2fv(this._getUniformLocation(t),o),void 0===i?this._nameToUniform2[t]=Array.from(o):g(o,i)}}setUniform3f(t,o,i,n){const r=this._nameToUniform3[t];if(void 0===r||o!==r[0]||i!==r[1]||n!==r[2]){this._context.gl.uniform3f(this._getUniformLocation(t),o,i,n),void 0===r?this._nameToUniform3[t]=[o,i,n]:(r[0]=o,r[1]=i,r[2]=n)}}setUniform3fv(t,o){const i=this._nameToUniform3[t];if(a(i,o)){this._context.gl.uniform3fv(this._getUniformLocation(t),o),void 0===i?this._nameToUniform3[t]=Array.from(o):g(o,i)}}setUniform4f(t,o,i,n,r){const e=this._nameToUniform4[t];if(void 0===e||o!==e[0]||i!==e[1]||n!==e[2]||r!==e[3]){this._context.gl.uniform4f(this._getUniformLocation(t),o,i,n,r),void 0===e?this._nameToUniform4[t]=[o,i,n,r]:(e[0]=o,e[1]=i,e[2]=n,e[3]=r)}}setUniform4fv(t,o){const i=this._nameToUniform4[t];if(a(i,o)){this._context.gl.uniform4fv(this._getUniformLocation(t),o),void 0===i?this._nameToUniform4[t]=Array.from(o):g(o,i)}}setUniformMatrix3fv(t,o,i=!1){const n=this._nameToUniformMatrix3[t];if(l(n,o)){this._context.gl.uniformMatrix3fv(this._getUniformLocation(t),i,o),void 0===n?this._nameToUniformMatrix3[t]=Array.from(o):g(o,n)}}setUniformMatrix4fv(t,o,i=!1){const n=this._nameToUniformMatrix4[t];if(U(n,o)){this._context.gl.uniformMatrix4fv(this._getUniformLocation(t),i,o),void 0===n?this._nameToUniformMatrix4[t]=Array.from(o):g(o,n)}}stop(){}}function a(t,i){if(o(t)||t.length!==i.length)return!0;for(let o=0;o<t.length;++o)if(t[o]!==i[o])return!0;return!1}function h(t,o,e){const m=t.type===n.WEBGL2?s(e,o):e,f=t.gl,a=f.createShader(o);return f.shaderSource(a,m),f.compileShader(a),i()&&!f.getShaderParameter(a,f.COMPILE_STATUS)&&(console.error("Compile error in ".concat(o===r.VERTEX_SHADER?"vertex":"fragment"," shader")),console.error(f.getShaderInfoLog(a)),console.error(c(m)),t.type===n.WEBGL2&&(console.log("Shader source before transpilation:"),console.log(e))),a}function c(t){let o=2;return t.replace(/\n/g,(()=>"\n"+_(o++)+":"))}function _(t){return t>=1e3?t.toString():(" "+t).slice(-3)}function g(t,o){for(let i=0;i<t.length;++i)o[i]=t[i]}function l(t,i){return!!o(t)||(9!==t.length?a(t,i):9!==t.length||t[0]!==i[0]||t[1]!==i[1]||t[2]!==i[2]||t[3]!==i[3]||t[4]!==i[4]||t[5]!==i[5]||t[6]!==i[6]||t[7]!==i[7]||t[8]!==i[8])}function U(t,i){return!!o(t)||(16!==t.length?a(t,i):16!==t.length||t[0]!==i[0]||t[1]!==i[1]||t[2]!==i[2]||t[3]!==i[3]||t[4]!==i[4]||t[5]!==i[5]||t[6]!==i[6]||t[7]!==i[7]||t[8]!==i[8]||t[9]!==i[9]||t[10]!==i[10]||t[11]!==i[11]||t[12]!==i[12]||t[13]!==i[13]||t[14]!==i[14]||t[15]!==i[15])}export{f as Program};
5
+ import"../../core/has.js";import{isSome as t,isNone as o}from"../../core/maybe.js";import{webglValidateShadersEnabled as i}from"./checkWebGLError.js";import{ContextType as n}from"./context-util.js";import{ShaderType as r,ResourceType as e}from"./enums.js";import{transpileShader as s}from"./ShaderTranspiler.js";const m=4294967295;class a{constructor(t,o,m,a,f=new Map){this._context=t,this._locations=a,this._uniformBlockBindings=f,this._refCount=1,this._nameToUniformLocation={},this._nameToUniform1={},this._nameToUniform1v={},this._nameToUniform2={},this._nameToUniform3={},this._nameToUniform4={},this._nameToUniformMatrix3={},this._nameToUniformMatrix4={},t||console.error("RenderingContext isn't initialized!"),0===o.length&&console.error("Shaders source should not be empty!"),this._context.type===n.WEBGL2&&(o=s(o,r.VERTEX_SHADER),m=s(m,r.FRAGMENT_SHADER)),this._vShader=h(this._context,r.VERTEX_SHADER,o),this._fShader=h(this._context,r.FRAGMENT_SHADER,m),this._vShader&&this._fShader||console.error("Error loading shaders!"),this._context.instanceCounter.increment(e.Shader,this),i()&&(this.vertexShader=o,this.fragmentShader=m)}get glName(){if(t(this._glName))return this._glName;if(o(this._vShader))return null;const r=this._context.gl,s=r.createProgram();if(r.attachShader(s,this._vShader),r.attachShader(s,this._fShader),this._locations.forEach(((t,o)=>r.bindAttribLocation(s,t,o))),r.linkProgram(s),i()&&!r.getProgramParameter(s,r.LINK_STATUS)&&console.error(`Could not link shader\nvalidated: ${r.getProgramParameter(s,r.VALIDATE_STATUS)}, gl error ${r.getError()}, vertex: ${r.getShaderParameter(this._vShader,r.COMPILE_STATUS)}, fragment: ${r.getShaderParameter(this._fShader,r.COMPILE_STATUS)}, info log: ${r.getProgramInfoLog(s)}, vertex source: ${this.vertexShader}, fragment source: ${this.fragmentShader}`),this._context.type===n.WEBGL2){const t=r;for(const[o,i]of this._uniformBlockBindings){const n=t.getUniformBlockIndex(s,o);n<m&&t.uniformBlockBinding(s,n,i)}}return this._glName=s,this._context.instanceCounter.increment(e.Program,this),s}get hasGLName(){return t(this._glName)}dispose(){if(--this._refCount>0)return;const t=this._context.gl;this._vShader&&(t.deleteShader(this._vShader),this._vShader=null,this._context.instanceCounter.decrement(e.Shader,this)),this._fShader&&(t.deleteShader(this._fShader),this._fShader=null),this._glName&&(t.deleteProgram(this._glName),this._glName=null,this._context.instanceCounter.decrement(e.Program,this))}ref(){++this._refCount}_getUniformLocation(t){return void 0===this._nameToUniformLocation[t]&&(this._nameToUniformLocation[t]=this._context.gl.getUniformLocation(this.glName,t)),this._nameToUniformLocation[t]}hasUniform(t){return null!==this._getUniformLocation(t)}setUniform1i(t,o){const i=this._nameToUniform1[t];if(void 0===i||o!==i){this._context.gl.uniform1i(this._getUniformLocation(t),o),this._nameToUniform1[t]=o}}setUniform1iv(t,o){const i=this._nameToUniform1v[t];if(f(i,o)){this._context.gl.uniform1iv(this._getUniformLocation(t),o),void 0===i?this._nameToUniform1v[t]=Array.from(o):g(o,i)}}setUniform2iv(t,o){const i=this._nameToUniform2[t];if(f(i,o)){this._context.gl.uniform2iv(this._getUniformLocation(t),o),void 0===i?this._nameToUniform2[t]=Array.from(o):g(o,i)}}setUniform3iv(t,o){const i=this._nameToUniform3[t];if(f(i,o)){this._context.gl.uniform3iv(this._getUniformLocation(t),o),void 0===i?this._nameToUniform3[t]=Array.from(o):g(o,i)}}setUniform4iv(t,o){const i=this._nameToUniform4[t];if(f(i,o)){this._context.gl.uniform4iv(this._getUniformLocation(t),o),void 0===i?this._nameToUniform4[t]=Array.from(o):g(o,i)}}setUniform1f(t,o){const i=this._nameToUniform1[t];if(void 0===i||o!==i){this._context.gl.uniform1f(this._getUniformLocation(t),o),this._nameToUniform1[t]=o}}setUniform1fv(t,o){const i=this._nameToUniform1v[t];if(f(i,o)){this._context.gl.uniform1fv(this._getUniformLocation(t),o),void 0===i?this._nameToUniform1v[t]=Array.from(o):g(o,i)}}setUniform2f(t,o,i){const n=this._nameToUniform2[t];if(void 0===n||o!==n[0]||i!==n[1]){this._context.gl.uniform2f(this._getUniformLocation(t),o,i),void 0===n?this._nameToUniform2[t]=[o,i]:(n[0]=o,n[1]=i)}}setUniform2fv(t,o){const i=this._nameToUniform2[t];if(f(i,o)){this._context.gl.uniform2fv(this._getUniformLocation(t),o),void 0===i?this._nameToUniform2[t]=Array.from(o):g(o,i)}}setUniform3f(t,o,i,n){const r=this._nameToUniform3[t];if(void 0===r||o!==r[0]||i!==r[1]||n!==r[2]){this._context.gl.uniform3f(this._getUniformLocation(t),o,i,n),void 0===r?this._nameToUniform3[t]=[o,i,n]:(r[0]=o,r[1]=i,r[2]=n)}}setUniform3fv(t,o){const i=this._nameToUniform3[t];if(f(i,o)){this._context.gl.uniform3fv(this._getUniformLocation(t),o),void 0===i?this._nameToUniform3[t]=Array.from(o):g(o,i)}}setUniform4f(t,o,i,n,r){const e=this._nameToUniform4[t];if(void 0===e||o!==e[0]||i!==e[1]||n!==e[2]||r!==e[3]){this._context.gl.uniform4f(this._getUniformLocation(t),o,i,n,r),void 0===e?this._nameToUniform4[t]=[o,i,n,r]:(e[0]=o,e[1]=i,e[2]=n,e[3]=r)}}setUniform4fv(t,o){const i=this._nameToUniform4[t];if(f(i,o)){this._context.gl.uniform4fv(this._getUniformLocation(t),o),void 0===i?this._nameToUniform4[t]=Array.from(o):g(o,i)}}setUniformMatrix3fv(t,o,i=!1){const n=this._nameToUniformMatrix3[t];if(l(n,o)){this._context.gl.uniformMatrix3fv(this._getUniformLocation(t),i,o),void 0===n?this._nameToUniformMatrix3[t]=Array.from(o):g(o,n)}}setUniformMatrix4fv(t,o,i=!1){const n=this._nameToUniformMatrix4[t];if(U(n,o)){this._context.gl.uniformMatrix4fv(this._getUniformLocation(t),i,o),void 0===n?this._nameToUniformMatrix4[t]=Array.from(o):g(o,n)}}stop(){}}function f(t,i){if(o(t)||t.length!==i.length)return!0;for(let o=0;o<t.length;++o)if(t[o]!==i[o])return!0;return!1}function h(t,o,e){const s=t.gl,m=s.createShader(o);return s.shaderSource(m,e),s.compileShader(m),i()&&!s.getShaderParameter(m,s.COMPILE_STATUS)&&(console.error("Compile error in ".concat(o===r.VERTEX_SHADER?"vertex":"fragment"," shader")),console.error(s.getShaderInfoLog(m)),console.error(c(e)),t.type===n.WEBGL2&&(console.log("Shader source before transpilation:"),console.log(e))),m}function c(t){let o=2;return t.replace(/\n/g,(()=>"\n"+_(o++)+":"))}function _(t){return t>=1e3?t.toString():(" "+t).slice(-3)}function g(t,o){for(let i=0;i<t.length;++i)o[i]=t[i]}function l(t,i){return!!o(t)||(9!==t.length?f(t,i):9!==t.length||t[0]!==i[0]||t[1]!==i[1]||t[2]!==i[2]||t[3]!==i[3]||t[4]!==i[4]||t[5]!==i[5]||t[6]!==i[6]||t[7]!==i[7]||t[8]!==i[8])}function U(t,i){return!!o(t)||(16!==t.length?f(t,i):16!==t.length||t[0]!==i[0]||t[1]!==i[1]||t[2]!==i[2]||t[3]!==i[3]||t[4]!==i[4]||t[5]!==i[5]||t[6]!==i[6]||t[7]!==i[7]||t[8]!==i[8]||t[9]!==i[9]||t[10]!==i[10]||t[11]!==i[11]||t[12]!==i[12]||t[13]!==i[13]||t[14]!==i[14]||t[15]!==i[15])}export{a as Program};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../core/Error.js";import{throwIfAborted as a}from"../../../core/promiseUtils.js";import{isTiledLayer as t}from"../../../layers/support/layerUtils.js";import{stringFromViewingMode as i,ViewingMode as r}from"../../../views/ViewingMode.js";import{checkIfTileInfoSupportedForView as n}from"../../../views/3d/terrain/terrainUtils.js";import o from"../../../views/3d/terrain/TilingScheme.js";import{isSpatialReferenceSupported as l}from"../../../views/support/spatialReferenceSupport.js";async function s(e,t={}){await m(e,t),a(t)}async function p(e,i={}){const{basemap:r,view:n}=e;if("spatialReferenceLocked"in n&&!n.spatialReferenceLocked)return;if(await r.load(i),a(i),0===r.baseLayers.length)return;const o=r.baseLayers.getItemAt(0);if(!t(o))return;if(r.spatialReference){if(n.spatialReference.equals(r.spatialReference))return;c()}await o.load(i),a(i);const l=(("supportedSpatialReferences"in o?o.supportedSpatialReferences:null)||["tileInfo"in o?o.tileInfo.spatialReference:null]).filter(Boolean);0!==l.length&&l.every((e=>!n.spatialReference.equals(e)))&&c()}function c(){throw new e("basemap-compatibility:incompatible-spatial-reference","Basemap spatial reference is not compatible with the view")}async function m(a,t){const{basemap:i,view:r}=a;if(await i.load(t),0===i.baseLayers.length)return;const n=f(i.baseLayers.concat(i.referenceLayers));if(n.length)throw n[0];const o=i.baseLayers.getItemAt(0);try{await o.load(t)}catch(l){const a="basemap-compatibility:unknown-error",t="Unknown basemap compatibility error",{name:i=a,message:r=t,details:n}=l;throw new e(i,r,n)}u(o,r)}function f(a){const t=["ArcGISTiledImageServiceLayer","ArcGISTiledMapServiceLayer","OpenStreetMap","VectorTileLayer","WebTiledLayer"];return a.toArray().filter((e=>-1===t.indexOf(e.operationalLayerType))).map((a=>new e("basemap-compatibility:unsupported-basemap-layer-type","Unsupported basemap layer type ${operationalLayerType}",{layer:a,operationalLayerType:a.operationalLayerType||"unknown"})))}function u(a,t){const s=a.tileInfo;if(!s)return;const p=t.state.viewingMode;if(!p)return;if(!l(s.spatialReference,p))throw new e(`basemapgalleryitem:spatial-reference-unsupported-${i(p)}`,`Basemap spatial reference is unsupported in ${i(p)} mode`);if(p===r.Global){let t=n(s,a.fullExtent,null,r.Global);if(t&&a.compatibleTileInfo256&&!n(a.compatibleTileInfo256,a.fullExtent,null,r.Global)&&(t=null),t){const a=s.spatialReference.isWebMercator?"web-mercator":"wgs84";throw new e(`basemapgalleryitem:tiling-scheme-unsupported-${a}-global`,"Basemap tiling scheme is unsupported in global mode",{error:t})}}else if(o.checkUnsupported(s))throw new e("basemapgalleryitem:tiling-scheme-unsupported-local","Basemap tiling scheme is unsupported in local mode");const c=t.get("basemapTerrain.tilingScheme");if(c&&!c.compatibleWith(s)&&(!a.compatibleTileInfo256||!c.compatibleWith(a.compatibleTileInfo256)))throw new e("basemapgalleryitem:tiling-scheme-incompatible","Basemap tiling scheme is incompatible with the view")}export{p as default2DCompatibility,s as default3DCompatibility};
5
+ import e from"../../../core/Error.js";import{throwIfAborted as t}from"../../../core/promiseUtils.js";import{isTiledLayer as a}from"../../../layers/support/layerUtils.js";import{stringFromViewingMode as i,ViewingMode as r}from"../../../views/ViewingMode.js";import{checkIfTileInfoSupportedForView as n}from"../../../views/3d/terrain/terrainUtils.js";import o from"../../../views/3d/terrain/TilingScheme.js";import{isSpatialReferenceSupported as l}from"../../../views/support/spatialReferenceSupport.js";async function s(e,a={}){await m(e,a),t(a)}async function p(e,i={}){const{basemap:r,view:n}=e;if("spatialReferenceLocked"in n&&!n.spatialReferenceLocked)return;if(await r.load(i),t(i),0===r.baseLayers.length)return;const o=r.baseLayers.getItemAt(0);if(!a(o))return;if(r.spatialReference){if(n.spatialReference.equals(r.spatialReference))return;c()}await o.load(i),t(i);const l=(("supportedSpatialReferences"in o?o.supportedSpatialReferences:null)||["tileInfo"in o?o.tileInfo.spatialReference:null]).filter(Boolean);0!==l.length&&l.every((e=>!n.spatialReference.equals(e)))&&c()}function c(){throw new e("basemap-compatibility:incompatible-spatial-reference","Basemap spatial reference is not compatible with the view")}async function m(t,a){const{basemap:i,view:r}=t;if(await i.load(a),0===i.baseLayers.length)return;const n=f(i.baseLayers.concat(i.referenceLayers));if(n.length)throw n[0];const o=i.baseLayers.getItemAt(0);try{await o.load(a)}catch(l){const t="basemap-compatibility:unknown-error",a="Unknown basemap compatibility error",{name:i=t,message:r=a,details:n}=l;throw new e(i,r,n)}u(o,r)}function f(t){const a=["ArcGISTiledImageServiceLayer","ArcGISTiledMapServiceLayer","OpenStreetMap","VectorTileLayer","WebTiledLayer"];return t.toArray().filter((e=>-1===a.indexOf(e.operationalLayerType))).map((t=>new e("basemap-compatibility:unsupported-basemap-layer-type","Unsupported basemap layer type ${operationalLayerType}",{layer:t,operationalLayerType:t.operationalLayerType||"unknown"})))}function u(t,a){const s=t.tileInfo;if(!s)return;const p=a.state.viewingMode;if(!p)return;if(!l(s.spatialReference,p))throw new e(`basemapgalleryitem:spatial-reference-unsupported-${i(p)}`,`Basemap spatial reference is unsupported in ${i(p)} mode`);if(p===r.Global){let a=n(s,t.fullExtent,null,r.Global);if(a&&t.tileInfo.getOrCreateCompatible(256)&&!n(t.tileInfo.getOrCreateCompatible(256),t.fullExtent,null,r.Global)&&(a=null),a){const t=s.spatialReference.isWebMercator?"web-mercator":"wgs84";throw new e(`basemapgalleryitem:tiling-scheme-unsupported-${t}-global`,"Basemap tiling scheme is unsupported in global mode",{error:a})}}else if(o.checkUnsupported(s))throw new e("basemapgalleryitem:tiling-scheme-unsupported-local","Basemap tiling scheme is unsupported in local mode");const c=a.get("basemapTerrain.tilingScheme");if(c&&!c.compatibleWith(s)&&(!t.tileInfo.getOrCreateCompatible(256)||!c.compatibleWith(t.tileInfo.getOrCreateCompatible(256))))throw new e("basemapgalleryitem:tiling-scheme-incompatible","Basemap tiling scheme is incompatible with the view")}export{p as default2DCompatibility,s as default3DCompatibility};