@arcgis/core 6.0.0-next.55 → 6.0.0-next.57

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 (298) hide show
  1. package/arcgisGlobal.d.ts +1 -0
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/00c227bcecc28fe278bb.js +1 -0
  4. package/assets/esri/core/workers/chunks/033b9fcd9833db3b6e7d.js +1 -0
  5. package/assets/esri/core/workers/chunks/0978e12dd6a1cbc50b80.js +1 -0
  6. package/assets/esri/core/workers/chunks/{88df1b8b295d3aed649f.js → 10499abb7678e95d9f05.js} +1 -1
  7. package/assets/esri/core/workers/chunks/{e956845255bce0910944.js → 1507297550c3cd1268e2.js} +1 -1
  8. package/assets/esri/core/workers/chunks/1afc8820c283ef785729.js +1 -0
  9. package/assets/esri/core/workers/chunks/1c0f5c42331fb6fc26cb.js +1 -0
  10. package/assets/esri/core/workers/chunks/1c874f86bfd0963aa3d2.js +1 -0
  11. package/assets/esri/core/workers/chunks/2a84c9a81ec2bed3d4e5.js +1 -0
  12. package/assets/esri/core/workers/chunks/2cd2fcf4a37d180d5d5c.js +1 -0
  13. package/assets/esri/core/workers/chunks/2f31766bc0f9d1d70c5a.js +1 -0
  14. package/assets/esri/core/workers/chunks/2f9adf0b809ce8797ebf.js +1 -0
  15. package/assets/esri/core/workers/chunks/35109db6a6be66f895f7.js +1 -0
  16. package/assets/esri/core/workers/chunks/373b140f92eda3857f82.js +1 -0
  17. package/assets/esri/core/workers/chunks/38bba952c38af5a150e7.js +1 -0
  18. package/assets/esri/core/workers/chunks/3982409149571a827390.js +1 -0
  19. package/assets/esri/core/workers/chunks/3aea09191b737dc1de70.js +1 -0
  20. package/assets/esri/core/workers/chunks/3d851710f7fcc27c5b60.js +2 -0
  21. package/assets/esri/core/workers/chunks/3e8d70039800f2395d66.js +1 -0
  22. package/assets/esri/core/workers/chunks/3fc4b7d0ee460fc96176.js +1 -0
  23. package/assets/esri/core/workers/chunks/457bd1bd37c67b61efe8.js +1 -0
  24. package/assets/esri/core/workers/chunks/4d8539674fc2e4fea03c.js +1 -0
  25. package/assets/esri/core/workers/chunks/{e61082f56c08abe54b3a.js → 5954f02c3901b28d8e73.js} +1 -1
  26. package/assets/esri/core/workers/chunks/5ba6007c3c49a8153256.js +1 -0
  27. package/assets/esri/core/workers/chunks/5bdd95eeb8f34dbf26f2.js +2 -0
  28. package/assets/esri/core/workers/chunks/{ced5dfb2bf46fc5eac8c.js → 5e47026c681238038955.js} +2 -2
  29. package/assets/esri/core/workers/chunks/{2baf35b1b19482d603b5.js → 5f7505ada0991cfbdd84.js} +1 -1
  30. package/assets/esri/core/workers/chunks/601d668e70c5d72fe58c.js +1 -0
  31. package/assets/esri/core/workers/chunks/651e33be8bb3995d749f.js +1 -0
  32. package/assets/esri/core/workers/chunks/{542a9c414c99d84d52ab.js → 6a202ef9ba9b89e09153.js} +1 -1
  33. package/assets/esri/core/workers/chunks/{0826feebdca8a31eb630.js → 6ba6fece5c11fe2a6ace.js} +1 -1
  34. package/assets/esri/core/workers/chunks/{5eb69e2895e5aec81051.js → 6fd10891506925560443.js} +1 -1
  35. package/assets/esri/core/workers/chunks/721f43554b9654481de7.js +1 -0
  36. package/assets/esri/core/workers/chunks/75274ac3ddf7c45f47d7.js +1 -0
  37. package/assets/esri/core/workers/chunks/7b6fd287e7043ad50f4e.js +1 -0
  38. package/assets/esri/core/workers/chunks/7baa49055bc31618b56e.js +1 -0
  39. package/assets/esri/core/workers/chunks/80d1267606383ae537f2.js +1 -0
  40. package/assets/esri/core/workers/chunks/8570e3df90fb76a8741a.js +1 -0
  41. package/assets/esri/core/workers/chunks/{c3c0f24a9e0047232ae1.js → 8679dfc0c53355b6feb0.js} +1 -1
  42. package/assets/esri/core/workers/chunks/8920d0b11951b57d6a66.js +1 -0
  43. package/assets/esri/core/workers/chunks/8a636dc51372e14c98f5.js +1 -0
  44. package/assets/esri/core/workers/chunks/{14259910f44c08fd5bbd.js → 9117c9b720c9ba6e7a6e.js} +1 -1
  45. package/assets/esri/core/workers/chunks/92d97e0fcc20dd5f5ac4.js +1 -0
  46. package/assets/esri/core/workers/chunks/9ca84fa9423654061d05.js +1 -0
  47. package/assets/esri/core/workers/chunks/9e372af03d62fa5ad10e.js +1 -0
  48. package/assets/esri/core/workers/chunks/a22458e5272332d86cb9.js +1 -0
  49. package/assets/esri/core/workers/chunks/{3ea480cebf8ee56228a5.js → a7dfca326883384d2751.js} +1 -1
  50. package/assets/esri/core/workers/chunks/{723d8316f5d4b6ce2942.js → a9539393e2f1812a973a.js} +1 -1
  51. package/assets/esri/core/workers/chunks/{be0b8bb4f09aae6ff5de.js → ab784764ddf9d7f693a1.js} +1 -1
  52. package/assets/esri/core/workers/chunks/b10c534cbe311d17b7d5.js +1 -0
  53. package/assets/esri/core/workers/chunks/b38b6fe08a367e9de4f5.js +1 -0
  54. package/assets/esri/core/workers/chunks/{4e651869e9a196494694.js → b6e628b5d2643af4c19b.js} +1 -1
  55. package/assets/esri/core/workers/chunks/{b37ab6b1cb4cfc85cd9d.js → b7828d7e2c5b75644057.js} +1 -1
  56. package/assets/esri/core/workers/chunks/{ec465abb0344ad719e9d.js → bd8e329ec74d921d311a.js} +1 -1
  57. package/assets/esri/core/workers/chunks/{9e508f930086d2ef5f22.js → be0133fa63c5d6545a7f.js} +40 -41
  58. package/assets/esri/core/workers/chunks/{56e6e70aa40e51827290.js → c3f94024c6c9eed9f273.js} +1 -1
  59. package/assets/esri/core/workers/chunks/{6d17b45022dfd2548098.js → c5ddf8b347c31fe772a3.js} +1 -1
  60. package/assets/esri/core/workers/chunks/{ee9af58ae202b803bba7.js → c7a0c4ca37ebd1d98cf1.js} +1 -1
  61. package/assets/esri/core/workers/chunks/cb0e3614b78c78040662.js +1 -0
  62. package/assets/esri/core/workers/chunks/d22e3b5d836dffdf91cc.js +1 -0
  63. package/assets/esri/core/workers/chunks/d7763c42754152510e13.js +2 -0
  64. package/assets/esri/core/workers/chunks/e0341def2d81e679a200.js +1 -0
  65. package/assets/esri/core/workers/chunks/e42e9dd3c933f5f864ab.js +1 -0
  66. package/assets/esri/core/workers/chunks/e566102c7ed7a8ebf89e.js +1 -0
  67. package/assets/esri/core/workers/chunks/e74586b074d0fa6abb4b.js +1 -0
  68. package/assets/esri/core/workers/chunks/e7dff025780726d5feae.js +1 -0
  69. package/assets/esri/core/workers/chunks/e96fa029acba59c04e4e.js +2 -0
  70. package/assets/esri/core/workers/chunks/f4fcf87da4495584223d.js +1 -0
  71. package/assets/esri/core/workers/chunks/f989588dfdbb69056491.js +1 -0
  72. package/assets/esri/core/workers/chunks/fc5b920f9756e11c2f88.js +1 -0
  73. package/assets/esri/core/workers/chunks/fdfbd201be372d3796bf.js +2 -0
  74. package/assets/esri/core/workers/chunks/ff0a0819bba5e8264c47.js +1 -0
  75. package/chunks/BlendLayers.glsl.js +1 -1
  76. package/chunks/ColorMaterial.glsl.js +14 -14
  77. package/chunks/Component.glsl.js +38 -37
  78. package/chunks/DefaultMaterial.glsl.js +15 -15
  79. package/chunks/GlobalIllumination.glsl.js +12 -11
  80. package/chunks/GlobalIlluminationBlur.glsl.js +6 -4
  81. package/chunks/HUDMaterial.glsl.js +3 -3
  82. package/chunks/Path.glsl.js +15 -15
  83. package/chunks/Pattern.glsl.js +20 -20
  84. package/chunks/RasterColorizer.glsl.js +1 -1
  85. package/chunks/ShadowHighlight.glsl.js +1 -1
  86. package/chunks/Terrain.glsl.js +28 -27
  87. package/chunks/Water.glsl.js +30 -20
  88. package/chunks/pdf.js +57 -0
  89. package/config.js +1 -1
  90. package/core/accessorSupport/write.js +1 -1
  91. package/core/memoryEstimations.js +1 -1
  92. package/core/scheduling.js +1 -1
  93. package/interfaces.d.ts +0 -1
  94. package/kernel.js +1 -1
  95. package/layers/LinkChartLayer.js +1 -1
  96. package/layers/VoxelWasmPerSceneView.js +1 -1
  97. package/layers/geospatialPDF/GeospatialPDFFrame.js +1 -1
  98. package/layers/geospatialPDF/GeospatialPDFLayerWorker.js +1 -56
  99. package/layers/geospatialPDF/GeospatialPDFWorkerClient.js +1 -1
  100. package/layers/geospatialPDF/parserUtils.js +2 -0
  101. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  102. package/layers/graphics/dehydratedFeatures.js +1 -1
  103. package/layers/graphics/transferFeatures.js +1 -1
  104. package/layers/support/ControlPoint.js +1 -1
  105. package/layers/support/ControlPointsGeoreference.js +1 -1
  106. package/layers/support/commonProperties.js +1 -1
  107. package/layers/support/fieldUtils.d.ts +129 -57
  108. package/layers/support/fieldUtils.js +1 -1
  109. package/layers/support/geospatialPDFUtils.d.ts +63 -0
  110. package/layers/support/geospatialPDFUtils.js +2 -0
  111. package/networks/Network.js +1 -1
  112. package/networks/support/TopologyValidationJobInfo.js +1 -1
  113. package/package.json +5 -5
  114. package/symbols/CIMSymbol.d.ts +9 -9
  115. package/symbols/PathSymbol3DLayer.d.ts +1 -1
  116. package/symbols/WaterSymbol3DLayer.d.ts +13 -1
  117. package/symbols/WaterSymbol3DLayer.js +1 -1
  118. package/views/3d/GroundView3D.js +1 -1
  119. package/views/3d/analysis/ShadowCastAnalysisView3D.js +1 -1
  120. package/views/3d/analysis/Viewshed/ViewshedObserverManipulatedObject3D.js +1 -1
  121. package/views/3d/camera/constraintUtils/tilt.js +1 -1
  122. package/views/3d/camera/intersectionUtils.js +1 -1
  123. package/views/3d/environment/EnvironmentView.js +1 -1
  124. package/views/3d/input/handlers/ground/GroundNavigation.js +1 -1
  125. package/views/3d/interactive/Manipulator3D.js +1 -1
  126. package/views/3d/interactive/Manipulator3DBase.js +1 -1
  127. package/views/3d/interactive/editingTools/dragEventPipeline3D.js +1 -1
  128. package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DView.js +1 -1
  129. package/views/3d/interactive/visualElements/Object3DVisualElement.js +1 -1
  130. package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
  131. package/views/3d/layers/BuildingSceneLayerView3D.js +1 -1
  132. package/views/3d/layers/DrapedSubView3D.js +1 -1
  133. package/views/3d/layers/DynamicLayerView3D.js +1 -1
  134. package/views/3d/layers/FeatureLikeLayerViewBase3D.js +1 -1
  135. package/views/3d/layers/FlowSubView3D.js +1 -1
  136. package/views/3d/layers/GraphicsLayerView3D.js +1 -1
  137. package/views/3d/layers/I3SMeshView3D.js +1 -1
  138. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  139. package/views/3d/layers/RouteLayerView3D.js +1 -1
  140. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  141. package/views/3d/layers/VectorTileLayerView3D.js +1 -1
  142. package/views/3d/layers/VoxelLayerView3D.js +1 -1
  143. package/views/3d/layers/graphics/Deconflictor.js +1 -1
  144. package/views/3d/layers/graphics/Graphics3DFrustumVisibility.js +1 -1
  145. package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
  146. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  147. package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
  148. package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
  149. package/views/3d/layers/i3s/I3SIndex.js +1 -1
  150. package/views/3d/layers/i3s/I3SIntersectionHandler.js +1 -1
  151. package/views/3d/layers/i3s/I3SUtil.js +1 -1
  152. package/views/3d/layers/support/Tiles3DBVH.js +1 -1
  153. package/views/3d/layers/support/Tiles3DMeshIntersectionHandler.js +1 -1
  154. package/views/3d/layers/support/createTileBVHForLayer.js +1 -1
  155. package/views/3d/state/controllers/PinchAndPanControllerGlobal.js +1 -1
  156. package/views/3d/state/controllers/PinchAndPanControllerLocal.js +1 -1
  157. package/views/3d/state/controllers/RotateController.js +1 -1
  158. package/views/3d/state/controllers/ZoomControllerGlobal.js +1 -1
  159. package/views/3d/state/controllers/ZoomStepControllerGlobal.js +1 -1
  160. package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
  161. package/views/3d/state/utils/groundNavigationUtils.js +1 -1
  162. package/views/3d/state/utils/navigationUtils.js +1 -1
  163. package/views/3d/support/GroundAndIMSurface.js +1 -1
  164. package/views/3d/support/QualityProfile.js +1 -1
  165. package/views/3d/support/QualitySettings.js +1 -1
  166. package/views/3d/support/flow/StreamlineResources3DShape.js +1 -1
  167. package/views/3d/support/pointsOfInterest/CenterOnSurface.js +1 -1
  168. package/views/3d/support/pointsOfInterest/PointsOfInterest.js +1 -1
  169. package/views/3d/terrain/BlendLayersTechniqueConfiguration.js +1 -1
  170. package/views/3d/terrain/OverlayManager.js +1 -1
  171. package/views/3d/terrain/PatchGeometryFactory.js +1 -1
  172. package/views/3d/terrain/RasterColorizerTechniqueConfiguration.js +1 -1
  173. package/views/3d/terrain/TerrainRenderer.js +1 -1
  174. package/views/3d/terrain/TerrainSurface.js +1 -1
  175. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  176. package/views/3d/webgl-engine/collections/Component/ComponentObjectFixedBVH.js +1 -1
  177. package/views/3d/webgl-engine/collections/Component/IntersectionGeometry.js +1 -1
  178. package/views/3d/webgl-engine/collections/Component/Material/Component.glsl.js +1 -1
  179. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  180. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
  181. package/views/3d/webgl-engine/core/shaderLibrary/clampShadowPosition.glsl.js +2 -0
  182. package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +14 -14
  183. package/views/3d/webgl-engine/core/shaderLibrary/hud/HUD.glsl.js +1 -1
  184. package/views/3d/webgl-engine/core/shaderLibrary/lastFrameUniforms.js +1 -1
  185. package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +15 -12
  186. package/views/3d/webgl-engine/core/shaderLibrary/terrain/TileComposite.glsl.js +2 -3
  187. package/views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js +1 -1
  188. package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.glsl.js +1 -1
  189. package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.js +1 -1
  190. package/views/3d/webgl-engine/effects/globalIllumination/GlobalIlluminationBlur.glsl.js +1 -1
  191. package/views/3d/webgl-engine/effects/globalIllumination/globalIlluminationUniforms.js +1 -1
  192. package/views/3d/webgl-engine/lib/BufferGeometry.js +1 -1
  193. package/views/3d/webgl-engine/lib/BufferObject3D.js +1 -1
  194. package/views/3d/webgl-engine/lib/GridLocalOriginFactory.js +1 -1
  195. package/views/3d/webgl-engine/lib/Object3D.js +1 -1
  196. package/views/3d/webgl-engine/lib/Program.js +1 -1
  197. package/views/3d/webgl-engine/lib/RayIntersections.js +1 -1
  198. package/views/3d/webgl-engine/lib/RenderGeometry.js +1 -1
  199. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  200. package/views/3d/webgl-engine/lib/TriangleIntersectionData.js +1 -1
  201. package/views/3d/webgl-engine/lib/depthRangeUtils.js +1 -1
  202. package/views/3d/webgl-engine/materials/DefaultLayouts.js +1 -1
  203. package/views/3d/webgl-engine/materials/Path.glsl.js +1 -1
  204. package/views/3d/webgl-engine/materials/Water.glsl.js +1 -1
  205. package/views/3d/webgl-engine/materials/WaterMaterial.js +1 -1
  206. package/views/3d/webgl-engine/materials/WaterTechniqueConfiguration.js +1 -1
  207. package/views/3d/webgl-engine/materials/getWaterColor.glsl.js +89 -0
  208. package/views/3d/webgl-engine/parts/Model.js +1 -1
  209. package/views/3d/webgl-engine/shaders/ColorMaterial.glsl.js +1 -1
  210. package/views/3d/webgl-engine/shaders/DefaultMaterial.glsl.js +1 -1
  211. package/views/3d/webgl-engine/shaders/Pattern.glsl.js +1 -1
  212. package/views/3d/webgl-engine/shaders/Terrain.glsl.js +1 -1
  213. package/views/3d/webgl-engine/shaders/TerrainTechniqueConfiguration.js +1 -1
  214. package/views/Attribution.js +5 -5
  215. package/views/DOMContainer.d.ts +2 -1
  216. package/views/SceneView.js +1 -1
  217. package/views/draw/DrawGraphicTool.js +1 -1
  218. package/views/draw/support/surfaceCoordinateSystems.js +1 -1
  219. package/views/webgl/Program.js +3 -3
  220. package/views/webgl/ShaderBuilder.js +23 -23
  221. package/webscene/Slide.js +1 -1
  222. package/webscene/VirtualLighting.d.ts +2 -4
  223. package/widgets/BatchAttributeForm/inputs/FieldInput.d.ts +17 -1
  224. package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
  225. package/widgets/BatchAttributeForm/inputs/support/inputUtils.d.ts +7 -0
  226. package/widgets/BatchAttributeForm/inputs/support/inputUtils.js +1 -1
  227. package/widgets/BatchAttributeForm.js +1 -1
  228. package/widgets/ShadowCast/ShadowCastViewModel.js +1 -1
  229. package/widgets/Sketch/SketchViewModel.js +1 -1
  230. package/widgets/Weather/WeatherViewModel.js +1 -1
  231. package/widgets/support/ContingentValuesManager.js +1 -1
  232. package/widgets/support/forms/types.d.ts +23 -1
  233. package/assets/esri/core/workers/chunks/144f18a3dd2c8cf07cf7.js +0 -1
  234. package/assets/esri/core/workers/chunks/193a73a2c7f4f8482c21.js +0 -1
  235. package/assets/esri/core/workers/chunks/20acb6f3ed5140b6c6c6.js +0 -1
  236. package/assets/esri/core/workers/chunks/23fc1c1ed483ed3b2298.js +0 -1
  237. package/assets/esri/core/workers/chunks/249a687ce1b6d0815242.js +0 -1
  238. package/assets/esri/core/workers/chunks/2634927d26cb1139c6d0.js +0 -1
  239. package/assets/esri/core/workers/chunks/2d1b8154ee40afc9d40b.js +0 -1
  240. package/assets/esri/core/workers/chunks/2d4788be418a4e5f6606.js +0 -1
  241. package/assets/esri/core/workers/chunks/333140b18aeb5a50b654.js +0 -1
  242. package/assets/esri/core/workers/chunks/4401b3f8ebb658abe789.js +0 -1
  243. package/assets/esri/core/workers/chunks/4761cd436abceee858bf.js +0 -1
  244. package/assets/esri/core/workers/chunks/4a41bf3d1e2e9bb79771.js +0 -2
  245. package/assets/esri/core/workers/chunks/4de08ead94660025075b.js +0 -1
  246. package/assets/esri/core/workers/chunks/56f227e1a9e51d1fd742.js +0 -1
  247. package/assets/esri/core/workers/chunks/5bd451c7db17ee8f0315.js +0 -1
  248. package/assets/esri/core/workers/chunks/5c34d49a6c9cc34b7626.js +0 -1
  249. package/assets/esri/core/workers/chunks/5f324d88785ffcb73ae0.js +0 -1
  250. package/assets/esri/core/workers/chunks/703373f529c1c334cfad.js +0 -1
  251. package/assets/esri/core/workers/chunks/70695e0fb53018d48e7b.js +0 -2
  252. package/assets/esri/core/workers/chunks/723c9ad4c25be2b82476.js +0 -1
  253. package/assets/esri/core/workers/chunks/733c32d8091427d84de7.js +0 -1
  254. package/assets/esri/core/workers/chunks/766a1357be2ed7f4e125.js +0 -1
  255. package/assets/esri/core/workers/chunks/844c593754b2692257f4.js +0 -1
  256. package/assets/esri/core/workers/chunks/846248697c398468d8e6.js +0 -1
  257. package/assets/esri/core/workers/chunks/860552f49f17de2f3353.js +0 -1
  258. package/assets/esri/core/workers/chunks/89e55895683369b5277a.js +0 -1
  259. package/assets/esri/core/workers/chunks/8c94e987754b3919181e.js +0 -1
  260. package/assets/esri/core/workers/chunks/919115788da38049aea7.js +0 -2
  261. package/assets/esri/core/workers/chunks/976303f47c342b9d1cc0.js +0 -1
  262. package/assets/esri/core/workers/chunks/9b727f45dfea84357b57.js +0 -1
  263. package/assets/esri/core/workers/chunks/a05a2c2aaf0c288f9681.js +0 -1
  264. package/assets/esri/core/workers/chunks/a116dd204921e7464944.js +0 -1
  265. package/assets/esri/core/workers/chunks/ab76170c374fd67ce8cd.js +0 -1
  266. package/assets/esri/core/workers/chunks/aebd12488b4004e207a3.js +0 -1
  267. package/assets/esri/core/workers/chunks/b33e7e74cf8fa3926617.js +0 -1
  268. package/assets/esri/core/workers/chunks/bb2af16e55cb39163827.js +0 -1
  269. package/assets/esri/core/workers/chunks/c7b1c6d57603fa385c54.js +0 -1
  270. package/assets/esri/core/workers/chunks/cd8181600623e18f511c.js +0 -1
  271. package/assets/esri/core/workers/chunks/cef537fa9705dd1cf685.js +0 -1
  272. package/assets/esri/core/workers/chunks/d33403d578fbeecaf844.js +0 -1
  273. package/assets/esri/core/workers/chunks/d5bb9f9b7b341c671525.js +0 -1
  274. package/assets/esri/core/workers/chunks/d96e63d66f7b1f4ea54a.js +0 -2
  275. package/assets/esri/core/workers/chunks/ddbfa664e69612295785.js +0 -1
  276. package/assets/esri/core/workers/chunks/ded81c504bf44806ca7d.js +0 -1
  277. package/assets/esri/core/workers/chunks/e0466387b2ab54d706ca.js +0 -1
  278. package/assets/esri/core/workers/chunks/e3bcd2e356f75afc316a.js +0 -1
  279. package/assets/esri/core/workers/chunks/e80526571f1a34de3278.js +0 -1
  280. package/assets/esri/core/workers/chunks/ea71850ba87ae6038000.js +0 -1
  281. package/assets/esri/core/workers/chunks/ee70be138831cc2a0f56.js +0 -1
  282. package/assets/esri/core/workers/chunks/f23c4fd014126ea7abc6.js +0 -1
  283. package/assets/esri/core/workers/chunks/f537a5e808dc546813c7.js +0 -1
  284. package/assets/esri/core/workers/chunks/f6e40f3faf0c80cf1b3a.js +0 -1
  285. package/assets/esri/core/workers/chunks/fe811d651d201f698b8f.js +0 -2
  286. package/chunks/NativeLine.glsl.js +0 -8
  287. package/layers/geospatialPDF/geospatialPDFParserUtils.js +0 -2
  288. package/views/3d/webgl-engine/core/shaderLibrary/shading/WaterColor.glsl.js +0 -70
  289. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +0 -2
  290. package/views/3d/webgl-engine/shaders/NativeLine.glsl.js +0 -2
  291. package/views/3d/webgl-engine/shaders/NativeLineTechnique.js +0 -2
  292. package/views/3d/webgl-engine/shaders/NativeLineTechniqueConfiguration.js +0 -2
  293. /package/assets/esri/core/workers/chunks/{919115788da38049aea7.js.LICENSE.txt → 3d851710f7fcc27c5b60.js.LICENSE.txt} +0 -0
  294. /package/assets/esri/core/workers/chunks/{fe811d651d201f698b8f.js.LICENSE.txt → 5bdd95eeb8f34dbf26f2.js.LICENSE.txt} +0 -0
  295. /package/assets/esri/core/workers/chunks/{ced5dfb2bf46fc5eac8c.js.LICENSE.txt → 5e47026c681238038955.js.LICENSE.txt} +0 -0
  296. /package/assets/esri/core/workers/chunks/{4a41bf3d1e2e9bb79771.js.LICENSE.txt → d7763c42754152510e13.js.LICENSE.txt} +0 -0
  297. /package/assets/esri/core/workers/chunks/{d96e63d66f7b1f4ea54a.js.LICENSE.txt → e96fa029acba59c04e4e.js.LICENSE.txt} +0 -0
  298. /package/assets/esri/core/workers/chunks/{70695e0fb53018d48e7b.js.LICENSE.txt → fdfbd201be372d3796bf.js.LICENSE.txt} +0 -0
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{subclass as t}from"../../core/accessorSupport/decorators.js";import n from"../../core/Error.js";import"../../core/has.js";import{Loadable as r}from"../../core/Loadable.js";import{throwIfAborted as i}from"../../core/promiseUtils.js";import{open as a}from"../../core/workers.js";import o from"./GeospatialPDFFrame.js";import{parse as s}from"./geospatialPDFParserUtils.js";let c=class extends r{constructor(){super(...arguments),this._connection=null,this._workerHandler=null}load(e){let t=a(`GeospatialPDFLayerWorker`,{...e,strategy:`dedicated`,registryTarget:this}).then(e=>{this._connection=e,this._workerHandler=this._connection.createInvokeProxy()});return this.addResolvingPromise(t),Promise.resolve(this)}destroy(){this._connection?.close(),this._connection=null,this._workerHandler=null,super.destroy()}async loadPDF(e,t={}){await this.load(t);let{geospatialMetadata:r,pageNumber:a,numPages:c}=await this._workerHandler.loadPDF(e,t),l=await s(r,0);i(t);let u=l.lgiDictFrame??l.vpFrame;if(!u)throw new n(`geospatial-pdf-layer:load`,`pdf does not contain supported LGIDict or VP/Measure.`);let d=new o(u);return{frame:d,sourceSpatialReference:d.spatialReference.toJSON(),neatlineExtent:d.toExtent()}}async render(e,t,n,r,i,a){let o={sourceExtentAsJSON:e.toJSON(),width:t,height:n,ctm:r,currentRing:i};return this._workerHandler.renderPDF(o,a)}};c=e([t(`esri.layers.geospatialPDF.GeospatialPDFWorkerClient`)],c);export{c as GeospatialPDFWorkerClient};
2
+ import{__decorate as e}from"tslib";import{subclass as t}from"../../core/accessorSupport/decorators.js";import"../../core/has.js";import{Loadable as n}from"../../core/Loadable.js";import{throwIfAborted as r}from"../../core/promiseUtils.js";import{open as i}from"../../core/workers.js";import{parse as a}from"./parserUtils.js";let o=class extends n{constructor(){super(...arguments),this._connection=null,this._workerHandler=null}load(e){let t=i(`GeospatialPDFLayerWorker`,{...e,strategy:`dedicated`,registryTarget:this}).then(e=>{this._connection=e,this._workerHandler=this._connection.createInvokeProxy()});return this.addResolvingPromise(t),Promise.resolve(this)}destroy(){this._connection?.close(),this._connection=null,this._workerHandler=null,super.destroy()}async loadPDF(e,t={}){await this.load(t);let{geospatialMetadata:n,pageNumber:i,numPages:o}=await this._workerHandler.loadPDF(e,t),s=await a(n,0);return r(t),{frame:s,sourceSpatialReference:s.spatialReference.toJSON(),neatlineExtent:s.toExtent()}}async render(e,t,n,r,i,a){let o={sourceExtentAsJSON:e.toJSON(),width:t,height:n,ctm:r,currentRing:i};return this._workerHandler.renderPDF(o,a)}};o=e([t(`esri.layers.geospatialPDF.GeospatialPDFWorkerClient`)],o);export{o as GeospatialPDFWorkerClient};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
+ import e from"../../core/Error.js";import"../../core/has.js";import t from"./GeospatialPDFFrame.js";import{LGIDictMapFrame as n}from"./LGIDictMapFrame.js";import{projectionToSpatialReference as r}from"./support/projectionToSpatialReference.js";import{ViewportMeasureFrame as i}from"./ViewportMeasureFrame.js";async function a(t,n=0){_(t.MediaBox),x(t.Rotate),t.LGIDict,t.VP;let{mapFrames:r,errors:i}=await o(t);if(!r.length){if(i.length){let t=i[0];throw new e(`geospatial-pdf-layer:load`,`${t.sourceType} frame ${t.frameIndex} is invalid`,`${t.message}`)}throw new e(`geospatial-pdf-layer:load`,`PDF does not contain LGIDict or VP/Measure geospatial metadata.`)}let a=n??0;if(!Number.isInteger(a)||a<0||a>=r.length)throw new e(`geospatial-pdf-layer:invalid-frame`,`Invalid map frame index: ${a}.`);return r[a].frame}async function o(n){let r=[],i=[],a=_(n.MediaBox),o=[{sourceType:`VP`,value:n.VP},{sourceType:`LGIDict`,value:n.LGIDict}];for(let{sourceType:d,value:f}of o){if(f==null)continue;let o=Array.isArray(f)?f:[f];for(let f=0;f<o.length;f++)try{let i=d===`VP`?await c(u(o[f]),a,n.geographicBounds):await s(l(o[f]),a,n.geographicBounds),[p,m,h,g]=i.ctm,_=p*g-m*h;if(!i.ctm.every(Number.isFinite)||!Number.isFinite(_)||_===0)throw new e(`geospatial-pdf-layer:invalid-frame`,`Map frame has an invalid CTM.`);let v=new t(i),y=v.getPageCoveragePercent();r.push({sourceType:d,frameIndex:f,frame:v,pageCoveragePercent:y})}catch(e){i.push({sourceType:d,frameIndex:f,message:e instanceof Error?e.message:String(e)})}}return r.sort((e,t)=>t.pageCoveragePercent-e.pageCoveragePercent),{mapFrames:r,errors:i}}async function s(t,i,a){if(!t.Projection)throw new e(`geospatial-pdf-layer:parse`,`LGIDict map frame missing Projection.`);let o=r(t.Projection),s;try{s=t.Display?r(t.Display):void 0}catch{s=o}return await n.create({ctm:t.CTM,registration:t.Registration,projection:o,display:s,neatline:t.Neatline,mediaBox:i,geographicBounds:a})}async function c(e,t,n){return await i.create({bbox:e.BBox,bounds:e.Measure?.Bounds,gpts:e.Measure?.GPTS,lpts:e.Measure?.LPTS,gcs:e.Measure?.GCS,mediaBox:t,geographicBounds:n})}function l(e){let t=C(e,`LGIDict map frame must be an object.`);return{CTM:_(t.CTM),Registration:v(t.Registration),Neatline:_(t.Neatline),Projection:p(t.Projection),Display:p(t.Display)}}function u(e){let t=C(e,`Viewport frame must be an object.`),n=d(t.Measure);return{BBox:_(t.BBox),Measure_Raw:t.Measure,Measure:n,Raw:t}}function d(e){if(S(e))return{Bounds:_(e.Bounds),GPTS:_(e.GPTS),LPTS:_(e.LPTS),GCS:f(e.GCS)}}function f(e){if(S(e))return{WKT:y(e.WKT),EPSG:x(e.EPSG)}}function p(e){if(S(e))return{Type:b(e.Type),Units:b(e.Units),Datum:m(e.Datum),Projection_Type:b(e.ProjectionType),Central_Meridian:x(e.CentralMeridian),False_Easting:x(e.FalseEasting),False_Northing:x(e.FalseNorthing),Height:x(e.Height),Hemisphere:b(e.Hemisphere),Latitude_One:x(e.LatitudeOne),Latitude_Two:x(e.LatitudeTwo),Latitude_Of_True_Scale:x(e.LatitudeOfTrueScale),Longitude_One:x(e.LongitudeOne),Longitude_Two:x(e.LongitudeTwo),Longitude_Down_From_Pole:x(e.LongitudeDownFromPole),Orientation:b(e.Orientation),Origin_Height:x(e.OriginHeight),Origin_Latitude:x(e.OriginLatitude),Origin_Longitude:x(e.OriginLongitude),Scale_Factor:x(e.ScaleFactor),Standard_Parallel:x(e.StandardParallel),Standard_Parallel_One:x(e.StandardParallelOne),Standard_Parallel_Two:x(e.StandardParallelTwo),Zone:x(e.Zone),Description:b(e.Description),raw:e}}function m(e){return e==null?null:typeof e==`string`?{kind:`name`,name:b(e),ellipsoid:null,to_WGS84:null,raw:e}:S(e)?{kind:`definition`,name:b(e.Description),ellipsoid:h(e.Ellipsoid),to_WGS84:g(e.ToWGS84),raw:e}:{kind:`unknown`,name:b(e),ellipsoid:null,to_WGS84:null,raw:e}}function h(e){if(S(e))return{semi_Major_Axis:x(e.SemiMajorAxis),inverse_Flattening:x(e.InvFlattening),semi_Minor_Axis:x(e.SemiMinorAxis),description:b(e.Description)}}function g(e){if(S(e))return{dx:x(e.dx)??0,dy:x(e.dy)??0,dz:x(e.dz)??0,rx:x(e.rx)??0,ry:x(e.ry)??0,rz:x(e.rz)??0,sf:x(e.sf)??0}}function _(e){if(!Array.isArray(e))return;let t=[];for(let n of e){let e=x(n);if(e===void 0)return;t.push(e)}return t}function v(e){if(Array.isArray(e))return e.filter(e=>Array.isArray(e)).map(e=>e.map(e=>x(e)).filter(e=>e!==void 0))}function y(e){if(e!=null)return typeof e==`string`?e:String(e)}function b(e){let t=y(e);if(t!==void 0)return t.trim()}function x(e){if(e==null)return;if(typeof e==`number`)return Number.isFinite(e)?e:void 0;if(typeof e!=`string`)return;let t=e.trim();if(t===``)return;let n=Number(t);return Number.isFinite(n)?n:void 0}function S(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function C(t,n){if(!S(t))throw new e(`geospatial-pdf-layer:parse`,n);return t}export{a as parse,o as parseAllFrames};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import{property as n,subclass as r}from"../../../core/accessorSupport/decorators.js";import{runUntracked as i}from"../../../core/accessorSupport/tracking.js";import has from"../../../core/has.js";import{exactEquals as a}from"../../../core/libs/gl-matrix-2/math/vec3.js";import o from"../../../core/Logger.js";import{destroyMaybe as s}from"../../../core/maybe.js";import c from"../../../core/PooledArray.js";import{EsriPromiseMixin as l}from"../../../core/Promise.js";import{isAbortError as u}from"../../../core/promiseUtils.js";import{watch as d,sync as f,initial as p}from"../../../core/reactiveUtils.js";import{UpdatingHandles as m}from"../../../core/support/UpdatingHandles.js";import{create as h,fromValues as g}from"../../../geometry/support/aaBoundingRect.js";import{I3SClientNodeLoader as _}from"../../../views/3d/layers/i3s/I3SClientNodeLoader.js";import{I3SDataRequester as v}from"../../../views/3d/layers/i3s/I3SDataRequester.js";import{addCallback as y}from"../../../views/3d/layers/i3s/I3SFrameTask.js";import{I3SIndex as b}from"../../../views/3d/layers/i3s/I3SIndex.js";import x from"../../../views/3d/layers/i3s/I3SLodHandling.js";import S from"../../../views/3d/layers/i3s/I3SNodeLoader.js";import{getVertexCrs as C,getIndexCrs as w,findIntersectingNodes as T}from"../../../views/3d/layers/i3s/I3SUtil.js";import E from"../../../views/3d/layers/i3s/I3SViewportQueries.js";import{groundNavigationConstants as D}from"../../../views/3d/state/utils/groundNavigationUtils.js";import{projectElevationUpdateExtent as O}from"../../../views/3d/support/elevationUpdateExtentUtils.js";import{toBoundingRect as k}from"../../../views/3d/support/extentUtils.js";import{minQuality as A}from"../../../views/3d/support/MemoryController.js";import{PromiseQueue as j}from"../../../views/support/PromiseQueue.js";import{noBudget as M}from"../../../views/support/Scheduler.js";const N=1e4,P=1e-4;let F=class extends l(t){get isMeshPyramid(){return this.layer.profile===`mesh-pyramids`||this.layer.store?.lodType===`MeshPyramid`}get isGraphics3D(){return this.layer.profile===`points`}get useMaximumNumberOfFeatures(){return!this.isMeshPyramid&&(this.layer.priority==null||this.layer.priority===`High`)}get indexRequester(){return new v(this.layer.customParameters,this.layer.apiKey)}get dataRequester(){return new v(this.layer.customParameters,this.layer.apiKey)}get crsVertex(){return C(this.layer)}get crsIndex(){return w(this.layer)}get layer(){return this.layerView.layer}get updating(){return this.running||this._updatingHandles.updating}get rootNodeVisible(){return i(()=>{if(this._index){let e=this._index.rootNode;if(e)return this._updateViewData(),this._index.isNodeVisible(e.index)}return!0})}get index(){return this._index}get requiredAttributes(){return this._requiredAttributes}constructor(e){super(e),this.featureTarget=5e4,this.fixedFeatureTarget=!1,this._updatingHandles=new m,this.running=!0,this.updatingProgress=1,this.leavesReached=!1,this.worker=null,this._featureLOD=1,this._stableFeatureLOD=!1,this._isIdle=!1,this._cameraDirty=!0,this._invisibleDirty=!1,this._newLoadingNodes=new c({deallocator:null}),this._modificationsNodeFilteringArray=new c,this._downloadingCount=0,this._loadingNodes=new Map,this._updatingNodes=new Map,this._progressMaxNumNodes=1,this._requiredAttributes=[],this._requiredAttributesDirty=!0,this._updatesDisabled=!1,this.disableIDBCache=!1,this._disableMemCache=!1,this._restartNodeLoading=!1,this._fields=null,this._attributeStorageInfo=null,this._idleQueue=new j,this._elevationUpdateNodes=new c({deallocator:null}),this._errorCount=0}initialize(){let{layerView:e,layer:t}=this;this._disableMemCache=!e.loadCachedGPUData||!e.addCachedGPUData,this._lodHandling=new x(e),this._defaultGeometrySchema=t.store.defaultGeometrySchema,this.disableIDBCache=!!has(`disable-feature:idb-cache`),`fields`in t&&(this._fields=t.fields,this._attributeStorageInfo=t.attributeStorageInfo),this.addResolvingPromise(Promise.all([t.indexInfo,t.when(),e.when()]).then(([n])=>{if(this.destroyed||!e||e.destroyed||!n)return;let{view:r,clientGeometry:i}=e;if(this._setClippingArea(r.clippingArea),this.addHandles([this._updatingHandles.add(()=>r?.pointsOfInterest?.focus?.renderLocation,e=>this._pointOfInterestChanged(e),{initial:!0,equals:a}),d(()=>r.quality,()=>this._setCameraDirty(),f),this._updatingHandles.add(()=>r.state.mode===2,t=>{this._updateIdleState(t),t&&(this._index?.resetFailedNodes(),e.contentVisible||this._updateViewData())},p),this._updatingHandles.add(()=>e.contentVisible,e=>{e&&this._index?.invalidateAllElevationRanges(),this.restartNodeLoading()},p),y(e.view.resourceController.scheduler,this),this._updatingHandles.add(()=>[this.featureTarget,this.fixedFeatureTarget],()=>{this._setCameraDirty(),this._stableFeatureLOD=!1}),this._updatingHandles.add(()=>r.state?.contentCamera,()=>this._setCameraDirty()),this._updatingHandles.add(()=>r.navigation.mode?.type,e=>{this._setCameraDirty(),this._index&&(this._index.isGroundNavigationMode=e===`ground`)}),this._updatingHandles.add(()=>t.elevationInfo,e=>this._elevationInfoChanged(e),f),this._updatingHandles.add(()=>e.lodFactor,()=>this._setCameraDirty()),this._updatingHandles.add(()=>e.availableFields,()=>this._requiredFieldsChange()),this._updatingHandles.add(()=>e.holeFilling,e=>this._index!=null&&(this._index.holeFilling=e))]),this._viewportQueries=new E(this.crsIndex,r.renderCoordsHelper,r.state.contentCamera,!r.state.fixedContentCamera||this.isGraphics3D,this._clippingArea,this.isMeshPyramid?r.groundView:r.elevationProvider,r.state.isGlobal,this.layer.elevationInfo,{progressiveLoadFactor:this._getProgressiveLoadFactor(),screenspaceErrorBias:this._lod,angleDependentLoD:this._lod<.5}),this._clientNodeLoader=new _(this.layer.uid,{indexSR:this.crsIndex,vertexSR:this.crsVertex,renderSR:r.renderCoordsHelper.spatialReference},r.resourceController.memoryController,this.worker),this._index=new b(t,r.navigation.mode.type===`ground`,D.i3sNodeDownwardCheckDistanceInMeters/r.renderCoordsHelper.unitInMeters,n,this.indexRequester,this._clientNodeLoader,this._viewportQueries,o.getLogger(this),e.holeFilling,t=>e.isNodeLoaded(t),t=>e.isNodeReloading(t),e=>this._shouldLoadNode(e),e=>this._enableFromGPUCache(e,1),e=>this._needsUpdate(e),t=>e.computeVisibilityObb?.(t)??null,e?.computeNodeFiltering?t=>e.computeNodeFiltering(t):void 0),this._index.updateElevationInfo(this.layer.elevationInfo,this.isMeshPyramid||this.isGraphics3D),this._index.imModificationsChanged(!!e.hasModifications),this._index.layerFilterChanged(!!e.hasGeometryFilter),i!=null){for(let e of i)this._addMesh(e.mesh,e.oid);this.addHandles(i.on(`change`,e=>{for(let t of e.removed)this._removeMesh(t.oid);for(let t of e.added)this._addMesh(t.mesh,t.oid)}))}this._startNodeLoading()}))}updateNodeModificationStatus(e){let t=this._index,n=this.layerView;t!=null&&n?.updateNodeModificationStatus&&(this._modificationsNodeFilteringArray.clear(),e.forAll(e=>{let n=t.getNode(e);n!=null&&this._modificationsNodeFilteringArray.push(n)}),n.updateNodeModificationStatus(this._modificationsNodeFilteringArray),this._invisibleDirty=!0)}destroy(){this.cancelNodeLoading(),this._updatingHandles.destroy(),this._nodeLoader=null,I.prune(),this._newLoadingNodes.prune(),this._modificationsNodeFilteringArray.prune(),this._elevationUpdateNodes.prune(),L!=null&&(L.hide(),L=null),this._index=null,this._lodHandling=s(this._lodHandling),this._nodeLoader=null,this._clientNodeLoader=null,this._viewportQueries=null,this._set(`worker`,null)}get viewportQueries(){return this._viewportQueries}_getRequiredAttributes(){if(this._attributeStorageInfo==null||!this._fields||!this.layerView.availableFields)return[];let e=this._attributeStorageInfo,t=this._fields,n=this.layer.objectIdField;return this.layerView.availableFields.map(n=>{let r=z(e,n),i=z(t,n);return r>=0&&i>=0?{index:r,name:t[i].name,field:t[i],attributeStorageInfo:e[r]}:null}).filter(e=>e!=null&&e.name!==n)}_requiredFieldsChange(){let e=this._getRequiredAttributes();R(this._requiredAttributes,e)||(this._requiredAttributes=e,this._requiredAttributesDirty=!1,this.restartNodeLoading())}requestUpdate(){this._requiredAttributesDirty=!0,this.restartNodeLoading()}_setClippingArea(e){let t=h();this._clippingArea=k(e,t,this.layerView.view.renderSpatialReference)?t:null}_pointOfInterestChanged(e){this._viewportQueries!=null&&(this._viewportQueries.setPointOfInterest(e),this._index!=null&&this._index.requestUpdate())}updateClippingArea(e){this._setClippingArea(e),this._viewportQueries!=null&&this._index!=null&&(this._viewportQueries.updateClippingArea(this._clippingArea),this._index.invalidateVisibilityCache()),this._setCameraDirty()}_setCameraDirty(){this._cameraDirty=!0,this._lodHandling.setLodGlobalDirty(),this._evaluateRunning()}_addMesh(e,t){if(this._index==null)return;let n=this._clientNodeLoader.createMeshNodeInfo(e,t),r=this._index.addClientNodeToIndex(n.id,n.mbs);this._clientNodeLoader.addMeshNode(r,n),this._evaluateRunning(),this.notifyChange(`rootNodeVisible`)}_removeMesh(e){let t=this._clientNodeLoader.getMeshNodeIndex(e);if(t!=null){if(this._index!=null)this._index.removeClientNodeFromIndex(t,(e,t)=>{this.layerView.removeNode(t),this._clientNodeLoader.removeNode(e),this.layerView.deleteCachedNodeData&&e!=null&&this.layerView.deleteCachedNodeData(e),this.layerView.deleteCachedGPUData?.(this.layerView.loadCachedGPUData?.(t))},(e,t,n)=>{this._clientNodeLoader.updateNodeIndex(e,t,n),this.layerView.updateNodeIndex&&this.layerView.updateNodeIndex(t,n)}),this.notifyChange(`rootNodeVisible`);else throw Error(`delayed removal of client side i3s node geometry not supported yet.`)}}updateElevationChanged(e,t){let n=this._index,r=this._viewportQueries;if(n?.rootNode==null||t==null||r==null)return null;let i=r.elevationIntersectionSpatialReference;i.equals(t)||(O(e,t,B,i)||g(-1/0,-1/0,1/0,1/0,B),e=B);let a=this._elevationUpdateNodes;return a.clear(),T(e,n.rootNode,n,e=>a.push(e.index),r),a.length&&(a.forAll(e=>n.updateElevationChanged(e)),this._setCameraDirty()),a}removeAllGeometryObbs(){this._index!=null&&this._index.removeAllGeometryObbs()}getRenderMbs(e){return this._viewportQueries==null?null:this._viewportQueries.calculateServiceMbsInRenderSRElevationAdjusted(e)}_elevationInfoChanged(e){this._index!=null&&(this._index.updateElevationInfo(e,this.isMeshPyramid||this.isGraphics3D),this._setCameraDirty())}restartNodeLoading(){this._restartNodeLoading=!0,this.cancelNodeLoading(),this._evaluateRunning()}schedule(e,t){let n=this._idleQueue.push(e,t);return this._evaluateRunning(),n}reschedule(e,t){let n=this._idleQueue.unshift(e,t);return this._evaluateRunning(),n}get _isIntegratedMesh(){return this.layer.type===`integrated-mesh`}get unloadedMemoryEstimate(){return this._index==null||!this.layerView.contentVisible?0:this._index.unloadedMemoryEstimate*this._lodDropFactor}async _loadNodeData(e,t){return e.index<0?this._clientNodeLoader.loadNodeData(e.id,t):this._nodeLoader.loadNodeData(e,t)}async _loadAttributes(e,t,n){return(e.index<0?this._clientNodeLoader:this._nodeLoader).loadAttributes(e,t,n)}get indexDepth(){return this._index==null?0:this._index.maxLevel}set disableMemCache(e){this._disableMemCache=!this.layerView.loadCachedGPUData||!this.layerView.addCachedGPUData||e}runTask(e,t){return this.layerView.contentVisible?!this.layerView.visible||this._index==null?-1/0:(this._processWithErrorLogging(e,t),this._index.maxPriority):(this._updateViewData(),this._evaluateRunning(),-1/0)}_processWithErrorLogging(e,t){try{this._process(e,t)}catch(e){this._errorCount<50?o.getLogger(this).error(`Error during processing: ${e} at ${e.stack}`):this._errorCount===50&&o.getLogger(this).error(`Too many errors for this layer. Further errors will not be displayed.`),this._errorCount++}}_process(e,t){this._restartNodeLoading&&this._startNodeLoading(),this._nodeLoader!=null&&this._index!=null&&(this._updateViewData(),this._invisibleDirty&&this._removeInvisibleNodes(e)&&(this._invisibleDirty=!1),this._isIntegratedMesh&&(e.enabled=!1),e.run(()=>this._processIndex(e)),this._updateFeatureLOD(),e.run(()=>this._processCache(e)),this._isIntegratedMesh&&(e.enabled=!0),e.run(()=>this._processNodes(e,t)),this._idleQueue.runTask(e),e.run(()=>this._prefetchIndex()),t.numIndexLoading+=this._index.indexLoading,t.numNodesLoading+=this._downloadingCount,e.run(()=>this._lodHandling.lodGlobalHandling(e)),this._evaluateRunning())}_processIndex(e){if(this._index==null)return!1;if(this._index.dirty){this._newLoadingNodes.clear(),this._index.update(Array.from(this._loadingNodes.keys()),e,e=>this.updateNodeModificationStatus(e)),this._disableMemCache||(this._newLoadingNodes.pushArray(this._index.updates.add.data,this._index.updates.add.length),this._newLoadingNodes.pushAll(this._index.updates.missing));let t=this._index.featureEstimate.leavesReached;!this._index.isLoading&&t!==this._get(`leavesReached`)&&this._set(`leavesReached`,t)}return this._index.load()}_prefetchIndex(){return this._index==null||this._loadingNodes.size>0||this._index.updates.add.length>0?!1:this._index.prefetch()}_updateFeatureLOD(){if(!this.useMaximumNumberOfFeatures||this._index==null||this._viewportQueries==null)return;let e=!this._index.isLoading,t=this.featureTarget*this._baseLOD,n=this._index.featureEstimate;if(n.estimate=n.estimate||t/2,this._index.indexMissing>500){if(this._featureLOD<=P)return;this._featureLOD/=1.5,this._stableFeatureLOD=!1}else if(e&&n.estimate<t){if(n.leavesReached||this._featureLOD>=N||this._stableFeatureLOD)return;let e=Math.min(10,Math.max(t/n.estimate,1.001));this._featureLOD*=e;let r=this._lod,i=this._index.checkFeatureTarget(t,r);i!==r&&(this._featureLOD=i/this._baseLOD,this._stableFeatureLOD=!0)}else if(n.estimate>t*1.2||e&&n.estimate>t){if(this._featureLOD<=P)return;this._featureLOD/=1+(n.estimate/t-1)*.25,this._stableFeatureLOD=!1}else return;this._featureLOD=Math.min(N,Math.max(P,this._featureLOD)),this._viewportQueries.updateScreenSpaceErrorBias(this._lod),this._index.requestUpdate()}_processCache(e){let t=this._index;if(t==null)return!1;for(;this._newLoadingNodes.length>0&&!e.done;){let n=this._newLoadingNodes.pop();for(let r=t.getParent(n);r!=null&&!this.layerView.isNodeLoaded(r.index);r=t.getParent(r.index)){if(!this._disableMemCache&&!t.useNodeAsHole(r.index)){e.enabled&&e.madeProgress();break}if(this._enableFromGPUCache(r,0)){e.madeProgress();break}}}return e.hasProgressed}_processNodes(e,t){if(this._index==null)return!1;let n=(this._isIdle?100:2)-this._loadingNodes.size,r=this._index.updates;for(r.cancel.forEach(this._cancelNode,this),r.cancel=[];r.remove.length>0&&!e.done;)this.layerView.removeNode(r.remove.pop()),e.madeProgress();for(;r.update.length>0&&!e.done;){let t=this._index.getNode(r.update.pop());t!=null&&(this._updateLoadedNode(t),e.madeProgress())}for(;r.add.length>0&&!e.done&&n>0;){--n;let i=this._index.getNode(r.add.back());if(i==null||i.cacheState!==2&&!this._hasNodeLoadToken(t))break;r.add.pop(),this._loadNode(i),e.madeProgress()}return e.hasProgressed}_cancelAllNodes(){this._loadingNodes.forEach(e=>e.abort()),this._loadingNodes.clear(),this._updatingNodes.forEach(e=>e.abort()),this._updatingNodes.clear()}_cancelNode(e){let t=this._loadingNodes.get(e);t&&(t.abort(),this._loadingNodes.delete(e))}_hasNodeLoadToken(e){return!this._isIdle&&e.numNodesLoading+this._loadingNodes.size>=2?!1:this.index==null||!this.dataRequester.isFull(this._index.urlPrefix)}_evaluateRunning(){let e=!1,t=0;if(this.layerView){if(!this.layerView.contentVisible)e=this._cameraDirty,t=+!e;else{let n=(this._index?.indexMissing??0)+(this._index?.updates.add.length??0)*3+this._loadingNodes.size*2;e=!!(n>0||this._updatingNodes.size>0||this._restartNodeLoading||this._cameraDirty||this._idleQueue.updating||this._lodHandling&&this._lodHandling.requiresLODGlobalHandling||this._index!=null&&this._index.isPrefetching),n===0&&(this._progressMaxNumNodes=1),this._progressMaxNumNodes=Math.max(n,this._progressMaxNumNodes),t=1-n/this._progressMaxNumNodes}this.running=e,this.updatingProgress=t}}_updateViewData(){if(!this._cameraDirty||this._index==null||this._viewportQueries==null)return;let e=this.layerView.view,{contentCamera:t,fixedContentCamera:n}=e.state;this._viewportQueries.updateCamera(t,!n||this.isGraphics3D),this._viewportQueries.setPointOfInterest(e.pointsOfInterest.focus.renderLocation),this._viewportQueries.updateScreenSpaceErrorBias(this._lod),this._index.invalidateVisibilityCache(),this._index.requestUpdate(),this._stableFeatureLOD=!1,this._invisibleDirty=!0,this._cameraDirty=!1,this.notifyChange(`rootNodeVisible`)}_getProgressiveLoadFactor(){return this.layerView.view.quality<1?1:this.layerView.progressiveLoadFactor}get _lod(){return this._featureLOD*this._baseLOD}get _baseLOD(){let e=this.layerView.lodFactor;return this.fixedFeatureTarget?1:(e>0?e:1)*this.layerView.view.quality}get _lodDropFactor(){return this.fixedFeatureTarget?1:(Math.min(this.layerView.view.quality,.5)-A)/(.5-A)}isGeometryVisible(e){return!!this._index?.isGeometryVisible(e.index)}updateVisibility(e){this._index?.invalidateNodeVisibilityCache(e)}invalidateGeometryVisibility(e){this._index?.invalidateGeometryVisibility(e)}invalidateVisibilityObbs(){this._index?.invalidateVisibilityObbs()}modificationsChanged(){this._index?.imModificationsChanged(!!this.layerView.hasModifications),this._invisibleDirty=!0}_shouldLoadNode(e){return!(!this._lodHandling.shouldLoadNode(e)||this._shouldDropNode(e)||this._index==null||!this._index.isGeometryVisible(e.index))}_shouldDropNode(e){if(this._viewportQueries==null)return!1;let t=this._lodDropFactor;return t>=1||!this._lodHandling.hasNoVisibleChildren(e)?!1:Math.abs(this._viewportQueries.calcCameraDistanceToCenterAndUpdateMinmax(e))-this._viewportQueries.minCenterDistance>(this._viewportQueries.maxCenterDistance-this._viewportQueries.minCenterDistance)*t}_startNodeLoading(){this._restartNodeLoading=!1;let e=this._index;if(this._updatesDisabled||e==null||this._viewportQueries==null)return;this._updateViewData(),this._requiredAttributesDirty&&=(this._requiredAttributes=this._getRequiredAttributes(),!1);let t={textureEncodings:this.layerView.supportedTextureEncodings,textureUsageMask:this.layerView.rendererTextureUsage,loadFeatureData:this.useMaximumNumberOfFeatures};this._nodeLoader=new S(this.layer,this.dataRequester,o.getLogger(this),this._defaultGeometrySchema,this._requiredAttributes,t),e.requestUpdate(),this._lodHandling.startNodeLoading((e,t)=>this._removeNodes(e,t,1),e,{maxLodLevel:this._viewportQueries.maxLodLevel}),this._evaluateRunning()}isNodeLoading(){return this._nodeLoader!=null&&this._index!=null}cancelNodeLoading(){this.isNodeLoading()&&(this.indexRequester.cancelAll(),this.dataRequester.cancelAll(),this._idleQueue.cancelAll(),this._cancelAllNodes(),this._nodeLoader=null,this._evaluateRunning())}_removeInvisibleNodes(e){let t=this._index;if(t==null||this._viewportQueries==null)return!1;I.clear(),this.layerView.getLoadedNodeIndices(I);let n=this._viewportQueries.maxCenterDistance===0,r=n?()=>!1:e=>this._shouldDropNode(e);return I.filterInPlace(e=>{let n=t.getNode(e);return n==null||!t.isGeometryVisible(e)||r(n)}),I.length>0&&this._lodHandling.setLodGlobalDirty(),this._removeNodes(I,e,0),n&&this._lodDropFactor<1?!1:I.length===0||(I.clear(),!1)}markNodeToRemove(e){I.push(e)}removeMarkedNodes(){this._removeNodes(I,M,0)}_removeNodes(e,t,n){if(!(e.length===0||t.done))for(this._index!=null&&this._index.requestUpdate();e.length>0&&!t.done;){let r=e.pop(),i=this._index;n===1&&this.layerView.nodeFadeoutEnabled&&i!=null&&i.isGeometryVisible(r)?this.layerView.fadeNode(r,1,!0):this.layerView.removeNode(r),t.madeProgress()}}_needsUpdate(e){if(e.resources.isEmpty||this._updatingNodes.has(e.index))return!1;let t=this.layerView.getLoadedAttributes(e.index);return t!=null&&t!==this._requiredAttributes}async _updateLoadedNode(e){let t=new AbortController,n=this._requiredAttributes;this._updatingNodes.set(e.index,t),this._evaluateRunning();try{let r=R(this.layerView.getLoadedAttributes(e.index),n)?this.layerView.getAttributeData(e.index):await this._loadAttributes(e,n,t.signal);await this.schedule(()=>this.layerView.updateAttributes(e.index,{loadedAttributes:n,attributeData:r},t.signal),t.signal)}catch(r){if(!u(r)&&!t.signal.aborted)try{await this.layerView.updateAttributes(e.index,{loadedAttributes:n,attributeData:{}},t.signal)}catch(e){u(e)||o.getLogger(this).error(`#updateLoadedNode()`,this.layer,e)}}finally{this._updatingNodes.get(e.index)===t&&(this._updatingNodes.delete(e.index),this._evaluateRunning())}}_loadNode(e){if(this._loadingNodes.has(e.index)){o.getLogger(this).error(`already loading node `+e.index);return}let t=new AbortController;this._loadingNodes.set(e.index,t),this._evaluateRunning(),this._loadAndAddNode(e,t.signal).then(n=>{n&&this._index!=null&&this._loadingNodes.get(e.index)===t&&(this._loadingNodes.delete(e.index),this._index.requestUpdate())}).catch(()=>{}).finally(()=>{this._loadingNodes.get(e.index)===t&&this._loadingNodes.delete(e.index),this._evaluateRunning()})}_loadAndAddNode(e,t){return e.cacheState===1?this._loadUncached(e,t).then(()=>!1):this._loadCached(e,t).then(t=>!t&&(e.cacheState=1,!0)).catch(t=>!u(t)&&(e.cacheState=1,!0))}_enableFromGPUCache(e,t){if(this._disableMemCache||this._index==null)return!1;let n=this._loadCachedGPUData(e);return n?(this.layerView.addCachedGPUData(e,n,t),this._nodeAdded(),!0):!1}_loadCachedGPUData(e){let t=this.layerView.loadCachedGPUData(e.index);return t?.attributeInfo!=null&&R(t.attributeInfo.loadedAttributes,this._requiredAttributes)?t:(this.layerView.deleteCachedGPUData(t),null)}_nodeAdded(){this._index!=null&&this._index.requestUpdate(),this._lodHandling.setLodGlobalDirty(),this._evaluateRunning()}updateLoadStatus(e,t){this._index?.updateChildrenLoaded(e,t?1:-1)}async _loadCached(e,t){if(this._enableFromGPUCache(e,1))return!0;let n=this.layerView;if(this.disableIDBCache||!n.loadCachedNodeData||!n.addCachedNodeData)return!1;let r=e.index>=0?(t,n)=>this._nodeLoader.loadTextures(e,t,n):t=>this._clientNodeLoader.loadTextures(e,t),i=await this.schedule(()=>n.loadCachedNodeData(e,t,r),t);if(i==null)return!1;let a=this._requiredAttributes,o=await this.reschedule(()=>this._loadAttributes(e,a,t),t);return await this.reschedule(()=>n.addCachedNodeData(e,i,{loadedAttributes:a,attributeData:o},t),t),this._nodeAdded(),!0}_loadUncached(e,t){return this._downloadingCount++,this._loadNodeData(e,t).then(n=>this.schedule(()=>this.layerView.addNode(e,n,t),t)).finally(()=>this._downloadingCount--).then(()=>{this._nodeAdded(),e.cacheState=2}).catch(t=>{if(!u(t))throw o.getLogger(this).error(`#loadNodeData()`,this.layer,`Failed to load node '${e.id}'`,t),e.failed=!0,this._index?.requestUpdate(),t})}_updateIdleState(e){e!==this._isIdle&&(this._isIdle=e,this._evaluateRunning())}get test(){}notifyLODUpdate(){this._lodHandling.setLodGlobalDirty(),this._evaluateRunning(),this._index!=null&&this._index.requestUpdate()}geometryFilterChanged(e){this._index?.layerFilterChanged(e),this._setCameraDirty()}};e([n({readOnly:!0})],F.prototype,`isMeshPyramid`,null),e([n({readOnly:!0})],F.prototype,`isGraphics3D`,null),e([n({readOnly:!0})],F.prototype,`useMaximumNumberOfFeatures`,null),e([n({readOnly:!0})],F.prototype,`indexRequester`,null),e([n({readOnly:!0})],F.prototype,`dataRequester`,null),e([n({readOnly:!0})],F.prototype,`crsVertex`,null),e([n({readOnly:!0})],F.prototype,`crsIndex`,null),e([n()],F.prototype,`featureTarget`,void 0),e([n()],F.prototype,`fixedFeatureTarget`,void 0),e([n()],F.prototype,`layerView`,void 0),e([n()],F.prototype,`layer`,null),e([n()],F.prototype,`_updatingHandles`,void 0),e([n()],F.prototype,`updating`,null),e([n()],F.prototype,`running`,void 0),e([n()],F.prototype,`updatingProgress`,void 0),e([n({readOnly:!0})],F.prototype,`leavesReached`,void 0),e([n({constructOnly:!0})],F.prototype,`worker`,void 0),e([n({readOnly:!0})],F.prototype,`rootNodeVisible`,null),F=e([r(`esri.layers.graphics.controllers.I3SOnDemandController`)],F);const I=new c({deallocator:null});let L;function R(e,t){return e!=null&&e.length===t.length&&e.every(e=>z(t,e.name)>=0)}function z(e,t){let n=t.toLowerCase();for(let t=0;t<e.length;t++)if(e[t].name.toLowerCase()===n)return t;return-1}const B=h(),V=F;export{V as default};
2
+ import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import{property as n,subclass as r}from"../../../core/accessorSupport/decorators.js";import{runUntracked as i}from"../../../core/accessorSupport/tracking.js";import has from"../../../core/has.js";import{exactEquals as a}from"../../../core/libs/gl-matrix-2/math/vec3.js";import o from"../../../core/Logger.js";import{destroyMaybe as s}from"../../../core/maybe.js";import c from"../../../core/PooledArray.js";import{EsriPromiseMixin as l}from"../../../core/Promise.js";import{isAbortError as u}from"../../../core/promiseUtils.js";import{watch as d,sync as f,initial as p}from"../../../core/reactiveUtils.js";import{UpdatingHandles as m}from"../../../core/support/UpdatingHandles.js";import{create as h,fromValues as g}from"../../../geometry/support/aaBoundingRect.js";import{I3SClientNodeLoader as _}from"../../../views/3d/layers/i3s/I3SClientNodeLoader.js";import{I3SDataRequester as v}from"../../../views/3d/layers/i3s/I3SDataRequester.js";import{addCallback as y}from"../../../views/3d/layers/i3s/I3SFrameTask.js";import{I3SIndex as b}from"../../../views/3d/layers/i3s/I3SIndex.js";import x from"../../../views/3d/layers/i3s/I3SLodHandling.js";import S from"../../../views/3d/layers/i3s/I3SNodeLoader.js";import{getVertexCrs as C,getIndexCrs as w,findIntersectingNodes as T}from"../../../views/3d/layers/i3s/I3SUtil.js";import E from"../../../views/3d/layers/i3s/I3SViewportQueries.js";import{groundNavigationConstants as D}from"../../../views/3d/state/utils/groundNavigationUtils.js";import{projectElevationUpdateExtent as O}from"../../../views/3d/support/elevationUpdateExtentUtils.js";import{toBoundingRect as k}from"../../../views/3d/support/extentUtils.js";import{minQuality as A}from"../../../views/3d/support/MemoryController.js";import{PromiseQueue as j}from"../../../views/support/PromiseQueue.js";import{noBudget as M}from"../../../views/support/Scheduler.js";const N=1e4,P=1e-4;let F=class extends l(t){get isMeshPyramid(){return this.layer.profile===`mesh-pyramids`||this.layer.store?.lodType===`MeshPyramid`}get isGraphics3D(){return this.layer.profile===`points`}get useMaximumNumberOfFeatures(){return!this.isMeshPyramid&&(this.layer.priority==null||this.layer.priority===`High`)}get indexRequester(){return new v(this.layer.customParameters,this.layer.apiKey)}get dataRequester(){return new v(this.layer.customParameters,this.layer.apiKey)}get crsVertex(){return C(this.layer)}get crsIndex(){return w(this.layer)}get layer(){return this.layerView.layer}get updating(){return this.running||this._updatingHandles.updating}get rootNodeVisible(){return i(()=>{if(this._index){let e=this._index.rootNode;if(e)return this._updateViewData(),this._index.isNodeVisible(e.index)}return!0})}get index(){return this._index}get requiredAttributes(){return this._requiredAttributes}constructor(e){super(e),this.featureTarget=5e4,this.fixedFeatureTarget=!1,this._updatingHandles=new m,this.running=!0,this.updatingProgress=1,this.leavesReached=!1,this.worker=null,this._featureLOD=1,this._stableFeatureLOD=!1,this._isIdle=!1,this._cameraDirty=!0,this._invisibleDirty=!1,this._newLoadingNodes=new c({deallocator:null}),this._modificationsNodeFilteringArray=new c,this._downloadingCount=0,this._loadingNodes=new Map,this._updatingNodes=new Map,this._progressMaxNumNodes=1,this._requiredAttributes=[],this._requiredAttributesDirty=!0,this._updatesDisabled=!1,this.disableIDBCache=!1,this._disableMemCache=!1,this._restartNodeLoading=!1,this._fields=null,this._attributeStorageInfo=null,this._idleQueue=new j,this._elevationUpdateNodes=new c({deallocator:null}),this._errorCount=0}initialize(){let{layerView:e,layer:t}=this;this._disableMemCache=!e.loadCachedGPUData||!e.addCachedGPUData,this._lodHandling=new x(e),this._defaultGeometrySchema=t.store.defaultGeometrySchema,this.disableIDBCache=!!has(`disable-feature:idb-cache`),`fields`in t&&(this._fields=t.fields,this._attributeStorageInfo=t.attributeStorageInfo),this.addResolvingPromise(Promise.all([t.indexInfo,t.when(),e.when()]).then(([n])=>{if(this.destroyed||!e||e.destroyed||!n)return;let{view:r,clientGeometry:i}=e;if(this._setClippingArea(r.clippingArea),this.addHandles([this._updatingHandles.add(()=>r?.pointsOfInterest?.focus?.renderLocation,e=>this._pointOfInterestChanged(e),{initial:!0,equals:a}),d(()=>r.quality,()=>this._setCameraDirty(),f),this._updatingHandles.add(()=>r.state.mode===2,t=>{this._updateIdleState(t),t&&(this._index?.resetFailedNodes(),e.contentVisible||this._updateViewData())},p),this._updatingHandles.add(()=>e.contentVisible,e=>{e&&this._index?.invalidateAllElevationRanges(),this.restartNodeLoading()},p),y(e.view.resourceController.scheduler,this),this._updatingHandles.add(()=>[this.featureTarget,this.fixedFeatureTarget],()=>{this._setCameraDirty(),this._stableFeatureLOD=!1}),this._updatingHandles.add(()=>r.state?.contentCamera,()=>this._setCameraDirty()),this._updatingHandles.add(()=>r.navigation.mode?.type,e=>{this._setCameraDirty(),this._index&&(this._index.isGroundNavigationMode=e===`ground`)}),this._updatingHandles.add(()=>t.elevationInfo,e=>this._elevationInfoChanged(e),f),this._updatingHandles.add(()=>e.lodFactor,()=>this._setCameraDirty()),this._updatingHandles.add(()=>e.availableFields,()=>this._requiredFieldsChange()),this._updatingHandles.add(()=>e.holeFilling,e=>this._index!=null&&(this._index.holeFilling=e))]),this._viewportQueries=new E(this.crsIndex,r.renderCoordsHelper,r.state.contentCamera,!r.state.fixedContentCamera||this.isGraphics3D,this._clippingArea,this.isMeshPyramid?r.groundView:r.elevationProvider,r.state.isGlobal,this.layer.elevationInfo,{progressiveLoadFactor:this._getProgressiveLoadFactor(),screenspaceErrorBias:this._lod,angleDependentLoD:this._lod<.5}),this._clientNodeLoader=new _(this.layer.uid,{indexSR:this.crsIndex,vertexSR:this.crsVertex,renderSR:r.renderCoordsHelper.spatialReference},r.resourceController.memoryController,this.worker),this._index=new b(t,r.navigation.mode.type===`ground`,D.i3sNodeDownwardCheckDistanceInMeters/r.renderCoordsHelper.unitInMeters,n,this.indexRequester,this._clientNodeLoader,this._viewportQueries,o.getLogger(this),e.holeFilling,t=>e.isNodeLoaded(t),t=>e.isNodeReloading(t),e=>this._shouldLoadNode(e),e=>this._enableFromGPUCache(e,1),e=>this._needsUpdate(e),t=>e.computeVisibilityObb?.(t)??null,e?.computeNodeFiltering?t=>e.computeNodeFiltering(t):void 0),this._index.updateElevationInfo(this.layer.elevationInfo,this.isMeshPyramid||this.isGraphics3D),this._index.imModificationsChanged(!!e.hasModifications),this._index.layerFilterChanged(!!e.hasGeometryFilter),i!=null){for(let e of i)this._addMesh(e.mesh,e.oid);this.addHandles(i.on(`change`,e=>{for(let t of e.removed)this._removeMesh(t.oid);for(let t of e.added)this._addMesh(t.mesh,t.oid)}))}this._startNodeLoading()}))}updateNodeModificationStatus(e){let t=this._index,n=this.layerView;t!=null&&n?.updateNodeModificationStatus&&(this._modificationsNodeFilteringArray.clear(),e.forAll(e=>{let n=t.getNode(e);n!=null&&this._modificationsNodeFilteringArray.push(n)}),n.updateNodeModificationStatus(this._modificationsNodeFilteringArray),this._invisibleDirty=!0)}destroy(){this.cancelNodeLoading(),this._updatingHandles.destroy(),this._nodeLoader=null,I.prune(),this._newLoadingNodes.prune(),this._modificationsNodeFilteringArray.prune(),this._elevationUpdateNodes.prune(),L!=null&&(L.hide(),L=null),this._index=null,this._lodHandling=s(this._lodHandling),this._nodeLoader=null,this._clientNodeLoader=null,this._viewportQueries=null,this._set(`worker`,null)}get viewportQueries(){return this._viewportQueries}_getRequiredAttributes(){if(this._attributeStorageInfo==null||!this._fields||!this.layerView.availableFields)return[];let e=this._attributeStorageInfo,t=this._fields,n=this.layer.objectIdField;return this.layerView.availableFields.map(n=>{let r=z(e,n),i=z(t,n);return r>=0&&i>=0?{index:r,name:t[i].name,field:t[i],attributeStorageInfo:e[r]}:null}).filter(e=>e!=null&&e.name!==n)}_requiredFieldsChange(){let e=this._getRequiredAttributes();R(this._requiredAttributes,e)||(this._requiredAttributes=e,this._requiredAttributesDirty=!1,this.restartNodeLoading())}requestUpdate(){this._requiredAttributesDirty=!0,this.restartNodeLoading()}_setClippingArea(e){let t=h();this._clippingArea=k(e,t,this.layerView.view.renderSpatialReference)?t:null}_pointOfInterestChanged(e){this._viewportQueries!=null&&(this._viewportQueries.setPointOfInterest(e),this._index!=null&&this._index.requestUpdate())}updateClippingArea(e){this._setClippingArea(e),this._viewportQueries!=null&&this._index!=null&&(this._viewportQueries.updateClippingArea(this._clippingArea),this._index.invalidateVisibilityCache()),this._setCameraDirty()}_setCameraDirty(){this._cameraDirty=!0,this._lodHandling.setLodGlobalDirty(),this._evaluateRunning()}_addMesh(e,t){if(this._index==null)return;let n=this._clientNodeLoader.createMeshNodeInfo(e,t),r=this._index.addClientNodeToIndex(n.id,n.mbs);this._clientNodeLoader.addMeshNode(r,n),this._evaluateRunning(),this.notifyChange(`rootNodeVisible`)}_removeMesh(e){let t=this._clientNodeLoader.getMeshNodeIndex(e);if(t!=null){if(this._index!=null)this._index.removeClientNodeFromIndex(t,(e,t)=>{this.layerView.removeNode(t),this._clientNodeLoader.removeNode(e),this.layerView.deleteCachedNodeData&&e!=null&&this.layerView.deleteCachedNodeData(e),this.layerView.deleteCachedGPUData?.(this.layerView.loadCachedGPUData?.(t))},(e,t,n)=>{this._clientNodeLoader.updateNodeIndex(e,t,n),this.layerView.updateNodeIndex&&this.layerView.updateNodeIndex(t,n)}),this.notifyChange(`rootNodeVisible`);else throw Error(`delayed removal of client side i3s node geometry not supported yet.`)}}updateElevationChanged(e,t){let n=this._index,r=this._viewportQueries;if(n?.rootNode==null||t==null||r==null)return null;let i=r.elevationIntersectionSpatialReference;i.equals(t)||(O(e,t,B,i)||g(-1/0,-1/0,1/0,1/0,B),e=B);let a=this._elevationUpdateNodes;return a.clear(),T(e,n.rootNode,n,e=>a.push(e.index),r),a.length&&(a.forAll(e=>n.updateElevationChanged(e)),this._setCameraDirty()),a}removeAllGeometryObbs(){this._index!=null&&this._index.removeAllGeometryObbs()}getRenderMbs(e){return this._viewportQueries==null?null:this._viewportQueries.calculateServiceMbsInRenderSRElevationAdjusted(e)}_elevationInfoChanged(e){this._index!=null&&(this._index.updateElevationInfo(e,this.isMeshPyramid||this.isGraphics3D),this._setCameraDirty())}restartNodeLoading(){this._restartNodeLoading=!0,this.cancelNodeLoading(),this._evaluateRunning()}schedule(e,t){let n=this._idleQueue.push(e,t);return this._evaluateRunning(),n}reschedule(e,t){let n=this._idleQueue.unshift(e,t);return this._evaluateRunning(),n}get unloadedMemoryEstimate(){return this._index==null||!this.layerView.contentVisible?0:this._index.unloadedMemoryEstimate*this._lodDropFactor}async _loadNodeData(e,t){return e.index<0?this._clientNodeLoader.loadNodeData(e.id,t):this._nodeLoader.loadNodeData(e,t)}async _loadAttributes(e,t,n){return(e.index<0?this._clientNodeLoader:this._nodeLoader).loadAttributes(e,t,n)}get indexDepth(){return this._index==null?0:this._index.maxLevel}set disableMemCache(e){this._disableMemCache=!this.layerView.loadCachedGPUData||!this.layerView.addCachedGPUData||e}runTask(e,t){return this.layerView.contentVisible?!this.layerView.visible||this._index==null?-1/0:(this._processWithErrorLogging(e,t),this._index.maxPriority):(this._updateViewData(),this._evaluateRunning(),-1/0)}_processWithErrorLogging(e,t){try{this._process(e,t)}catch(e){this._errorCount<50?o.getLogger(this).error(`Error during processing: ${e} at ${e.stack}`):this._errorCount===50&&o.getLogger(this).error(`Too many errors for this layer. Further errors will not be displayed.`),this._errorCount++}}_process(e,t){this._restartNodeLoading&&this._startNodeLoading(),this._nodeLoader!=null&&this._index!=null&&(this._updateViewData(),this._invisibleDirty&&this._removeInvisibleNodes(e)&&(this._invisibleDirty=!1),e.run(()=>this._processIndex(e)),this._updateFeatureLOD(),e.run(()=>this._processCache(e)),e.run(()=>this._processNodes(e,t)),this._idleQueue.runTask(e),e.run(()=>this._prefetchIndex()),t.numIndexLoading+=this._index.indexLoading,t.numNodesLoading+=this._downloadingCount,e.run(()=>this._lodHandling.lodGlobalHandling(e)),this._evaluateRunning())}_processIndex(e){if(this._index==null)return!1;if(this._index.dirty){this._newLoadingNodes.clear(),this._index.update(Array.from(this._loadingNodes.keys()),e,e=>this.updateNodeModificationStatus(e)),this._disableMemCache||(this._newLoadingNodes.pushArray(this._index.updates.add.data,this._index.updates.add.length),this._newLoadingNodes.pushAll(this._index.updates.missing));let t=this._index.featureEstimate.leavesReached;!this._index.isLoading&&t!==this._get(`leavesReached`)&&this._set(`leavesReached`,t)}return this._index.load()}_prefetchIndex(){return this._index==null||this._loadingNodes.size>0||this._index.updates.add.length>0?!1:this._index.prefetch()}_updateFeatureLOD(){if(!this.useMaximumNumberOfFeatures||this._index==null||this._viewportQueries==null)return;let e=!this._index.isLoading,t=this.featureTarget*this._baseLOD,n=this._index.featureEstimate;if(n.estimate=n.estimate||t/2,this._index.indexMissing>500){if(this._featureLOD<=P)return;this._featureLOD/=1.5,this._stableFeatureLOD=!1}else if(e&&n.estimate<t){if(n.leavesReached||this._featureLOD>=N||this._stableFeatureLOD)return;let e=Math.min(10,Math.max(t/n.estimate,1.001));this._featureLOD*=e;let r=this._lod,i=this._index.checkFeatureTarget(t,r);i!==r&&(this._featureLOD=i/this._baseLOD,this._stableFeatureLOD=!0)}else if(n.estimate>t*1.2||e&&n.estimate>t){if(this._featureLOD<=P)return;this._featureLOD/=1+(n.estimate/t-1)*.25,this._stableFeatureLOD=!1}else return;this._featureLOD=Math.min(N,Math.max(P,this._featureLOD)),this._viewportQueries.updateScreenSpaceErrorBias(this._lod),this._index.requestUpdate()}_processCache(e){let t=this._index;if(t==null)return!1;for(;this._newLoadingNodes.length>0&&!e.done;){let n=this._newLoadingNodes.pop();for(let r=t.getParent(n);r!=null&&!this.layerView.isNodeLoaded(r.index);r=t.getParent(r.index)){if(!this._disableMemCache&&!t.useNodeAsHole(r.index)){e.enabled&&e.madeProgress();break}if(this._enableFromGPUCache(r,0)){e.madeProgress();break}}}return e.hasProgressed}_processNodes(e,t){if(this._index==null)return!1;let n=(this._isIdle?100:2)-this._loadingNodes.size,r=this._index.updates;for(r.cancel.forEach(this._cancelNode,this),r.cancel=[];r.remove.length>0&&!e.done;)this.layerView.removeNode(r.remove.pop()),e.madeProgress();for(;r.update.length>0&&!e.done;){let t=this._index.getNode(r.update.pop());t!=null&&(this._updateLoadedNode(t),e.madeProgress())}for(;r.add.length>0&&!e.done&&n>0;){--n;let i=this._index.getNode(r.add.back());if(i==null||i.cacheState!==2&&!this._hasNodeLoadToken(t))break;r.add.pop(),this._loadNode(i),e.madeProgress()}return e.hasProgressed}_cancelAllNodes(){this._loadingNodes.forEach(e=>e.abort()),this._loadingNodes.clear(),this._updatingNodes.forEach(e=>e.abort()),this._updatingNodes.clear()}_cancelNode(e){let t=this._loadingNodes.get(e);t&&(t.abort(),this._loadingNodes.delete(e))}_hasNodeLoadToken(e){return!this._isIdle&&e.numNodesLoading+this._loadingNodes.size>=2?!1:this.index==null||!this.dataRequester.isFull(this._index.urlPrefix)}_evaluateRunning(){let e=!1,t=0;if(this.layerView){if(!this.layerView.contentVisible)e=this._cameraDirty,t=+!e;else{let n=(this._index?.indexMissing??0)+(this._index?.updates.add.length??0)*3+this._loadingNodes.size*2;e=!!(n>0||this._updatingNodes.size>0||this._restartNodeLoading||this._cameraDirty||this._idleQueue.updating||this._lodHandling&&this._lodHandling.requiresLODGlobalHandling||this._index!=null&&this._index.isPrefetching),n===0&&(this._progressMaxNumNodes=1),this._progressMaxNumNodes=Math.max(n,this._progressMaxNumNodes),t=1-n/this._progressMaxNumNodes}this.running=e,this.updatingProgress=t}}_updateViewData(){if(!this._cameraDirty||this._index==null||this._viewportQueries==null)return;let e=this.layerView.view,{contentCamera:t,fixedContentCamera:n}=e.state;this._viewportQueries.updateCamera(t,!n||this.isGraphics3D),this._viewportQueries.setPointOfInterest(e.pointsOfInterest.focus.renderLocation),this._viewportQueries.updateScreenSpaceErrorBias(this._lod),this._index.invalidateVisibilityCache(),this._index.requestUpdate(),this._stableFeatureLOD=!1,this._invisibleDirty=!0,this._cameraDirty=!1,this.notifyChange(`rootNodeVisible`)}_getProgressiveLoadFactor(){return this.layerView.view.quality<1?1:this.layerView.progressiveLoadFactor}get _lod(){return this._featureLOD*this._baseLOD}get _baseLOD(){let e=this.layerView.lodFactor;return this.fixedFeatureTarget?1:(e>0?e:1)*this.layerView.view.quality}get _lodDropFactor(){return this.fixedFeatureTarget?1:(Math.min(this.layerView.view.quality,.5)-A)/(.5-A)}isGeometryVisible(e){return!!this._index?.isGeometryVisible(e.index)}updateVisibility(e){this._index?.invalidateNodeVisibilityCache(e)}invalidateGeometryVisibility(e){this._index?.invalidateGeometryVisibility(e)}invalidateVisibilityObbs(){this._index?.invalidateVisibilityObbs()}modificationsChanged(){this._index?.imModificationsChanged(!!this.layerView.hasModifications),this._invisibleDirty=!0}_shouldLoadNode(e){return!(!this._lodHandling.shouldLoadNode(e)||this._shouldDropNode(e)||this._index==null||!this._index.isGeometryVisible(e.index))}_shouldDropNode(e){if(this._viewportQueries==null)return!1;let t=this._lodDropFactor;return t>=1||!this._lodHandling.hasNoVisibleChildren(e)?!1:Math.abs(this._viewportQueries.calcCameraDistanceToCenterAndUpdateMinmax(e))-this._viewportQueries.minCenterDistance>(this._viewportQueries.maxCenterDistance-this._viewportQueries.minCenterDistance)*t}_startNodeLoading(){this._restartNodeLoading=!1;let e=this._index;if(this._updatesDisabled||e==null||this._viewportQueries==null)return;this._updateViewData(),this._requiredAttributesDirty&&=(this._requiredAttributes=this._getRequiredAttributes(),!1);let t={textureEncodings:this.layerView.supportedTextureEncodings,textureUsageMask:this.layerView.rendererTextureUsage,loadFeatureData:this.useMaximumNumberOfFeatures};this._nodeLoader=new S(this.layer,this.dataRequester,o.getLogger(this),this._defaultGeometrySchema,this._requiredAttributes,t),e.requestUpdate(),this._lodHandling.startNodeLoading((e,t)=>this._removeNodes(e,t,1),e,{maxLodLevel:this._viewportQueries.maxLodLevel}),this._evaluateRunning()}isNodeLoading(){return this._nodeLoader!=null&&this._index!=null}cancelNodeLoading(){this.isNodeLoading()&&(this.indexRequester.cancelAll(),this.dataRequester.cancelAll(),this._idleQueue.cancelAll(),this._cancelAllNodes(),this._nodeLoader=null,this._evaluateRunning())}_removeInvisibleNodes(e){let t=this._index;if(t==null||this._viewportQueries==null)return!1;I.clear(),this.layerView.getLoadedNodeIndices(I);let n=this._viewportQueries.maxCenterDistance===0,r=n?()=>!1:e=>this._shouldDropNode(e);return I.filterInPlace(e=>{let n=t.getNode(e);return n==null||!t.isGeometryVisible(e)||r(n)}),I.length>0&&this._lodHandling.setLodGlobalDirty(),this._removeNodes(I,e,0),n&&this._lodDropFactor<1?!1:I.length===0||(I.clear(),!1)}markNodeToRemove(e){I.push(e)}removeMarkedNodes(){this._removeNodes(I,M,0)}_removeNodes(e,t,n){if(!(e.length===0||t.done))for(this._index!=null&&this._index.requestUpdate();e.length>0&&!t.done;){let r=e.pop(),i=this._index;n===1&&this.layerView.nodeFadeoutEnabled&&i!=null&&i.isGeometryVisible(r)?this.layerView.fadeNode(r,1,!0):this.layerView.removeNode(r),t.madeProgress()}}_needsUpdate(e){if(e.resources.isEmpty||this._updatingNodes.has(e.index))return!1;let t=this.layerView.getLoadedAttributes(e.index);return t!=null&&t!==this._requiredAttributes}async _updateLoadedNode(e){let t=new AbortController,n=this._requiredAttributes;this._updatingNodes.set(e.index,t),this._evaluateRunning();try{let r=R(this.layerView.getLoadedAttributes(e.index),n)?this.layerView.getAttributeData(e.index):await this._loadAttributes(e,n,t.signal);await this.schedule(()=>this.layerView.updateAttributes(e.index,{loadedAttributes:n,attributeData:r},t.signal),t.signal)}catch(r){if(!u(r)&&!t.signal.aborted)try{await this.layerView.updateAttributes(e.index,{loadedAttributes:n,attributeData:{}},t.signal)}catch(e){u(e)||o.getLogger(this).error(`#updateLoadedNode()`,this.layer,e)}}finally{this._updatingNodes.get(e.index)===t&&(this._updatingNodes.delete(e.index),this._evaluateRunning())}}_loadNode(e){if(this._loadingNodes.has(e.index)){o.getLogger(this).error(`already loading node `+e.index);return}let t=new AbortController;this._loadingNodes.set(e.index,t),this._evaluateRunning(),this._loadAndAddNode(e,t.signal).then(n=>{n&&this._index!=null&&this._loadingNodes.get(e.index)===t&&(this._loadingNodes.delete(e.index),this._index.requestUpdate())}).catch(()=>{}).finally(()=>{this._loadingNodes.get(e.index)===t&&this._loadingNodes.delete(e.index),this._evaluateRunning()})}_loadAndAddNode(e,t){return e.cacheState===1?this._loadUncached(e,t).then(()=>!1):this._loadCached(e,t).then(t=>!t&&(e.cacheState=1,!0)).catch(t=>!u(t)&&(e.cacheState=1,!0))}_enableFromGPUCache(e,t){if(this._disableMemCache||this._index==null)return!1;let n=this._loadCachedGPUData(e);return n?(this.layerView.addCachedGPUData(e,n,t),this._nodeAdded(),!0):!1}_loadCachedGPUData(e){let t=this.layerView.loadCachedGPUData(e.index);return t?.attributeInfo!=null&&R(t.attributeInfo.loadedAttributes,this._requiredAttributes)?t:(this.layerView.deleteCachedGPUData(t),null)}_nodeAdded(){this._index!=null&&this._index.requestUpdate(),this._lodHandling.setLodGlobalDirty(),this._evaluateRunning()}updateLoadStatus(e,t){this._index?.updateChildrenLoaded(e,t?1:-1)}async _loadCached(e,t){if(this._enableFromGPUCache(e,1))return!0;let n=this.layerView;if(this.disableIDBCache||!n.loadCachedNodeData||!n.addCachedNodeData)return!1;let r=e.index>=0?(t,n)=>this._nodeLoader.loadTextures(e,t,n):t=>this._clientNodeLoader.loadTextures(e,t),i=await this.schedule(()=>n.loadCachedNodeData(e,t,r),t);if(i==null)return!1;let a=this._requiredAttributes,o=await this.reschedule(()=>this._loadAttributes(e,a,t),t);return await this.reschedule(()=>n.addCachedNodeData(e,i,{loadedAttributes:a,attributeData:o},t),t),this._nodeAdded(),!0}_loadUncached(e,t){return this._downloadingCount++,this._loadNodeData(e,t).then(n=>this.schedule(()=>this.layerView.addNode(e,n,t),t)).finally(()=>this._downloadingCount--).then(()=>{this._nodeAdded(),e.cacheState=2}).catch(t=>{if(!u(t))throw o.getLogger(this).error(`#loadNodeData()`,this.layer,`Failed to load node '${e.id}'`,t),e.failed=!0,this._index?.requestUpdate(),t})}_updateIdleState(e){e!==this._isIdle&&(this._isIdle=e,this._evaluateRunning())}get test(){}notifyLODUpdate(){this._lodHandling.setLodGlobalDirty(),this._evaluateRunning(),this._index!=null&&this._index.requestUpdate()}geometryFilterChanged(e){this._index?.layerFilterChanged(e),this._setCameraDirty()}};e([n({readOnly:!0})],F.prototype,`isMeshPyramid`,null),e([n({readOnly:!0})],F.prototype,`isGraphics3D`,null),e([n({readOnly:!0})],F.prototype,`useMaximumNumberOfFeatures`,null),e([n({readOnly:!0})],F.prototype,`indexRequester`,null),e([n({readOnly:!0})],F.prototype,`dataRequester`,null),e([n({readOnly:!0})],F.prototype,`crsVertex`,null),e([n({readOnly:!0})],F.prototype,`crsIndex`,null),e([n()],F.prototype,`featureTarget`,void 0),e([n()],F.prototype,`fixedFeatureTarget`,void 0),e([n()],F.prototype,`layerView`,void 0),e([n()],F.prototype,`layer`,null),e([n()],F.prototype,`_updatingHandles`,void 0),e([n()],F.prototype,`updating`,null),e([n()],F.prototype,`running`,void 0),e([n()],F.prototype,`updatingProgress`,void 0),e([n({readOnly:!0})],F.prototype,`leavesReached`,void 0),e([n({constructOnly:!0})],F.prototype,`worker`,void 0),e([n({readOnly:!0})],F.prototype,`rootNodeVisible`,null),F=e([r(`esri.layers.graphics.controllers.I3SOnDemandController`)],F);const I=new c({deallocator:null});let L;function R(e,t){return e!=null&&e.length===t.length&&e.every(e=>z(t,e.name)>=0)}function z(e,t){let n=t.toLowerCase();for(let t=0;t<e.length;t++)if(e[t].name.toLowerCase()===n)return t;return-1}const B=h(),V=F;export{V as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{baseObjectMemory as e,estimateNumberArrayMemory as t,estimateNestedObjectMemory as n,estimateAttributesMemory as r}from"../../core/memoryEstimations.js";import{generateUID as i}from"../../core/uid.js";import a from"../../geometry/SpatialReference.js";import{empty as o,expandWithNestedArray as s}from"../../geometry/support/aaBoundingBox.js";import{empty as c,expandWithNestedArray as l}from"../../geometry/support/aaBoundingRect.js";import{unquantizePolyline as u,unquantizePolygon as d,unquantizeMultipoint as f,unquantizePoint as p}from"../../geometry/support/quantizationUtils.js";import{featureGeometryTypeKebabDictionary as m}from"../../geometry/support/typeUtils.js";import{getApproximateMaxDensificationSegments as h}from"../../views/2d/layers/graphics/densificationConstants.js";export{equals}from"./dehydratedFeatureComparison.js";class g{constructor(e,t,n){this.uid=e,this.geometry=t,this.attributes=n,this.visible=!0,this.objectId=null,this.centroid=null}}function _(e){return e.geometry!=null}class v{constructor(){this.exceededTransferLimit=!1,this.features=[],this.fields=[],this.hasM=!1,this.hasZ=!1,this.geometryType=null,this.objectIdFieldName=null,this.globalIdFieldName=null,this.geometryProperties=null,this.geohashFieldName=null,this.spatialReference=null,this.transform=null,this.missingAttributes=null}}function y(e,t){let n=m.fromJSON(e.geometryType),r=a.fromJSON(e.spatialReference),i=e.transform,o=e.objectIdFieldName,s=t?.maxStringAttributeLength,c=t?.maxStringAttributeFields,l;return{geometryType:n,features:e.features.map(t=>{let a=b(t,n,r,e.objectIdFieldName),m=a.geometry;if(A(a.attributes,c,s,e=>{l??=[];let t=k(a,o);t!=null&&l.push({objectId:t,attribute:e})}),m!=null&&i)switch(m.type){case`point`:a.geometry=p(i,m,m);break;case`multipoint`:a.geometry=f(i,m,m);break;case`polygon`:a.geometry=d(i,m,m);break;case`polyline`:a.geometry=u(i,m,m);break;case`extent`:case`mesh`:a.geometry=m}return a}),spatialReference:r,fields:e.fields??[],objectIdFieldName:e.objectIdFieldName,globalIdFieldName:e.globalIdFieldName,geohashFieldName:e.geohashFieldName,geometryProperties:e.geometryProperties,hasZ:e.hasZ,hasM:e.hasM,exceededTransferLimit:e.exceededTransferLimit,transform:null,missingAttributes:l}}function b(e,t,n,r){return{uid:i(),objectId:r&&e.attributes?e.attributes[r]:null,attributes:e.attributes,geometry:x(e.geometry,t,n),visible:!0}}function x(e,t,n){if(e==null)return null;switch(t){case`point`:{let t=e;return{x:t.x,y:t.y,z:t.z,m:t.m,hasZ:t.z!=null,hasM:t.m!=null,type:`point`,spatialReference:n}}case`polyline`:{let t=e;return{paths:t.paths,hasZ:!!t.hasZ,hasM:!!t.hasM,type:`polyline`,spatialReference:n}}case`polygon`:{let t=e;return{rings:t.rings,hasZ:!!t.hasZ,hasM:!!t.hasM,type:`polygon`,spatialReference:n}}case`multipoint`:{let t=e;return{points:t.points,hasZ:!!t.hasZ,hasM:!!t.hasM,type:`multipoint`,spatialReference:n}}}}function S(r){if(r==null)return 0;switch(r.type){case`point`:return e+10+8+24;case`polyline`:case`polygon`:{let t=0,i=2+ +!!r.hasZ+ +!!r.hasM,a=r.type===`polyline`?r.paths:r.rings;if((r.type===`polyline`?r.curvePaths:r.curveRings)?.length){let e=3*h()*128;t=8*e*i+e*128+32*(a.length+1)}else t=n(a);return e+64+t+34}case`multipoint`:{let t=n(r.points);return e+t+64+34+32}case`extent`:return e+10+64+34;case`mesh`:{let n=r.vertexAttributes;return e+t(n.position,n.normal,n.uv,n.tangent)}default:return e}}const C=43;function w(e){return 43+r(e.attributes)+S(e.geometry)}function T(e){if(e==null)return 0;switch(e.type){case`point`:return 1;case`polyline`:{let t=0;for(let n of e.paths)t+=n.length;return t}case`polygon`:{let t=0;for(let n of e.rings)t+=n.length;return t}case`multipoint`:return e.points.length;case`extent`:return 2;case`mesh`:{let t=e.vertexAttributes&&e.vertexAttributes.position;return t?t.length/3:0}default:return}}function E(e){if(e==null)return!1;switch(e.type){case`extent`:case`point`:return!0;case`polyline`:for(let t of e.paths)if(t.length>0)return!0;return!1;case`polygon`:for(let t of e.rings)if(t.length>0)return!0;return!1;case`multipoint`:return e.points.length>0;case`mesh`:return!e.loaded||e.vertexAttributes.position.length>0}}function D(e,t){switch(o(t),e.type===`mesh`&&(e=e.extent),e.type){case`point`:t[0]=t[3]=e.x,t[1]=t[4]=e.y,e.hasZ&&(t[2]=t[5]=e.z);break;case`polyline`:for(let n=0;n<e.paths.length;n++)s(t,e.paths[n],!!e.hasZ);break;case`polygon`:for(let n=0;n<e.rings.length;n++)s(t,e.rings[n],!!e.hasZ);break;case`multipoint`:s(t,e.points,!!e.hasZ);break;case`extent`:t[0]=e.xmin,t[1]=e.ymin,t[3]=e.xmax,t[4]=e.ymax,e.zmin!=null&&(t[2]=e.zmin),e.zmax!=null&&(t[5]=e.zmax)}return t}function O(e,t){switch(c(t),e.type===`mesh`&&(e=e.extent),e.type){case`point`:t[0]=t[2]=e.x,t[1]=t[3]=e.y;break;case`polyline`:for(let n=0;n<e.paths.length;n++)l(t,e.paths[n]);break;case`polygon`:for(let n=0;n<e.rings.length;n++)l(t,e.rings[n]);break;case`multipoint`:l(t,e.points);break;case`extent`:t[0]=e.xmin,t[1]=e.ymin,t[2]=e.xmax,t[3]=e.ymax}}function k(e,t){return e.objectId==null?e.attributes&&t?e.attributes[t]:null:e.objectId}function A(e,t,n,r){if(t?.size&&n!=null&&e)for(let i in e){if(!t.has(i))continue;let a=e[i];typeof a==`string`&&a.length>n&&(r(i),e[i]=``)}}export{g as DehydratedFeatureClass,v as DehydratedFeatureSetClass,C as baseDehydratedGraphicMemory,D as computeAABB,O as computeAABR,S as estimateGeometryMemory,w as estimateSize,y as fromFeatureSetJSON,x as fromJSONGeometry,k as getObjectId,_ as hasGeometry,E as hasVertices,T as numVertices,A as removeLargeStringAttributes};
2
+ import{baseObjectMemory as e,estimateNumberArrayMemory as t,estimateUniformNumberArraysMemory as n,estimateArrayReferencesMemory as r,estimateAttributesMemory as i}from"../../core/memoryEstimations.js";import{generateUID as a}from"../../core/uid.js";import o from"../../geometry/SpatialReference.js";import{empty as s,expandWithNestedArray as c}from"../../geometry/support/aaBoundingBox.js";import{empty as l,expandWithNestedArray as u}from"../../geometry/support/aaBoundingRect.js";import{unquantizePolyline as d,unquantizePolygon as f,unquantizeMultipoint as p,unquantizePoint as m}from"../../geometry/support/quantizationUtils.js";import{featureGeometryTypeKebabDictionary as h}from"../../geometry/support/typeUtils.js";import{getApproximateMaxDensificationSegments as g}from"../../views/2d/layers/graphics/densificationConstants.js";export{equals}from"./dehydratedFeatureComparison.js";class _{constructor(e,t,n){this.uid=e,this.geometry=t,this.attributes=n,this.visible=!0,this.objectId=null,this.centroid=null}}function v(e){return e.geometry!=null}class y{constructor(){this.exceededTransferLimit=!1,this.features=[],this.fields=[],this.hasM=!1,this.hasZ=!1,this.geometryType=null,this.objectIdFieldName=null,this.globalIdFieldName=null,this.geometryProperties=null,this.geohashFieldName=null,this.spatialReference=null,this.transform=null,this.missingAttributes=null}}function b(e,t){let n=h.fromJSON(e.geometryType),r=o.fromJSON(e.spatialReference),i=e.transform,a=e.objectIdFieldName,s=t?.maxStringAttributeLength,c=t?.maxStringAttributeFields,l;return{geometryType:n,features:e.features.map(t=>{let o=x(t,n,r,e.objectIdFieldName),u=o.geometry;if(j(o.attributes,c,s,e=>{l??=[];let t=A(o,a);t!=null&&l.push({objectId:t,attribute:e})}),u!=null&&i)switch(u.type){case`point`:o.geometry=m(i,u,u);break;case`multipoint`:o.geometry=p(i,u,u);break;case`polygon`:o.geometry=f(i,u,u);break;case`polyline`:o.geometry=d(i,u,u);break;case`extent`:case`mesh`:o.geometry=u}return o}),spatialReference:r,fields:e.fields??[],objectIdFieldName:e.objectIdFieldName,globalIdFieldName:e.globalIdFieldName,geohashFieldName:e.geohashFieldName,geometryProperties:e.geometryProperties,hasZ:e.hasZ,hasM:e.hasM,exceededTransferLimit:e.exceededTransferLimit,transform:null,missingAttributes:l}}function x(e,t,n,r){return{uid:a(),objectId:r&&e.attributes?e.attributes[r]:null,attributes:e.attributes,geometry:S(e.geometry,t,n),visible:!0}}function S(e,t,n){if(e==null)return null;switch(t){case`point`:{let t=e;return{x:t.x,y:t.y,z:t.z,m:t.m,hasZ:t.z!=null,hasM:t.m!=null,type:`point`,spatialReference:n}}case`polyline`:{let t=e;return{paths:t.paths,hasZ:!!t.hasZ,hasM:!!t.hasM,type:`polyline`,spatialReference:n}}case`polygon`:{let t=e;return{rings:t.rings,hasZ:!!t.hasZ,hasM:!!t.hasM,type:`polygon`,spatialReference:n}}case`multipoint`:{let t=e;return{points:t.points,hasZ:!!t.hasZ,hasM:!!t.hasM,type:`multipoint`,spatialReference:n}}}}function C(i){if(i==null)return 0;switch(i.type){case`point`:return e+10+8+24;case`polyline`:case`polygon`:{let t=0,a=2+ +!!i.hasZ+ +!!i.hasM,o=i.type===`polyline`?i.paths:i.rings;if((i.type===`polyline`?i.curvePaths:i.curveRings)?.length){let e=3*g()*128;t=8*e*a+e*128+32*(o.length+1)}else{t=r(o.length);for(let e of o)t+=n(e)}return e+64+t+34}case`multipoint`:{let t=n(i.points);return e+t+64+34+32}case`extent`:return e+10+64+34;case`mesh`:{let n=i.vertexAttributes;return e+t(n.position,n.normal,n.uv,n.tangent)}default:return e}}const w=43;function T(e){return 43+i(e.attributes)+C(e.geometry)}function E(e){if(e==null)return 0;switch(e.type){case`point`:return 1;case`polyline`:{let t=0;for(let n of e.paths)t+=n.length;return t}case`polygon`:{let t=0;for(let n of e.rings)t+=n.length;return t}case`multipoint`:return e.points.length;case`extent`:return 2;case`mesh`:{let t=e.vertexAttributes&&e.vertexAttributes.position;return t?t.length/3:0}default:return}}function D(e){if(e==null)return!1;switch(e.type){case`extent`:case`point`:return!0;case`polyline`:for(let t of e.paths)if(t.length>0)return!0;return!1;case`polygon`:for(let t of e.rings)if(t.length>0)return!0;return!1;case`multipoint`:return e.points.length>0;case`mesh`:return!e.loaded||e.vertexAttributes.position.length>0}}function O(e,t){switch(s(t),e.type===`mesh`&&(e=e.extent),e.type){case`point`:t[0]=t[3]=e.x,t[1]=t[4]=e.y,e.hasZ&&(t[2]=t[5]=e.z);break;case`polyline`:for(let n=0;n<e.paths.length;n++)c(t,e.paths[n],!!e.hasZ);break;case`polygon`:for(let n=0;n<e.rings.length;n++)c(t,e.rings[n],!!e.hasZ);break;case`multipoint`:c(t,e.points,!!e.hasZ);break;case`extent`:t[0]=e.xmin,t[1]=e.ymin,t[3]=e.xmax,t[4]=e.ymax,e.zmin!=null&&(t[2]=e.zmin),e.zmax!=null&&(t[5]=e.zmax)}return t}function k(e,t){switch(l(t),e.type===`mesh`&&(e=e.extent),e.type){case`point`:t[0]=t[2]=e.x,t[1]=t[3]=e.y;break;case`polyline`:for(let n=0;n<e.paths.length;n++)u(t,e.paths[n]);break;case`polygon`:for(let n=0;n<e.rings.length;n++)u(t,e.rings[n]);break;case`multipoint`:u(t,e.points);break;case`extent`:t[0]=e.xmin,t[1]=e.ymin,t[2]=e.xmax,t[3]=e.ymax}}function A(e,t){return e.objectId==null?e.attributes&&t?e.attributes[t]:null:e.objectId}function j(e,t,n,r){if(t?.size&&n!=null&&e)for(let i in e){if(!t.has(i))continue;let a=e[i];typeof a==`string`&&a.length>n&&(r(i),e[i]=``)}}export{_ as DehydratedFeatureClass,y as DehydratedFeatureSetClass,w as baseDehydratedGraphicMemory,O as computeAABB,k as computeAABR,C as estimateGeometryMemory,T as estimateSize,b as fromFeatureSetJSON,S as fromJSONGeometry,A as getObjectId,v as hasGeometry,D as hasVertices,E as numVertices,j as removeLargeStringAttributes};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{isPlainObject as e}from"../../core/lang.js";function t(e,t){if(c(e))return r(e,a,l(e),t)}function n(e,t,n){if(c(e)&&t)return r(t,e.type===`multipoint`?s:o,l(e),n)}function r(e,t,n,r){let i=t.vertexCount(e,n);if(i<1024)return;let a=t.partCount(e),o=`${r},${i},${a}`,s=Math.min(a,3),c=0,l=0;for(let r=0;r<s;++r){let i=s===1?0:Math.floor(r*(a-1)/(s-1));for(;c<i;)l+=t.partLength(e,c++,n)*n;let u=t.partLength(e,c,n);if(o+=`,${u}`,u>0)for(let r=0;r<3;++r){let i=r===0?0:r===1?Math.floor(u/2):Math.max(0,u-2);for(let r=0;r<n;++r){let a=t.coordinate(e,c,i,r,l,n);o+=`,${a.toFixed(5)}`}}}return o}function i(e,t,n){if(!e||!c(n)||!t)return!1;let{coords:r}=t,i=2+Number(!!e.hasZ)+Number(!!e.hasM),a=e.type===`multipoint`?s:o,l=u(n);if(a.partCount(t)!==l)return!1;let f=0;for(let e=0;e<l;++e){let o=d(n,e);if(a.partLength(t,e,i)!==o.length)return!1;for(let e of o)for(let t=0;t<i;++t)if(r[f++]!==e[t])return!1}return!0}const a={partCount:u,vertexCount(e){let t=0,n=u(e);for(let r=0;r<n;++r)t+=d(e,r).length;return t},partLength:(e,t)=>d(e,t).length,coordinate:(e,t,n,r)=>d(e,t)[n][r]},o={partCount:e=>e.lengths.length,vertexCount:(e,t)=>e.coords.length/t,partLength:(e,t)=>e.lengths[t],coordinate:(e,t,n,r,i,a)=>e.coords[i+n*a+r]},s={...o,partCount:()=>1,partLength:(e,t,n)=>e.coords.length/n};function c(t){return!!t&&e(t)&&(t.type===`polygon`||t.type===`polyline`||t.type===`multipoint`)&&!(t.type===`polygon`&&t.curveRings?.length)&&!(t.type===`polyline`&&t.curvePaths?.length)}function l(e){return 2+Number(!!e.hasZ)+Number(!!e.hasM)}function u(e){return e.type===`multipoint`?1:e.type===`polygon`?e.rings.length:e.paths.length}function d(e,t){return e.type===`multipoint`?e.points:e.type===`polygon`?e.rings[t]:e.paths[t]}function f(e,t,n){p(e.geometry,t,n)}function p(e,t,n){if(!e||(e.spatialReference=n,e.type===`extent`||e.type===`mesh`||e.type===`point`||!t))return;let{coords:r,lengths:i}=t,a=l(e),o=e.type===`multipoint`?[r.length/a]:i,s=[],c=0;if(a===2)for(let e of o){let t=[];for(let n=0;n<e;n++,c+=2)t.push([r[c],r[c+1]]);s.push(t)}else if(a===3)for(let e of o){let t=[];for(let n=0;n<e;n++,c+=3)t.push([r[c],r[c+1],r[c+2]]);s.push(t)}else for(let e of o){let t=[];for(let n=0;n<e;n++,c+=4)t.push([r[c],r[c+1],r[c+2],r[c+3]]);s.push(t)}e.type===`multipoint`?e.points=s[0]:e.type===`polygon`?e.rings=s:e.paths=s}export{f as completeDehydratedFeatureFromTransfer,p as completeDehydratedGeometryFromTransfer,t as geometryKey,i as identicalTransferGeometry,n as transferGeometryKey};
2
+ import{isPlainObject as e}from"../../core/lang.js";function t(e,t){if(c(e))return r(e,a,l(e),t)}function n(e,t,n){if(c(e)&&t)return r(t,e.type===`multipoint`?s:o,l(e),n)}function r(e,t,n,r){let i=t.vertexCount(e,n);if(i<1024)return;let a=t.partCount(e),o=`${r},${i},${a}`,s=Math.min(a,3),c=0,l=0;for(let r=0;r<s;++r){let i=s===1?0:Math.floor(r*(a-1)/(s-1));for(;c<i;)l+=t.partLength(e,c++,n)*n;let u=t.partLength(e,c,n);if(o+=`,${u}`,u>0)for(let r=0;r<3;++r){let i=r===0?0:r===1?Math.floor(u/2):Math.max(0,u-2);for(let r=0;r<n;++r){let a=t.coordinate(e,c,i,r,l,n);o+=`,${a.toFixed(5)}`}}}return o}function i(e,t,n){if(!e||!c(n)||!t)return!1;let{coords:r}=t,i=2+Number(!!e.hasZ)+Number(!!e.hasM),a=e.type===`multipoint`?s:o,l=u(n);if(a.partCount(t)!==l)return!1;let f=0;for(let e=0;e<l;++e){let o=d(n,e);if(a.partLength(t,e,i)!==o.length)return!1;for(let e of o)for(let t=0;t<i;++t)if(r[f++]!==e[t])return!1}return!0}const a={partCount:u,vertexCount(e){let t=0,n=u(e);for(let r=0;r<n;++r)t+=d(e,r).length;return t},partLength:(e,t)=>d(e,t).length,coordinate:(e,t,n,r)=>d(e,t)[n][r]},o={partCount:e=>e.lengths.length,vertexCount:(e,t)=>e.coords.length/t,partLength:(e,t)=>e.lengths[t],coordinate:(e,t,n,r,i,a)=>e.coords[i+n*a+r]},s={...o,partCount:()=>1,partLength:(e,t,n)=>e.coords.length/n};function c(t){return!!t&&e(t)&&(t.type===`polygon`||t.type===`polyline`||t.type===`multipoint`)&&!(t.type===`polygon`&&t.curveRings?.length)&&!(t.type===`polyline`&&t.curvePaths?.length)}function l(e){return 2+Number(!!e.hasZ)+Number(!!e.hasM)}function u(e){return e.type===`multipoint`?1:e.type===`polygon`?e.rings.length:e.paths.length}function d(e,t){return e.type===`multipoint`?e.points:e.type===`polygon`?e.rings[t]:e.paths[t]}function f(e,t,n){p(e.geometry,t,n)}function p(e,t,n){if(!e||(e.spatialReference=n,e.type===`extent`||e.type===`mesh`||e.type===`point`||!t))return;let{coords:r,lengths:i}=t,a=l(e),o=e.type===`multipoint`?[r.length/a]:i,s=Array(o.length).fill(null),c=0,u=0;if(a===2)for(let e of o){let t=Array(e).fill(null);for(let n=0;n<e;n++,c+=2)t[n]=[r[c],r[c+1]];s[u++]=t}else if(a===3)for(let e of o){let t=Array(e).fill(null);for(let n=0;n<e;n++,c+=3)t[n]=[r[c],r[c+1],r[c+2]];s[u++]=t}else for(let e of o){let t=Array(e).fill(null);for(let n=0;n<e;n++,c+=4)t[n]=[r[c],r[c+1],r[c+2],r[c+3]];s[u++]=t}e.type===`multipoint`?e.points=s[0]:e.type===`polygon`?e.rings=s:e.paths=s}export{f as completeDehydratedFeatureFromTransfer,p as completeDehydratedGeometryFromTransfer,t as geometryKey,i as identicalTransferGeometry,n as transferGeometryKey};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../core/accessorSupport/decorators.js";import{Clonable as r}from"../../core/Clonable.js";import i from"../../geometry/Point.js";let a=class extends r{constructor(e){super(e),this.sourcePoint=null,this.mapPoint=null}};e([t()],a.prototype,`sourcePoint`,void 0),e([t({type:i})],a.prototype,`mapPoint`,void 0),a=e([n(`esri.layers.support.ControlPoint`)],a);const o=a;export{o as default};
2
+ import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../core/accessorSupport/decorators.js";import{Clonable as r}from"../../core/Clonable.js";import i from"../../geometry/Point.js";let a=class extends r{constructor(e){super(e),this.sourcePoint=null,this.mapPoint=null}};e([t()],a.prototype,`sourcePoint`,void 0),e([t({type:i})],a.prototype,`mapPoint`,void 0),a=e([n(`esri.layers.support.ControlPoint`)],a);export{a as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../core/accessorSupport/decorators.js";import{Clonable as r}from"../../core/Clonable.js";import i from"../../core/Error.js";import{JSONSupportMixin as a,JSONSupport as o}from"../../core/JSONSupport.js";import{invert as s}from"../../core/libs/gl-matrix-2/math/mat3.js";import{fromValues as c,create as l}from"../../core/libs/gl-matrix-2/factories/mat3f64.js";import{set as u,rotate as d,lerp as f}from"../../core/libs/gl-matrix-2/math/vec2.js";import{create as p,fromValues as m}from"../../core/libs/gl-matrix-2/factories/vec2f64.js";import h from"../../core/Logger.js";import{transformProjective as g,getProjectiveTransform as _}from"../../core/perspectiveUtils.js";import{createScreenPoint as v}from"../../core/screenUtils.js";import y from"../../geometry/Point.js";import b from"../../geometry/Polygon.js";import{projectOrLoad as x}from"../../geometry/projectionUtils.js";import S from"../../geometry/SpatialReference.js";import C from"./ControlPoint.js";import{GeoreferenceBaseMixin as w}from"./GeoreferenceBaseMixin.js";import{reader as T}from"../../core/accessorSupport/decorators/reader.js";import{writer as E}from"../../core/accessorSupport/decorators/writer.js";const D=l(),O=p();let k=class extends o{};e([t({type:Number,json:{write:{isRequired:!0}}})],k.prototype,`x`,void 0),e([t({type:Number,json:{write:{isRequired:!0}}})],k.prototype,`y`,void 0),k=e([n(`esri.layers.support.ControlPointsGeoreference.ControlPointJSONType`)],k);let A=class extends a(w(r)){constructor(e){super(e),this.height=0,this.type=`control-points`,this.width=0}get controlPoints(){return this._get(`controlPoints`)??null}set controlPoints(e){this._set(`controlPoints`,e)}readControlPoints(e,t){let n=S.fromJSON(t.spatialReference),r=c(...t.coefficients,1);return e.map(e=>(u(O,e.x,e.y),g(O,O,r),{sourcePoint:e,mapPoint:new y({x:O[0],y:O[1],spatialReference:n})}))}writeControlPoints(e,t,n,r){if(this.transform==null){let e=new i(`web-document-write:invalid-georeference`,`Invalid 'controlPoints', 'width', 'height' configuration. Make sure the parent media element is loaded i.e. the ImageElement or VideoElement set as 'MediaLayer.source'.`,{layer:r?.layer,georeference:this});r?.messages?r.messages.push(e):h.getLogger(this).error(e.name,e.message)}else e!=null&&j(e[0])&&(t.controlPoints=e.map(e=>{let t=e.sourcePoint;return{x:t.x,y:t.y}}),t.spatialReference=e[0].mapPoint.spatialReference.toJSON(),t.coefficients=this.transform.slice(0,8))}get coords(){if(this.controlPoints==null)return null;let e=this._updateTransform(D);if(e==null||!j(this.controlPoints[0]))return null;let t=this.controlPoints[0].mapPoint.spatialReference;return Y(e,this.width,this.height,t)}set coords(e){if(this.controlPoints==null||!j(this.controlPoints[0]))return;let t=this.controlPoints[0].mapPoint.spatialReference;if(e=this.projectOrWarn(e,t),e==null)return;let{width:n,height:r}=this,{rings:[[i,a,o,s]]}=e,c=new C({sourcePoint:v(0,r),mapPoint:new y({x:i[0],y:i[1],spatialReference:t})}),l=new C({sourcePoint:v(0,0),mapPoint:new y({x:a[0],y:a[1],spatialReference:t})}),d=new C({sourcePoint:v(n,0),mapPoint:new y({x:o[0],y:o[1],spatialReference:t})}),f=new C({sourcePoint:v(n,r),mapPoint:new y({x:s[0],y:s[1],spatialReference:t})});j(c)&&j(l)&&j(d)&&j(f)&&(W(D,c,l,d,f),this.controlPoints=this.controlPoints.map(({sourcePoint:e})=>(u(O,e.x,e.y),g(O,O,D),{sourcePoint:e,mapPoint:new y({x:O[0],y:O[1],spatialReference:t})})))}get inverseTransform(){return this.transform==null?null:s(l(),this.transform)}get transform(){return this._updateTransform()}toMap(e){if(e==null||this.transform==null||this.controlPoints==null||!j(this.controlPoints[0]))return null;u(O,e.x,e.y);let t=this.controlPoints[0].mapPoint.spatialReference;return g(O,O,this.transform),new y({x:O[0],y:O[1],spatialReference:t})}toSource(e){if(e==null||this.inverseTransform==null||this.controlPoints==null||!j(this.controlPoints[0]))return null;let t=this.controlPoints[0].mapPoint.spatialReference;return e=e.normalize(),e=x(e,t).geometry,e==null?null:(u(O,e.x,e.y),g(O,O,this.inverseTransform),v(O[0],O[1]))}toSourceNormalized(e){let t=this.toSource(e);return t!=null&&(t.x/=this.width,t.y/=this.height),t}_updateTransform(e){let{controlPoints:t,width:n,height:r}=this;if(t==null||!(n>0)||!(r>0))return null;let[i,a,o,s]=t;if(!j(i))return null;let c=i.mapPoint.spatialReference,u=this._projectControlPoint(a,c),d=this._projectControlPoint(o,c),f=this._projectControlPoint(s,c);if(!u.valid||!d.valid||!f.valid||!j(u.controlPoint))return null;e??=l();let p=null;return p=j(d.controlPoint)&&j(f.controlPoint)?W(e,i,u.controlPoint,d.controlPoint,f.controlPoint):j(d.controlPoint)?U(e,i,u.controlPoint,d.controlPoint):H(e,i,u.controlPoint),p.every(e=>e===0)?null:p}_projectControlPoint(e,t){if(!j(e))return{valid:!0,controlPoint:e};let{sourcePoint:n,mapPoint:r}=e,{geometry:i,pending:a}=x(r,t);return a?{valid:!1,controlPoint:null}:!a&&!i?(h.getLogger(this).warn(`map point could not be projected to the spatial reference`,{georeference:this,controlPoint:e,sourceSpatialReference:r.spatialReference,targetSpatialReference:t}),{valid:!1,controlPoint:null}):{valid:!0,controlPoint:new C({sourcePoint:n,mapPoint:i})}}};e([t({type:[C],json:{write:{allowNull:!1,isRequired:!0,target:{controlPoints:{type:[k],isRequired:!0},coefficients:{type:[Number],isRequired:!0},spatialReference:{type:S,isRequired:!0}}}}})],A.prototype,`controlPoints`,null),e([T(`controlPoints`)],A.prototype,`readControlPoints`,null),e([E(`controlPoints`)],A.prototype,`writeControlPoints`,null),e([t({clonable:!1})],A.prototype,`coords`,null),e([t({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}})],A.prototype,`height`,void 0),e([t({readOnly:!0})],A.prototype,`inverseTransform`,null),e([t({readOnly:!0})],A.prototype,`transform`,null),e([t({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}})],A.prototype,`width`,void 0),A=e([n(`esri.layers.support.ControlPointsGeoreference`)],A);function j(e){return e?.sourcePoint!=null&&e.mapPoint!=null}const M=p(),N=p(),P=p(),F=p(),I=p(),L=p(),R=p(),z=p(),B=Math.PI/2;function V(e,t,n){u(e,n.sourcePoint.x,n.sourcePoint.y),u(t,n.mapPoint.x,n.mapPoint.y)}function H(e,t,n){return V(M,I,t),V(N,L,n),d(P,N,M,B),d(F,M,N,B),d(R,L,I,-B),d(z,I,L,-B),J(e,M,N,P,F,I,L,R,z)}function U(e,t,n,r){return V(M,I,t),V(N,L,n),V(P,R,r),f(F,M,N,.5),d(F,P,F,Math.PI),f(z,I,L,.5),d(z,R,z,Math.PI),J(e,M,N,P,F,I,L,R,z)}function W(e,t,n,r,i){return V(M,I,t),V(N,L,n),V(P,R,r),V(F,z,i),J(e,M,N,P,F,I,L,R,z)}const G=Array(8).fill(0),K=Array(8).fill(0);function q(e,t,n,r,i){return e[0]=t[0],e[1]=t[1],e[2]=n[0],e[3]=n[1],e[4]=r[0],e[5]=r[1],e[6]=i[0],e[7]=i[1],e}function J(e,t,n,r,i,a,o,s,c){return _(e,q(G,t,n,r,i),q(K,a,o,s,c))}function Y(e,t,n,r){let i=m(0,n),a=m(0,0),o=m(t,0),s=m(t,n);return g(i,i,e),g(a,a,e),g(o,o,e),g(s,s,e),new b({rings:[[i,a,o,s,i]],spatialReference:r})}const X=A;export{X as default};
2
+ import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../core/accessorSupport/decorators.js";import{Clonable as r}from"../../core/Clonable.js";import i from"../../core/Error.js";import{JSONSupportMixin as a,JSONSupport as o}from"../../core/JSONSupport.js";import{invert as s}from"../../core/libs/gl-matrix-2/math/mat3.js";import{fromValues as c,create as l}from"../../core/libs/gl-matrix-2/factories/mat3f64.js";import{set as u,lerp as d,rotate as f}from"../../core/libs/gl-matrix-2/math/vec2.js";import{create as p,fromValues as m}from"../../core/libs/gl-matrix-2/factories/vec2f64.js";import h from"../../core/Logger.js";import{transformProjective as g,getProjectiveTransform as _}from"../../core/perspectiveUtils.js";import{createScreenPoint as v}from"../../core/screenUtils.js";import y from"../../geometry/Point.js";import b from"../../geometry/Polygon.js";import{projectOrLoad as x}from"../../geometry/projectionUtils.js";import S from"../../geometry/SpatialReference.js";import C from"./ControlPoint.js";import{GeoreferenceBaseMixin as w}from"./GeoreferenceBaseMixin.js";import{reader as T}from"../../core/accessorSupport/decorators/reader.js";import{writer as E}from"../../core/accessorSupport/decorators/writer.js";const D=l(),O=p();let k=class extends o{};e([t({type:Number,json:{write:{isRequired:!0}}})],k.prototype,`x`,void 0),e([t({type:Number,json:{write:{isRequired:!0}}})],k.prototype,`y`,void 0),k=e([n(`esri.layers.support.ControlPointsGeoreference.ControlPointJSONType`)],k);let A=class extends a(w(r)){constructor(e){super(e),this.height=0,this.type=`control-points`,this.width=0}get controlPoints(){return this._get(`controlPoints`)??null}set controlPoints(e){this._set(`controlPoints`,e)}readControlPoints(e,t){let n=S.fromJSON(t.spatialReference),r=c(...t.coefficients,1);return e.map(e=>(u(O,e.x,e.y),g(O,O,r),{sourcePoint:e,mapPoint:new y({x:O[0],y:O[1],spatialReference:n})}))}writeControlPoints(e,t,n,r){if(this.transform==null){let e=new i(`web-document-write:invalid-georeference`,`Invalid 'controlPoints', 'width', 'height' configuration. Make sure the parent media element is loaded i.e. the ImageElement or VideoElement set as 'MediaLayer.source'.`,{layer:r?.layer,georeference:this});r?.messages?r.messages.push(e):h.getLogger(this).error(e.name,e.message)}else e!=null&&j(e[0])&&(t.controlPoints=e.map(e=>{let t=e.sourcePoint;return{x:t.x,y:t.y}}),t.spatialReference=e[0].mapPoint.spatialReference.toJSON(),t.coefficients=this.transform.slice(0,8))}get coords(){if(this.controlPoints==null)return null;let e=this._updateTransform(D);if(e==null||!j(this.controlPoints[0]))return null;let t=this.controlPoints[0].mapPoint.spatialReference;return Y(e,this.width,this.height,t)}set coords(e){if(this.controlPoints==null||!j(this.controlPoints[0]))return;let t=this.controlPoints[0].mapPoint.spatialReference;if(e=this.projectOrWarn(e,t),e==null)return;let{width:n,height:r}=this,{rings:[[i,a,o,s]]}=e,c=new C({sourcePoint:v(0,r),mapPoint:new y({x:i[0],y:i[1],spatialReference:t})}),l=new C({sourcePoint:v(0,0),mapPoint:new y({x:a[0],y:a[1],spatialReference:t})}),d=new C({sourcePoint:v(n,0),mapPoint:new y({x:o[0],y:o[1],spatialReference:t})}),f=new C({sourcePoint:v(n,r),mapPoint:new y({x:s[0],y:s[1],spatialReference:t})});j(c)&&j(l)&&j(d)&&j(f)&&(W(D,c,l,d,f),this.controlPoints=this.controlPoints.map(({sourcePoint:e})=>(u(O,e.x,e.y),g(O,O,D),{sourcePoint:e,mapPoint:new y({x:O[0],y:O[1],spatialReference:t})})))}get inverseTransform(){return this.transform==null?null:s(l(),this.transform)}get transform(){return this._updateTransform()}toMap(e){if(e==null||this.transform==null||this.controlPoints==null||!j(this.controlPoints[0]))return null;u(O,e.x,e.y);let t=this.controlPoints[0].mapPoint.spatialReference;return g(O,O,this.transform),new y({x:O[0],y:O[1],spatialReference:t})}toSource(e){if(e==null||this.inverseTransform==null||this.controlPoints==null||!j(this.controlPoints[0]))return null;let t=this.controlPoints[0].mapPoint.spatialReference;return e=e.normalize(),e=x(e,t).geometry,e==null?null:(u(O,e.x,e.y),g(O,O,this.inverseTransform),v(O[0],O[1]))}toSourceNormalized(e){let t=this.toSource(e);return t!=null&&(t.x/=this.width,t.y/=this.height),t}_updateTransform(e){let{controlPoints:t,width:n,height:r}=this;if(t==null||!(n>0)||!(r>0))return null;let[i,a,o,s]=t;if(!j(i))return null;let c=i.mapPoint.spatialReference,u=this._projectControlPoint(a,c),d=this._projectControlPoint(o,c),f=this._projectControlPoint(s,c);if(!u.valid||!d.valid||!f.valid||!j(u.controlPoint))return null;e??=l();let p=null;return p=j(d.controlPoint)&&j(f.controlPoint)?W(e,i,u.controlPoint,d.controlPoint,f.controlPoint):j(d.controlPoint)?U(e,i,u.controlPoint,d.controlPoint):H(e,i,u.controlPoint),p.every(e=>e===0)?null:p}_projectControlPoint(e,t){if(!j(e))return{valid:!0,controlPoint:e};let{sourcePoint:n,mapPoint:r}=e,{geometry:i,pending:a}=x(r,t);return a?{valid:!1,controlPoint:null}:!a&&!i?(h.getLogger(this).warn(`map point could not be projected to the spatial reference`,{georeference:this,controlPoint:e,sourceSpatialReference:r.spatialReference,targetSpatialReference:t}),{valid:!1,controlPoint:null}):{valid:!0,controlPoint:new C({sourcePoint:n,mapPoint:i})}}};e([t({type:[C],json:{write:{allowNull:!1,isRequired:!0,target:{controlPoints:{type:[k],isRequired:!0},coefficients:{type:[Number],isRequired:!0},spatialReference:{type:S,isRequired:!0}}}}})],A.prototype,`controlPoints`,null),e([T(`controlPoints`)],A.prototype,`readControlPoints`,null),e([E(`controlPoints`)],A.prototype,`writeControlPoints`,null),e([t({clonable:!1})],A.prototype,`coords`,null),e([t({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}})],A.prototype,`height`,void 0),e([t({readOnly:!0})],A.prototype,`inverseTransform`,null),e([t({readOnly:!0})],A.prototype,`transform`,null),e([t({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}})],A.prototype,`width`,void 0),A=e([n(`esri.layers.support.ControlPointsGeoreference`)],A);function j(e){return e?.sourcePoint!=null&&e.mapPoint!=null}const M=p(),N=p(),P=p(),F=p(),I=p(),L=p(),R=p(),z=p(),B=Math.PI/2;function V(e,t,n){u(e,n.sourcePoint.x,n.sourcePoint.y),u(t,n.mapPoint.x,n.mapPoint.y)}function H(e,t,n){return V(M,I,t),V(N,L,n),f(P,N,M,B),f(F,M,N,B),f(R,L,I,-B),f(z,I,L,-B),J(e,M,N,P,F,I,L,R,z)}function U(e,t,n,r){return V(M,I,t),V(N,L,n),V(P,R,r),d(F,M,N,.5),f(F,P,F,Math.PI),d(z,I,L,.5),f(z,R,z,Math.PI),J(e,M,N,P,F,I,L,R,z)}function W(e,t,n,r,i){return V(M,I,t),V(N,L,n),V(P,R,r),V(F,z,i),J(e,M,N,P,F,I,L,R,z)}const G=Array(8).fill(0),K=Array(8).fill(0);function q(e,t,n,r,i){return e[0]=t[0],e[1]=t[1],e[2]=n[0],e[3]=n[1],e[4]=r[0],e[5]=r[1],e[6]=i[0],e[7]=i[1],e}function J(e,t,n,r,i,a,o,s,c){return _(e,q(G,t,n,r,i),q(K,a,o,s,c))}function Y(e,t,n,r){let i=m(0,n),a=m(0,0),o=m(t,0),s=m(t,n);return g(i,i,e),g(a,a,e),g(o,o,e),g(s,s,e),new b({rings:[[i,a,o,s,i]],spatialReference:r})}export{A as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{excludeTables as e}from"../../core/accessorSupport/layerContainerType.js";import{JSONMap as t}from"../../core/jsonMap.js";import n from"../../geometry/Extent.js";import r from"../../geometry/SpatialReference.js";import{w as i}from"../../chunks/persistableUrlUtils.js";import a from"../../symbols/support/ElevationInfo.js";import o from"../../tables/AttributeTableTemplate.js";import{transparencyToOpacity as s}from"../../webdoc/support/opacityUtils.js";import c from"./TimeInfo.js";const l={type:Boolean,value:!0,json:{origins:{service:{read:!1,write:!1},"web-map":{read:!1,write:!1}},name:`screenSizePerspective`,write:{enabled:!0,layerContainerTypes:e}}},u={type:Boolean,value:!0,json:{name:`disablePopup`,read:{reader(e,t){return!t.disablePopup}},write:{enabled:!0,writer(e,t,n){t[n]=!e}}}},d={type:Boolean,value:!0,nonNullable:!0,json:{name:`showLabels`,write:{enabled:!0,layerContainerTypes:e}}},f={type:String,json:{origins:{"portal-item":{write:!1}},write:{isRequired:!0,ignoreOrigin:!0,writer:i}}},p={type:Boolean,value:!0,nonNullable:!0,json:{origins:{service:{read:{enabled:!1}}},name:`showLegend`,write:{enabled:!0,layerContainerTypes:e}}},m={value:null,type:a,json:{origins:{service:{name:`elevationInfo`,write:!0}},name:`layerDefinition.elevationInfo`,write:{enabled:!0,layerContainerTypes:e}}};function h(e){return{type:e,readOnly:!0,json:{origins:{service:{read:!0}},read:!1}}}const g={write:{enabled:!0,layerContainerTypes:e},read:!0},_={type:Number,json:{origins:{"web-document":g,"portal-item":{write:{layerContainerTypes:e}}}}},v={..._,json:{..._.json,origins:{"web-document":{...g,write:{enabled:!0,layerContainerTypes:e,target:{opacity:{type:Number},"layerDefinition.drawingInfo.transparency":{type:Number}}}}},read:{source:[`layerDefinition.drawingInfo.transparency`,`drawingInfo.transparency`],reader(e,t,n){if((!n||n.origin===`service`)&&t.drawingInfo&&t.drawingInfo.transparency!==void 0)return s(t.drawingInfo.transparency);if(t.layerDefinition?.drawingInfo&&t.layerDefinition.drawingInfo.transparency!==void 0)return s(t.layerDefinition.drawingInfo.transparency)}}}},y={type:n,readOnly:!0,json:{origins:{service:{read:{source:[`fullExtent`,`spatialReference`],reader:(e,t)=>{let i=n.fromJSON(e);return t.spatialReference!=null&&typeof t.spatialReference==`object`&&(i.spatialReference=r.fromJSON(t.spatialReference)),i}}}},read:!1}},b={type:String,json:{origins:{service:{read:!1},"portal-item":{read:!1}}}},x={type:Number,json:{origins:{service:{write:{enabled:!1}}},name:`layerDefinition.minScale`,write:{layerContainerTypes:e}}},S={type:Number,json:{origins:{service:{write:{enabled:!1}}},name:`layerDefinition.maxScale`,write:{layerContainerTypes:e}}},C={json:{write:{ignoreOrigin:!0,layerContainerTypes:e},origins:{"web-map":{read:!1,write:!1}}}},w={type:o,json:{name:`attributeTableInfo`,write:!0}},T=new t({High:`high`,Medium:`medium`,Low:`low`,None:`none`}),E={type:T.apiValues,json:{name:`layerDefinition.barrierWeight`,default:`high`,read:T.read,write:T.write,origins:{service:{read:!1}}}};function D(e){return{name:`layerDefinition.timeInfo`,read:!0,write:{enabled:!0,overridePolicy(t,n){return{enabled:!0,allowNull:this.originIdOf(n)>=3,ignoreOrigin:e?this.originIdOf(n)<3:!1}}}}}function O(e){let t=e?.alwaysWriteNonItemOrigin,n={[e?.webDocumentOrigin??`web-document`]:D(t),"portal-item":D(t)};return e?.disableServiceOrigin&&(n.service={read:!1,write:!1}),{type:c,json:{name:e?.name,origins:n}}}export{w as attributeTableTemplate,E as barrierWeight,m as elevationInfo,b as id,d as labelsVisible,p as legendEnabled,C as listMode,S as maxScale,x as minScale,_ as opacity,v as opacityDrawingInfo,u as popupEnabled,h as readOnlyService,y as sceneLayerFullExtent,l as screenSizePerspectiveEnabled,O as timeInfo,f as url};
2
+ import{excludeTables as e}from"../../core/accessorSupport/layerContainerType.js";import{JSONMap as t}from"../../core/jsonMap.js";import n from"../../geometry/Extent.js";import r from"../../geometry/SpatialReference.js";import{w as i}from"../../chunks/persistableUrlUtils.js";import a from"../../symbols/support/ElevationInfo.js";import o from"../../tables/AttributeTableTemplate.js";import{transparencyToOpacity as s}from"../../webdoc/support/opacityUtils.js";import c from"./TimeInfo.js";const l={type:Boolean,value:!0,json:{origins:{service:{read:!1,write:!1},"web-map":{read:!1,write:!1}},name:`screenSizePerspective`,write:{enabled:!0,layerContainerTypes:e}}},u={type:Boolean,value:!0,json:{name:`disablePopup`,read:{reader(e,t){return!t.disablePopup}},write:{enabled:!0,writer(e,t,n){t[n]=!e}}}},d={type:Boolean,value:!0,nonNullable:!0,json:{name:`showLabels`,write:{enabled:!0,layerContainerTypes:e},origins:{"web-scene":{name:`showLabels`,default:!1,write:{enabled:!0,layerContainerTypes:e}}}}},f={type:String,json:{origins:{"portal-item":{write:!1}},write:{isRequired:!0,ignoreOrigin:!0,writer:i}}},p={type:Boolean,value:!0,nonNullable:!0,json:{origins:{service:{read:{enabled:!1}}},name:`showLegend`,write:{enabled:!0,layerContainerTypes:e}}},m={value:null,type:a,json:{origins:{service:{name:`elevationInfo`,write:!0}},name:`layerDefinition.elevationInfo`,write:{enabled:!0,layerContainerTypes:e}}};function h(e){return{type:e,readOnly:!0,json:{origins:{service:{read:!0}},read:!1}}}const g={write:{enabled:!0,layerContainerTypes:e},read:!0},_={type:Number,json:{origins:{"web-document":g,"portal-item":{write:{layerContainerTypes:e}}}}},v={..._,json:{..._.json,origins:{"web-document":{...g,write:{enabled:!0,layerContainerTypes:e,target:{opacity:{type:Number},"layerDefinition.drawingInfo.transparency":{type:Number}}}}},read:{source:[`layerDefinition.drawingInfo.transparency`,`drawingInfo.transparency`],reader(e,t,n){if((!n||n.origin===`service`)&&t.drawingInfo&&t.drawingInfo.transparency!==void 0)return s(t.drawingInfo.transparency);if(t.layerDefinition?.drawingInfo&&t.layerDefinition.drawingInfo.transparency!==void 0)return s(t.layerDefinition.drawingInfo.transparency)}}}},y={type:n,readOnly:!0,json:{origins:{service:{read:{source:[`fullExtent`,`spatialReference`],reader:(e,t)=>{let i=n.fromJSON(e);return t.spatialReference!=null&&typeof t.spatialReference==`object`&&(i.spatialReference=r.fromJSON(t.spatialReference)),i}}}},read:!1}},b={type:String,json:{origins:{service:{read:!1},"portal-item":{read:!1}}}},x={type:Number,json:{origins:{service:{write:{enabled:!1}}},name:`layerDefinition.minScale`,write:{layerContainerTypes:e}}},S={type:Number,json:{origins:{service:{write:{enabled:!1}}},name:`layerDefinition.maxScale`,write:{layerContainerTypes:e}}},C={json:{write:{ignoreOrigin:!0,layerContainerTypes:e},origins:{"web-map":{read:!1,write:!1}}}},w={type:o,json:{name:`attributeTableInfo`,write:!0}},T=new t({High:`high`,Medium:`medium`,Low:`low`,None:`none`}),E={type:T.apiValues,json:{name:`layerDefinition.barrierWeight`,default:`high`,read:T.read,write:T.write,origins:{service:{read:!1}}}};function D(e){return{name:`layerDefinition.timeInfo`,read:!0,write:{enabled:!0,overridePolicy(t,n){return{enabled:!0,allowNull:this.originIdOf(n)>=3,ignoreOrigin:e?this.originIdOf(n)<3:!1}}}}}function O(e){let t=e?.alwaysWriteNonItemOrigin,n={[e?.webDocumentOrigin??`web-document`]:D(t),"portal-item":D(t)};return e?.disableServiceOrigin&&(n.service={read:!1,write:!1}),{type:c,json:{name:e?.name,origins:n}}}export{w as attributeTableTemplate,E as barrierWeight,m as elevationInfo,b as id,d as labelsVisible,p as legendEnabled,C as listMode,S as maxScale,x as minScale,_ as opacity,v as opacityDrawingInfo,u as popupEnabled,h as readOnlyService,y as sceneLayerFullExtent,l as screenSizePerspectiveEnabled,O as timeInfo,f as url};
@@ -3,7 +3,7 @@
3
3
  * [labeling](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#labelingInfo),
4
4
  * [elevation](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#elevationInfo),
5
5
  * [editor tracking](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#editFieldsInfo)
6
- * and time span. Use [getFieldUsage()](https://developers.arcgis.com/javascript/latest/references/core/layers/support/fieldUtils/#getFieldUsage) to find
6
+ * and time span. Use [getLayerFieldUsage()](https://developers.arcgis.com/javascript/latest/references/core/layers/support/fieldUtils/#getLayerFieldUsage) to find
7
7
  * where source fields are used in layer configuration.
8
8
  *
9
9
  * @since 4.11
@@ -52,21 +52,21 @@ export function getDisplayFieldName(layer: FeatureLayer | CSVLayer | GeoJSONLaye
52
52
  export function getElevationFields(layer: FeatureLayer | null | undefined): Promise<string[]>;
53
53
 
54
54
  /**
55
- * The layer properties inspected by [getFieldUsage()](https://developers.arcgis.com/javascript/latest/references/core/layers/support/fieldUtils/#getFieldUsage).
56
- * Supports feature-like layers without requiring a specific layer class.
55
+ * Defines the layer contract used by [getLayerFieldUsage()](https://developers.arcgis.com/javascript/latest/references/core/layers/support/fieldUtils/#getLayerFieldUsage)
56
+ * to identify field references in the layer's configuration.
57
57
  *
58
58
  * @since 6.0
59
59
  */
60
60
  export interface LayerForFieldUsage {
61
- /** Whether the layer is loaded. Must be `true` before collecting field usage. */
62
- readonly loaded: boolean;
61
+ /** Loads the layer. The promise resolves when its fields and configuration are ready to inspect. */
62
+ load(): Promise<unknown>;
63
63
  /** The source fields index used for case-insensitive reference lookup. */
64
64
  readonly fieldsIndex: FieldsIndex<Field>;
65
65
  /** The configured definition expression. */
66
66
  readonly definitionExpression?: string | null;
67
67
  /** The configured feature effect. */
68
68
  readonly featureEffect?: FeatureEffect | null;
69
- /** The configured display filters. */
69
+ /** The configured display filter. */
70
70
  readonly displayFilterInfo?: DisplayFilterInfo | null;
71
71
  /** The configured feature drawing order. */
72
72
  readonly orderBy?: readonly OrderByInfo[] | null;
@@ -89,47 +89,100 @@ export interface LayerForFieldUsage {
89
89
  }
90
90
 
91
91
  /**
92
- * A configuration value that uses a source field, together with the object that owns it.
93
- * See [FieldUsageLocation](https://developers.arcgis.com/javascript/latest/references/core/layers/support/fieldUtils/#FieldUsageLocation) for the supported location types.
92
+ * Identifies where a field is used in the layer's configuration.
93
+ * Use `type` to determine the corresponding `value` and `owner` types.
94
+ * The value is captured when the snapshot is collected. Configuration objects and owners are retained by reference, not cloned.
94
95
  *
95
- * @since 6.0
96
- */
97
- export interface FieldUsageLocationInfo<TType extends string, TValue, TOwner> {
98
- /** Identifies the kind of configuration that uses the field. */
99
- readonly type: TType;
100
- /**
101
- * The configured value captured when the report was collected.
102
- * Configuration objects are retained by reference, not cloned.
103
- */
104
- readonly value: TValue;
105
- /** The actual object that owns the configuration value, not a clone. */
106
- readonly owner: TOwner;
107
- }
108
-
109
- /**
110
- * A location where a source layer field is used. Narrow by `type` to access the
111
- * corresponding `value` and `owner` types.
112
- *
113
- * Renderers, feature effects, popup templates, form templates, and time information
114
- * are reported as whole configuration objects owned by the layer or feature reduction.
115
- * Each display filter's SQL value is owned by that filter. Each label expression
116
- * and label filter is owned by its label class. Each aggregate definition is owned
117
- * by its feature reduction. Each drawing-order entry is reported as an
118
- * `OrderByInfo` owned by the layer, with type `"orderBy"`.
119
- * A layer's separate `trackIdField` is reported with
120
- * type `"trackIdField"`.
96
+ * The value and owner depend on the configuration:
97
+ * | `type` | `value` | `owner` |
98
+ * | --- | --- | --- |
99
+ * | `definitionExpression` | SQL expression, for example, [FeatureLayer.definitionExpression](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#definitionExpression) | layer |
100
+ * | `featureEffect` | FeatureEffect object, for example, [FeatureLayer.featureEffect](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#featureEffect) | layer |
101
+ * | `displayFilterInfo` | SQL expression, for example, [DisplayFilter.where](https://developers.arcgis.com/javascript/latest/references/core/layers/support/DisplayFilter/#where) | layer's [DisplayFilter](https://developers.arcgis.com/javascript/latest/references/core/layers/support/DisplayFilter/) |
102
+ * | `orderBy` | OrderByInfo object, for example, an entry in [FeatureLayer.orderBy](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#orderBy) | layer |
103
+ * | `renderer` | Renderer object, for example, [FeatureLayer.renderer](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#renderer) | layer |
104
+ * | `popupTemplate` | PopupTemplate object, for example, [FeatureLayer.popupTemplate](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#popupTemplate) | layer |
105
+ * | `formTemplate` | FormTemplate object, for example, [FeatureLayer.formTemplate](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#formTemplate) | layer |
106
+ * | `timeInfo` | TimeInfo object, for example, [FeatureLayer.timeInfo](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#timeInfo) | layer |
107
+ * | `trackIdField` | Field name, for example, [LayerForFieldUsage](https://developers.arcgis.com/javascript/latest/references/core/layers/support/fieldUtils/#LayerForFieldUsage-trackIdField) | layer |
108
+ * | `labeling.expression` | Label expression string, for example, the expression in [LabelClass.labelExpressionInfo](https://developers.arcgis.com/javascript/latest/references/core/layers/support/LabelClass/#labelExpressionInfo) | layer's [LabelClass](https://developers.arcgis.com/javascript/latest/references/core/layers/support/LabelClass/) |
109
+ * | `labeling.where` | SQL expression, for example, [LabelClass.where](https://developers.arcgis.com/javascript/latest/references/core/layers/support/LabelClass/#where) | layer's [LabelClass](https://developers.arcgis.com/javascript/latest/references/core/layers/support/LabelClass/) |
110
+ * | `featureReduction.fields` | AggregateField object, for example, an entry in [FeatureReductionCluster.fields](https://developers.arcgis.com/javascript/latest/references/core/layers/support/FeatureReductionCluster/#fields) | layer's [featureReduction](https://developers.arcgis.com/javascript/latest/references/core/layers/mixins/FeatureReductionLayer/#FeatureReductionUnion) |
111
+ * | `featureReduction.renderer` | Renderer object, for example, [FeatureReductionCluster.renderer](https://developers.arcgis.com/javascript/latest/references/core/layers/support/FeatureReductionCluster/#renderer) | layer's [featureReduction](https://developers.arcgis.com/javascript/latest/references/core/layers/mixins/FeatureReductionLayer/#FeatureReductionUnion) |
112
+ * | `featureReduction.popupTemplate` | PopupTemplate object, for example, [FeatureReductionCluster.popupTemplate](https://developers.arcgis.com/javascript/latest/references/core/layers/support/FeatureReductionCluster/#popupTemplate) | layer's [featureReduction](https://developers.arcgis.com/javascript/latest/references/core/layers/mixins/FeatureReductionLayer/#FeatureReductionUnion) |
113
+ * | `featureReduction.labeling.expression` | Label expression string, for example, the expression in [LabelClass.labelExpressionInfo](https://developers.arcgis.com/javascript/latest/references/core/layers/support/LabelClass/#labelExpressionInfo) | [LabelClass](https://developers.arcgis.com/javascript/latest/references/core/layers/support/LabelClass/) in `layer.featureReduction` |
114
+ * | `featureReduction.labeling.where` | SQL expression, for example, [LabelClass.where](https://developers.arcgis.com/javascript/latest/references/core/layers/support/LabelClass/#where) | [LabelClass](https://developers.arcgis.com/javascript/latest/references/core/layers/support/LabelClass/) in `layer.featureReduction` |
121
115
  *
122
116
  * @since 6.0
123
117
  */
124
- export type FieldUsageLocation = FieldUsageLocationInfo<"definitionExpression", string, LayerForFieldUsage> | FieldUsageLocationInfo<"featureEffect", FeatureEffect, LayerForFieldUsage> | FieldUsageLocationInfo<"displayFilterInfo", string, DisplayFilter> | FieldUsageLocationInfo<"orderBy", OrderByInfo, LayerForFieldUsage> | FieldUsageLocationInfo<"renderer", RendererUnion, LayerForFieldUsage> | FieldUsageLocationInfo<"labeling.expression", string, LabelClass> | FieldUsageLocationInfo<"labeling.where", string, LabelClass> | FieldUsageLocationInfo<"featureReduction.fields", AggregateField, FeatureReductionCluster | FeatureReductionBinning> | FieldUsageLocationInfo<"featureReduction.renderer", RendererUnion, FeatureReductionCluster | FeatureReductionBinning> | FieldUsageLocationInfo<"featureReduction.labeling.expression", string, LabelClass> | FieldUsageLocationInfo<"featureReduction.labeling.where", string, LabelClass> | FieldUsageLocationInfo<"featureReduction.popupTemplate", PopupTemplateInstance, FeatureReductionCluster | FeatureReductionBinning> | FieldUsageLocationInfo<"popupTemplate", PopupTemplateInstance, LayerForFieldUsage> | FieldUsageLocationInfo<"formTemplate", FormTemplate, LayerForFieldUsage> | FieldUsageLocationInfo<"timeInfo", TimeInfo, LayerForFieldUsage> | FieldUsageLocationInfo<"trackIdField", string, LayerForFieldUsage>;
118
+ export type FieldUsageLocation = {
119
+ readonly type: "definitionExpression";
120
+ readonly value: string;
121
+ readonly owner: LayerForFieldUsage;
122
+ } | {
123
+ readonly type: "featureEffect";
124
+ readonly value: FeatureEffect;
125
+ readonly owner: LayerForFieldUsage;
126
+ } | {
127
+ readonly type: "displayFilterInfo";
128
+ readonly value: string;
129
+ readonly owner: DisplayFilter;
130
+ } | {
131
+ readonly type: "orderBy";
132
+ readonly value: OrderByInfo;
133
+ readonly owner: LayerForFieldUsage;
134
+ } | {
135
+ readonly type: "renderer";
136
+ readonly value: RendererUnion;
137
+ readonly owner: LayerForFieldUsage;
138
+ } | {
139
+ readonly type: "labeling.expression";
140
+ readonly value: string;
141
+ readonly owner: LabelClass;
142
+ } | {
143
+ readonly type: "labeling.where";
144
+ readonly value: string;
145
+ readonly owner: LabelClass;
146
+ } | {
147
+ readonly type: "featureReduction.fields";
148
+ readonly value: AggregateField;
149
+ readonly owner: FeatureReductionCluster | FeatureReductionBinning;
150
+ } | {
151
+ readonly type: "featureReduction.renderer";
152
+ readonly value: RendererUnion;
153
+ readonly owner: FeatureReductionCluster | FeatureReductionBinning;
154
+ } | {
155
+ readonly type: "featureReduction.labeling.expression";
156
+ readonly value: string;
157
+ readonly owner: LabelClass;
158
+ } | {
159
+ readonly type: "featureReduction.labeling.where";
160
+ readonly value: string;
161
+ readonly owner: LabelClass;
162
+ } | {
163
+ readonly type: "featureReduction.popupTemplate";
164
+ readonly value: PopupTemplateInstance;
165
+ readonly owner: FeatureReductionCluster | FeatureReductionBinning;
166
+ } | {
167
+ readonly type: "popupTemplate";
168
+ readonly value: PopupTemplateInstance;
169
+ readonly owner: LayerForFieldUsage;
170
+ } | {
171
+ readonly type: "formTemplate";
172
+ readonly value: FormTemplate;
173
+ readonly owner: LayerForFieldUsage;
174
+ } | {
175
+ readonly type: "timeInfo";
176
+ readonly value: TimeInfo;
177
+ readonly owner: LayerForFieldUsage;
178
+ } | {
179
+ readonly type: "trackIdField";
180
+ readonly value: string;
181
+ readonly owner: LayerForFieldUsage;
182
+ };
125
183
 
126
184
  /**
127
- * An unresolved field reference and the configuration that contains it.
128
- * Layer configuration and aggregate definitions are checked against the layer's
129
- * fields. Feature-reduction renderer, label, and popup references are checked
130
- * against the aggregate fields, except popup `$aggregatedFeatures` references,
131
- * which use the source fields. A missing source dependency is reported on its
132
- * aggregate definition, not repeated on the aggregate's consumers.
185
+ * Defines a field and its location used in the layer configuration but isn't part of the layer's fields.
133
186
  *
134
187
  * @since 6.0
135
188
  */
@@ -140,39 +193,44 @@ export type UnknownFieldUsage = FieldUsageLocation
140
193
  };
141
194
 
142
195
  /**
143
- * A snapshot of source field usage in a feature-like layer's configuration.
196
+ * A snapshot of field usage in a feature-like layer's configuration returned by [getLayerFieldUsage()](https://developers.arcgis.com/javascript/latest/references/core/layers/support/fieldUtils/#getLayerFieldUsage).
144
197
  *
145
198
  * @since 6.0
146
199
  */
147
200
  export interface FeatureLikeLayerFieldUsage {
148
201
  /**
149
- * Unresolved field references with their configuration values and owners,
150
- * sorted by `type`. Repeated references within the same location are reported once.
202
+ * Unknown fields are referenced by the layer but cannot be found in the applicable layer fields or aggregate fields.
203
+ * Entries identify these field names and their configuration types, values, and owning objects,
204
+ * sorted by `type`, or an empty array if all field references can be resolved.
205
+ * Repeated references to the same field within the same location are reported once.
151
206
  */
152
207
  readonly unknownFields: readonly UnknownFieldUsage[];
153
208
  /**
154
- * Returns the configuration locations that use a source field, sorted by `type`.
155
- * Multiple label classes, display filters, and aggregate definitions have separate
156
- * locations. Repeated references within the same location are reported once.
209
+ * Returns the configuration locations where the specified field is used, sorted by `type`.
210
+ * Locations distinguish individual configuration values, such as label expressions, display filters, and aggregate field definitions.
211
+ * Repeated references to the field within the same location are reported once.
157
212
  *
158
- * @param fieldName - A source field name at collection time. Lookup is case-insensitive.
159
- * @returns The typed values and their owners, or an empty array for an unknown or unused field.
213
+ * @param fieldName - The name of a field present in the layer when [getLayerFieldUsage()](https://developers.arcgis.com/javascript/latest/references/core/layers/support/fieldUtils/#getLayerFieldUsage) ran. Lookup is case-insensitive.
214
+ * @returns Matching [FieldUsageLocation](https://developers.arcgis.com/javascript/latest/references/core/layers/support/fieldUtils/#FieldUsageLocation) entries identifying the configuration type,
215
+ * value, and owning object, or an empty array if the field does not exist on the layer or is not referenced
216
+ * by the configuration inspected by this utility.
160
217
  */
161
218
  getLocations(fieldName: string): readonly FieldUsageLocation[];
162
219
  }
163
220
 
164
221
  /**
165
- * Finds where source layer fields are used in a loaded feature-like layer's configuration.
166
- * Accepts any layer implementing [LayerForFieldUsage](https://developers.arcgis.com/javascript/latest/references/core/layers/support/fieldUtils/#LayerForFieldUsage).
222
+ * Loads a feature-like layer and finds where its source fields are used, including in renderers, labels, popup templates, and filters.
223
+ * Supports layers implementing [LayerForFieldUsage](https://developers.arcgis.com/javascript/latest/references/core/layers/support/fieldUtils/#LayerForFieldUsage), such as
224
+ * [FeatureLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/), [CSVLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/CSVLayer/), and [GeoJSONLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/GeoJSONLayer/).
225
+ * If loading fails, the promise rejects with the layer's load error.
167
226
  *
168
- * Use this utility to detect properties of the layer using a field about to be deleted.
227
+ * Use it to identify dependencies before removing a field. Call it again after updating the layer configuration to get a new snapshot.
169
228
  *
170
- * @param layer - The loaded layer to inspect.
171
- * @returns A snapshot with a case-insensitive field usage lookup.
229
+ * @param layer - The feature-like layer to load and inspect.
230
+ * @returns Field usage information with case-insensitive lookup by field name.
172
231
  * @since 6.0
173
232
  * @example
174
- * await layer.load();
175
- * const usage = await fieldUtils.getFieldUsage(layer);
233
+ * const usage = await fieldUtils.getLayerFieldUsage(layer);
176
234
  * console.log(usage.unknownFields);
177
235
  * console.log(usage.getLocations("population"));
178
236
  * // For layer.definitionExpression = "POPULATION < 100", includes:
@@ -183,8 +241,22 @@ export interface FeatureLikeLayerFieldUsage {
183
241
  * console.log(location.value, location.owner); // SQL string and its LabelClass
184
242
  * }
185
243
  * }
244
+ * @example
245
+ * const usage = await fieldUtils.getLayerFieldUsage(layer);
246
+ * // Handle unknown fields by cleaning them from the layer configuration
247
+ * for (const unknownField of usage.unknownFields) {
248
+ * switch (unknownField.type) {
249
+ * case "definitionExpression": {
250
+ * unknownField.owner.definitionExpression = null;
251
+ * console.log(`cleaned field "${unknownField.fieldName}" from "${unknownField.type}"`);
252
+ * break;
253
+ * }
254
+ * default:
255
+ * console.error(`couldn't clean field "${unknownField.fieldName}" from "${unknownField.type}"`);
256
+ * }
257
+ * }
186
258
  */
187
- export function getFieldUsage(layer: LayerForFieldUsage): Promise<FeatureLikeLayerFieldUsage>;
259
+ export function getLayerFieldUsage(layer: LayerForFieldUsage): Promise<FeatureLikeLayerFieldUsage>;
188
260
 
189
261
  /**
190
262
  * Returns an array of field names related to time.