@arcgis/core 4.34.0-next.62 → 4.34.0-next.65

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 (270) hide show
  1. package/AggregateGraphic.js +1 -1
  2. package/Graphic.js +1 -1
  3. package/TrackGraphic.js +1 -1
  4. package/analysis/VolumeMeasurement/VolumeMeasurementCutFillOptions.js +1 -1
  5. package/analysis/VolumeMeasurementAnalysis.js +1 -1
  6. package/assets/esri/core/workers/RemoteClient.js +1 -1
  7. package/assets/esri/core/workers/chunks/{b68b54be3d67595a9446.js → 06ff5f34ad9bdf9705de.js} +77 -67
  8. package/assets/esri/core/workers/chunks/{5de7c2a80bd9c81cefe2.js → 070b29cba896f46537f9.js} +1 -1
  9. package/assets/esri/core/workers/chunks/{8c0e11f781607239749d.js → 0a36df6fdab95785d1ce.js} +1 -1
  10. package/assets/esri/core/workers/chunks/0b01c87db77246632ad9.js +1 -0
  11. package/assets/esri/core/workers/chunks/0b24a6c06d1becbb6815.js +1 -0
  12. package/assets/esri/core/workers/chunks/0cdf6b51f2a63f348530.js +1 -0
  13. package/assets/esri/core/workers/chunks/0d82cc6905b105b3568a.js +1 -0
  14. package/assets/esri/core/workers/chunks/10ec10ca361842efce92.js +1 -0
  15. package/assets/esri/core/workers/chunks/{bdc18ef9cdc8242f014e.js → 1143313f2f6f34deaad7.js} +1 -1
  16. package/assets/esri/core/workers/chunks/2394ac65d64e50399d76.js +1 -0
  17. package/assets/esri/core/workers/chunks/{69fbe363bb130fdd8146.js → 3d6f07e04f77cc0a7506.js} +1 -1
  18. package/assets/esri/core/workers/chunks/{db7678104b18534482e3.js → 426232091caf8608e5f1.js} +1 -1
  19. package/assets/esri/core/workers/chunks/47febd4de836a33b51b1.js +1 -0
  20. package/assets/esri/core/workers/chunks/487afbf352d12c745430.js +1 -0
  21. package/assets/esri/core/workers/chunks/4fda6e90822bc0198b28.js +2 -0
  22. package/assets/esri/core/workers/chunks/{3fd09a7c05583a57a317.js → 5d12862042b6bf9f9d54.js} +1 -1
  23. package/assets/esri/core/workers/chunks/5d65987f2c1b5c56a799.js +1 -0
  24. package/assets/esri/core/workers/chunks/{ba0c7339fa19cc7cbde7.js → 5e1d6704ee0aa41b1d06.js} +1 -1
  25. package/assets/esri/core/workers/chunks/{4ac127cefa3aa5e93e78.js → 657b01a6df8dc46c5209.js} +1 -1
  26. package/assets/esri/core/workers/chunks/{71b222089f5e9dcee474.js → 6a1b652ccbf58ac44658.js} +1 -1
  27. package/assets/esri/core/workers/chunks/{4050ddb580d364d9e205.js → 6ab435423acb0ed0b1c7.js} +1 -1
  28. package/assets/esri/core/workers/chunks/7b7f5028a488bb9c10f4.js +1 -0
  29. package/assets/esri/core/workers/chunks/{d83bdc13c3cad3eee7be.js → 7c3a1958990de095d3a1.js} +1 -1
  30. package/assets/esri/core/workers/chunks/808cfed7022e3846d5b2.js +1 -0
  31. package/assets/esri/core/workers/chunks/88b8f33ce1cbf8a0f855.js +33 -0
  32. package/assets/esri/core/workers/chunks/8bd5a0ff7dcf1067bf53.js +1 -0
  33. package/assets/esri/core/workers/chunks/{f462a138912e5379b6a7.js → 904c116c6b093e0e970c.js} +1 -1
  34. package/assets/esri/core/workers/chunks/99b20eef2893047fac10.js +1 -0
  35. package/assets/esri/core/workers/chunks/a16b471c3706ee37f9b6.js +1 -0
  36. package/assets/esri/core/workers/chunks/{bb2ab663e3e5597f2104.js → a1bd4eecca1e3272bffb.js} +1 -1
  37. package/assets/esri/core/workers/chunks/{8005ae652361f506bc5f.js → a29fb90226bd08157bd1.js} +1 -1
  38. package/assets/esri/core/workers/chunks/a596d6ccb6103e594031.js +1 -0
  39. package/assets/esri/core/workers/chunks/a5e6359fadbd699b1c8e.js +1 -0
  40. package/assets/esri/core/workers/chunks/a7f3cdd9a249ef4572ce.js +1 -0
  41. package/assets/esri/core/workers/chunks/{d2bdd52d2291306a4e47.js → a80d769b0ed025f0df64.js} +1 -1
  42. package/assets/esri/core/workers/chunks/a987731d1b5449d8fb0c.js +1 -0
  43. package/assets/esri/core/workers/chunks/af83dddddbfe25194527.js +1 -0
  44. package/assets/esri/core/workers/chunks/{4d8d942fbd6750bb7567.js → b057e6d593c1607cae61.js} +1 -1
  45. package/assets/esri/core/workers/chunks/{d707538b150d79050336.js → b1f1a26e7a2ef5b783ee.js} +1 -1
  46. package/assets/esri/core/workers/chunks/c337c1a2dbc452780dd7.js +1 -0
  47. package/assets/esri/core/workers/chunks/{a35a439f053d1fe0541b.js → c601bbdafdee5074b04f.js} +1 -1
  48. package/assets/esri/core/workers/chunks/{d7ce68667bb355ef8e5d.js → c7a386ac90e58eb71935.js} +1 -1
  49. package/assets/esri/core/workers/chunks/c8694a27e2cf28b010e8.js +1 -0
  50. package/assets/esri/core/workers/chunks/cf69f6afeaf1229e032c.js +1 -0
  51. package/assets/esri/core/workers/chunks/d1e8220dcae1d01d3c35.js +1 -0
  52. package/assets/esri/core/workers/chunks/e12e8d69c05c182b6a69.js +1 -0
  53. package/assets/esri/core/workers/chunks/{220c8d6338f236298720.js → e6457ac25c0829ee039c.js} +1 -1
  54. package/assets/esri/core/workers/chunks/{c77a97c723b8c17df186.js → e72aee3f857aa473822c.js} +1 -1
  55. package/assets/esri/core/workers/chunks/{8374d87176486c1fc90e.js → eadac757f74470b89a36.js} +1 -1
  56. package/assets/esri/core/workers/chunks/{7c23be93d394f1bee941.js → f6107f844f4feed42828.js} +1 -1
  57. package/assets/esri/core/workers/chunks/f76774781865cb1411b0.js +1 -0
  58. package/assets/esri/core/workers/chunks/fd04df45cdcc6ff52554.js +1 -0
  59. package/assets/esri/layers/support/rasterFormats/qb3-wasm.wasm +0 -0
  60. package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
  61. package/assets/esri/libs/lyr3d/lyr3DWorker.wasm +0 -0
  62. package/assets/esri/libs/vxl/vxlLayer.wasm +0 -0
  63. package/assets/esri/themes/base/widgets/_Attribution.scss +0 -1
  64. package/assets/esri/themes/dark/main.css +1 -1
  65. package/assets/esri/themes/light/main.css +1 -1
  66. package/assets/esri/themes/light/view.css +1 -1
  67. package/chunks/ComponentShader.glsl.js +1 -1
  68. package/chunks/DefaultMaterial.glsl.js +2 -2
  69. package/chunks/Fog.glsl.js +2 -2
  70. package/chunks/GaussianSplat.glsl.js +7 -0
  71. package/chunks/GaussianSplatComposition.glsl.js +7 -0
  72. package/chunks/GaussianSplatDepthComposition.glsl.js +11 -0
  73. package/chunks/{BloomBlur.glsl.js → GlowBlur.glsl.js} +5 -5
  74. package/chunks/GlowComposition.glsl.js +41 -0
  75. package/chunks/Path.glsl.js +1 -1
  76. package/chunks/RealisticTree.glsl.js +40 -36
  77. package/chunks/lyr3DMain.js +1 -1
  78. package/chunks/lyr3DWorker.js +1 -1
  79. package/chunks/qb3-wasm.js +5 -0
  80. package/chunks/vxlLayer.js +1 -1
  81. package/config.js +1 -1
  82. package/geometry/ellipsoidUtils.js +1 -1
  83. package/geometry/operators/geodeticUtilsOperator.d.ts +6 -0
  84. package/geometry/support/heightModelInfoUtils.js +1 -1
  85. package/graphic/AggregateGraphicOrigin.js +5 -0
  86. package/graphic/CSVGraphicOrigin.js +1 -1
  87. package/graphic/CatalogGraphicOrigin.js +1 -1
  88. package/graphic/FeatureGraphicOrigin.js +1 -1
  89. package/graphic/GeoJSONGraphicOrigin.js +1 -1
  90. package/graphic/KnowledgeGraphGraphicOrigin.js +1 -1
  91. package/graphic/OGCFeatureGraphicOrigin.js +1 -1
  92. package/graphic/OrientedImageryGraphicOrigin.js +1 -1
  93. package/graphic/ParquetGraphicOrigin.js +1 -1
  94. package/graphic/StreamGraphicOrigin.js +1 -1
  95. package/graphic/SubtypeGroupGraphicOrigin.js +1 -1
  96. package/graphic/TrackGraphicOrigin.js +5 -0
  97. package/graphic/WFSGraphicOrigin.js +1 -1
  98. package/graphic/getPopupProvider.js +5 -0
  99. package/interfaces.d.ts +795 -30
  100. package/kernel.js +1 -1
  101. package/layers/GaussianSplatLayer.js +1 -1
  102. package/layers/IntegratedMesh3DTilesLayer.js +1 -1
  103. package/layers/Lyr3DWasmPerSceneView.js +1 -1
  104. package/layers/VoxelWasmPerSceneView.js +1 -1
  105. package/layers/knowledgeGraph/KnowledgeGraphSublayer.js +1 -1
  106. package/layers/knowledgeGraph/nodeMovementUtils.js +1 -1
  107. package/layers/mixins/FeatureReductionLayer.js +1 -1
  108. package/layers/mixins/TrackableLayer.js +1 -1
  109. package/layers/support/GaussianSplatAtlasPageAllocator.js +5 -0
  110. package/layers/support/gaussianSplatUtils.js +5 -0
  111. package/layers/support/rasterDatasets/MRFRaster.js +1 -1
  112. package/layers/support/rasterFormats/Qb3.js +5 -0
  113. package/layers/support/rasterFormats/RasterCodec.js +1 -1
  114. package/layers/support/tiles3DUtils.js +5 -0
  115. package/package.json +1 -1
  116. package/rest/knowledgeGraph/GraphApplyEditsResult.js +1 -1
  117. package/rest/knowledgeGraph/wasmInterface/wasmToUpdateResponseFactories.js +1 -1
  118. package/rest/knowledgeGraphService.js +1 -1
  119. package/rest/lastMileDelivery/enums.js +5 -0
  120. package/rest/lastMileDelivery.d.ts +10 -0
  121. package/rest/lastMileDelivery.js +5 -0
  122. package/rest/route/utils.js +1 -1
  123. package/rest/support/JobInfo.js +1 -1
  124. package/rest/support/LastMileDeliveryParameters.d.ts +4 -0
  125. package/rest/support/LastMileDeliveryParameters.js +5 -0
  126. package/support/revision.js +1 -1
  127. package/symbols/patterns/StylePattern3D.js +1 -1
  128. package/symbols/patterns/styles.js +1 -1
  129. package/unionTypes.d.ts +3 -0
  130. package/views/2d/analysis/AnalysisView2D.js +5 -0
  131. package/views/2d/analysis/ElevationProfileAnalysisView2D.d.ts +4 -0
  132. package/views/2d/analysis/ElevationProfileAnalysisView2D.js +5 -0
  133. package/views/2d/analysis/analysisViewModuleImportUtils.js +5 -0
  134. package/views/2d/engine/webgl/Painter.js +1 -1
  135. package/views/2d/engine/webgl/shaderGraph/GraphShaderModule.js +1 -1
  136. package/views/2d/engine/webgl/shaderGraph/techniques/TextureStatisticsTechnique.js +5 -0
  137. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/TextureStatisticsDiffShader.js +5 -0
  138. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/TextureStatisticsMinMaxSumShader.js +5 -0
  139. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/TextureStatisticsStdDevShader.js +5 -0
  140. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/TextureStatisticsSumOfSquaredDiffShader.js +5 -0
  141. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/utils.js +1 -1
  142. package/views/2d/engine/webgl/shaderGraph/techniques/videoScreenRenderer/VideoScreenTechnique.js +1 -1
  143. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  144. package/views/2d/layers/features/layerAdapters/FeatureLayerAdapter.js +1 -1
  145. package/views/2d/layers/features/layerAdapters/InMemoryLayerAdapter.js +1 -1
  146. package/views/2d/layers/features/layerAdapters/KnowledgeGraphSublayerAdapter.js +1 -1
  147. package/views/2d/layers/features/layerAdapters/OGCFeatureLayerAdapter.js +1 -1
  148. package/views/2d/layers/features/layerAdapters/OrientedImageryLayerAdapter.js +1 -1
  149. package/views/2d/layers/features/layerAdapters/ParquetLayerAdapter.js +1 -1
  150. package/views/2d/layers/features/layerAdapters/StreamLayerAdapter.js +1 -1
  151. package/views/2d/layers/support/visualVariableSimpleUtils.js +1 -1
  152. package/views/3d/analysis/AnalysisView3D.js +1 -1
  153. package/views/3d/analysis/AreaMeasurementAnalysisView3D.js +1 -1
  154. package/views/3d/analysis/DimensionAnalysisView3D.js +1 -1
  155. package/views/3d/analysis/DirectLineMeasurementAnalysisView3D.js +1 -1
  156. package/views/3d/analysis/ElevationProfile/ElevationProfileHoveredPointsVisualization.js +1 -1
  157. package/views/3d/analysis/ElevationProfile/ElevationProfileLineVisualization.js +5 -0
  158. package/views/3d/analysis/ElevationProfile/ElevationProfileSceneLineComputation.js +1 -1
  159. package/views/3d/analysis/ElevationProfile/ElevationProfileVisualization.js +1 -1
  160. package/views/3d/analysis/ElevationProfileAnalysisView3D.js +1 -1
  161. package/views/3d/analysis/LineOfSightAnalysisView3D.js +1 -1
  162. package/views/3d/analysis/SliceAnalysisView3D.js +1 -1
  163. package/views/3d/analysis/ViewshedAnalysisView3D.js +1 -1
  164. package/views/3d/analysis/VolumeMeasurementAnalysisView3D.js +1 -1
  165. package/views/3d/analysis/analysisViewModuleImportUtils.js +5 -0
  166. package/views/3d/environment/EnvironmentRenderer.js +1 -1
  167. package/views/3d/environment/Fog.js +1 -1
  168. package/views/3d/environment/FogTechniqueConfiguration.js +1 -1
  169. package/views/3d/environment/Precipitation.js +1 -1
  170. package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
  171. package/views/3d/layers/GraphicsView3D.js +1 -1
  172. package/views/3d/layers/I3SMeshView3D.js +1 -1
  173. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  174. package/views/3d/layers/{IntegratedMesh3DTilesViewPerformanceInfo.js → Lyr3DViewPerformanceInfo.js} +1 -1
  175. package/views/3d/layers/Lyr3DWasm.js +1 -1
  176. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  177. package/views/3d/layers/graphics/Labeler.js +1 -1
  178. package/views/3d/layers/i3s/LayerElevationProvider.js +1 -1
  179. package/views/3d/layers/support/LayerViewAnalysisViewManager.js +1 -1
  180. package/views/3d/layers/support/Tiles3DIntersectionHandler.js +1 -1
  181. package/views/3d/support/GaussianSplatSortWorker.js +1 -1
  182. package/views/3d/support/GaussianSplatWorkerHandle.js +1 -1
  183. package/views/3d/support/QualitySettings.js +1 -1
  184. package/views/3d/support/pointsOfInterest/CameraOnSurface.js +1 -1
  185. package/views/3d/support/pointsOfInterest/ContentGeometryUpdates.js +1 -1
  186. package/views/3d/support/pointsOfInterest/PointsOfInterest.js +1 -1
  187. package/views/3d/webgl-engine/collections/Component/ComponentObject.js +1 -1
  188. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  189. package/views/3d/webgl-engine/collections/Component/ComponentObjectElevationAgnosticComponentBVH.js +1 -1
  190. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  191. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
  192. package/views/3d/webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl.js +4 -4
  193. package/views/3d/webgl-engine/core/shaderLibrary/output/Emissions.glsl.js +5 -5
  194. package/views/3d/webgl-engine/core/shaderLibrary/util/ComputeCovariance.glsl.js +40 -0
  195. package/views/3d/webgl-engine/core/shaderLibrary/util/GaussianSplatUnpacking.glsl.js +59 -0
  196. package/views/3d/webgl-engine/core/shaderLibrary/util/QuaternionToRotationMatrix.glsl.js +23 -0
  197. package/views/3d/webgl-engine/effects/{bloom/BloomBlur.glsl.js → glow/GlowBlur.glsl.js} +1 -1
  198. package/views/3d/webgl-engine/effects/glow/GlowBlurTechnique.js +5 -0
  199. package/views/3d/webgl-engine/effects/{bloom/BloomBlurTechniqueConfiguration.js → glow/GlowBlurTechniqueConfiguration.js} +1 -1
  200. package/views/3d/webgl-engine/effects/{bloom/BloomComposition.glsl.js → glow/GlowComposition.glsl.js} +1 -1
  201. package/views/3d/webgl-engine/effects/glow/GlowCompositionTechnique.js +5 -0
  202. package/views/3d/webgl-engine/effects/{bloom/BloomCompositionTechniqueConfiguration.js → glow/GlowCompositionTechniqueConfiguration.js} +1 -1
  203. package/views/3d/webgl-engine/effects/glow/GlowRenderNode.js +5 -0
  204. package/views/3d/webgl-engine/effects/weather/SnowCover.glsl.js +10 -4
  205. package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
  206. package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +5 -0
  207. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  208. package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
  209. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  210. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  211. package/views/3d/webgl-engine/materials/PathTechniqueConfiguration.js +1 -1
  212. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  213. package/views/3d/webgl-engine/shaders/DefaultMaterialTechniqueConfiguration.js +1 -1
  214. package/views/3d/webgl-engine/shaders/GaussianSplat.glsl.js +5 -0
  215. package/views/3d/webgl-engine/shaders/GaussianSplatComposition.glsl.js +5 -0
  216. package/views/3d/webgl-engine/shaders/GaussianSplatCompositionTechnique.js +5 -0
  217. package/views/3d/webgl-engine/shaders/GaussianSplatCompositionTechniqueConfiguration.js +5 -0
  218. package/views/3d/webgl-engine/shaders/GaussianSplatDepthComposition.glsl.js +5 -0
  219. package/views/3d/webgl-engine/shaders/GaussianSplatDepthCompositionTechnique.js +5 -0
  220. package/views/3d/webgl-engine/shaders/GaussianSplatDepthTechnique.js +5 -0
  221. package/views/3d/webgl-engine/shaders/GaussianSplatTechnique.js +5 -0
  222. package/views/3d/webgl-engine/shaders/GaussianSplatTechniqueConfiguration.js +5 -0
  223. package/views/3d/webgl-engine/shaders/RealisticTree.glsl.js +1 -1
  224. package/views/SceneView.js +1 -1
  225. package/views/VideoView.js +1 -1
  226. package/views/View2D.js +1 -1
  227. package/views/analysis/AnalysisView.js +5 -0
  228. package/views/analysis/ElevationProfile/ElevationProfileResult.js +1 -1
  229. package/views/layers/FeatureLayerView.js +1 -1
  230. package/views/support/AnalysisViewManager.js +1 -1
  231. package/views/webgl/FramebufferObject.js +1 -1
  232. package/widgets/Locate/LocateViewModel.js +1 -1
  233. package/widgets/OrientedImageryViewer/imageMeasurementUtils.js +1 -1
  234. package/assets/esri/core/workers/chunks/08d420cd7cfa19a10fa4.js +0 -1
  235. package/assets/esri/core/workers/chunks/17abab49db1813d3e192.js +0 -1
  236. package/assets/esri/core/workers/chunks/182383fd00008606bfaa.js +0 -1
  237. package/assets/esri/core/workers/chunks/188feb2bcbf8e48e3163.js +0 -1
  238. package/assets/esri/core/workers/chunks/3124a8516e815efec973.js +0 -1
  239. package/assets/esri/core/workers/chunks/3461701a15be46603c56.js +0 -1
  240. package/assets/esri/core/workers/chunks/36acf191a2d48560c796.js +0 -1
  241. package/assets/esri/core/workers/chunks/40e1fbfbf3f3979b3713.js +0 -1
  242. package/assets/esri/core/workers/chunks/4b1daffa97fd90a554a0.js +0 -1
  243. package/assets/esri/core/workers/chunks/4b68783e8d1415d0a171.js +0 -1
  244. package/assets/esri/core/workers/chunks/5915f5ba9064097aee79.js +0 -1
  245. package/assets/esri/core/workers/chunks/5ed7e139c72cd2b3ddba.js +0 -1
  246. package/assets/esri/core/workers/chunks/659f7e99b2d524ef53fb.js +0 -2
  247. package/assets/esri/core/workers/chunks/702d2c668dedf83421ca.js +0 -1
  248. package/assets/esri/core/workers/chunks/7b2ec80dca0fdb0442cf.js +0 -1
  249. package/assets/esri/core/workers/chunks/7b9178c3826f9ef52a00.js +0 -1
  250. package/assets/esri/core/workers/chunks/9a20390602126995f831.js +0 -1
  251. package/assets/esri/core/workers/chunks/a2150baf0661e2f28011.js +0 -1
  252. package/assets/esri/core/workers/chunks/a532614aa65fb52dee7b.js +0 -1
  253. package/assets/esri/core/workers/chunks/abededd48e0ea6cfec01.js +0 -1
  254. package/assets/esri/core/workers/chunks/ae1cb4c65d72217ae4d4.js +0 -1
  255. package/assets/esri/core/workers/chunks/c1c6202f7bef24b5db26.js +0 -1
  256. package/assets/esri/core/workers/chunks/c75b0243e5bb84738419.js +0 -1
  257. package/assets/esri/core/workers/chunks/d47c3431c501d77b1779.js +0 -1
  258. package/assets/esri/core/workers/chunks/eacc7fccdc3fb670ac8f.js +0 -33
  259. package/assets/esri/core/workers/chunks/f6d91256c4e5f8a0d5c0.js +0 -1
  260. package/assets/esri/core/workers/chunks/f711aeba1a2c184ddb43.js +0 -1
  261. package/chunks/BloomComposition.glsl.js +0 -41
  262. package/graphic/isPopupProviderGraphicOrigin.js +0 -5
  263. package/views/2d/analysisViewModuleImportUtils.js +0 -5
  264. package/views/3d/analysis/ElevationProfile/ElevationProfileLinesVisualization.js +0 -5
  265. package/views/3d/analysisViewModuleImportUtils.js +0 -5
  266. package/views/3d/webgl-engine/effects/bloom/BloomBlurTechnique.js +0 -5
  267. package/views/3d/webgl-engine/effects/bloom/BloomCompositionTechnique.js +0 -5
  268. package/views/3d/webgl-engine/effects/bloom/BloomRenderNode.js +0 -5
  269. /package/assets/esri/core/workers/chunks/{659f7e99b2d524ef53fb.js.LICENSE.txt → 4fda6e90822bc0198b28.js.LICENSE.txt} +0 -0
  270. /package/views/3d/webgl-engine/effects/{bloom/BloomPresets.glsl.js → glow/GlowPresets.glsl.js} +0 -0
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
+ */
5
+ import{rad2deg as e}from"../../core/mathUtils.js";import{d as r,f as o,t as n,c as t,A as s,z as i,a as m}from"../../chunks/vec32.js";import{fromValues as a,create as f}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{WGS84ECEFSpatialReferenceLike as x}from"../../geometry/ellipsoidUtils.js";import c from"../../geometry/Extent.js";import u from"../../geometry/SpatialReference.js";import{projectBuffer as l}from"../../geometry/projection/projectBuffer.js";function p(e,r){if(!Array.isArray(e)||e.length<r)return!1;for(const o of e)if("number"!=typeof o)return!1;return!0}const b=7645211,y={xmin:-180,ymin:-90,zmin:-450,xmax:180,ymax:90,zmax:8850};function A(A){let E=new u({wkid:4326,vcsWkid:115700}),g=A.root?.boundingVolume,_=!1,w=A?.root?.transform;if((A.extensions?.ESRI_crs?.wkid||A.extensions?.ESRI_crs?.latestWkid||A.extensions?.ESRI_crs?.wkt)&&(A.root?.extensions?.ESRI_crs?.boundingVolume?.box||A.root?.extensions?.ESRI_crs?.boundingVolume?.sphere))E=new u(A.extensions?.ESRI_crs),g=A.root?.extensions?.ESRI_crs?.boundingVolume,w=A.root?.transform,_=!0;else if(!g)return new c(-180,-90,180,90,E);if(g.box){const e=g?.box;if(e[3]>b&&e[7]>b&&e[11]>b)return new c({...y,sr:E})}const R=f();if(!_&&g.region&&p(g.region,6)){const r=g.region,o=e(r[0]),n=e(r[1]),t=r[4],s=e(r[2]),i=e(r[3]),m=r[5];return new c({xmin:o,ymin:n,zmin:t,xmax:s,ymax:i,zmax:m,spatialReference:E})}if(g.sphere&&p(g.sphere,4)){const e=g.sphere,m=a(e[0],e[1],e[2]),b=e[3]/Math.sqrt(3),y=f();r(y,m,a(b,b,b));const A=f();if(o(A,m,a(b,b,b)),w&&p(w,16)){const e=w;n(R,y,e),t(y,R),n(R,A,e),t(A,R)}_||(l(y,x,0,y,u.WGS84,0),l(A,x,0,A,u.WGS84,0));const S=f(),d=f();return s(S,y,A),i(d,y,A),new c({xmin:S[0],ymin:S[1],zmin:S[2],xmax:d[0],ymax:d[1],zmax:d[2],spatialReference:E})}if(g.box&&p(g.box,12)){const e=g.box,r=a(e[0],e[1],e[2]),t=a(e[3],e[4],e[5]),b=a(e[6],e[7],e[8]),y=a(e[9],e[10],e[11]),A=[];for(let o=0;o<8;++o)A.push(f());if(o(A[0],r,t),o(A[0],A[0],b),o(A[0],A[0],y),m(A[1],r,t),o(A[1],A[1],b),o(A[1],A[1],y),o(A[2],r,t),m(A[2],A[2],b),o(A[2],A[2],y),m(A[3],r,t),m(A[3],A[3],b),o(A[3],A[3],y),o(A[4],r,t),o(A[4],A[4],b),m(A[4],A[4],y),m(A[5],r,t),o(A[5],A[5],b),m(A[5],A[5],y),o(A[6],r,t),m(A[6],A[6],b),m(A[6],A[6],y),m(A[7],r,t),m(A[7],A[7],b),m(A[7],A[7],y),w&&p(w,16)){const e=w;for(let r=0;r<8;++r)n(A[r],A[r],e)}const R=a(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),S=a(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE);for(let o=0;o<8;++o)_||l(A[o],x,0,A[o],u.WGS84,0),s(S,S,A[o]),i(R,R,A[o]);return new c({xmin:S[0],ymin:S[1],zmin:S[2],xmax:R[0],ymax:R[1],zmax:R[2],spatialReference:E})}return new c(-180,-90,180,90,E)}export{A as initFullExtent,p as verifyArray};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/core",
3
- "version": "4.34.0-next.62",
3
+ "version": "4.34.0-next.65",
4
4
  "homepage": "https://js.arcgis.com",
5
5
  "description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
6
6
  "keywords": [
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as r}from"tslib";import o from"../../core/Accessor.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as t}from"../../core/accessorSupport/decorators/subclass.js";let e=class extends o{constructor(r){super(r),this.hasError=!1,this.error=null,this.editResults=[]}};r([s()],e.prototype,"hasError",void 0),r([s()],e.prototype,"error",void 0),r([s()],e.prototype,"editResults",void 0),e=r([t("esri.rest.knowledgeGraph.GraphApplyEditsResult")],e);const p=e;export{p as default};
5
+ import{__decorate as e}from"tslib";import o from"../../core/Accessor.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";let t=class extends o{constructor(e){super(e),this.hasError=!1,this.error=null,this.editResults=[],this.cascadeRelationshipDeleteResults=[],this.cascadeProvenanceDeleteResults=[]}};e([r()],t.prototype,"hasError",void 0),e([r()],t.prototype,"error",void 0),e([r()],t.prototype,"editResults",void 0),e([r()],t.prototype,"cascadeRelationshipDeleteResults",void 0),e([r()],t.prototype,"cascadeProvenanceDeleteResults",void 0),t=e([s("esri.rest.knowledgeGraph.GraphApplyEditsResult")],t);const p=t;export{p as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import t from"../GraphApplyEditsResult.js";import{wasmErrorToEsriError as e}from"./wasmUtils.js";function r(r){const s=r.has_error(),_=new t({hasError:s,error:s?e(r.error):null}),o=r.get_edit_results_count();for(let t=0;t<o;t++){const s=r.get_edit_results_at(t),o=r.get_edit_results_type_name_at(t),u=[],d=[],l=[],a=s.get_add_results_count(),i=s.get_update_results_count(),n=s.get_delete_results_count();for(let t=0;t<a;t++){const r=s.get_add_result_at(t);u.push({id:r.id,error:e(r.error)})}for(let t=0;t<i;t++){const r=s.get_update_result_at(t);d.push({id:r.id,error:e(r.error)})}for(let t=0;t<n;t++){const r=s.get_delete_result_at(t);l.push({id:r.id,error:e(r.error)})}_.editResults.push({typeName:o,adds:u,updates:d,deletes:l})}return _}export{r as decoderToApplyEditsResponse};
5
+ import e from"../GraphApplyEditsResult.js";import{wasmErrorToEsriError as t}from"./wasmUtils.js";function r(r){const s=r.has_error(),_=new e({hasError:s,error:s?t(r.error):null}),d=r.get_edit_results_count();for(let e=0;e<d;e++){const s=r.get_edit_results_at(e);s.deleteLater();const d=r.get_edit_results_type_name_at(e),o=[],a=[],l=[],n=s.get_add_results_count(),c=s.get_update_results_count(),u=s.get_delete_results_count();for(let e=0;e<n;e++){const r=s.get_add_result_at(e);r.deleteLater(),o.push({id:r.id,error:t(r.error)})}for(let e=0;e<c;e++){const r=s.get_update_result_at(e);r.deleteLater(),a.push({id:r.id,error:t(r.error)})}for(let e=0;e<u;e++){const r=s.get_delete_result_at(e);r.deleteLater(),l.push({id:r.id,error:t(r.error)})}_.editResults.push({typeName:d,adds:o,updates:a,deletes:l})}const o=r.get_cascaded_rel_deletes_count();for(let e=0;e<o;e++){const s=r.get_cascaded_rel_deletes_at(e);s.deleteLater();const d=r.get_cascaded_rel_deletes_type_name_at(e),o=[];for(let e=0;e<s.get_count();e++){const r=s.get_result_at(e);r.deleteLater(),o.push({id:r.id,originId:r.origin_id,destinationId:r.dest_id,error:t(r.error)})}_.cascadeRelationshipDeleteResults.push({typeName:d,cascadeRelationshipDeletes:o})}if(r.has_cascading_provenance_deletes()){const e=r.get_cascading_provenance_deletes();e.deleteLater();const s=e.get_count();for(let r=0;r<s;r++){const s=e.get_result_at(r);s.deleteLater(),_.cascadeProvenanceDeleteResults.push({id:s.id,error:t(s.error)})}}return _}export{r as decoderToApplyEditsResponse};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{id as e}from"../kernel.js";import t from"../request.js";import r from"../core/Error.js";import a from"../core/Logger.js";import{isAbortError as n}from"../core/promiseUtils.js";import{asArrayBuffer as o}from"../core/typedArrayUtil.js";import d from"../geometry/Geometry.js";import i from"../geometry/SpatialReference.js";import{submitJob as s}from"./geoprocessor/submitJob.js";import p from"./knowledgeGraph/GraphQueryResult.js";import c from"./knowledgeGraph/GraphQueryResultHeader.js";import l from"./knowledgeGraph/GraphQueryStreamingResult.js";import u from"./knowledgeGraph/KnowledgeGraph.js";import h from"./knowledgeGraph/ServiceDefinition.js";import{encodeClientDataAtKeysRequest as w}from"./knowledgeGraph/wasmInterface/clientDataToWasmEncodedFactories.js";import{getWasmInterface as g}from"./knowledgeGraph/wasmInterface/knowledgeWasmAccess.js";import{bindParamArrayToWasm as y,setInputQuantizationParametersOnEncoder as f,setOutputQuantizationParametersOnEncoder as m,setProvenanceBehaviorOnEncoder as _,geometryToWasm as k,bindParamObjectToWasm as G}from"./knowledgeGraph/wasmInterface/queryToWasmEncodedFactories.js";import{updateSearchPropertiesToWasm as b,fieldIndexToWasm as x,updateGraphPropertyToWasm as T,graphPropertyToWasm as v,updateEntityTypeToWasm as A,updateRelationshipTypeToWasm as S,entityTypeToWasm as P,relationshipTypeToWasm as D,inputQuantizationParametersToWasmFormat as R,namedObjectToWasm as E}from"./knowledgeGraph/wasmInterface/updateToWasmEncodedFactories.js";import{wasmClientDataAllKeysResponseToClientDataKeys as I,wasmClientDataFetchResponseToClientData as q}from"./knowledgeGraph/wasmInterface/wasmToClientDataFactories.js";import{decoderToAddNamedTypesResult as C,decoderToDeleteNamedTypeResult as F,decoderToUpdateNamedTypesResult as M,decoderToAddGraphPropertiesResult as j,decoderToDeleteGraphPropertiesResult as U,decoderToUpdateGraphPropertiesResult as N,decoderToGraphAddIndexResult as K,decoderToGraphDeleteIndexResult as Q,decoderToGraphUpdateSearchIndexResult as $}from"./knowledgeGraph/wasmInterface/wasmToDataModelChangeResponseFactories.js";import{wasmToDataModel as L}from"./knowledgeGraph/wasmInterface/wasmToDataModelFactories.js";import{wasmToGraphQueryResponseHeader as O,decodedWasmObjToQueryResponseObj as W}from"./knowledgeGraph/wasmInterface/wasmToQueryResponseObjFactories.js";import{decoderToApplyEditsResponse as H}from"./knowledgeGraph/wasmInterface/wasmToUpdateResponseFactories.js";import{checkWasmError as z}from"./knowledgeGraph/wasmInterface/wasmUtils.js";const B=new Map,J=()=>new Map(B.entries()),V={fetchKnowledgeGraph:async e=>{const t=new u({url:e}),r=[];return r.push(we(t)),r.push(ge(t)),await Promise.all(r),t},refreshDataModel:async e=>{e.dataModel=await Xe(e)},refreshServiceDefinition:async e=>{const r=(await t(e.url,{query:{f:"json"}})).data;return r.capabilities=r?.capabilities?.split(","),r.supportedQueryFormats=r?.supportedQueryFormats?.split(","),e.serviceDefinition=new h(r),e.serviceDefinition},executeFindPathsAsynchronous:async(e,t)=>{const a=e.inKnowledgeGraphUrl.split("/rest/services");if(a.length<2)throw new r("knowledge-graph:invalid-tool-url","The URL for the KG Service was not correctly formatted. It should contain /rest/services/");const n=a[0],o=(await be(`${n}/rest/info`,{query:{f:"json"}})).data.currentVersion,d=`/rest/services/${o&&o<12?"System":"Utilities"}/KnowledgeGraphServerToolsAsync/GPServer/ServerFilteredFindPaths`;return await Ge(`${n}${d}`,{in_knowledge_graph_url:e.inKnowledgeGraphUrl,config_type:"STRING",config_string:e.config.toJSON(),result_type:"STRING"},{},t)},executeFindPaths:async(e,t)=>{const a=e.inKnowledgeGraphUrl.split("/rest/services");if(a.length<2)throw new r("knowledge-graph:invalid-tool-url","The URL for the KG Service was not correctly formatted. It should contain /rest/services/");const n=a[0],o=(await be(`${n}/rest/info`,{query:{f:"json"}})).data.currentVersion,d=`/rest/services/${o&&o<12?"System":"Utilities"}/KnowledgeGraphServerTools/GPServer/ServerFilteredFindPaths/execute`,i=await be(`${n}${d}`,{method:"post",query:{f:"pjson",in_knowledge_graph_url:e.inKnowledgeGraphUrl,config_type:"STRING",config_string:JSON.stringify(e.config),result_type:"STRING"},...t});if(i.data.results.length<1)throw new r("knowledge-graph:no-results","No results were returned from the FindPaths tool - no results returned",i);let s;for(const r of i.data.results)if("out_results_string"===r.paramName){s=r.value;break}if(!s)throw new r("knowledge-graph:no-results","No results were returned from the FindPaths tool - no results were returned on the expected paramater out_results_string",i);return s},fetchAsynchronousFindPathsResultData:async(e,t)=>(await e.fetchResultData("out_results_string",null,t)).value,executeQueryStreaming:async(e,t,a)=>{const n="include",o=`${e.url}/graph/query`;await xe(e);const d=await Me(o,a);if(!e.serviceDefinition?.supportsProvenance&&t.provenanceBehavior===n)throw new r("knowledge-graph:provenance-not-supported","The Knowledge Graph Service definition indicated that provenance is not supported");d.data.body=await Ce(t,e);const i=await ke(d.data.url,d.data);if(e.dataModel){const t=await Ye(i,e.dataModel);return new l({resultRowsStream:t.readableStream,resultHeader:t.resultHeader})}throw new r("knowledge-graph:undefined-data-model","The KnowledgeGraph supplied did not have a data model")},executeApplyEdits:async(e,t,a)=>{if(e.serviceDefinition?.dataEditingNotSupported)throw new r("knowledge-graph:data-editing-not-supported","The Knowledge Graph Service definition indicated that data editing is not supported");const n=`${e.url}/graph/applyEdits`;await xe(e);const o=await Me(n,a);o.data.body=await ve(t,e);return Ue(await ke(o.data.url,o.data))},executeAddNamedTypes:async(e,t,a)=>{if(!t.newEntityTypes?.length&&!t.newRelationshipTypes?.length)throw new r("knowledge-graph:no-arguments","The operation to add types to the data model contained no values");const n=`${e.url}/dataModel/edit/namedTypes/add`;await xe(e);const o=await Me(n,a);o.data.body=await Ae(t);const d=await ke(o.data.url,o.data),i=await Ne(d);return i.updatedKnowledgeGraph=await he(e.url),i},executeDeleteNamedType:async(e,t,a)=>{if(!t)throw new r("knowledge-graph:no-arguments","The operation to delete a named type from the data model contained no value");const n=`${e.url}/dataModel/edit/namedTypes/${t}/delete`;await xe(e);const o=await Me(n,a);o.data.body="";const d=await ke(o.data.url,o.data),i=await Ke(d);return i.updatedKnowledgeGraph=await he(e.url),i},executeUpdateNamedType:async(e,t,a,n)=>{if(!t&&!Object.keys(a).length)throw new r("knowledge-graph:no-arguments","The operation to update types in the data model contained missing or empty values");const o=`${e.url}/dataModel/edit/namedTypes/${t}/update`;await xe(e);const d=await Me(o,n);d.data.body=await Se(a,t,e.dataModel);const i=await ke(d.data.url,d.data),s=await Qe(i);return s.updatedKnowledgeGraph=await he(e.url),s},executeAddGraphProperties:async(e,t,a,n)=>{if(!t&&!a.length)throw new r("knowledge-graph:no-arguments","The operation to add properties to the data model contained missing or empty values");const o=`${e.url}/dataModel/edit/namedTypes/${t}/fields/add`;await xe(e);const d=await Me(o,n);d.data.body=await Pe(a);const i=await ke(d.data.url,d.data),s=await $e(i);return s.updatedKnowledgeGraph=await he(e.url),s},executeDeleteGraphProperty:async(e,t,a,n)=>{if(!t&&!a)throw new r("knowledge-graph:no-arguments","The operation to delete property contained missing or empty values");const o=`${e.url}/dataModel/edit/namedTypes/${t}/fields/delete`;await xe(e);const d=await Me(o,n);d.data.body=await De(a);const i=await ke(d.data.url,d.data),s=await Le(i);return s.updatedKnowledgeGraph=await he(e.url),s},executeUpdateGraphProperty:async(e,t,a,n,o)=>{if(!t&&!a&&!Object.keys(n).length)throw new r("knowledge-graph:no-arguments","The operation to update properties in the data model contained missing or empty values");const d=`${e.url}/dataModel/edit/namedTypes/${t}/fields/update`;await xe(e);const i=await Me(d,o);i.data.body=await Re(a,n);const s=await ke(i.data.url,i.data),p=await Oe(s);return p.updatedKnowledgeGraph=await he(e.url),p},executeAddGraphFieldIndex:async(e,t,a,n)=>{if(!t)throw new r("knowledge-graph:no-arguments","The operation to update search index in the data model contained missing named type");if(!a?.length)throw new r("knowledge-graph:no-arguments","The operation to update search index in the data model contained missing or empty field index values");const o=`${e.url}/dataModel/edit/namedTypes/${t}/indexes/add`;await xe(e);const d=await Me(o,n);d.data.body=await Ee(a);const i=await ke(d.data.url,d.data),s=await We(i);return s.updatedKnowledgeGraph=await he(e.url),s},executeDeleteGraphFieldIndex:async(e,t,a,n)=>{if(!t)throw new r("knowledge-graph:no-arguments","The operation to update search index in the data model contained missing named type");if(!a?.length)throw new r("knowledge-graph:no-arguments","The operation to update search index in the data model contained missing or empty field index values");const o=`${e.url}/dataModel/edit/namedTypes/${t}/indexes/delete`;await xe(e);const d=await Me(o,n);d.data.body=await Ie(a);const i=await ke(d.data.url,d.data),s=await He(i);return s.updatedKnowledgeGraph=await he(e.url),s},executeUpdateSearchIndex:async(e,t,a,n)=>{if(!t)throw new r("knowledge-graph:no-arguments","The operation to update search index in the data model contained missing named type");if(!Object.keys(a.addSearchProperties??{}).length&&!Object.keys(a.removeSearchProperties??{}).length)throw new r("knowledge-graph:no-arguments","The operation to update search index in the data model contained missing or empty properties values");const o=`${e.url}/dataModel/searchIndex/update`;await xe(e);const d=await Me(o,n);d.data.body=await qe(t,a);const i=await ke(d.data.url,d.data),s=await ze(i);return s.updatedKnowledgeGraph=await he(e.url),s},executeQuery:async(e,a,n)=>{const o=`${e.url}/graph/query`,d=await t(o,{responseType:"array-buffer",query:{f:"pbf",openCypherQuery:a.openCypherQuery,...n?.query},signal:n?.signal,timeout:n?.timeout}),i=d.getHeader?.("content-type"),s=d.data;if(i?.includes("application/x-protobuf")){const t=new((await g()).GraphQueryDecoder);if(t.deleteLater(),e.dataModel){const r=Ve({wasmQueryDecoder:t,newArrayBufferToParse:s,dataModel:e.dataModel});return new p({resultRows:r.resultRows,resultHeader:r.resultHeader})}throw new r("knowledge-graph:undefined-data-model","The KnowledgeGraph supplied did not have a data model")}throw new r("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:i,data:d.data})},executeSearch:async(e,a,n)=>{const o=a.typeCategoryFilter,d=`${e.url}/graph/search`,i=await t(d,{responseType:"array-buffer",query:{f:"pbf",searchQuery:`"${a.searchQuery}"`,typeCategoryFilter:o,...n?.query},signal:n?.signal,timeout:n?.timeout}),s=i.getHeader?.("content-type"),c=i.data;if(s?.includes("application/x-protobuf")){const t=new((await g()).GraphQueryDecoder);if(t.deleteLater(),e.dataModel){const r=Ve({wasmQueryDecoder:t,newArrayBufferToParse:c,dataModel:e.dataModel});return new p({resultRows:r.resultRows,resultHeader:r.resultHeader})}throw new r("knowledge-graph:undefined-data-model","The KnowledgeGraph supplied did not have a data model")}throw new r("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:s,data:i.data})},executeSearchStreaming:async(e,t,a)=>{const n=`${e.url}/graph/search`;await xe(e);const o=await Me(n,a);o.data.body=await Fe(t);const d=await ke(o.data.url,o.data);if(e.dataModel){const t=await Ye(d,e.dataModel);return new l({resultRowsStream:t.readableStream,resultHeader:t.resultHeader})}throw new r("knowledge-graph:undefined-data-model","The KnowledgeGraph supplied did not have a data model")},fetchClientDataAtKeys:async(e,t,a={ignoreCache:!1})=>{if(!t.length)return new Map;let n=B.get(e.url||"");n||(n=new Map,B.set(e.url||"",n));const o=new Map(n.entries()),d=`${e.url}/clientData/fetch`;t=Array.from(new Set(t));const i=await g(),s=w(t,n,i,a.ignoreCache),p=await Me(d,a.requestOptions);p.data.body=s;const c=await ke(p.data.url,p.data),l=c.headers.get("content-type");if(l?.includes("application/x-protobuf")){const e=new i.ClientDataFetchResponseDecoder;e.deleteLater();const t=await c.arrayBuffer();return e.decode(new Uint8Array(t)),e.has_error()&&z(e.error,"knowledge-graph:fetchClientDataAtKeys-decoding-error","An error occurred while decoding the client data keys response"),q(e,n,o,a.ignoreCache)}throw new r("knowledge-graph:unexpected-server-response","server returned an unexpected response when fetching client data",{responseType:l,data:c})},fetchAllClientDataKeys:async(e,a)=>{const n=`${e.url}/clientData`,o=await t(n,{responseType:"array-buffer",query:{f:"pbf"},signal:a?.signal,timeout:a?.timeout}),d=o.getHeader?.("content-type"),i=o.data;if(d?.includes("application/x-protobuf")){const e=new((await g()).ClientDataKeysResponseDecoder);return e.deleteLater(),e.decode(new Uint8Array(i)),e.has_error()&&z(e.error,"knowledge-graph:fetchAllClientDataKeys-decoding-error","An error occurred while decoding the client data keys response"),I(e)}throw new r("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:d,data:o.data})},clearClientDataCache:()=>B.clear(),_fetchWrapper:async(e,t)=>fetch(e,t),_submitJobWrapper:async(e,t,r,a)=>s(e,t,r,a),_esriRequestWrapper:async(e,r)=>t(e,r)};async function Y(e,t,r){return V.executeApplyEdits(e,t,r)}async function X(e,t,r){return V.executeAddNamedTypes(e,t,r)}async function Z(e,t,r){return V.executeDeleteNamedType(e,t,r)}async function ee(e,t,r,a){return V.executeUpdateNamedType(e,t,r,a)}async function te(e,t,r,a){return V.executeAddGraphProperties(e,t,r,a)}async function re(e,t,r,a){return V.executeDeleteGraphProperty(e,t,r,a)}async function ae(e,t,r,a,n){return V.executeUpdateGraphProperty(e,t,r,a,n)}async function ne(e,t,r,a){return V.executeAddGraphFieldIndex(e,t,r,a)}async function oe(e,t,r,a){return V.executeDeleteGraphFieldIndex(e,t,r,a)}async function de(e,t,r,a){return V.executeUpdateSearchIndex(e,t,r,a)}async function ie(e,t,r){return V.executeQuery(e,t,r)}async function se(e,t,r){return V.executeQueryStreaming(e,t,r)}async function pe(e,t,r){return V.executeSearch(e,t,r)}async function ce(e,t,r){return V.executeSearchStreaming(e,t,r)}function le(e,t){return V.fetchAllClientDataKeys(e,t)}function ue(e,t,r){return V.fetchClientDataAtKeys(e,t,r)}async function he(e){return V.fetchKnowledgeGraph(e)}async function we(e){return V.refreshDataModel(e)}async function ge(e){return V.refreshServiceDefinition(e)}async function ye(e,t){return V.executeFindPathsAsynchronous(e,t)}async function fe(e,t){return V.executeFindPaths(e,t)}async function me(e,t){return V.fetchAsynchronousFindPathsResultData(e,t)}function _e(){return V.clearClientDataCache()}async function ke(e,t){return V._fetchWrapper(e,t)}async function Ge(e,t,r,a){return V._submitJobWrapper(e,t,r,a)}async function be(e,t){return V._esriRequestWrapper(e,t)}async function xe(t){const r=e?.findCredential(t.url);r||(t.dataModel?await Xe(t):await we(t))}function Te(e,t,r,a){null==t?r.set_param_key_value(e,""):"object"!=typeof t||t instanceof Date?r.set_param_key_value(e,t):t instanceof d?r.set_param_key_value(e,k(t,a)):Array.isArray(t)?r.set_param_key_value(e,y(t,a)):r.set_param_key_value(e,G(t,a))}async function ve(e,t){if(t.dataModel||await we(t),!t.dataModel)throw new r("knowledge-graph:data-model-undefined","Encoding could not proceed because a data model was not provided and it could not be determined from the service");const a=await g(),n=!!e.options?.cascadeDelete,d=new a.GraphApplyEditsEncoder(a.SpatialReferenceUtil.WGS84(),e.options?.inputQuantizationParameters?R(e.options?.inputQuantizationParameters):a.InputQuantizationUtil.WGS84_lossless());d.deleteLater(),d.cascade_delete=n;try{let t;e.entityAdds?.forEach(e=>{t=d.add_entity(E(e,a)),z(t,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits - an entity failed to be added to the encoder")}),e.relationshipAdds?.forEach(e=>{if(!e.originId||!e.destinationId)throw new r("knowledge-graph:relationship-origin-destination-missing","When adding a new relationship, you must provide both an origin and destination id on the appropriate class property");t=d.add_relationship(E(e,a)),z(t,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits - a relationship failed to be added to the encoder")}),e.entityUpdates?.forEach(e=>{if(!e.id)throw new r("knowledge-graph:entity-id-missing","When updating an entity or relationship, you must specify the id on the class level property");t=d.update_entity(E(e,a)),z(t,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits - an entity failed to be added to the encoder")}),e.relationshipUpdates?.forEach(e=>{if(!e.id)throw new r("knowledge-graph:relationship-id-missing","When updating an entity or relationship, you must specify the id on the class level property");t=d.update_relationship(E(e,a)),z(t,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits - a relationship failed to be added to the encoder")}),e.entityDeletes?.forEach(e=>{if(!e.typeName)throw new r("knowledge-graph:no-type-name","You must indicate the entity/relationship named object type to apply edits - delete");const t=d.make_delete_helper(e.typeName,!0);t.deleteLater(),e.ids?.forEach(e=>{t.delete_by_id(e)})}),e.relationshipDeletes?.forEach(e=>{if(!e.typeName)throw new r("knowledge-graph:no-type-name","You must indicate the entity/relationship named object type to apply edits - delete");const t=d.make_delete_helper(e.typeName,!1);e.ids?.forEach(e=>{t.delete_by_id(e)})}),d.encode()}catch(s){throw new r("knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits failed",{error:s})}const i=d.get_encoding_result();return z(i.error,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits failed"),o(structuredClone(i.get_byte_buffer()))}async function Ae(e){const t=await g(),a=new t.GraphNamedObjectTypeAddsRequestEncoder;a.deleteLater(),e.newEntityTypes?.forEach(e=>{a.add_entity_type(P(e,t))}),e.newRelationshipTypes?.forEach(e=>{a.add_relationship_type(D(e,t))});try{a.encode()}catch(d){throw new r("knowledge-graph:addNamedTypes-encoding-failed","Attempting to encode the addNamedTypes failed",{error:d})}const n=a.get_encoding_result();return z(n.error,"knowledge-graph:addNamedTypes-encoding-failed","Attempting to encode the addNamedTypes failed"),o(structuredClone(n.get_byte_buffer()))}async function Se(e,t,a){const n=await g(),d=new n.GraphNamedObjectTypeUpdateRequestEncoder;d.deleteLater();if(a.entityTypes.some(e=>e.name===t))d.update_entity_type(A(e,n));else{if(!a.relationshipTypes.some(e=>e.name===t))throw new r("knowledge-graph:updateNamedType-encoding-failed","The named type you are trying to update does not exist in the data model");d.update_relationship_type(S(e,n))}d.update_alias=e.hasOwnProperty("alias");try{d.encode()}catch(s){throw new r("knowledge-graph:updateNamedType-encoding-failed","Attempting to encode the updateNamedType failed",{error:s})}const i=d.get_encoding_result();return z(i.error,"knowledge-graph:updateNamedType-encoding-failed","Attempting to encode the updateNamedType failed"),o(structuredClone(i.get_byte_buffer()))}async function Pe(e){const t=await g(),a=new t.GraphPropertyAddsRequestEncoder;a.deleteLater(),e.forEach(e=>{a.add_graph_property(v(e,t))});try{a.encode()}catch(d){throw new r("knowledge-graph:addGraphProperties-encoding-failed","Attempting to encode the addGraphProperties failed",{error:d})}const n=a.get_encoding_result();return z(n.error,"knowledge-graph:addGraphProperties-encoding-failed","Attempting to encode the addGraphProperties failed"),o(structuredClone(n.get_byte_buffer()))}async function De(e){const t=new((await g()).GraphPropertyDeleteRequestEncoder);t.deleteLater(),t.field_name=e;try{t.encode()}catch(n){throw new r("knowledge-graph:deleteGraphProperty-encoding-failed","Attempting to encode the deleteGraphProperty failed",{error:n})}const a=t.get_encoding_result();return z(a.error,"knowledge-graph:deleteGraphProperty-encoding-failed","Attempting to encode the deleteGraphProperty failed"),o(structuredClone(a.get_byte_buffer()))}async function Re(e,t){const a=await g(),n=new a.GraphPropertyUpdateRequestEncoder;n.deleteLater(),n.update_graph_property(T(t,a)),n.set_property_name(e),n.update_alias=t.hasOwnProperty("alias"),n.update_editable=t.hasOwnProperty("editable"),n.update_required=t.hasOwnProperty("required"),n.update_visible=t.hasOwnProperty("defaultVisibility"),n.update_default_value=t.hasOwnProperty("defaultValue");try{n.encode()}catch(i){throw new r("knowledge-graph:updateGraphProperty-encoding-failed","Attempting to encode the updateGraphProperty failed",{error:i})}const d=n.get_encoding_result();return z(d.error,"knowledge-graph:updateGraphProperty-encoding-failed","Attempting to encode the updateGraphProperty failed"),o(structuredClone(d.get_byte_buffer()))}async function Ee(e){const t=await g(),a=new t.GraphIndexAddsRequestEncoder;a.deleteLater(),e.forEach(e=>{a.add_field_index(x(e,t))});try{a.encode()}catch(d){throw new r("knowledge-graph:addGraphFieldIndex-encoding-failed","Attempting to encode the addGraphFieldIndex failed",{error:d})}const n=a.get_encoding_result();return z(n.error,"knowledge-graph:addGraphFieldIndex-encoding-failed","Attempting to encode the addGraphFieldIndex failed"),o(structuredClone(n.get_byte_buffer()))}async function Ie(e){const t=new((await g()).GraphIndexDeleteRequestEncoder);t.deleteLater(),e.forEach(e=>{t.add_index_name(e)});try{t.encode()}catch(n){throw new r("knowledge-graph:deleteGraphFieldIndex-encoding-failed","Attempting to encode the deleteGraphFieldIndex failed",{error:n})}const a=t.get_encoding_result();return z(a.error,"knowledge-graph:deleteGraphFieldIndex-encoding-failed","Attempting to encode the deleteGraphFieldIndex failed"),o(structuredClone(a.get_byte_buffer()))}async function qe(e,t){const a=await g(),n=new a.GraphUpdateSearchIndexRequestEncoder;n.deleteLater(),t.hasOwnProperty("addSearchProperties")&&n.insert_add_search_property(e,b(t.addSearchProperties,a)),t.hasOwnProperty("removeSearchProperties")&&n.insert_delete_search_property(e,b(t.removeSearchProperties,a));try{n.encode()}catch(i){throw new r("knowledge-graph:updateSearchIndex-encoding-failed","Attempting to encode the updateSearchIndex failed",{error:i})}const d=n.get_encoding_result();return z(d.error,"knowledge-graph:updateSearchIndex-encoding-failed","Attempting to encode the updateSearchIndex failed"),o(structuredClone(d.get_byte_buffer()))}async function Ce(e,t){const a=await g(),n=new a.GraphQueryRequestEncoder;if(n.deleteLater(),e.outputSpatialReference?n.output_spatial_reference={wkid:e.outputSpatialReference.wkid,latestWkid:e.outputSpatialReference.latestWkid,vcsWkid:e.outputSpatialReference.vcsWkid,latestVcsWkid:e.outputSpatialReference.latestVcsWkid,wkt:e.outputSpatialReference.wkt??""}:n.output_spatial_reference=a.SpatialReferenceUtil.WGS84(),n.open_cypher_query=e.openCypherQuery,e.bindParameters)for(const[r,o]of Object.entries(e.bindParameters))Te(r,o,n,a);if(e.bindGeometryQuantizationParameters)f(e.bindGeometryQuantizationParameters,n);else{if(t.dataModel||await we(t),4326!==t.dataModel?.spatialReference?.wkid)throw new r("knowledge-graph:SR-quantization-mismatch","If the DataModel indicates a coordinate system other than WGS84, inputQuantizationParameters must be provided to the query encoder");n.input_quantization_parameters=a.InputQuantizationUtil.WGS84_lossless()}e.outputQuantizationParameters&&m(e.outputQuantizationParameters,n,a),e.provenanceBehavior&&_(e.provenanceBehavior,n);try{n.encode()}catch(i){throw new r("knowledge-graph:query-encoding-failed","Attempting to encode the query failed",{error:i})}const d=n.get_encoding_result();if(0!==d.error.error_code)throw new r("knowledge-graph:query-encoding-failed","Attempting to encode the query failed",{errorCode:d.error.error_code,errorMessage:d.error.error_message});return o(structuredClone(d.get_byte_buffer()))}async function Fe(e){const t=await g(),a=new t.GraphSearchRequestEncoder;if(a.deleteLater(),a.search_query=e.searchQuery,a.type_category_filter=t.esriNamedTypeCategory[e.typeCategoryFilter],!0===e.returnSearchContext&&(a.return_search_context=e.returnSearchContext),null!=e.start&&e.start>0&&(a.start_index=e.start),null!=e.num&&(a.max_num_results=e.num),null!=e.idsFilter&&Array.isArray(e.idsFilter)&&e.idsFilter.length>0)try{a.set_ids_filter(y(e.idsFilter,t))}catch(d){throw new r("knowledge-graph:ids-format-error","Attempting to set ids filter failed. This is usually caused by an incorrectly formatted UUID string",{error:d})}e.namedTypesFilter?.forEach(e=>{a.add_named_type_filter(e)});try{a.encode()}catch(d){throw new r("knowledge-graph:search-encoding-failed","Attempting to encode the search failed",{error:d})}const n=a.get_encoding_result();if(0!==n.error.error_code)throw new r("knowledge-graph:search-encoding-failed","Attempting to get encoding result from the query failed",{errorCode:n.error.error_code,errorMessage:n.error.error_message});return o(structuredClone(n.get_byte_buffer()))}async function Me(e,r){return t(e,{responseType:"native-request-init",method:"post",query:{f:"pbf",...r?.query},body:"x",headers:{"Content-Type":"application/octet-stream"},signal:r?.signal,timeout:r?.timeout})}async function je(e,t,a){const n=e.headers.get("content-type");if(n?.includes("application/x-protobuf")){const r=await e.arrayBuffer(),n=new t;try{return n.decode(new Uint8Array(r)),a(n)}finally{n.deleteLater()}}throw new r("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:n,data:await e.text()})}async function Ue(e){return je(e,(await g()).GraphApplyEditsDecoder,H)}async function Ne(e){return je(e,(await g()).GraphNamedObjectTypeAddsResponseDecoder,C)}async function Ke(e){return je(e,(await g()).GraphNamedObjectTypeDeleteResponseDecoder,F)}async function Qe(e){return je(e,(await g()).GraphNamedObjectTypeUpdateResponseDecoder,M)}async function $e(e){return je(e,(await g()).GraphPropertyAddsResponseDecoder,j)}async function Le(e){return je(e,(await g()).GraphPropertyDeleteResponseDecoder,U)}async function Oe(e){return je(e,(await g()).GraphPropertyUpdateResponseDecoder,N)}async function We(e){return je(e,(await g()).GraphIndexAddsResponseDecoder,K)}async function He(e){return je(e,(await g()).GraphIndexDeleteResponseDecoder,Q)}async function ze(e){return je(e,(await g()).GraphUpdateSearchIndexResponseDecoder,$)}let Be=50;function Je(e){Be=e}function Ve({wasmQueryDecoder:e,newArrayBufferToParse:t,dataModel:a,decodedHeader:n,limitMaxProcessingTime:o=!1}){t&&e.push_buffer(new Uint8Array(t));const d=[];let s,p,c=0;const l=Date.now();let u=!0;for(;e.next_row();){s&&p||(s=n??O(e),p=s.outSpatialReference??new i({wkid:4326})),c||(c=e.get_header_keys().size());const t=new Array(c);for(let r=0;r<c;r++){const n=e.get_value(r);t[r]=W(n,a,p)}if(d.push(t),o&&Date.now()-l>Be){u=!1;break}}if(e.has_error())throw new r("knowledge-graph:stream-decoding-error","One or more result rows were not successfully decoded - inner row decoding",{errorCode:e.error.error_code,errorMessage:e.error.error_message});return{resultHeader:s,resultRows:d,parsedAllResultsFromBuffer:u}}async function Ye(e,t){const o=e.headers.get("content-type");if(e.headers.get("content-length")&&a.getLogger("esri.rest.knowledgeGraph.knowledgeGraphService").warnOnce("Found `Content-Length` header when expecting a streaming HTTP response! Please investigate whether all intermediate HTTP proxies and/or load balancers are configured such that they don't forcefully buffer the entire response before returning it to the client. A valid HTTP streaming response should use Chunked Transfer Encoding and not have a Content Length defined."),o?.includes("application/x-protobuf")){const o=e.body?.getReader(),d=new((await g()).GraphQueryDecoder);let i,s,p;d.deleteLater();const l=new Promise((e,t)=>{s=e,p=t});let u=!1,h=null;const w=new ReadableStream({pull:async function e(l){if(!o){const e=new r("knowledge-graph:stream-decoding-error","Error reading from stream - reader is undefined");throw p(e),e}const{done:w,value:g}=h?{done:!1,value:null}:await o.read().catch(e=>{throw p(e),o.releaseLock(),e});g&&(h=g);try{if(w){let e;if(d.has_error()?e=new r("knowledge-graph:stream-decoding-error","One or more result rows were not successfully decoded - query stream done",{errorCode:d.error.error_code,errorMessage:d.error.error_message}):u||s(new c),o.releaseLock(),e)throw l.error(e),p(e),e;return void l.close()}const{resultHeader:a,resultRows:n,parsedAllResultsFromBuffer:y}=Ve({wasmQueryDecoder:d,newArrayBufferToParse:g,dataModel:t,decodedHeader:i,limitMaxProcessingTime:!0});return y&&(h=null),!i&&a&&(i=a,s(a),u=!0),n.length>0?void l.enqueue(n):await e(l)}catch(y){throw a.getLogger("esri.rest.knowledgeGraph.knowledgeGraphService").error(y),p(y),o.releaseLock(),n(y)?y:new r("knowledge-graph:unexpected-server-response","Error inside streaming data return parsing",{error:y})}}});return{readableStream:w,resultHeader:await l}}throw new r("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:o,data:e.text()})}async function Xe(e){const a=`${e.url}/dataModel/queryDataModel`,n=await t(a,{responseType:"array-buffer",query:{f:"pbf"}}),o=n.getHeader?.("content-type"),d=n.data;if(o?.includes("application/x-protobuf")){const e=(await g()).decode_data_model_from_protocol_buffer(new Uint8Array(d));if(!e)throw new r("knowledge-graph:data-model-decode-failure","The server responded to the data model query, but the response failed to be decoded. This typically occurs when the Knowledge JS API (4.26 or later) is used with an unsupported backend (11.0 or earlier)");return L(e)}throw new r("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:o,data:n.data})}export{xe as _checkAuthentication,be as _esriRequestWrapper,ke as _fetchWrapper,J as _getClientDataCacheCopy,Je as _setMaxQueryParsingDurationForTesting,Ge as _submitJobWrapper,_e as clearClientDataCache,B as clientDataCache,ne as executeAddGraphFieldIndex,te as executeAddGraphProperties,X as executeAddNamedTypes,Y as executeApplyEdits,oe as executeDeleteGraphFieldIndex,re as executeDeleteGraphProperty,Z as executeDeleteNamedType,fe as executeFindPaths,ye as executeFindPathsAsynchronous,ie as executeQuery,se as executeQueryStreaming,pe as executeSearch,ce as executeSearchStreaming,ae as executeUpdateGraphProperty,ee as executeUpdateNamedType,de as executeUpdateSearchIndex,le as fetchAllClientDataKeys,me as fetchAsynchronousFindPathsResultData,ue as fetchClientDataAtKeys,he as fetchKnowledgeGraph,V as kgRestServices,we as refreshDataModel,ge as refreshServiceDefinition};
5
+ import{id as e}from"../kernel.js";import t from"../request.js";import r from"../core/Error.js";import a from"../core/Logger.js";import{isAbortError as n}from"../core/promiseUtils.js";import o from"../geometry/Geometry.js";import d from"../geometry/SpatialReference.js";import{submitJob as i}from"./geoprocessor/submitJob.js";import s from"./knowledgeGraph/GraphQueryResult.js";import p from"./knowledgeGraph/GraphQueryResultHeader.js";import c from"./knowledgeGraph/GraphQueryStreamingResult.js";import l from"./knowledgeGraph/KnowledgeGraph.js";import u from"./knowledgeGraph/ServiceDefinition.js";import{encodeClientDataAtKeysRequest as h}from"./knowledgeGraph/wasmInterface/clientDataToWasmEncodedFactories.js";import{getWasmInterface as w}from"./knowledgeGraph/wasmInterface/knowledgeWasmAccess.js";import{bindParamArrayToWasm as g,setInputQuantizationParametersOnEncoder as y,setOutputQuantizationParametersOnEncoder as f,setProvenanceBehaviorOnEncoder as m,geometryToWasm as _,bindParamObjectToWasm as k}from"./knowledgeGraph/wasmInterface/queryToWasmEncodedFactories.js";import{updateSearchPropertiesToWasm as G,fieldIndexToWasm as b,updateGraphPropertyToWasm as x,graphPropertyToWasm as T,updateEntityTypeToWasm as v,updateRelationshipTypeToWasm as A,entityTypeToWasm as P,relationshipTypeToWasm as S,inputQuantizationParametersToWasmFormat as D,namedObjectToWasm as R}from"./knowledgeGraph/wasmInterface/updateToWasmEncodedFactories.js";import{wasmClientDataAllKeysResponseToClientDataKeys as E,wasmClientDataFetchResponseToClientData as I}from"./knowledgeGraph/wasmInterface/wasmToClientDataFactories.js";import{decoderToAddNamedTypesResult as q,decoderToDeleteNamedTypeResult as C,decoderToUpdateNamedTypesResult as F,decoderToAddGraphPropertiesResult as M,decoderToDeleteGraphPropertiesResult as j,decoderToUpdateGraphPropertiesResult as U,decoderToGraphAddIndexResult as N,decoderToGraphDeleteIndexResult as K,decoderToGraphUpdateSearchIndexResult as Q}from"./knowledgeGraph/wasmInterface/wasmToDataModelChangeResponseFactories.js";import{wasmToDataModel as $}from"./knowledgeGraph/wasmInterface/wasmToDataModelFactories.js";import{wasmToGraphQueryResponseHeader as L,decodedWasmObjToQueryResponseObj as O}from"./knowledgeGraph/wasmInterface/wasmToQueryResponseObjFactories.js";import{decoderToApplyEditsResponse as W}from"./knowledgeGraph/wasmInterface/wasmToUpdateResponseFactories.js";import{checkWasmError as H}from"./knowledgeGraph/wasmInterface/wasmUtils.js";const z=new Map,B=()=>new Map(z.entries()),J={fetchKnowledgeGraph:async e=>{const t=new l({url:e}),r=[];return r.push(he(t)),r.push(we(t)),await Promise.all(r),t},refreshDataModel:async e=>{e.dataModel=await Ye(e)},refreshServiceDefinition:async e=>{const r=(await t(e.url,{query:{f:"json"}})).data;return r.capabilities=r?.capabilities?.split(","),r.supportedQueryFormats=r?.supportedQueryFormats?.split(","),e.serviceDefinition=new u(r),e.serviceDefinition},executeFindPathsAsynchronous:async(e,t)=>{const a=e.inKnowledgeGraphUrl.split("/rest/services");if(a.length<2)throw new r("knowledge-graph:invalid-tool-url","The URL for the KG Service was not correctly formatted. It should contain /rest/services/");const n=a[0],o=(await Ge(`${n}/rest/info`,{query:{f:"json"}})).data.currentVersion,d=`/rest/services/${o&&o<12?"System":"Utilities"}/KnowledgeGraphServerToolsAsync/GPServer/ServerFilteredFindPaths`;return await ke(`${n}${d}`,{in_knowledge_graph_url:e.inKnowledgeGraphUrl,config_type:"STRING",config_string:e.config.toJSON(),result_type:"STRING"},{},t)},executeFindPaths:async(e,t)=>{const a=e.inKnowledgeGraphUrl.split("/rest/services");if(a.length<2)throw new r("knowledge-graph:invalid-tool-url","The URL for the KG Service was not correctly formatted. It should contain /rest/services/");const n=a[0],o=(await Ge(`${n}/rest/info`,{query:{f:"json"}})).data.currentVersion,d=`/rest/services/${o&&o<12?"System":"Utilities"}/KnowledgeGraphServerTools/GPServer/ServerFilteredFindPaths/execute`,i=await Ge(`${n}${d}`,{method:"post",query:{f:"pjson",in_knowledge_graph_url:e.inKnowledgeGraphUrl,config_type:"STRING",config_string:JSON.stringify(e.config),result_type:"STRING"},...t});if(i.data.results.length<1)throw new r("knowledge-graph:no-results","No results were returned from the FindPaths tool - no results returned",i);let s;for(const r of i.data.results)if("out_results_string"===r.paramName){s=r.value;break}if(!s)throw new r("knowledge-graph:no-results","No results were returned from the FindPaths tool - no results were returned on the expected paramater out_results_string",i);return s},fetchAsynchronousFindPathsResultData:async(e,t)=>(await e.fetchResultData("out_results_string",null,t)).value,executeQueryStreaming:async(e,t,a)=>{const n="include",o=`${e.url}/graph/query`;await be(e);const d=await Fe(o,a);if(!e.serviceDefinition?.supportsProvenance&&t.provenanceBehavior===n)throw new r("knowledge-graph:provenance-not-supported","The Knowledge Graph Service definition indicated that provenance is not supported");d.data.body=await qe(t,e);const i=await _e(d.data.url,d.data);if(e.dataModel){const t=await Ve(i,e.dataModel);return new c({resultRowsStream:t.readableStream,resultHeader:t.resultHeader})}throw new r("knowledge-graph:undefined-data-model","The KnowledgeGraph supplied did not have a data model")},executeApplyEdits:async(e,t,a)=>{if(e.serviceDefinition?.dataEditingNotSupported)throw new r("knowledge-graph:data-editing-not-supported","The Knowledge Graph Service definition indicated that data editing is not supported");const n=`${e.url}/graph/applyEdits`;await be(e);const o=await Fe(n,a);o.data.body=await Te(t,e);return je(await _e(o.data.url,o.data))},executeAddNamedTypes:async(e,t,a)=>{if(!t.newEntityTypes?.length&&!t.newRelationshipTypes?.length)throw new r("knowledge-graph:no-arguments","The operation to add types to the data model contained no values");const n=`${e.url}/dataModel/edit/namedTypes/add`;await be(e);const o=await Fe(n,a);o.data.body=await ve(t);const d=await _e(o.data.url,o.data),i=await Ue(d);return i.updatedKnowledgeGraph=await ue(e.url),i},executeDeleteNamedType:async(e,t,a)=>{if(!t)throw new r("knowledge-graph:no-arguments","The operation to delete a named type from the data model contained no value");const n=`${e.url}/dataModel/edit/namedTypes/${t}/delete`;await be(e);const o=await Fe(n,a);o.data.body="";const d=await _e(o.data.url,o.data),i=await Ne(d);return i.updatedKnowledgeGraph=await ue(e.url),i},executeUpdateNamedType:async(e,t,a,n)=>{if(!t&&!Object.keys(a).length)throw new r("knowledge-graph:no-arguments","The operation to update types in the data model contained missing or empty values");const o=`${e.url}/dataModel/edit/namedTypes/${t}/update`;await be(e);const d=await Fe(o,n);d.data.body=await Ae(a,t,e.dataModel);const i=await _e(d.data.url,d.data),s=await Ke(i);return s.updatedKnowledgeGraph=await ue(e.url),s},executeAddGraphProperties:async(e,t,a,n)=>{if(!t&&!a.length)throw new r("knowledge-graph:no-arguments","The operation to add properties to the data model contained missing or empty values");const o=`${e.url}/dataModel/edit/namedTypes/${t}/fields/add`;await be(e);const d=await Fe(o,n);d.data.body=await Pe(a);const i=await _e(d.data.url,d.data),s=await Qe(i);return s.updatedKnowledgeGraph=await ue(e.url),s},executeDeleteGraphProperty:async(e,t,a,n)=>{if(!t&&!a)throw new r("knowledge-graph:no-arguments","The operation to delete property contained missing or empty values");const o=`${e.url}/dataModel/edit/namedTypes/${t}/fields/delete`;await be(e);const d=await Fe(o,n);d.data.body=await Se(a);const i=await _e(d.data.url,d.data),s=await $e(i);return s.updatedKnowledgeGraph=await ue(e.url),s},executeUpdateGraphProperty:async(e,t,a,n,o)=>{if(!t&&!a&&!Object.keys(n).length)throw new r("knowledge-graph:no-arguments","The operation to update properties in the data model contained missing or empty values");const d=`${e.url}/dataModel/edit/namedTypes/${t}/fields/update`;await be(e);const i=await Fe(d,o);i.data.body=await De(a,n);const s=await _e(i.data.url,i.data),p=await Le(s);return p.updatedKnowledgeGraph=await ue(e.url),p},executeAddGraphFieldIndex:async(e,t,a,n)=>{if(!t)throw new r("knowledge-graph:no-arguments","The operation to update search index in the data model contained missing named type");if(!a?.length)throw new r("knowledge-graph:no-arguments","The operation to update search index in the data model contained missing or empty field index values");const o=`${e.url}/dataModel/edit/namedTypes/${t}/indexes/add`;await be(e);const d=await Fe(o,n);d.data.body=await Re(a);const i=await _e(d.data.url,d.data),s=await Oe(i);return s.updatedKnowledgeGraph=await ue(e.url),s},executeDeleteGraphFieldIndex:async(e,t,a,n)=>{if(!t)throw new r("knowledge-graph:no-arguments","The operation to update search index in the data model contained missing named type");if(!a?.length)throw new r("knowledge-graph:no-arguments","The operation to update search index in the data model contained missing or empty field index values");const o=`${e.url}/dataModel/edit/namedTypes/${t}/indexes/delete`;await be(e);const d=await Fe(o,n);d.data.body=await Ee(a);const i=await _e(d.data.url,d.data),s=await We(i);return s.updatedKnowledgeGraph=await ue(e.url),s},executeUpdateSearchIndex:async(e,t,a,n)=>{if(!t)throw new r("knowledge-graph:no-arguments","The operation to update search index in the data model contained missing named type");if(!Object.keys(a.addSearchProperties??{}).length&&!Object.keys(a.removeSearchProperties??{}).length)throw new r("knowledge-graph:no-arguments","The operation to update search index in the data model contained missing or empty properties values");const o=`${e.url}/dataModel/searchIndex/update`;await be(e);const d=await Fe(o,n);d.data.body=await Ie(t,a);const i=await _e(d.data.url,d.data),s=await He(i);return s.updatedKnowledgeGraph=await ue(e.url),s},executeQuery:async(e,a,n)=>{const o=`${e.url}/graph/query`,d=await t(o,{responseType:"array-buffer",query:{f:"pbf",openCypherQuery:a.openCypherQuery,...n?.query},signal:n?.signal,timeout:n?.timeout}),i=d.getHeader?.("content-type"),p=d.data;if(i?.includes("application/x-protobuf")){const t=new((await w()).GraphQueryDecoder);if(t.deleteLater(),e.dataModel){const r=Je({wasmQueryDecoder:t,newArrayBufferToParse:p,dataModel:e.dataModel});return new s({resultRows:r.resultRows,resultHeader:r.resultHeader})}throw new r("knowledge-graph:undefined-data-model","The KnowledgeGraph supplied did not have a data model")}throw new r("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:i,data:d.data})},executeSearch:async(e,a,n)=>{const o=a.typeCategoryFilter,d=`${e.url}/graph/search`,i=await t(d,{responseType:"array-buffer",query:{f:"pbf",searchQuery:`"${a.searchQuery}"`,typeCategoryFilter:o,...n?.query},signal:n?.signal,timeout:n?.timeout}),p=i.getHeader?.("content-type"),c=i.data;if(p?.includes("application/x-protobuf")){const t=new((await w()).GraphQueryDecoder);if(t.deleteLater(),e.dataModel){const r=Je({wasmQueryDecoder:t,newArrayBufferToParse:c,dataModel:e.dataModel});return new s({resultRows:r.resultRows,resultHeader:r.resultHeader})}throw new r("knowledge-graph:undefined-data-model","The KnowledgeGraph supplied did not have a data model")}throw new r("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:p,data:i.data})},executeSearchStreaming:async(e,t,a)=>{const n=`${e.url}/graph/search`;await be(e);const o=await Fe(n,a);o.data.body=await Ce(t);const d=await _e(o.data.url,o.data);if(e.dataModel){const t=await Ve(d,e.dataModel);return new c({resultRowsStream:t.readableStream,resultHeader:t.resultHeader})}throw new r("knowledge-graph:undefined-data-model","The KnowledgeGraph supplied did not have a data model")},fetchClientDataAtKeys:async(e,t,a={ignoreCache:!1})=>{if(!t.length)return new Map;let n=z.get(e.url||"");n||(n=new Map,z.set(e.url||"",n));const o=new Map(n.entries()),d=`${e.url}/clientData/fetch`;t=Array.from(new Set(t));const i=await w(),s=h(t,n,i,a.ignoreCache),p=await Fe(d,a.requestOptions);p.data.body=s;const c=await _e(p.data.url,p.data),l=c.headers.get("content-type");if(l?.includes("application/x-protobuf")){const e=new i.ClientDataFetchResponseDecoder;e.deleteLater();const t=await c.arrayBuffer();return e.decode(new Uint8Array(t)),e.has_error()&&H(e.error,"knowledge-graph:fetchClientDataAtKeys-decoding-error","An error occurred while decoding the client data keys response"),I(e,n,o,a.ignoreCache)}throw new r("knowledge-graph:unexpected-server-response","server returned an unexpected response when fetching client data",{responseType:l,data:c})},fetchAllClientDataKeys:async(e,a)=>{const n=`${e.url}/clientData`,o=await t(n,{responseType:"array-buffer",query:{f:"pbf"},signal:a?.signal,timeout:a?.timeout}),d=o.getHeader?.("content-type"),i=o.data;if(d?.includes("application/x-protobuf")){const e=new((await w()).ClientDataKeysResponseDecoder);return e.deleteLater(),e.decode(new Uint8Array(i)),e.has_error()&&H(e.error,"knowledge-graph:fetchAllClientDataKeys-decoding-error","An error occurred while decoding the client data keys response"),E(e)}throw new r("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:d,data:o.data})},clearClientDataCache:()=>z.clear(),_fetchWrapper:async(e,t)=>fetch(e,t),_submitJobWrapper:async(e,t,r,a)=>i(e,t,r,a),_esriRequestWrapper:async(e,r)=>t(e,r)};async function V(e,t,r){return J.executeApplyEdits(e,t,r)}async function Y(e,t,r){return J.executeAddNamedTypes(e,t,r)}async function X(e,t,r){return J.executeDeleteNamedType(e,t,r)}async function Z(e,t,r,a){return J.executeUpdateNamedType(e,t,r,a)}async function ee(e,t,r,a){return J.executeAddGraphProperties(e,t,r,a)}async function te(e,t,r,a){return J.executeDeleteGraphProperty(e,t,r,a)}async function re(e,t,r,a,n){return J.executeUpdateGraphProperty(e,t,r,a,n)}async function ae(e,t,r,a){return J.executeAddGraphFieldIndex(e,t,r,a)}async function ne(e,t,r,a){return J.executeDeleteGraphFieldIndex(e,t,r,a)}async function oe(e,t,r,a){return J.executeUpdateSearchIndex(e,t,r,a)}async function de(e,t,r){return J.executeQuery(e,t,r)}async function ie(e,t,r){return J.executeQueryStreaming(e,t,r)}async function se(e,t,r){return J.executeSearch(e,t,r)}async function pe(e,t,r){return J.executeSearchStreaming(e,t,r)}function ce(e,t){return J.fetchAllClientDataKeys(e,t)}function le(e,t,r){return J.fetchClientDataAtKeys(e,t,r)}async function ue(e){return J.fetchKnowledgeGraph(e)}async function he(e){return J.refreshDataModel(e)}async function we(e){return J.refreshServiceDefinition(e)}async function ge(e,t){return J.executeFindPathsAsynchronous(e,t)}async function ye(e,t){return J.executeFindPaths(e,t)}async function fe(e,t){return J.fetchAsynchronousFindPathsResultData(e,t)}function me(){return J.clearClientDataCache()}async function _e(e,t){return J._fetchWrapper(e,t)}async function ke(e,t,r,a){return J._submitJobWrapper(e,t,r,a)}async function Ge(e,t){return J._esriRequestWrapper(e,t)}async function be(t){const r=e?.findCredential(t.url);r||(t.dataModel?await Ye(t):await he(t))}function xe(e,t,r,a){null==t?r.set_param_key_value(e,""):"object"!=typeof t||t instanceof Date?r.set_param_key_value(e,t):t instanceof o?r.set_param_key_value(e,_(t,a)):Array.isArray(t)?r.set_param_key_value(e,g(t,a)):r.set_param_key_value(e,k(t,a))}async function Te(e,t){if(t.dataModel||await he(t),!t.dataModel)throw new r("knowledge-graph:data-model-undefined","Encoding could not proceed because a data model was not provided and it could not be determined from the service");const a=await w(),n=!!e.options?.cascadeDelete,o=!!e.options?.cascadeProvenanceDelete,d=new a.GraphApplyEditsEncoder(a.SpatialReferenceUtil.WGS84(),e.options?.inputQuantizationParameters?D(e.options?.inputQuantizationParameters):a.InputQuantizationUtil.WGS84_lossless());d.deleteLater(),d.cascade_delete=n,d.cascade_delete_provenance=o;try{let t;e.entityAdds?.forEach(e=>{t=d.add_entity(R(e,a)),H(t,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits - an entity failed to be added to the encoder")}),e.relationshipAdds?.forEach(e=>{if(!e.originId||!e.destinationId)throw new r("knowledge-graph:relationship-origin-destination-missing","When adding a new relationship, you must provide both an origin and destination id on the appropriate class property");t=d.add_relationship(R(e,a)),H(t,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits - a relationship failed to be added to the encoder")}),e.entityUpdates?.forEach(e=>{if(!e.id)throw new r("knowledge-graph:entity-id-missing","When updating an entity or relationship, you must specify the id on the class level property");t=d.update_entity(R(e,a)),H(t,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits - an entity failed to be added to the encoder")}),e.relationshipUpdates?.forEach(e=>{if(!e.id)throw new r("knowledge-graph:relationship-id-missing","When updating an entity or relationship, you must specify the id on the class level property");t=d.update_relationship(R(e,a)),H(t,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits - a relationship failed to be added to the encoder")}),e.entityDeletes?.forEach(e=>{if(!e.typeName)throw new r("knowledge-graph:no-type-name","You must indicate the entity/relationship named object type to apply edits - delete");const t=d.make_delete_helper(e.typeName,!0);t.deleteLater(),e.ids?.forEach(e=>{t.delete_by_id(e)})}),e.relationshipDeletes?.forEach(e=>{if(!e.typeName)throw new r("knowledge-graph:no-type-name","You must indicate the entity/relationship named object type to apply edits - delete");const t=d.make_delete_helper(e.typeName,!1);e.ids?.forEach(e=>{t.delete_by_id(e)})}),d.encode()}catch(s){throw new r("knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits failed",{error:s})}const i=d.get_encoding_result();return H(i.error,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits failed"),structuredClone(i.get_byte_buffer())}async function ve(e){const t=await w(),a=new t.GraphNamedObjectTypeAddsRequestEncoder;a.deleteLater(),e.newEntityTypes?.forEach(e=>{a.add_entity_type(P(e,t))}),e.newRelationshipTypes?.forEach(e=>{a.add_relationship_type(S(e,t))});try{a.encode()}catch(o){throw new r("knowledge-graph:addNamedTypes-encoding-failed","Attempting to encode the addNamedTypes failed",{error:o})}const n=a.get_encoding_result();return H(n.error,"knowledge-graph:addNamedTypes-encoding-failed","Attempting to encode the addNamedTypes failed"),structuredClone(n.get_byte_buffer())}async function Ae(e,t,a){const n=await w(),o=new n.GraphNamedObjectTypeUpdateRequestEncoder;o.deleteLater();if(a.entityTypes.some(e=>e.name===t))o.update_entity_type(v(e,n));else{if(!a.relationshipTypes.some(e=>e.name===t))throw new r("knowledge-graph:updateNamedType-encoding-failed","The named type you are trying to update does not exist in the data model");o.update_relationship_type(A(e,n))}o.update_alias=e.hasOwnProperty("alias");try{o.encode()}catch(i){throw new r("knowledge-graph:updateNamedType-encoding-failed","Attempting to encode the updateNamedType failed",{error:i})}const d=o.get_encoding_result();return H(d.error,"knowledge-graph:updateNamedType-encoding-failed","Attempting to encode the updateNamedType failed"),structuredClone(d.get_byte_buffer())}async function Pe(e){const t=await w(),a=new t.GraphPropertyAddsRequestEncoder;a.deleteLater(),e.forEach(e=>{a.add_graph_property(T(e,t))});try{a.encode()}catch(o){throw new r("knowledge-graph:addGraphProperties-encoding-failed","Attempting to encode the addGraphProperties failed",{error:o})}const n=a.get_encoding_result();return H(n.error,"knowledge-graph:addGraphProperties-encoding-failed","Attempting to encode the addGraphProperties failed"),structuredClone(n.get_byte_buffer())}async function Se(e){const t=new((await w()).GraphPropertyDeleteRequestEncoder);t.deleteLater(),t.field_name=e;try{t.encode()}catch(n){throw new r("knowledge-graph:deleteGraphProperty-encoding-failed","Attempting to encode the deleteGraphProperty failed",{error:n})}const a=t.get_encoding_result();return H(a.error,"knowledge-graph:deleteGraphProperty-encoding-failed","Attempting to encode the deleteGraphProperty failed"),structuredClone(a.get_byte_buffer())}async function De(e,t){const a=await w(),n=new a.GraphPropertyUpdateRequestEncoder;n.deleteLater(),n.update_graph_property(x(t,a)),n.set_property_name(e),n.update_alias=t.hasOwnProperty("alias"),n.update_editable=t.hasOwnProperty("editable"),n.update_required=t.hasOwnProperty("required"),n.update_visible=t.hasOwnProperty("defaultVisibility"),n.update_default_value=t.hasOwnProperty("defaultValue");try{n.encode()}catch(d){throw new r("knowledge-graph:updateGraphProperty-encoding-failed","Attempting to encode the updateGraphProperty failed",{error:d})}const o=n.get_encoding_result();return H(o.error,"knowledge-graph:updateGraphProperty-encoding-failed","Attempting to encode the updateGraphProperty failed"),structuredClone(o.get_byte_buffer())}async function Re(e){const t=await w(),a=new t.GraphIndexAddsRequestEncoder;a.deleteLater(),e.forEach(e=>{a.add_field_index(b(e,t))});try{a.encode()}catch(o){throw new r("knowledge-graph:addGraphFieldIndex-encoding-failed","Attempting to encode the addGraphFieldIndex failed",{error:o})}const n=a.get_encoding_result();return H(n.error,"knowledge-graph:addGraphFieldIndex-encoding-failed","Attempting to encode the addGraphFieldIndex failed"),structuredClone(n.get_byte_buffer())}async function Ee(e){const t=new((await w()).GraphIndexDeleteRequestEncoder);t.deleteLater(),e.forEach(e=>{t.add_index_name(e)});try{t.encode()}catch(n){throw new r("knowledge-graph:deleteGraphFieldIndex-encoding-failed","Attempting to encode the deleteGraphFieldIndex failed",{error:n})}const a=t.get_encoding_result();return H(a.error,"knowledge-graph:deleteGraphFieldIndex-encoding-failed","Attempting to encode the deleteGraphFieldIndex failed"),structuredClone(a.get_byte_buffer())}async function Ie(e,t){const a=await w(),n=new a.GraphUpdateSearchIndexRequestEncoder;n.deleteLater(),t.hasOwnProperty("addSearchProperties")&&n.insert_add_search_property(e,G(t.addSearchProperties,a)),t.hasOwnProperty("removeSearchProperties")&&n.insert_delete_search_property(e,G(t.removeSearchProperties,a));try{n.encode()}catch(d){throw new r("knowledge-graph:updateSearchIndex-encoding-failed","Attempting to encode the updateSearchIndex failed",{error:d})}const o=n.get_encoding_result();return H(o.error,"knowledge-graph:updateSearchIndex-encoding-failed","Attempting to encode the updateSearchIndex failed"),structuredClone(o.get_byte_buffer())}async function qe(e,t){const a=await w(),n=new a.GraphQueryRequestEncoder;if(n.deleteLater(),e.outputSpatialReference?n.output_spatial_reference={wkid:e.outputSpatialReference.wkid,latestWkid:e.outputSpatialReference.latestWkid,vcsWkid:e.outputSpatialReference.vcsWkid,latestVcsWkid:e.outputSpatialReference.latestVcsWkid,wkt:e.outputSpatialReference.wkt??""}:n.output_spatial_reference=a.SpatialReferenceUtil.WGS84(),n.open_cypher_query=e.openCypherQuery,e.bindParameters)for(const[r,i]of Object.entries(e.bindParameters))xe(r,i,n,a);if(e.bindGeometryQuantizationParameters)y(e.bindGeometryQuantizationParameters,n);else{if(t.dataModel||await he(t),4326!==t.dataModel?.spatialReference?.wkid)throw new r("knowledge-graph:SR-quantization-mismatch","If the DataModel indicates a coordinate system other than WGS84, inputQuantizationParameters must be provided to the query encoder");n.input_quantization_parameters=a.InputQuantizationUtil.WGS84_lossless()}e.outputQuantizationParameters&&f(e.outputQuantizationParameters,n,a),e.provenanceBehavior&&m(e.provenanceBehavior,n);try{n.encode()}catch(d){throw new r("knowledge-graph:query-encoding-failed","Attempting to encode the query failed",{error:d})}const o=n.get_encoding_result();if(0!==o.error.error_code)throw new r("knowledge-graph:query-encoding-failed","Attempting to encode the query failed",{errorCode:o.error.error_code,errorMessage:o.error.error_message});return structuredClone(o.get_byte_buffer())}async function Ce(e){const t=await w(),a=new t.GraphSearchRequestEncoder;if(a.deleteLater(),a.search_query=e.searchQuery,a.type_category_filter=t.esriNamedTypeCategory[e.typeCategoryFilter],!0===e.returnSearchContext&&(a.return_search_context=e.returnSearchContext),null!=e.start&&e.start>0&&(a.start_index=e.start),null!=e.num&&(a.max_num_results=e.num),null!=e.idsFilter&&Array.isArray(e.idsFilter)&&e.idsFilter.length>0)try{a.set_ids_filter(g(e.idsFilter,t))}catch(o){throw new r("knowledge-graph:ids-format-error","Attempting to set ids filter failed. This is usually caused by an incorrectly formatted UUID string",{error:o})}e.namedTypesFilter?.forEach(e=>{a.add_named_type_filter(e)});try{a.encode()}catch(o){throw new r("knowledge-graph:search-encoding-failed","Attempting to encode the search failed",{error:o})}const n=a.get_encoding_result();if(0!==n.error.error_code)throw new r("knowledge-graph:search-encoding-failed","Attempting to get encoding result from the query failed",{errorCode:n.error.error_code,errorMessage:n.error.error_message});return structuredClone(n.get_byte_buffer())}async function Fe(e,r){return t(e,{responseType:"native-request-init",method:"post",query:{f:"pbf",...r?.query},body:"x",headers:{"Content-Type":"application/octet-stream"},signal:r?.signal,timeout:r?.timeout})}async function Me(e,t,a){const n=e.headers.get("content-type");if(n?.includes("application/x-protobuf")){const r=await e.arrayBuffer(),n=new t;try{return n.decode(new Uint8Array(r)),a(n)}finally{n.deleteLater()}}throw new r("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:n,data:await e.text()})}async function je(e){return Me(e,(await w()).GraphApplyEditsDecoder,W)}async function Ue(e){return Me(e,(await w()).GraphNamedObjectTypeAddsResponseDecoder,q)}async function Ne(e){return Me(e,(await w()).GraphNamedObjectTypeDeleteResponseDecoder,C)}async function Ke(e){return Me(e,(await w()).GraphNamedObjectTypeUpdateResponseDecoder,F)}async function Qe(e){return Me(e,(await w()).GraphPropertyAddsResponseDecoder,M)}async function $e(e){return Me(e,(await w()).GraphPropertyDeleteResponseDecoder,j)}async function Le(e){return Me(e,(await w()).GraphPropertyUpdateResponseDecoder,U)}async function Oe(e){return Me(e,(await w()).GraphIndexAddsResponseDecoder,N)}async function We(e){return Me(e,(await w()).GraphIndexDeleteResponseDecoder,K)}async function He(e){return Me(e,(await w()).GraphUpdateSearchIndexResponseDecoder,Q)}let ze=50;function Be(e){ze=e}function Je({wasmQueryDecoder:e,newArrayBufferToParse:t,dataModel:a,decodedHeader:n,limitMaxProcessingTime:o=!1}){t&&e.push_buffer(new Uint8Array(t));const i=[];let s,p,c=0;const l=Date.now();let u=!0;for(;e.next_row();){s&&p||(s=n??L(e),p=s.outSpatialReference??new d({wkid:4326})),c||(c=e.get_header_keys().size());const t=new Array(c);for(let r=0;r<c;r++){const n=e.get_value(r);t[r]=O(n,a,p)}if(i.push(t),o&&Date.now()-l>ze){u=!1;break}}if(e.has_error())throw new r("knowledge-graph:stream-decoding-error","One or more result rows were not successfully decoded - inner row decoding",{errorCode:e.error.error_code,errorMessage:e.error.error_message});return{resultHeader:s,resultRows:i,parsedAllResultsFromBuffer:u}}async function Ve(e,t){const o=e.headers.get("content-type");if(e.headers.get("content-length")&&a.getLogger("esri.rest.knowledgeGraph.knowledgeGraphService").warnOnce("Found `Content-Length` header when expecting a streaming HTTP response! Please investigate whether all intermediate HTTP proxies and/or load balancers are configured such that they don't forcefully buffer the entire response before returning it to the client. A valid HTTP streaming response should use Chunked Transfer Encoding and not have a Content Length defined."),o?.includes("application/x-protobuf")){const o=e.body?.getReader(),d=new((await w()).GraphQueryDecoder);let i,s,c;d.deleteLater();const l=new Promise((e,t)=>{s=e,c=t});let u=!1,h=null;const g=new ReadableStream({pull:async function e(l){if(!o){const e=new r("knowledge-graph:stream-decoding-error","Error reading from stream - reader is undefined");throw c(e),e}const{done:w,value:g}=h?{done:!1,value:null}:await o.read().catch(e=>{throw c(e),o.releaseLock(),e});g&&(h=g);try{if(w){let e;if(d.has_error()?e=new r("knowledge-graph:stream-decoding-error","One or more result rows were not successfully decoded - query stream done",{errorCode:d.error.error_code,errorMessage:d.error.error_message}):u||s(new p),o.releaseLock(),e)throw l.error(e),c(e),e;return void l.close()}const{resultHeader:a,resultRows:n,parsedAllResultsFromBuffer:y}=Je({wasmQueryDecoder:d,newArrayBufferToParse:g,dataModel:t,decodedHeader:i,limitMaxProcessingTime:!0});return y&&(h=null),!i&&a&&(i=a,s(a),u=!0),n.length>0?void l.enqueue(n):await e(l)}catch(y){throw a.getLogger("esri.rest.knowledgeGraph.knowledgeGraphService").error(y),c(y),o.releaseLock(),n(y)?y:new r("knowledge-graph:unexpected-server-response","Error inside streaming data return parsing",{error:y})}}});return{readableStream:g,resultHeader:await l}}throw new r("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:o,data:e.text()})}async function Ye(e){const a=`${e.url}/dataModel/queryDataModel`,n=await t(a,{responseType:"array-buffer",query:{f:"pbf"}}),o=n.getHeader?.("content-type"),d=n.data;if(o?.includes("application/x-protobuf")){const e=(await w()).decode_data_model_from_protocol_buffer(new Uint8Array(d));if(!e)throw new r("knowledge-graph:data-model-decode-failure","The server responded to the data model query, but the response failed to be decoded. This typically occurs when the Knowledge JS API (4.26 or later) is used with an unsupported backend (11.0 or earlier)");return $(e)}throw new r("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:o,data:n.data})}export{be as _checkAuthentication,Ge as _esriRequestWrapper,_e as _fetchWrapper,B as _getClientDataCacheCopy,Be as _setMaxQueryParsingDurationForTesting,ke as _submitJobWrapper,me as clearClientDataCache,z as clientDataCache,ae as executeAddGraphFieldIndex,ee as executeAddGraphProperties,Y as executeAddNamedTypes,V as executeApplyEdits,ne as executeDeleteGraphFieldIndex,te as executeDeleteGraphProperty,X as executeDeleteNamedType,ye as executeFindPaths,ge as executeFindPathsAsynchronous,de as executeQuery,ie as executeQueryStreaming,se as executeSearch,pe as executeSearchStreaming,re as executeUpdateGraphProperty,Z as executeUpdateNamedType,oe as executeUpdateSearchIndex,ce as fetchAllClientDataKeys,fe as fetchAsynchronousFindPathsResultData,le as fetchClientDataAtKeys,ue as fetchKnowledgeGraph,J as kgRestServices,he as refreshDataModel,we as refreshServiceDefinition};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
+ */
5
+ import{strict as e}from"../../core/jsonMap.js";const a=e()({Europe:"europe",Japan:"japan",Korea:"korea",MiddleEastAndAfrica:"middle-east-and-africa",NorthAmerica:"north-america",SouthAmerica:"south-america",SouthAsia:"south-asia",Thailand:"thailand"}),s=e()({Feet:"feet",Kilometers:"kilometers",Meters:"meters",Miles:"miles",NauticalMiles:"nautical-miles",Yards:"yards"}),r=e()({None:"none","Straight Line":"straight-line","True Shape with Measures":"true-shape-with-measures"}),t=e()({Days:"days",Hours:"hours",Minutes:"minutes",Seconds:"seconds"}),i=e()({GEO_LOCAL:"geo-local",UTC:"utc"});export{a as analysisRegionJsonMap,s as distanceUnitsJsonMap,r as routeShapeJsonMap,t as timeUnitsJsonMap,i as timeZoneUsageJsonMap};
@@ -0,0 +1,10 @@
1
+ import "../interfaces";
2
+
3
+ export const execute: __esri.lastMileDelivery["execute"];
4
+ export const getCost: __esri.lastMileDelivery["getCost"];
5
+ export const getDepots: __esri.lastMileDelivery["getDepots"];
6
+ export const getDepotVisits: __esri.lastMileDelivery["getDepotVisits"];
7
+ export const getDirectionLines: __esri.lastMileDelivery["getDirectionLines"];
8
+ export const getDirectionPoints: __esri.lastMileDelivery["getDirectionPoints"];
9
+ export const getOrders: __esri.lastMileDelivery["getOrders"];
10
+ export const getRoutes: __esri.lastMileDelivery["getRoutes"];
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
+ */
5
+ import t from"./geoprocessor/GPOptions.js";import{submitJob as e}from"./geoprocessor/submitJob.js";import{lastMileDeliveryParametersToQueryParameters as n}from"./route/utils.js";const s={cost:"usage_cost",depotVisits:"output_depot_visits",depots:"output_depots",directionLines:"output_direction_lines",directionPoints:"output_direction_points",networkAnalysisLayerPackage:"output_network_analysis_layer_package",orders:"output_orders",resultFile:"output_result_file",routeData:"output_route_data",routes:"output_routes"};function a(e){if(!e)return;const{outSpatialReference:n,processExtent:s,returnM:a,returnZ:o}=e;return new t({outSpatialReference:n,processExtent:s,returnM:a,returnZ:o})}function o(t,e){return{gpOptions:a(t),requestOptions:{...e,query:{...e?.query,token:t?.apiKey}}}}async function u(t,s,a,o){const u=n(s),r=await e(t,u,a,o);return await r.waitForJobCompletion({apiKey:s.apiKey}),r}async function r(t,e,n){const{gpOptions:a,requestOptions:u}=o(e,n),{value:r}=await t.fetchResultData(s.depots,a,u);return r}async function i(t,e,n){const{gpOptions:a,requestOptions:u}=o(e,n),{value:r}=await t.fetchResultData(s.orders,a,u);return r}async function c(t,e,n){const{gpOptions:a,requestOptions:u}=o(e,n),{value:r}=await t.fetchResultData(s.routes,a,u);return r}async function p(t,e,n){const{gpOptions:a,requestOptions:u}=o(e,n),r=await t.fetchResultData(s.cost,a,u);return{numberOfObjects:r.value.numObjects,credits:r.value.credits}}async function l(t,e,n){const{gpOptions:a,requestOptions:u}=o(e,n),{value:r}=await t.fetchResultData(s.directionPoints,a,u);return r}async function f(t,e,n){const{gpOptions:a,requestOptions:u}=o(e,n),{value:r}=await t.fetchResultData(s.depotVisits,a,u);return r}async function y(t,e,n){const{gpOptions:a,requestOptions:u}=o(e,n),{value:r}=await t.fetchResultData(s.directionLines,a,u);return r}async function d(t,e,n){const{dataType:a,value:{url:o}}=await t.fetchResultData(s.routeData,e,n);return{dataType:a,url:o}}async function O(t,e,n){const{dataType:a,value:{url:o}}=await t.fetchResultData(s.resultFile,e,n);return{dataType:a,url:o}}async function _(t,e,n){const{dataType:a,value:{url:o}}=await t.fetchResultData(s.networkAnalysisLayerPackage,e,n);return{dataType:a,url:o}}export{u as execute,p as getCost,f as getDepotVisits,r as getDepots,y as getDirectionLines,l as getDirectionPoints,_ as getNetworkAnalysisLayer,i as getOrders,O as getResultFile,d as getRouteData,c as getRoutes};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{impedanceAttributeNameJsonMap as t}from"../support/networkEnums.js";function r(r,e){if(null==r)return null;const i={},s=new RegExp(`^${e}`,"i");for(const n of Object.keys(r))if(s.test(n)){const s=n.slice(e.length);i[t.fromJSON(s)]=r[n]}return i}function e(r,e,i){if(null!=r){e.attributes||(e.attributes={});for(const s in r){const n=t.toJSON(s);e.attributes[`${i}${n}`]=r[s]}}}function i(r){const e={};for(const i of Object.keys(r)){const s=i;e[t.fromJSON(s)]=r[i]}return e}function s(r){const e={};for(const i of Object.keys(r)){const s=i;e[t.toJSON(s)]=r[i]}return e}function n(t,r){return null==t||null==r?null:Math.round((t-r)/6e4)}function o(t){const r=t.toJSON(),e=r;return e.accumulateAttributeNames&&=r.accumulateAttributeNames?.join(),e.attributeParameterValues&&=JSON.stringify(r.attributeParameterValues),e.barriers&&=JSON.stringify(r.barriers),e.outSR&&=r.outSR?.wkid,e.overrides&&=JSON.stringify(r.overrides),e.polygonBarriers&&=JSON.stringify(r.polygonBarriers),e.polylineBarriers&&=JSON.stringify(r.polylineBarriers),e.restrictionAttributeNames&&=r.restrictionAttributeNames?.join(),e.stops&&=JSON.stringify(r.stops),e.travelMode&&=JSON.stringify(r.travelMode),e}function a(t){const r=t.toJSON(),e=r;return e.accumulateAttributeNames&&=r.accumulateAttributeNames?.join(),e.attributeParameterValues&&=JSON.stringify(r.attributeParameterValues),e.barriers&&=JSON.stringify(r.barriers),e.facilities&&=JSON.stringify(r.facilities),e.incidents&&=JSON.stringify(r.incidents),e.outSR&&=r.outSR?.wkid,e.overrides&&=JSON.stringify(r.overrides),e.polygonBarriers&&=JSON.stringify(r.polygonBarriers),e.polylineBarriers&&=JSON.stringify(r.polylineBarriers),e.restrictionAttributeNames&&=r.restrictionAttributeNames?.join(),e.travelMode&&=JSON.stringify(r.travelMode),e}function u(t){const r=t.toJSON(),e=r;return e.accumulateAttributeNames&&=r.accumulateAttributeNames?.join(),e.attributeParameterValues&&=JSON.stringify(r.attributeParameterValues),e.barriers&&=JSON.stringify(r.barriers),e.defaultBreaks&&=r.defaultBreaks?.join(),e.excludeSourcesFromPolygons&&=r.excludeSourcesFromPolygons?.join(),e.facilities&&=JSON.stringify(r.facilities),e.outSR&&=r.outSR?.wkid,e.overrides&&=JSON.stringify(r.overrides),e.polygonBarriers&&=JSON.stringify(r.polygonBarriers),e.polylineBarriers&&=JSON.stringify(r.polylineBarriers),e.restrictionAttributeNames&&=r.restrictionAttributeNames?.join(),e.travelMode&&=JSON.stringify(r.travelMode),e}export{a as closestFacilityParametersToQueryParameters,s as fromKebabImpedanceAttributes,r as getPrefixedProperties,n as getTimezoneOffset,o as routeParametersToQueryParameters,u as serviceAreaParametersToQueryParameters,e as setPrefixedProperties,i as toKebabImpedanceAttributes};
5
+ import{impedanceAttributeNameJsonMap as e}from"../support/networkEnums.js";function t(t,r){if(null==t)return null;const i={},s=new RegExp(`^${r}`,"i");for(const o of Object.keys(t))if(s.test(o)){const s=o.slice(r.length);i[e.fromJSON(s)]=t[o]}return i}function r(t,r,i){if(null!=t){r.attributes||(r.attributes={});for(const s in t){const o=e.toJSON(s);r.attributes[`${i}${o}`]=t[s]}}}function i(t){const r={};for(const i of Object.keys(t)){const s=i;r[e.fromJSON(s)]=t[i]}return r}function s(t){const r={};for(const i of Object.keys(t)){const s=i;r[e.toJSON(s)]=t[i]}return r}function o(e,t){return null==e||null==t?null:Math.round((e-t)/6e4)}function n(e){const t=e.toJSON(),r=t;return r.accumulateAttributeNames&&=t.accumulateAttributeNames?.join(),r.attributeParameterValues&&=JSON.stringify(t.attributeParameterValues),r.barriers&&=JSON.stringify(t.barriers),r.outSR&&=t.outSR?.wkid,r.overrides&&=JSON.stringify(t.overrides),r.polygonBarriers&&=JSON.stringify(t.polygonBarriers),r.polylineBarriers&&=JSON.stringify(t.polylineBarriers),r.restrictionAttributeNames&&=t.restrictionAttributeNames?.join(),r.stops&&=JSON.stringify(t.stops),r.travelMode&&=JSON.stringify(t.travelMode),r}function a(e){const t=e.toJSON(),r=t;return r.accumulateAttributeNames&&=t.accumulateAttributeNames?.join(),r.attributeParameterValues&&=JSON.stringify(t.attributeParameterValues),r.barriers&&=JSON.stringify(t.barriers),r.facilities&&=JSON.stringify(t.facilities),r.incidents&&=JSON.stringify(t.incidents),r.outSR&&=t.outSR?.wkid,r.overrides&&=JSON.stringify(t.overrides),r.polygonBarriers&&=JSON.stringify(t.polygonBarriers),r.polylineBarriers&&=JSON.stringify(t.polylineBarriers),r.restrictionAttributeNames&&=t.restrictionAttributeNames?.join(),r.travelMode&&=JSON.stringify(t.travelMode),r}function u(e){const t=e.toJSON(),r=t;return r.accumulateAttributeNames&&=t.accumulateAttributeNames?.join(),r.attributeParameterValues&&=JSON.stringify(t.attributeParameterValues),r.barriers&&=JSON.stringify(t.barriers),r.defaultBreaks&&=t.defaultBreaks?.join(),r.excludeSourcesFromPolygons&&=t.excludeSourcesFromPolygons?.join(),r.facilities&&=JSON.stringify(t.facilities),r.outSR&&=t.outSR?.wkid,r.overrides&&=JSON.stringify(t.overrides),r.polygonBarriers&&=JSON.stringify(t.polygonBarriers),r.polylineBarriers&&=JSON.stringify(t.polylineBarriers),r.restrictionAttributeNames&&=t.restrictionAttributeNames?.join(),r.travelMode&&=JSON.stringify(t.travelMode),r}function l(e){const t=e.toJSON(),r={depots:JSON.stringify(t.depots),orders:JSON.stringify(t.orders),routes:JSON.stringify(t.routes),token:t.token};return t.analysis_region&&(r.analysis_region=t.analysis_region),t.directions_language&&(r.directions_language=t.directions_language),t.distance_units&&(r.distance_units=t.distance_units),t.earliest_route_start_date&&(r.earliest_route_start_date=t.earliest_route_start_date),t.earliest_route_start_time&&(r.earliest_route_start_time=t.earliest_route_start_time),t.ignore_invalid_order_locations&&(r.ignore_invalid_order_locations=t.ignore_invalid_order_locations),t.line_barriers&&(r.line_barriers=JSON.stringify(t.line_barriers)),t.max_route_total_time&&(r.max_route_total_time=t.max_route_total_time),t.order_specialties&&(r.order_specialties=JSON.stringify(t.order_specialties)),t.overrides&&(r.overrides=JSON.stringify(t.overrides)),t.point_barriers&&(r.point_barriers=JSON.stringify(t.point_barriers)),t.polygon_barriers&&(r.polygon_barriers=JSON.stringify(t.polygon_barriers)),t.populate_directions&&(r.populate_directions=t.populate_directions),t.route_shape&&(r.route_shape=t.route_shape),t.route_specialties&&(r.route_specialties=JSON.stringify(t.route_specialties)),t.save_output_network_analysis_layer&&(r.save_output_network_analysis_layer=t.save_output_network_analysis_layer),t.save_route_data&&(r.save_route_data=t.save_route_data),t.sequence_gap&&(r.sequence_gap=t.sequence_gap),t.time_units&&(r.time_units=t.time_units),t.time_zone_usage_for_time_fields&&(r.time_zone_usage_for_time_fields=t.time_zone_usage_for_time_fields),t.travel_mode&&(r.travel_mode=JSON.stringify(t.travel_mode)),t.zones&&(r.zones=JSON.stringify(t.zones)),r}export{a as closestFacilityParametersToQueryParameters,s as fromKebabImpedanceAttributes,t as getPrefixedProperties,o as getTimezoneOffset,l as lastMileDeliveryParametersToQueryParameters,n as routeParametersToQueryParameters,u as serviceAreaParametersToQueryParameters,r as setPrefixedProperties,i as toKebabImpedanceAttributes};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import o from"../../request.js";import"../../core/has.js";import{strict as t}from"../../core/jsonMap.js";import{JSONSupport as s}from"../../core/JSONSupport.js";import{onAbort as r,createAbortError as i}from"../../core/promiseUtils.js";import{property as a}from"../../core/accessorSupport/decorators/property.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{enumeration as c}from"../../core/accessorSupport/decorators/enumeration.js";import{subclass as n}from"../../core/accessorSupport/decorators/subclass.js";import{parseUrl as l}from"../utils.js";import u from"../geoprocessor/GPOptions.js";import{gpEncode as b,decode as m}from"../geoprocessor/utils.js";import j from"./GPMessage.js";var p;const h=t()({esriJobCancelled:"job-cancelled",esriJobCancelling:"job-cancelling",esriJobDeleted:"job-deleted",esriJobDeleting:"job-deleting",esriJobTimedOut:"job-timed-out",esriJobExecuting:"job-executing",esriJobFailed:"job-failed",esriJobNew:"job-new",esriJobSubmitted:"job-submitted",esriJobSucceeded:"job-succeeded",esriJobWaiting:"job-waiting"},{ignoreUnknown:!1}),d=1e3;let g=class extends s{static{p=this}constructor(e){super(e),this.jobId=null,this.jobStatus=null,this.messages=null,this.progress=null,this.requestOptions=null,this.sourceUrl=null,this._cancelJobTimer=void 0,this._jobCompletionTimer=void 0}async cancelJob(e){const{jobId:t,sourceUrl:s}=this,{path:a}=l(s),c={...this.requestOptions,...e,query:{f:"json"}},n=`${a}/jobs/${t}/cancel`,{data:u}=await o(n,c),{messages:b,jobStatus:m,progress:j}=p.fromJSON(u);return this.set({messages:b,jobStatus:m,progress:j}),"job-cancelled"===m?this:new Promise((o,t)=>{r(c.signal,()=>{this.clearCancelJobTimer(),t(i())}),this.clearCancelJobTimer();const s=()=>{this._cancelJobTimer||t(i()),this.checkJobStatus(e).then(({jobStatus:e})=>{switch(e){case"job-cancelling":default:this._cancelJobTimer=setTimeout(s,d);break;case"job-deleted":case"job-deleting":case"job-executing":case"job-failed":case"job-new":case"job-submitted":case"job-succeeded":case"job-timed-out":case"job-waiting":t(this);break;case"job-cancelled":o(this)}}).catch(e=>{t(e)})};this._cancelJobTimer=setTimeout(s,d)})}destroy(){clearInterval(this._cancelJobTimer),clearInterval(this._jobCompletionTimer)}async checkJobStatus(e){const{path:t}=l(this.sourceUrl),s={...this.requestOptions,...e,query:{f:"json"}},r=`${t}/jobs/${this.jobId}`,{data:i}=await o(r,s),{messages:a,jobStatus:c,progress:n}=p.fromJSON(i);return this.set({messages:a,jobStatus:c,progress:n}),this}async fetchResultData(e,t,s){t=u.from(t||{});const{returnColumnName:r,returnFeatureCollection:i,returnM:a,returnZ:c,outSpatialReference:n}=t,{path:j}=l(this.sourceUrl),p=b({returnColumnName:r||null,returnFeatureCollection:i||null,returnM:a||null,returnZ:c||null,outSR:n,returnType:"data",f:"json"},null),h={...this.requestOptions,...s,query:p},d=`${j}/jobs/${this.jobId}/results/${e}`,{data:g}=await o(d,h);return m(g)}async fetchResultImage(e,t,s){const{path:r}=l(this.sourceUrl),i={...t.toJSON(),f:"json"},a=b(i),c={...this.requestOptions,...s,query:a},n=`${r}/jobs/${this.jobId}/results/${e}`,{data:u}=await o(n,c);return m(u)}async fetchResultMapImageLayer(){const{path:e}=l(this.sourceUrl),o=e.indexOf("/GPServer/"),t=`${e.slice(0,Math.max(0,o))}/MapServer/jobs/${this.jobId}`;return new(0,(await import("../../layers/MapImageLayer.js")).default)({url:t})}async waitForJobCompletion(e={}){const{interval:o=d,signal:t,statusCallback:s}=e;return new Promise((e,a)=>{r(t,()=>{this.clearJobCompletionTimer(),a(i())}),this.clearJobCompletionTimer();const c=()=>{this._jobCompletionTimer||a(i()),this.checkJobStatus().then(({jobStatus:t})=>{switch(t){case"job-succeeded":e(this);break;case"job-executing":case"job-new":case"job-submitted":case"job-waiting":s&&s(this),this._jobCompletionTimer=setTimeout(c,o);break;case"job-cancelled":case"job-cancelling":case"job-deleted":case"job-deleting":case"job-failed":case"job-timed-out":a(this);break;default:this._jobCompletionTimer=setTimeout(c,o)}}).catch(e=>{a(e)})};this._jobCompletionTimer=setTimeout(c,o)})}clearCancelJobTimer(){clearTimeout(this._cancelJobTimer),this._cancelJobTimer=void 0}clearJobCompletionTimer(){clearTimeout(this._jobCompletionTimer),this._jobCompletionTimer=void 0}};e([a()],g.prototype,"jobId",void 0),e([c(h,{ignoreUnknown:!1})],g.prototype,"jobStatus",void 0),e([a({type:[j]})],g.prototype,"messages",void 0),e([a()],g.prototype,"progress",void 0),e([a()],g.prototype,"requestOptions",void 0),e([a({json:{write:!0}})],g.prototype,"sourceUrl",void 0),g=p=e([n("esri.rest.support.JobInfo")],g);export{g as default};
5
+ import{__decorate as e}from"tslib";import o from"../../request.js";import"../../core/has.js";import{strict as t}from"../../core/jsonMap.js";import{JSONSupport as s}from"../../core/JSONSupport.js";import{onAbort as r,createAbortError as i}from"../../core/promiseUtils.js";import{property as a}from"../../core/accessorSupport/decorators/property.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{enumeration as c}from"../../core/accessorSupport/decorators/enumeration.js";import{subclass as n}from"../../core/accessorSupport/decorators/subclass.js";import{parseUrl as l}from"../utils.js";import u from"../geoprocessor/GPOptions.js";import{gpEncode as b,decode as m}from"../geoprocessor/utils.js";import j from"./GPMessage.js";var p;const h=t()({esriJobCancelled:"job-cancelled",esriJobCancelling:"job-cancelling",esriJobDeleted:"job-deleted",esriJobDeleting:"job-deleting",esriJobTimedOut:"job-timed-out",esriJobExecuting:"job-executing",esriJobFailed:"job-failed",esriJobNew:"job-new",esriJobSubmitted:"job-submitted",esriJobSucceeded:"job-succeeded",esriJobWaiting:"job-waiting"},{ignoreUnknown:!1}),d=1e3;let g=class extends s{static{p=this}constructor(e){super(e),this.jobId=null,this.jobStatus=null,this.messages=null,this.progress=null,this.requestOptions=null,this.sourceUrl=null,this._cancelJobTimer=void 0,this._jobCompletionTimer=void 0}async cancelJob(e){const{jobId:t,sourceUrl:s}=this,{path:a}=l(s),c={...this.requestOptions,...e,query:{f:"json"}},n=`${a}/jobs/${t}/cancel`,{data:u}=await o(n,c),{messages:b,jobStatus:m,progress:j}=p.fromJSON(u);return this.set({messages:b,jobStatus:m,progress:j}),"job-cancelled"===m?this:new Promise((o,t)=>{r(c.signal,()=>{this.clearCancelJobTimer(),t(i())}),this.clearCancelJobTimer();const s=()=>{this._cancelJobTimer||t(i()),this.checkJobStatus(e).then(({jobStatus:e})=>{switch(e){case"job-cancelling":default:this._cancelJobTimer=setTimeout(s,d);break;case"job-deleted":case"job-deleting":case"job-executing":case"job-failed":case"job-new":case"job-submitted":case"job-succeeded":case"job-timed-out":case"job-waiting":t(this);break;case"job-cancelled":o(this)}}).catch(e=>{t(e)})};this._cancelJobTimer=setTimeout(s,d)})}destroy(){clearInterval(this._cancelJobTimer),clearInterval(this._jobCompletionTimer)}async checkJobStatus(e){const{path:t}=l(this.sourceUrl),s={...this.requestOptions,...e,query:{...e?.query,f:"json"}},r=`${t}/jobs/${this.jobId}`,{data:i}=await o(r,s),{messages:a,jobStatus:c,progress:n}=p.fromJSON(i);return this.set({messages:a,jobStatus:c,progress:n}),this}async fetchResultData(e,t,s){t=u.from(t||{});const{returnColumnName:r,returnFeatureCollection:i,returnM:a,returnZ:c,outSpatialReference:n}=t,{path:j}=l(this.sourceUrl),p={returnColumnName:r||null,returnFeatureCollection:i||null,returnM:a||null,returnZ:c||null,outSR:n,returnType:"data",f:"json",...s?.query},h=b(p,null),d={...this.requestOptions,...s,query:h},g=`${j}/jobs/${this.jobId}/results/${e}`,{data:J}=await o(g,d);return m(J)}async fetchResultImage(e,t,s){const{path:r}=l(this.sourceUrl),i={...t.toJSON(),f:"json"},a=b(i),c={...this.requestOptions,...s,query:a},n=`${r}/jobs/${this.jobId}/results/${e}`,{data:u}=await o(n,c);return m(u)}async fetchResultMapImageLayer(){const{path:e}=l(this.sourceUrl),o=e.indexOf("/GPServer/"),t=`${e.slice(0,Math.max(0,o))}/MapServer/jobs/${this.jobId}`;return new(0,(await import("../../layers/MapImageLayer.js")).default)({url:t})}async waitForJobCompletion(e={}){const{interval:o=d,signal:t,statusCallback:s,apiKey:a}=e;return new Promise((e,c)=>{r(t,()=>{this.clearJobCompletionTimer(),c(i())}),this.clearJobCompletionTimer();const n=()=>{this._jobCompletionTimer||c(i()),this.checkJobStatus({query:{token:a}}).then(({jobStatus:t})=>{switch(t){case"job-succeeded":e(this);break;case"job-executing":case"job-new":case"job-submitted":case"job-waiting":s&&s(this),this._jobCompletionTimer=setTimeout(n,o);break;case"job-cancelled":case"job-cancelling":case"job-deleted":case"job-deleting":case"job-failed":case"job-timed-out":c(this);break;default:this._jobCompletionTimer=setTimeout(n,o)}}).catch(e=>{c(e)})};this._jobCompletionTimer=setTimeout(n,o)})}clearCancelJobTimer(){clearTimeout(this._cancelJobTimer),this._cancelJobTimer=void 0}clearJobCompletionTimer(){clearTimeout(this._jobCompletionTimer),this._jobCompletionTimer=void 0}};e([a()],g.prototype,"jobId",void 0),e([c(h,{ignoreUnknown:!1})],g.prototype,"jobStatus",void 0),e([a({type:[j]})],g.prototype,"messages",void 0),e([a()],g.prototype,"progress",void 0),e([a()],g.prototype,"requestOptions",void 0),e([a({json:{write:!0}})],g.prototype,"sourceUrl",void 0),g=p=e([n("esri.rest.support.JobInfo")],g);export{g as default};
@@ -0,0 +1,4 @@
1
+ import "../../interfaces";
2
+
3
+ import LastMileDeliveryParameters = __esri.LastMileDeliveryParameters;
4
+ export default LastMileDeliveryParameters;
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
+ */
5
+ import{__decorate as e}from"tslib";import{ClonableMixin as t}from"../../core/Clonable.js";import{JSONSupport as o}from"../../core/JSONSupport.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import{ensureClass as i,Integer as s}from"../../core/accessorSupport/ensureType.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{enumeration as n}from"../../core/accessorSupport/decorators/enumeration.js";import{subclass as a}from"../../core/accessorSupport/decorators/subclass.js";import{analysisRegionJsonMap as p,distanceUnitsJsonMap as l,routeShapeJsonMap as u,timeUnitsJsonMap as m,timeZoneUsageJsonMap as y}from"../lastMileDelivery/enums.js";import d from"./FeatureSet.js";import c from"./TravelMode.js";var v;let _=class extends(t(o)){static{v=this}constructor(e){super(e),this.analysisRegion=null,this.apiKey=null,this.depots=null,this.directionsLanguage=null,this.distanceUnits=null,this.earliestRouteStartDate=null,this.earliestRouteStartTime=null,this.ignoreInvalidOrderLocations=null,this.lineBarriers=null,this.maximumRouteDuration=null,this.orderSpecialties=null,this.orders=null,this.overrides=null,this.pointBarriers=null,this.polygonBarriers=null,this.populateDirections=null,this.routeShape=null,this.routeSpecialties=null,this.routes=null,this.saveOutputNetworkAnalysisLayer=null,this.saveRouteData=null,this.sequenceGap=null,this.timeUnits=null,this.timeZoneUsage=null,this.travelMode=null,this.zones=null}static from(e){return i(v,e)}};e([n(p,{name:"analysis_region"})],_.prototype,"analysisRegion",void 0),e([r({type:String,json:{name:"token",write:!0}})],_.prototype,"apiKey",void 0),e([r({type:d,json:{write:!0}})],_.prototype,"depots",void 0),e([r({type:String,json:{name:"directions_language",write:!0}})],_.prototype,"directionsLanguage",void 0),e([n(l,{name:"distance_units"})],_.prototype,"distanceUnits",void 0),e([r({type:String,json:{name:"earliest_route_start_date",write:!0}})],_.prototype,"earliestRouteStartDate",void 0),e([r({type:String,json:{name:"earliest_route_start_time",write:!0}})],_.prototype,"earliestRouteStartTime",void 0),e([r({type:Boolean,json:{name:"ignore_invalid_order_locations",write:!0}})],_.prototype,"ignoreInvalidOrderLocations",void 0),e([r({type:d,json:{name:"line_barriers",write:!0}})],_.prototype,"lineBarriers",void 0),e([r({type:Number,json:{name:"max_route_total_time",write:!0}})],_.prototype,"maximumRouteDuration",void 0),e([r({type:d,json:{name:"order_specialties",write:!0}})],_.prototype,"orderSpecialties",void 0),e([r({type:d,json:{write:!0}})],_.prototype,"orders",void 0),e([r({json:{write:!0}})],_.prototype,"overrides",void 0),e([r({type:d,json:{name:"point_barriers",write:!0}})],_.prototype,"pointBarriers",void 0),e([r({type:d,json:{name:"polygon_barriers",write:!0}})],_.prototype,"polygonBarriers",void 0),e([r({type:Boolean,json:{name:"populate_directions",write:!0}})],_.prototype,"populateDirections",void 0),e([n(u,{name:"route_shape"})],_.prototype,"routeShape",void 0),e([r({type:d,json:{name:"route_specialties",write:!0}})],_.prototype,"routeSpecialties",void 0),e([r({type:d,json:{write:!0}})],_.prototype,"routes",void 0),e([r({type:Boolean,json:{name:"save_output_network_analysis_layer",write:!0}})],_.prototype,"saveOutputNetworkAnalysisLayer",void 0),e([r({type:Boolean,json:{name:"save_route_data",write:!0}})],_.prototype,"saveRouteData",void 0),e([r({type:s,range:{min:1},json:{name:"sequence_gap",write:!0}})],_.prototype,"sequenceGap",void 0),e([n(m,{name:"time_units"})],_.prototype,"timeUnits",void 0),e([n(y,{name:"time_zone_usage_for_time_fields"})],_.prototype,"timeZoneUsage",void 0),e([r({type:c,json:{name:"travel_mode",write:!0}})],_.prototype,"travelMode",void 0),e([r({type:d,json:{write:!0}})],_.prototype,"zones",void 0),_=v=e([a("esri.rest.support.LastMileDeliveryParameters")],_);const j=_;export{j as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- const c="20250819",d="5c3246de86f5874cc0bbf16c329440fdbd18d094";export{c as buildDate,d as commitHash};
5
+ const c="20250822",d="97138d43e361cffd3debdc555ab7a61c45fe8485";export{c as buildDate,d as commitHash};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import{property as r}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as e}from"../../core/accessorSupport/decorators/subclass.js";import s from"./Pattern3D.js";import o from"./styles.js";var p;let i=p=class extends s{constructor(t){super(t),this.type="style",this.style="solid"}clone(){return new p({style:this.style})}};t([r({type:["style"],json:{write:{isRequired:!0}}})],i.prototype,"type",void 0),t([r({type:o,json:{read:!0,write:{isRequired:!0}}})],i.prototype,"style",void 0),i=p=t([e("esri.symbols.patterns.StylePattern3D")],i);export{i as default};
5
+ import{__decorate as t}from"tslib";import{property as r}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as e}from"../../core/accessorSupport/decorators/subclass.js";import s from"./Pattern3D.js";import{fillStyles as o}from"./styles.js";var p;let i=p=class extends s{constructor(t){super(t),this.type="style",this.style="solid"}clone(){return new p({style:this.style})}};t([r({type:["style"],json:{write:{isRequired:!0}}})],i.prototype,"type",void 0),t([r({type:o,json:{read:!0,write:{isRequired:!0}}})],i.prototype,"style",void 0),i=p=t([e("esri.symbols.patterns.StylePattern3D")],i);export{i as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- const a=["backward-diagonal","cross","diagonal-cross","forward-diagonal","horizontal","none","solid","vertical"];export{a as default};
5
+ const o=["backward-diagonal","cross","diagonal-cross","forward-diagonal","horizontal","none","solid","vertical"];export{o as fillStyles};
package/unionTypes.d.ts CHANGED
@@ -1,5 +1,8 @@
1
1
  import "./interfaces";
2
2
 
3
+ export type AnalysisView3DUnion = __esri.unionTypes.AnalysisView3DUnion;
4
+ export type AnalysisView2DUnion = __esri.unionTypes.AnalysisView2DUnion;
5
+ export const AnalysisView2DUnion: typeof __esri.unionTypes.AnalysisView2DUnion;
3
6
  export type AnalysisViewUnion = __esri.unionTypes.AnalysisViewUnion;
4
7
  export type AnalysisUnion = __esri.unionTypes.AnalysisUnion;
5
8
  export type RendererWithVisualVariablesUnion = __esri.unionTypes.RendererWithVisualVariablesUnion;
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
+ */
5
+ import{__decorate as s}from"tslib";import"../../../core/Logger.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import"../../../core/Error.js";import{subclass as r}from"../../../core/accessorSupport/decorators/subclass.js";import{AnalysisView as o}from"../../analysis/AnalysisView.js";let e=class extends o{};e=s([r("esri.views.2d.analysis.AnalysisView2D")],e);export{e as AnalysisView2D};
@@ -0,0 +1,4 @@
1
+ import "../../../interfaces";
2
+
3
+ import ElevationProfileAnalysisView2D = __esri.ElevationProfileAnalysisView2D;
4
+ export default ElevationProfileAnalysisView2D;
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
+ */
5
+ import{__decorate as e}from"tslib";import{property as r}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as t}from"../../../core/accessorSupport/decorators/subclass.js";import{AnalysisView2D as s}from"./AnalysisView2D.js";let o=class extends s{constructor(e){super(e),this.type="elevation-profile-view-2d",this.analysis=null}get interactive(){return super.interactive}set interactive(e){super.interactive=e}get updating(){return!1}get visible(){return super.visible}set visible(e){super.visible=e}};e([r({readOnly:!0})],o.prototype,"type",void 0),e([r({constructOnly:!0,nonNullable:!0})],o.prototype,"analysis",void 0),e([r({readOnly:!0})],o.prototype,"updating",null),o=e([t("esri.views.2d.analysis.ElevationProfileAnalysisView2D")],o);const i=o;export{i as default};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
+ */
5
+ import e from"../../../core/Error.js";const l={"area-measurement":null,dimension:null,"direct-line-measurement":null,"elevation-profile":()=>import("./ElevationProfileAnalysisView2D.js"),"line-of-sight":null,slice:null,viewshed:null,"volume-measurement":null};function n(n){const i=l[n.type];if(!i)throw new e("analysis-view-module-import-utils:analysis-not-supported",`Analysis "${n.type}" is not supported`);return i()}export{l as analysisModules,n as importAnalysisViewModule};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import"../../../../core/has.js";import{disposeMaybe as e,destroyMaybe as t}from"../../../../core/maybe.js";import{brushes as s}from"../brushes.js";import r from"../vectorTiles/shaders/VTLMaterialManager.js";import{BitBlitRenderer as i}from"./BitBlitRenderer.js";import{backbufferStencilVisible as n}from"./definitions.js";import a from"./MaterialManager.js";import o from"./TextureManager.js";import{TextureUploadManager as l}from"./TextureUploadManager.js";import{WorldExtentRenderer as h}from"./WorldExtentClipRenderer.js";import{BlendEffect as f}from"./effects/BlendEffect.js";import{FeatureEffect as c}from"./effects/FeatureEffect.js";import d from"./effects/HighlightEffect.js";import{HittestEffect as p}from"./effects/HittestEffect.js";import{EffectManager as u}from"./effects/post-processing/EffectManager.js";import{SimpleMesh as b}from"./meshing/SimpleMesh.js";import m from"./painter/RenderPass.js";import{TechniqueProgramCache as _}from"./shaderGraph/techniques/TechniqueProgramCache.js";import{SizedDepthStencilFormat as g}from"../../../webgl/enums.js";import{FramebufferObject as w}from"../../../webgl/FramebufferObject.js";import{Renderbuffer as S}from"../../../webgl/Renderbuffer.js";import{RenderbufferDescriptor as M}from"../../../webgl/RenderbufferDescriptor.js";import{TextureDescriptor as E}from"../../../webgl/TextureDescriptor.js";class P{constructor(e,t){this.context=e,this._currentPipelineStateNeedsUpdate=!1,this._blitRenderer=new i,this._worldExtentRenderer=new h,this._brushCache=new Map,this._lastWidth=null,this._lastHeight=null,this._vtlMaterialManager=new r,this._blendEffect=new f,this._stencilBuf=null,this._prevBeforeLayerFBOStack=[],this._fboPool=[],this.effects={highlight:new d,hittest:new p,insideEffect:new c("inside"),outsideEffect:new c("outside")},this._programCache=new _,this.materialManager=new a(e),this.textureManager=new o(t),this.textureUploadManager=new l(t),this._effectsManager=new u,this._quadMesh=b.fromVertexStream(e,[0,0,1,0,0,1,1,1])}dispose(){if(this._programCache.destroy(),this.materialManager.dispose(),this.textureManager.dispose(),this.textureUploadManager.destroy(),this._blitRenderer=e(this._blitRenderer),this._worldExtentRenderer=e(this._worldExtentRenderer),this._quadMesh=t(this._quadMesh),this._brushCache&&(this._brushCache.forEach(e=>e.dispose()),this._brushCache.clear(),this._brushCache=null),this._fbos){let e;for(e in this._fbos)this._fbos[e]&&this._fbos[e].dispose()}for(const e of this._fboPool)e.dispose();if(this._fboPool.length=0,this.effects){let e;for(e in this.effects)this.effects[e]&&this.effects[e].dispose()}this._effectsManager.dispose(),this._blendEffect.dispose(this.context),this._vtlMaterialManager=e(this._vtlMaterialManager)}clearShaderCache(){this._programCache.destroy(),this._programCache=new _}get blitRenderer(){return this._blitRenderer}get vectorTilesMaterialManager(){return this._vtlMaterialManager}get quadMesh(){return this._quadMesh}getFbos(){if(!this._fbos)throw new Error("InternalError: Painter FBOs not initialized");return this._fbos}acquireFbo(e,t){let s;if(this._fboPool.length>0)s=this._fboPool.pop();else{const r=new E(e,t);r.samplingMode=9728,r.wrapMode=33071,s=new w(this.context,r,this._stencilBuf)}return s.width===e&&s.height===t||s.resize(e,t),s}releaseFbo(e){this._fboPool.push(e)}getSharedStencilBuffer(){return this._stencilBuf}beforeRenderPhases(e,t,s){const{context:r}=e;this._worldExtentRenderer.render(e,t,s);const{width:i,height:n}=r.getViewport();if(this.updateFBOs(i,n),this._prevFBO=r.getBoundFramebufferObject(),r.bindFramebuffer(this.getFbos().output),r.setColorMask(!0,!0,!0,!0),null!=t){const{r:e,g:s,b:i,a:n}=t;r.setClearColor(n*e/255,n*s/255,n*i/255,n)}else r.setClearColor(0,0,0,0);r.setDepthWriteEnabled(!0),r.setClearDepth(1),r.clear(16640),r.setDepthWriteEnabled(!1)}afterRenderPhases(e){const{context:t}=e;t.bindFramebuffer(this._prevFBO),t.setStencilFunction(514,n,255),t.setStencilTestEnabled(!0),t.setDepthTestEnabled(!1),this.blitTexture(t,this.getFbos().output.colorTexture,9728)}beforeRenderLayer(e,t,s){const{context:r,blendMode:i,effects:n,drawPhase:a,requireFBO:o}=e;if(r.setClearColor(0,0,0,0),o||C(a,i,n,s)){const e=r.getBoundFramebufferObject();this._prevBeforeLayerFBOStack.push(e);const{width:t,height:s}=r.getViewport(),i=this.acquireFbo(t,s);r.bindFramebuffer(i),r.setColorMask(!0,!0,!0,!0),r.setClearColor(0,0,0,0),r.setDepthWriteEnabled(!0),r.setClearDepth(1),r.clear(16640),r.setDepthWriteEnabled(!1)}r.setDepthWriteEnabled(!1),r.setDepthTestEnabled(!1),r.setStencilTestEnabled(!0),r.setClearStencil(t),r.setStencilWriteMask(255),r.clear(1024)}afterRenderLayer(e,t){const{context:s,blendMode:r,effects:i,requireFBO:n,drawPhase:a}=e;if(n||C(a,r,i,t)){const n=s.getBoundFramebufferObject();null!=i&&i.length>0&&1===a&&(s.setColorMask(!0,!0,!0,!0),this._applyEffects(e,i,n)),s.bindFramebuffer(this._prevBeforeLayerFBOStack.pop()),s.setStencilTestEnabled(!1),s.setStencilWriteMask(0),s.setBlendingEnabled(!0),s.setBlendFunctionSeparate(1,771,1,771),s.setColorMask(!0,!0,!0,!0);const o=null==r||16===a||2===a?"normal":r;this._blendEffect.draw(e,n.colorTexture,9728,o,t),this.releaseFbo(n)}}renderObject(e,t,r,i){const n=s[r];if(!n)return;let a=this._brushCache.get(n);void 0===a&&(a=new n,this._brushCache.set(n,a)),a.prepareState(e),a.draw(e,t,i)}renderObjects(e,t,r,i){const n=s[r];if(!n)return;let a=this._brushCache.get(n);void 0===a&&(a=new n,this._brushCache.set(n,a)),a.drawMany(e,t,i)}registerRenderPass(e){const t=e.brushes.map(e=>(this._brushCache.has(e)||this._brushCache.set(e,new e),this._brushCache.get(e)));return new m(t,e)}blitTexture(e,t,s,r=1){e.setBlendingEnabled(!0),e.setBlendFunctionSeparate(1,771,1,771),e.setColorMask(!0,!0,!0,!0),this._blitRenderer.render(e,t,s,r),this._currentPipelineStateNeedsUpdate=!0}getPostProcessingEffects(e){return this._effectsManager.getPostProcessingEffects(e)}updateFBOs(e,t){if(e!==this._lastWidth||t!==this._lastHeight){if(this._lastWidth=e,this._lastHeight=t,this._fbos){let s;for(s in this._fbos)this._fbos[s].resize(e,t);return}const s=new E(e,t);s.samplingMode=9728,s.wrapMode=33071;const r=new M(g.DEPTH24_STENCIL8,e,t);this._stencilBuf=new S(this.context,r),this._fbos={output:new w(this.context,s,this._stencilBuf),effect0:new w(this.context,s,this._stencilBuf)}}}_applyEffects(e,t,s){const{context:r}=e,i=this._effectsManager.getPostProcessingEffects(t);for(const{postProcessingEffect:n,effect:a}of i)r.bindFramebuffer(s),n.draw(e,s,a);this._currentPipelineStateNeedsUpdate=!0}setShader(e){return this._shaderState={shader:e.shader,uniforms:e.uniforms,defines:e.defines,optionalAttributes:e.optionalAttributes,useComputeBuffer:e.useComputeBuffer??!1},this._shaderState}setPipelineState(e){e!==this._currentPipelineState&&(this._currentPipelineState=e,this._currentPipelineStateNeedsUpdate=!0)}submitDraw(e,t,s){let r=s?.stencilRef;if(!this._shaderState)return null;const{shader:i,uniforms:n,defines:a,optionalAttributes:o}=this._shaderState,l=e.context,h=t.getAttributePrecisionPackFactors(),f=this._programCache.getProgram(i,h,n,a??{},o??{});if(f.setUniforms(n),f.bind(l),this.updatePipelineState(l),null==r){const e=t.getStencilReference();null!=e&&(r=e)}return null!=r&&this.setStencilRef(l,r),t.draw(e,i.locationInfo),f.cleanupTemporaryTextures(),{vertexShader:f.vertexShader,fragmentShader:f.fragmentShader}}submitDrawMesh(e,t,s,r){this.submitDrawMeshUntyped(e,t,s,r)}submitDrawMeshUntyped(e,t,s,r){const i=r?.parts,n=r?.stencilRef,{shader:a,uniforms:o,defines:l,optionalAttributes:h}=this.setShader(t),f=this._programCache.getProgram(a,{},o,l??{},h??{});if(f.setUniforms(o),f.bind(e),this.updatePipelineState(e),this.setStencilRef(e,n),i)for(const c of i)s.bind(e,t.shader.locationInfo,c),s.draw(e);else for(let c=0;c<s.parts.length;c++)s.bind(e,t.shader.locationInfo,c),s.draw(e);s.unbind(e),f.cleanupTemporaryTextures()}updatePipelineState(e){this._currentPipelineStateNeedsUpdate&&(this._currentPipelineStateNeedsUpdate=!1,this._updatePipelineState(e))}_updatePipelineState(e){if(null==this._currentPipelineState)throw new Error("Pipeline state not defined. Call setPipelineState before calling submitDraw ");const{color:t,depth:s,stencil:r}=this._currentPipelineState;if(t){const{blendMode:s,write:r}=t;switch(e.setColorMask(...r),e.setBlendingEnabled(!0),e.setBlendEquation(32774),s){case"composite":e.setBlendFunctionSeparate(1,771,1,771);break;case"additive":e.setBlendFunctionSeparate(1,1,1,1);break;case"custom":{const{blendParameters:s}=t,{dstAlpha:r,dstRGB:i,srcAlpha:n,srcRGB:a}=s;e.setBlendFunctionSeparate(a,i,n,r);break}case"delete":e.setBlendEquation(32779),e.setBlendFunctionSeparate(1,771,1,771)}}else e.setColorMask(!1,!1,!1,!1);if(s){const{test:t,write:r}=s;r?(e.setDepthWriteEnabled(!0),e.setDepthRange(r.zNear,r.zFar)):e.setDepthWriteEnabled(!1),t?(e.setDepthTestEnabled(!0),e.setDepthFunction(t)):e.setDepthTestEnabled(!1)}else e.setDepthTestEnabled(!1),e.setDepthWriteEnabled(!1);if(r){const{test:t,write:s}=r;if(t){const{op:s}=t;e.setStencilTestEnabled(!0),e.setStencilOpSeparate(1032,s.fail,s.zFail,s.zPass)}else e.setStencilTestEnabled(!1);if(s){const{mask:t}=s;e.setStencilWriteMask(t)}else e.setStencilWriteMask(0)}else e.setStencilTestEnabled(!1),e.setStencilWriteMask(0)}setStencilRef(e,t){if(null==this._currentPipelineState)throw new Error("Pipeline state not defined. Call setPipelineState before calling submitDraw ");const{stencil:s}=this._currentPipelineState;if(s){const{test:r}=s;if(r){const{compare:s,mask:i}=r;if(null==t)throw new Error("InternalError: Stencil reference expected for target but not defined");e.setStencilFunctionSeparate(1032,s,t,i)}}}}function C(e,t,s,r){return 4!==e&&2!==e&&16!==e&&(1!==r||null!=t&&"normal"!==t||null!=s&&s.length>0)}export{P as default};
5
+ import"../../../../core/has.js";import{disposeMaybe as e,destroyMaybe as t}from"../../../../core/maybe.js";import{brushes as s}from"../brushes.js";import r from"../vectorTiles/shaders/VTLMaterialManager.js";import{BitBlitRenderer as i}from"./BitBlitRenderer.js";import{backbufferStencilVisible as n}from"./definitions.js";import a from"./MaterialManager.js";import o from"./TextureManager.js";import{TextureUploadManager as l}from"./TextureUploadManager.js";import{WorldExtentRenderer as h}from"./WorldExtentClipRenderer.js";import{BlendEffect as f}from"./effects/BlendEffect.js";import{FeatureEffect as c}from"./effects/FeatureEffect.js";import d from"./effects/HighlightEffect.js";import{HittestEffect as p}from"./effects/HittestEffect.js";import{EffectManager as u}from"./effects/post-processing/EffectManager.js";import{SimpleMesh as b}from"./meshing/SimpleMesh.js";import m from"./painter/RenderPass.js";import{TechniqueProgramCache as _}from"./shaderGraph/techniques/TechniqueProgramCache.js";import{SizedDepthStencilFormat as g}from"../../../webgl/enums.js";import{FramebufferObject as w}from"../../../webgl/FramebufferObject.js";import{Renderbuffer as S}from"../../../webgl/Renderbuffer.js";import{RenderbufferDescriptor as M}from"../../../webgl/RenderbufferDescriptor.js";import{TextureDescriptor as E}from"../../../webgl/TextureDescriptor.js";class P{constructor(e,t){this.context=e,this._currentPipelineStateNeedsUpdate=!1,this._blitRenderer=new i,this._worldExtentRenderer=new h,this._brushCache=new Map,this._lastWidth=null,this._lastHeight=null,this._vtlMaterialManager=new r,this._blendEffect=new f,this._stencilBuf=null,this._prevBeforeLayerFBOStack=[],this._fboPool=[],this.effects={highlight:new d,hittest:new p,insideEffect:new c("inside"),outsideEffect:new c("outside")},this._programCache=new _,this.materialManager=new a(e),this.textureManager=new o(t),this.textureUploadManager=new l(t),this._effectsManager=new u,this._quadMesh=b.fromVertexStream(e,[0,0,1,0,0,1,1,1])}dispose(){if(this._programCache.destroy(),this.materialManager.dispose(),this.textureManager.dispose(),this.textureUploadManager.destroy(),this._blitRenderer=e(this._blitRenderer),this._worldExtentRenderer=e(this._worldExtentRenderer),this._quadMesh=t(this._quadMesh),this._brushCache&&(this._brushCache.forEach(e=>e.dispose()),this._brushCache.clear(),this._brushCache=null),this._fbos){let e;for(e in this._fbos)this._fbos[e]&&this._fbos[e].dispose()}for(const e of this._fboPool)e.dispose();if(this._fboPool.length=0,this.effects){let e;for(e in this.effects)this.effects[e]&&this.effects[e].dispose()}this._effectsManager.dispose(),this._blendEffect.dispose(this.context),this._vtlMaterialManager=e(this._vtlMaterialManager)}clearShaderCache(){this._programCache.destroy(),this._programCache=new _}get blitRenderer(){return this._blitRenderer}get vectorTilesMaterialManager(){return this._vtlMaterialManager}get quadMesh(){return this._quadMesh}getFbos(){if(!this._fbos)throw new Error("InternalError: Painter FBOs not initialized");return this._fbos}acquireFbo(e,t){let s;if(this._fboPool.length>0)s=this._fboPool.pop();else{const r=new E(e,t);r.samplingMode=9728,r.wrapMode=33071,s=new w(this.context,r,this._stencilBuf)}return s.width===e&&s.height===t||s.resize(e,t),s}releaseFbo(e){this._fboPool.push(e)}getSharedStencilBuffer(){return this._stencilBuf}beforeRenderPhases(e,t,s){const{context:r}=e;this._worldExtentRenderer.render(e,t,s);const{width:i,height:n}=r.getViewport();if(this.updateFBOs(i,n),this._prevFBO=r.getBoundFramebufferObject(),r.bindFramebuffer(this.getFbos().output),r.setColorMask(!0,!0,!0,!0),null!=t){const{r:e,g:s,b:i,a:n}=t;r.setClearColor(n*e/255,n*s/255,n*i/255,n)}else r.setClearColor(0,0,0,0);r.setDepthWriteEnabled(!0),r.setClearDepth(1),r.clear(16640),r.setDepthWriteEnabled(!1)}afterRenderPhases(e){const{context:t}=e;t.bindFramebuffer(this._prevFBO),t.setStencilFunction(514,n,255),t.setStencilTestEnabled(!0),t.setDepthTestEnabled(!1),this.blitTexture(t,this.getFbos().output.colorTexture,9728)}beforeRenderLayer(e,t,s){const{context:r,blendMode:i,effects:n,drawPhase:a,requireFBO:o}=e;if(r.setClearColor(0,0,0,0),o||C(a,i,n,s)){const e=r.getBoundFramebufferObject();this._prevBeforeLayerFBOStack.push(e);const{width:t,height:s}=r.getViewport(),i=this.acquireFbo(t,s);r.bindFramebuffer(i),r.setColorMask(!0,!0,!0,!0),r.setClearColor(0,0,0,0),r.setDepthWriteEnabled(!0),r.setClearDepth(1),r.clear(16640),r.setDepthWriteEnabled(!1)}r.setDepthWriteEnabled(!1),r.setDepthTestEnabled(!1),r.setStencilTestEnabled(!0),r.setClearStencil(t),r.setStencilWriteMask(255),r.clear(1024)}afterRenderLayer(e,t){const{context:s,blendMode:r,effects:i,requireFBO:n,drawPhase:a}=e;if(n||C(a,r,i,t)){const n=s.getBoundFramebufferObject();null!=i&&i.length>0&&1===a&&(s.setColorMask(!0,!0,!0,!0),this._applyEffects(e,i,n)),s.bindFramebuffer(this._prevBeforeLayerFBOStack.pop()),s.setStencilTestEnabled(!1),s.setStencilWriteMask(0),s.setBlendingEnabled(!0),s.setBlendFunctionSeparate(1,771,1,771),s.setColorMask(!0,!0,!0,!0);const o=null==r||16===a||2===a?"normal":r;this._blendEffect.draw(e,n.colorTexture,9728,o,t),this.releaseFbo(n)}}renderObject(e,t,r,i){const n=s[r];if(!n)return;let a=this._brushCache.get(n);void 0===a&&(a=new n,this._brushCache.set(n,a)),a.prepareState(e),a.draw(e,t,i)}renderObjects(e,t,r,i){const n=s[r];if(!n)return;let a=this._brushCache.get(n);void 0===a&&(a=new n,this._brushCache.set(n,a)),a.drawMany(e,t,i)}registerRenderPass(e){const t=e.brushes.map(e=>(this._brushCache.has(e)||this._brushCache.set(e,new e),this._brushCache.get(e)));return new m(t,e)}blitTexture(e,t,s,r=1){e.setBlendingEnabled(!0),e.setBlendFunctionSeparate(1,771,1,771),e.setColorMask(!0,!0,!0,!0),this._blitRenderer.render(e,t,s,r),this._currentPipelineStateNeedsUpdate=!0}getPostProcessingEffects(e){return this._effectsManager.getPostProcessingEffects(e)}updateFBOs(e,t){if(e!==this._lastWidth||t!==this._lastHeight){if(this._lastWidth=e,this._lastHeight=t,this._fbos){let s;for(s in this._fbos)this._fbos[s].resize(e,t);return}const s=new E(e,t);s.samplingMode=9728,s.wrapMode=33071;const r=new M(g.DEPTH24_STENCIL8,e,t);this._stencilBuf=new S(this.context,r),this._fbos={output:new w(this.context,s,this._stencilBuf),effect0:new w(this.context,s,this._stencilBuf)}}}_applyEffects(e,t,s){const{context:r}=e,i=this._effectsManager.getPostProcessingEffects(t);for(const{postProcessingEffect:n,effect:a}of i)r.bindFramebuffer(s),n.draw(e,s,a);this._currentPipelineStateNeedsUpdate=!0}setShader(e){return this._shaderState={shader:e.shader,uniforms:e.uniforms,defines:e.defines,optionalAttributes:e.optionalAttributes,useComputeBuffer:e.useComputeBuffer??!1},this._shaderState}setPipelineState(e){e!==this._currentPipelineState&&(this._currentPipelineState=e,this._currentPipelineStateNeedsUpdate=!0)}submitDraw(e,t,s){let r=s?.stencilRef;if(!this._shaderState)return null;const{shader:i,uniforms:n,defines:a,optionalAttributes:o}=this._shaderState,l=e.context,h=t.getAttributePrecisionPackFactors(),f=this._programCache.getProgram(i,h,n,a??{},o??{});if(f.setUniforms(n),f.bind(l),this.updatePipelineState(l),null==r){const e=t.getStencilReference();null!=e&&(r=e)}return null!=r&&this.setStencilRef(l,r),t.draw(e,i.locationInfo),f.cleanupTemporaryTextures(),{vertexShader:f.vertexShader,fragmentShader:f.fragmentShader}}submitDrawMesh(e,t,s,r){this.submitDrawMeshUntyped(e,t,s,r)}submitDrawMeshUntyped(e,t,s,r){const i=r?.parts,n=r?.stencilRef,{shader:a,uniforms:o,defines:l,optionalAttributes:h}=this.setShader(t),f=this._programCache.getProgram(a,{},o,l??{},h??{});if(f.setUniforms(o),f.bind(e),this.updatePipelineState(e),this.setStencilRef(e,n),i)for(const c of i)s.bind(e,t.shader.locationInfo,c),s.draw(e);else for(let c=0;c<s.parts.length;c++)s.bind(e,t.shader.locationInfo,c),s.draw(e);s.unbind(e),f.cleanupTemporaryTextures()}updatePipelineState(e){this._currentPipelineStateNeedsUpdate&&(this._currentPipelineStateNeedsUpdate=!1,this._updatePipelineState(e))}_updatePipelineState(e){if(null==this._currentPipelineState)throw new Error("Pipeline state not defined. Call setPipelineState before calling submitDraw ");const{color:t,depth:s,stencil:r}=this._currentPipelineState;if(t){const{blendMode:s,write:r}=t;switch(e.setColorMask(...r),e.setBlendingEnabled("none"!==s),e.setBlendEquation(32774),s){case"composite":e.setBlendFunctionSeparate(1,771,1,771);break;case"additive":e.setBlendFunctionSeparate(1,1,1,1);break;case"custom":{const{blendParameters:s}=t,{dstAlpha:r,dstRGB:i,srcAlpha:n,srcRGB:a}=s;e.setBlendFunctionSeparate(a,i,n,r);break}case"delete":e.setBlendEquation(32779),e.setBlendFunctionSeparate(1,771,1,771)}}else e.setColorMask(!1,!1,!1,!1);if(s){const{test:t,write:r}=s;r?(e.setDepthWriteEnabled(!0),e.setDepthRange(r.zNear,r.zFar)):e.setDepthWriteEnabled(!1),t?(e.setDepthTestEnabled(!0),e.setDepthFunction(t)):e.setDepthTestEnabled(!1)}else e.setDepthTestEnabled(!1),e.setDepthWriteEnabled(!1);if(r){const{test:t,write:s}=r;if(t){const{op:s}=t;e.setStencilTestEnabled(!0),e.setStencilOpSeparate(1032,s.fail,s.zFail,s.zPass)}else e.setStencilTestEnabled(!1);if(s){const{mask:t}=s;e.setStencilWriteMask(t)}else e.setStencilWriteMask(0)}else e.setStencilTestEnabled(!1),e.setStencilWriteMask(0)}setStencilRef(e,t){if(null==this._currentPipelineState)throw new Error("Pipeline state not defined. Call setPipelineState before calling submitDraw ");const{stencil:s}=this._currentPipelineState;if(s){const{test:r}=s;if(r){const{compare:s,mask:i}=r;if(null==t)throw new Error("InternalError: Stencil reference expected for target but not defined");e.setStencilFunctionSeparate(1032,s,t,i)}}}}function C(e,t,s,r){return 4!==e&&2!==e&&16!==e&&(1!==r||null!=t&&"normal"!==t||null!=s&&s.length>0)}export{P as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import"../../../../../core/has.js";import e from"../../../../../core/Logger.js";import{Float as r,Int as o,Vec4 as n,Vec2 as s}from"./graph/glsl.js";import{GlslShaderWriter as i}from"./graph/GlslGraphWriter.js";import{ShaderGraphContext as p}from"./graph/ShaderGraphContext.js";import{setReachableUids as a}from"./graph/ShaderGraphNode.js";import{TypedShaderProgram as u}from"./typed/TypedShaderProgram.js";import{ShaderBuilder as c}from"../../../../webgl/ShaderBuilder.js";function y(t){return new t}function d(t,e,r){const o=t.constructor[e]??[];t.constructor.hasOwnProperty(e)||Object.defineProperty(t.constructor,e,{value:o.slice()}),t.constructor[e].push(r)}function f(t,e){return(r,o)=>{d(r,"locations",{typeCtor:e,propertyKey:o,parameterIndex:null,index:t})}}const h=t=>(e,r)=>{d(e,"builtins",{builtin:t,propertyKey:r})},l=t=>(e,r,o)=>{d(e,"inputs",{inputCtor:t,propertyKey:r,parameterIndex:o})},m=t=>(e,r)=>{d(e,"uniforms",{typeCtor:t,propertyKey:r})},g=t=>(e,r)=>{d(e,"options",{typeCtor:t,propertyKey:r})},_=(t,e)=>{d(t,"defines",{propertyKey:e})};function K(t){return(e,r)=>{d(e,"transformFeedbackBindings",{propertyKey:r,parameterIndex:null,index:t})}}const b=(t,e)=>(r,o)=>{r.constructor.builtins.push({builtin:t,propertyKey:o,typeCtor:e})};class x{static{this.builtins=[]}}t([b("gl_VertexID",o)],x.prototype,"glVertexID",void 0);class C{}class I{static{this.builtins=[]}}t([b("gl_FragCoord",n)],I.prototype,"glFragCoord",void 0),t([b("gl_PointCoord",s)],I.prototype,"glPointCoord",void 0);class v{}t([h("gl_FragDepth")],v.prototype,"glFragDepth",void 0);class w{constructor(){this.type="uniform-group"}get _uniforms(){return this.constructor.uniforms??[]}}class P{constructor(){this.logShader=!1,this.computeAttributes={}}get vertexInput(){const t=this._shaderModuleClass.inputs.findLast(t=>"vertex"===t.propertyKey&&0===t.parameterIndex);if(!t)throw new Error("Unable to find vertex input parameter");return t}get computeInput(){return this._shaderModuleClass.inputs.findLast(t=>"vertex"===t.propertyKey&&1===t.parameterIndex)}get fragmentInput(){const t=this._shaderModuleClass.inputs.findLast(t=>"fragment"===t.propertyKey);if(!t)throw new Error("Unable to find fragment input parameter");return t}get transformFeedbackBindings(){return this.fragmentInput.inputCtor.transformFeedbackBindings??[]}get locations(){return[...this.vertexInput.inputCtor.locations,...this.computeInput?.inputCtor.locations??[]]}get locationsMap(){const t=new Map,r=new Set;for(const o of this.locations)r.has(o.index)?e.getLogger("esri.views.2d.engine.webgl.shaderGraph.GraphShaderModule").warnOnce("mapview-rendering",`Unable to assigned attribute ${o.propertyKey} to ${o.index}. Index already in use`,{locationsMap:t}):(t.set(o.propertyKey,o.index),r.add(o.index));return t}get locationInfo(){if(!this._locationInfo){const t=this.locationsMap,e=Array.from(t.entries()).map(([t,e])=>`${t}.${e}`).join("."),r=this.computeAttributes;this._locationInfo={stringHash:e,locations:t,computeAttributeMap:r}}return this._locationInfo}get renamedLocationsMap(){const t=new Map;for(const e of this.locations)t.set("a_"+e.propertyKey,e.index);return t}get optionPropertyKeys(){if(!this._optionPropertyKeys){const t=new Set;for(const e of this._options)t.add(e.propertyKey);this._optionPropertyKeys=t}return this._optionPropertyKeys}get _shaderModuleClass(){return this.constructor}get _defines(){return this._shaderModuleClass.defines??[]}get _options(){return this._shaderModuleClass.options??[]}get _uniforms(){return this._shaderModuleClass.uniforms??[]}getProgram(t,e,r,o){try{const{vertex:n,fragment:s,uniformBindings:i}=this._generateShaders(t,e,r,o);return new u(n,s,this.renamedLocationsMap,i,this.transformFeedbackBindings)}catch(n){return new u("","",this.renamedLocationsMap,[],this.transformFeedbackBindings)}}getDebugUniformClassInfo(t){const e=this._options.find(e=>e.propertyKey===t);if(e)return{type:"option",className:e.typeCtor};const r=this._uniforms.find(e=>e.propertyKey===t);if(!r)throw new Error(`Unable to find uniform class type for property: ${t}`);return{type:"required",className:r.typeCtor}}getShaderKey(t,e,r,o){const n=Object.keys(t).map(e=>`${e}.${t[e]}`).join("."),s=Object.keys(r).map(t=>`${t}.${r[t]}`).join("."),i=Object.keys(o).map(t=>`${t}.${o[t]}`).join("."),p=Object.keys(e).filter(t=>this.optionPropertyKeys.has(t)&&e[t]).join(".");return`${this.type}.${n}.${s}.${i}.${p}`}_generateShaders(t,e,r,o){const n=[];this._setDefines(r),this._setOptionalUniforms(n,e),this._setRequiredUniforms(n);const s=this._hydrateVertexInput(o),u=this._injectPackPrecisionFactor(s,t),c=this._hydrateComputeInput(),y=c&&this._injectComputePackPrecisionFactor(c,t),d=this.vertex(u,y),f=this._hydrateFragmentInput(d),h=this.fragment(f),l=new Set;for(const i in h){const t=h[i];a(l,t)}const m=this._getVertexInputBuiltins(),g={};for(const[i,p]of Object.entries(s))g[i]=p;if(null!=c)for(const[i,p]of Object.entries(c))g[i]=p;const _=p.createVertex(g,d,m,n,this.transformFeedbackBindings,l);(new i).write(_);const K=this._getFragmentInputBuiltins(h);K.set("glPointCoord","gl_PointCoord");const b=p.createFragment(f,h,K,n,_,this.transformFeedbackBindings);(new i).write(b);const x=this._createShaderBuilder(_,b),C=x.generate("vertex"),I=x.generate("fragment");return this.logShader&&(console.log(C),console.log(I)),{vertex:C,fragment:I,uniformBindings:n}}_setDefines(t){for(const e in t)this[e]=t[e]}_setOptionalUniforms(t,e){for(const r of this._options){e[r.propertyKey]?this[r.propertyKey]=this._hydrateUniformGroup(t,r):this[r.propertyKey]=null}}_setRequiredUniforms(t){for(const e of this._uniforms)this[e.propertyKey]=this._hydrateUniformGroup(t,e)}_hydrateUniformGroup(t,e){const r=new(0,e.typeCtor);for(const o of r._uniforms??[]){const n=y(o.typeCtor),s=`u_${e.propertyKey}_${o.propertyKey}`,i=n.type,p=[e.propertyKey,o.propertyKey].join(".");if("type"in o.typeCtor&&"array"===o.typeCtor.type){const e=n;t.push({shaderModulePath:p,uniformName:s,uniformType:i,uniformArrayLength:e.size,uniformArrayElementType:e.elementType.type,uniformHydrated:n})}else if("type"in o.typeCtor&&"array-2d"===o.typeCtor.type){const e=n;t.push({shaderModulePath:p,uniformName:s,uniformType:i,uniformArrayLength:e.size,uniformArrayElementType:e.elementType.type,uniformHydrated:n})}else t.push({shaderModulePath:p,uniformName:s,uniformType:i,uniformHydrated:n});r[o.propertyKey]=n}return r}_hydrateVertexInput(t){const e=this.vertexInput.inputCtor,r=e.locations.reduce((e,r)=>!1===t[r.propertyKey]?e:{...e,[r.propertyKey]:y(r.typeCtor)},{});for(const{propertyKey:o,typeCtor:n}of e.builtins){const t=y(n);r[o]=t}return r}_hydrateComputeInput(){if(null==this.computeInput)return null;return this.computeInput.inputCtor.locations.reduce((t,e)=>({...t,[e.propertyKey]:y(e.typeCtor)}),{})}_injectPackPrecisionFactor(t,e){const o={};for(const n in t){const s=t[n],i=e[n];if(i){if("float"!==s.type&&"vec2"!==s.type&&"vec3"!==s.type&&"vec4"!==s.type)throw new Error(`InternalError: packPrecisionFactor requires GenType, but found ${s.type}`);o[n]=s.divide(new r(i))}else o[n]=s}return o}_injectComputePackPrecisionFactor(t,e){const o={},n=new Map;for(const r in this.computeAttributes)for(const t of this.computeAttributes[r]??[])n.set(t,r);for(const s in t){const i=t[s],p=n.get(s);if(!p)continue;const a=e[p];if(a){if("float"!==i.type&&"vec2"!==i.type&&"vec3"!==i.type&&"vec4"!==i.type)throw new Error(`InternalError: packPrecisionFactor requires GenType, but found ${i.type}`);o[s]=i.divide(new r(a))}else o[s]=i}return o}_hydrateFragmentInput(t){const e={};for(const r in t)e[r]=t[r];for(const{propertyKey:r,typeCtor:o}of I.builtins){const t=y(o);e[r]=t}return e}_getVertexInputBuiltins(){const t=this.vertexInput.inputCtor,e=new Map;for(const{builtin:r,propertyKey:o}of t.builtins)e.set(o,r);return e}_getFragmentInputBuiltins(t){const e=t.constructor,r=new Map;for(const o of e.builtins??[])r.set(o.propertyKey,o.builtin);return r}_createShaderBuilder(t,e){const r=new c;return this._insertDebugInfo(r),t.insertVertexShader(r),e.insertFragmentShader(r),r}_insertDebugInfo(t){t.vertex.code.add("// DEFINES: "),t.vertex.code.add("// --------------------------------------------------------- ");for(const e of this._defines)this[e.propertyKey]?t.vertex.code.add(`// ${e.propertyKey}: true`):t.vertex.code.add(`// ${e.propertyKey}: false`);t.vertex.code.add(""),t.vertex.code.add("// OPTIONS: "),t.vertex.code.add("// --------------------------------------------------------- ");for(const e of this._options)this[e.propertyKey]?t.vertex.code.add(`// ${e.propertyKey}: true`):t.vertex.code.add(`// ${e.propertyKey}: false`)}}export{C as ComputeVertexInput,I as FragmentInput,v as FragmentOutput,P as GraphShaderModule,w as UniformGroup,x as VertexInput,h as builtin,_ as define,l as input,f as location,g as option,K as transformFeedback,m as uniform};
5
+ import{__decorate as t}from"tslib";import"../../../../../core/has.js";import e from"../../../../../core/Logger.js";import{Float as r,Int as o,Vec4 as n,Vec2 as s}from"./graph/glsl.js";import{GlslShaderWriter as i}from"./graph/GlslGraphWriter.js";import{ShaderGraphContext as p}from"./graph/ShaderGraphContext.js";import{setReachableUids as a}from"./graph/ShaderGraphNode.js";import{TypedShaderProgram as u}from"./typed/TypedShaderProgram.js";import{ShaderBuilder as c}from"../../../../webgl/ShaderBuilder.js";function y(t){return new t}function d(t,e,r){const o=t.constructor[e]??[];t.constructor.hasOwnProperty(e)||Object.defineProperty(t.constructor,e,{value:o.slice()}),t.constructor[e].push(r)}function f(t,e){return(r,o)=>{d(r,"locations",{typeCtor:e,propertyKey:o,parameterIndex:null,index:t})}}const h=t=>(e,r)=>{d(e,"builtins",{builtin:t,propertyKey:r})},l=t=>(e,r,o)=>{d(e,"inputs",{inputCtor:t,propertyKey:r,parameterIndex:o})},m=t=>(e,r)=>{d(e,"uniforms",{typeCtor:t,propertyKey:r})},g=t=>(e,r)=>{d(e,"options",{typeCtor:t,propertyKey:r})},_=(t,e)=>{d(t,"defines",{propertyKey:e})};function K(t){return(e,r)=>{d(e,"transformFeedbackBindings",{propertyKey:r,parameterIndex:null,index:t})}}const b=(t,e)=>(r,o)=>{r.constructor.builtins.push({builtin:t,propertyKey:o,typeCtor:e})};class C{static{this.builtins=[]}}t([b("gl_VertexID",o)],C.prototype,"glVertexID",void 0);class x{}class I{static{this.builtins=[]}}t([b("gl_FragCoord",n)],I.prototype,"glFragCoord",void 0),t([b("gl_PointCoord",s)],I.prototype,"glPointCoord",void 0);class v{}t([h("gl_FragDepth")],v.prototype,"glFragDepth",void 0);class w{constructor(){this.type="uniform-group"}get _uniforms(){return this.constructor.uniforms??[]}}class P{constructor(){this.logShader=!1,this.computeAttributes={}}get vertexInput(){const t=this._shaderModuleClass.inputs.findLast(t=>"vertex"===t.propertyKey&&0===t.parameterIndex);if(!t)throw new Error("Unable to find vertex input parameter");return t}get computeInput(){return this._shaderModuleClass.inputs.findLast(t=>"vertex"===t.propertyKey&&1===t.parameterIndex)}get fragmentInput(){const t=this._shaderModuleClass.inputs.findLast(t=>"fragment"===t.propertyKey);if(!t)throw new Error("Unable to find fragment input parameter");return t}get transformFeedbackBindings(){return this.fragmentInput.inputCtor.transformFeedbackBindings??[]}get locations(){return[...this.vertexInput.inputCtor.locations,...this.computeInput?.inputCtor.locations??[]]}get locationsMap(){const t=new Map,r=new Set;for(const o of this.locations)r.has(o.index)?e.getLogger("esri.views.2d.engine.webgl.shaderGraph.GraphShaderModule").warnOnce("mapview-rendering",`Unable to assigned attribute ${o.propertyKey} to ${o.index}. Index already in use`,{locationsMap:t}):(t.set(o.propertyKey,o.index),r.add(o.index));return t}get locationInfo(){if(!this._locationInfo){const t=this.locationsMap,e=Array.from(t.entries()).map(([t,e])=>`${t}.${e}`).join("."),r=this.computeAttributes;this._locationInfo={stringHash:e,locations:t,computeAttributeMap:r}}return this._locationInfo}get renamedLocationsMap(){const t=new Map;for(const e of this.locations)t.set("a_"+e.propertyKey,e.index);return t}get optionPropertyKeys(){if(!this._optionPropertyKeys){const t=new Set;for(const e of this._options)t.add(e.propertyKey);this._optionPropertyKeys=t}return this._optionPropertyKeys}get _shaderModuleClass(){return this.constructor}get _defines(){return this._shaderModuleClass.defines??[]}get _options(){return this._shaderModuleClass.options??[]}get _uniforms(){return this._shaderModuleClass.uniforms??[]}getProgram(t,e,r,o){try{const{vertex:n,fragment:s,uniformBindings:i}=this._generateShaders(t,e,r,o);return new u(n,s,this.renamedLocationsMap,i,this.transformFeedbackBindings)}catch(n){return new u("","",this.renamedLocationsMap,[],this.transformFeedbackBindings)}}getDebugUniformClassInfo(t){const e=this._options.find(e=>e.propertyKey===t);if(e)return{type:"option",className:e.typeCtor};const r=this._uniforms.find(e=>e.propertyKey===t);if(!r)throw new Error(`Unable to find uniform class type for property: ${t}`);return{type:"required",className:r.typeCtor}}getShaderKey(t,e,r,o){const n=Object.keys(t).map(e=>`${e}.${t[e]}`).join("."),s=Object.keys(r).map(t=>`${t}.${r[t]}`).join("."),i=Object.keys(o).map(t=>`${t}.${o[t]}`).join("."),p=Object.keys(e).filter(t=>this.optionPropertyKeys.has(t)&&e[t]).join(".");return`${this.type}.${n}.${s}.${i}.${p}`}_generateShaders(t,e,r,o){const n=[];this._setDefines(r),this._setOptionalUniforms(n,e),this._setRequiredUniforms(n);const s=this._hydrateVertexInput(o),u=this._injectPackPrecisionFactor(s,t),c=this._hydrateComputeInput(),y=c&&this._injectComputePackPrecisionFactor(c,t),d=this.vertex(u,y),f=this._hydrateFragmentInput(d),h=this.fragment(f),l=new Set;for(const i in h){const t=h[i];a(l,t)}const m=this._getVertexInputBuiltins(),g={};for(const[i,p]of Object.entries(s))g[i]=p;if(null!=c)for(const[i,p]of Object.entries(c))g[i]=p;const _=p.createVertex(g,d,m,n,this.transformFeedbackBindings,l);(new i).write(_);const K=this._getFragmentInputBuiltins(h);K.set("glPointCoord","gl_PointCoord"),K.set("glFragCoord","gl_FragCoord");const b=p.createFragment(f,h,K,n,_,this.transformFeedbackBindings);(new i).write(b);const C=this._createShaderBuilder(_,b),x=C.generate("vertex"),I=C.generate("fragment");return this.logShader&&(console.log(x),console.log(I)),{vertex:x,fragment:I,uniformBindings:n}}_setDefines(t){for(const e in t)this[e]=t[e]}_setOptionalUniforms(t,e){for(const r of this._options){e[r.propertyKey]?this[r.propertyKey]=this._hydrateUniformGroup(t,r):this[r.propertyKey]=null}}_setRequiredUniforms(t){for(const e of this._uniforms)this[e.propertyKey]=this._hydrateUniformGroup(t,e)}_hydrateUniformGroup(t,e){const r=new(0,e.typeCtor);for(const o of r._uniforms??[]){const n=y(o.typeCtor),s=`u_${e.propertyKey}_${o.propertyKey}`,i=n.type,p=[e.propertyKey,o.propertyKey].join(".");if("type"in o.typeCtor&&"array"===o.typeCtor.type){const e=n;t.push({shaderModulePath:p,uniformName:s,uniformType:i,uniformArrayLength:e.size,uniformArrayElementType:e.elementType.type,uniformHydrated:n})}else if("type"in o.typeCtor&&"array-2d"===o.typeCtor.type){const e=n;t.push({shaderModulePath:p,uniformName:s,uniformType:i,uniformArrayLength:e.size,uniformArrayElementType:e.elementType.type,uniformHydrated:n})}else t.push({shaderModulePath:p,uniformName:s,uniformType:i,uniformHydrated:n});r[o.propertyKey]=n}return r}_hydrateVertexInput(t){const e=this.vertexInput.inputCtor,r=e.locations.reduce((e,r)=>!1===t[r.propertyKey]?e:{...e,[r.propertyKey]:y(r.typeCtor)},{});for(const{propertyKey:o,typeCtor:n}of e.builtins){const t=y(n);r[o]=t}return r}_hydrateComputeInput(){if(null==this.computeInput)return null;return this.computeInput.inputCtor.locations.reduce((t,e)=>({...t,[e.propertyKey]:y(e.typeCtor)}),{})}_injectPackPrecisionFactor(t,e){const o={};for(const n in t){const s=t[n],i=e[n];if(i){if("float"!==s.type&&"vec2"!==s.type&&"vec3"!==s.type&&"vec4"!==s.type)throw new Error(`InternalError: packPrecisionFactor requires GenType, but found ${s.type}`);o[n]=s.divide(new r(i))}else o[n]=s}return o}_injectComputePackPrecisionFactor(t,e){const o={},n=new Map;for(const r in this.computeAttributes)for(const t of this.computeAttributes[r]??[])n.set(t,r);for(const s in t){const i=t[s],p=n.get(s);if(!p)continue;const a=e[p];if(a){if("float"!==i.type&&"vec2"!==i.type&&"vec3"!==i.type&&"vec4"!==i.type)throw new Error(`InternalError: packPrecisionFactor requires GenType, but found ${i.type}`);o[s]=i.divide(new r(a))}else o[s]=i}return o}_hydrateFragmentInput(t){const e={};for(const r in t)e[r]=t[r];for(const{propertyKey:r,typeCtor:o}of I.builtins){const t=y(o);e[r]=t}return e}_getVertexInputBuiltins(){const t=this.vertexInput.inputCtor,e=new Map;for(const{builtin:r,propertyKey:o}of t.builtins)e.set(o,r);return e}_getFragmentInputBuiltins(t){const e=t.constructor,r=new Map;for(const o of e.builtins??[])r.set(o.propertyKey,o.builtin);return r}_createShaderBuilder(t,e){const r=new c;return this._insertDebugInfo(r),t.insertVertexShader(r),e.insertFragmentShader(r),r}_insertDebugInfo(t){t.vertex.code.add("// DEFINES: "),t.vertex.code.add("// --------------------------------------------------------- ");for(const e of this._defines)this[e.propertyKey]?t.vertex.code.add(`// ${e.propertyKey}: true`):t.vertex.code.add(`// ${e.propertyKey}: false`);t.vertex.code.add(""),t.vertex.code.add("// OPTIONS: "),t.vertex.code.add("// --------------------------------------------------------- ");for(const e of this._options)this[e.propertyKey]?t.vertex.code.add(`// ${e.propertyKey}: true`):t.vertex.code.add(`// ${e.propertyKey}: false`)}}export{x as ComputeVertexInput,I as FragmentInput,v as FragmentOutput,P as GraphShaderModule,w as UniformGroup,C as VertexInput,h as builtin,_ as define,l as input,f as location,g as option,K as transformFeedback,m as uniform};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
+ */
5
+ import"../../../../../../core/has.js";import{isPowerOfTwo as e,nextPowerOfTwo as t}from"../../../../../../core/mathUtils.js";import{disposeMaybe as r}from"../../../../../../core/maybe.js";import{simplePipelineState as s}from"../utils.js";import{Technique as u}from"./Technique.js";import{TextureStatisticsDiffShader as i}from"./shaders/TextureStatisticsDiffShader.js";import{TextureStatisticsMinMaxSumShader as o}from"./shaders/TextureStatisticsMinMaxSumShader.js";import{TextureStatisticsStdDevShader as a}from"./shaders/TextureStatisticsStdDevShader.js";import{TextureStatisticsSumOfSquaredDiffShader as f}from"./shaders/TextureStatisticsSumOfSquaredDiffShader.js";import{getWebGLCapabilities as n}from"../../../../../webgl/capabilities.js";import{ColorAttachment2 as h,ColorAttachment3 as l,SizedPixelFormat as m,PixelType as c,ColorAttachment0 as x,ColorAttachment1 as T}from"../../../../../webgl/enums.js";import{FramebufferObject as b}from"../../../../../webgl/FramebufferObject.js";import{Texture as d}from"../../../../../webgl/Texture.js";import{TextureDescriptor as p}from"../../../../../webgl/TextureDescriptor.js";const _=1048576;class F extends u{constructor(){super(...arguments),this.type=27,this._width=0,this._height=0,this._framebuffers=null,this._minTexture=null,this._maxTexture=null,this._sumTexture=null,this._resultsFramebuffer=null,this._startFramebuffer=null,this._diffFramebuffer=null,this._scaleFbo=null,this.shaders={textureStatisticsMinMaxSum:new o,textureStatisticsSum:new f,textureStatisticsDiff:new i,textureStatisticsStdDev:new a}}dispose(){this.shaders.textureStatisticsMinMaxSum=null,this._framebuffers&&(this._framebuffers.forEach(e=>r(e)),this._framebuffers=null),r(this._resultsFramebuffer),r(this._startFramebuffer),r(this._diffFramebuffer),r(this._scaleFbo),r(this._minTexture),r(this._maxTexture),r(this._sumTexture)}get minValuesTexture(){return this._minTexture||null}get maxValuesTexture(){return this._maxTexture||null}get meanValuesTexture(){return this._resultsFramebuffer?.getColorTexture(h)||null}get stdDevValuesTexture(){return this._resultsFramebuffer?.getColorTexture(l)||null}get statsFbo(){return this._resultsFramebuffer}render(t,r){const{context:u,painter:i}=t;let o=r.fbo.width,a=r.fbo.height,f=r.fbo;const n=u.gl,h=u.getBoundFramebufferObject();if(o*a>_||!e(o)||!e(a)){const t=o/a;if(o*a>_){const e=Math.max(Math.floor(Math.sqrt(_/t)),1);o=Math.max(Math.floor(t*e),1),a=e}e(o)||(o=S(o)),e(a)||(a=S(a)),this._scaleFbo?this._scaleFbo.resize(o,a):this._scaleFbo=g(u,o,a,c.UNSIGNED_BYTE,m.RGBA8),u.bindFramebuffer(this._scaleFbo),u.setViewport(0,0,o,a),i.blitTexture(u,f.getColorTexture(x),9728),f=this._scaleFbo}this._updateResources(t,f),i.setPipelineState({...s,color:{write:[!0,!0,!0,!0],blendMode:"none"}});const l=this._applyReductionPass(t);n.readBuffer(n.COLOR_ATTACHMENT2),l.copyToTexture(0,0,1,1,0,0,this._sumTexture),n.readBuffer(n.COLOR_ATTACHMENT1),l.copyToTexture(0,0,1,1,0,0,this._maxTexture),n.readBuffer(n.COLOR_ATTACHMENT0),l.copyToTexture(0,0,1,1,0,0,this._minTexture);const T=r.fbo.getColorTexture(x);if(!T)throw new Error("Start buffer color texture is not available, cannot compute diff.");this._computeDiff(t,T,this._sumTexture,o,a);const b=this._applySecondReductionPass(t,o,a).getColorTexture(x);this._computeSdtDev(t,this._minTexture,this._maxTexture,this._sumTexture,b,o,a),u.bindFramebuffer(h),u.setViewport(0,0,o,a),u.setDrawBuffers([x]),i.setPipelineState(s)}_applyReductionPass(e){const{context:t,painter:r}=e,s=this.shaders.textureStatisticsMinMaxSum,u=this._framebuffers;if(null===u)throw new Error("Framebuffers are not initialized, cannot apply reduction pass.");t.setDrawBuffers([x,T,h]);const i=this._startFramebuffer;let o=i.getColorTexture(x),a=i.getColorTexture(T),f=i.getColorTexture(h);const n=u;for(const l of n){t.setViewport(0,0,l.width,l.height),t.bindFramebuffer(l),t.setClearColor(0,0,0,0),t.clear(16384);const e={shader:s,uniforms:{config:{minTexture:{texture:o,unit:1},maxTexture:{texture:a,unit:2},sumTexture:{texture:f,unit:3},width:l.width,height:l.height}},defines:null,optionalAttributes:null,useComputeBuffer:!1};r.submitDrawMesh(t,e,r.quadMesh),o=l.getColorTexture(x),a=l.getColorTexture(T),f=l.getColorTexture(h)}return u.at(-1)}_applySecondReductionPass(e,t,r){const{context:s,painter:u}=e,i=this.shaders.textureStatisticsSum,o=this._framebuffers;if(null===o||null==this._diffFramebuffer)throw new Error("Framebuffers are not initialized, cannot apply reduction pass.");s.setDrawBuffers([x]);let a=this._diffFramebuffer.getColorTexture(x);const f=o;for(const n of f){s.setViewport(0,0,n.width,n.height),s.bindFramebuffer(n),s.setClearColor(0,0,0,0),s.clear(16384);const e={shader:i,uniforms:{config:{sumTexture:{texture:a,unit:2},width:n.width,height:n.height}},defines:null,optionalAttributes:null,useComputeBuffer:!1};u.submitDrawMesh(s,e,u.quadMesh),a=n.getColorTexture(x)}return o.at(-1)}_updateResources(e,t){const{context:r}=e,s=t.width,u=t.height;if(null===this._startFramebuffer){if(!n().supportsColorBufferFloat)throw new Error("WebGL does not support color buffer float, cannot compute texture statistics.");const e=g(r,s,u,c.UNSIGNED_BYTE,m.RGBA8,3),i=e.getColorTexture(x),o=e.getColorTexture(T),a=e.getColorTexture(h);t.copyToTexture(0,0,s,u,0,0,i),t.copyToTexture(0,0,s,u,0,0,o),t.copyToTexture(0,0,s,u,0,0,a),this._startFramebuffer=e,this._diffFramebuffer=g(r,s,u,c.FLOAT,m.RGBA32F),this._resultsFramebuffer=g(r,1,1,c.FLOAT,m.RGBA32F,4),this._minTexture=C(r,1,1,c.FLOAT,m.RGBA32F),this._maxTexture=C(r,1,1,c.FLOAT,m.RGBA32F),this._sumTexture=C(r,1,1,c.FLOAT,m.RGBA32F)}else{const e=this._startFramebuffer;e.resize(s,u);const r=e.getColorTexture(x),i=e.getColorTexture(T),o=e.getColorTexture(h);t.copyToTexture(0,0,s,u,0,0,r),t.copyToTexture(0,0,s,u,0,0,i),t.copyToTexture(0,0,s,u,0,0,o),this._diffFramebuffer.resize(s,u)}if(this._width===s&&this._height===u&&null!==this._framebuffers)return;const i=(this._framebuffers||[]).reverse();this._framebuffers=null,this._width=s,this._height=u,this._framebuffers=this._updateFramebuffers(r,s,u,i,3)}_updateFramebuffers(e,t,s,u,i=1){const o=[];let a=t,f=s;for(;a>1||f>1;){const t=Math.max(1,Math.floor(a/2)),r=Math.max(1,Math.floor(f/2)),s=w(e,t,r,u,i);o.push(s),a=t,f=r}return o.at(-1),u.forEach(e=>r(e)),u.length=0,o}_computeDiff(e,t,r,s,u){const{context:i,painter:o}=e;i.bindFramebuffer(this._diffFramebuffer),i.setDrawBuffers([x]),i.setViewport(0,0,s,u),i.setClearColor(0,0,0,0),i.clear(16384);const a={shader:this.shaders.textureStatisticsDiff,uniforms:{config:{inputTexture:{texture:t,unit:1},sumTexture:{texture:r,unit:2},numTexels:s*u}},defines:null,optionalAttributes:null,useComputeBuffer:!1};o.submitDrawMesh(i,a,o.quadMesh)}_computeSdtDev(e,t,r,s,u,i,o){const{context:a,painter:f}=e;a.bindFramebuffer(this._resultsFramebuffer),a.setDrawBuffers([x,T,h,l]),a.setViewport(0,0,1,1),a.setClearColor(0,0,0,0),a.clear(16384);const n={shader:this.shaders.textureStatisticsStdDev,uniforms:{config:{minTexture:{texture:t,unit:1},maxTexture:{texture:r,unit:2},sumTexture:{texture:s,unit:3},diffSqTexture:{texture:u,unit:4},numTexels:i*o}},defines:null,optionalAttributes:null,useComputeBuffer:!1};f.submitDrawMesh(a,n,f.quadMesh)}}function w(e,t,r,s,u=1){let i=s.pop();return void 0!==i?i.resize(t,r):i=g(e,t,r,c.FLOAT,m.RGBA32F,u),i}function g(e,t,r,s,u,i=1){if(i<1||i>4)throw new Error("Number of color attachments must be between 1 and 4.");const o=new b(e,C(e,t,r,s,u));for(let a=1;a<i;a++){const i=C(e,t,r,s,u);o.attachColorTexture(i,x+a)}return o}function C(e,t,r,s,u){const i=new p(t,r);return i.samplingMode=9728,i.wrapMode=33071,i.pixelFormat=6408,i.dataType=s,i.internalFormat=u,new d(e,i)}function S(e){const r=t(e),s=r/2;return Math.abs(r-e)<Math.abs(s-e)?r:s}export{F as TextureStatisticsTechnique};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
+ */
5
+ import{__decorate as t,__param as e}from"tslib";import{location as o,uniform as r,input as s,VertexInput as i,UniformGroup as p,GraphShaderModule as n,FragmentOutput as u,FragmentInput as l}from"../../GraphShaderModule.js";import{Vec2 as m,Sampler2D as d,Float as x,Vec4 as a,texture2D as c,texelFetch as f,Int as v,IVec2 as g}from"../../graph/glsl.js";import{uvToClip as y}from"./utils.js";class h extends i{}t([o(0,m)],h.prototype,"position",void 0);class T extends l{}class w extends p{}t([r(d)],w.prototype,"inputTexture",void 0),t([r(d)],w.prototype,"sumTexture",void 0),t([r(x)],w.prototype,"numTexels",void 0);class j extends n{constructor(){super(...arguments),this.type="TextureStatisticsDiffShader"}vertex(t){const e=t.position;return{uv:e,glPosition:new a(y(e),0,1)}}fragment(t){const{inputTexture:e,sumTexture:o}=this.config,r=new u,s=c(e,t.uv),i=f(o,new g(0,0),new v(0)),p=this.config.numTexels,n=i.divide(p),l=s.subtract(n);return r.fragColor=l.multiply(l),r}}t([r(w)],j.prototype,"config",void 0),t([e(0,s(h))],j.prototype,"vertex",null),t([e(0,s(T))],j.prototype,"fragment",null);export{j as TextureStatisticsDiffShader};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
+ */
5
+ import{__decorate as t,__param as e}from"tslib";import{location as o,uniform as r,input as d,VertexInput as n,UniformGroup as a,GraphShaderModule as i,FragmentOutput as s,FragmentInput as p}from"../../GraphShaderModule.js";import{Vec2 as u,Sampler2D as m,Int as x,Vec4 as l,IVec2 as w,texelFetch as g,min as y,max as c}from"../../graph/glsl.js";import{uvToClip as f,sum4 as v}from"./utils.js";class h extends n{}t([o(0,u)],h.prototype,"position",void 0);class T extends p{}class S extends a{}t([r(m)],S.prototype,"minTexture",void 0),t([r(m)],S.prototype,"maxTexture",void 0),t([r(m)],S.prototype,"sumTexture",void 0),t([r(x)],S.prototype,"width",void 0),t([r(x)],S.prototype,"height",void 0);class j extends i{constructor(){super(...arguments),this.type="TextureStatisticsMinMaxSumShader"}vertex(t){const e=t.position;return{uv:e,glPosition:new l(f(e),0,1)}}fragment(t){const e=new s,{minTexture:o,maxTexture:r,sumTexture:d}=this.config,n=t.glFragCoord.xy,a=new w(n.multiply(2)),i=new x(0),p=g(o,a,i),u=g(o,a.add(new w(-1,0)),i),m=g(o,a.add(new w(0,-1)),i),l=g(o,a.add(new w(-1,-1)),i),f=y(y(p,u),y(m,l)),h=g(r,a,i),T=g(r,a.add(new w(-1,0)),i),S=g(r,a.add(new w(0,-1)),i),j=g(r,a.add(new w(-1,-1)),i),D=c(c(h,T),c(S,j)),M=g(d,a,i),b=g(d,a.add(new w(-1,0)),i),C=g(d,a.add(new w(0,-1)),i),F=g(d,a.add(new w(-1,-1)),i),G=v(M,b,C,F);return e.fragData0=f,e.fragData1=D,e.fragData2=G,e}}t([r(S)],j.prototype,"config",void 0),t([e(0,d(h))],j.prototype,"vertex",null),t([e(0,d(T))],j.prototype,"fragment",null);export{j as TextureStatisticsMinMaxSumShader};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
+ */
5
+ import{__decorate as t,__param as e}from"tslib";import{location as o,uniform as r,input as i,VertexInput as s,UniformGroup as p,GraphShaderModule as n,FragmentOutput as a,FragmentInput as d}from"../../GraphShaderModule.js";import{Vec2 as u,Sampler2D as x,Float as m,Vec4 as f,IVec2 as l,Int as g,texelFetch as v,sqrt as c}from"../../graph/glsl.js";import{uvToClip as y}from"./utils.js";class T extends s{}t([o(0,u)],T.prototype,"position",void 0);class h extends d{}class S extends p{}t([r(x)],S.prototype,"minTexture",void 0),t([r(x)],S.prototype,"maxTexture",void 0),t([r(x)],S.prototype,"sumTexture",void 0),t([r(x)],S.prototype,"diffSqTexture",void 0),t([r(m)],S.prototype,"numTexels",void 0);class w extends n{constructor(){super(...arguments),this.type="TextureStatisticsStdDevShader"}vertex(t){const e=t.position;return{uv:e,glPosition:new f(y(e),0,1)}}fragment(t){const e=new a,{minTexture:o,maxTexture:r,sumTexture:i,diffSqTexture:s}=this.config,p=t.glFragCoord.xy,n=new l(p),d=new g(0),u=v(o,n,d),x=v(r,n,d),m=v(i,n,d),y=v(s,n,d),T=this.config.numTexels,h=m.divide(T),S=new f(y.divide(T)),w=c(S);return e.fragData0=u,e.fragData1=x,e.fragData2=h,e.fragData3=w,e}}t([r(S)],w.prototype,"config",void 0),t([e(0,i(T))],w.prototype,"vertex",null),t([e(0,i(h))],w.prototype,"fragment",null);export{w as TextureStatisticsStdDevShader};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
+ */
5
+ import{__decorate as t,__param as e}from"tslib";import{location as o,uniform as r,input as s,VertexInput as i,UniformGroup as n,GraphShaderModule as p,FragmentOutput as a,FragmentInput as d}from"../../GraphShaderModule.js";import{Vec2 as l,Sampler2D as u,Int as f,Vec4 as m,IVec2 as g,texelFetch as c}from"../../graph/glsl.js";import{uvToClip as x,sum4 as w}from"./utils.js";class y extends i{}t([o(0,l)],y.prototype,"position",void 0);class h extends d{}class v extends n{}t([r(u)],v.prototype,"sumTexture",void 0),t([r(f)],v.prototype,"width",void 0),t([r(f)],v.prototype,"height",void 0);class S extends p{constructor(){super(...arguments),this.type="TextureStatisticsSumOfSquaredDiffShader"}vertex(t){const e=t.position;return{uv:e,glPosition:new m(x(e),0,1)}}fragment(t){const e=new a,{sumTexture:o}=this.config,r=t.glFragCoord.xy,s=new g(r.multiply(2)),i=new f(0),n=c(o,s,i),p=c(o,s.add(new g(-1,0)),i),d=c(o,s.add(new g(0,-1)),i),l=c(o,s.add(new g(-1,-1)),i),u=w(n,p,d,l);return e.fragData0=u,e.fragData1=new m(0),e.fragData2=new m(0),e}}t([r(v)],S.prototype,"config",void 0),t([e(0,s(y))],S.prototype,"vertex",null),t([e(0,s(h))],S.prototype,"fragment",null);export{S as TextureStatisticsSumOfSquaredDiffShader};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{maxHighlightReasons as t}from"../../../definitions.js";import{Float as n,greaterThan as r,float as u,max as i,mod as c,floor as o,vec4 as e,dot as f,vec2 as s,fract as l,sin as m,equal as a,vec3 as p,divide as y}from"../../graph/glsl.js";import{nanMagicNumber as d}from"./constants.js";function b(t){const n=u(12.9898),r=u(78.233),i=u(43758.5453),o=f(t,s(n,r)),e=c(o,u(3.14));return l(m(e).multiply(i))}function w(t){return a(t,u(d))}function x(t){return y(t,u(255))}function j(t,n){return t.x.multiply(n.y).subtract(n.x.multiply(t.y))}function z(t){return t.multiply(2).subtract(1)}function g(t){return t.multiply(.5).add(.5)}function v(t,n){const r=u(2**n);return c(o(t.divide(r)),u(2))}function h(t,n){return r(v(t,n),u(.5))}function k(n,r){return v(n,r+t)}function q(t,n){return v(t,n)}function A(t){const n=v(t.z,7),r=u(1).subtract(n),i=t.xyz.subtract(p(0,0,u(128)));return r.multiply(t).add(n.multiply(i))}function B(t){const n=e(255/256,255/65536,255/16777216,255/4294967296);return f(t,n)}function C(t){return i(i(i(t.x,t.y),t.z),t.w)}function D(t){return new n(1).subtract(t)}function E(t){return t.subtract(new n(1))}function F(t){return new n(1).divide(t)}function G(t,r){return new n(t).subtract(r)}function H(t,r){return t.subtract(new n(r))}export{g as clipToUv,j as cross2,v as getBit,h as getBitBool,k as getFilterBit,q as getHighlightBit,w as isNan,C as max4,E as minusOne,H as minusScalar,x as norm,D as oneMinus,F as oneOver,b as rand,B as rgba2float,G as scalarMinus,A as unpackDisplayIdTexel,z as uvToClip};
5
+ import{maxHighlightReasons as t}from"../../../definitions.js";import{Float as n,greaterThan as r,float as u,max as c,mod as i,floor as o,vec4 as e,dot as f,vec2 as s,fract as l,sin as a,equal as m,vec3 as p,Vec4 as b,divide as d}from"../../graph/glsl.js";import{nanMagicNumber as y}from"./constants.js";function w(t){const n=u(12.9898),r=u(78.233),c=u(43758.5453),o=f(t,s(n,r)),e=i(o,u(3.14));return l(a(e).multiply(c))}function x(t){return m(t,u(y))}function j(t){return d(t,u(255))}function z(t,n){return t.x.multiply(n.y).subtract(n.x.multiply(t.y))}function g(t){return t.multiply(2).subtract(1)}function v(t){return t.multiply(.5).add(.5)}function h(t,n){const r=u(2**n);return i(o(t.divide(r)),u(2))}function k(t,n){return r(h(t,n),u(.5))}function q(n,r){return h(n,r+t)}function A(t,n){return h(t,n)}function B(t){const n=h(t.z,7),r=u(1).subtract(n),c=t.xyz.subtract(p(0,0,u(128)));return r.multiply(t).add(n.multiply(c))}function C(t){const n=e(255/256,255/65536,255/16777216,255/4294967296);return f(t,n)}function D(t){return c(c(c(t.x,t.y),t.z),t.w)}function E(t){return new n(1).subtract(t)}function F(t){return t.subtract(new n(1))}function G(t){return new n(1).divide(t)}function H(t,r){return new n(t).subtract(r)}function I(t,r){return t.subtract(new n(r))}function J(t,n,r,u){let c=new b(0);const i=new b(0);return c=K(c,t,i),c=K(c,n,i),c=K(c,r,i),c=K(c,u,i),c}function K(t,n,r){const u=n.subtract(r),c=t.add(u);return r=c.subtract(t).subtract(u),c}export{v as clipToUv,z as cross2,h as getBit,k as getBitBool,q as getFilterBit,A as getHighlightBit,x as isNan,K as kahanSummation,D as max4,F as minusOne,I as minusScalar,j as norm,E as oneMinus,G as oneOver,w as rand,C as rgba2float,H as scalarMinus,J as sum4,B as unpackDisplayIdTexel,g as uvToClip};