@arcgis/core 5.1.0-next.127 → 5.1.0-next.128

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 (289) hide show
  1. package/applications/Urban/editingSessionUtils.js +1 -1
  2. package/arcade/featureSetUtils.js +1 -1
  3. package/arcade/featureset/sources/FeatureLayerDynamic.js +1 -1
  4. package/arcade/featureset/sources/FeatureLayerParquet.js +2 -0
  5. package/arcade/featureset/support/FeatureSet.js +1 -1
  6. package/arcade/featureset/support/shared.js +1 -1
  7. package/arcade.d.ts +2 -1
  8. package/arcgisGlobal.d.ts +3 -1
  9. package/assets/esri/core/workers/RemoteClient.js +1 -1
  10. package/assets/esri/core/workers/chunks/01ba5319cac3e0f14205.js +1 -0
  11. package/assets/esri/core/workers/chunks/{b045bffb4f2eb9203183.js → 05e1f1628a3726eca03d.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{38cfedce779dd75bd217.js → 07ca020796c57cefda62.js} +1 -1
  13. package/assets/esri/core/workers/chunks/08dfe61c75f0032db4d4.js +1 -0
  14. package/assets/esri/core/workers/chunks/0a1037fdc8c7bf8d0e7e.js +1 -0
  15. package/assets/esri/core/workers/chunks/0b45d34938fa7862f746.js +1 -0
  16. package/assets/esri/core/workers/chunks/0fe57b2d06368d3f68c9.js +1 -0
  17. package/assets/esri/core/workers/chunks/11c3b1e8ca21ad62fdd1.js +1 -0
  18. package/assets/esri/core/workers/chunks/{1436e378d975345686aa.js → 183b7664c68babd90fc8.js} +1 -1
  19. package/assets/esri/core/workers/chunks/{c187bc997bad61b6c6e9.js → 18d1ac2165a84c42e98f.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{0b169bb1969f86232a1a.js → 1b03e10a6b721365acbb.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{b7e363c14919698f5b65.js → 1b07d7656ffcf53cba2b.js} +1 -1
  22. package/assets/esri/core/workers/chunks/1bd49e8d2657c72bf3f9.js +1 -0
  23. package/assets/esri/core/workers/chunks/1d38b2fcd85ac9ebd7c6.js +1 -0
  24. package/assets/esri/core/workers/chunks/1d91e69483c3ceec3c4d.js +1 -0
  25. package/assets/esri/core/workers/chunks/{c2cd80b712f29e8cbb8d.js → 1ff57bf19f021f5fd246.js} +1 -1
  26. package/assets/esri/core/workers/chunks/{287f1441819c345f389e.js → 268243ee64d001009f78.js} +1 -1
  27. package/assets/esri/core/workers/chunks/26aa8190ac439f634c5b.js +1 -0
  28. package/assets/esri/core/workers/chunks/2b781de7b467c61849b2.js +1 -0
  29. package/assets/esri/core/workers/chunks/309fcc46da0b4393960e.js +1 -0
  30. package/assets/esri/core/workers/chunks/{03e93c18efc67a25ca63.js → 35c4037b8eea067d9638.js} +1 -1
  31. package/assets/esri/core/workers/chunks/39a10b2092a98083f4cf.js +1 -0
  32. package/assets/esri/core/workers/chunks/3b9174de370b187a0985.js +1 -0
  33. package/assets/esri/core/workers/chunks/3bd32387af52fa48d747.js +1 -0
  34. package/assets/esri/core/workers/chunks/3d4bb539bf939fcdeef9.js +1 -0
  35. package/assets/esri/core/workers/chunks/3dc6e9494af16f7b8009.js +1 -0
  36. package/assets/esri/core/workers/chunks/42e5e00610f281ca8ffa.js +1 -0
  37. package/assets/esri/core/workers/chunks/{73c355b895fd6a34fcb8.js → 45b560ca01fb566ba560.js} +1 -1
  38. package/assets/esri/core/workers/chunks/{d36b407f5ad5eabac530.js → 4a9e34fe9a16b1850876.js} +28 -28
  39. package/assets/esri/core/workers/chunks/4e59e5a5d0ff887ff899.js +1 -0
  40. package/assets/esri/core/workers/chunks/4efef5fa8bf23aaf34cd.js +1 -0
  41. package/assets/esri/core/workers/chunks/511b9c12a7479d39dac0.js +1 -0
  42. package/assets/esri/core/workers/chunks/51a53011478e0cf96e0b.js +1 -0
  43. package/assets/esri/core/workers/chunks/599bd80379423c99799d.js +1 -0
  44. package/assets/esri/core/workers/chunks/{640abe600fa069ed7640.js → 6144f59bc0ba153a82d3.js} +1 -1
  45. package/assets/esri/core/workers/chunks/65cc9a48ac95523f7aa8.js +1 -0
  46. package/assets/esri/core/workers/chunks/66392ff750c28064040a.js +1 -0
  47. package/assets/esri/core/workers/chunks/668d84dc512b3085a960.js +1 -0
  48. package/assets/esri/core/workers/chunks/67bf361d0b5cfd6b53da.js +1 -0
  49. package/assets/esri/core/workers/chunks/68b77b36daae2b4b4237.js +1 -0
  50. package/assets/esri/core/workers/chunks/6f5a82388a5eb5fcf1b7.js +1 -0
  51. package/assets/esri/core/workers/chunks/70b5e0fce22122a7ccc2.js +1 -0
  52. package/assets/esri/core/workers/chunks/73b0edabddbb72fe1104.js +1 -0
  53. package/assets/esri/core/workers/chunks/{8b0a01ebc86ab226f01f.js → 75b4c27ca02b124a713c.js} +1 -1
  54. package/assets/esri/core/workers/chunks/7a1f65511bce26e6b770.js +1 -0
  55. package/assets/esri/core/workers/chunks/7f849c8255140be6097f.js +1 -0
  56. package/assets/esri/core/workers/chunks/831455798b177678720c.js +1 -0
  57. package/assets/esri/core/workers/chunks/8570d1c7159b5a84d56c.js +1 -0
  58. package/assets/esri/core/workers/chunks/{3bdef4b9f86711ae48b3.js → 86cad656a6a473982109.js} +2 -2
  59. package/assets/esri/core/workers/chunks/{9331969046f2b277d620.js → 8a39dd585742960d3ca2.js} +1 -1
  60. package/assets/esri/core/workers/chunks/{5cb1b950249d651f3837.js → 8dcb3e77f76d8396706b.js} +1 -1
  61. package/assets/esri/core/workers/chunks/8f25d91ea7b99597124e.js +1 -0
  62. package/assets/esri/core/workers/chunks/92341f36a8b15f34bcca.js +1 -0
  63. package/assets/esri/core/workers/chunks/96f58e0157b960f6ee22.js +1 -0
  64. package/assets/esri/core/workers/chunks/{bf706a5d065a357de51b.js → 993fee0e91303eb1f01f.js} +1 -1
  65. package/assets/esri/core/workers/chunks/9da1a514e042eb642d35.js +1 -0
  66. package/assets/esri/core/workers/chunks/9f93c29af2a18f7cb160.js +1 -0
  67. package/assets/esri/core/workers/chunks/{f0556a695d080454b8da.js → 9fd61a387bd6603da299.js} +1 -1
  68. package/assets/esri/core/workers/chunks/a18cb809dd56c5537b3b.js +1 -0
  69. package/assets/esri/core/workers/chunks/{52175ff9e8c2c136f90a.js → a3ecde3794a7db3cf283.js} +1 -1
  70. package/assets/esri/core/workers/chunks/a4cdcb0b06242a95722a.js +1 -0
  71. package/assets/esri/core/workers/chunks/{bfd1aef8ac795e1ce227.js → a892b3be70f482bef0ba.js} +1 -1
  72. package/assets/esri/core/workers/chunks/a8ef7acb6d3d1f45e14c.js +1 -0
  73. package/assets/esri/core/workers/chunks/ac5032253c752768021b.js +2 -0
  74. package/assets/esri/core/workers/chunks/ac7ecd90330090c90005.js +1 -0
  75. package/assets/esri/core/workers/chunks/b1524f23e6cee5301a14.js +1 -0
  76. package/assets/esri/core/workers/chunks/{c983e5ce0ff952b65d7f.js → b2b342b06d502fc61ea5.js} +1 -1
  77. package/assets/esri/core/workers/chunks/b75a4753cea6544da8bb.js +1 -0
  78. package/assets/esri/core/workers/chunks/b775a0d8894930af4983.js +1 -0
  79. package/assets/esri/core/workers/chunks/bbcad2fde838819ffc7b.js +1 -0
  80. package/assets/esri/core/workers/chunks/bd36c57dd0cd28dee55f.js +30 -0
  81. package/assets/esri/core/workers/chunks/be1d2c3a61e6447fbbc7.js +1 -0
  82. package/assets/esri/core/workers/chunks/be8340d5ae5e662c2671.js +1 -0
  83. package/assets/esri/core/workers/chunks/{97a654e8054302582a3b.js → bfa6f4c08e7571bb1f37.js} +1 -1
  84. package/assets/esri/core/workers/chunks/c030cdb4cdb08cb51501.js +262 -0
  85. package/assets/esri/core/workers/chunks/c2cbc2a920e6e199533a.js +1 -0
  86. package/assets/esri/core/workers/chunks/c8460bdf60aca749ed05.js +30 -0
  87. package/assets/esri/core/workers/chunks/c9057b0ad2c2bae4a8ce.js +1 -0
  88. package/assets/esri/core/workers/chunks/cf9a132c4c37e62de3d7.js +1 -0
  89. package/assets/esri/core/workers/chunks/{03354e9256b2f77fd4f2.js → d6145cd7e7c5346f62ec.js} +1 -1
  90. package/assets/esri/core/workers/chunks/d6911e9453532501f460.js +1 -0
  91. package/assets/esri/core/workers/chunks/{886ae23a1d8fa21e531f.js → d750e4abeb777caa8c36.js} +1 -1
  92. package/assets/esri/core/workers/chunks/dada22a4350e9ddaf850.js +30 -0
  93. package/assets/esri/core/workers/chunks/e9acc05b0cf9e05f31a8.js +1 -0
  94. package/assets/esri/core/workers/chunks/e9cd84ad0054e9fea448.js +1 -0
  95. package/assets/esri/core/workers/chunks/ead719bff4a94816a42e.js +1 -0
  96. package/assets/esri/core/workers/chunks/f116ff0121d28bbf7a23.js +1 -0
  97. package/assets/esri/core/workers/chunks/f27c7d5cb0937fe50acf.js +1 -0
  98. package/assets/esri/core/workers/chunks/f5f9f21c23c51e35ae65.js +1 -0
  99. package/assets/esri/core/workers/chunks/f955b35337a08f9f747d.js +1 -0
  100. package/assets/esri/core/workers/chunks/{f75295cdd5e84eb97d5a.js → f9d583785b3b09ace222.js} +1 -1
  101. package/assets/esri/core/workers/chunks/fe6385115d76e16e8da0.js +1 -0
  102. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_fr.json +1 -1
  103. package/chunks/ComponentShader.glsl.js +11 -11
  104. package/chunks/GaussianSplatComposition.glsl.js +1 -1
  105. package/chunks/GlobalIlluminationBlur.glsl.js +8 -8
  106. package/chunks/OITBlend.glsl.js +1 -24
  107. package/chunks/OITBlendEmission.glsl.js +9 -9
  108. package/chunks/OITDimOpaque.glsl.js +3 -9
  109. package/config.js +1 -1
  110. package/core/reactiveUtils.d.ts +410 -109
  111. package/graphic/AnnotationFeatureGraphicOrigin.d.ts +5 -2
  112. package/graphic/AnnotationFeatureGraphicOrigin.js +1 -1
  113. package/graphic/DimensionFeatureGraphicOrigin.js +1 -1
  114. package/graphic/graphicOrigins.js +1 -1
  115. package/graphic/isAnnotationFeatureGraphicOrigin.d.ts +29 -0
  116. package/graphic/isAnnotationFeatureGraphicOrigin.js +2 -0
  117. package/graphic/isDimensionFeatureGraphicOrigin.d.ts +29 -0
  118. package/graphic/isDimensionFeatureGraphicOrigin.js +2 -0
  119. package/interfaces.d.ts +3 -3
  120. package/kernel.js +1 -1
  121. package/layers/AnnotationFeatureLayer.d.ts +73 -0
  122. package/layers/AnnotationFeatureLayer.js +1 -1
  123. package/layers/ParquetLayer.js +1 -1
  124. package/layers/graphics/sources/MemorySource.js +1 -1
  125. package/layers/graphics/sources/ParquetSource.js +1 -1
  126. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  127. package/layers/mixins/OperationalLayer.js +1 -1
  128. package/layers/support/{AnnotationSublayer.d.ts → AnnotationFeatureSublayer.d.ts} +12 -12
  129. package/layers/support/AnnotationFeatureSublayer.js +2 -0
  130. package/layers/support/ExportImageServiceParameters.js +1 -1
  131. package/layers/support/ParquetPortalItemData.js +1 -1
  132. package/layers/support/layersMapping.js +1 -1
  133. package/package.json +3 -3
  134. package/rest/print.js +1 -1
  135. package/smartMapping/renderers/location.js +1 -1
  136. package/smartMapping/renderers/predominance.js +1 -1
  137. package/smartMapping/renderers/support/regenerateUtils.js +1 -1
  138. package/smartMapping/renderers/support/rendererUtils.d.ts +3 -1
  139. package/smartMapping/renderers/support/rendererUtils.js +1 -1
  140. package/support/revision.js +1 -1
  141. package/symbols/WebStyleSymbol.js +1 -1
  142. package/symbols/support/symbolUtils.js +1 -1
  143. package/symbols/support/webStyleSymbolCache.js +2 -0
  144. package/undoredo/support/ApplySet.js +1 -1
  145. package/undoredo/support/ApplySetItem.js +1 -1
  146. package/views/2d/engine/vectorTiles/VectorTileContainer.js +1 -1
  147. package/views/2d/engine/webgl/TextureManager.js +1 -1
  148. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AAnimatedShader.js +1 -1
  149. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerMeshWriter.js +1 -1
  150. package/views/2d/engine/webgl/shaderGraph/techniques/animated/attributes.js +1 -1
  151. package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueBackground.js +1 -1
  152. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  153. package/views/2d/layers/features/layerAdapters/AnnotationLayerAdapter.js +1 -1
  154. package/views/3d/interactive/visualElements/DrapedVisualElementResources.js +1 -1
  155. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  156. package/views/3d/support/GaussianSplatSortWorker.js +1 -1
  157. package/views/3d/support/GaussianSplatWorkerHandle.js +1 -1
  158. package/views/3d/support/gaussianSplatting/GaussianSplatDataStore.js +1 -1
  159. package/views/3d/support/gaussianSplatting/GaussianSplatOrderTexture.js +1 -1
  160. package/views/3d/support/gaussianSplatting/GaussianSplatTextureAtlas.js +1 -1
  161. package/views/3d/webgl-engine/collections/Component/Material/ComponentShader.glsl.js +1 -1
  162. package/views/3d/webgl-engine/core/shaderLibrary/shading/Gamma.glsl.js +2 -2
  163. package/views/3d/webgl-engine/core/shaderLibrary/util/EmissionDimming.glsl.js +1 -1
  164. package/views/3d/webgl-engine/core/shaderLibrary/util/GaussianSplatTextureFetch.glsl.js +6 -8
  165. package/views/3d/webgl-engine/core/shaderTechnique/ShaderTechniqueRepository.js +1 -1
  166. package/views/3d/webgl-engine/effects/fog/FogTechniqueConfiguration.js +1 -1
  167. package/views/3d/webgl-engine/effects/globalIllumination/GlobalIlluminationBlur.glsl.js +1 -1
  168. package/views/3d/webgl-engine/effects/glow/Glow.js +1 -1
  169. package/views/3d/webgl-engine/effects/glow/GlowBlurTechniqueConfiguration.js +1 -1
  170. package/views/3d/webgl-engine/effects/glow/GlowCompositionTechniqueConfiguration.js +1 -1
  171. package/views/3d/webgl-engine/effects/smaa/SMAA.js +1 -1
  172. package/views/3d/webgl-engine/effects/transparency/OITBlend.glsl.js +1 -1
  173. package/views/3d/webgl-engine/effects/transparency/OITBlend.js +1 -1
  174. package/views/3d/webgl-engine/effects/transparency/OITBlendEmission.glsl.js +1 -1
  175. package/views/3d/webgl-engine/effects/transparency/OITBlendEmissionTechnique.js +1 -1
  176. package/views/3d/webgl-engine/effects/transparency/OITBlendFragmentTechniqueConfiguration.js +2 -0
  177. package/views/3d/webgl-engine/effects/transparency/OITBlendTechnique.js +1 -1
  178. package/views/3d/webgl-engine/effects/transparency/OITBlendTechniqueConfiguration.js +1 -1
  179. package/views/3d/webgl-engine/effects/transparency/OITDimOpaque.glsl.js +1 -1
  180. package/views/3d/webgl-engine/effects/transparency/OITDimOpaqueTechnique.js +1 -1
  181. package/views/3d/webgl-engine/effects/transparency/oitBlendFragment.glsl.js +2 -0
  182. package/views/3d/webgl-engine/lib/Compositor.js +1 -1
  183. package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
  184. package/views/3d/webgl-engine/lib/Material.js +1 -1
  185. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  186. package/views/3d/webgl-engine/lib/lodRendering/LodComponentData.js +1 -1
  187. package/views/3d/webgl-engine/lib/lodRendering/LodLevel.js +1 -1
  188. package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
  189. package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
  190. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  191. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  192. package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
  193. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  194. package/views/3d/webgl-engine/materials/renderers/MergedRenderer.js +1 -1
  195. package/views/3d/webgl-engine/shaders/GaussianSplatCompositionTechniqueConfiguration.js +1 -1
  196. package/views/3d/webgl-engine/shaders/OutputColorHighlightOLID.glsl.js +1 -1
  197. package/views/3d/webgl-engine/shaders/alphaCutoff.glsl.js +1 -1
  198. package/views/3d/webgl-engine/shaders/oitResolution.glsl.js +1 -1
  199. package/views/View2D.d.ts +2 -3
  200. package/views/draw/support/editingSessionUtils.js +1 -1
  201. package/webdoc/support/writeUtils.js +1 -1
  202. package/webscene/support/AlphaCutoff.js +1 -1
  203. package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.d.ts +2 -2
  204. package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.js +1 -1
  205. package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
  206. package/widgets/BatchAttributeForm/types.d.ts +30 -4
  207. package/widgets/BatchAttributeForm.js +1 -1
  208. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  209. package/widgets/Editor/MergeFeaturesWorkflow.js +1 -1
  210. package/widgets/Editor/SplitFeatureWorkflow.js +1 -1
  211. package/widgets/Editor/UpdateFeatureWorkflow.js +1 -1
  212. package/widgets/Editor/UpdateFeaturesWorkflow.js +1 -1
  213. package/widgets/Editor/support/SketchController.js +1 -1
  214. package/widgets/Editor/workflowUtils.js +1 -1
  215. package/widgets/Editor.js +1 -1
  216. package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
  217. package/widgets/Print/PrintViewModel.d.ts +11 -1
  218. package/widgets/Print/PrintViewModel.js +1 -1
  219. package/assets/esri/core/workers/chunks/0803f022b5191171bc9c.js +0 -1
  220. package/assets/esri/core/workers/chunks/152f1c08197955224ad3.js +0 -1
  221. package/assets/esri/core/workers/chunks/19dcae83be0fc0aced02.js +0 -1
  222. package/assets/esri/core/workers/chunks/1a95370ddc22729ab3c6.js +0 -1
  223. package/assets/esri/core/workers/chunks/23d50c4478f40a7d62bf.js +0 -1
  224. package/assets/esri/core/workers/chunks/2623cd08487fdc9a94f1.js +0 -1
  225. package/assets/esri/core/workers/chunks/2b00229c238aae70b948.js +0 -1
  226. package/assets/esri/core/workers/chunks/2b814bb51704a5b4fdc2.js +0 -30
  227. package/assets/esri/core/workers/chunks/30f1909c5ef1835b8507.js +0 -1
  228. package/assets/esri/core/workers/chunks/3172d7fc23787a287191.js +0 -1
  229. package/assets/esri/core/workers/chunks/39596715e84d0da2f803.js +0 -30
  230. package/assets/esri/core/workers/chunks/426b8e1e2eef2460851d.js +0 -1
  231. package/assets/esri/core/workers/chunks/44e52fe98ffafe6a2807.js +0 -1
  232. package/assets/esri/core/workers/chunks/4d09ef7c57ab7f9782fe.js +0 -1
  233. package/assets/esri/core/workers/chunks/5022413f5a41b5d435ea.js +0 -1
  234. package/assets/esri/core/workers/chunks/52afd43bbe23e358efb5.js +0 -1
  235. package/assets/esri/core/workers/chunks/59a60fa09b19a0b2f473.js +0 -1
  236. package/assets/esri/core/workers/chunks/59dafa1e1340ea4043e6.js +0 -1
  237. package/assets/esri/core/workers/chunks/6284eafe2c3b45a0e72a.js +0 -1
  238. package/assets/esri/core/workers/chunks/65f02eca694cc1c9f5a7.js +0 -1
  239. package/assets/esri/core/workers/chunks/6cab67fc7044ee9b863b.js +0 -1
  240. package/assets/esri/core/workers/chunks/6d616b66fb32904b55a1.js +0 -1
  241. package/assets/esri/core/workers/chunks/6d696beddcc5fbed5875.js +0 -1
  242. package/assets/esri/core/workers/chunks/6f125b4ed06c0022dee6.js +0 -1
  243. package/assets/esri/core/workers/chunks/6f4825c3ef1fe202ab82.js +0 -1
  244. package/assets/esri/core/workers/chunks/6f7193b9ff5942c0d354.js +0 -1
  245. package/assets/esri/core/workers/chunks/70737052bab29fcaa120.js +0 -1
  246. package/assets/esri/core/workers/chunks/72d67cc3a382e83bf1a2.js +0 -1
  247. package/assets/esri/core/workers/chunks/7cadb872b9ca96eedca5.js +0 -1
  248. package/assets/esri/core/workers/chunks/8486ef6c7076baf0348b.js +0 -1
  249. package/assets/esri/core/workers/chunks/851705cf276eae8d4d37.js +0 -1
  250. package/assets/esri/core/workers/chunks/882ee7ed8a3a0215f9b9.js +0 -1
  251. package/assets/esri/core/workers/chunks/8c443c52c846a096a250.js +0 -1
  252. package/assets/esri/core/workers/chunks/972ba277a27704d28357.js +0 -1
  253. package/assets/esri/core/workers/chunks/97d2bdbea39cbcf8fd0f.js +0 -1
  254. package/assets/esri/core/workers/chunks/9d27cc631bab8aa7479e.js +0 -1
  255. package/assets/esri/core/workers/chunks/9d5f7573bfe3b051daf1.js +0 -1
  256. package/assets/esri/core/workers/chunks/a0c00c6fe60db49b3ab9.js +0 -1
  257. package/assets/esri/core/workers/chunks/a2d7e8147dee6642029a.js +0 -2
  258. package/assets/esri/core/workers/chunks/a643a4751bbf4430bde2.js +0 -262
  259. package/assets/esri/core/workers/chunks/a9003fe5975cd554ba24.js +0 -1
  260. package/assets/esri/core/workers/chunks/aa02458ceb839b555ee1.js +0 -1
  261. package/assets/esri/core/workers/chunks/ab62724b80b3c478a597.js +0 -1
  262. package/assets/esri/core/workers/chunks/b44cf254585210578eab.js +0 -1
  263. package/assets/esri/core/workers/chunks/b9935cc8e2bd4045058a.js +0 -1
  264. package/assets/esri/core/workers/chunks/c2a65de34f6a6c89c652.js +0 -1
  265. package/assets/esri/core/workers/chunks/c32430e99e8cd6e5f688.js +0 -1
  266. package/assets/esri/core/workers/chunks/c6d0b4875b6b8d6bc25a.js +0 -1
  267. package/assets/esri/core/workers/chunks/c80fc1b3048e8d58a1f8.js +0 -1
  268. package/assets/esri/core/workers/chunks/ca8c08659d82019d775d.js +0 -1
  269. package/assets/esri/core/workers/chunks/cf8ce21dc649021e97f6.js +0 -1
  270. package/assets/esri/core/workers/chunks/d41caf20c26f80385265.js +0 -1
  271. package/assets/esri/core/workers/chunks/d52864823067e57a719a.js +0 -1
  272. package/assets/esri/core/workers/chunks/d5c35a75fd4c41def420.js +0 -1
  273. package/assets/esri/core/workers/chunks/dd920a6f6422fa213eba.js +0 -1
  274. package/assets/esri/core/workers/chunks/df18b0a653b328d8d052.js +0 -1
  275. package/assets/esri/core/workers/chunks/e1505ec80b068011bdc5.js +0 -1
  276. package/assets/esri/core/workers/chunks/e16710ef178d64606a55.js +0 -1
  277. package/assets/esri/core/workers/chunks/e33d2ede6c9f1527d51b.js +0 -1
  278. package/assets/esri/core/workers/chunks/e5ef06c205d34df1e4bc.js +0 -1
  279. package/assets/esri/core/workers/chunks/e912b515704e20313e53.js +0 -1
  280. package/assets/esri/core/workers/chunks/eabeaab5c4810f999a4d.js +0 -1
  281. package/assets/esri/core/workers/chunks/ec723f8777b935c5e81a.js +0 -1
  282. package/assets/esri/core/workers/chunks/f590db684d88e72bd79b.js +0 -1
  283. package/assets/esri/core/workers/chunks/f622ae3887c85535e8ab.js +0 -30
  284. package/assets/esri/core/workers/chunks/fa3faec65882c5b6f1a0.js +0 -1
  285. package/layers/support/AnnotationSublayer.js +0 -2
  286. package/views/3d/webgl-engine/effects/transparency/OITBlendEmissionTechniqueConfiguration.js +0 -2
  287. package/views/3d/webgl-engine/effects/transparency/OITDimOpaqueTechniqueConfiguration.js +0 -2
  288. /package/assets/esri/core/workers/chunks/{3bdef4b9f86711ae48b3.js.LICENSE.txt → 86cad656a6a473982109.js.LICENSE.txt} +0 -0
  289. /package/assets/esri/core/workers/chunks/{a2d7e8147dee6642029a.js.LICENSE.txt → ac5032253c752768021b.js.LICENSE.txt} +0 -0
@@ -1,5 +1,6 @@
1
1
  import type GraphicOrigin from "./GraphicOrigin.js";
2
2
  import type AnnotationFeatureLayer from "../layers/AnnotationFeatureLayer.js";
3
+ import type AnnotationFeatureSublayer from "../layers/support/AnnotationFeatureSublayer.js";
3
4
 
4
5
  /**
5
6
  * Provides information about the [AnnotationFeatureLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/AnnotationFeatureLayer/) from which a graphic originates.
@@ -22,9 +23,11 @@ import type AnnotationFeatureLayer from "../layers/AnnotationFeatureLayer.js";
22
23
  * });
23
24
  */
24
25
  export default class AnnotationFeatureGraphicOrigin extends GraphicOrigin {
25
- constructor(layer: AnnotationFeatureLayer);
26
+ constructor(sublayer: AnnotationFeatureSublayer);
26
27
  /** A layer from which a graphic originates. */
27
- readonly layer: AnnotationFeatureLayer;
28
+ get layer(): AnnotationFeatureLayer;
29
+ /** The [AnnotationFeatureSublayer](https://developers.arcgis.com/javascript/latest/references/core/layers/support/AnnotationFeatureSublayer/) from which a graphic originates. */
30
+ readonly sublayer: AnnotationFeatureSublayer;
28
31
  /**
29
32
  * Indicates the type of layer the graphic originated from.
30
33
  *
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{idFieldsProviderSymbol as r}from"./getIdFieldsProvider.js";import{popupProviderSymbol as t}from"./getPopupProvider.js";import{getSliceableContainerSymbol as e}from"./getSliceableContainer.js";import i from"./GraphicOrigin.js";class o extends i{get[t](){return this.layer}get[r](){return this.layer}get[e](){return this.layer}constructor(r){super(),this.type="annotation-feature",this.layer=r}get id(){return this.layer.id}}export{o as default};
2
+ import{idFieldsProviderSymbol as r}from"./getIdFieldsProvider.js";import{popupProviderSymbol as t}from"./getPopupProvider.js";import{getSliceableContainerSymbol as e}from"./getSliceableContainer.js";import i from"./GraphicOrigin.js";import{isAnnotationFeatureGraphicOriginSymbol as s}from"./isAnnotationFeatureGraphicOrigin.js";var a;class o extends i{get[(a=s,t)](){return this.layer}get[r](){return this.layer}get[e](){return this.layer}constructor(r){super(),this[a]=!0,this.type="annotation-feature",this.sublayer=r}get layer(){return this.sublayer.parent}get id(){return`${this.layer.id}:__${this.sublayer.subtypeCode}__`}}export{o as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{idFieldsProviderSymbol as r}from"./getIdFieldsProvider.js";import{popupProviderSymbol as e}from"./getPopupProvider.js";import{getSliceableContainerSymbol as t}from"./getSliceableContainer.js";import i from"./GraphicOrigin.js";class s extends i{get[e](){return this.layer}get[r](){return this.layer}get[t](){return this.layer}constructor(r){super(),this.type="dimension-feature",this.layer=r}get id(){return this.layer.id}}export{s as default};
2
+ import{idFieldsProviderSymbol as r}from"./getIdFieldsProvider.js";import{popupProviderSymbol as e}from"./getPopupProvider.js";import{getSliceableContainerSymbol as t}from"./getSliceableContainer.js";import i from"./GraphicOrigin.js";import{isDimensionFeatureGraphicOriginSymbol as s}from"./isDimensionFeatureGraphicOrigin.js";var o;class a extends i{get[(o=s,e)](){return this.layer}get[r](){return this.layer}get[t](){return this.layer}constructor(r){super(),this[o]=!0,this.type="dimension-feature",this.layer=r}get id(){return this.layer.id}}export{a as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- export{isBuildingGraphicOrigin}from"./isBuildingGraphicOrigin.js";export{isCatalogGraphicOrigin}from"./isCatalogGraphicOrigin.js";export{isCSVGraphicOrigin}from"./isCSVGraphicOrigin.js";export{isFeatureGraphicOrigin}from"./isFeatureGraphicOrigin.js";export{isGeoJSONGraphicOrigin}from"./isGeoJSONGraphicOrigin.js";export{isGeoRSSGraphicOrigin}from"./isGeoRSSGraphicOrigin.js";export{isKnowledgeGraphGraphicOrigin}from"./isKnowledgeGraphGraphicOrigin.js";export{isMapImageGraphicOrigin}from"./isMapImageGraphicOrigin.js";export{isMapNotesGraphicOrigin}from"./isMapNotesGraphicOrigin.js";export{isOGCFeatureGraphicOrigin}from"./isOGCFeatureGraphicOrigin.js";export{isOrientedImageryGraphicOrigin}from"./isOrientedImageryGraphicOrigin.js";export{isParquetGraphicOrigin}from"./isParquetGraphicOrigin.js";export{isPointCloudGraphicOrigin}from"./isPointCloudGraphicOrigin.js";export{isSceneGraphicOrigin}from"./isSceneGraphicOrigin.js";export{isStreamGraphicOrigin}from"./isStreamGraphicOrigin.js";export{isSubtypeGroupGraphicOrigin}from"./isSubtypeGroupGraphicOrigin.js";export{isTileGraphicOrigin}from"./isTileGraphicOrigin.js";export{isVectorTileGraphicOrigin}from"./isVectorTileGraphicOrigin.js";export{isVoxelGraphicOrigin}from"./isVoxelGraphicOrigin.js";export{isWFSGraphicOrigin}from"./isWFSGraphicOrigin.js";
2
+ export{isAnnotationFeatureGraphicOrigin}from"./isAnnotationFeatureGraphicOrigin.js";export{isBuildingGraphicOrigin}from"./isBuildingGraphicOrigin.js";export{isCatalogGraphicOrigin}from"./isCatalogGraphicOrigin.js";export{isCSVGraphicOrigin}from"./isCSVGraphicOrigin.js";export{isDimensionFeatureGraphicOrigin}from"./isDimensionFeatureGraphicOrigin.js";export{isFeatureGraphicOrigin}from"./isFeatureGraphicOrigin.js";export{isGeoJSONGraphicOrigin}from"./isGeoJSONGraphicOrigin.js";export{isGeoRSSGraphicOrigin}from"./isGeoRSSGraphicOrigin.js";export{isKnowledgeGraphGraphicOrigin}from"./isKnowledgeGraphGraphicOrigin.js";export{isMapImageGraphicOrigin}from"./isMapImageGraphicOrigin.js";export{isMapNotesGraphicOrigin}from"./isMapNotesGraphicOrigin.js";export{isOGCFeatureGraphicOrigin}from"./isOGCFeatureGraphicOrigin.js";export{isOrientedImageryGraphicOrigin}from"./isOrientedImageryGraphicOrigin.js";export{isParquetGraphicOrigin}from"./isParquetGraphicOrigin.js";export{isPointCloudGraphicOrigin}from"./isPointCloudGraphicOrigin.js";export{isSceneGraphicOrigin}from"./isSceneGraphicOrigin.js";export{isStreamGraphicOrigin}from"./isStreamGraphicOrigin.js";export{isSubtypeGroupGraphicOrigin}from"./isSubtypeGroupGraphicOrigin.js";export{isTileGraphicOrigin}from"./isTileGraphicOrigin.js";export{isVectorTileGraphicOrigin}from"./isVectorTileGraphicOrigin.js";export{isVoxelGraphicOrigin}from"./isVoxelGraphicOrigin.js";export{isWFSGraphicOrigin}from"./isWFSGraphicOrigin.js";
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Provides a utility function to determine whether a graphic's origin is a [AnnotationFeatureGraphicOrigin](https://developers.arcgis.com/javascript/latest/references/core/graphic/AnnotationFeatureGraphicOrigin/).
3
+ *
4
+ * @since 5.1
5
+ * @example
6
+ * // Use hitTest() to get a graphic, then check whether it originated from a AnnotationFeatureLayer.
7
+ * view.hitTest(screenPoint).then((response) => {
8
+ * const graphic = response.results[0]?.graphic;
9
+ * if (!graphic) {
10
+ * return;
11
+ * }
12
+ * if (isAnnotationFeatureGraphicOrigin(graphic.origin)) {
13
+ * // hitTest returned a graphic from a AnnotationFeatureLayer.
14
+ * // Use this info for your processing logic.
15
+ * } else {
16
+ * console.log("graphic's origin is NOT a AnnotationFeatureLayer");
17
+ * }
18
+ * });
19
+ */
20
+ import type AnnotationFeatureGraphicOrigin from "./AnnotationFeatureGraphicOrigin.js";
21
+ import type GraphicOrigin from "./GraphicOrigin.js";
22
+
23
+ /**
24
+ * Utility function that determines whether a graphic’s origin is a [AnnotationFeatureGraphicOrigin](https://developers.arcgis.com/javascript/latest/references/core/graphic/AnnotationFeatureGraphicOrigin/).
25
+ *
26
+ * @param origin - The graphic origin to check.
27
+ * @returns Returns `true` if the graphic origin is of type [AnnotationFeatureGraphicOrigin](https://developers.arcgis.com/javascript/latest/references/core/graphic/AnnotationFeatureGraphicOrigin/), `false` otherwise.
28
+ */
29
+ export function isAnnotationFeatureGraphicOrigin(origin: GraphicOrigin | null | undefined): origin is AnnotationFeatureGraphicOrigin;
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
+ const n=Symbol("isAnnotationFeatureGraphicOrigin");function i(i){return!!i&&n in i}export{i as isAnnotationFeatureGraphicOrigin,n as isAnnotationFeatureGraphicOriginSymbol};
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Provides a utility function to determine whether a graphic's origin is a [DimensionFeatureGraphicOrigin](https://developers.arcgis.com/javascript/latest/references/core/graphic/DimensionFeatureGraphicOrigin/).
3
+ *
4
+ * @since 5.1
5
+ * @example
6
+ * // Use hitTest() to get a graphic, then check whether it originated from a DimensionFeatureLayer.
7
+ * view.hitTest(screenPoint).then((response) => {
8
+ * const graphic = response.results[0]?.graphic;
9
+ * if (!graphic) {
10
+ * return;
11
+ * }
12
+ * if (isDimensionFeatureGraphicOrigin(graphic.origin)) {
13
+ * // hitTest returned a graphic from a DimensionFeatureLayer.
14
+ * // Use this info for your processing logic.
15
+ * } else {
16
+ * console.log("graphic's origin is NOT a DimensionFeatureLayer");
17
+ * }
18
+ * });
19
+ */
20
+ import type DimensionFeatureGraphicOrigin from "./DimensionFeatureGraphicOrigin.js";
21
+ import type GraphicOrigin from "./GraphicOrigin.js";
22
+
23
+ /**
24
+ * Utility function that determines whether a graphic’s origin is a [DimensionFeatureGraphicOrigin](https://developers.arcgis.com/javascript/latest/references/core/graphic/DimensionFeatureGraphicOrigin/).
25
+ *
26
+ * @param origin - The graphic origin to check.
27
+ * @returns Returns `true` if the graphic origin is of type [DimensionFeatureGraphicOrigin](https://developers.arcgis.com/javascript/latest/references/core/graphic/DimensionFeatureGraphicOrigin/), `false` otherwise.
28
+ */
29
+ export function isDimensionFeatureGraphicOrigin(origin: GraphicOrigin | null | undefined): origin is DimensionFeatureGraphicOrigin;
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
+ const i=Symbol("isDimensionFeatureGraphicOrigin");function n(n){return!!n&&i in n}export{n as isDimensionFeatureGraphicOrigin,i as isDimensionFeatureGraphicOriginSymbol};
package/interfaces.d.ts CHANGED
@@ -5060,11 +5060,11 @@ declare namespace __esri {
5060
5060
  export const AggregateField: typeof import("./layers/support/AggregateField.js").default;
5061
5061
 
5062
5062
  /** @deprecated since 5.0. Refactor using \@arcgis/codemod */
5063
- export type AnnotationSublayerProperties = import("./layers/support/AnnotationSublayer.js").AnnotationSublayerProperties;
5063
+ export type AnnotationFeatureSublayerProperties = import("./layers/support/AnnotationFeatureSublayer.js").AnnotationFeatureSublayerProperties;
5064
5064
 
5065
5065
  /** @deprecated since 5.0. Refactor using \@arcgis/codemod */
5066
- export type AnnotationSublayer = import("./layers/support/AnnotationSublayer.js").default;
5067
- export const AnnotationSublayer: typeof import("./layers/support/AnnotationSublayer.js").default;
5066
+ export type AnnotationFeatureSublayer = import("./layers/support/AnnotationFeatureSublayer.js").default;
5067
+ export const AnnotationFeatureSublayer: typeof import("./layers/support/AnnotationFeatureSublayer.js").default;
5068
5068
 
5069
5069
  /** @deprecated since 5.0. Refactor using \@arcgis/codemod */
5070
5070
  export type BuildingFieldStatistics = import("./layers/support/BuildingFieldStatistics.js").default;
package/kernel.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";export{buildDate,commitHash as revision}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const e="5.1";let s,r=e;function i(o){s=o}function t(e){const r=s?.findCredential(e);return r?.token?o(e,"token",r.token):e}r="5.1.0-next.127",has("host-webworker")||globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),has("host-webworker");export{t as addTokenParameter,r as fullVersion,s as id,i as setId,e as version};
2
+ import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";export{buildDate,commitHash as revision}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const e="5.1";let s,r=e;function i(o){s=o}function t(e){const r=s?.findCredential(e);return r?.token?o(e,"token",r.token):e}r="5.1.0-next.128",has("host-webworker")||globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),has("host-webworker");export{t as addTokenParameter,r as fullVersion,s as id,i as setId,e as version};
@@ -1,6 +1,9 @@
1
+ import type Graphic from "../Graphic.js";
1
2
  import type PopupTemplate from "../PopupTemplate.js";
3
+ import type Collection from "../core/Collection.js";
2
4
  import type Extent from "../geometry/Extent.js";
3
5
  import type Layer from "./Layer.js";
6
+ import type AnnotationFeatureSublayer from "./support/AnnotationFeatureSublayer.js";
4
7
  import type Field from "./support/Field.js";
5
8
  import type FeatureSet from "../rest/support/FeatureSet.js";
6
9
  import type Query from "../rest/support/Query.js";
@@ -22,6 +25,8 @@ import type { QueryProperties } from "../rest/support/Query.js";
22
25
  import type { CreatePopupTemplateOptions } from "../support/popupUtils.js";
23
26
  import type { ObjectId } from "../views/types.js";
24
27
  import type { PopupTemplateProperties } from "../PopupTemplate.js";
28
+ import type { AnnotationFeatureSublayerProperties } from "./support/AnnotationFeatureSublayer.js";
29
+ import type { ReadonlyArrayOrCollection } from "../core/Collection.js";
25
30
 
26
31
  export interface AnnotationFeatureLayerProperties extends LayerProperties, APIKeyMixinProperties, CustomParametersMixinProperties, PortalLayerProperties, OperationalLayerProperties, RefreshableLayerProperties, ScaleRangeLayerProperties, TemporalLayerProperties, BlendLayerProperties, FeatureLayerBaseProperties, Partial<Pick<AnnotationFeatureLayer, "outFields" | "popupEnabled">> {
27
32
  /**
@@ -41,6 +46,29 @@ export interface AnnotationFeatureLayerProperties extends LayerProperties, APIKe
41
46
  * @see [View2D.popup](https://developers.arcgis.com/javascript/latest/references/core/views/View2D/#popup)
42
47
  */
43
48
  popupTemplate?: PopupTemplateProperties | null;
49
+ /**
50
+ * A [Collection](https://developers.arcgis.com/javascript/latest/references/core/core/Collection/) of [AnnotationFeatureSublayer](https://developers.arcgis.com/javascript/latest/references/core/layers/support/AnnotationFeatureSublayer/) objects that allow
51
+ * you to alter the visibility of one or more sublayers of the AnnotationFeatureLayer.
52
+ * If this property is not specified, all the sublayers from the feature service are displayed as defined in the service.
53
+ *
54
+ * All sublayers must be referenced using the [AnnotationFeatureSublayer.subtypeCode](https://developers.arcgis.com/javascript/latest/references/core/layers/support/AnnotationFeatureSublayer/#subtypeCode) to identify the sublayer. The sublayers may be [added](https://developers.arcgis.com/javascript/latest/references/core/core/Collection/#add),
55
+ * [removed](https://developers.arcgis.com/javascript/latest/references/core/core/Collection/#remove), or
56
+ * [reordered](https://developers.arcgis.com/javascript/latest/references/core/core/Collection/#reorder) using the
57
+ * [Collection](https://developers.arcgis.com/javascript/latest/references/core/core/Collection/) methods. Because [AnnotationFeatureSublayer](https://developers.arcgis.com/javascript/latest/references/core/layers/support/AnnotationFeatureSublayer/) extends
58
+ * [Accessor](https://developers.arcgis.com/javascript/latest/references/core/core/Accessor/), its properties may be
59
+ * [watched](https://developers.arcgis.com/javascript/latest/watch-for-changes/#watch-for-changes-in-the-api).
60
+ *
61
+ * @example
62
+ * // Only includes the first AnnotationFeatureSublayer from the AnnotationFeatureLayer
63
+ * let layer = new AnnotationFeatureLayer({
64
+ * url: "https://sampleserver6.arcgisonline.com/arcgis/rest/services/RiversAnnotation/FeatureServer/0",
65
+ * sublayers: [{
66
+ * subtypeCode: 0,
67
+ * visible: true
68
+ * }]
69
+ * });
70
+ */
71
+ sublayers?: ReadonlyArrayOrCollection<AnnotationFeatureSublayerProperties> | null;
44
72
  }
45
73
 
46
74
  export interface AnnotationFeatureLayerEvents extends EditBusLayerEvents, RefreshableLayerEvents, LayerEvents {}
@@ -116,6 +144,30 @@ export default class AnnotationFeatureLayer extends AnnotationFeatureLayerSuperc
116
144
  */
117
145
  get popupTemplate(): PopupTemplate | null | undefined;
118
146
  set popupTemplate(value: PopupTemplateProperties | null | undefined);
147
+ /**
148
+ * A [Collection](https://developers.arcgis.com/javascript/latest/references/core/core/Collection/) of [AnnotationFeatureSublayer](https://developers.arcgis.com/javascript/latest/references/core/layers/support/AnnotationFeatureSublayer/) objects that allow
149
+ * you to alter the visibility of one or more sublayers of the AnnotationFeatureLayer.
150
+ * If this property is not specified, all the sublayers from the feature service are displayed as defined in the service.
151
+ *
152
+ * All sublayers must be referenced using the [AnnotationFeatureSublayer.subtypeCode](https://developers.arcgis.com/javascript/latest/references/core/layers/support/AnnotationFeatureSublayer/#subtypeCode) to identify the sublayer. The sublayers may be [added](https://developers.arcgis.com/javascript/latest/references/core/core/Collection/#add),
153
+ * [removed](https://developers.arcgis.com/javascript/latest/references/core/core/Collection/#remove), or
154
+ * [reordered](https://developers.arcgis.com/javascript/latest/references/core/core/Collection/#reorder) using the
155
+ * [Collection](https://developers.arcgis.com/javascript/latest/references/core/core/Collection/) methods. Because [AnnotationFeatureSublayer](https://developers.arcgis.com/javascript/latest/references/core/layers/support/AnnotationFeatureSublayer/) extends
156
+ * [Accessor](https://developers.arcgis.com/javascript/latest/references/core/core/Accessor/), its properties may be
157
+ * [watched](https://developers.arcgis.com/javascript/latest/watch-for-changes/#watch-for-changes-in-the-api).
158
+ *
159
+ * @example
160
+ * // Only includes the first AnnotationFeatureSublayer from the AnnotationFeatureLayer
161
+ * let layer = new AnnotationFeatureLayer({
162
+ * url: "https://sampleserver6.arcgisonline.com/arcgis/rest/services/RiversAnnotation/FeatureServer/0",
163
+ * sublayers: [{
164
+ * subtypeCode: 0,
165
+ * visible: true
166
+ * }]
167
+ * });
168
+ */
169
+ get sublayers(): Collection<AnnotationFeatureSublayer> | null | undefined;
170
+ set sublayers(value: ReadonlyArrayOrCollection<AnnotationFeatureSublayerProperties> | null | undefined);
119
171
  /** The layer type provides a convenient way to check the type of the layer without the need to import specific layer modules. */
120
172
  get type(): "annotation-feature";
121
173
  /**
@@ -132,6 +184,27 @@ export default class AnnotationFeatureLayer extends AnnotationFeatureLayerSuperc
132
184
  * @returns A query object initialized from the layer configuration.
133
185
  */
134
186
  createQuery(): Query;
187
+ /**
188
+ * Returns the sublayer to which the given feature belongs.
189
+ *
190
+ * @param feature - The feature whose sublayer will be returned.
191
+ * @returns The sublayer from the `AnnotationFeatureLayer` to which the feature belongs to.
192
+ */
193
+ findSublayerForFeature(feature: Graphic): AnnotationFeatureSublayer | null | undefined;
194
+ /**
195
+ * Returns the sublayer with the [SubtypeSublayer.subtypeCode](https://developers.arcgis.com/javascript/latest/references/core/layers/support/SubtypeSublayer/#subtypeCode) that matches the number passed as an argument.
196
+ *
197
+ * @param subtypeCode - The subtype coded value.
198
+ * @returns The sublayer from the `AnnotationFeatureLayer` to which the feature belongs to.
199
+ * @example
200
+ * // Updates the visibility of a sublayer after first finding
201
+ * // the sublayer from the subtypeCode.
202
+ * const subtypeCode = 5;
203
+ * const sublayer = annotationFeatureLayer.findSublayerForSubtypeCode(subtypeCode);
204
+ *
205
+ * sublayer.visible = true;
206
+ */
207
+ findSublayerForSubtypeCode(subtypeCode: number): AnnotationFeatureSublayer | null | undefined;
135
208
  /**
136
209
  * Executes a [Query](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/) against the feature service and
137
210
  * returns the [Extent](https://developers.arcgis.com/javascript/latest/references/core/geometry/Extent/) of features that satisfy the query. If no
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__addDisposableResource as e,__disposeResources as r,__decorate as t}from"tslib";import s from"../PopupTemplate.js";import i from"../request.js";import{ClonableMixin as o}from"../core/Clonable.js";import a from"../core/Collection.js";import n from"../core/Error.js";import{disposable as l,makeHandle as p}from"../core/handleUtils.js";import{MultiOriginJSONSupportMixin as u}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as d,whenOrAbort as m,onAbort as y}from"../core/promiseUtils.js";import{watch as h,sync as c}from"../core/reactiveUtils.js";import{join as f}from"../core/urlUtils.js";import{property as b,subclass as g}from"../core/accessorSupport/decorators.js";import v from"../graphic/AnnotationFeatureGraphicOrigin.js";import j from"./Layer.js";import{APIKeyMixin as E}from"./mixins/APIKeyMixin.js";import{ArcGISService as S}from"./mixins/ArcGISService.js";import{BlendLayer as L}from"./mixins/BlendLayer.js";import{CustomParametersMixin as w}from"./mixins/CustomParametersMixin.js";import{FeatureLayerBase as I}from"./mixins/FeatureLayerBase.js";import{OperationalLayer as P}from"./mixins/OperationalLayer.js";import{PortalLayer as x}from"./mixins/PortalLayer.js";import{RefreshableLayer as O}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as F}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as T}from"./mixins/TemporalLayer.js";import A from"./support/AnnotationSublayer.js";import{barrierWeight as _,popupEnabled as q}from"./support/commonProperties.js";import{ensureLayerCredential as C,createQuery as U,getFieldDomain as D,hasDataChanged as G}from"./support/featureLayerUtils.js";import{defineFieldProperties as N}from"./support/fieldProperties.js";import{fixTimeInfoFields as Q}from"./support/fieldUtils.js";import{serviceSupportsSpatialReference as H}from"./support/versionUtils.js";import J from"../rest/support/Query.js";import{createPopupTemplate as R}from"../support/popupUtils.js";import{reader as M}from"../core/accessorSupport/decorators/reader.js";const k="annotation-feature-layer",B=N(),K=a.ofType(A);let V=class extends(I(L(T(F(O(S(P(x(u(w(E(o(j))))))))))))){constructor(e){super(e),this.barrierWeight="high",this.fields=null,this.fieldsIndex=null,this.graphicOrigin=new v(this),this.operationalLayerType="ArcGISAnnotationLayer",this.outFields=null,this.popupEnabled=!0,this.popupTemplate=null,this.source=null,this.supportedSourceTypes=new Set(["Annotation Layer"]),this.type="annotation-feature",this._dataElementPromise=null,this.addHandles(h(()=>this.sublayers,(e,r)=>this._handleSublayersChange(e,r),c))}destroy(){this.source?.destroy()}load(e){const r=e?.signal,t=this.loadFromPortal({supportedTypes:["Feature Service"]},e).catch(d).then(async()=>{if(this.url&&null==this.layerId&&/FeatureServer|MapServer\/*$/i.test(this.url)){const e=await this._fetchFirstValidLayerId(r);null!=e&&(this.layerId=e)}if(!this.url)throw new n(`${k}:missing-url`,"AnnotationFeatureLayer must be created with a url");return this.initLayerProperties(await this.createGraphicsSource(r))}).then(()=>C(this,"load",e));return this.addResolvingPromise(t),Promise.resolve(this)}get editingEnabled(){return this._isOverridden("editingEnabled")?this._get("editingEnabled"):this.loaded&&null!=this.capabilities&&this.capabilities.operations.supportsEditing&&this.userHasEditingPrivileges}set editingEnabled(e){this._overrideIfSome("editingEnabled",e)}get effectiveEditingEnabled(){return!1}get defaultPopupTemplate(){return this.createPopupTemplate()}readSublayers(e,r){const t=new K(r.subtypes.map(({code:e,name:r})=>new A({subtypeCode:e,title:r})).reverse());if(this.visibleLayers){const e=new Set(this.visibleLayers);t.forEach(r=>{r.visible=e.has(r.subtypeCode)})}return t}get visibleLayers(){return this.sublayers?Array.from(new Set(this.sublayers?.toArray().filter(e=>e.visible).map(e=>e.subtypeCode).sort((e,r)=>e-r)??null)):this._get("visibleLayers")??null}set visibleLayers(e){this._set("visibleLayers",e)}createPopupTemplate(e){return R(this,e)}async createGraphicsSource(t){const s={stack:[],error:void 0,hasError:!1};try{const{default:r}=await m(import("./graphics/sources/FeatureLayerSource.js"),t),i=new r({layer:this,supportedSourceTypes:this.supportedSourceTypes});e(s,l(y(t,()=>i.cancelLoad())??p()),!1);return await i.load({signal:t}),i}catch(i){s.error=i,s.hasError=!0}finally{r(s)}}createQuery(){const e=U(this);return e.where=this.definitionExpression||"1=1",e}async fetchDataElement(e){if(this._dataElementPromise)return this._dataElementPromise;if(!this.url)throw new Error("InternalError: A URL is required to retrieve the data element for this layer.");const r=f(this.url,"queryDataElements"),t={f:"json",layers:this.layerId};return this._dataElementPromise=i(r,{...e,responseType:"json",query:t}).then(e=>{const r=e.data.layerDataElements,t=this.layerId,s=r.find(e=>e.layerId===t);if(!s)throw new n("fetchDataElement:not-available","A data element for this layer could not be retrieved.");return s.dataElement}),this._dataElementPromise}getFieldDomain(e,r){return D(this,e,r,this.getField(e)?.domain??null)}async queryFeatures(e,r){const t=await this.load(),s=await t.source.queryFeatures(J.from(e)??t.createQuery(),r),i=this.graphicOrigin;if(s?.features)for(const o of s.features)o.layer=o.sourceLayer=t,o.origin=i;return s}async queryObjectIds(e,r){const t=await this.load();return t.source.queryObjectIds(J.from(e)??t.createQuery(),r)}async queryFeatureCount(e,r){const t=await this.load();return t.source.queryFeatureCount(J.from(e)??t.createQuery(),r)}async queryExtent(e,r){const t=await this.load();return t.source.queryExtent(J.from(e)??t.createQuery(),r)}serviceSupportsSpatialReference(e){return this.loaded&&H(this,e)}async initLayerProperties(e){this._set("source",e),e.sourceJSON&&(this.sourceJSON=e.sourceJSON,this.read(e.sourceJSON,{origin:"service",portalItem:this.portalItem,portal:this.portalItem?.portal,url:this.parsedUrl})),Q(this.timeInfo,this.fieldsIndex)}async hasDataChanged(){return G(this)}_fetchFirstValidLayerId(e){return i(this.url??"",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e}).then(e=>{const r=e.data;if(!r)return;this.applyPreferredHost(r);const t=[...r.layers||[],...r.tables||[]];return t.find(({type:e})=>!e||this.supportedSourceTypes.has(e))?.id})}_handleSublayersChange(e,r){r&&(r.forEach(e=>{e.parent=null}),this.removeHandles("sublayers-owner")),e&&(e.forEach(e=>{e.parent=this}),this.addHandles([e.on("after-add",({item:e})=>{e.parent=this}),e.on("after-remove",({item:e})=>{e.parent=null})],"sublayers-owner"))}};t([b(_)],V.prototype,"barrierWeight",void 0),t([b({json:{write:!0}})],V.prototype,"editingEnabled",null),t([b({readOnly:!0})],V.prototype,"effectiveEditingEnabled",null),t([b({...B.fields,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],V.prototype,"fields",void 0),t([b(B.fieldsIndex)],V.prototype,"fieldsIndex",void 0),t([b({readOnly:!0,clonable:!1})],V.prototype,"graphicOrigin",void 0),t([b({type:["ArcGISAnnotationLayer"]})],V.prototype,"operationalLayerType",void 0),t([b(B.outFields)],V.prototype,"outFields",void 0),t([b(q)],V.prototype,"popupEnabled",void 0),t([b({type:s,json:{name:"popupInfo",write:!0}})],V.prototype,"popupTemplate",void 0),t([b({readOnly:!0})],V.prototype,"defaultPopupTemplate",null),t([b({clonable:!1,readOnly:!0})],V.prototype,"source",void 0),t([b({type:K})],V.prototype,"sublayers",void 0),t([M("service","sublayers",["subtypes"])],V.prototype,"readSublayers",null),t([b({json:{read:!1},value:"annotation-feature",readOnly:!0})],V.prototype,"type",void 0),t([b({type:[Number],json:{write:{ignoreOrigin:!0}}})],V.prototype,"visibleLayers",null),V=t([g("esri.layers.AnnotationFeatureLayer")],V);const W=V;export{W as default};
2
+ import{__addDisposableResource as e,__disposeResources as r,__decorate as t}from"tslib";import s from"../PopupTemplate.js";import i from"../request.js";import{ClonableMixin as o}from"../core/Clonable.js";import a from"../core/Collection.js";import n from"../core/Error.js";import{disposable as l,makeHandle as p}from"../core/handleUtils.js";import{MultiOriginJSONSupportMixin as u}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as d,whenOrAbort as y,onAbort as m}from"../core/promiseUtils.js";import{watch as h,sync as c}from"../core/reactiveUtils.js";import{join as f}from"../core/urlUtils.js";import{property as b,subclass as v}from"../core/accessorSupport/decorators.js";import j from"./Layer.js";import{APIKeyMixin as g}from"./mixins/APIKeyMixin.js";import{ArcGISService as S}from"./mixins/ArcGISService.js";import{BlendLayer as L}from"./mixins/BlendLayer.js";import{CustomParametersMixin as E}from"./mixins/CustomParametersMixin.js";import{FeatureLayerBase as w}from"./mixins/FeatureLayerBase.js";import{OperationalLayer as F}from"./mixins/OperationalLayer.js";import{PortalLayer as I}from"./mixins/PortalLayer.js";import{RefreshableLayer as P}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as x}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as _}from"./mixins/TemporalLayer.js";import T from"./support/AnnotationFeatureSublayer.js";import{barrierWeight as O,popupEnabled as C}from"./support/commonProperties.js";import{ensureLayerCredential as A,createQuery as q,getFieldDomain as U,hasDataChanged as k}from"./support/featureLayerUtils.js";import{defineFieldProperties as D}from"./support/fieldProperties.js";import{fixTimeInfoFields as N}from"./support/fieldUtils.js";import{serviceSupportsSpatialReference as Q}from"./support/versionUtils.js";import G from"../rest/support/Query.js";import{createPopupTemplate as H}from"../support/popupUtils.js";import{reader as J}from"../core/accessorSupport/decorators/reader.js";const M="annotation-feature-layer",R=D(),B=a.ofType(T);let K=class extends(w(L(_(x(P(S(F(I(u(E(g(o(j))))))))))))){constructor(e){super(e),this._sublayerLookup=new Map,this.barrierWeight="high",this.fields=null,this.fieldsIndex=null,this.operationalLayerType="ArcGISAnnotationLayer",this.outFields=null,this.popupEnabled=!0,this.popupTemplate=null,this.source=null,this.supportedSourceTypes=new Set(["Annotation Layer"]),this.type="annotation-feature",this._dataElementPromise=null,this.addHandles(h(()=>this.sublayers,(e,r)=>this._handleSublayersChange(e,r),c))}destroy(){this.source?.destroy()}load(e){const r=e?.signal,t=this.loadFromPortal({supportedTypes:["Feature Service"]},e).catch(d).then(async()=>{if(this.url&&null==this.layerId&&/FeatureServer|MapServer\/*$/i.test(this.url)){const e=await this._fetchFirstValidLayerId(r);null!=e&&(this.layerId=e)}if(!this.url)throw new n(`${M}:missing-url`,"AnnotationFeatureLayer must be created with a url");return this.initLayerProperties(await this.createGraphicsSource(r))}).then(()=>A(this,"load",e));return this.addResolvingPromise(t),Promise.resolve(this)}get editingEnabled(){return this._isOverridden("editingEnabled")?this._get("editingEnabled"):this.loaded&&null!=this.capabilities&&this.capabilities.operations.supportsEditing&&this.userHasEditingPrivileges}set editingEnabled(e){this._overrideIfSome("editingEnabled",e)}get effectiveEditingEnabled(){return!1}get defaultPopupTemplate(){return this.createPopupTemplate()}readSublayers(e,r){const t=new B(r.subtypes.map(({code:e})=>new T({subtypeCode:e})).reverse());if(this.visibleLayers){const e=new Set(this.visibleLayers);t.forEach(r=>{r.visible=e.has(r.subtypeCode)})}return t}get visibleLayers(){return this.sublayers?Array.from(new Set(this.sublayers?.toArray().filter(e=>e.visible).map(e=>e.subtypeCode).sort((e,r)=>e-r)??null)):this._get("visibleLayers")??null}set visibleLayers(e){this._set("visibleLayers",e)}createPopupTemplate(e){return H(this,e)}async createGraphicsSource(t){const s={stack:[],error:void 0,hasError:!1};try{const{default:r}=await y(import("./graphics/sources/FeatureLayerSource.js"),t),i=new r({layer:this,supportedSourceTypes:this.supportedSourceTypes});e(s,l(m(t,()=>i.cancelLoad())??p()),!1);return await i.load({signal:t}),i}catch(i){s.error=i,s.hasError=!0}finally{r(s)}}createQuery(){const e=q(this);return e.where=this.definitionExpression||"1=1",e}async fetchDataElement(e){if(this._dataElementPromise)return this._dataElementPromise;if(!this.url)throw new Error("InternalError: A URL is required to retrieve the data element for this layer.");const r=f(this.url,"queryDataElements"),t={f:"json",layers:this.layerId};return this._dataElementPromise=i(r,{...e,responseType:"json",query:t}).then(e=>{const r=e.data.layerDataElements,t=this.layerId,s=r.find(e=>e.layerId===t);if(!s)throw new n("fetchDataElement:not-available","A data element for this layer could not be retrieved.");return s.dataElement}),this._dataElementPromise}findSublayerForFeature(e){const r=this.fieldsIndex.get(this.subtypeField),t=e.attributes[r.name];return this.findSublayerForSubtypeCode(t)}findSublayerForSubtypeCode(e){return this._sublayerLookup.get(e)}getFieldDomain(e,r){return U(this,e,r,this.getField(e)?.domain??null)}async queryFeatures(e,r){const t=await this.load(),s=await t.source.queryFeatures(G.from(e)??t.createQuery(),r);if(s?.features)for(const i of s.features){const e=this.findSublayerForFeature(i);i.origin=e?.graphicOrigin,i.layer=i.sourceLayer=this}return s}async queryObjectIds(e,r){const t=await this.load();return t.source.queryObjectIds(G.from(e)??t.createQuery(),r)}async queryFeatureCount(e,r){const t=await this.load();return t.source.queryFeatureCount(G.from(e)??t.createQuery(),r)}async queryExtent(e,r){const t=await this.load();return t.source.queryExtent(G.from(e)??t.createQuery(),r)}serviceSupportsSpatialReference(e){return this.loaded&&Q(this,e)}async initLayerProperties(e){this._set("source",e),e.sourceJSON&&(this.sourceJSON=e.sourceJSON,this.read(e.sourceJSON,{origin:"service",portalItem:this.portalItem,portal:this.portalItem?.portal,url:this.parsedUrl})),N(this.timeInfo,this.fieldsIndex)}async hasDataChanged(){return k(this)}_fetchFirstValidLayerId(e){return i(this.url??"",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e}).then(e=>{const r=e.data;if(!r)return;this.applyPreferredHost(r);const t=[...r.layers||[],...r.tables||[]];return t.find(({type:e})=>!e||this.supportedSourceTypes.has(e))?.id})}_handleSublayersChange(e,r){r&&(r.forEach(e=>{e.parent=null}),this.removeHandles("sublayers-owner"),this._sublayerLookup.clear()),e&&(e.forEach(e=>{e.parent=this,this._sublayerLookup.set(e.subtypeCode,e)}),this.addHandles([e.on("after-add",({item:e})=>{e.parent=this,this._sublayerLookup.set(e.subtypeCode,e)}),e.on("after-remove",({item:e})=>{e.parent=null,this._sublayerLookup.delete(e.subtypeCode)})],"sublayers-owner"))}};t([b(O)],K.prototype,"barrierWeight",void 0),t([b({json:{write:!0}})],K.prototype,"editingEnabled",null),t([b({readOnly:!0})],K.prototype,"effectiveEditingEnabled",null),t([b({...R.fields,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],K.prototype,"fields",void 0),t([b(R.fieldsIndex)],K.prototype,"fieldsIndex",void 0),t([b({type:["ArcGISAnnotationLayer"]})],K.prototype,"operationalLayerType",void 0),t([b(R.outFields)],K.prototype,"outFields",void 0),t([b(C)],K.prototype,"popupEnabled",void 0),t([b({type:s,json:{name:"popupInfo",write:!0}})],K.prototype,"popupTemplate",void 0),t([b({readOnly:!0})],K.prototype,"defaultPopupTemplate",null),t([b({clonable:!1,readOnly:!0})],K.prototype,"source",void 0),t([b({type:B})],K.prototype,"sublayers",void 0),t([J("service","sublayers",["subtypes"])],K.prototype,"readSublayers",null),t([b({json:{read:!1},value:"annotation-feature",readOnly:!0})],K.prototype,"type",void 0),t([b({type:[Number],json:{write:{ignoreOrigin:!0}}})],K.prototype,"visibleLayers",null),K=t([v("esri.layers.AnnotationFeatureLayer")],K);const V=K;export{V as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import r from"../PopupTemplate.js";import{ClonableMixin as t}from"../core/Clonable.js";import i from"../core/Collection.js";import{deprecatedProperty as o}from"../core/deprecate.js";import s from"../core/Error.js";import has from"../core/has.js";import p from"../core/Logger.js";import{MultiOriginJSONSupportMixin as n}from"../core/MultiOriginJSONSupport.js";import{setDeepValue as a}from"../core/object.js";import{property as l}from"../core/accessorSupport/decorators/property.js";import{subclass as u}from"../core/accessorSupport/decorators/subclass.js";import{writer as d}from"../core/accessorSupport/decorators/writer.js";import m from"../geometry/Extent.js";import y from"../geometry/SpatialReference.js";import c from"../graphic/ParquetGraphicOrigin.js";import f from"./Layer.js";import{ParquetSource as h}from"./graphics/sources/ParquetSource.js";import{BlendLayer as g}from"./mixins/BlendLayer.js";import{CustomParametersMixin as j}from"./mixins/CustomParametersMixin.js";import{FeatureEffectLayer as w}from"./mixins/FeatureEffectLayer.js";import{FeatureReductionLayer as b}from"./mixins/FeatureReductionLayer.js";import{OperationalLayer as v}from"./mixins/OperationalLayer.js";import{OrderedLayer as O}from"./mixins/OrderedLayer.js";import{ScaleRangeLayer as x}from"./mixins/ScaleRangeLayer.js";import{labelsVisible as q,legendEnabled as E,popupEnabled as I}from"./support/commonProperties.js";import P from"./support/FeatureTemplate.js";import F from"./support/Field.js";import{defineFieldProperties as T}from"./support/fieldProperties.js";import{fixRendererFields as L}from"./support/fieldUtils.js";import S from"./support/GeometryEncodingLocation.js";import _ from"./support/GeometryEncodingWkb.js";import R from"./support/LabelClass.js";import{reader as D}from"./support/labelingInfo.js";import z from"./support/ParquetFilesData.js";import Q from"./support/ParquetPortalItemData.js";import{parquetGeometryTypeKebabDict as U}from"./support/parquetUtils.js";import{rendererTypes as C}from"../renderers/support/typeUtils.js";import k from"../rest/support/Query.js";import{createPopupTemplate as G}from"../support/popupUtils.js";const J=T(),M="__OBJECTID",N={types:{key:"type",base:null,typeMap:{wkb:_,location:S}},json:{name:"layerDefinition.geometryEncoding",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{read:{source:"geometryEncoding"}}}}};let V=class extends(b(w(g(O(x(v(n(j(t(f)))))))))){constructor(e){super(e),this._emptyUrls=new i,this.copyright=null,this.definitionExpression=null,this.displayOptimization=null,this.fields=null,this.fieldsIndex=null,this.geometryEncoding=null,this.fullExtent=null,this.geometryType=null,this.graphicOrigin=new c(this),this.labelsVisible=!0,this.labelingInfo=null,this.objectIdField=M,this.operationalLayerType="ParquetLayer",this.outFields=null,this.persistenceEnabled=!!has("parquetlayer-persistence-enabled"),this.popupTemplate=null,this.source=null,this.spatialReference=null,this.templates=null,this.title="Parquet",this.type="parquet",this.data=null}destroy(){this.source?.destroy()}async load(e){return this.addResolvingPromise(this._load(e)),this}get capabilities(){return this.source?.capabilities}get defaultPopupTemplate(){return this.createPopupTemplate()}writeFields(e,r,t,i){const o=e.filter(e=>!(e.name===M&&"oid"===e.type)).map(e=>e.toJSON(i));a(t,o,r)}get isTable(){return null==this.geometryEncoding&&null==this.displayOptimization}set renderer(e){L(e,this.fieldsIndex),this._set("renderer",e)}writeData(e,r,t,i){if(!e)return;const o=e.write({},i);"portal-item"!==o.type?o.urls.length&&(r.source=o):i.messages?.push(new s("parquet-layer:unsupported-data","Portal-item-backed Parquet data is not yet supported in web maps",{layer:this}))}get urls(){return"files"===this.data?.type?this.data.urls:this._emptyUrls}set urls(e){o(p.getLogger(this),"urls",{replacement:"data",version:"5.1",warnOnce:!0}),this.data=new z({urls:this._normalizeUrls(e)})}createPopupTemplate(e){return G(this,e)}createQuery(){const e=new k;return e.returnGeometry=!0,e.outFields=["*"],e.where=this.definitionExpression||"1=1",e}async createSource(e){const r=new h({layer:this});return await r.load(e),r}getFieldDomain(e,r){return null}getField(e){return this.fieldsIndex.get(e)}async queryFeatures(e,r){await this.load();const t=await this.source.queryFeatures(this._normalizeQuery(e),r),i=this.graphicOrigin;if(t?.features)for(const o of t.features)o.layer=o.sourceLayer=this,o.origin=i;return t}async queryObjectIds(e,r){return await this.load(),this.source.queryObjectIds(this._normalizeQuery(e),r)}async queryFeatureCount(e,r){return await this.load(),this.source.queryFeatureCount(this._normalizeQuery(e),r)}async queryExtent(e,r){return await this.load(),this.source.queryExtent(this._normalizeQuery(e),r)}_normalizeQuery(e){return k.from(e)??this.createQuery()}_normalizeUrls(e){return Array.isArray(e)?new i(e):e??new i}async _load(e){const r=await this.createSource(e);this._set("source",r),this.read(r.sourceJSON,{origin:"service"}),["fields"].forEach(e=>this.revertToOrigin(e,"service")),L(this.renderer,this.fieldsIndex),null==this.spatialReference&&(this.spatialReference=y.WGS84)}};e([l({readOnly:!0,json:{read:!1,write:!1}})],V.prototype,"capabilities",null),e([l({type:String})],V.prototype,"copyright",void 0),e([l({readOnly:!0})],V.prototype,"defaultPopupTemplate",null),e([l({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],V.prototype,"definitionExpression",void 0),e([l()],V.prototype,"displayOptimization",void 0),e([l({type:[F],json:{name:"layerDefinition.fields",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"fields"}}}})],V.prototype,"fields",void 0),e([d("fields")],V.prototype,"writeFields",null),e([l(J.fieldsIndex)],V.prototype,"fieldsIndex",void 0),e([l(N)],V.prototype,"geometryEncoding",void 0),e([l({type:m,json:{name:"extent"}})],V.prototype,"fullExtent",void 0),e([l({type:U.apiValues,json:{name:"layerDefinition.geometryType",read:{reader:U.read},write:{writer:U.write,ignoreOrigin:!0,isRequired:!0},origins:{service:{read:{source:"geometryType",reader:U.read}}}}})],V.prototype,"geometryType",void 0),e([l({readOnly:!0,clonable:!1})],V.prototype,"graphicOrigin",void 0),e([l(q)],V.prototype,"labelsVisible",void 0),e([l({type:[R],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:D},write:!0}})],V.prototype,"labelingInfo",void 0),e([l(E)],V.prototype,"legendEnabled",void 0),e([l()],V.prototype,"file",void 0),e([l({type:String,readOnly:!0})],V.prototype,"objectIdField",void 0),e([l({type:["ParquetLayer"]})],V.prototype,"operationalLayerType",void 0),e([l(J.outFields)],V.prototype,"outFields",void 0),e([l(I)],V.prototype,"popupEnabled",void 0),e([l({type:r,json:{name:"popupInfo",write:!0}})],V.prototype,"popupTemplate",void 0),e([l({types:C,json:{name:"layerDefinition.drawingInfo.renderer",write:!0,origins:{service:{read:{source:"drawingInfo.renderer"}}}}})],V.prototype,"renderer",null),e([l({type:h,readOnly:!0,cast:null,json:{read:!1}})],V.prototype,"source",void 0),e([l({type:y,json:{name:"layerDefinition.spatialReference",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{read:{source:"extent.spatialReference"}}}}})],V.prototype,"spatialReference",void 0),e([l({type:[P]})],V.prototype,"templates",void 0),e([l()],V.prototype,"title",void 0),e([l({json:{read:!1},readOnly:!0})],V.prototype,"type",void 0),e([l({types:{key:"type",base:null,typeMap:{files:z,"portal-item":Q}},json:{name:"source",origins:{"web-map":{write:{target:"source",ignoreOrigin:!0}}}}})],V.prototype,"data",void 0),e([d("web-map","data")],V.prototype,"writeData",null),e([l({type:i.ofType(String),json:{read:!1,write:!1}})],V.prototype,"urls",null),V=e([u("esri.layers.ParquetLayer")],V);const A=V;export{A as default};
2
+ import{__decorate as e}from"tslib";import r from"../PopupTemplate.js";import{ClonableMixin as t}from"../core/Clonable.js";import i from"../core/Collection.js";import{deprecatedProperty as o}from"../core/deprecate.js";import s from"../core/Error.js";import has from"../core/has.js";import p from"../core/Logger.js";import{MultiOriginJSONSupportMixin as a}from"../core/MultiOriginJSONSupport.js";import{setDeepValue as n}from"../core/object.js";import{property as l}from"../core/accessorSupport/decorators/property.js";import{subclass as u}from"../core/accessorSupport/decorators/subclass.js";import{writer as d}from"../core/accessorSupport/decorators/writer.js";import m from"../geometry/Extent.js";import y from"../geometry/SpatialReference.js";import c from"../graphic/ParquetGraphicOrigin.js";import f from"./Layer.js";import{ParquetSource as h}from"./graphics/sources/ParquetSource.js";import{BlendLayer as g}from"./mixins/BlendLayer.js";import{CustomParametersMixin as j}from"./mixins/CustomParametersMixin.js";import{FeatureEffectLayer as w}from"./mixins/FeatureEffectLayer.js";import{FeatureReductionLayer as b}from"./mixins/FeatureReductionLayer.js";import{OperationalLayer as v}from"./mixins/OperationalLayer.js";import{OrderedLayer as O}from"./mixins/OrderedLayer.js";import{ScaleRangeLayer as x}from"./mixins/ScaleRangeLayer.js";import{labelsVisible as q,legendEnabled as E,popupEnabled as I}from"./support/commonProperties.js";import P from"./support/FeatureTemplate.js";import F from"./support/Field.js";import{defineFieldProperties as T}from"./support/fieldProperties.js";import{fixRendererFields as L}from"./support/fieldUtils.js";import S from"./support/GeometryEncodingLocation.js";import _ from"./support/GeometryEncodingWkb.js";import R from"./support/LabelClass.js";import{reader as D}from"./support/labelingInfo.js";import z from"./support/ParquetFilesData.js";import Q from"./support/ParquetPortalItemData.js";import{parquetGeometryTypeKebabDict as U}from"./support/parquetUtils.js";import{rendererTypes as C}from"../renderers/support/typeUtils.js";import k from"../rest/support/Query.js";import{createPopupTemplate as G}from"../support/popupUtils.js";const J=T(),M="__OBJECTID",N={types:{key:"type",base:null,typeMap:{wkb:_,location:S}},json:{name:"layerDefinition.geometryEncoding",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{read:{source:"geometryEncoding"}}}}};let V=class extends(b(w(g(O(x(v(a(j(t(f)))))))))){constructor(e){super(e),this._emptyUrls=new i,this.copyright=null,this.definitionExpression=null,this.displayOptimization=null,this.fields=null,this.fieldsIndex=null,this.geometryEncoding=null,this.fullExtent=null,this.geometryType=null,this.graphicOrigin=new c(this),this.labelsVisible=!0,this.labelingInfo=null,this.objectIdField=M,this.operationalLayerType="ParquetLayer",this.outFields=null,this.persistenceEnabled=!!has("parquetlayer-persistence-enabled"),this.popupTemplate=null,this.source=null,this.spatialReference=null,this.templates=null,this.title="Parquet",this.type="parquet",this.data=null}destroy(){this.source?.destroy()}async load(e){return this.addResolvingPromise(this._load(e)),this}get capabilities(){return this.source?.capabilities}get defaultPopupTemplate(){return this.createPopupTemplate()}writeFields(e,r,t,i){const o=e.filter(e=>!(e.name===M&&"oid"===e.type)).map(e=>e.toJSON(i));n(t,o,r)}get isTable(){return null==this.geometryEncoding&&null==this.displayOptimization}set renderer(e){L(e,this.fieldsIndex),this._set("renderer",e)}writeData(e,r,t,i){if(!e)return;const o=e.write({},i);"portal-item"!==o.type?o.urls.length&&(r.source=o):i.messages?.push(new s("parquet-layer:unsupported-data","Portal-item-backed Parquet data is not yet supported in web maps",{layer:this}))}get urls(){return"files"===this.data?.type?this.data.urls:this._emptyUrls}set urls(e){o(p.getLogger(this),"urls",{replacement:"data",version:"5.1",warnOnce:!0}),this.data=new z({urls:this._normalizeUrls(e)})}createPopupTemplate(e){return G(this,e)}createQuery(){const e=new k;return e.returnGeometry=!0,e.outFields=["*"],e.where=this.definitionExpression||"1=1",e}async createSource(e){const r=new h({layer:this});return await r.load(e),r}getFieldDomain(e,r){return null}getField(e){return this.fieldsIndex.get(e)}async queryFeatures(e,r){await this.load();const t=await this.source.queryFeatures(this._normalizeQuery(e),r),i=this.graphicOrigin;if(t?.features)for(const o of t.features)o.layer=o.sourceLayer=this,o.origin=i;return t}async queryObjectIds(e,r){return await this.load(),this.source.queryObjectIds(this._normalizeQuery(e),r)}async queryFeatureCount(e,r){return await this.load(),this.source.queryFeatureCount(this._normalizeQuery(e),r)}async queryExtent(e,r){return await this.load(),this.source.queryExtent(this._normalizeQuery(e),r)}_normalizeQuery(e){return k.from(e)??this.createQuery()}_normalizeUrls(e){return Array.isArray(e)?new i(e):e??new i}async _load(e){const r=await this.createSource(e);this._set("source",r),this.read(r.sourceJSON,{origin:"service"}),["fields"].forEach(e=>this.revertToOrigin(e,"service")),L(this.renderer,this.fieldsIndex),null==this.spatialReference&&(this.spatialReference=y.WGS84)}};e([l({readOnly:!0,json:{read:!1,write:!1}})],V.prototype,"capabilities",null),e([l({type:String})],V.prototype,"copyright",void 0),e([l({readOnly:!0})],V.prototype,"defaultPopupTemplate",null),e([l({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],V.prototype,"definitionExpression",void 0),e([l()],V.prototype,"displayOptimization",void 0),e([l({type:[F],json:{name:"layerDefinition.fields",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"fields"}}}})],V.prototype,"fields",void 0),e([d("fields")],V.prototype,"writeFields",null),e([l(J.fieldsIndex)],V.prototype,"fieldsIndex",void 0),e([l(N)],V.prototype,"geometryEncoding",void 0),e([l({type:m,json:{name:"extent"}})],V.prototype,"fullExtent",void 0),e([l({type:U.apiValues,json:{name:"layerDefinition.geometryType",read:{reader:U.read},write:{writer:U.write,ignoreOrigin:!0,isRequired:!0},origins:{service:{read:{source:"geometryType",reader:U.read}}}}})],V.prototype,"geometryType",void 0),e([l({readOnly:!0,clonable:!1})],V.prototype,"graphicOrigin",void 0),e([l(q)],V.prototype,"labelsVisible",void 0),e([l({type:[R],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:D},write:!0}})],V.prototype,"labelingInfo",void 0),e([l(E)],V.prototype,"legendEnabled",void 0),e([l()],V.prototype,"file",void 0),e([l({type:String,readOnly:!0})],V.prototype,"objectIdField",void 0),e([l({type:["ParquetLayer"]})],V.prototype,"operationalLayerType",void 0),e([l(J.outFields)],V.prototype,"outFields",void 0),e([l(I)],V.prototype,"popupEnabled",void 0),e([l({type:r,json:{name:"popupInfo",write:!0}})],V.prototype,"popupTemplate",void 0),e([l({types:C,json:{name:"layerDefinition.drawingInfo.renderer",write:!0,origins:{service:{read:{source:"drawingInfo.renderer"}}}}})],V.prototype,"renderer",null),e([l({type:h,readOnly:!0,cast:null,json:{read:!1}})],V.prototype,"source",void 0),e([l({type:y,json:{name:"layerDefinition.spatialReference",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{read:{source:"extent.spatialReference"}}}}})],V.prototype,"spatialReference",void 0),e([l({type:[P]})],V.prototype,"templates",void 0),e([l()],V.prototype,"title",void 0),e([l({json:{read:!1},readOnly:!0})],V.prototype,"type",void 0),e([l({types:{key:"type",base:null,typeMap:{files:z,"portal-item":Q}},json:{name:"source",origins:{"web-map":{write:{target:"source",ignoreOrigin:!0}}}}})],V.prototype,"data",void 0),e([d("web-map","data")],V.prototype,"writeData",null),e([l({type:i.ofType(String),json:{read:!1,write:!1}})],V.prototype,"urls",null),V=e([u("esri.layers.ParquetLayer")],V);export{V as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../Graphic.js";import r from"../../../core/Collection.js";import i from"../../../core/Error.js";import has from"../../../core/has.js";import{LoadableMixin as o}from"../../../core/Loadable.js";import s from"../../../core/Logger.js";import{EsriPromiseMixin as n}from"../../../core/Promise.js";import{open as a}from"../../../core/workers.js";import{property as l,subclass as u}from"../../../core/accessorSupport/decorators.js";import{ensureType as p}from"../../../core/accessorSupport/ensureType.js";import d from"../../../geometry/Extent.js";import c from"../../../geometry/Polygon.js";import{typeKebabDictionary as y}from"../../../geometry/support/typeUtils.js";import{createFeatureIdFromLayer as h}from"../data/createFeatureId.js";import{unapplyEditsZUnitScaling as m}from"../../../rest/query/operations/editsZScale.js";import{applyFeatureSetZUnitScaling as f}from"../../../rest/query/operations/queryZScale.js";import g from"../../../rest/support/FeatureSet.js";import{shared as _}from"../../../core/accessorSupport/decorators/shared.js";let F=0,T=class extends(o(n(r))){constructor(e){super(e),this._idToClientGeometry=null,this.type="memory"}load(e){const t=null!=e?e.signal:null;return this.addResolvingPromise(this._startWorker(t)),Promise.resolve(this)}destroy(){this._connection?.close(),this._connection=null}get _workerGeometryType(){const e=this.layer?.geometryType;return e?this._geometryTypeRequiresClientGraphicMapping(e)?"polygon":e:null}applyEdits(e){return this.load().then(()=>this._applyEdits(e))}openPorts(){return this.load().then(()=>this._connection.openPorts())}async queryFeatures(e,t={}){await this.load(t);const r=await this._connection.invoke("queryFeatures",e?e.toJSON():null,t);f(e,this.layer.spatialReference,r);const i=g.fromJSON(r);if(!this._requiresClientGraphicMapping()||!this._idToClientGeometry)return i;const o=this.layer.objectIdField;for(const s of i.features){const e=s.attributes[o],t=this._idToClientGeometry.get(e);void 0!==t&&(s.geometry=t)}return i.geometryType=this.layer.geometryType,i}async queryFeaturesJSON(e,t={}){if(this._requiresClientGraphicMapping())throw new i("query-features-json:unsupported","Cannot query in JSON format for client only geometry types (mesh and extent)");await this.load(t);const r=await this._connection.invoke("queryFeatures",e?e.toJSON():null,t);return f(e,this.layer.spatialReference,r),r}queryFeatureCount(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryFeatureCount",e?e.toJSON():null,t))}queryObjectIds(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryObjectIds",e?e.toJSON():null,t))}queryExtent(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryExtent",e?e.toJSON():null,t)).then(e=>({count:e.count,extent:d.fromJSON(e.extent)}))}querySnapping(e,t={}){return this.load(t).then(()=>this._connection.invoke("querySnapping",e,t))}async queryAttributeBins(e,t={}){return await this.load(),this._connection.invoke("queryAttributeBins",e?.toJSON(),t)}async _applyEdits(e){if(!this._connection)throw new i("feature-layer-source:edit-failure","Memory source not loaded");const t=this.layer.objectIdField,r=this.layer.uniqueIdFields;let o=null;const s=[],n=[];await Promise.all([this._prepareClientMapping(e.addFeatures,null),this._prepareClientMapping(e.updateFeatures,null)]);const a=e=>r?.length&&"attributes"in e?h(e,this.layer):"objectId"in e&&null!=e.objectId?e.objectId:"attributes"in e&&null!=e.attributes[t]?e.attributes[t]:null;if(e.addFeatures&&(o=this._prepareAddFeatures(e.addFeatures)),e.deleteFeatures)for(const i of e.deleteFeatures){const e=a(i);null!=e&&s.push(e)}const l=e.updateFeatures&&this._idToClientGeometry?new Map:null;if(e.updateFeatures)for(const i of e.updateFeatures)if(n.push(this._serializeFeature(i)),l&&null!=i.geometry){const e=a(i);null!=e&&l.set(e,i)}m(o?o.features:null,n,this.layer.spatialReference);const{fullExtent:u,featureEditResults:p}=await this._connection.invoke("applyEdits",{adds:o?o.features:[],updates:n,deletes:s});return this.fullExtent=u,o&&o.finish(p.uidToObjectId),this._updateIdToClientGeometries(l,p),this._createEditsResult(p)}async _prepareClientMapping(e,t){if("mesh"!==this._layerOrSourceGeometryType||null==e)return;const r=[];for(const{geometry:i}of e)null==i||"mesh"!==i.type||i.hasExtent||i.loaded||r.push(i.load({signal:t}));r.length&&await Promise.all(r)}_updateIdToClientGeometries(e,t){if(this._idToClientGeometry){if(e)for(const r of t.updateResults){if(!r.success)continue;const t=e.get(r.objectId);null!=t&&this._addIdToClientGeometry(t)}for(const e of t.deleteResults)e.success&&this._idToClientGeometry.delete(e.objectId)}}_createEditsResult(e){return{addFeatureResults:e.addResults?e.addResults.map(this._createFeatureEditResult,this):[],updateFeatureResults:e.updateResults?e.updateResults.map(this._createFeatureEditResult,this):[],deleteFeatureResults:e.deleteResults?e.deleteResults.map(this._createFeatureEditResult,this):[],addAttachmentResults:[],updateAttachmentResults:[],deleteAttachmentResults:[]}}_createFeatureEditResult(e){const t=!0===e.success?null:e.error||{code:void 0,description:""};return{objectId:e.objectId,globalId:e.globalId,error:t?new i("feature-layer-source:edit-failure",t.description,{code:t.code}):null}}_prepareAddFeatures(e){const t=new Map,r=new Array(e.length);let i=null;for(let s=0;s<e.length;s++){const o=e[s],n=this._serializeFeature(o);i||null==o.geometry||(i=o.geometry.type),r[s]=n,t.set(`${n.uid}`,o)}const o=this;return{features:r,inferredGeometryType:i,finish(e){const r=o.sourceJSON.objectIdField;for(const i in e){const s=e[i],n=t.get(i);n&&(n.attributes||(n.attributes={}),-1===s?delete n.attributes[r]:n.attributes[r]=s,o._addIdToClientGeometry(n))}}}}_addIdToClientGeometry(e){if(!this._idToClientGeometry)return;const t=this.sourceJSON.objectIdField,r=e.attributes?.[t];null!=r&&this._idToClientGeometry.set(r,e.geometry??null)}get _layerOrSourceGeometryType(){return this.layer?.geometryType??this.sourceJSON?.geometryType}_requiresClientGraphicMapping(){return this._geometryTypeRequiresClientGraphicMapping(this._layerOrSourceGeometryType)}_geometryRequiresClientGraphicMapping(e){return this._geometryTypeRequiresClientGraphicMapping(e.type)}_geometryTypeRequiresClientGraphicMapping(e){return"mesh"===e||"multipatch"===e||"extent"===e}_serializeFeature(e){const{attributes:t}=e,r=this._geometryForSerialization(e),i=(F++).toString();return r?{uid:i,geometry:r.toJSON(),attributes:t}:{uid:i,attributes:t}}_geometryForSerialization(e){const{geometry:t}=e;if(null==t)return null;if(this._geometryRequiresClientGraphicMapping(t)){return t.extent?c.fromExtent(t.extent):null}return t}async _startWorker(e){this._connection=await a("MemorySourceWorker",{strategy:has("feature-layers-workers")?"dedicated":"local",signal:e,registryTarget:this});const{fields:t,spatialReference:r,objectIdField:i,hasM:o,hasZ:n,timeInfo:l,dateFieldsTimeZone:u}=this.layer,p="defaults"===this.layer.originOf("spatialReference");await this._prepareClientMapping(this.items,e);const d=this._prepareAddFeatures(this.items);this.addHandles(this.on("before-changes",e=>{s.getLogger(this).error("Source modifications will not propagate after layer has been loaded. Please use .applyEdits() instead"),e.preventDefault()}));const{uniqueIdFields:c}=this.layer,h=c?.length?{type:c.length>1?"composite":"simple",fields:c.slice(),OIDFieldContainsHashValue:!(1===c?.length&&c.at(0)===this.layer.objectIdField)}:void 0,m={features:d.features,fields:t?.map(e=>e.toJSON()),geometryType:y.toJSON(this._workerGeometryType),hasM:"mesh"!==this._layerOrSourceGeometryType&&o,hasZ:"mesh"===this._layerOrSourceGeometryType||n,objectIdField:i,spatialReference:p?null:r&&r.toJSON(),timeInfo:l?.toJSON()??null,dateFieldsTimeZone:u,uniqueIdInfo:h},f=await this._connection.invoke("load",m,{signal:e});for(const a of f.warnings)s.getLogger(this.layer).warn("#load()",`${a.message} (title: '${this.layer.title||"no title"}', id: '${this.layer.id??"no id"}')`,{warning:a});f.featureErrors.length&&s.getLogger(this.layer).error("#load()",`Failed to load ${f.featureErrors.length} features due to errors. (title: '${this.layer.title||"no title"}', id: '${this.layer.id??"no id"}').`,f.featureErrors.map(e=>"\n\n- "+e.error.description).join(""));const g=f.layerDefinition;this._geometryTypeRequiresClientGraphicMapping(d.inferredGeometryType)&&(g.geometryType=y.toJSON(d.inferredGeometryType)),this.sourceJSON=g,this._requiresClientGraphicMapping()&&(this._idToClientGeometry=new Map),d.finish(f.assignedObjectIds)}};e([_({Type:t,ensureType:p(t)})],T.prototype,"itemType",void 0),e([l()],T.prototype,"type",void 0),e([l({constructOnly:!0})],T.prototype,"layer",void 0),e([l({readOnly:!0})],T.prototype,"_workerGeometryType",null),e([l()],T.prototype,"sourceJSON",void 0),T=e([u("esri.layers.graphics.sources.MemorySource")],T);export{T as MemorySource};
2
+ import{__decorate as e}from"tslib";import t from"../../../Graphic.js";import r from"../../../core/Collection.js";import i from"../../../core/Error.js";import has from"../../../core/has.js";import{LoadableMixin as o}from"../../../core/Loadable.js";import s from"../../../core/Logger.js";import{EsriPromiseMixin as n}from"../../../core/Promise.js";import{open as a}from"../../../core/workers.js";import{property as l,subclass as u}from"../../../core/accessorSupport/decorators.js";import{ensureType as p}from"../../../core/accessorSupport/ensureType.js";import d from"../../../geometry/Extent.js";import c from"../../../geometry/Polygon.js";import{typeKebabDictionary as y}from"../../../geometry/support/typeUtils.js";import{createFeatureIdFromLayer as h}from"../data/createFeatureId.js";import{unapplyEditsZUnitScaling as m}from"../../../rest/query/operations/editsZScale.js";import{applyFeatureSetZUnitScaling as f}from"../../../rest/query/operations/queryZScale.js";import g from"../../../rest/support/FeatureSet.js";import{shared as _}from"../../../core/accessorSupport/decorators/shared.js";let F=0,T=class extends(o(n(r))){constructor(e){super(e),this._idToClientGeometry=null,this.type="memory"}load(e){const t=null!=e?e.signal:null;return this.addResolvingPromise(this._startWorker(t)),Promise.resolve(this)}destroy(){this._connection?.close(),this._connection=null}get _workerGeometryType(){const e=this.layer?.geometryType;return e?this._geometryTypeRequiresClientGraphicMapping(e)?"polygon":e:null}applyEdits(e){return this.load().then(()=>this._applyEdits(e))}openPorts(){return this.load().then(()=>this._connection.openPorts())}async queryFeatures(e,t={}){await this.load(t);const r=await this._connection.invoke("queryFeatures",e?e.toJSON():null,t);f(e,this.layer.spatialReference,r);const i=g.fromJSON(r);if(!this._requiresClientGraphicMapping()||!this._idToClientGeometry)return i;const o=this.layer.objectIdField;for(const s of i.features){const e=s.attributes[o],t=this._idToClientGeometry.get(e);void 0!==t&&(s.geometry=t)}return i.geometryType=this.layer.geometryType,i}async queryFeaturesJSON(e,t={}){if(this._requiresClientGraphicMapping())throw new i("query-features-json:unsupported","Cannot query in JSON format for client only geometry types (mesh and extent)");await this.load(t);const r=await this._connection.invoke("queryFeatures",e?e.toJSON():null,t);return f(e,this.layer.spatialReference,r),r}queryFeatureCount(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryFeatureCount",e?e.toJSON():null,t))}queryObjectIds(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryObjectIds",e?e.toJSON():null,t))}queryExtent(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryExtent",e?e.toJSON():null,t)).then(e=>({count:e.count,extent:d.fromJSON(e.extent)}))}querySnapping(e,t={}){return this.load(t).then(()=>this._connection.invoke("querySnapping",e,t))}async queryAttributeBins(e,t={}){await this.load();const r=await this._connection.invoke("queryAttributeBins",e?.toJSON(),t);return(await import("../../../rest/support/AttributeBinsFeatureSet.js")).default.fromJSON(r)}async _applyEdits(e){if(!this._connection)throw new i("feature-layer-source:edit-failure","Memory source not loaded");const t=this.layer.objectIdField,r=this.layer.uniqueIdFields;let o=null;const s=[],n=[];await Promise.all([this._prepareClientMapping(e.addFeatures,null),this._prepareClientMapping(e.updateFeatures,null)]);const a=e=>r?.length&&"attributes"in e?h(e,this.layer):"objectId"in e&&null!=e.objectId?e.objectId:"attributes"in e&&null!=e.attributes[t]?e.attributes[t]:null;if(e.addFeatures&&(o=this._prepareAddFeatures(e.addFeatures)),e.deleteFeatures)for(const i of e.deleteFeatures){const e=a(i);null!=e&&s.push(e)}const l=e.updateFeatures&&this._idToClientGeometry?new Map:null;if(e.updateFeatures)for(const i of e.updateFeatures)if(n.push(this._serializeFeature(i)),l&&null!=i.geometry){const e=a(i);null!=e&&l.set(e,i)}m(o?o.features:null,n,this.layer.spatialReference);const{fullExtent:u,featureEditResults:p}=await this._connection.invoke("applyEdits",{adds:o?o.features:[],updates:n,deletes:s});return this.fullExtent=u,o&&o.finish(p.uidToObjectId),this._updateIdToClientGeometries(l,p),this._createEditsResult(p)}async _prepareClientMapping(e,t){if("mesh"!==this._layerOrSourceGeometryType||null==e)return;const r=[];for(const{geometry:i}of e)null==i||"mesh"!==i.type||i.hasExtent||i.loaded||r.push(i.load({signal:t}));r.length&&await Promise.all(r)}_updateIdToClientGeometries(e,t){if(this._idToClientGeometry){if(e)for(const r of t.updateResults){if(!r.success)continue;const t=e.get(r.objectId);null!=t&&this._addIdToClientGeometry(t)}for(const e of t.deleteResults)e.success&&this._idToClientGeometry.delete(e.objectId)}}_createEditsResult(e){return{addFeatureResults:e.addResults?e.addResults.map(this._createFeatureEditResult,this):[],updateFeatureResults:e.updateResults?e.updateResults.map(this._createFeatureEditResult,this):[],deleteFeatureResults:e.deleteResults?e.deleteResults.map(this._createFeatureEditResult,this):[],addAttachmentResults:[],updateAttachmentResults:[],deleteAttachmentResults:[]}}_createFeatureEditResult(e){const t=!0===e.success?null:e.error||{code:void 0,description:""};return{objectId:e.objectId,globalId:e.globalId,error:t?new i("feature-layer-source:edit-failure",t.description,{code:t.code}):null}}_prepareAddFeatures(e){const t=new Map,r=new Array(e.length);let i=null;for(let s=0;s<e.length;s++){const o=e[s],n=this._serializeFeature(o);i||null==o.geometry||(i=o.geometry.type),r[s]=n,t.set(`${n.uid}`,o)}const o=this;return{features:r,inferredGeometryType:i,finish(e){const r=o.sourceJSON.objectIdField;for(const i in e){const s=e[i],n=t.get(i);n&&(n.attributes||(n.attributes={}),-1===s?delete n.attributes[r]:n.attributes[r]=s,o._addIdToClientGeometry(n))}}}}_addIdToClientGeometry(e){if(!this._idToClientGeometry)return;const t=this.sourceJSON.objectIdField,r=e.attributes?.[t];null!=r&&this._idToClientGeometry.set(r,e.geometry??null)}get _layerOrSourceGeometryType(){return this.layer?.geometryType??this.sourceJSON?.geometryType}_requiresClientGraphicMapping(){return this._geometryTypeRequiresClientGraphicMapping(this._layerOrSourceGeometryType)}_geometryRequiresClientGraphicMapping(e){return this._geometryTypeRequiresClientGraphicMapping(e.type)}_geometryTypeRequiresClientGraphicMapping(e){return"mesh"===e||"multipatch"===e||"extent"===e}_serializeFeature(e){const{attributes:t}=e,r=this._geometryForSerialization(e),i=(F++).toString();return r?{uid:i,geometry:r.toJSON(),attributes:t}:{uid:i,attributes:t}}_geometryForSerialization(e){const{geometry:t}=e;if(null==t)return null;if(this._geometryRequiresClientGraphicMapping(t)){return t.extent?c.fromExtent(t.extent):null}return t}async _startWorker(e){this._connection=await a("MemorySourceWorker",{strategy:has("feature-layers-workers")?"dedicated":"local",signal:e,registryTarget:this});const{fields:t,spatialReference:r,objectIdField:i,hasM:o,hasZ:n,timeInfo:l,dateFieldsTimeZone:u}=this.layer,p="defaults"===this.layer.originOf("spatialReference");await this._prepareClientMapping(this.items,e);const d=this._prepareAddFeatures(this.items);this.addHandles(this.on("before-changes",e=>{s.getLogger(this).error("Source modifications will not propagate after layer has been loaded. Please use .applyEdits() instead"),e.preventDefault()}));const{uniqueIdFields:c}=this.layer,h=c?.length?{type:c.length>1?"composite":"simple",fields:c.slice(),OIDFieldContainsHashValue:!(1===c?.length&&c.at(0)===this.layer.objectIdField)}:void 0,m={features:d.features,fields:t?.map(e=>e.toJSON()),geometryType:y.toJSON(this._workerGeometryType),hasM:"mesh"!==this._layerOrSourceGeometryType&&o,hasZ:"mesh"===this._layerOrSourceGeometryType||n,objectIdField:i,spatialReference:p?null:r&&r.toJSON(),timeInfo:l?.toJSON()??null,dateFieldsTimeZone:u,uniqueIdInfo:h},f=await this._connection.invoke("load",m,{signal:e});for(const a of f.warnings)s.getLogger(this.layer).warn("#load()",`${a.message} (title: '${this.layer.title||"no title"}', id: '${this.layer.id??"no id"}')`,{warning:a});f.featureErrors.length&&s.getLogger(this.layer).error("#load()",`Failed to load ${f.featureErrors.length} features due to errors. (title: '${this.layer.title||"no title"}', id: '${this.layer.id??"no id"}').`,f.featureErrors.map(e=>"\n\n- "+e.error.description).join(""));const g=f.layerDefinition;this._geometryTypeRequiresClientGraphicMapping(d.inferredGeometryType)&&(g.geometryType=y.toJSON(d.inferredGeometryType)),this.sourceJSON=g,this._requiresClientGraphicMapping()&&(this._idToClientGeometry=new Map),d.finish(f.assignedObjectIds)}};e([_({Type:t,ensureType:p(t)})],T.prototype,"itemType",void 0),e([l()],T.prototype,"type",void 0),e([l({constructOnly:!0})],T.prototype,"layer",void 0),e([l({readOnly:!0})],T.prototype,"_workerGeometryType",null),e([l()],T.prototype,"sourceJSON",void 0),T=e([u("esri.layers.graphics.sources.MemorySource")],T);export{T as MemorySource};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import e from"../../../core/Error.js";import{Loadable as r}from"../../../core/Loadable.js";import s from"../../../core/Logger.js";import{throwIfAborted as o}from"../../../core/promiseUtils.js";import{watch as i}from"../../../core/reactiveUtils.js";import{open as a}from"../../../core/workers.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import{subclass as c}from"../../../core/accessorSupport/decorators/subclass.js";import l from"../../../geometry/Extent.js";import{createFileProviderSchema as u,toParquetJSONGeometryType as y}from"../../support/parquetUtils.js";import p from"../../../rest/support/FeatureSet.js";let m=class extends r{constructor(t){super(t),this.type="parquet"}load(t){const e=null!=t?t.signal:null;return this.addResolvingPromise(this._initialize(e)),this.addHandles([i(()=>this.layer.data,async t=>{t&&await this._proxy.updateFileProvider(await u(t))}),i(()=>this.layer.customParameters,t=>this._setCustomParameters(t))]),Promise.resolve(this)}destroy(){this._connection?.destroy()}async openPorts(){return await this.load(),this._connection.openPorts()}async queryFeaturesJSON(t,e={}){return await this.load(e),this._proxy.queryFeatures(t.toJSON(),{signal:e?.signal})}async queryFeatures(t,e={}){const r=await this.queryFeaturesJSON(t,{signal:e?.signal});return p.fromJSON(r)}async queryObjectIds(t,e){return await this._proxy.queryObjectIds(t.toJSON(),{signal:e?.signal})}async queryFeatureCount(t,e){return this._proxy.queryFeatureCount(t.toJSON(),{signal:e?.signal})}async queryExtent(t,e){if(null==this.layer.geometryEncoding)return s.getLogger(this).warn("Tried to queryExtent, but source does not have a geometry. Returning null extent."),{count:0,extent:null};const r=await this._proxy.queryExtent(t.toJSON(),{signal:e?.signal});return{count:r.count,extent:l.fromJSON(r.extent)}}async _initialize(t){if(!this.layer.data)throw new e("parquet:missing-data","A data source must be specified",this.layer);const r=await u(this.layer.data,{signal:t});o(t),this._connection=await a("ParquetSourceWorker",{strategy:"dedicated",signal:t,registryTarget:this}),o(t),this._proxy=this._connection.createInvokeProxy();const{layerDefinition:s,capabilities:i}=await this._proxy.load({provider:r,fields:this.layer.fields?.map(t=>t.toJSON()),geometryType:this.layer.geometryType?y(this.layer.geometryType):null,spatialReference:this.layer.spatialReference?.toJSON(),geometryEncoding:this.layer.geometryEncoding?.toJSON(),displayOptimization:this.layer.displayOptimization,customParameters:this.layer.customParameters});o(t),this.sourceJSON=s,this.capabilities=i}_setCustomParameters(t){this._proxy.setCustomParameters(t).catch(()=>{s.getLogger(this).warn("Failed to update customParameters")})}};t([n()],m.prototype,"type",void 0),t([n({constructOnly:!0})],m.prototype,"layer",void 0),t([n()],m.prototype,"sourceJSON",void 0),t([n()],m.prototype,"capabilities",void 0),m=t([c("esri.layers.graphics.sources.ParquetSource")],m);export{m as ParquetSource};
2
+ import{__decorate as t}from"tslib";import e from"../../../core/Error.js";import{Loadable as r}from"../../../core/Loadable.js";import s from"../../../core/Logger.js";import{throwIfAborted as o}from"../../../core/promiseUtils.js";import{watch as a}from"../../../core/reactiveUtils.js";import{open as i}from"../../../core/workers.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import{subclass as u}from"../../../core/accessorSupport/decorators/subclass.js";import y from"../../../geometry/Extent.js";import{createFileProviderSchema as c,toParquetJSONGeometryType as l}from"../../support/parquetUtils.js";import p from"../../../rest/support/FeatureSet.js";let m=class extends r{constructor(t){super(t),this.type="parquet"}load(t){const e=null!=t?t.signal:null;return this.addResolvingPromise(this._initialize(e)),this.addHandles([a(()=>this.layer.data,async t=>{t&&await this._proxy.updateFileProvider(await c(t))}),a(()=>this.layer.customParameters,t=>this._setCustomParameters(t))]),Promise.resolve(this)}destroy(){this._connection?.destroy()}async openPorts(){return await this.load(),this._connection.openPorts()}async queryFeaturesJSON(t,e={}){return await this.load(e),this._proxy.queryFeatures(t.toJSON(),{signal:e?.signal})}async queryFeatures(t,e={}){const r=await this.queryFeaturesJSON(t,{signal:e?.signal});return p.fromJSON(r)}async queryObjectIds(t,e){return await this._proxy.queryObjectIds(t.toJSON(),{signal:e?.signal})}async queryFeatureCount(t,e){return this._proxy.queryFeatureCount(t.toJSON(),{signal:e?.signal})}async queryExtent(t,e){if(null==this.layer.geometryEncoding)return s.getLogger(this).warn("Tried to queryExtent, but source does not have a geometry. Returning null extent."),{count:0,extent:null};const r=await this._proxy.queryExtent(t.toJSON(),{signal:e?.signal});return{count:r.count,extent:y.fromJSON(r.extent)}}async _initialize(t){if(!this.layer.data)throw new e("parquet:missing-data","A data source must be specified",this.layer);const r=await c(this.layer.data,{signal:t});o(t),this._connection=await i("ParquetSourceWorker",{strategy:"dedicated",signal:t,registryTarget:this}),o(t),this._proxy=this._connection.createInvokeProxy();const{layerDefinition:s,capabilities:a}=await this._proxy.load({provider:r,fields:this.layer.fields?.map(t=>t.toJSON()),geometryType:this.layer.geometryType?l(this.layer.geometryType):null,spatialReference:this.layer.spatialReference?.toJSON(),geometryEncoding:this.layer.geometryEncoding?.toJSON(),displayOptimization:this.layer.displayOptimization,customParameters:this.layer.customParameters});o(t),this.sourceJSON=s,this.capabilities=a}_setCustomParameters(t){this._proxy.setCustomParameters(t).catch(()=>{s.getLogger(this).warn("Failed to update customParameters")})}_queryStream(t,e){return this._proxy.queryStream(t,e)}_getStreamNextFeatures(t,e){return this._proxy.getStreamNextFeatures(t,e)}};t([n()],m.prototype,"type",void 0),t([n({constructOnly:!0})],m.prototype,"layer",void 0),t([n()],m.prototype,"sourceJSON",void 0),t([n()],m.prototype,"capabilities",void 0),m=t([u("esri.layers.graphics.sources.ParquetSource")],m);export{m as ParquetSource};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__addDisposableResource as e,__disposeResources as t}from"tslib";import{toConst as r}from"../../../../core/compilerUtils.js";import s from"../../../../core/Error.js";import has from"../../../../core/has.js";import i from"../../../../core/Logger.js";import{onAbortOrThrow as a,throwIfAborted as n}from"../../../../core/promiseUtils.js";import{QueueProcessor as o}from"../../../../core/QueueProcessor.js";import{parseWhereClause as u}from"../../../../core/sql.js";import l from"../../../../geometry/SpatialReference.js";import{set as p,create as c,expandWithAABB as d,expandWithRect as f,negativeInfinity as m}from"../../../../geometry/support/aaBoundingBox.js";import{getQueryResultExtent as h,QueryEngine as y}from"../../data/QueryEngine.js";import{queryBinsCapabilities as g,queryCapabilities as _}from"../../data/QueryEngineCapabilities.js";import{QueryEngineResult as w}from"../../data/QueryEngineResult.js";import{normalizeQueryLike as x}from"../../data/queryUtils.js";import{createFileProvider as I}from"../parquet/createFileProvider.js";import{createDrawingInfo as F}from"./clientSideDefaults.js";import{getParquetFileId as S,getParquetRowId as R}from"./parquetIdUtils.js";import q from"../../../support/Field.js";import v from"../../../support/FieldsIndex.js";import{fromParquetGeometryEncodingJSON as C}from"../../../support/parquetEncodingUtils.js";import{completeParquetLayerInfo as E,fromParquetJSONGeometryType as O,toParquetJSONGeometryType as b}from"../../../support/parquetUtils.js";import{loadParquetModule as P}from"../../../../libs/parquet/loadParquetModule.js";import{FeatureStoreQueryAdapter as Q}from"../../../../views/2d/layers/features/FeatureStoreQueryAdapter.js";import{FeatureSnapshotSourceChunk as T}from"../../../../views/2d/layers/features/sources/strategies/chunks/FeatureSnapshotSourceChunk.js";import{FeatureSourceChunkStore as j}from"../../../../views/2d/layers/features/sources/strategies/chunks/SourceChunkStore.js";import{FeatureMetadata as N}from"../../../../views/2d/layers/features/support/FeatureMetadata.js";import{FeatureSetReaderParquet as A}from"../../../../views/2d/layers/features/support/FeatureSetReaderParquet.js";const M=new Q,B=4,G="__OBJECTID",D=new TextDecoder,z=8e3,k=8,V=2,W=20;class U{constructor(e,t){this._files=e,this._createFileStream=t,this._fileIndex=0,this._streamIndex=0,this._streams=[],this._pending=new Set,this._resolvedCount=0}async next(e){for(await this._fill(e);this._pending.size>0;){n(e),await this._fill(e);const t=await J(this._pending);if(this._pending.delete(t.read),this._resolvedCount++,null!=t.chunk)return t.chunk}return null}async _fill(e){for(this._removeDone();this._pending.size<k;){const t=this._getOrCreateNextStream(e);if(null==t)return;this._pending.add(t.read(e))}}_getOrCreateNextStream(e){const t=this._resolvedCount>=k?k:V;if(this._fileIndex<this._files.length&&this._streams.length<t){const t=this._files[this._fileIndex++],r=new Z(t.id,this._createFileStream(t,e));return this._streams.push(r),r}return this._getNextStream()}_getNextStream(){const e=this._streams.length;for(let t=0;t<e;t++){const r=(this._streamIndex+t)%e,s=this._streams[r];if(s.canRead)return this._streamIndex=(r+1)%e,s}return null}_removeDone(){let e=this._streamIndex;for(let t=this._streams.length-1;t>=0;t--)this._streams[t].done&&(this._streams.splice(t,1),t<e&&e--);this._streamIndex=this._streams.length>0?e%this._streams.length:0}}function J(e){return Promise.race(Array.from(e,async e=>({read:e,chunk:await e})))}class Z{constructor(e,t){this._fileId=e,this._stream=t,this._readCount=0,this._reachedEnd=!1}get canRead(){return!this._reachedEnd}get done(){return this._reachedEnd&&0===this._readCount}async read(e){this._readCount++;try{const t=await this._stream,r=await t.next(e);return null==r?(this._reachedEnd=!0,null):{fileId:this._fileId,chunk:r}}finally{this._readCount--}}}class L{constructor(){this._queue=new o({concurrency:B,process:(e,t)=>this._executeQuery(e,t)}),this._streams=new Map,this._streamIdCounter=0,this._indexMap={}}async load(e){const t=e.spatialReference?l.fromJSON(e.spatialReference):void 0;if(t&&!t.isWGS84&&!t.isWebMercator)throw new s("parquet:unsupported-projection","Only WGS84 and Web Mercator are supported");this._customParameters=e.customParameters,this._provider=I(e.provider,null,()=>this._customParameters);const r=await this._provider.getMetadata(),a=await E(r,{fields:e.fields?.map(e=>q.fromJSON(e)),geometryEncoding:e.geometryEncoding?C(e.geometryEncoding):null,geometryType:e.geometryType?O(e.geometryType):null,displayOptimization:e.displayOptimization,spatialReference:t});if(!a.fields)throw new s("parquet:unsupported","Fields must be defined");let n;if(a.spatialReference&&a.geometryType){if(!a.spatialReference)throw new s("parquet:unsupported","SpatialReference must be defined");if(!a.spatialReference.isGeographic&&!a.spatialReference.isWebMercator)throw new s("parquet:unsupported-projection","Only WGS84 and Web Mercator are supported");a.spatialReference.isGeographic&&!a.spatialReference.isWGS84&&(i.getLogger("parquet:unsupported-projection").warn("Found a geographic projection that is not WGS84. Handling as WGS84.",{spatialReference:a.spatialReference}),a.spatialReference=l.WGS84),n={geometry:a.geometryEncoding?{geometryType:b(a.geometryType),spatialReference:a.spatialReference.toJSON(),encoding:a.geometryEncoding.toJSON()}:null,displayOptimization:a.displayOptimization}}this.setCustomParameters(e.customParameters),this._displayOptimization=a.displayOptimization,await this._provider.updateGeometryInfo(n),this._capabilities=ie(await this._getFileStatistics());const o=await this._provider.getFiles();if(!o.length)return{layerDefinition:{},capabilities:ie(null)};const u=await o[0].file;a.file=u;const{fields:p}=a;if(null==p)throw new s("parquet-layer:missing-metadata","Unable to create parquet source: cannot infer fields",p);p.push(new q({name:G,type:"oid",alias:G}));for(const s of p){const e=u.getColumnId(s.name);null!=e&&(this._indexMap[s.name]=e)}const c=new v(p.map(e=>e.toJSON()));this._fieldsIndex=c;const d=b(a.geometryType??"point");return this._metadata=N.createFeature({fieldsIndex:c.toJSON(),geometryType:d,hasZ:!1,hasM:!1,featureIdInfo:{type:"object-id",fieldName:"rowId"},subtypes:null,subtypeField:null,types:null,typeIdField:null,globalIdField:null,spatialReference:a.spatialReference,outSpatialReference:null,timeInfo:null,timeReferenceUnknownClient:null,dateFieldsTimeZone:null}),this._queryEngineParams={fieldsIndex:this._metadata.fieldsIndex,geometryType:d,featureIdInfo:{type:"object-id",fieldName:"rowId"},hasM:!1,hasZ:!1,spatialReference:a.spatialReference?.toJSON()??{wkid:4326},aggregateAdapter:null,timeInfo:null,definitionExpression:null},this._fullExtent=r?.extent?r.extent:await this._tryDeriveParquetFullExtent(a),{capabilities:this._capabilities,layerDefinition:{fields:a.fields?.map(e=>e.toJSON()),drawingInfo:F(d),extent:this._fullExtent??void 0,geometryType:d,geometryEncoding:a.geometryEncoding?.toJSON(),displayOptimization:a.displayOptimization}}}destroy(){this._provider.destroy(),this._queue.destroy();for(const{handle:e}of this._streams.values())e.remove();this._streams.clear()}setCustomParameters(e){this._customParameters=e}getIndexMap(){return this._indexMap}async updateFileProvider(e){this._provider=I(e,this._provider.getGeometryInfo(),()=>this._customParameters)}async queryFeatures(e,t){this._validateQuery(e),ae(e)||(e.resultRecordCount=e.resultRecordCount?Math.min(e.resultRecordCount,z):z,e.resultOffset=e.resultOffset??0),(e.outStatistics||e.returnDistinctValues)&&(e.returnGeometry=void 0);return(await this._enqueueQuery(e,t)).createQueryResponse()}async queryFeatureCount(e,t){const r=await x(e,null,this._queryEngineParams.spatialReference);if(this._validateQuery(r),!H(r))return this._getFeatureCount();r.outFields=void 0,r.returnGeometry=void 0;return(await this._enqueueQuery(r,t)).createQueryResponseForCount()}async queryObjectIds(e,t){const r=await x(e,null,this._queryEngineParams.spatialReference);if(this._validateQuery(r),!H(r))return Array.from({length:await this._getFeatureCount()},(e,t)=>t);r.resultRecordCount=r.resultRecordCount?Math.min(r.resultRecordCount,8e3):8e3,r.resultOffset=r.resultOffset??0,r.returnGeometry=void 0,r.outFields=void 0;return(await this._enqueueQuery(r,t)).items.map(e=>e.getObjectId())}async queryExtent(e,t){const s=await x(e,null,this._queryEngineParams.spatialReference);if(this._validateQuery(s),this._fullExtent&&!H(s))return{count:await this._getFeatureCount(),extent:this._fullExtent};const i=r(this._metadata.spatialReference);s.returnGeometry=!0,s.outFields=void 0;const a=p(c(),m),n=c(),o=await this._enqueueQuery(s,t);let u=0;for(const r of o.items)r.getBounds(n)&&(d(a,n),u+=1);return{count:u,extent:h(a,i,s.outSR?r(s.outSR):i.toJSON(),i,!1)}}async queryStream(e,t){if(!t.signal)throw new Error("InternalError: AbortSignal must be passed");const r=await this._getCandidateFiles(e),s=new U(r,async(t,r)=>{const s=await t.file,i=await this._createParquetQuery(s,e);return s.executeQuery(i,r)}),i=this._streamIdCounter++,n=a(t.signal,e=>{const t=this._streams.get(i);null!=t&&(t.handle.remove(),this._streams.delete(i))});return this._streams.set(i,{stream:s,handle:n}),i}async getStreamNext(e,t){if(!t.signal)throw new Error("InternalError: AbortSignal must be passed");const r=this._streams.get(e);if(!r)return{result:null};const s=await r.stream.next(t.signal);if(null==s)return r.handle.remove(),this._streams.delete(e),{result:null};const i=s.chunk.serialize().buffer,a={fileId:s.fileId,buffer:i};return i instanceof ArrayBuffer?{result:a,transferList:[i]}:{result:a}}async createPatch(e,t,r,s,i){if(!i.signal)throw new Error("InternalError: AbortSignal must be passed");const a=await this._getFileInfoById(e),n=await a.file;return(await n.createChunkPatch(t,r,s,i.signal)).serialize().buffer}async _getCandidateFiles(e){const t=await this._provider.getFiles(),r=await this._getSpatialFilePruning(e);if(null==r)return t;const s=t.filter(e=>this._mayIncludeFileForSpatialPruning(e,r));return"xz"===r.type?$(s,r):s}async _getSpatialFilePruning(e){if("tile"!==e.type)return null;const t=this._displayOptimization,r=t?.index;if(null==r)return null;const s=e.outSpatialReference.wkid;if(null==r.wkid||null==s)return null;const i=r.wkid,a=await P();switch(r.type){case"xz":return{type:"xz",fieldName:r.code,intersects:(t,n)=>a.queryIntersectsXZStatistics(r.fullExtent,e.extent,s,i,W,t,n)};case"z":return{type:"xy",xFieldName:r.xColumn,yFieldName:r.yColumn,intersects:(t,r,n,o)=>a.queryIntersectsXYStatistics(e.extent,s,i,t,r,n,o)}}}_mayIncludeFileForSpatialPruning(e,t){switch(t.type){case"xz":{const r=X(e,t);return null==r||te(r,t)}case"xy":{const{xStatistics:r,yStatistics:s}=ee(e,t);return null==r||null==s||re(r,s,t)}}}async _tryDeriveParquetFullExtent(r){if(!r.spatialReference)return null;if(null==this._fullExtent&&"location"===r.geometryEncoding?.type){const i=await this._provider.getFiles(),{xField:a,yField:n}=r.geometryEncoding,o=p(c(),m);for(const r of i){const i=await r.file;for(const r of i.rowGroups()){const i={stack:[],error:void 0,hasError:!1};try{const t=e(i,r.columnDescriptorForAttribute(a),!1),s=e(i,r.columnDescriptorForAttribute(n),!1),u=[t.minValue(),s.minValue(),t.maxValue(),s.maxValue()];f(o,u),r.free()}catch(s){i.error=s,i.hasError=!0}finally{t(i)}}}return{xmin:o[0],ymin:o[1],xmax:o[3],ymax:o[4],spatialReference:r.spatialReference?.toJSON()}}return null}async _getFileInfoById(e){const t=await this._provider.getFiles();for(const r of t)if(r.id===e)return r;throw new Error(`InternalError: File ${e} does not exist`)}async _getFileStatistics(){return{featureCount:await this._getFeatureCount(),byteLength:await this._getByteLength()}}async _getFile(e){return(await this._getFileInfoById(e)).file}async _createParquetQuery(e,t){const r=(await P()).Query.new();return"tile"===t.type&&(r.setExtent(t.extent),r.setQuantizationTransform(t.transform),r.setScale(t.scale)),r.setOutFields(t.outFields.filter(e=>null!=this._indexMap[e])),r.setOutSpatialReference(t.outSpatialReference.wkid),r.setReturnGeometry(t.returnGeometry),t.where&&await this._setWhereClause(r,e,t.where),r}async _getFeatureCount(){return(await this._provider.getFiles()).map(e=>e.statistics.rowCount).reduce((e,t)=>e+t,0)}async _getByteLength(){return(await this._provider.getFiles()).map(e=>e.statistics.byteSize).reduce((e,t)=>e+t,0)}_validateQuery(e){if(!this._capabilities.query.supportsStatistics&&e.outStatistics)throw new s("parquet:unsupported","Statistics queries are not supported",{query:e});if(!this._capabilities.query.supportsOrderBy&&e.orderByFields?.length)throw new s("parquet:unsupported","Queries using orderBy are not supported",{query:e});if(!this._capabilities.query.supportsDistinct&&e.returnDistinctValues)throw new s("parquet:unsupported","Queries using returnDistinctValues are not supported",{query:e})}async _setWhereClause(e,t,r){const i=this._indexMap,a=this._fieldsIndex,n={getAttribute(e,r){const s=t.readAttribute(e.rowGroup,e.row,i[r]);if(null==s)return null;const n=a.get(r);return"esriFieldTypeString"===n.type||"esriFieldTypeDateOnly"===n.type||"esriFieldTypeTimeOnly"===n.type||"esriFieldTypeTimestampOffset"===n.type?D.decode(s):s}},o=await u(r,this._fieldsIndex);if(!o.isStandardized)throw new s("sql-parse-error","expression is not standardized");const l=(e,t)=>o.testFeatureCompiled({rowGroup:e,row:t},n,null);e.setWhere(r),e.setWhereEvaluator(l),e.setWhereFields(o.fieldNames)}async*_fetchChunks(e,t){const r=await P(),s=await this._provider.getFiles();for(const i of s){const s=await i.file,a=r.Query.new();a.setOutFields(e.fields),a.setReturnGeometry(e.returnGeometry),e.where&&await this._setWhereClause(a,s,e.where);const o=await s.executeQuery(a),u=[],l=o.next(t);for(let e=0;e<B;e++)u.push(o.next(t));let p=await l;for(;null!=p;){n(t);const e=new A(this._metadata,this._indexMap,p,i.id),r=Y([new T(e,null,0,!1)],this._queryEngineParams),s=u.shift();u.push(o.next(t)),yield r,p=await s}}}_enqueueQuery(e,t){return this._queue.push(e,t)}async _executeQuery(e,t){const r=await this._getReadParams(e);if(e.where=void 0,e.objectIds?.length){const r=new Map;for(const t of e.objectIds){const e=S(t),s=R(t);let i=r.get(e);i||(i=[],r.set(e,i)),i.push(s)}const s=[];for(const[i,a]of r.entries()){const r=await this._executeFileIdQuery(e,i,a,t);for(const e of r)s.push(e)}return new w(s,e,{fieldsIndex:this._fieldsIndex,geometryType:this._metadata.geometryType,spatialReference:this._queryEngineParams.spatialReference,hasM:!1,hasZ:!1,featureAdapter:M,featureIdInfo:this._queryEngineParams.featureIdInfo})}let s=e.resultRecordCount??await this._getFeatureCount(),i=e.resultOffset??0;e.resultRecordCount=void 0,e.resultOffset=void 0;const a=[];for await(const n of this._fetchChunks(r,t)){const r=await n.executeQueryForOpaqueFeatures(e,t);if(r.length>i){const t=r.slice(i,Math.min(i+s,r.length));for(const e of t)a.push(e);if(i=0,s-=t.length,0===s)return new w(a,e,{fieldsIndex:this._fieldsIndex,geometryType:this._metadata.geometryType,spatialReference:this._queryEngineParams.spatialReference,hasM:!1,hasZ:!1,featureAdapter:M,featureIdInfo:this._queryEngineParams.featureIdInfo})}else i-=r.length}return new w(a,e,{fieldsIndex:this._fieldsIndex,geometryType:this._metadata.geometryType,spatialReference:this._queryEngineParams.spatialReference,hasM:!1,hasZ:!1,featureAdapter:M,featureIdInfo:this._queryEngineParams.featureIdInfo})}async _executeFileIdQuery(e,t,r,s){const i=await this._getReadParams(e),a=(await P()).Query.new();a.setOutFields(i.fields),a.setReturnGeometry(i.returnGeometry),a.setIds(new Uint32Array(r));const n=await this._getFile(t),o=await n.executeQuery(a,s);let u=await o.next(s),l=0;const p=[];for(;null!=u;){const e=new A(this._metadata,this._indexMap,u,t),r=new T(e,null,l++,!1);p.push(r),u=await o.next(s)}return Y(p,this._queryEngineParams).executeQueryForOpaqueFeatures(e,s)}async _getReadParams(e){const t=new Set;if(e.outStatistics)for(const r of e.outStatistics)null!=r.onStatisticField&&t.add(r.onStatisticField);if(e.outFields)for(const r of e.outFields)t.add(r);return{fields:(t.has("*")?this._fieldsIndex.fields.map(e=>e.name):Array.from(t)).filter(e=>null!=this._indexMap[e]),returnGeometry:!!e.returnGeometry||!!e.geometry,where:e.where}}}function H(e){for(const t in e){const r=t;switch(r){case"resultOffset":case"resultRecordCount":case"aggregateIds":case"distance":case"gdbVersion":case"geometry":case"having":case"timeExtent":case"objectIds":case"historicMoment":case"where":return null!=e[r]}}return!1}function Y(e,t){const r=new j;for(const s of e)r.insert(s);return new y({...t,featureStore:r})}function X(e,t){return e.statistics.statistics.get(t.fieldName)??null}function $(e,t){return e.slice().sort((e,r)=>{const s=K(e,t),i=K(r,t);return s===i?0:s<i?-1:1})}function K(e,t){const r=X(e,t);if(null==r)return Number.POSITIVE_INFINITY;const s=se(r.minValue),i=se(r.maxValue);return null==s||null==i||i<s?Number.POSITIVE_INFINITY:i-s}function ee(e,t){return{xStatistics:e.statistics.statistics.get(t.xFieldName)??null,yStatistics:e.statistics.statistics.get(t.yFieldName)??null}}function te(e,t){const r=se(e.minValue),s=se(e.maxValue);return null==r||null==s||t.intersects(r,s)}function re(e,t,r){const s=se(e.minValue),i=se(e.maxValue),a=se(t.minValue),n=se(t.maxValue);return null==s||null==i||null==a||null==n||r.intersects(s,i,a,n)}function se(e){return"number"==typeof e&&Number.isFinite(e)?e:null}function ie(e){const t=e?.featureCount;let r=!1;return null!=t&&t<has("parquetlayer-full-query-feature-count")&&(r=!0),{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,isBranchVersioned:!1,supportedCurveTypes:[],supportsAttachment:!1,supportsM:!1,supportsTrueCurve:!1,supportsZ:!1},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:!1,supportsDelete:!1,supportsEditing:!1,supportsChangeTracking:!1,supportsQuery:!0,supportsQueryBins:!1,supportsQueryPivot:!1,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:!1,supportsExceedsLimitStatistics:!1,supportsAsyncConvert3D:!1},query:{..._,maxRecordCount:z,supportsDistinct:r,supportsOrderBy:r,supportsStatistics:r,supportsSpatialAggregationStatistics:r,supportedSpatialAggregationStatistics:{envelope:r,centroid:r,convexHull:r}},queryAttributeBins:r?g:{supportsDate:!1,supportsFixedInterval:!1,supportsAutoInterval:!1,supportsFixedBoundaries:!1,supportsStackBy:!1,supportsSplitBy:!1,supportsSnapToData:!1,supportsReturnFullIntervalBin:!1,supportsFirstDayOfWeek:!1,supportsNormalization:!1},queryRelated:{supportsCount:!1,supportsOrderBy:!1,supportsPagination:!1,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},editing:{supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsGeometryUpdate:!1,supportsGlobalId:!1,supportsTrueCurveUpdate:!1,supportsTrueCurveUpdateByTrueCurveClientsOnly:!0,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsUploadWithItemId:!1,supportsUpdateWithoutM:!1,supportsAsyncApplyEdits:!1,zDefault:void 0}}}function ae(e){return!!(e.objectIds?.length||e.outStatistics||e.orderByFields?.length||e.returnDistinctValues)}export{L as default};
2
+ import{__addDisposableResource as e,__disposeResources as t}from"tslib";import{toConst as r}from"../../../../core/compilerUtils.js";import s from"../../../../core/Error.js";import has from"../../../../core/has.js";import i from"../../../../core/Logger.js";import{onAbortOrThrow as a,throwIfAborted as n}from"../../../../core/promiseUtils.js";import{QueueProcessor as o}from"../../../../core/QueueProcessor.js";import{parseWhereClause as u}from"../../../../core/sql.js";import l from"../../../../geometry/SpatialReference.js";import{set as p,create as c,expandWithAABB as d,expandWithRect as f,negativeInfinity as m}from"../../../../geometry/support/aaBoundingBox.js";import{convertToGeometry as h}from"../../featureConversionUtils.js";import{getQueryResultExtent as y,QueryEngine as g}from"../../data/QueryEngine.js";import{queryBinsCapabilities as _,queryCapabilities as w}from"../../data/QueryEngineCapabilities.js";import{QueryEngineResult as x}from"../../data/QueryEngineResult.js";import{normalizeQueryLike as I}from"../../data/queryUtils.js";import{createFileProvider as F}from"../parquet/createFileProvider.js";import{createDrawingInfo as S}from"./clientSideDefaults.js";import{getParquetFileId as q,getParquetRowId as R}from"./parquetIdUtils.js";import v from"../../../support/Field.js";import C from"../../../support/FieldsIndex.js";import{fromParquetGeometryEncodingJSON as E}from"../../../support/parquetEncodingUtils.js";import{completeParquetLayerInfo as b,fromParquetJSONGeometryType as O,toParquetJSONGeometryType as P}from"../../../support/parquetUtils.js";import{loadParquetModule as T}from"../../../../libs/parquet/loadParquetModule.js";import{FeatureStoreQueryAdapter as Q}from"../../../../views/2d/layers/features/FeatureStoreQueryAdapter.js";import{FeatureSnapshotSourceChunk as j}from"../../../../views/2d/layers/features/sources/strategies/chunks/FeatureSnapshotSourceChunk.js";import{FeatureSourceChunkStore as N}from"../../../../views/2d/layers/features/sources/strategies/chunks/SourceChunkStore.js";import{FeatureMetadata as A}from"../../../../views/2d/layers/features/support/FeatureMetadata.js";import{FeatureSetReaderParquet as M}from"../../../../views/2d/layers/features/support/FeatureSetReaderParquet.js";const G=new Q,B=4,z="__OBJECTID",D=new TextDecoder,k=8e3,V=8,W=2,U=20;class J{constructor(e,t){this._files=e,this._createFileStream=t,this._fileIndex=0,this._streamIndex=0,this._streams=[],this._pending=new Set,this._resolvedCount=0}async next(e){for(await this._fill(e);this._pending.size>0;){n(e),await this._fill(e);const t=await Z(this._pending);if(this._pending.delete(t.read),this._resolvedCount++,null!=t.chunk)return t.chunk}return null}async _fill(e){for(this._removeDone();this._pending.size<V;){const t=this._getOrCreateNextStream(e);if(null==t)return;this._pending.add(t.read(e))}}_getOrCreateNextStream(e){const t=this._resolvedCount>=V?V:W;if(this._fileIndex<this._files.length&&this._streams.length<t){const t=this._files[this._fileIndex++],r=new L(t.id,this._createFileStream(t,e));return this._streams.push(r),r}return this._getNextStream()}_getNextStream(){const e=this._streams.length;for(let t=0;t<e;t++){const r=(this._streamIndex+t)%e,s=this._streams[r];if(s.canRead)return this._streamIndex=(r+1)%e,s}return null}_removeDone(){let e=this._streamIndex;for(let t=this._streams.length-1;t>=0;t--)this._streams[t].done&&(this._streams.splice(t,1),t<e&&e--);this._streamIndex=this._streams.length>0?e%this._streams.length:0}}function Z(e){return Promise.race(Array.from(e,async e=>({read:e,chunk:await e})))}class L{constructor(e,t){this._fileId=e,this._stream=t,this._readCount=0,this._reachedEnd=!1}get canRead(){return!this._reachedEnd}get done(){return this._reachedEnd&&0===this._readCount}async read(e){this._readCount++;try{const t=await this._stream,r=await t.next(e);return null==r?(this._reachedEnd=!0,null):{fileId:this._fileId,chunk:r}}finally{this._readCount--}}}class H{constructor(){this._queue=new o({concurrency:B,process:(e,t)=>this._executeQuery(e,t)}),this._streams=new Map,this._streamIdCounter=0,this._indexMap={}}async load(e){const t=e.spatialReference?l.fromJSON(e.spatialReference):void 0;if(t&&!t.isWGS84&&!t.isWebMercator)throw new s("parquet:unsupported-projection","Only WGS84 and Web Mercator are supported");this._customParameters=e.customParameters,this._provider=F(e.provider,null,()=>this._customParameters);const r=await this._provider.getMetadata(),a=await b(r,{fields:e.fields?.map(e=>v.fromJSON(e)),geometryEncoding:e.geometryEncoding?E(e.geometryEncoding):null,geometryType:e.geometryType?O(e.geometryType):null,displayOptimization:e.displayOptimization,spatialReference:t});if(!a.fields)throw new s("parquet:unsupported","Fields must be defined");let n;if(a.spatialReference&&a.geometryType){if(!a.spatialReference)throw new s("parquet:unsupported","SpatialReference must be defined");if(!a.spatialReference.isGeographic&&!a.spatialReference.isWebMercator)throw new s("parquet:unsupported-projection","Only WGS84 and Web Mercator are supported");a.spatialReference.isGeographic&&!a.spatialReference.isWGS84&&(i.getLogger("parquet:unsupported-projection").warn("Found a geographic projection that is not WGS84. Handling as WGS84.",{spatialReference:a.spatialReference}),a.spatialReference=l.WGS84),n={geometry:a.geometryEncoding?{geometryType:P(a.geometryType),spatialReference:a.spatialReference.toJSON(),encoding:a.geometryEncoding.toJSON()}:null,displayOptimization:a.displayOptimization}}this.setCustomParameters(e.customParameters),this._displayOptimization=a.displayOptimization,await this._provider.updateGeometryInfo(n),this._capabilities=ae(await this._getFileStatistics());const o=await this._provider.getFiles();if(!o.length)return{layerDefinition:{},capabilities:ae(null)};const u=await o[0].file;a.file=u;const{fields:p}=a;if(null==p)throw new s("parquet-layer:missing-metadata","Unable to create parquet source: cannot infer fields",p);p.push(new v({name:z,type:"oid",alias:z}));for(const s of p){const e=u.getColumnId(s.name);null!=e&&(this._indexMap[s.name]=e)}const c=new C(p.map(e=>e.toJSON()));this._fieldsIndex=c;const d=P(a.geometryType??"point");return this._metadata=A.createFeature({fieldsIndex:c.toJSON(),geometryType:d,hasZ:!1,hasM:!1,featureIdInfo:{type:"object-id",fieldName:"rowId"},subtypes:null,subtypeField:null,types:null,typeIdField:null,globalIdField:null,spatialReference:a.spatialReference,outSpatialReference:null,timeInfo:null,timeReferenceUnknownClient:null,dateFieldsTimeZone:null}),this._queryEngineParams={fieldsIndex:this._metadata.fieldsIndex,geometryType:d,featureIdInfo:{type:"object-id",fieldName:"rowId"},hasM:!1,hasZ:!1,spatialReference:a.spatialReference?.toJSON()??{wkid:4326},aggregateAdapter:null,timeInfo:null,definitionExpression:null},this._fullExtent=r?.extent?r.extent:await this._tryDeriveParquetFullExtent(a),{capabilities:this._capabilities,layerDefinition:{fields:a.fields?.map(e=>e.toJSON()),drawingInfo:S(d),extent:this._fullExtent??void 0,geometryType:d,geometryEncoding:a.geometryEncoding?.toJSON(),displayOptimization:a.displayOptimization}}}destroy(){this._provider.destroy(),this._queue.destroy();for(const{handle:e}of this._streams.values())e.remove();this._streams.clear()}setCustomParameters(e){this._customParameters=e}getIndexMap(){return this._indexMap}async updateFileProvider(e){this._provider=F(e,this._provider.getGeometryInfo(),()=>this._customParameters)}async queryFeatures(e,t){this._validateQuery(e),ne(e)||(e.resultRecordCount=e.resultRecordCount?Math.min(e.resultRecordCount,k):k,e.resultOffset=e.resultOffset??0),(e.outStatistics||e.returnDistinctValues)&&(e.returnGeometry=void 0);return(await this._enqueueQuery(e,t)).createQueryResponse()}async queryFeatureCount(e,t){const r=await I(e,null,this._queryEngineParams.spatialReference);if(this._validateQuery(r),!Y(r))return this._getFeatureCount();r.outFields=void 0,r.returnGeometry=void 0;return(await this._enqueueQuery(r,t)).createQueryResponseForCount()}async queryObjectIds(e,t){const r=await I(e,null,this._queryEngineParams.spatialReference);if(this._validateQuery(r),!Y(r))return Array.from({length:await this._getFeatureCount()},(e,t)=>t);r.resultRecordCount=r.resultRecordCount?Math.min(r.resultRecordCount,8e3):8e3,r.resultOffset=r.resultOffset??0,r.returnGeometry=void 0,r.outFields=void 0;return(await this._enqueueQuery(r,t)).items.map(e=>e.getObjectId())}async queryExtent(e,t){const s=await I(e,null,this._queryEngineParams.spatialReference);if(this._validateQuery(s),this._fullExtent&&!Y(s))return{count:await this._getFeatureCount(),extent:this._fullExtent};const i=r(this._metadata.spatialReference);s.returnGeometry=!0,s.outFields=void 0;const a=p(c(),m),n=c(),o=await this._enqueueQuery(s,t);let u=0;for(const r of o.items)r.getBounds(n)&&(d(a,n),u+=1);return{count:u,extent:y(a,i,s.outSR?r(s.outSR):i.toJSON(),i,!1)}}async queryStream(e,t){if(!t.signal)throw new Error("InternalError: AbortSignal must be passed");const r=await this._getCandidateFiles(e),s=new J(r,async(t,r)=>{const s=await t.file,i=await this._createParquetQuery(s,e);return s.executeQuery(i,r)}),i=this._streamIdCounter++,n=a(t.signal,e=>{const t=this._streams.get(i);null!=t&&(t.handle.remove(),this._streams.delete(i))});return this._streams.set(i,{stream:s,handle:n}),i}async getStreamNext(e,t){if(!t.signal)throw new Error("InternalError: AbortSignal must be passed");const r=this._streams.get(e);if(!r)return{result:null};const s=await r.stream.next(t.signal);if(null==s)return r.handle.remove(),this._streams.delete(e),{result:null};const i=s.chunk.serialize().buffer,a={fileId:s.fileId,buffer:i};return i instanceof ArrayBuffer?{result:a,transferList:[i]}:{result:a}}async getStreamNextFeatures(e,t){const{result:r}=await this.getStreamNext(e,t);if(null==r)return null;const s=(await T()).ParquetChunk.deserialize(new Uint8Array(r.buffer)),i=new M(this._metadata,this._indexMap,s,r.fileId),a=[];for(;i.next();){const e=h(i.readGeometryWorldSpace(),i.geometryType,i.hasZ,i.hasM),t=i.readAttributes();a.push({attributes:t,geometry:e})}return{features:a}}async createPatch(e,t,r,s,i){if(!i.signal)throw new Error("InternalError: AbortSignal must be passed");const a=await this._getFileInfoById(e),n=await a.file;return(await n.createChunkPatch(t,r,s,i.signal)).serialize().buffer}async _getCandidateFiles(e){const t=await this._provider.getFiles(),r=await this._getSpatialFilePruning(e);if(null==r)return t;const s=t.filter(e=>this._mayIncludeFileForSpatialPruning(e,r));return"xz"===r.type?K(s,r):s}async _getSpatialFilePruning(e){if("tile"!==e.type&&("arcade"!==e.type||null==e.extent))return null;const t=this._displayOptimization,r=t?.index;if(null==r)return null;const s=e.outSpatialReference.wkid;if(null==r.wkid||null==s)return null;const i=r.wkid,a=await T();switch(r.type){case"xz":return{type:"xz",fieldName:r.code,intersects:(t,n)=>a.queryIntersectsXZStatistics(r.fullExtent,e.extent,s,i,U,t,n)};case"z":return{type:"xy",xFieldName:r.xColumn,yFieldName:r.yColumn,intersects:(t,r,n,o)=>a.queryIntersectsXYStatistics(e.extent,s,i,t,r,n,o)}}}_mayIncludeFileForSpatialPruning(e,t){switch(t.type){case"xz":{const r=$(e,t);return null==r||re(r,t)}case"xy":{const{xStatistics:r,yStatistics:s}=te(e,t);return null==r||null==s||se(r,s,t)}}}async _tryDeriveParquetFullExtent(r){if(!r.spatialReference)return null;if(null==this._fullExtent&&"location"===r.geometryEncoding?.type){const i=await this._provider.getFiles(),{xField:a,yField:n}=r.geometryEncoding,o=p(c(),m);for(const r of i){const i=await r.file;for(const r of i.rowGroups()){const i={stack:[],error:void 0,hasError:!1};try{const t=e(i,r.columnDescriptorForAttribute(a),!1),s=e(i,r.columnDescriptorForAttribute(n),!1),u=[t.minValue(),s.minValue(),t.maxValue(),s.maxValue()];f(o,u),r.free()}catch(s){i.error=s,i.hasError=!0}finally{t(i)}}}return{xmin:o[0],ymin:o[1],xmax:o[3],ymax:o[4],spatialReference:r.spatialReference?.toJSON()}}return null}async _getFileInfoById(e){const t=await this._provider.getFiles();for(const r of t)if(r.id===e)return r;throw new Error(`InternalError: File ${e} does not exist`)}async _getFileStatistics(){return{featureCount:await this._getFeatureCount(),byteLength:await this._getByteLength()}}async _getFile(e){return(await this._getFileInfoById(e)).file}async _createParquetQuery(e,t){const r=(await T()).Query.new();return"tile"===t.type?(r.setExtent(t.extent),r.setQuantizationTransform(t.transform),r.setScale(t.scale)):"arcade"===t.type&&null!=t.extent&&r.setExtent(t.extent),r.setOutFields(t.outFields.filter(e=>null!=this._indexMap[e])),r.setOutSpatialReference(t.outSpatialReference.wkid),r.setReturnGeometry(t.returnGeometry),t.where&&await this._setWhereClause(r,e,t.where),r}async _getFeatureCount(){return(await this._provider.getFiles()).map(e=>e.statistics.rowCount).reduce((e,t)=>e+t,0)}async _getByteLength(){return(await this._provider.getFiles()).map(e=>e.statistics.byteSize).reduce((e,t)=>e+t,0)}_validateQuery(e){if(!this._capabilities.query.supportsStatistics&&e.outStatistics)throw new s("parquet:unsupported","Statistics queries are not supported",{query:e});if(!this._capabilities.query.supportsOrderBy&&e.orderByFields?.length)throw new s("parquet:unsupported","Queries using orderBy are not supported",{query:e});if(!this._capabilities.query.supportsDistinct&&e.returnDistinctValues)throw new s("parquet:unsupported","Queries using returnDistinctValues are not supported",{query:e})}async _setWhereClause(e,t,r){const i=this._indexMap,a=this._fieldsIndex,n={getAttribute(e,r){const s=t.readAttribute(e.rowGroup,e.row,i[r]);if(null==s)return null;const n=a.get(r);return"esriFieldTypeString"===n.type||"esriFieldTypeDateOnly"===n.type||"esriFieldTypeTimeOnly"===n.type||"esriFieldTypeTimestampOffset"===n.type?D.decode(s):s}},o=await u(r,this._fieldsIndex);if(!o.isStandardized)throw new s("sql-parse-error","expression is not standardized");const l=(e,t)=>o.testFeatureCompiled({rowGroup:e,row:t},n,null);e.setWhere(r),e.setWhereEvaluator(l),e.setWhereFields(o.fieldNames)}async*_fetchChunks(e,t){const r=await T(),s=await this._provider.getFiles();for(const i of s){const s=await i.file,a=r.Query.new();a.setOutFields(e.fields),a.setReturnGeometry(e.returnGeometry),e.where&&await this._setWhereClause(a,s,e.where);const o=await s.executeQuery(a),u=[],l=o.next(t);for(let e=0;e<B;e++)u.push(o.next(t));let p=await l;for(;null!=p;){n(t);const e=new M(this._metadata,this._indexMap,p,i.id),r=X([new j(e,null,0,!1)],this._queryEngineParams),s=u.shift();u.push(o.next(t)),yield r,p=await s}}}_enqueueQuery(e,t){return this._queue.push(e,t)}async _executeQuery(e,t){const r=await this._getReadParams(e);if(e.where=void 0,e.objectIds?.length){const r=new Map;for(const t of e.objectIds){const e=q(t),s=R(t);let i=r.get(e);i||(i=[],r.set(e,i)),i.push(s)}const s=[];for(const[i,a]of r.entries()){const r=await this._executeFileIdQuery(e,i,a,t);for(const e of r)s.push(e)}return new x(s,e,{fieldsIndex:this._fieldsIndex,geometryType:this._metadata.geometryType,spatialReference:this._queryEngineParams.spatialReference,hasM:!1,hasZ:!1,featureAdapter:G,featureIdInfo:this._queryEngineParams.featureIdInfo})}let s=e.resultRecordCount??await this._getFeatureCount(),i=e.resultOffset??0;e.resultRecordCount=void 0,e.resultOffset=void 0;const a=[];for await(const n of this._fetchChunks(r,t)){const r=await n.executeQueryForOpaqueFeatures(e,t);if(r.length>i){const t=r.slice(i,Math.min(i+s,r.length));for(const e of t)a.push(e);if(i=0,s-=t.length,0===s)return new x(a,e,{fieldsIndex:this._fieldsIndex,geometryType:this._metadata.geometryType,spatialReference:this._queryEngineParams.spatialReference,hasM:!1,hasZ:!1,featureAdapter:G,featureIdInfo:this._queryEngineParams.featureIdInfo})}else i-=r.length}return new x(a,e,{fieldsIndex:this._fieldsIndex,geometryType:this._metadata.geometryType,spatialReference:this._queryEngineParams.spatialReference,hasM:!1,hasZ:!1,featureAdapter:G,featureIdInfo:this._queryEngineParams.featureIdInfo})}async _executeFileIdQuery(e,t,r,s){const i=await this._getReadParams(e),a=(await T()).Query.new();a.setOutFields(i.fields),a.setReturnGeometry(i.returnGeometry),a.setIds(new Uint32Array(r));const n=await this._getFile(t),o=await n.executeQuery(a,s);let u=await o.next(s),l=0;const p=[];for(;null!=u;){const e=new M(this._metadata,this._indexMap,u,t),r=new j(e,null,l++,!1);p.push(r),u=await o.next(s)}return X(p,this._queryEngineParams).executeQueryForOpaqueFeatures(e,s)}async _getReadParams(e){const t=new Set;if(e.outStatistics)for(const r of e.outStatistics)null!=r.onStatisticField&&t.add(r.onStatisticField);if(e.outFields)for(const r of e.outFields)t.add(r);return{fields:(t.has("*")?this._fieldsIndex.fields.map(e=>e.name):Array.from(t)).filter(e=>null!=this._indexMap[e]),returnGeometry:!!e.returnGeometry||!!e.geometry,where:e.where}}}function Y(e){for(const t in e){const r=t;switch(r){case"resultOffset":case"resultRecordCount":case"aggregateIds":case"distance":case"gdbVersion":case"geometry":case"having":case"timeExtent":case"objectIds":case"historicMoment":case"where":return null!=e[r]}}return!1}function X(e,t){const r=new N;for(const s of e)r.insert(s);return new g({...t,featureStore:r})}function $(e,t){return e.statistics.statistics.get(t.fieldName)??null}function K(e,t){return e.slice().sort((e,r)=>{const s=ee(e,t),i=ee(r,t);return s===i?0:s<i?-1:1})}function ee(e,t){const r=$(e,t);if(null==r)return Number.POSITIVE_INFINITY;const s=ie(r.minValue),i=ie(r.maxValue);return null==s||null==i||i<s?Number.POSITIVE_INFINITY:i-s}function te(e,t){return{xStatistics:e.statistics.statistics.get(t.xFieldName)??null,yStatistics:e.statistics.statistics.get(t.yFieldName)??null}}function re(e,t){const r=ie(e.minValue),s=ie(e.maxValue);return null==r||null==s||t.intersects(r,s)}function se(e,t,r){const s=ie(e.minValue),i=ie(e.maxValue),a=ie(t.minValue),n=ie(t.maxValue);return null==s||null==i||null==a||null==n||r.intersects(s,i,a,n)}function ie(e){return"number"==typeof e&&Number.isFinite(e)?e:null}function ae(e){const t=e?.featureCount;let r=!1;return null!=t&&t<has("parquetlayer-full-query-feature-count")&&(r=!0),{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,isBranchVersioned:!1,supportedCurveTypes:[],supportsAttachment:!1,supportsM:!1,supportsTrueCurve:!1,supportsZ:!1},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:!1,supportsDelete:!1,supportsEditing:!1,supportsChangeTracking:!1,supportsQuery:!0,supportsQueryBins:!1,supportsQueryPivot:!1,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:!1,supportsExceedsLimitStatistics:!1,supportsAsyncConvert3D:!1},query:{...w,maxRecordCount:k,supportsDistinct:r,supportsOrderBy:r,supportsStatistics:r,supportsSpatialAggregationStatistics:r,supportedSpatialAggregationStatistics:{envelope:r,centroid:r,convexHull:r}},queryAttributeBins:r?_:{supportsDate:!1,supportsFixedInterval:!1,supportsAutoInterval:!1,supportsFixedBoundaries:!1,supportsStackBy:!1,supportsSplitBy:!1,supportsSnapToData:!1,supportsReturnFullIntervalBin:!1,supportsFirstDayOfWeek:!1,supportsNormalization:!1},queryRelated:{supportsCount:!1,supportsOrderBy:!1,supportsPagination:!1,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},editing:{supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsGeometryUpdate:!1,supportsGlobalId:!1,supportsTrueCurveUpdate:!1,supportsTrueCurveUpdateByTrueCurveClientsOnly:!0,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsUploadWithItemId:!1,supportsUpdateWithoutM:!1,supportsAsyncApplyEdits:!1,zDefault:void 0}}}function ne(e){return!!(e.objectIds?.length||e.outStatistics||e.orderByFields?.length||e.returnDistinctValues)}export{H as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import r from"../../core/Error.js";import{isBlobProtocol as t}from"../../core/urlUtils.js";import{property as i,subclass as o}from"../../core/accessorSupport/decorators.js";import{Integer as s,Null as n}from"../../core/accessorSupport/ensureType.js";import{excludeTables as p}from"../../core/accessorSupport/layerContainerType.js";import{readLoadable as a}from"../../core/accessorSupport/read.js";import{willPropertyWrite as l}from"../../core/accessorSupport/write.js";import{listMode as y,opacity as m}from"../support/commonProperties.js";import{isLayerSupportedForWriteContext as u}from"../support/layersMapping.js";import d from"../../time/TimeExtent.js";import{addLayerUnsupportedError as c}from"../../webdoc/support/unsupportedErrors.js";import{reader as w}from"../../core/accessorSupport/decorators/reader.js";import{writer as b}from"../../core/accessorSupport/decorators/writer.js";const g=g=>{const T=g;let f=class extends T{constructor(){super(...arguments),this.persistenceEnabled=!0,this.title=null}readId(e,r,t){return"Group Layer"===t?.portalItem?.type?void 0:e}writeListMode(e,r,t,i){(i&&"ground"===i.layerContainerType||e&&l(this,t,{},i))&&(r[t]=e)}writeOperationalLayerType(e,r,t){e&&(r[t]=e)}writeTitle(e,r){r.title=e??"Layer"}readVisibilityTimeExtent(e){return e?d.fromArray(e):null}writeVisibilityTimeExtent(e,t,i,o){e&&"tables"!==o.layerContainerType&&(e.isEmpty?o?.messages&&o.messages.push(new r("layer:invalid-visibilityTimeExtent","visibilityTimeExtent cannot be empty")):t[i]=e.toArray())}read(e,r){r&&(r.layer=this),a(this,e,r=>super.read(e,r),r)}write(e,i){if(!this.persistenceEnabled&&!i?.ignorePersistenceEnabled)return null;if(i?.origin){if(!u(i,this.operationalLayerType))return c(i,this),null}const o=super.write(e,{...i,layer:this}),s=!!i&&!!i.messages&&!!i.messages.filter(e=>e instanceof r&&"web-document-write:property-required"===e.name).length;return t(o?.url)?(i?.messages?.push(new r("layer:invalid-url",`Layer (${this.title}, ${this.id}) of type '${this.declaredClass}' using a Blob URL cannot be written to web scenes and web maps`,{layer:this})),null):!this.url&&s?null:o}beforeSave(){}};return e([i({type:String,json:{write:{ignoreOrigin:!0},origins:{"web-scene":{write:{isRequired:!0,ignoreOrigin:!0}},"portal-item":{write:!1}}}})],f.prototype,"id",void 0),e([w("id",["id"])],f.prototype,"readId",null),e([i(y)],f.prototype,"listMode",void 0),e([b("listMode")],f.prototype,"writeListMode",null),e([i({type:String,readOnly:!0,json:{read:!1,write:{target:"layerType",ignoreOrigin:!0},origins:{"portal-item":{write:!1},"web-scene":{name:"layerType",read:!1,write:{enabled:!0,ignoreOrigin:!0,layerContainerTypes:p,isRequired:!0}}}}})],f.prototype,"operationalLayerType",void 0),e([b("operationalLayerType")],f.prototype,"writeOperationalLayerType",null),e([i(m)],f.prototype,"opacity",void 0),e([i({type:Boolean,readOnly:!1})],f.prototype,"persistenceEnabled",void 0),e([i({type:String,json:{write:{ignoreOrigin:!0,writerEnsuresNonNull:!0},origins:{"web-scene":{write:{isRequired:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}},"portal-item":{write:!1}}},value:"Layer"})],f.prototype,"title",void 0),e([b("title"),b(["web-scene"],"title")],f.prototype,"writeTitle",null),e([i({type:d,json:{origins:{"web-scene":{write:{layerContainerTypes:p}}}}})],f.prototype,"visibilityTimeExtent",void 0),e([w("visibilityTimeExtent")],f.prototype,"readVisibilityTimeExtent",null),e([b(["portal-item","web-map","web-scene"],"visibilityTimeExtent",{visibilityTimeExtent:{type:[[s,n]]}})],f.prototype,"writeVisibilityTimeExtent",null),e([i({type:Boolean,json:{name:"visibility",write:{layerContainerTypes:p}}})],f.prototype,"visible",void 0),f=e([o("esri.layers.mixins.OperationalLayer")],f),f};export{g as OperationalLayer};
2
+ import{__decorate as e}from"tslib";import r from"../../core/Error.js";import{isBlobProtocol as t}from"../../core/urlUtils.js";import{property as i,subclass as o}from"../../core/accessorSupport/decorators.js";import{Integer as s,Null as n}from"../../core/accessorSupport/ensureType.js";import{excludeTables as p}from"../../core/accessorSupport/layerContainerType.js";import{readLoadable as a}from"../../core/accessorSupport/read.js";import{willPropertyWrite as l}from"../../core/accessorSupport/write.js";import{listMode as y,opacity as m}from"../support/commonProperties.js";import{isLayerSupportedForWriteContext as u}from"../support/layersMapping.js";import d from"../../time/TimeExtent.js";import{addLayerUnsupportedError as c}from"../../webdoc/support/unsupportedErrors.js";import{reader as w}from"../../core/accessorSupport/decorators/reader.js";import{writer as b}from"../../core/accessorSupport/decorators/writer.js";const g=g=>{const T=g;let f=class extends T{constructor(){super(...arguments),this.persistenceEnabled=!0,this.title=null}readId(e,r,t){return"Group Layer"===t?.portalItem?.type?void 0:e}writeListMode(e,r,t,i){(i&&"ground"===i.layerContainerType||e&&l(this,t,{},i))&&(r[t]=e)}writeOperationalLayerType(e,r,t){e&&(r[t]=e)}writeTitle(e,r){r.title=e??"Layer"}readVisibilityTimeExtent(e){return e?d.fromArray(e):null}writeVisibilityTimeExtent(e,t,i,o){e&&"tables"!==o.layerContainerType&&(e.isEmpty?o?.messages&&o.messages.push(new r("layer:invalid-visibilityTimeExtent","visibilityTimeExtent cannot be empty")):t[i]=e.toArray())}read(e,r){r&&(r.layer=this),a(this,e,r=>super.read(e,r),r)}write(e,i){if(!this.persistenceEnabled&&!i?.ignorePersistenceEnabled)return null;if(i?.origin){if(!u(i,this.operationalLayerType,this.type))return c(i,this),null}const o=super.write(e,{...i,layer:this}),s=!!i&&!!i.messages&&!!i.messages.filter(e=>e instanceof r&&"web-document-write:property-required"===e.name).length;return t(o?.url)?(i?.messages?.push(new r("layer:invalid-url",`Layer (${this.title}, ${this.id}) of type '${this.declaredClass}' using a Blob URL cannot be written to web scenes and web maps`,{layer:this})),null):!this.url&&s?null:o}beforeSave(){}};return e([i({type:String,json:{write:{ignoreOrigin:!0},origins:{"web-scene":{write:{isRequired:!0,ignoreOrigin:!0}},"portal-item":{write:!1}}}})],f.prototype,"id",void 0),e([w("id",["id"])],f.prototype,"readId",null),e([i(y)],f.prototype,"listMode",void 0),e([b("listMode")],f.prototype,"writeListMode",null),e([i({type:String,readOnly:!0,json:{read:!1,write:{target:"layerType",ignoreOrigin:!0},origins:{"portal-item":{write:!1},"web-scene":{name:"layerType",read:!1,write:{enabled:!0,ignoreOrigin:!0,layerContainerTypes:p,isRequired:!0}}}}})],f.prototype,"operationalLayerType",void 0),e([b("operationalLayerType")],f.prototype,"writeOperationalLayerType",null),e([i(m)],f.prototype,"opacity",void 0),e([i({type:Boolean,readOnly:!1})],f.prototype,"persistenceEnabled",void 0),e([i({type:String,json:{write:{ignoreOrigin:!0,writerEnsuresNonNull:!0},origins:{"web-scene":{write:{isRequired:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}},"portal-item":{write:!1}}},value:"Layer"})],f.prototype,"title",void 0),e([b("title"),b(["web-scene"],"title")],f.prototype,"writeTitle",null),e([i({type:d,json:{origins:{"web-scene":{write:{layerContainerTypes:p}}}}})],f.prototype,"visibilityTimeExtent",void 0),e([w("visibilityTimeExtent")],f.prototype,"readVisibilityTimeExtent",null),e([b(["portal-item","web-map","web-scene"],"visibilityTimeExtent",{visibilityTimeExtent:{type:[[s,n]]}})],f.prototype,"writeVisibilityTimeExtent",null),e([i({type:Boolean,json:{name:"visibility",write:{layerContainerTypes:p}}})],f.prototype,"visible",void 0),f=e([o("esri.layers.mixins.OperationalLayer")],f),f};export{g as OperationalLayer};