@arcgis/core 5.2.0-next.27 → 5.2.0-next.29

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 (418) hide show
  1. package/WebLinkChart.js +1 -1
  2. package/WebMap.js +1 -1
  3. package/applications/KnowledgeStudio/generalSharedKgUtils.d.ts +40 -2
  4. package/applications/KnowledgeStudio/generalSharedKgUtils.js +1 -1
  5. package/arcade/Dictionary.js +1 -1
  6. package/arcade/Feature.js +1 -1
  7. package/arcade/Pixel.js +1 -1
  8. package/arcade/deepClone.js +1 -1
  9. package/arcade/featureset/support/FeatureSet.js +1 -1
  10. package/arcade/functions/geometry.js +1 -1
  11. package/arcade/languageUtils.js +1 -1
  12. package/assets/esri/core/libs/libtess/libtess-f32.wasm +0 -0
  13. package/assets/esri/core/libs/libtess/libtess-f64.wasm +0 -0
  14. package/assets/esri/core/workers/RemoteClient.js +1 -1
  15. package/assets/esri/core/workers/chunks/0197e459fdb04dfb28ef.js +1 -0
  16. package/assets/esri/core/workers/chunks/{f7344d855f1092383abe.js → 15aa9b85976069acf4f3.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{5ee887fc6e1e0e70e02f.js → 1664434dc7a67c8ce453.js} +1 -1
  18. package/assets/esri/core/workers/chunks/17b98787a0698f584882.js +1 -0
  19. package/assets/esri/core/workers/chunks/1837f97f720d255a1694.js +1 -0
  20. package/assets/esri/core/workers/chunks/1b9c68e8431bb4608209.js +1 -0
  21. package/assets/esri/core/workers/chunks/1bbf5f5da5842b93f638.js +1 -0
  22. package/assets/esri/core/workers/chunks/1bd7b7f4ee7ea6cb7ef9.js +1 -0
  23. package/assets/esri/core/workers/chunks/1e386475937e02b3f523.js +1 -0
  24. package/assets/esri/core/workers/chunks/209460f8aae3f9f8c9b8.js +1 -0
  25. package/assets/esri/core/workers/chunks/{316a3d5c7842b445e29e.js → 20ffeb09bb30400de110.js} +1 -1
  26. package/assets/esri/core/workers/chunks/21122f3f3e19a7fd7d33.js +1 -0
  27. package/assets/esri/core/workers/chunks/{25fd4d5d3af887536b3b.js → 2628136bf9f47d238a24.js} +1 -1
  28. package/assets/esri/core/workers/chunks/{bf9eca7dd107bdb06614.js → 2665337e1b665e7e2b70.js} +1 -1
  29. package/assets/esri/core/workers/chunks/2b044c8fab2055a8818d.js +1 -0
  30. package/assets/esri/core/workers/chunks/2b2b042a6d6949b06127.js +1 -0
  31. package/assets/esri/core/workers/chunks/2c15c227d057292d4fa8.js +1 -0
  32. package/assets/esri/core/workers/chunks/2f02880a7f081eb210cd.js +1 -0
  33. package/assets/esri/core/workers/chunks/2fc3e43b64300014dddc.js +1 -0
  34. package/assets/esri/core/workers/chunks/{31c4128b23968575feca.js → 31d92ba9089617aa59ab.js} +1 -1
  35. package/assets/esri/core/workers/chunks/32740b075d7a890d7888.js +1 -0
  36. package/assets/esri/core/workers/chunks/38b69fba9ae4ccbae6b7.js +1 -0
  37. package/assets/esri/core/workers/chunks/390f2beee8e3f2a302e4.js +1 -0
  38. package/assets/esri/core/workers/chunks/3c342e662c13a05f4caf.js +1 -0
  39. package/assets/esri/core/workers/chunks/{d670e134348954ce465d.js → 3d1e5bfd88771d4a0bf6.js} +1 -1
  40. package/assets/esri/core/workers/chunks/3eee32db0e9a5086b9a8.js +1 -0
  41. package/assets/esri/core/workers/chunks/43847d66726fd0bcbbb7.js +1 -0
  42. package/assets/esri/core/workers/chunks/4545cf12ad0824ce6b41.js +1 -0
  43. package/assets/esri/core/workers/chunks/45e4b9069263adeae394.js +1 -0
  44. package/assets/esri/core/workers/chunks/47290f27375c76bcc9c7.js +1 -0
  45. package/assets/esri/core/workers/chunks/{4e16d7fa2e6f11d082b5.js → 4ba4fd8fa31169760fee.js} +1 -1
  46. package/assets/esri/core/workers/chunks/{268ee59800e64baa9682.js → 4be0c64bbf2449d57ea5.js} +1 -1
  47. package/assets/esri/core/workers/chunks/5115059b012ef84407cf.js +1 -0
  48. package/assets/esri/core/workers/chunks/{e8e7cd26c43f231cdea2.js → 5189413a83faf3480e29.js} +1 -1
  49. package/assets/esri/core/workers/chunks/5c63b38160c7d063b8af.js +1 -0
  50. package/assets/esri/core/workers/chunks/5cccb8b06014ccef30f8.js +1 -0
  51. package/assets/esri/core/workers/chunks/{0098544169e429dd98d2.js → 689673173ca1c0e098fe.js} +1 -1
  52. package/assets/esri/core/workers/chunks/697e0ce10d77b90d4fee.js +1 -0
  53. package/assets/esri/core/workers/chunks/6991ba1b204668e7d4da.js +1 -0
  54. package/assets/esri/core/workers/chunks/{ccffaba50674adba7a0f.js → 6b56971783bf4c31a563.js} +1 -1
  55. package/assets/esri/core/workers/chunks/70c94bcfa20453134037.js +1 -0
  56. package/assets/esri/core/workers/chunks/{8f93e6fc11a158d4f1ee.js → 7335a762412bc8c15a2f.js} +1 -1
  57. package/assets/esri/core/workers/chunks/759686b896f51f0fe6a9.js +1 -0
  58. package/assets/esri/core/workers/chunks/7656900713e55036c3c1.js +1 -0
  59. package/assets/esri/core/workers/chunks/{b2b342b06d502fc61ea5.js → 76789f46b2c65d219cf9.js} +1 -1
  60. package/assets/esri/core/workers/chunks/774615303c1cc9a77e20.js +1 -0
  61. package/assets/esri/core/workers/chunks/7b290ac2e8a567ecae4a.js +1 -0
  62. package/assets/esri/core/workers/chunks/7ff37a4f315f7621462b.js +1 -0
  63. package/assets/esri/core/workers/chunks/8ad5e80e911419c1685a.js +1 -0
  64. package/assets/esri/core/workers/chunks/{a3ecde3794a7db3cf283.js → 8d90bef1091204fba0f1.js} +1 -1
  65. package/assets/esri/core/workers/chunks/8f16a358ed83d2264415.js +1 -0
  66. package/assets/esri/core/workers/chunks/{a454df829a72ab02c860.js → 8fd63cb38036f331a803.js} +1 -1
  67. package/assets/esri/core/workers/chunks/{bbcad2fde838819ffc7b.js → 906f4c0fa8135e6c2f03.js} +1 -1
  68. package/assets/esri/core/workers/chunks/989937c120bdd676ec1e.js +1 -0
  69. package/assets/esri/core/workers/chunks/9ba705a6ddabca0f77b1.js +1 -0
  70. package/assets/esri/core/workers/chunks/{87011d2fe14c54e296af.js → 9fe71d49c888fd871312.js} +1 -1
  71. package/assets/esri/core/workers/chunks/a14e5607c5c091c77e3d.js +1 -0
  72. package/assets/esri/core/workers/chunks/a2be8784f2cfdbb42681.js +1 -0
  73. package/assets/esri/core/workers/chunks/a6379a8df8c08b729b9c.js +1 -0
  74. package/assets/esri/core/workers/chunks/a988fd54912969b812ce.js +1 -0
  75. package/assets/esri/core/workers/chunks/a9db775210ebeee41738.js +1 -0
  76. package/assets/esri/core/workers/chunks/acbc14395c31f6da509e.js +1 -0
  77. package/assets/esri/core/workers/chunks/{11d1af758e2140095b10.js → aec82b94787821153d2b.js} +1 -1
  78. package/assets/esri/core/workers/chunks/b18b6bb85e52b03b85e3.js +680 -0
  79. package/assets/esri/core/workers/chunks/b624796ff4a9d4c406bf.js +1 -0
  80. package/assets/esri/core/workers/chunks/b7458bd3a2f590f32111.js +1 -0
  81. package/assets/esri/core/workers/chunks/bb1fad01d9f070e7d795.js +1 -0
  82. package/assets/esri/core/workers/chunks/{a9d477f90e5046400dd5.js → bcb2092c87d8d21c6458.js} +1 -1
  83. package/assets/esri/core/workers/chunks/{3e94ed4d57ee7d870cba.js → c6f5688074ae89c37add.js} +1 -1
  84. package/assets/esri/core/workers/chunks/caf150028aeac91b8d80.js +1 -0
  85. package/assets/esri/core/workers/chunks/cb30e8a66d6dcfebd439.js +1 -0
  86. package/assets/esri/core/workers/chunks/d7c0ab622caf495dbcef.js +1 -0
  87. package/assets/esri/core/workers/chunks/e181d0f5562878b3dc01.js +1 -0
  88. package/assets/esri/core/workers/chunks/{fd629872b5c07853f695.js → e4015870412edd69453c.js} +1 -1
  89. package/assets/esri/core/workers/chunks/{d07068c44d560e4ce02e.js → e5d2fab228d54b18a8a8.js} +1 -1
  90. package/assets/esri/core/workers/chunks/e774303efefee31952d0.js +1 -0
  91. package/assets/esri/core/workers/chunks/e98a8f80023c6023e72c.js +1 -0
  92. package/assets/esri/core/workers/chunks/f10a339b16d84b650012.js +2 -0
  93. package/assets/esri/core/workers/chunks/f1d211904d5a1de93cb3.js +1 -0
  94. package/assets/esri/core/workers/chunks/f847a4846c427f671455.js +1 -0
  95. package/assets/esri/core/workers/chunks/fe42fa2144691b9186fd.js +1 -0
  96. package/assets/esri/images/portal/gaussiansplatlayer16.png +0 -0
  97. package/assets/esri/images/portal/knowledgegraphlayer16.png +0 -0
  98. package/assets/esri/images/portal/propresentation16.png +0 -0
  99. package/assets/esri/images/portal/urbanproject16.png +0 -0
  100. package/assets/esri/images/support/loading-throb.gif +0 -0
  101. package/assets/esri/layers/raster/formats/lerc-wasm.wasm +0 -0
  102. package/assets/esri/libs/basisu/basis_encoder.wasm +0 -0
  103. package/assets/esri/libs/dxtEncoder/dxt_encoder.wasm +0 -0
  104. package/assets/esri/themes/base/icons/style.scss +0 -0
  105. package/assets/esri/themes/base/icons/variables.scss +0 -0
  106. package/assets/esri/themes/base/images/files/archive-32.svg +0 -0
  107. package/assets/esri/themes/base/images/files/cad-32.svg +0 -0
  108. package/assets/esri/themes/base/images/files/code-32.svg +0 -0
  109. package/assets/esri/themes/base/images/files/csv-32.svg +0 -0
  110. package/assets/esri/themes/base/images/files/excel-32.svg +0 -0
  111. package/assets/esri/themes/base/images/files/generic-32.svg +0 -0
  112. package/assets/esri/themes/base/images/files/gpx-32.svg +0 -0
  113. package/assets/esri/themes/base/images/files/image-32.svg +0 -0
  114. package/assets/esri/themes/base/images/files/pdf-32.svg +0 -0
  115. package/assets/esri/themes/base/images/files/report-32.svg +0 -0
  116. package/assets/esri/themes/base/images/files/sound-32.svg +0 -0
  117. package/assets/esri/themes/base/images/files/text-32.svg +0 -0
  118. package/assets/esri/themes/base/images/files/video-32.svg +0 -0
  119. package/assets/esri/themes/base/images/files/word-32.svg +0 -0
  120. package/assets/esri/themes/base/images/files/zip-32.svg +0 -0
  121. package/assets/esri/themes/base/images/loading-throb.gif +0 -0
  122. package/assets/esri/themes/base/widgets/_BatchAttributeForm.scss +24 -0
  123. package/assets/esri/themes/base/widgets/_Bookmarks.scss +0 -0
  124. package/assets/esri/themes/dark/main.css +1 -1
  125. package/assets/esri/themes/light/main.css +1 -1
  126. package/assets/esri/themes/light/view.css +1 -1
  127. package/chunks/GlowComposition.glsl.js +5 -5
  128. package/chunks/OITBlend.glsl.js +1 -1
  129. package/chunks/languageUtils.js +1 -1
  130. package/config.js +1 -1
  131. package/core/AsyncUpdate.js +1 -1
  132. package/core/Loadable.js +1 -1
  133. package/core/colorUtils.js +1 -1
  134. package/core/date.js +1 -1
  135. package/core/has.js +1 -1
  136. package/core/workers/WorkerHandle.js +1 -1
  137. package/core/workers/workerFactory.js +1 -1
  138. package/editing/sharedTemplates/SharedTemplateProvider.js +1 -1
  139. package/form/elements/AttachmentElement.d.ts +4 -1
  140. package/form/elements/inputs/attachments/AttachmentInput.d.ts +1 -0
  141. package/form/elements/inputs/attachments/AudioInput.d.ts +1 -0
  142. package/form/elements/inputs/attachments/DocumentInput.d.ts +3 -0
  143. package/form/elements/inputs/attachments/ImageInput.d.ts +1 -0
  144. package/form/elements/inputs/attachments/VideoInput.d.ts +1 -0
  145. package/geometry/Mesh.js +1 -1
  146. package/geometry/support/meshUtils/loadExternal.js +1 -1
  147. package/identity/OAuthCredential.js +1 -1
  148. package/kernel.js +1 -1
  149. package/layers/AnnotationFeatureLayer.d.ts +2 -4
  150. package/layers/AnnotationFeatureLayer.js +1 -1
  151. package/layers/DimensionFeatureLayer.d.ts +0 -2
  152. package/layers/DimensionFeatureLayer.js +1 -1
  153. package/layers/LinkChartLayer.js +1 -1
  154. package/layers/ParquetLayer.js +1 -1
  155. package/layers/PointCloudLayer.js +1 -1
  156. package/layers/SceneLayer.js +1 -1
  157. package/layers/buildingSublayers/BuildingComponentSublayer.js +1 -1
  158. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  159. package/layers/graphics/editingSupport.js +1 -1
  160. package/layers/graphics/sources/MemorySource.js +1 -1
  161. package/layers/graphics/sources/ParquetSource.js +1 -1
  162. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  163. package/layers/mixins/EditBusLayer.js +1 -1
  164. package/layers/mixins/SceneService.js +1 -1
  165. package/layers/support/KMLSublayer.js +1 -1
  166. package/layers/support/ParquetFilesData.js +1 -1
  167. package/layers/support/TitleCreator.js +1 -1
  168. package/layers/support/featureLayerUtils.js +1 -1
  169. package/layers/support/parquetUtils.js +1 -1
  170. package/linkChart/guards.js +2 -0
  171. package/linkChart/utils.js +1 -1
  172. package/networks/CircuitManager.d.ts +44 -0
  173. package/networks/support/CircuitExportJobInfo.d.ts +1 -1
  174. package/networks/support/CircuitVerifyJobInfo.d.ts +1 -1
  175. package/networks/support/jsonTypes.d.ts +2 -0
  176. package/package.json +5 -5
  177. package/rest/featureService/types.d.ts +4 -7
  178. package/rest/knowledgeGraph/ReplicaDefinition.d.ts +62 -6
  179. package/rest/networks/circuits/support/CircuitVerifyResult.d.ts +1 -1
  180. package/rest/networks/circuits/support/ExportCircuitsParameters.d.ts +1 -1
  181. package/rest/networks/circuits/support/VerifyCircuitsParameters.d.ts +17 -3
  182. package/rest/networks/unitIdentifiers/support/UnitQueryResult.d.ts +1 -1
  183. package/smartMapping/support/adapters/FeatureLayerAdapter.js +1 -1
  184. package/smartMapping/support/adapters/FeatureLayerBinningAdapter.js +1 -1
  185. package/support/ArcadeExpression.js +1 -1
  186. package/support/basemapUtils.js +1 -1
  187. package/support/revision.js +1 -1
  188. package/symbols/cim/CIMOperators.js +1 -1
  189. package/symbols/cim/utils.js +1 -1
  190. package/symbols/support/cimSymbolUtils.js +1 -1
  191. package/versionManagement/VersionManagementService.js +1 -1
  192. package/versionManagement/VersionManager.js +1 -1
  193. package/views/2d/analysis/AreaMeasurement/AreaMeasurementTool.js +1 -1
  194. package/views/2d/analysis/DistanceMeasurement/DistanceMeasurementTool.js +1 -1
  195. package/views/2d/engine/ParentChildStage.js +1 -1
  196. package/views/2d/engine/Stage.js +1 -1
  197. package/views/2d/engine/ThrottledCanvas.js +2 -0
  198. package/views/2d/engine/webgl/Profiler.js +1 -1
  199. package/views/2d/engine/webgl/mesh/factories/FeatureMeshFactory.js +1 -1
  200. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js +1 -1
  201. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  202. package/views/2d/engine/webgl/util/AnnotationMatcher.js +1 -1
  203. package/views/2d/engine/webgl/util/DictionaryMatcher.js +1 -1
  204. package/views/2d/engine/webgl/util/DimensionMatcher.js +1 -1
  205. package/views/2d/engine/webgl/util/IntervalMatcher.js +1 -1
  206. package/views/2d/engine/webgl/util/LabelMatcher.js +1 -1
  207. package/views/2d/engine/webgl/util/MapMatcher.js +1 -1
  208. package/views/2d/engine/webgl/util/Matcher.js +1 -1
  209. package/views/2d/engine/webgl/util/createMatcher.js +1 -1
  210. package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
  211. package/views/2d/layers/ImageryLayerView2D.js +1 -1
  212. package/views/2d/layers/LayerView2D.js +1 -1
  213. package/views/2d/layers/MediaLayerView2D.js +1 -1
  214. package/views/2d/layers/TileLayerView2D.js +1 -1
  215. package/views/2d/layers/features/Processor.js +1 -1
  216. package/views/2d/layers/features/layerAdapters/AnnotationLayerAdapter.js +1 -1
  217. package/views/2d/layers/features/layerAdapters/CatalogFootprintLayerAdapter.js +1 -1
  218. package/views/2d/layers/features/layerAdapters/DimensionLayerAdapter.js +1 -1
  219. package/views/2d/layers/features/layerAdapters/FeatureLayerAdapter.js +1 -1
  220. package/views/2d/layers/features/layerAdapters/InMemoryLayerAdapter.js +1 -1
  221. package/views/2d/layers/features/layerAdapters/KnowledgeGraphSublayerAdapter.js +1 -1
  222. package/views/2d/layers/features/layerAdapters/OGCFeatureLayerAdapter.js +1 -1
  223. package/views/2d/layers/features/layerAdapters/OrientedImageryLayerAdapter.js +1 -1
  224. package/views/2d/layers/features/layerAdapters/ParquetLayerAdapter.js +1 -1
  225. package/views/2d/layers/features/layerAdapters/StreamLayerAdapter.js +1 -1
  226. package/views/2d/layers/features/layerAdapters/SubtypeGroupLayerAdapter.js +1 -1
  227. package/views/2d/layers/features/processor/BinningStrategy.js +1 -1
  228. package/views/2d/layers/features/processor/ClusterStrategy.js +1 -1
  229. package/views/2d/layers/features/processor/TrackStrategy.js +1 -1
  230. package/views/2d/layers/features/sources/strategies/support/queryAdapters.js +1 -1
  231. package/views/2d/layers/features/support/FeatureMetadata.js +1 -1
  232. package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
  233. package/views/2d/layers/features/support/FeatureSetReaderIndirect.js +1 -1
  234. package/views/2d/layers/support/annodime/DimensionInfo.js +1 -1
  235. package/views/2d/layers/support/annodime/MatcherGeometryOverride.js +2 -0
  236. package/views/2d/layers/support/annodime/PrivateDimensionEffect.js +1 -1
  237. package/views/2d/layers/support/annodime/PrivateMatcherGeometryOverrideEffect.js +2 -0
  238. package/views/2d/layers/support/annodime/TileObjectId.js +2 -0
  239. package/views/2d/layers/support/annodime/annotationGraphic.js +1 -1
  240. package/views/2d/layers/support/annodime/debugUtils.js +2 -0
  241. package/views/2d/layers/support/annodime/dimensionStyleDefaults.js +2 -0
  242. package/views/2d/layers/support/annodime/dimensionSymbols.js +1 -1
  243. package/views/2d/layers/support/annodime/dimensionUtils.js +1 -1
  244. package/views/2d/layers/support/annodime/utils.js +1 -1
  245. package/views/3d/analysis/Viewshed/ViewshedPlacementController.js +1 -1
  246. package/views/3d/analysis/Viewshed/ViewshedPlacementPointPlugin.js +1 -1
  247. package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
  248. package/views/3d/camera/constraintUtils/surfaceCollision.js +1 -1
  249. package/views/3d/camera/constraintUtils.js +1 -1
  250. package/views/3d/glTF/internal/Resource.js +1 -1
  251. package/views/3d/glTF/loader.js +1 -1
  252. package/views/3d/layers/BuildingSceneLayerView3D.js +1 -1
  253. package/views/3d/layers/I3SMeshView3D.js +1 -1
  254. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  255. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  256. package/views/3d/layers/SceneLayerWorkerHandle.js +1 -1
  257. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  258. package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
  259. package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
  260. package/views/3d/layers/graphics/tessellationUtils.js +1 -1
  261. package/views/3d/layers/i3s/I3SOverrides.js +1 -1
  262. package/views/3d/state/GoToOperation.js +1 -1
  263. package/views/3d/state/SurfaceCollisionConstraint.js +1 -1
  264. package/views/3d/state/ViewState.js +1 -1
  265. package/views/3d/state/ViewStateManager.js +1 -1
  266. package/views/3d/state/controllers/PointToPointAnimationController.js +1 -1
  267. package/views/3d/state/controllers/ZoomControllerGlobal.js +1 -1
  268. package/views/3d/state/controllers/ZoomStepControllerGlobal.js +1 -1
  269. package/views/3d/support/renderInfoUtils/polygon.js +1 -1
  270. package/views/3d/webgl/ManagedFBO.js +1 -1
  271. package/views/3d/webgl/RenderCamera.js +1 -1
  272. package/views/3d/webgl/RenderNode.js +1 -1
  273. package/views/3d/webgl-engine/effects/RenderNodes.js +1 -1
  274. package/views/3d/webgl-engine/effects/atmosphere/ChapmanAtmosphere.js +1 -1
  275. package/views/3d/webgl-engine/effects/clouds/CloudsComposition.js +1 -1
  276. package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +1 -1
  277. package/views/3d/webgl-engine/effects/focusArea/FocusAreaColorNode.js +1 -1
  278. package/views/3d/webgl-engine/effects/fog/Fog.js +1 -1
  279. package/views/3d/webgl-engine/effects/geometry/RenderOccludedRenderNode.js +1 -1
  280. package/views/3d/webgl-engine/effects/glow/Glow.js +1 -1
  281. package/views/3d/webgl-engine/effects/haze/Haze.js +1 -1
  282. package/views/3d/webgl-engine/effects/laserlines/LaserLineRenderer.js +1 -1
  283. package/views/3d/webgl-engine/effects/magnifier/Magnifier.js +1 -1
  284. package/views/3d/webgl-engine/effects/smaa/SMAA.js +1 -1
  285. package/views/3d/webgl-engine/effects/transparency/OITBlend.js +1 -1
  286. package/views/3d/webgl-engine/effects/transparency/OITBlendTechniqueConfiguration.js +1 -1
  287. package/views/3d/webgl-engine/lib/CutFillComputationRenderNode.js +1 -1
  288. package/views/3d/webgl-engine/lib/CutFillVisualizationRenderNode.js +1 -1
  289. package/views/3d/webgl-engine/lib/GPUPointOcclusionQuery.js +1 -1
  290. package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
  291. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  292. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  293. package/views/3d/webgl-engine/materials/renderers/MergedRenderer.js +1 -1
  294. package/views/3d/webgl-engine/materials/renderers/VaoWriter.js +1 -1
  295. package/views/3d/webgl.js +1 -1
  296. package/views/VideoView.js +1 -1
  297. package/views/View2D.js +1 -1
  298. package/views/Viewport2DBaseMixin.js +1 -1
  299. package/views/analysis/ElevationProfile/ElevationProfileLineGroundComputation.js +1 -1
  300. package/views/draw/DrawTool.js +1 -1
  301. package/views/draw/support/editingSessionUtils.js +1 -1
  302. package/views/interactive/sketch/SketchLabelOptions.d.ts +0 -6
  303. package/views/layers/AnnotationFeatureLayerView.d.ts +0 -7
  304. package/views/layers/DimensionFeatureLayerView.d.ts +0 -7
  305. package/views/popupAdapter.js +1 -1
  306. package/views/support/LayerViewManager.js +1 -1
  307. package/views/webgl/BufferObject.js +1 -1
  308. package/webdoc/support/webdocSaveUtils.js +1 -1
  309. package/widgets/BasemapGallery/BasemapGalleryViewModel.js +1 -1
  310. package/widgets/BasemapGallery/support/PortalBasemapsSource.js +1 -1
  311. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
  312. package/widgets/BatchAttributeForm/batchAttributeFormUtils.js +1 -1
  313. package/widgets/BatchAttributeForm/css.js +1 -1
  314. package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.js +1 -1
  315. package/widgets/BatchAttributeForm/interfaceUtils.js +1 -1
  316. package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
  317. package/widgets/BatchAttributeForm.js +1 -1
  318. package/widgets/Directions/DirectionsViewModel.js +1 -1
  319. package/widgets/Directions.js +1 -1
  320. package/widgets/Editor/EditorViewModel.d.ts +1 -13
  321. package/widgets/Editor.d.ts +11 -13
  322. package/widgets/Editor.js +1 -1
  323. package/widgets/Feature/FeatureViewModel.js +1 -1
  324. package/widgets/Feature.js +1 -1
  325. package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
  326. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  327. package/widgets/FeatureTable/support/FeatureStore.js +1 -1
  328. package/widgets/FeatureTable.js +1 -1
  329. package/widgets/Features/FeaturesViewModel.js +1 -1
  330. package/widgets/Features.js +1 -1
  331. package/widgets/LayerList/LayerListViewModel.js +1 -1
  332. package/widgets/LinkChartLayoutSwitcher/LinkChartLayoutSwitcherViewModel.js +1 -1
  333. package/widgets/Locate/LocateViewModel.js +1 -1
  334. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  335. package/widgets/OrientedImageryViewer/adapters/sketch/DataCaptureAdapter.js +1 -1
  336. package/widgets/OrientedImageryViewer/adapters/sketch/MeasurementAdapter.js +1 -1
  337. package/widgets/OrientedImageryViewer/adapters/view/MapViewAdapter.js +1 -1
  338. package/widgets/OrientedImageryViewer/services/SuperimposeService.js +1 -1
  339. package/widgets/OrientedImageryViewer/support/MediaPrefetcher.js +1 -1
  340. package/widgets/PanoramicViewer/PanoramicViewerViewModel.js +1 -1
  341. package/widgets/Popup/PopupViewModel.d.ts +0 -1
  342. package/widgets/Popup/PopupViewModel.js +1 -1
  343. package/widgets/Popup.js +1 -1
  344. package/widgets/Print/PrintViewModel.js +1 -1
  345. package/widgets/Print.js +1 -1
  346. package/widgets/ScaleBar/ScaleBarViewModel.js +1 -1
  347. package/widgets/Sketch/SketchViewModel.d.ts +0 -12
  348. package/widgets/Sketch.d.ts +0 -12
  349. package/widgets/TableList/ListItem.js +1 -1
  350. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceFeature.js +1 -1
  351. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceViewModel.js +1 -1
  352. package/widgets/VersionManagement/VersionManagementViewModel.js +1 -1
  353. package/widgets/Widget.js +1 -1
  354. package/widgets/support/geolocationUtils.js +1 -1
  355. package/widgets/support/tests.js +1 -1
  356. package/assets/esri/core/workers/chunks/04070767356c12026369.js +0 -1
  357. package/assets/esri/core/workers/chunks/045f178fecc23839bfa8.js +0 -680
  358. package/assets/esri/core/workers/chunks/073ee52705ea326fecfb.js +0 -1
  359. package/assets/esri/core/workers/chunks/0e81b6aa64d5491870b2.js +0 -1
  360. package/assets/esri/core/workers/chunks/126a8c26618425790804.js +0 -1
  361. package/assets/esri/core/workers/chunks/1a7c0a1dc6ecc93ea03a.js +0 -1
  362. package/assets/esri/core/workers/chunks/1cb1f125dccbf8c8cac9.js +0 -1
  363. package/assets/esri/core/workers/chunks/1f03e34520746e432719.js +0 -1
  364. package/assets/esri/core/workers/chunks/292498a9c7d462d215c6.js +0 -1
  365. package/assets/esri/core/workers/chunks/2ed81f1e490cb7e73405.js +0 -1
  366. package/assets/esri/core/workers/chunks/32f26757e36704923286.js +0 -1
  367. package/assets/esri/core/workers/chunks/33e86dd1a54e447fa0e3.js +0 -1
  368. package/assets/esri/core/workers/chunks/35c87b0a4d4ee7ce302d.js +0 -1
  369. package/assets/esri/core/workers/chunks/36b904912cea1744d1c6.js +0 -1
  370. package/assets/esri/core/workers/chunks/3a35779cae6a11cde51b.js +0 -1
  371. package/assets/esri/core/workers/chunks/3b7060d264888bf298b1.js +0 -1
  372. package/assets/esri/core/workers/chunks/3df5394b17e9659ecb8f.js +0 -1
  373. package/assets/esri/core/workers/chunks/4adfe7f8a8efe2cd8e80.js +0 -1
  374. package/assets/esri/core/workers/chunks/511b9c12a7479d39dac0.js +0 -1
  375. package/assets/esri/core/workers/chunks/5396a894e6f8030ca088.js +0 -1
  376. package/assets/esri/core/workers/chunks/5728d8440aca205e4f53.js +0 -1
  377. package/assets/esri/core/workers/chunks/66392ff750c28064040a.js +0 -1
  378. package/assets/esri/core/workers/chunks/668d84dc512b3085a960.js +0 -1
  379. package/assets/esri/core/workers/chunks/6849282c4a5cd733779d.js +0 -1
  380. package/assets/esri/core/workers/chunks/6adc17e6e287a365ad8d.js +0 -1
  381. package/assets/esri/core/workers/chunks/6db5ee9c589265b23b60.js +0 -1
  382. package/assets/esri/core/workers/chunks/76ed8e455f6bd79e561c.js +0 -1
  383. package/assets/esri/core/workers/chunks/7c34eb94e2c74602aeab.js +0 -1
  384. package/assets/esri/core/workers/chunks/831455798b177678720c.js +0 -1
  385. package/assets/esri/core/workers/chunks/88b08b386926ec889573.js +0 -1
  386. package/assets/esri/core/workers/chunks/8bd4c43c34aacf3b07da.js +0 -1
  387. package/assets/esri/core/workers/chunks/8ca88cfc0b9f84dc5832.js +0 -1
  388. package/assets/esri/core/workers/chunks/928b18e13e015330d44b.js +0 -1
  389. package/assets/esri/core/workers/chunks/937e347d130d469518ce.js +0 -1
  390. package/assets/esri/core/workers/chunks/93b40245378ced43ca08.js +0 -1
  391. package/assets/esri/core/workers/chunks/98dfe31e8ed9b522eaff.js +0 -1
  392. package/assets/esri/core/workers/chunks/a18cb809dd56c5537b3b.js +0 -1
  393. package/assets/esri/core/workers/chunks/a195f569eada3a8736be.js +0 -1
  394. package/assets/esri/core/workers/chunks/a40ede4d3375184f21fe.js +0 -1
  395. package/assets/esri/core/workers/chunks/a8167ab9fd846d699be5.js +0 -1
  396. package/assets/esri/core/workers/chunks/af96cbc4fb7bef726635.js +0 -1
  397. package/assets/esri/core/workers/chunks/b87aca8ad281870ae970.js +0 -1
  398. package/assets/esri/core/workers/chunks/ceb5bd9f2afaa2ea0808.js +0 -1
  399. package/assets/esri/core/workers/chunks/d25c37f169577a33db46.js +0 -1
  400. package/assets/esri/core/workers/chunks/d374cb2d17a2d11c500f.js +0 -1
  401. package/assets/esri/core/workers/chunks/dadf85890961bcc205eb.js +0 -1
  402. package/assets/esri/core/workers/chunks/db279d5d9c7deec554bb.js +0 -1
  403. package/assets/esri/core/workers/chunks/de0c94defb90e1805081.js +0 -1
  404. package/assets/esri/core/workers/chunks/e1340232962cf576d37e.js +0 -1
  405. package/assets/esri/core/workers/chunks/e38d1ba15babc238b151.js +0 -1
  406. package/assets/esri/core/workers/chunks/e73bb7c8de7412d9975c.js +0 -1
  407. package/assets/esri/core/workers/chunks/f23351a04643c464be84.js +0 -1
  408. package/assets/esri/core/workers/chunks/f3d331da3c61af5c5a2f.js +0 -1
  409. package/assets/esri/core/workers/chunks/f5125925f83c979edde7.js +0 -2
  410. package/assets/esri/core/workers/chunks/f912c173c58ae4299cbe.js +0 -1
  411. package/assets/esri/core/workers/chunks/f93facf47aba9b128fcc.js +0 -1
  412. package/assets/esri/core/workers/chunks/fae147d03ed723ab234d.js +0 -1
  413. package/views/2d/engine/ManagedCanvas.js +0 -2
  414. package/views/2d/layers/features/support/FeatureSetReaderAnnotationJSON.js +0 -2
  415. package/views/2d/layers/features/support/FeatureSetReaderDimensionJSON.js +0 -2
  416. package/views/2d/layers/support/annodime/annotationUtils.js +0 -2
  417. package/views/3d/state/controllers/SurfaceCollisionCorrectionController.js +0 -2
  418. /package/assets/esri/core/workers/chunks/{f5125925f83c979edde7.js.LICENSE.txt → f10a339b16d84b650012.js.LICENSE.txt} +0 -0
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../AggregateGraphic.js";import r from"../../../Graphic.js";import s from"../../../TrackGraphic.js";import{isSome as i}from"../../../core/arrayUtils.js";import a from"../../../core/Collection.js";import o from"../../../core/Error.js";import{makeHandle as n,handlesGroup as l}from"../../../core/handleUtils.js";import has from"../../../core/has.js";import u from"../../../core/Logger.js";import{destroyMaybe as h}from"../../../core/maybe.js";import{notDeepEqual as c}from"../../../core/object.js";import{createAbortError as p,ignoreAbortErrors as d,throwIfNotAbortError as y,isAbortError as m}from"../../../core/promiseUtils.js";import{watch as g,sync as f}from"../../../core/reactiveUtils.js";import{isScreenRect as w}from"../../../core/screenUtils.js";import{sqlAnd as v}from"../../../core/sql.js";import{getMetersPerUnitForSR as _}from"../../../core/units.js";import{property as b,subclass as S}from"../../../core/accessorSupport/decorators.js";import{UpdatingHandles as A}from"../../../core/support/UpdatingHandles.js";import F from"../../../geometry/Extent.js";import{fromJSON as j}from"../../../geometry/support/jsonUtils.js";import x from"../../../geometry/support/rotate.js";import{isCurvedGeometry as E}from"../../../geometry/support/curves/curveUtils.js";import{densifyCurvedGeometry as I}from"../../../geometry/support/curves/densifyCurvedGeometry.js";import k from"../../../layers/effects/FeatureEffectView.js";import{convertFromFeature as O}from"../../../layers/graphics/featureConversionUtils.js";import U from"../../../layers/support/FeatureFilter.js";import{checkServiceCurrentUserSupport as R}from"../../../layers/support/featureLayerUtils.js";import{packFields as V}from"../../../layers/support/fieldUtils.js";import{getEffectiveLayerCapabilities as C}from"../../../layers/support/layerUtils.js";import{combineTimeExtent as Q}from"../../../layers/support/timeSupport.js";import q from"../../../rest/support/AggregateFeatureSet.js";import M from"../../../rest/support/AttributeBinsFeatureSet.js";import H from"../../../rest/support/AttributeBinsQuery.js";import P from"../../../rest/support/FeatureSet.js";import L from"../../../rest/support/Query.js";import{HittestDrawHelper as T}from"../../../symbols/cim/CIMSymbolDrawHelper.js";import{symbolToCIM as W}from"../../../symbols/cim/CIMSymbolHelper.js";import{getDisplayedSymbol as D}from"../../../symbols/support/symbolUtils.js";import{LayerView2D as G}from"./LayerView2D.js";import{FeatureContainer as N}from"./features/FeatureContainer.js";import{createFeaturePipelineWorkerProxy as J}from"./features/FeaturePipelineWorkerProxy.js";import{FeatureSourceEventLog as z}from"./features/FeatureSourceEventLog.js";import{AnnotationLayerAdapter as B}from"./features/layerAdapters/AnnotationLayerAdapter.js";import{CatalogFootprintLayerAdapter as Z}from"./features/layerAdapters/CatalogFootprintLayerAdapter.js";import{DimensionLayerAdapter as K}from"./features/layerAdapters/DimensionLayerAdapter.js";import{FeatureLayerAdapter as $}from"./features/layerAdapters/FeatureLayerAdapter.js";import{createFeatureIdInfo as X}from"./features/layerAdapters/featureServiceUtils.js";import{InMemoryLayerAdapter as Y}from"./features/layerAdapters/InMemoryLayerAdapter.js";import{KnowledgeGraphSublayerAdapter as ee}from"./features/layerAdapters/KnowledgeGraphSublayerAdapter.js";import{OGCFeatureLayerAdapter as te}from"./features/layerAdapters/OGCFeatureLayerAdapter.js";import{OrientedImageryLayerAdapter as re}from"./features/layerAdapters/OrientedImageryLayerAdapter.js";import{ParquetLayerAdapter as se}from"./features/layerAdapters/ParquetLayerAdapter.js";import{StreamLayerAdapter as ie}from"./features/layerAdapters/StreamLayerAdapter.js";import{SubtypeGroupLayerAdapter as ae}from"./features/layerAdapters/SubtypeGroupLayerAdapter.js";import{createComplexSymbolInstances as oe}from"./features/schema/processor/symbols/ComplexSymbolSchema.js";import{DebouncedFeatureOverride as ne}from"./support/DebouncedFeatureOverride.js";import{FeatureCommandQueue as le}from"./support/FeatureCommandQueue.js";import{handleNoEngineError as ue}from"./support/handleNoEngineError.js";import{toJSONGeometryType as he}from"./support/util.js";import{getMapPointsFromScreen as ce}from"../support/hitTestUtils.js";import{FeatureTileSubscriptionManager as pe}from"../tiling/FeatureTileSubscriptionManager.js";import{RefreshableLayerView as de}from"../../layers/RefreshableLayerView.js";import{getHighlightName as ye}from"../../support/highlightOptionsUtils.js";function me(e,t){const r=new Set;return e&&e.forEach(e=>r.add(e)),t&&t.forEach(e=>r.add(e)),r.has("*")?["*"]:Array.from(r)}const ge=4294967294;function fe(e,t){return l(e.map(e=>g(()=>{const t=e();return t&&"object"==typeof t?"getTime"in t&&"function"==typeof t.getTime?t.getTime():JSON.stringify(t):t},t,f)))}function we(e){if(!e.geometry)return e;if(!E(e.geometry))return e;const t=.001/_(e.geometry.spatialReference),r=100;return{geometry:I(e.geometry,{maxSegmentsPerCurve:12e3,maxSegmentLength:r*t,maxDeviation:0}),attributes:e.attributes}}const ve=l=>{const f=de(G(l));let _=class extends f{constructor(){super(...arguments),this._commandsQueue=new le({process:e=>{switch(e.type){case"override-batch":return this._doOverride(e);case"update":return this._doUpdate();case"highlight":return this._updateHighlights()}}}),this._visibilityOverrides=new Set,this._lastAvailableFields=[],this._lastTargetState=null,this.eventLog=new z,this._sourceRefreshVersion=1,this._displayRefreshVersion=1,this._pipelineUpdating=!1,this._editUpdatingHandles=new A,this._fields=null,this._hittestDrawHelper=null,this._sourceUpdating=!1,this.featureEffectView=new k}destroy(){this._editUpdatingHandles.destroy(),this._workerProxy?.destroy(),this._workerAttached.reject(p()),this._commandsQueue.destroy(),this._hittestDrawHelper?.destroy()}initialize(){this._workerAttached=Promise.withResolvers(),d(this._workerAttached.promise),this.addResolvingPromise(this._initProxy()),this.featureEffectView.featureEffect=this.featureEffect,this.featureEffectView.endTransition()}async _initProxy(){const e=this.layer;if("isTable"in e&&e.isTable)throw new o("featurelayerview:table-not-supported","table feature layer can't be displayed",{layer:e});if(("feature"===e.type||"subtype-group"===e.type)&&!1===C(e)?.operations.supportsQuery)throw new o("featurelayerview:query-not-supported","layer view requires a layer with query capability",{layer:e});this._workerProxy&&this._workerProxy.destroy();const t=this._createClientOptions();this._workerProxy=await J(t)}async _attachProxy(){const e=x(this.view.extent,this.view.rotation,this.view.center),t={tileInfoJSON:this.view?.featuresTilingScheme?.tileInfo?.toJSON(),initialViewExtent:e.toJSON()};try{await this._workerProxy.pipeline.onAttach(t),this._workerAttached.resolve()}catch(r){this._workerAttached.reject(p()),y(r)}}async _detachProxy(){return this._workerProxy.pipeline.onDetach()}async getWorker(){return await this._workerAttached.promise,this._workerProxy}get dataUpdating(){return this._sourceUpdating||this._editUpdatingHandles.updating}get hasAllFeatures(){return this.layer.visible&&!this.suspended&&this.eventLog.hasAllData&&this.eventLog.willQueryAllFeatures}get hasAllFeaturesInView(){const e=this.effectiveDisplayFilter?.where||null,t=!this.eventLog.willQueryAllFeatures&&null!=e&&"1=1"!==e;return this.layer.visible&&!this.suspended&&this.eventLog.hasAllData&&!t}get hasFullGeometries(){return this.layer.visible&&!this.suspended&&this.eventLog.hasAllData&&this.eventLog.willQueryFullResolutionGeometry}get layerAdapter(){switch(this.layer.type){case"annotation-feature":return new B(this.layer);case"dimension-feature":return new K(this.layer);case"feature":return"memory"===this.layer.source.type?new Y(this.layer):new $(this.layer);case"geojson":case"csv":case"wfs":return new Y(this.layer);case"parquet":return new se(this.layer);case"subtype-group":return new ae(this.layer);case"ogc-feature":return new te(this.layer);case"stream":return new ie(this.layer);case"oriented-imagery":return new re(this.layer);case"knowledge-graph-sublayer":return new ee(this.layer);case"catalog-footprint":return new Z(this.layer);default:this.layer}return null}get timeExtent(){return Q(this.layerAdapter.timeOptions,this.view?.timeExtent,this._get("timeExtent"))}get usedMemory(){return this.container.usedMemory+this.eventLog.pipelineStatistics.usedMemory}getDisplayStatistics(e,t){return this.featureContainer?.getDisplayStatistics(e,t)}highlight(e,t){let s;e instanceof r?s=[e.getObjectId()]:"number"==typeof e||"string"==typeof e?s=[e]:a.isCollection(e)&&e.length>0?s=e.map(e=>e?.getObjectId()).toArray():Array.isArray(e)&&e.length>0&&(s="number"==typeof e[0]||"string"==typeof e[0]?e:e.map(e=>e?.getObjectId()));const o=s?.filter(i);if(!o?.length)return n();const l=ye(t);return this._addHighlights(o,l),n(()=>!this.destroyed&&this._removeHighlights(o,l))}async hitTest(e,i){const a=w(i),{trueHitIds:o,candidateHitIds:n}=await this.featureContainer.hitTest(i),l=await this.getWorker(),[u,h]=await Promise.all([l.pipeline.getDisplayFeatures(n),l.pipeline.getDisplayFeatures(o)]),{features:c,aggregates:p,tracks:d}=u,{features:y,aggregates:g,tracks:f}=h,v=[];if(a&&this.hasRenderer()){const e=new Map,t=new r;for(const r of c){t.attributes=r.attributes,t.geometry=j(r.geometry),t.symbol=null;const s=this.layerAdapter.getRenderer(t);if(!s){v.push(r);continue}const i=await D(t,{renderer:s,scale:this.view.scale,resolution:this.view.resolution,spatialReference:this.view.spatialReference,viewingMode:"2d",timeZone:this.view.timeZone});if(!i)continue;let a=null;const o=W(i);if("web-style"===o.type)try{const e=W(await o.fetchSymbol({acceptedFormats:["cim","web"]}));a="web-style"===e.type?null:e}catch(x){m(x),0;continue}else a=o;const n=a?.symbol;if(!n)continue;const l=this.view.stage.cimAnalyzer.analyzeSymbolReference(a,!1).some(e=>"alignment"in e&&0===e.alignment);e.set(r,{cimSymbol:n,isScreenAligned:l})}e.size>0&&!this._hittestDrawHelper&&(this._hittestDrawHelper=new T(this.view.stage.painter.textureManager.resourceManager));const{resolution:s,rotation:a}=this.view.state,o=ce(this.view,i);for(const[r,{cimSymbol:i,isScreenAligned:n}]of e){if(!r)continue;const e={hittestType:"rect",textInfo:null,mapRotation:a,resolution:s,searchDist:0,isScreenAligned:n};this._hittestDrawHelper.hitTest(o,i,r.geometry,e)&&v.push(r)}}else v.push(...c);const _=[...y,...v],b=[...g,...p],S=[...f,...d],A=this.featureContainer.getSortKeys(_.map(e=>e.displayId)),F=({displayId:e},{displayId:t})=>A.has(e)&&A.has(t)?A.get(e)-A.get(t):e-t;return _.sort(F).reverse(),b.sort(F).reverse(),[...b.map(r=>this._createAggregateGraphicHit(e,t.fromJSON(r))),...S.map(t=>this._createTrackGraphicHit(e,s.fromJSON(t))),..._.map(t=>this._createFeatureGraphicHit(a?null:e,r.fromJSON(t)))]}async queryAggregateSummaryStatistics(e,t,r){const s={...t,scale:this.view.scale},i=(await this.getWorker()).aggregates.executeQueryForSummaryStatistics(this._cleanUpAggregateQuery(e),s,r);return ue(i,{})}async queryUniqueValues(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.features.executeQueryForUniqueValues(this._cleanUpQuery(e),i,r);return ue(a,{uniqueValueInfos:[]})}async queryAggregateUniqueValues(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.aggregates.executeQueryForUniqueValues(this._cleanUpAggregateQuery(e),i,r);return ue(a,{uniqueValueInfos:[]})}async queryAggregateClassBreaks(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.aggregates.executeQueryForClassBreaks(this._cleanUpAggregateQuery(e),i,r);return ue(a,{classBreakInfos:[]})}async queryHistogram(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.features.executeQueryForHistogram(this._cleanUpQuery(e),i,r);return ue(a,{bins:[],maxValue:null,minValue:null,normalizationTotal:null})}async queryAggregateCount(e,t){const r=(await this.getWorker()).aggregates.executeQueryForCount(this._cleanUpAggregateQuery(e),t);return ue(r,0)}async queryAggregateHistogram(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.aggregates.executeQueryForHistogram(this._cleanUpAggregateQuery(e),i,r);return ue(a,{bins:[],maxValue:null,minValue:null,normalizationTotal:null})}async queryAggregateIds(e,t){const r=(await this.getWorker()).aggregates.executeQueryForIds(this._cleanUpAggregateQuery(e),t);return ue(r,[])}async queryAggregateJSON(e,t){const r=(await this.getWorker()).aggregates.executeQuery(this._cleanUpAggregateQuery(e),t);return ue(r,{features:[]})}async queryAttributeBins(e,t){const r=(await this.getWorker()).features.executeAttributeBinsQuery(this._cleanUpAttributeBinsQuery(e),t),s=await ue(r,{features:[]});return M.fromJSON(s)}async queryAggregates(e,t){const r=(await this.getWorker()).aggregates.executeQuery(this._cleanUpAggregateQuery(e),t),s=await ue(r,{features:[]}),i=q.fromJSON(s);return i.features.forEach(e=>this.layerAdapter.setAggregateGraphicOrigin?.(e)),i}async queryClassBreaks(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.features.executeQueryForClassBreaks(this._cleanUpQuery(e),i,r);return ue(a,{classBreakInfos:[]})}async queryExtent(e,t){const r=(await this.getWorker()).features.executeQueryForExtent(this._cleanUpQuery(e),t),s=await ue(r,{count:0,extent:null});return{count:s.count,extent:F.fromJSON(s.extent)}}async queryFeatureCount(e,t){const r=(await this.getWorker()).features.executeQueryForCount(this._cleanUpQuery(e),t);return ue(r,0)}queryFeatures(e,t){return this.queryFeaturesJSON(e,t).then(e=>{const t=P.fromJSON(e);return t.features.forEach(e=>this._setOriginForFeature(e)),t})}async queryFeaturesJSON(e,t){const r=(await this.getWorker()).features.executeQuery(this._cleanUpQuery(e),t);return ue(r,{features:[]})}async queryHeatmapStatistics(e){return(await this.getWorker()).pipeline.queryHeatmapStatistics(e)}async queryObjectIds(e,t){const r=(await this.getWorker()).features.executeQueryForIds(this._cleanUpQuery(e),t);return ue(r,[])}async queryStatistics(){const e=await this.getWorker();return ue(e.pipeline.queryStatistics(),{featureCount:0,ringCount:0,vertexCount:0})}async querySummaryStatistics(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.features.executeQueryForSummaryStatistics(this._cleanUpQuery(e),i,r);return ue(a,{})}async queryVisibleFeatures(e,t){const r=(await this.getWorker()).pipeline.queryVisibleFeatures(this._cleanUpQuery(e),t),s=await ue(r,{features:[]}),i=P.fromJSON(s);return i.features.forEach(e=>this._setOriginForFeature(e)),i}async getSampleFeatures(e){return(await this.getWorker()).pipeline.getSampleFeatures(e)}setVisibility(e,t){t?this._visibilityOverrides.delete(e):this._visibilityOverrides.add(e),this._update()}update(e){if(!this._subscriptions)return;this.view.animation&&!this._lastTargetState&&(this._lastTargetState=e.state.clone()),!this.view.animation&&this._lastTargetState&&(this._lastTargetState=null);const t=this.featureContainer.getPresenting(),r=this._subscriptions.update(e.targetState,this._lastTargetState,t);r&&(this.featureContainer.updateSubscriptions(r),d(this._updatingHandles.addPromise(this.getWorker().then(e=>e.pipeline.updateSubscriptions(r))))),this._subscriptions.coverage&&this.featureContainer.setCoverage(this._subscriptions.coverage)}attach(){has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D.attach"),d(this._updatingHandles.addPromise(this._workerAttached.promise)),d(this._attachProxy()),this.featureContainer=new N(this),this.container.addChild(this.featureContainer),this.view.timeline.record(`${this.layer.title} (FeatureLayer) Attach`),this._subscriptions=new pe(this.view.featuresTilingScheme),this.requestUpdate(),this.addAttachHandles([fe([()=>this._displayRefreshVersion,()=>"displayFilterInfo"in this.layer&&this.layer.displayFilterInfo,()=>this.timeExtent,()=>this.clips,()=>this.filter,()=>this.effectiveDisplayFilterClause,()=>this.featureEffect,()=>this._sourceRefreshVersion,()=>this.view.timeZone,()=>this.view.timeExtent,...this.layerAdapter.getUpdateHashProperties(this.view)],()=>this._update()),g(()=>this.updateSuspended,e=>{e||this._subscriptions.resume(this.featureContainer.getPresenting())}),g(()=>this.view.stationary,async e=>{if(e){const e=await this.getWorker(),t=x(this.view.extent,this.view.rotation,this.view.center);e.pipeline.updateStationaryExtent(t.toJSON(),this.featureContainer.requiresRefresh)}})]),this._update(),"stream"!==this.layer.type&&"parquet"!==this.layer.type&&"catalog-footprint"!==this.layer.type&&this.addAttachHandles(this.layer.on("edits",e=>this._editUpdatingHandles.addPromise(this._edit(e))))}detach(){has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D.detach"),this._detachProxy(),this._fields=null,this.featureContainer.destroy(),this.featureContainer=null,this._commandsQueue.clear(),this.container.removeAllChildren(),this._subscriptions=h(this._subscriptions),this._workerProxy.pipeline.onDetach(),this._workerAttached=Promise.withResolvers(),d(this._workerAttached.promise),this._lastAvailableFields=[],this._lastSchema=null}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}addOverrides(e){return this._commandsQueue.push({type:"override",options:{...e,release:[]}})}removeOverrides(e){for(const r of e)if(null==r)throw new o("featurelayerview:bad-override","Tried to remove an override for an invalid objectId",{objectId:r});const t={added:[],updated:[],removed:[],release:e,isWeak:!1,historicMoment:null};return this._commandsQueue.push({type:"override",options:t})}onProxyClientEvent(e){}hasRenderer(){return"renderer"in this.layer&&null!=this.layer.renderer}isUpdating(){const e=this.hasRenderer(),t=this._commandsQueue.updateTracking.updating,r=null!=this._updatingRequiredPromise,s=this.featureContainer.updating;return this.updateRequested||e&&(t||r)||s||this._pipelineUpdating||this.dataUpdating}_createClientOptions(){const e=this;return{updateSchemaStart:()=>e.updateSchemaStart(),updateSchemaEnd:t=>e.updateSchemaEnd(t),openMemoryPorts:async()=>{if(this.layerAdapter?.openMessagePorts){const e=await this.layerAdapter.openMessagePorts();return{result:e,transferList:e}}throw new Error("InternalError: Layer adapter does not support opening message ports")},get container(){return e.featureContainer},setUpdating:e=>{this._set("_pipelineUpdating",e.pipeline),this._set("_sourceUpdating",e.source)},emitEvent:e=>{this.onProxyClientEvent(e)},get eventLog(){return e.eventLog},fetch:async t=>{if(has("esri-2d-stabilize-glyphs")){const r=[];for(const s of t)r.push(await e.view.stage.painter.textureManager.rasterizeItem(s));return r}return Promise.all(t.map(t=>e.view.stage.painter.textureManager.rasterizeItem(t)))},fetchDictionary:e=>Promise.all(e.map(e=>this._fetchDictionaryRequest(e))),fetchMesh:e=>Promise.all(e.map(e=>this._fetchMeshRequest(e)))}}async _fetchDictionaryRequest(e){try{if(!("renderer"in this.layer)||!this.layer.renderer||"dictionary"!==this.layer.renderer.type)throw new Error("InternalError: Expected renderer to be of type 'dictionary'");const t=this.layer.renderer,r=this._lastSchema.processor.mesh.factory.symbology;if("dictionary"!==r.type)throw new Error("InternalError: Expected schema to be of type 'dictionary'");const s={cimAnalyzer:this.view.stage.cimAnalyzer,cimResourceManager:this.view.stage.painter.textureManager.resourceManager,store:this.featureContainer.instanceStore,scaleExpression:r.scaleExpression};this._fields||(this._fields=this.layer.fields.map(e=>e.toJSON()));const i=r.visualVariableUniforms,a=he(this.layer.geometryType),o=await t.getSymbolForControlString(e.controlString,a,!1);if(!o||!o.data)return{type:"dictionary-response",meshes:[]};return{type:"dictionary-response",meshes:await oe({...o.data,hasTextStringTemplates:!0},{uniforms:i,path:"renderer",schemaOptions:s})}}catch(t){return{type:"dictionary-response",meshes:[]}}}async _fetchMeshRequest(e){const{layer:t}=this;try{const r={cimAnalyzer:this.view.stage.cimAnalyzer,cimResourceManager:this.view.stage.painter.textureManager.resourceManager,store:this.featureContainer.instanceStore,scaleExpression:null};this._fields||(this._fields=t.fields.map(e=>e.toJSON()));return{type:"mesh-response",meshes:await oe({...e.symbolReference,hasTextStringTemplates:!0},{path:"anno-like",schemaOptions:r,uniforms:{visualVariableColor:null,visualVariableOpacity:null,visualVariableRotation:null,visualVariableSizeStops:null,visualVariableSizeScaleStops:null,visualVariableSizeOutlineScaleStops:null,visualVariableSizeUnitValue:null,visualVariableSizeMinMaxValue:null}})}}catch(r){return{type:"mesh-response",meshes:[]}}}_cleanUpQuery(e){const t=L.from(e)||this.createQuery();return t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference),"returnZ"in this.layer&&(t.returnZ??=this.layer.returnZ),"returnM"in this.layer&&(t.returnM??=this.layer.returnM),t.toJSON()}_cleanUpAttributeBinsQuery(e){const t=H.from(e);return t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference),t.toJSON()}_cleanUpAggregateQuery(e){const t=L.from(e)||this.createAggregateQuery();t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference);const r=t.objectIds??[];for(const s of t.aggregateIds??[])r.push(s);return t.objectIds=r,t.aggregateIds=[],t.toJSON()}async _update(){return this._commandsQueue.push({type:"update"})}_edit(e){return this._commandsQueue.push({type:"edit",event:e})}async doRefresh(e){this.attached&&(this.updateSuspended&&e||(e?this.incrementSourceRefreshVersion():this.incrementDisplayRefreshVersion()))}incrementSourceRefreshVersion(){this._sourceRefreshVersion=(this._sourceRefreshVersion+1)%ge+1}incrementDisplayRefreshVersion(){this._displayRefreshVersion=(this._displayRefreshVersion+1)%ge+1}async _resolveIdenifiers(e){const t=[],r=[];for(const a of e)null==a.objectId||-1===a.objectId?null==a.globalId?u.getLogger(this).warn("mapview-apply-edits","A feature identifier must contain either a GlobalId or ObjectId. Ignoring",{identifier:a}):r.push(a.globalId):t.push(a.objectId);const s="globalIdField"in this.layer&&this.layer.globalIdField,i=s&&this.availableFields.includes(s);if(r.length&&!i)return u.getLogger(this).error(new o("mapview-apply-edits",`Editing the specified service requires the layer's globalIdField, ${s} to be included the layer's outFields for updates to be reflected on the map`)),t;if(r.length){const e=await this._workerProxy.pipeline.getObjectIdsFromGlobalIds(r);for(const r of e)t.push(r)}return t}_resolveOverrides(e){const t=!1,r=!1,s=he(this.layer.geometryType),i=X(this.layer),a=[];for(const n of e.added){const e=O(we(n),s,t,r,i);if(null==e.objectId)throw new o("featurelayerview:bad-override","Feature does not have an objectId",{feature:n});a.push(e)}for(const n of e.updated){const e=O(we(n),s,t,r,i);if(null==e.objectId)throw new o("featurelayerview:bad-override","Feature does not have an objectId",{feature:n});a.push(e)}for(const n of e.removed)if(null==n)throw new o("featurelayerview:bad-override","Tried to remove an invalid objectId",{objectId:n});return{type:"override",updates:a,removed:e.removed,release:e.release,isWeak:e.isWeak??!1,historicMoment:e.historicMoment??null}}async _resolveEdit(e){const t=this.layer,r=e.historicMoment?.getTime()??null,s="layerId"in t&&e.editedFeatures?.find(e=>e.layerId===t.layerId);if(s&&this._canEditByFeature(s)){const{adds:e,deletes:t,updates:i}=s.editedFeatures,a=this.layer.objectIdField,o=i.map(e=>e.current),n=t.map(e=>"attributes"in e?{objectId:a?e.attributes[a]:null}:e),l=await this._resolveIdenifiers(n);return this._resolveOverrides({added:e,updated:o,removed:l,historicMoment:r,isWeak:!0,release:[]})}const[i,a,o]=await Promise.all([this._resolveIdenifiers(e.addedFeatures),this._resolveIdenifiers(e.updatedFeatures),this._resolveIdenifiers(e.deletedFeatures)]);return{type:"override-by-id",updates:[...i,...a],removed:o,historicMoment:r,isWeak:!0}}_canEditByFeature(e){const{adds:t,updates:r}=e.editedFeatures;return t.every(e=>this.view.spatialReference.equals(e.geometry?.spatialReference))&&r.every(e=>this.view.spatialReference.equals(e.current.geometry?.spatialReference))}async updateSchemaStart(){const e=this.layer;"featureReduction"in e&&e.featureReduction&&e.featureReduction!==this._lastFeatureReduction&&(e.featureReduction=e.featureReduction?.clone(),this._lastFeatureReduction=e.featureReduction);try{if(await Promise.allSettled([this._handleChange(),R(e)]),this.destroyed||!this.layerAdapter?.hasRequiredSupport||!this._subscriptions)return null;const t=this.featureContainer.updateStart("subtype-group"===e.type);this._lastFeatureEffect=this.featureEffect;const r={store:t,cimAnalyzer:this.view.stage.cimAnalyzer,cimResourceManager:this.view.stage.painter.textureManager.resourceManager,scaleExpression:void 0},s=await this._createViewSchemaConfig(),i={source:await this.layerAdapter.createSourceSchema(s,this._sourceRefreshVersion),processor:await this.layerAdapter.createProcessorSchema(r,s,this._displayRefreshVersion)};return c(this._lastSchema?.source.strategy,i.source.strategy)||c(this._lastSchema?.processor,i.processor)?(this._lastSchema=i,this._fields=null,i):null}catch(t){}return null}async updateSchemaEnd(e){try{this.featureEffectView.featureEffect=this._lastFeatureEffect,e&&this.featureEffectView.endTransition(),await this.featureContainer.updateEnd(this._lastSchema.processor,this.layerAdapter.getLabelingDeconflictionInfo(),e),has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D.updateEnd")}catch(t){}}async _doUpdate(){const e=Math.round(performance.now()),t=await this.getWorker();await t.pipeline.updateSchema(e),this.requestUpdate()}async _doOverride(e){const t=await this.getWorker();try{let r=new ne;for(const s of e.messages)switch(s.type){case"edit":r.tryAdd(await this._resolveEdit(s.event))||(await t.pipeline.onOverride(r.toMessage()),r=new ne,r.tryAdd(await this._resolveEdit(s.event)));break;case"override":r.tryAdd(this._resolveOverrides(s.options))||(await t.pipeline.onOverride(r.toMessage()),r=new ne,r.tryAdd(this._resolveOverrides(s.options)));break}await t.pipeline.onOverride(r.toMessage())}catch(r){m(r),0}}_getEffectiveAvailableFields(e){const t=me(this._lastAvailableFields,e);return this._lastAvailableFields=t,V(this.layer.fieldsIndex,t)}async _createViewSchemaConfig(){const e=this.requiresCurrentUser?await this.signedInUser:null,t=[E(this.view,this.layerAdapter,this.timeExtent,this._visibilityOverrides,this.filter,this.effectiveDisplayFilterClause),this.featureEffect?.filter?.toJSON()??null];return{availableFields:this._getEffectiveAvailableFields(this.availableFields),displayFilterEnabled:this.displayFilterEnabled,filters:t,scale:this.view.scale,timeZone:this.view.timeZone,timeExtent:this.view.timeExtent,currentUser:e,spatialReference:this.view.spatialReference,extent:this.view.extent,returnZ:this.hasZ,returnM:this.hasM}}_processHighlight(){this._commandsQueue.push({type:"highlight"})}async _updateHighlights(){const e=this._getHighlights(),t=await this.getWorker();if(this.destroyed)return;const r=t.pipeline.updateHighlight({highlights:e}).catch(e=>{m(e)||u.getLogger(this).error(e)});this._updatingHandles.consumePromise(r)}_setOriginForFeature(e){e.layer=e.sourceLayer=this.layer,this.layerAdapter.setGraphicOrigin(e)}_createFeatureGraphicHit(e,t){return this._setOriginForFeature(t),this._createGraphicHit(e,t)}_createTrackGraphicHit(e,t){return t.layer=t.sourceLayer=this.layer,this.layerAdapter.setTrackGraphicOrigin?.(t),this._createGraphicHit(e,t)}_createAggregateGraphicHit(e,t){return t.layer=t.sourceLayer=this.layer,this.layerAdapter.setAggregateGraphicOrigin?.(t),this._createGraphicHit(e,t)}_createGraphicHit(e,t){return null!=t.geometry&&(t.geometry.spatialReference=this.view.spatialReference),{type:"graphic",graphic:t,layer:this.layer,mapPoint:e}}};function E(e,t,r,s,i,a){i&&(i=i.clone());const o=null!=i?i.timeExtent:null,n=null!=r&&null!=o?r.intersection(o):r||o;n&&(i??=new U,i.timeExtent=n),i=t.addFilters?.(i,e)??i,a&&(i??=new U,i.where=v(i.where,a));let l=i?.toJSON()??null;return s.size&&(l??=(new U).toJSON(),l.hiddenIds=Array.from(s)),l}return e([b()],_.prototype,"_commandsQueue",void 0),e([b()],_.prototype,"_sourceRefreshVersion",void 0),e([b()],_.prototype,"_displayRefreshVersion",void 0),e([b({readOnly:!0})],_.prototype,"_pipelineUpdating",void 0),e([b()],_.prototype,"_sourceUpdating",void 0),e([b({readOnly:!0})],_.prototype,"dataUpdating",null),e([b({readOnly:!0})],_.prototype,"hasAllFeatures",null),e([b({readOnly:!0})],_.prototype,"hasAllFeaturesInView",null),e([b({readOnly:!0})],_.prototype,"hasFullGeometries",null),e([b()],_.prototype,"featureEffectView",void 0),e([b()],_.prototype,"layerAdapter",null),e([b({readOnly:!0})],_.prototype,"timeExtent",null),_=e([S("esri.views.2d.layers.FeatureLikeLayerView2D")],_),_};export{ve as FeatureLikeLayerView2D};
2
+ import{__decorate as e}from"tslib";import t from"../../../AggregateGraphic.js";import r from"../../../Graphic.js";import s from"../../../TrackGraphic.js";import{isSome as i}from"../../../core/arrayUtils.js";import a from"../../../core/Collection.js";import o from"../../../core/Error.js";import{makeHandle as n,handlesGroup as l}from"../../../core/handleUtils.js";import has from"../../../core/has.js";import u from"../../../core/Logger.js";import{destroyMaybe as h}from"../../../core/maybe.js";import{notDeepEqual as c}from"../../../core/object.js";import{createAbortError as p,ignoreAbortErrors as d,throwIfNotAbortError as y,isAbortError as m}from"../../../core/promiseUtils.js";import{watch as g,sync as f}from"../../../core/reactiveUtils.js";import{isScreenRect as w}from"../../../core/screenUtils.js";import{sqlAnd as v}from"../../../core/sql.js";import{getMetersPerUnitForSR as _}from"../../../core/units.js";import{property as b,subclass as S}from"../../../core/accessorSupport/decorators.js";import{UpdatingHandles as A}from"../../../core/support/UpdatingHandles.js";import F from"../../../geometry/Extent.js";import{fromJSON as j}from"../../../geometry/support/jsonUtils.js";import x from"../../../geometry/support/rotate.js";import{isCurvedGeometry as E}from"../../../geometry/support/curves/curveUtils.js";import{densifyCurvedGeometry as I}from"../../../geometry/support/curves/densifyCurvedGeometry.js";import k from"../../../layers/effects/FeatureEffectView.js";import{convertFromFeature as O}from"../../../layers/graphics/featureConversionUtils.js";import U from"../../../layers/support/FeatureFilter.js";import{checkServiceCurrentUserSupport as R}from"../../../layers/support/featureLayerUtils.js";import{packFields as V}from"../../../layers/support/fieldUtils.js";import{getEffectiveLayerCapabilities as C}from"../../../layers/support/layerUtils.js";import{combineTimeExtent as Q}from"../../../layers/support/timeSupport.js";import q from"../../../rest/support/AggregateFeatureSet.js";import M from"../../../rest/support/AttributeBinsFeatureSet.js";import H from"../../../rest/support/AttributeBinsQuery.js";import P from"../../../rest/support/FeatureSet.js";import L from"../../../rest/support/Query.js";import{HittestDrawHelper as T}from"../../../symbols/cim/CIMSymbolDrawHelper.js";import{symbolToCIM as W}from"../../../symbols/cim/CIMSymbolHelper.js";import{getDisplayedSymbol as D}from"../../../symbols/support/symbolUtils.js";import{LayerView2D as G}from"./LayerView2D.js";import{FeatureContainer as N}from"./features/FeatureContainer.js";import{createFeaturePipelineWorkerProxy as J}from"./features/FeaturePipelineWorkerProxy.js";import{FeatureSourceEventLog as z}from"./features/FeatureSourceEventLog.js";import{AnnotationLayerAdapter as B}from"./features/layerAdapters/AnnotationLayerAdapter.js";import{CatalogFootprintLayerAdapter as Z}from"./features/layerAdapters/CatalogFootprintLayerAdapter.js";import{DimensionLayerAdapter as K}from"./features/layerAdapters/DimensionLayerAdapter.js";import{FeatureLayerAdapter as $}from"./features/layerAdapters/FeatureLayerAdapter.js";import{createFeatureIdInfo as X}from"./features/layerAdapters/featureServiceUtils.js";import{InMemoryLayerAdapter as Y}from"./features/layerAdapters/InMemoryLayerAdapter.js";import{KnowledgeGraphSublayerAdapter as ee}from"./features/layerAdapters/KnowledgeGraphSublayerAdapter.js";import{OGCFeatureLayerAdapter as te}from"./features/layerAdapters/OGCFeatureLayerAdapter.js";import{OrientedImageryLayerAdapter as re}from"./features/layerAdapters/OrientedImageryLayerAdapter.js";import{ParquetLayerAdapter as se}from"./features/layerAdapters/ParquetLayerAdapter.js";import{StreamLayerAdapter as ie}from"./features/layerAdapters/StreamLayerAdapter.js";import{SubtypeGroupLayerAdapter as ae}from"./features/layerAdapters/SubtypeGroupLayerAdapter.js";import{createComplexSymbolInstances as oe}from"./features/schema/processor/symbols/ComplexSymbolSchema.js";import{DebouncedFeatureOverride as ne}from"./support/DebouncedFeatureOverride.js";import{FeatureCommandQueue as le}from"./support/FeatureCommandQueue.js";import{handleNoEngineError as ue}from"./support/handleNoEngineError.js";import{toJSONGeometryType as he}from"./support/util.js";import{getMapPointsFromScreen as ce}from"../support/hitTestUtils.js";import{FeatureTileSubscriptionManager as pe}from"../tiling/FeatureTileSubscriptionManager.js";import{RefreshableLayerView as de}from"../../layers/RefreshableLayerView.js";import{getHighlightName as ye}from"../../support/highlightOptionsUtils.js";function me(e,t){const r=new Set;return e&&e.forEach(e=>r.add(e)),t&&t.forEach(e=>r.add(e)),r.has("*")?["*"]:Array.from(r)}const ge=4294967294;function fe(e,t){return l(e.map(e=>g(()=>{const t=e();return t&&"object"==typeof t?"getTime"in t&&"function"==typeof t.getTime?t.getTime():JSON.stringify(t):t},t,f)))}function we(e){if(!e.geometry)return e;if(!E(e.geometry))return e;const t=.001/_(e.geometry.spatialReference),r=100;return{geometry:I(e.geometry,{maxSegmentsPerCurve:12e3,maxSegmentLength:r*t,maxDeviation:0}),attributes:e.attributes}}const ve=l=>{const f=de(G(l));let _=class extends f{constructor(){super(...arguments),this._commandsQueue=new le({process:e=>{switch(e.type){case"override-batch":return this._doOverride(e);case"update":return this._doUpdate();case"highlight":return this._updateHighlights()}}}),this._visibilityOverrides=new Set,this._lastAvailableFields=[],this._lastTargetState=null,this.eventLog=new z,this._sourceRefreshVersion=1,this._displayRefreshVersion=1,this._pipelineUpdating=!1,this._editUpdatingHandles=new A,this._fields=null,this._hittestDrawHelper=null,this._sourceUpdating=!1,this.featureEffectView=new k}destroy(){this._editUpdatingHandles.destroy(),this._workerProxy?.destroy(),this._workerAttached.reject(p()),this._commandsQueue.destroy(),this._hittestDrawHelper?.destroy()}initialize(){this._workerAttached=Promise.withResolvers(),d(this._workerAttached.promise),this.addResolvingPromise(this._initProxy()),this.featureEffectView.featureEffect=this.featureEffect,this.featureEffectView.endTransition()}async _initProxy(){const e=this.layer;if("isTable"in e&&e.isTable)throw new o("featurelayerview:table-not-supported","table feature layer can't be displayed",{layer:e});if(("feature"===e.type||"subtype-group"===e.type)&&!1===C(e)?.operations.supportsQuery)throw new o("featurelayerview:query-not-supported","layer view requires a layer with query capability",{layer:e});this._workerProxy&&this._workerProxy.destroy();const t=this._createClientOptions();this._workerProxy=await J(t)}async _attachProxy(){const e=x(this.view.extent,this.view.rotation,this.view.center),t={tileInfoJSON:this.view?.featuresTilingScheme?.tileInfo?.toJSON(),initialViewExtent:e.toJSON()};try{await this._workerProxy.pipeline.onAttach(t),this._workerAttached.resolve()}catch(r){this._workerAttached.reject(p()),y(r)}}async _detachProxy(){return this._workerProxy.pipeline.onDetach()}async getWorker(){return await this._workerAttached.promise,this._workerProxy}get dataUpdating(){return this._sourceUpdating||this._editUpdatingHandles.updating}get hasAllFeatures(){return this.layer.visible&&!this.suspended&&this.eventLog.hasAllData&&this.eventLog.willQueryAllFeatures}get hasAllFeaturesInView(){const e=this.effectiveDisplayFilter?.where||null,t=!this.eventLog.willQueryAllFeatures&&null!=e&&"1=1"!==e;return this.layer.visible&&!this.suspended&&this.eventLog.hasAllData&&!t}get hasFullGeometries(){return this.layer.visible&&!this.suspended&&this.eventLog.hasAllData&&this.eventLog.willQueryFullResolutionGeometry}get layerAdapter(){switch(this.layer.type){case"annotation-feature":return new B(this.layer);case"dimension-feature":return new K(this.layer);case"feature":return"memory"===this.layer.source.type?new Y(this.layer):new $(this.layer);case"geojson":case"csv":case"wfs":return new Y(this.layer);case"parquet":return new se(this.layer);case"subtype-group":return new ae(this.layer);case"ogc-feature":return new te(this.layer);case"stream":return new ie(this.layer);case"oriented-imagery":return new re(this.layer);case"knowledge-graph-sublayer":return new ee(this.layer);case"catalog-footprint":return new Z(this.layer);default:this.layer}return null}get timeExtent(){return Q(this.layerAdapter.timeOptions,this.view?.timeExtent,this._get("timeExtent"))}get usedMemory(){return this.container.usedMemory+this.eventLog.pipelineStatistics.usedMemory}getDisplayStatistics(e,t){return this.featureContainer?.getDisplayStatistics(e,t)}highlight(e,t){let s;e instanceof r?s=[e.getObjectId()]:"number"==typeof e||"string"==typeof e?s=[e]:a.isCollection(e)&&e.length>0?s=e.map(e=>e?.getObjectId()).toArray():Array.isArray(e)&&e.length>0&&(s="number"==typeof e[0]||"string"==typeof e[0]?e:e.map(e=>e?.getObjectId()));const o=s?.filter(i);if(!o?.length)return n();const l=ye(t);return this._addHighlights(o,l),n(()=>!this.destroyed&&this._removeHighlights(o,l))}async hitTest(e,i){const a=w(i),{trueHitIds:o,candidateHitIds:n}=await this.featureContainer.hitTest(i),l=await this.getWorker(),[u,h]=await Promise.all([l.pipeline.getDisplayFeatures(n),l.pipeline.getDisplayFeatures(o)]),{features:c,aggregates:p,tracks:d}=u,{features:y,aggregates:g,tracks:f}=h,v=[];if(a&&this.hasRenderer()){const e=new Map,t=new r;for(const r of c){t.attributes=r.attributes,t.geometry=j(r.geometry),t.symbol=null;const s=this.layerAdapter.getRenderer(t);if(!s){v.push(r);continue}const i=await D(t,{renderer:s,scale:this.view.scale,resolution:this.view.resolution,spatialReference:this.view.spatialReference,viewingMode:"2d",timeZone:this.view.timeZone});if(!i)continue;let a=null;const o=W(i);if("web-style"===o.type)try{const e=W(await o.fetchSymbol({acceptedFormats:["cim","web"]}));a="web-style"===e.type?null:e}catch(x){m(x),0;continue}else a=o;const n=a?.symbol;if(!n)continue;const l=this.view.stage.cimAnalyzer.analyzeSymbolReference(a,!1).some(e=>"alignment"in e&&0===e.alignment);e.set(r,{cimSymbol:n,isScreenAligned:l})}e.size>0&&!this._hittestDrawHelper&&(this._hittestDrawHelper=new T(this.view.stage.painter.textureManager.resourceManager));const{resolution:s,rotation:a}=this.view.state,o=ce(this.view,i);for(const[r,{cimSymbol:i,isScreenAligned:n}]of e){if(!r)continue;const e={hittestType:"rect",textInfo:null,mapRotation:a,resolution:s,searchDist:0,isScreenAligned:n};this._hittestDrawHelper.hitTest(o,i,r.geometry,e)&&v.push(r)}}else v.push(...c);const _=[...y,...v],b=[...g,...p],S=[...f,...d],A=this.featureContainer.getSortKeys(_.map(e=>e.displayId)),F=({displayId:e},{displayId:t})=>A.has(e)&&A.has(t)?A.get(e)-A.get(t):e-t;return _.sort(F).reverse(),b.sort(F).reverse(),[...b.map(r=>this._createAggregateGraphicHit(e,t.fromJSON(r))),...S.map(t=>this._createTrackGraphicHit(e,s.fromJSON(t))),..._.map(t=>this._createFeatureGraphicHit(a?null:e,r.fromJSON(t)))]}async queryAggregateSummaryStatistics(e,t,r){const s={...t,scale:this.view.scale},i=(await this.getWorker()).aggregates.executeQueryForSummaryStatistics(this._cleanUpAggregateQuery(e),s,r);return ue(i,{})}async queryUniqueValues(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.features.executeQueryForUniqueValues(this._cleanUpQuery(e),i,r);return ue(a,{uniqueValueInfos:[]})}async queryAggregateUniqueValues(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.aggregates.executeQueryForUniqueValues(this._cleanUpAggregateQuery(e),i,r);return ue(a,{uniqueValueInfos:[]})}async queryAggregateClassBreaks(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.aggregates.executeQueryForClassBreaks(this._cleanUpAggregateQuery(e),i,r);return ue(a,{classBreakInfos:[]})}async queryHistogram(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.features.executeQueryForHistogram(this._cleanUpQuery(e),i,r);return ue(a,{bins:[],maxValue:null,minValue:null,normalizationTotal:null})}async queryAggregateCount(e,t){const r=(await this.getWorker()).aggregates.executeQueryForCount(this._cleanUpAggregateQuery(e),t);return ue(r,0)}async queryAggregateHistogram(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.aggregates.executeQueryForHistogram(this._cleanUpAggregateQuery(e),i,r);return ue(a,{bins:[],maxValue:null,minValue:null,normalizationTotal:null})}async queryAggregateIds(e,t){const r=(await this.getWorker()).aggregates.executeQueryForIds(this._cleanUpAggregateQuery(e),t);return ue(r,[])}async queryAggregateJSON(e,t){const r=(await this.getWorker()).aggregates.executeQuery(this._cleanUpAggregateQuery(e),t);return ue(r,{features:[]})}async queryAttributeBins(e,t){const r=(await this.getWorker()).features.executeAttributeBinsQuery(this._cleanUpAttributeBinsQuery(e),t),s=await ue(r,{features:[]});return M.fromJSON(s)}async queryAggregates(e,t){const r=(await this.getWorker()).aggregates.executeQuery(this._cleanUpAggregateQuery(e),t),s=await ue(r,{features:[]}),i=q.fromJSON(s);return i.features.forEach(e=>this.layerAdapter.setAggregateGraphicOrigin?.(e)),i}async queryClassBreaks(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.features.executeQueryForClassBreaks(this._cleanUpQuery(e),i,r);return ue(a,{classBreakInfos:[]})}async queryExtent(e,t){const r=(await this.getWorker()).features.executeQueryForExtent(this._cleanUpQuery(e),t),s=await ue(r,{count:0,extent:null});return{count:s.count,extent:F.fromJSON(s.extent)}}async queryFeatureCount(e,t){const r=(await this.getWorker()).features.executeQueryForCount(this._cleanUpQuery(e),t);return ue(r,0)}queryFeatures(e,t){return this.queryFeaturesJSON(e,t).then(e=>{const t=P.fromJSON(e);return t.features.forEach(e=>this._setOriginForFeature(e)),t})}async queryFeaturesJSON(e,t){const r=(await this.getWorker()).features.executeQuery(this._cleanUpQuery(e),t);return ue(r,{features:[]})}async queryHeatmapStatistics(e){return(await this.getWorker()).pipeline.queryHeatmapStatistics(e)}async queryObjectIds(e,t){const r=(await this.getWorker()).features.executeQueryForIds(this._cleanUpQuery(e),t);return ue(r,[])}async queryStatistics(){const e=await this.getWorker();return ue(e.pipeline.queryStatistics(),{featureCount:0,ringCount:0,vertexCount:0})}async querySummaryStatistics(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.features.executeQueryForSummaryStatistics(this._cleanUpQuery(e),i,r);return ue(a,{})}async queryVisibleFeatures(e,t){const r=(await this.getWorker()).pipeline.queryVisibleFeatures(this._cleanUpQuery(e),t),s=await ue(r,{features:[]}),i=P.fromJSON(s);return i.features.forEach(e=>this._setOriginForFeature(e)),i}async getSampleFeatures(e){return(await this.getWorker()).pipeline.getSampleFeatures(e)}setVisibility(e,t){t?this._visibilityOverrides.delete(e):this._visibilityOverrides.add(e),this._update()}update(e){if(!this._subscriptions)return;this.view.animation&&!this._lastTargetState&&(this._lastTargetState=e.state.clone()),!this.view.animation&&this._lastTargetState&&(this._lastTargetState=null);const t=this.featureContainer.getPresenting(),r=this._subscriptions.update(e.targetState,this._lastTargetState,t);r&&(this.featureContainer.updateSubscriptions(r),d(this._updatingHandles.addPromise(this.getWorker().then(e=>e.pipeline.updateSubscriptions(r))))),this._subscriptions.coverage&&this.featureContainer.setCoverage(this._subscriptions.coverage)}attach(){has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D.attach"),d(this._updatingHandles.addPromise(this._workerAttached.promise)),d(this._attachProxy()),this.featureContainer=new N(this),this.container.addChild(this.featureContainer),this.view.timeline.record(`${this.layer.title} (FeatureLayer) Attach`),this._subscriptions=new pe(this.view.featuresTilingScheme),this.requestUpdate(),this.addAttachHandles([fe([()=>this._displayRefreshVersion,()=>"displayFilterInfo"in this.layer&&this.layer.displayFilterInfo,()=>this.timeExtent,()=>this.clips,()=>this.filter,()=>this.effectiveDisplayFilterClause,()=>this.featureEffect,()=>this._sourceRefreshVersion,()=>this.view.timeZone,()=>this.view.timeExtent,...this.layerAdapter.getUpdateHashProperties(this.view)],()=>this._update()),g(()=>this.updateSuspended,e=>{e||this._subscriptions.resume(this.featureContainer.getPresenting())}),g(()=>this.view.stationary,async e=>{if(e){const e=await this.getWorker(),t=x(this.view.extent,this.view.rotation,this.view.center);e.pipeline.updateStationaryExtent(t.toJSON(),this.featureContainer.requiresRefresh).catch(()=>{})}})]),this._update(),"stream"!==this.layer.type&&"parquet"!==this.layer.type&&"catalog-footprint"!==this.layer.type&&this.addAttachHandles(this.layer.on("edits",e=>this._editUpdatingHandles.addPromise(this._edit(e))))}detach(){has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D.detach"),this._detachProxy(),this._fields=null,this.featureContainer.destroy(),this.featureContainer=null,this._commandsQueue.clear(),this.container.removeAllChildren(),this._subscriptions=h(this._subscriptions),this._workerProxy.pipeline.onDetach(),this._workerAttached=Promise.withResolvers(),d(this._workerAttached.promise),this._lastAvailableFields=[],this._lastSchema=null}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}addOverrides(e){return this._commandsQueue.push({type:"override",options:{...e,release:[]}})}removeOverrides(e){for(const r of e)if(null==r)throw new o("featurelayerview:bad-override","Tried to remove an override for an invalid objectId",{objectId:r});const t={added:[],updated:[],removed:[],release:e,isWeak:!1,historicMoment:null};return this._commandsQueue.push({type:"override",options:t})}onProxyClientEvent(e){}hasRenderer(){return"renderer"in this.layer&&null!=this.layer.renderer}isUpdating(){const e=this.hasRenderer(),t=this._commandsQueue.updateTracking.updating,r=null!=this._updatingRequiredPromise,s=this.featureContainer.updating;return this.updateRequested||e&&(t||r)||s||this._pipelineUpdating||this.dataUpdating}_createClientOptions(){const e=this;return{updateSchemaStart:()=>e.updateSchemaStart(),updateSchemaEnd:t=>e.updateSchemaEnd(t),openMemoryPorts:async()=>{if(this.layerAdapter?.openMessagePorts){const e=await this.layerAdapter.openMessagePorts();return{result:e,transferList:e}}throw new Error("InternalError: Layer adapter does not support opening message ports")},get container(){return e.featureContainer},setUpdating:e=>{this._set("_pipelineUpdating",e.pipeline),this._set("_sourceUpdating",e.source)},emitEvent:e=>{this.onProxyClientEvent(e)},get eventLog(){return e.eventLog},fetch:async t=>{if(has("esri-2d-stabilize-glyphs")){const r=[];for(const s of t)r.push(await e.view.stage.painter.textureManager.rasterizeItem(s));return r}return Promise.all(t.map(t=>e.view.stage.painter.textureManager.rasterizeItem(t)))},fetchDictionary:e=>Promise.all(e.map(e=>this._fetchDictionaryRequest(e))),fetchMesh:e=>Promise.all(e.map(e=>this._fetchMeshRequest(e)))}}async _fetchDictionaryRequest(e){try{if(!("renderer"in this.layer)||!this.layer.renderer||"dictionary"!==this.layer.renderer.type)throw new Error("InternalError: Expected renderer to be of type 'dictionary'");const t=this.layer.renderer,r=this._lastSchema.processor.mesh.factory.symbology;if("dictionary"!==r.type)throw new Error("InternalError: Expected schema to be of type 'dictionary'");const s={cimAnalyzer:this.view.stage.cimAnalyzer,cimResourceManager:this.view.stage.painter.textureManager.resourceManager,store:this.featureContainer.instanceStore,scaleExpression:r.scaleExpression};this._fields||(this._fields=this.layer.fields.map(e=>e.toJSON()));const i=r.visualVariableUniforms,a=he(this.layer.geometryType),o=await t.getSymbolForControlString(e.controlString,a,!1);if(!o||!o.data)return{type:"dictionary-response",meshes:[]};return{type:"dictionary-response",meshes:await oe({...o.data,hasTextStringTemplates:!0},{uniforms:i,path:"renderer",schemaOptions:s})}}catch(t){return{type:"dictionary-response",meshes:[]}}}async _fetchMeshRequest(e){const{layer:t}=this;try{const r={cimAnalyzer:this.view.stage.cimAnalyzer,cimResourceManager:this.view.stage.painter.textureManager.resourceManager,store:this.featureContainer.instanceStore,scaleExpression:null};this._fields||(this._fields=t.fields.map(e=>e.toJSON()));return{type:"mesh-response",meshes:await oe({...e.symbolReference,hasTextStringTemplates:!0},{path:"anno-like",schemaOptions:r,uniforms:{visualVariableColor:null,visualVariableOpacity:null,visualVariableRotation:null,visualVariableSizeStops:null,visualVariableSizeScaleStops:null,visualVariableSizeOutlineScaleStops:null,visualVariableSizeUnitValue:null,visualVariableSizeMinMaxValue:null}})}}catch(r){return{type:"mesh-response",meshes:[]}}}_cleanUpQuery(e){const t=L.from(e)||this.createQuery();return t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference),"returnZ"in this.layer&&(t.returnZ??=this.layer.returnZ),"returnM"in this.layer&&(t.returnM??=this.layer.returnM),t.toJSON()}_cleanUpAttributeBinsQuery(e){const t=H.from(e);return t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference),t.toJSON()}_cleanUpAggregateQuery(e){const t=L.from(e)||this.createAggregateQuery();t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference);const r=t.objectIds??[];for(const s of t.aggregateIds??[])r.push(s);return t.objectIds=r,t.aggregateIds=[],t.toJSON()}async _update(){return this._commandsQueue.push({type:"update"})}_edit(e){return this._commandsQueue.push({type:"edit",event:e})}async doRefresh(e){this.attached&&(this.updateSuspended&&e||(e?this.incrementSourceRefreshVersion():this.incrementDisplayRefreshVersion()))}incrementSourceRefreshVersion(){this._sourceRefreshVersion=(this._sourceRefreshVersion+1)%ge+1}incrementDisplayRefreshVersion(){this._displayRefreshVersion=(this._displayRefreshVersion+1)%ge+1}async _resolveIdenifiers(e){const t=[],r=[];for(const a of e)null==a.objectId||-1===a.objectId?null==a.globalId?u.getLogger(this).warn("mapview-apply-edits","A feature identifier must contain either a GlobalId or ObjectId. Ignoring",{identifier:a}):r.push(a.globalId):t.push(a.objectId);const s="globalIdField"in this.layer&&this.layer.globalIdField,i=s&&this.availableFields.includes(s);if(r.length&&!i)return u.getLogger(this).error(new o("mapview-apply-edits",`Editing the specified service requires the layer's globalIdField, ${s} to be included the layer's outFields for updates to be reflected on the map`)),t;if(r.length){const e=await this._workerProxy.pipeline.getObjectIdsFromGlobalIds(r);for(const r of e)t.push(r)}return t}_resolveOverrides(e){const t=!1,r=!1,s=he(this.layer.geometryType),i=X(this.layer),a=[];for(const n of e.added){const e=O(we(n),s,t,r,i);if(null==e.objectId)throw new o("featurelayerview:bad-override","Feature does not have an objectId",{feature:n});a.push(e)}for(const n of e.updated){const e=O(we(n),s,t,r,i);if(null==e.objectId)throw new o("featurelayerview:bad-override","Feature does not have an objectId",{feature:n});a.push(e)}for(const n of e.removed)if(null==n)throw new o("featurelayerview:bad-override","Tried to remove an invalid objectId",{objectId:n});return{type:"override",updates:a,removed:e.removed,release:e.release,isWeak:e.isWeak??!1,historicMoment:e.historicMoment??null}}async _resolveEdit(e){const t=this.layer,r=e.historicMoment?.getTime()??null,s="layerId"in t&&e.editedFeatures?.find(e=>e.layerId===t.layerId);if(s&&this._canEditByFeature(s)){const{adds:e,deletes:t,updates:i}=s.editedFeatures,a=this.layer.objectIdField,o=i.map(e=>e.current),n=t.map(e=>"attributes"in e?{objectId:a?e.attributes[a]:null}:e),l=await this._resolveIdenifiers(n);return this._resolveOverrides({added:e,updated:o,removed:l,historicMoment:r,isWeak:!0,release:[]})}const[i,a,o]=await Promise.all([this._resolveIdenifiers(e.addedFeatures),this._resolveIdenifiers(e.updatedFeatures),this._resolveIdenifiers(e.deletedFeatures)]);return{type:"override-by-id",updates:[...i,...a],removed:o,historicMoment:r,isWeak:!0}}_canEditByFeature(e){const{adds:t,updates:r}=e.editedFeatures;return t.every(e=>this.view.spatialReference.equals(e.geometry?.spatialReference))&&r.every(e=>this.view.spatialReference.equals(e.current.geometry?.spatialReference))}async updateSchemaStart(){const e=this.layer;"featureReduction"in e&&e.featureReduction&&e.featureReduction!==this._lastFeatureReduction&&(e.featureReduction=e.featureReduction?.clone(),this._lastFeatureReduction=e.featureReduction);try{if(await Promise.allSettled([this._handleChange(),R(e)]),this.destroyed||!this.layerAdapter?.hasRequiredSupport||!this._subscriptions)return null;const t=this.featureContainer.updateStart("subtype-group"===e.type);this._lastFeatureEffect=this.featureEffect;const r={store:t,cimAnalyzer:this.view.stage.cimAnalyzer,cimResourceManager:this.view.stage.painter.textureManager.resourceManager,scaleExpression:void 0},s=await this._createViewSchemaConfig(),i={source:await this.layerAdapter.createSourceSchema(s,this._sourceRefreshVersion),processor:await this.layerAdapter.createProcessorSchema(r,s,this._displayRefreshVersion)};return c(this._lastSchema?.source.strategy,i.source.strategy)||c(this._lastSchema?.processor,i.processor)?(this._lastSchema=i,this._fields=null,i):null}catch(t){}return null}async updateSchemaEnd(e){try{this.featureEffectView.featureEffect=this._lastFeatureEffect,e&&this.featureEffectView.endTransition(),await this.featureContainer.updateEnd(this._lastSchema.processor,this.layerAdapter.getLabelingDeconflictionInfo(),e),has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D.updateEnd")}catch(t){}}async _doUpdate(){const e=Math.round(performance.now()),t=await this.getWorker();await t.pipeline.updateSchema(e),this.requestUpdate()}async _doOverride(e){const t=await this.getWorker();try{let r=new ne;for(const s of e.messages)switch(s.type){case"edit":r.tryAdd(await this._resolveEdit(s.event))||(await t.pipeline.onOverride(r.toMessage()),r=new ne,r.tryAdd(await this._resolveEdit(s.event)));break;case"override":r.tryAdd(this._resolveOverrides(s.options))||(await t.pipeline.onOverride(r.toMessage()),r=new ne,r.tryAdd(this._resolveOverrides(s.options)));break}await t.pipeline.onOverride(r.toMessage())}catch(r){m(r),0}}_getEffectiveAvailableFields(e){const t=me(this._lastAvailableFields,e);return this._lastAvailableFields=t,V(this.layer.fieldsIndex,t)}async _createViewSchemaConfig(){const e=this.requiresCurrentUser?await this.signedInUser:null,t=[E(this.view,this.layerAdapter,this.timeExtent,this._visibilityOverrides,this.filter,this.effectiveDisplayFilterClause),this.featureEffect?.filter?.toJSON()??null];return{availableFields:this._getEffectiveAvailableFields(this.availableFields),displayFilterEnabled:this.displayFilterEnabled,filters:t,scale:this.view.scale,timeZone:this.view.timeZone,timeExtent:this.view.timeExtent,currentUser:e,spatialReference:this.view.spatialReference,extent:this.view.extent,returnZ:this.hasZ,returnM:this.hasM}}_processHighlight(){this._commandsQueue.push({type:"highlight"})}async _updateHighlights(){const e=this._getHighlights(),t=await this.getWorker();if(this.destroyed)return;const r=t.pipeline.updateHighlight({highlights:e}).catch(e=>{m(e)||u.getLogger(this).error(e)});this._updatingHandles.consumePromise(r)}_setOriginForFeature(e){e.layer=e.sourceLayer=this.layer,this.layerAdapter.setGraphicOrigin(e)}_createFeatureGraphicHit(e,t){return this._setOriginForFeature(t),this._createGraphicHit(e,t)}_createTrackGraphicHit(e,t){return t.layer=t.sourceLayer=this.layer,this.layerAdapter.setTrackGraphicOrigin?.(t),this._createGraphicHit(e,t)}_createAggregateGraphicHit(e,t){return t.layer=t.sourceLayer=this.layer,this.layerAdapter.setAggregateGraphicOrigin?.(t),this._createGraphicHit(e,t)}_createGraphicHit(e,t){return null!=t.geometry&&(t.geometry.spatialReference=this.view.spatialReference),{type:"graphic",graphic:t,layer:this.layer,mapPoint:e}}};function E(e,t,r,s,i,a){i&&(i=i.clone());const o=null!=i?i.timeExtent:null,n=null!=r&&null!=o?r.intersection(o):r||o;n&&(i??=new U,i.timeExtent=n),i=t.addFilters?.(i,e)??i,a&&(i??=new U,i.where=v(i.where,a));let l=i?.toJSON()??null;return s.size&&(l??=(new U).toJSON(),l.hiddenIds=Array.from(s)),l}return e([b()],_.prototype,"_commandsQueue",void 0),e([b()],_.prototype,"_sourceRefreshVersion",void 0),e([b()],_.prototype,"_displayRefreshVersion",void 0),e([b({readOnly:!0})],_.prototype,"_pipelineUpdating",void 0),e([b()],_.prototype,"_sourceUpdating",void 0),e([b({readOnly:!0})],_.prototype,"dataUpdating",null),e([b({readOnly:!0})],_.prototype,"hasAllFeatures",null),e([b({readOnly:!0})],_.prototype,"hasAllFeaturesInView",null),e([b({readOnly:!0})],_.prototype,"hasFullGeometries",null),e([b()],_.prototype,"featureEffectView",void 0),e([b()],_.prototype,"layerAdapter",null),e([b({readOnly:!0})],_.prototype,"timeExtent",null),_=e([S("esri.views.2d.layers.FeatureLikeLayerView2D")],_),_};export{ve as FeatureLikeLayerView2D};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import i from"../../../Graphic.js";import{isSome as e}from"../../../core/arrayUtils.js";import s from"../../../core/Collection.js";import{makeHandle as r}from"../../../core/handleUtils.js";import"../../../core/has.js";import{QueueProcessor as h}from"../../../core/QueueProcessor.js";import{watch as a,sync as o}from"../../../core/reactiveUtils.js";import{isScreenRect as n}from"../../../core/screenUtils.js";import{property as l,subclass as g}from"../../../core/accessorSupport/decorators.js";import{convertGeometryToMask as p}from"../../../layers/raster/functions/clipUtils.js";import{GraphicsCollection as c}from"../../../support/GraphicsCollection.js";import d from"../engine/flow/FlowView2D.js";import{LayerView2D as u}from"./LayerView2D.js";import m from"./graphics/GraphicsView2D.js";import w from"./graphics/HighlightGraphicContainer.js";import y from"./imagery/ImageryView2D.js";import f from"./imagery/VectorFieldView2D.js";import v from"../../layers/ImageryLayerView.js";import{RefreshableLayerView as _}from"../../layers/RefreshableLayerView.js";import{isPixelHighlightTarget as b,isEmptyPixelRanges as x}from"../../layers/support/highlightUtils.js";import{defaultColor as H}from"../../support/HighlightDefaults.js";import{getHighlightName as V}from"../../support/highlightOptionsUtils.js";let j=class extends(_(u(v))){constructor(){super(...arguments),this._exportImageVersion=-1,this._highlightGraphics=new c,this._highlightView=void 0,this._pixelHighlights=[],this.layer=null,this.subview=null}get pixelData(){const{subview:t}=this;return this.updating||!t?null:"getPixelData"in t?t.getPixelData():null}update(t){this.subview?.update(t)}attach(){this.layer.increaseRasterJobHandlerUsage(),this._setSubView(),this.view&&(this._highlightView=new m({view:this.view,graphics:this._highlightGraphics,requestUpdateCallback:()=>this.requestUpdate(),container:new w(this.view.featuresTilingScheme)}),this.container.addChild(this._highlightView.container)),this.addAttachHandles([a(()=>this.layer.exportImageServiceParameters.version,t=>{t&&this._exportImageVersion!==t&&(this._exportImageVersion=t,this.requestUpdate())},o),a(()=>this.timeExtent,t=>{const{subview:i}=this;i&&(i.timeExtent=t,"redraw"in i?this.requestUpdate():i.redrawOrRefetch())},o),this.layer.on("redraw",()=>{const{subview:t}=this;t&&("redraw"in t?t.redraw():t.redrawOrRefetch())}),a(()=>this.layer.renderer,()=>this._setSubView()),a(()=>this.view.highlights.items.map(({name:t,color:i})=>({name:t,color:i})),()=>this._updateHighlightOptions(this.subview))])}detach(){this.layer.decreaseRasterJobHandlerUsage(),this.container.removeAllChildren(),this._detachSubview(this.subview),this.subview?.destroy(),this.subview=null,this._highlightView?.destroy(),this._exportImageVersion=-1}viewChange(){}moveEnd(){this.requestUpdate()}async hitTest(t,i){const{layer:e,subview:s}=this;if(!e.loaded||!this.attached||!s?.attached)return null;n(i)&&(t=this.view.toMap({x:i.x+i.width/2,y:i.y+i.height/2}));const r=await s.hitTest(t);return null==r?null:[{type:"raster",layer:e,mapPoint:t,...r}]}highlight(t,h){if(b(t))return x(t)?r():this._highlightPixels(t,h);if("number"==typeof t||"string"==typeof t)return this._highlightByImageIds([t],h);const a=Array.isArray(t)||s.isCollection(t)?t.at(0):t;if("number"==typeof a||"string"==typeof a)return this._highlightByImageIds(t,h);if(!(a instanceof i))return r();let o=[];Array.isArray(t)||s.isCollection(t)?o=t.map(t=>t.clone()):t instanceof i&&(o=[t.clone()]);const n=o?.filter(e);if(!n?.length)return r();const l=V(h);return this._addHighlightGraphics(o,l),r(()=>!this.destroyed&&this._removeHighlightGraphics(o,l))}_highlightByImageIds(t,i){const e=V(i),s=new AbortController,{signal:a}=s,o=this.layer.sourceJSON.maxRecordCount??1e3,n=Math.ceil(t.length/o),l=[],g=[],p=new h({concurrency:4,process:t=>this.layer.queryFeatures({objectIds:t.ids,returnGeometry:!0,outSpatialReference:this.view.spatialReference},{signal:a}).then(t=>g.push(...t.features)).catch(()=>{})});for(let r=0;r<n;r++)l.push(p.push({ids:t.slice(r*o,(r+1)*o)}));return Promise.allSettled(l).then(()=>{g.length&&!a.aborted&&(this._addHighlightGraphics(g,e),a.addEventListener("abort",()=>{this._removeHighlightGraphics(g,e)}))}),r(()=>s.abort())}_highlightPixels(t,i){const e={target:t,options:i};return this._pixelHighlights.push(e),this._updateHighlightOptions(this.subview),r(()=>{const t=this._pixelHighlights.indexOf(e);t>-1&&(this._pixelHighlights.splice(t,1),this._updateHighlightOptions(this.subview))})}_addHighlightGraphics(t,i){this._highlightGraphics.addMany(t),this._addHighlights(t.map(t=>t.uid),i)}_removeHighlightGraphics(t,i){this._highlightGraphics.removeMany(t),this._removeHighlights(t.map(t=>t.uid),i)}async doRefresh(){this.requestUpdate()}isUpdating(){return!this.subview||this.subview.updating||!!this._highlightView?.updating}_processHighlight(){const t=this._getHighlights();this._highlightView?.setHighlight(t)}_setSubView(){if(!this.view)return;const t=this.layer.renderer?.type;let i="imagery";if("vector-field"===t?i="imageryVF":"flow"===t&&(i="flow"),this.subview){const{type:t}=this.subview;if(t===i)return this._attachSubview(this.subview),void("flow"===t?this.subview.redrawOrRefetch():"imagery"===t&&"lerc"===this.layer.format?this.subview.redraw():this.requestUpdate());this._detachSubview(this.subview),this.subview?.destroy()}"imagery"===i?(this.subview=new y({layer:this.layer,view:this.view,timeExtent:this.timeExtent,updatingHandles:this._updatingHandles}),this._updateHighlightOptions(this.subview)):this.subview="imageryVF"===i?new f({layer:this.layer,view:this.view,timeExtent:this.timeExtent}):new d({layer:this.layer,layerView:this}),this._attachSubview(this.subview),this.requestUpdate()}_attachSubview(t){t&&!t.attached&&(t.attach(),t.attached=!0,this.container.addChildAt(t.container,0))}_detachSubview(t){t?.attached&&(this.container.removeChild(t.container),t.detach(),t.attached=!1)}_updateHighlightOptions(t){const i=this.view.highlights;this._pixelHighlights.sort((t,e)=>i.findIndex(({name:t})=>t===V(e.options))-i.findIndex(({name:i})=>i===V(t.options)));const s=this._pixelHighlights.map(({target:t,options:e})=>I(t,i,e)).filter(e);"imagery"===t?.type&&(t.pixelHighlights=s,t.attached&&("lerc"===this.layer.format?t.redraw():this.requestUpdate()))}};function I(t,i,e){const s=V(e),r=(i.find(t=>t.name===s)?.color??H).toArray(),{pixelRanges:h}=t;if(Array.isArray(h))return{ranges:h,bandId:t.bandId??0,color:r};const a="extent"===h.type?h:h.extent;if(!a)return;const o=[a.xmin,a.xmax],n=[a.ymin,a.ymax],{xBandId:l,yBandId:g}=t,c=1024,d=1024;return{xBandId:l,yBandId:g,xBandRange:o,yBandRange:n,color:r,width:c,height:d,xyMask:"polygon"===h.type?p({srcExtent:a,geometry:h,size:[c,d]}):void 0}}t([l()],j.prototype,"pixelData",null),t([l()],j.prototype,"subview",void 0),j=t([g("esri.views.2d.layers.ImageryLayerView2D")],j);const U=j;export{U as default};
2
+ import{__decorate as t}from"tslib";import i from"../../../Graphic.js";import{isSome as e}from"../../../core/arrayUtils.js";import s from"../../../core/Collection.js";import{makeHandle as r}from"../../../core/handleUtils.js";import"../../../core/has.js";import{QueueProcessor as h}from"../../../core/QueueProcessor.js";import{watch as a,sync as o}from"../../../core/reactiveUtils.js";import{isScreenRect as n}from"../../../core/screenUtils.js";import{property as l,subclass as g}from"../../../core/accessorSupport/decorators.js";import{convertGeometryToMask as p}from"../../../layers/raster/functions/clipUtils.js";import{GraphicsCollection as c}from"../../../support/GraphicsCollection.js";import d from"../engine/flow/FlowView2D.js";import{LayerView2D as u}from"./LayerView2D.js";import m from"./graphics/GraphicsView2D.js";import w from"./graphics/HighlightGraphicContainer.js";import y from"./imagery/ImageryView2D.js";import f from"./imagery/VectorFieldView2D.js";import v from"../../layers/ImageryLayerView.js";import{RefreshableLayerView as _}from"../../layers/RefreshableLayerView.js";import{isPixelHighlightTarget as b,isEmptyPixelRanges as x}from"../../layers/support/highlightUtils.js";import{defaultColor as H}from"../../support/HighlightDefaults.js";import{getHighlightName as V}from"../../support/highlightOptionsUtils.js";let j=class extends(_(u(v))){constructor(){super(...arguments),this._exportImageVersion=-1,this._highlightGraphics=new c,this._highlightView=void 0,this._pixelHighlights=[],this.layer=null,this.subview=null}get pixelData(){const{subview:t}=this;return this.updating||!t?null:"getPixelData"in t?t.getPixelData():null}update(t){this.subview?.update(t)}attach(){this.layer.increaseRasterJobHandlerUsage(),this._setSubView(),this.view&&(this._highlightView=new m({view:this.view,graphics:this._highlightGraphics,requestUpdateCallback:()=>this.requestUpdate(),container:new w(this.view.featuresTilingScheme)}),this.container.addChild(this._highlightView.container)),this.addAttachHandles([a(()=>this.layer.exportImageServiceParameters.version,t=>{t&&this._exportImageVersion!==t&&(this._exportImageVersion=t,this.requestUpdate())},o),a(()=>this.timeExtent,t=>{const{subview:i}=this;i&&(i.timeExtent=t,"redraw"in i?this.requestUpdate():i.redrawOrRefetch())},o),this.layer.on("redraw",()=>{const{subview:t}=this;t&&("redraw"in t?t.redraw():t.redrawOrRefetch())}),a(()=>this.layer.renderer,()=>this._setSubView()),a(()=>this.view?.highlights.items.map(({name:t,color:i})=>({name:t,color:i})),()=>this._updateHighlightOptions(this.subview))])}detach(){this.layer.decreaseRasterJobHandlerUsage(),this.container.removeAllChildren(),this._detachSubview(this.subview),this.subview?.destroy(),this.subview=null,this._highlightView?.destroy(),this._exportImageVersion=-1}viewChange(){}moveEnd(){this.requestUpdate()}async hitTest(t,i){const{layer:e,subview:s}=this;if(!e.loaded||!this.attached||!s?.attached)return null;n(i)&&(t=this.view.toMap({x:i.x+i.width/2,y:i.y+i.height/2}));const r=await s.hitTest(t);return null==r?null:[{type:"raster",layer:e,mapPoint:t,...r}]}highlight(t,h){if(b(t))return x(t)?r():this._highlightPixels(t,h);if("number"==typeof t||"string"==typeof t)return this._highlightByImageIds([t],h);const a=Array.isArray(t)||s.isCollection(t)?t.at(0):t;if("number"==typeof a||"string"==typeof a)return this._highlightByImageIds(t,h);if(!(a instanceof i))return r();let o=[];Array.isArray(t)||s.isCollection(t)?o=t.map(t=>t.clone()):t instanceof i&&(o=[t.clone()]);const n=o?.filter(e);if(!n?.length)return r();const l=V(h);return this._addHighlightGraphics(o,l),r(()=>!this.destroyed&&this._removeHighlightGraphics(o,l))}_highlightByImageIds(t,i){const e=V(i),s=new AbortController,{signal:a}=s,o=this.layer.sourceJSON.maxRecordCount??1e3,n=Math.ceil(t.length/o),l=[],g=[],p=new h({concurrency:4,process:t=>this.layer.queryFeatures({objectIds:t.ids,returnGeometry:!0,outSpatialReference:this.view.spatialReference},{signal:a}).then(t=>g.push(...t.features)).catch(()=>{})});for(let r=0;r<n;r++)l.push(p.push({ids:t.slice(r*o,(r+1)*o)}));return Promise.allSettled(l).then(()=>{g.length&&!a.aborted&&(this._addHighlightGraphics(g,e),a.addEventListener("abort",()=>{this._removeHighlightGraphics(g,e)}))}),r(()=>s.abort())}_highlightPixels(t,i){const e={target:t,options:i};return this._pixelHighlights.push(e),this._updateHighlightOptions(this.subview),r(()=>{const t=this._pixelHighlights.indexOf(e);t>-1&&(this._pixelHighlights.splice(t,1),this._updateHighlightOptions(this.subview))})}_addHighlightGraphics(t,i){this._highlightGraphics.addMany(t),this._addHighlights(t.map(t=>t.uid),i)}_removeHighlightGraphics(t,i){this._highlightGraphics.removeMany(t),this._removeHighlights(t.map(t=>t.uid),i)}async doRefresh(){this.requestUpdate()}isUpdating(){return!this.subview||this.subview.updating||!!this._highlightView?.updating}_processHighlight(){const t=this._getHighlights();this._highlightView?.setHighlight(t)}_setSubView(){if(!this.view)return;const t=this.layer.renderer?.type;let i="imagery";if("vector-field"===t?i="imageryVF":"flow"===t&&(i="flow"),this.subview){const{type:t}=this.subview;if(t===i)return this._attachSubview(this.subview),void("flow"===t?this.subview.redrawOrRefetch():"imagery"===t&&"lerc"===this.layer.format?this.subview.redraw():this.requestUpdate());this._detachSubview(this.subview),this.subview?.destroy()}"imagery"===i?(this.subview=new y({layer:this.layer,view:this.view,timeExtent:this.timeExtent,updatingHandles:this._updatingHandles}),this._updateHighlightOptions(this.subview)):this.subview="imageryVF"===i?new f({layer:this.layer,view:this.view,timeExtent:this.timeExtent}):new d({layer:this.layer,layerView:this}),this._attachSubview(this.subview),this.requestUpdate()}_attachSubview(t){t&&!t.attached&&(t.attach(),t.attached=!0,this.container.addChildAt(t.container,0))}_detachSubview(t){t?.attached&&(this.container.removeChild(t.container),t.detach(),t.attached=!1)}_updateHighlightOptions(t){const i=this.view.highlights;this._pixelHighlights.sort((t,e)=>i.findIndex(({name:t})=>t===V(e.options))-i.findIndex(({name:i})=>i===V(t.options)));const s=this._pixelHighlights.map(({target:t,options:e})=>I(t,i,e)).filter(e);"imagery"===t?.type&&(t.pixelHighlights=s,t.attached&&("lerc"===this.layer.format?t.redraw():this.requestUpdate()))}};function I(t,i,e){const s=V(e),r=(i.find(t=>t.name===s)?.color??H).toArray(),{pixelRanges:h}=t;if(Array.isArray(h))return{ranges:h,bandId:t.bandId??0,color:r};const a="extent"===h.type?h:h.extent;if(!a)return;const o=[a.xmin,a.xmax],n=[a.ymin,a.ymax],{xBandId:l,yBandId:g}=t,c=1024,d=1024;return{xBandId:l,yBandId:g,xBandRange:o,yBandRange:n,color:r,width:c,height:d,xyMask:"polygon"===h.type?p({srcExtent:a,geometry:h,size:[c,d]}):void 0}}t([l()],j.prototype,"pixelData",null),t([l()],j.prototype,"subview",void 0),j=t([g("esri.views.2d.layers.ImageryLayerView2D")],j);const U=j;export{U as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import e from"../../../core/Collection.js";import{referenceSetter as i}from"../../../core/collectionUtils.js";import{deprecatedFunction as s}from"../../../core/deprecate.js";import h from"../../../core/Error.js";import"../../../core/has.js";import r from"../../../core/Logger.js";import{watch as o,syncAndInitial as a}from"../../../core/reactiveUtils.js";import{property as n,subclass as l}from"../../../core/accessorSupport/decorators.js";import{isLinkChartView as p}from"../../../linkChart/utils.js";import{Container as c}from"../engine/Container.js";import{ClipMesh as g}from"../engine/webgl/ClipMesh.js";import{HighlightCounter as d}from"./support/HighlightCounter.js";import{createOrReuseHighlightGradient as u}from"./support/util.js";import f from"../../layers/support/ClipRect.js";import m from"../../layers/support/GeometryClipArea.js";import y from"../../layers/support/Path.js";import{defaultHighlightName as v}from"../../support/HighlightDefaults.js";import w from"../../support/HighlightOptions.js";import{isInEffectiveScaleRange as R}from"../../support/layerViewUtils.js";const _=e.ofType({key:"type",base:null,typeMap:{rect:f,path:y,geometry:m}}),H=new(e.ofType(w)),S=f=>{const m=f;let y=class extends m{constructor(){super(...arguments),this._highlightCounter=new d,this.attached=!1,this.clips=new _,this.highlights=null,this.lastUpdateId=-1,this.moving=!1,this.updateRequested=!1,this._visibleAtCurrentScale=!0}initialize(){const t=this.view?.spatialReferenceLocked??!0,e=this.view?.spatialReference;e&&t&&!this.spatialReferenceSupported?this.addResolvingPromise(Promise.reject(new h("layerview:spatial-reference-incompatible","The spatial reference of this layer does not meet the requirements of the view",{layer:this.layer}))):(this.container||(this.container=new c),this.container.fadeTransitionEnabled=!0,this.container.visible=!1,this.container.endTransitions(),this.addHandles([o(()=>this.suspended,t=>{this.container&&(this.container.visible=!t)},a),o(()=>this.updateSuspended,t=>{this.view&&!t&&this.updateRequested&&this.view.requestUpdate()},a),o(()=>this.layer?.opacity??1,t=>{this.container&&(this.container.opacity=t)},a),o(()=>this.layer&&"blendMode"in this.layer?this.layer.blendMode:"normal",t=>{this.container&&(this.container.blendMode=t)},a),o(()=>this.layer&&"effect"in this.layer?this.layer.effect:null,t=>{this.container&&(this.container.effect=t)},a),o(()=>this._mergedHighlights.items.map(t=>({name:t.name,options:{fillColor:t.color,haloColor:t.haloColor,fillOpacity:t.fillOpacity,haloOpacity:t.haloOpacity,haloWidth:t.haloWidth,haloBlur:t.haloBlur}})),()=>{this.container.highlightGradient=u(this.container.highlightGradient,this._mergedHighlights.items)},a),o(()=>this._mergedHighlights.items.map(t=>t.name),()=>{this._processHighlight()}),o(()=>this.clips.map(t=>t.version),async()=>{if(this.container){const t=this.view.spatialReference,e=await this._updatingHandles.addPromise(Promise.all(this.clips.items.map(e=>g.create(e,t))));for(const i of this.container.clips)i.destroy();this.container.clips=e.filter(t=>!!t)}},a),o(()=>({scale:this.view?.scale,scaleRange:this.layer&&"effectiveScaleRange"in this.layer?this.layer.effectiveScaleRange:null}),({scale:t,scaleRange:e})=>{const i=R(e,t);i!==this._visibleAtCurrentScale&&(this._visibleAtCurrentScale=i)},a),o(()=>this.layer?.effectiveVisible,async t=>{this.container.requestDeclutter()})],"constructor"),this.view?.whenLayerView?this.view.whenLayerView(this.layer).then(t=>{t===this&&this.processAttach()},()=>{}):this.when().then(()=>{this.processAttach()},()=>{}))}destroy(){this.processDetach(),this.updateRequested=!1;for(const t of this.container?.clips??[])t.destroy()}get highlightOptions(){return this._logHighlightOptionsDeprecation(),this.highlights?.find(({name:t})=>t===v)}set highlightOptions(t){if(this._logHighlightOptionsDeprecation(),!this.highlights){if(!t)return;this.highlights=new e([new w])}const i=this.highlights.find(({name:t})=>t===v);t?i?.assignFrom(t):(this.highlights.remove(i),0===this.highlights.length&&(this.highlights=null))}_logHighlightOptionsDeprecation(){s(r.getLogger(this),"`LayerView.highlightOptions` is deprecated in favor of View.highlights",{replacement:"View.highlights",version:"4.34",see:"https://arcg.is/inbTa1#highlights",warnOnce:!0})}get hasHighlight(){return this._highlightCounter.size>0}get _mergedHighlights(){if(!this.view)return H;if(!this.highlights)return this.view.highlights;const t=this.view.highlights.clone();for(const e of this.highlights){const i=t.find(t=>t.name===e.name);i&&i.assignFrom(e)}return t}get highlightIds(){return Array.from(this._highlightCounter.objectIds)}get scheduler(){return this.view.scheduler}get spatialReferenceSupported(){const t=this.view?.spatialReference;return null==t||this.supportsSpatialReference(t)}get updating(){if(!this.spatialReferenceSupported)return!1;if(!this.attached)return!0;if(this.suspended)return!1;return this.updateRequested||this.isUpdating()||this._updatingHandles?.updating||this.container.transitioning}get visibleAtCurrentScale(){return this._visibleAtCurrentScale}processAttach(){this.isResolved()&&!this.attached&&!this.destroyed&&this.spatialReferenceSupported&&(this.attach(),this.attached=!0,this.requestUpdate())}processDetach(){this.attached&&(this.attached=!1,this.removeHandles("attach"),this.detach(),this.updateRequested=!1)}requestUpdate(){this.destroyed||this.updateRequested||(this.updateRequested=!0,this.updateSuspended||this.view.requestUpdate())}processUpdate(t){!this.isFulfilled()||this.isResolved()?(this._set("updateParameters",t),this.updateRequested&&!this.updateSuspended&&(this.updateRequested=!1,this.update(t))):this.updateRequested=!1}hitTest(t,e){return Promise.resolve(null)}supportsSpatialReference(t){return!0}canResume(){if(!this.spatialReferenceSupported)return!1;switch(this.layer?.type){case"link-chart":case"knowledge-graph-sublayer":case"graphics":break;default:if(p(this.view)&&!this.view.inGeographicLayout)return!1}return!!super.canResume()&&this.visibleAtCurrentScale}getSuspendInfo(){const t=super.getSuspendInfo(),e=!this.spatialReferenceSupported;return e&&(t.spatialReferenceNotSupported=e),t}addAttachHandles(t){this.addHandles(t,"attach")}_addHighlights(t,e){this._highlightCounter.add(t,e)&&this._processHighlight()}_removeHighlights(t,e){this._highlightCounter.delete(t,e)&&this._processHighlight()}_processHighlight(){}_getHighlights(){const t=[];for(const[e,i]of this._highlightCounter.highlightNamesByObjectId){const s=this._getHighlightBits(i);t.push({objectId:e,highlightFlags:s})}return t}_getHighlightBits(t){const e=new Set(t);let i=1,s=0;if(!this.view)return 0;const h=this._mergedHighlights;for(const{name:r}of h)e.delete(r)&&(s=i),i<<=1;return s}};return t([n()],y.prototype,"attached",void 0),t([n({type:_,set(t){const e=i(t,this._get("clips"),_);this._set("clips",e)}})],y.prototype,"clips",void 0),t([n()],y.prototype,"container",void 0),t([n({type:w})],y.prototype,"highlightOptions",null),t([n({type:e.ofType(w)})],y.prototype,"highlights",void 0),t([n()],y.prototype,"_mergedHighlights",null),t([n()],y.prototype,"moving",void 0),t([n({readOnly:!0})],y.prototype,"spatialReferenceSupported",null),t([n({readOnly:!0})],y.prototype,"updateParameters",void 0),t([n()],y.prototype,"updateRequested",void 0),t([n()],y.prototype,"updating",null),t([n()],y.prototype,"view",void 0),t([n()],y.prototype,"_visibleAtCurrentScale",void 0),t([n({readOnly:!0})],y.prototype,"visibleAtCurrentScale",null),y=t([l("esri.views.2d.layers.LayerView2D")],y),y};export{S as LayerView2D};
2
+ import{__decorate as e}from"tslib";import t from"../../../core/Collection.js";import{referenceSetter as i}from"../../../core/collectionUtils.js";import{deprecatedFunction as s}from"../../../core/deprecate.js";import r from"../../../core/Error.js";import"../../../core/has.js";import h from"../../../core/Logger.js";import{watch as o,syncAndInitial as a}from"../../../core/reactiveUtils.js";import{property as n,subclass as l}from"../../../core/accessorSupport/decorators.js";import{isLinkChartView as p}from"../../../linkChart/guards.js";import{Container as c}from"../engine/Container.js";import{ClipMesh as g}from"../engine/webgl/ClipMesh.js";import{HighlightCounter as d}from"./support/HighlightCounter.js";import{createOrReuseHighlightGradient as u}from"./support/util.js";import f from"../../layers/support/ClipRect.js";import m from"../../layers/support/GeometryClipArea.js";import y from"../../layers/support/Path.js";import{defaultHighlightName as v}from"../../support/HighlightDefaults.js";import w from"../../support/HighlightOptions.js";import{isInEffectiveScaleRange as R}from"../../support/layerViewUtils.js";const _=t.ofType({key:"type",base:null,typeMap:{rect:f,path:y,geometry:m}}),H=new(t.ofType(w)),S=f=>{const m=f;let y=class extends m{constructor(){super(...arguments),this._highlightCounter=new d,this.attached=!1,this.clips=new _,this.highlights=null,this.lastUpdateId=-1,this.moving=!1,this.updateRequested=!1,this._visibleAtCurrentScale=!0}initialize(){const e=this.view?.spatialReferenceLocked??!0,t=this.view?.spatialReference;t&&e&&!this.spatialReferenceSupported?this.addResolvingPromise(Promise.reject(new r("layerview:spatial-reference-incompatible","The spatial reference of this layer does not meet the requirements of the view",{layer:this.layer}))):(this.container||(this.container=new c),this.container.fadeTransitionEnabled=!0,this.container.visible=!1,this.container.endTransitions(),this.addHandles([o(()=>this.suspended,e=>{this.container&&(this.container.visible=!e)},a),o(()=>this.updateSuspended,e=>{this.view&&!e&&this.updateRequested&&this.view.requestUpdate()},a),o(()=>this.layer?.opacity??1,e=>{this.container&&(this.container.opacity=e)},a),o(()=>this.layer&&"blendMode"in this.layer?this.layer.blendMode:"normal",e=>{this.container&&(this.container.blendMode=e)},a),o(()=>this.layer&&"effect"in this.layer?this.layer.effect:null,e=>{this.container&&(this.container.effect=e)},a),o(()=>this._mergedHighlights.items.map(e=>({name:e.name,options:{fillColor:e.color,haloColor:e.haloColor,fillOpacity:e.fillOpacity,haloOpacity:e.haloOpacity,haloWidth:e.haloWidth,haloBlur:e.haloBlur}})),()=>{this.container.highlightGradient=u(this.container.highlightGradient,this._mergedHighlights.items)},a),o(()=>this._mergedHighlights.items.map(e=>e.name),()=>{this._processHighlight()}),o(()=>this.clips.map(e=>e.version),async()=>{if(this.container&&this.view?.spatialReference){const e=this.view.spatialReference,t=await this._updatingHandles.addPromise(Promise.all(this.clips.items.map(t=>g.create(t,e))));for(const i of this.container.clips)i.destroy();this.container.clips=t.filter(e=>!!e)}},a),o(()=>({scale:this.view?.scale,scaleRange:this.layer&&"effectiveScaleRange"in this.layer?this.layer.effectiveScaleRange:null}),({scale:e,scaleRange:t})=>{const i=R(t,e);i!==this._visibleAtCurrentScale&&(this._visibleAtCurrentScale=i)},a),o(()=>this.layer?.effectiveVisible,async e=>{this.container.requestDeclutter()})],"constructor"),this.view?.whenLayerView?this.view.whenLayerView(this.layer).then(e=>{e===this&&this.processAttach()},()=>{}):this.when().then(()=>{this.processAttach()},()=>{}))}destroy(){this.processDetach(),this.updateRequested=!1;for(const e of this.container?.clips??[])e.destroy()}get highlightOptions(){return this._logHighlightOptionsDeprecation(),this.highlights?.find(({name:e})=>e===v)}set highlightOptions(e){if(this._logHighlightOptionsDeprecation(),!this.highlights){if(!e)return;this.highlights=new t([new w])}const i=this.highlights.find(({name:e})=>e===v);e?i?.assignFrom(e):(this.highlights.remove(i),0===this.highlights.length&&(this.highlights=null))}_logHighlightOptionsDeprecation(){s(h.getLogger(this),"`LayerView.highlightOptions` is deprecated in favor of View.highlights",{replacement:"View.highlights",version:"4.34",see:"https://arcg.is/inbTa1#highlights",warnOnce:!0})}get hasHighlight(){return this._highlightCounter.size>0}get _mergedHighlights(){if(!this.view)return H;if(!this.highlights)return this.view.highlights;const e=this.view.highlights.clone();for(const t of this.highlights){const i=e.find(e=>e.name===t.name);i&&i.assignFrom(t)}return e}get highlightIds(){return Array.from(this._highlightCounter.objectIds)}get scheduler(){return this.view.scheduler}get spatialReferenceSupported(){const e=this.view?.spatialReference;return null==e||this.supportsSpatialReference(e)}get updating(){if(!this.spatialReferenceSupported)return!1;if(!this.attached)return!0;if(this.suspended)return!1;return this.updateRequested||this.isUpdating()||this._updatingHandles?.updating||this.container.transitioning}get visibleAtCurrentScale(){return this._visibleAtCurrentScale}processAttach(){this.isResolved()&&!this.attached&&!this.destroyed&&this.spatialReferenceSupported&&(this.attach(),this.attached=!0,this.requestUpdate())}processDetach(){this.attached&&(this.attached=!1,this.removeHandles("attach"),this.detach(),this.updateRequested=!1)}requestUpdate(){this.destroyed||this.updateRequested||(this.updateRequested=!0,this.updateSuspended||this.view.requestUpdate())}processUpdate(e){!this.isFulfilled()||this.isResolved()?(this._set("updateParameters",e),this.updateRequested&&!this.updateSuspended&&(this.updateRequested=!1,this.update(e))):this.updateRequested=!1}hitTest(e,t){return Promise.resolve(null)}supportsSpatialReference(e){return!0}canResume(){if(!this.spatialReferenceSupported)return!1;switch(this.layer?.type){case"link-chart":case"knowledge-graph-sublayer":case"graphics":break;default:if(p(this.view)&&!this.view.inGeographicLayout)return!1}return!!super.canResume()&&this.visibleAtCurrentScale}getSuspendInfo(){const e=super.getSuspendInfo(),t=!this.spatialReferenceSupported;return t&&(e.spatialReferenceNotSupported=t),e}addAttachHandles(e){this.addHandles(e,"attach")}_addHighlights(e,t){this._highlightCounter.add(e,t)&&this._processHighlight()}_removeHighlights(e,t){this._highlightCounter.delete(e,t)&&this._processHighlight()}_processHighlight(){}_getHighlights(){const e=[];for(const[t,i]of this._highlightCounter.highlightNamesByObjectId){const s=this._getHighlightBits(i);e.push({objectId:t,highlightFlags:s})}return e}_getHighlightBits(e){const t=new Set(e);let i=1,s=0;if(!this.view)return 0;const r=this._mergedHighlights;for(const{name:h}of r)t.delete(h)&&(s=i),i<<=1;return s}};return e([n()],y.prototype,"attached",void 0),e([n({type:_,set(e){const t=i(e,this._get("clips"),_);this._set("clips",t)}})],y.prototype,"clips",void 0),e([n()],y.prototype,"container",void 0),e([n({type:w})],y.prototype,"highlightOptions",null),e([n({type:t.ofType(w)})],y.prototype,"highlights",void 0),e([n()],y.prototype,"_mergedHighlights",null),e([n()],y.prototype,"moving",void 0),e([n({readOnly:!0})],y.prototype,"spatialReferenceSupported",null),e([n({readOnly:!0})],y.prototype,"updateParameters",void 0),e([n()],y.prototype,"updateRequested",void 0),e([n()],y.prototype,"updating",null),e([n()],y.prototype,"view",void 0),e([n()],y.prototype,"_visibleAtCurrentScale",void 0),e([n({readOnly:!0})],y.prototype,"visibleAtCurrentScale",null),y=e([l("esri.views.2d.layers.LayerView2D")],y),y};export{S as LayerView2D};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import"../../../Graphic.js";import t from"../../../core/Collection.js";import i from"../../../core/Error.js";import"../../../core/has.js";import{some as r}from"../../../core/iteratorUtils.js";import s from"../../../core/Logger.js";import{getOrCreateMapValue as o}from"../../../core/MapUtils.js";import{isAbortError as n}from"../../../core/promiseUtils.js";import l from"../../../core/ReactiveMap.js";import{watch as a,syncAndInitial as m,on as c}from"../../../core/reactiveUtils.js";import{isScreenRect as p}from"../../../core/screenUtils.js";import{property as h,subclass as d}from"../../../core/accessorSupport/decorators.js";import u from"../../../geometry/Extent.js";import{create as g}from"../../../geometry/support/aaBoundingRect.js";import{ringsContainsCoords as f}from"../../../geometry/support/contains.js";import{targetIntersectsPolygon as y,extentIntersectsPolygon as j}from"../../../geometry/support/intersectsBase.js";import{MediaElementView as _}from"../../../layers/support/MediaElementView.js";import"../../../renderers/SimpleRenderer.js";import"../../../symbols/SimpleFillSymbol.js";import"../engine/Stage.js";import"../../../Color.js";import"../../../core/Accessor.js";import"../../../core/mathUtils.js";import"../../../core/libs/gl-matrix-2/factories/vec4f32.js";import"../../../geometry/Point.js";import"../../../chunks/pe.js";import"../../../core/units.js";import"../../../geometry/ellipsoidUtils.js";import"../../../geometry/support/spatialReferenceUtils.js";import"../../../core/RandomLCG.js";import"../engine/transitions/FadeTransition.js";import"../../webgl/BufferObject.js";import"../../webgl/FramebufferObject.js";import"../../webgl/Program.js";import"../../webgl/Renderbuffer.js";import"../../webgl/Texture.js";import"../../webgl/enums.js";import"../../webgl/Util.js";import"../engine/webgl/meshing/definitions.js";import"../engine/webgl/shaderGraph/techniques/shaders/VideoScreenShader.js";import"../LabelManager.js";import"./graphics/GraphicsView2D.js";import"../../../layers/effects/EffectView.js";import"../engine/webgl/shaderGraph/techniques/clip/ClipTechnique.js";import"../engine/webgl/AFeatureTile.js";import"../engine/webgl/DisplayEntity.js";import"../../../core/libs/gl-matrix-2/factories/vec2f32.js";import"../engine/webgl/number.js";import"../engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js";import"../engine/webgl/cpuMapped/GpuMeshState.js";import"../engine/webgl/shaderGraph/techniques/shaders/TileDebugInfoShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/TileStencilShader.js";import"../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import"../../../core/libs/gl-matrix-2/factories/vec3f32.js";import"../../../geometry/support/normalizeUtils.js";import"./support/util.js";import"../navigation/MapViewNavigation.js";import"../../../request.js";import"../../../core/asyncUtils.js";import"../../../core/support/UpdatingHandles.js";import"../../../core/urlUtils.js";import"../engine/webgl/shaderGraph/techniques/shaders/MagnifierShader.js";import"../../../geometry/Geometry.js";import"../../../geometry/Multipoint.js";import"../../../geometry/Polygon.js";import"../../../geometry/Polyline.js";import"../../../geometry/SpatialReference.js";import"../../../geometry/spatialReferenceEllipsoidUtils.js";import"../../../geometry/operators/support/GeographicTransformation.js";import"../../../geometry/projection/projectors.js";import"../engine/webgl/shaderGraph/techniques/shaders/GridShader.js";import"../../../geometry/support/geodesicConstants.js";import"../../../geometry/support/Ellipsoid.js";import"../tiling/TileInfoView.js";import"../tiling/TileKey.js";import w from"../tiling/TileQueue.js";import v from"../tiling/TileStrategy.js";import b from"../engine/webgl/Overlay.js";import S from"../engine/webgl/OverlayContainer.js";import{LayerView2D as E}from"./LayerView2D.js";import{getMapPointsFromScreen as T}from"../support/hitTestUtils.js";import R from"../../layers/MediaLayerView.js";import{TaskPriority as U}from"../../support/Scheduler.js";let G=class extends(E(R)){constructor(){super(...arguments),this._overlayContainer=null,this._fetchQueue=null,this._tileStrategy=null,this._elementReferences=new l,this._debugGraphicsView=null,this._interaction=null,this.elements=new t}initialize(){this.addHandles([a(()=>[this.interactive,this.suspended],async()=>{if(this.interactive&&!this._interaction){const{MediaLayerInteraction:e}=await this._updatingHandles.addPromise(import("./support/MediaLayerInteraction.js"));if(this.destroyed)return;this._interaction=new e({view:this.view,layer:this.layer}),this.selectedElement!==this._interaction.selectedElement&&(this._interaction.selectedElement=this.selectedElement),this.interactionOptions!==this._interaction.options&&(this._interaction.options=this.interactionOptions)}this._interaction&&(this._interaction.enabled=!this.suspended&&this.interactive)},m),a(()=>this.interactionOptions,e=>{this._interaction&&(this._interaction.options=e)},m),a(()=>this.selectedElement,e=>{this._interaction&&(this._interaction.selectedElement=e)},m)])}isUpdating(){return!0===this._interaction?.updating||r(this._elementReferences.values(),({overlay:e})=>!e.isReady)}attach(){this.addAttachHandles([c(()=>this.layer.effectiveSource,"refresh",()=>{this._tileStrategy.refresh(e=>this._updateTile(e)),this.requestUpdate()}),c(()=>this.layer.effectiveSource,"change",({element:e})=>this._elementUpdateHandler(e))]),this._overlayContainer=new S,this.container.addChild(this._overlayContainer),this._fetchQueue=new w({tileInfoView:this.view.featuresTilingScheme,concurrency:10,process:(e,t)=>this._queryElements(e,t),scheduler:this.scheduler,priority:U.MAPVIEW_FETCH_QUEUE}),this._tileStrategy=new v({cachePolicy:"purge",resampling:!0,acquireTile:e=>this._acquireTile(e),releaseTile:e=>this._releaseTile(e),tileInfoView:this.view.featuresTilingScheme}),this.requestUpdate()}detach(){this.elements.removeAll(),this._tileStrategy.destroy(),this._fetchQueue.destroy(),this._overlayContainer.removeAllChildren(),this.container.removeAllChildren(),this._elementReferences.clear(),this._debugGraphicsView?.destroy()}supportsSpatialReference(e){return!0}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}update(e){this._tileStrategy.update(e),this._debugGraphicsView?.update(e)}async hitTest(e,t){const i=[],r=e.normalize(),s=[r.x,r.y],o=p(t);for(const{elementView:{normalizedCoords:n,element:l}}of this._elementReferences.values())if(o){const r=T(this.view,t).map(e=>[e.x,e.y]);null!=n&&y(r,n.rings)&&i.push({type:"media",element:l,layer:this.layer,mapPoint:null,sourcePoint:l.toSource(e)})}else null!=n&&f(n.rings,s)&&i.push({type:"media",element:l,layer:this.layer,mapPoint:e,sourcePoint:l.toSource(e)});return i.reverse()}canResume(){return null!=this.layer.source&&super.canResume()}async doRefresh(){this._fetchQueue.reset(),this._tileStrategy.refresh(e=>this._updateTile(e))}_acquireTile(e){const t=new x(e.clone());return this._updateTile(t),t}_updateTile(e){this._updatingHandles.consumePromise(this._fetchQueue.push(e.key).then(t=>{const[i,r]=e.setElements(t);this._referenceElements(e,i),this._dereferenceElements(e,r),this.requestUpdate()},e=>{n(e)||s.getLogger(this).error(e)}))}_releaseTile(e){this._fetchQueue.abort(e.key.id),e.elements&&this._dereferenceElements(e,e.elements),this.requestUpdate()}async _queryElements(e,t){const i=this.layer.effectiveSource;if(null==i)return[];this.view.featuresTilingScheme.getTileBounds(C,e,!0);const r=new u({xmin:C[0],ymin:C[1],xmax:C[2],ymax:C[3],spatialReference:this.view.spatialReference});return i.queryElements(r,t)}_referenceElements(e,t){if(null!=this.layer.source)for(const i of t)this._referenceElement(e,i)}_referenceElement(e,t){o(this._elementReferences,t.uid,()=>{const e=new _({element:t,spatialReference:this.view.spatialReference}),r=new b(e);return this._overlayContainer.addChild(r),this.elements.add(t),this._updatingHandles.consumePromise(t.load().catch(e=>{s.getLogger("esri.views.2d.layers.MediaLayerView2D").error(new i("element-load-error","Element cannot be displayed",{element:t,error:e}))})),{debugGraphic:null,elementView:e,overlay:r,tiles:new Set}}).tiles.add(e)}_dereferenceElements(e,t){for(const i of t)this._dereferenceElement(e,i)}_dereferenceElement(e,t){const i=this._elementReferences.get(t.uid);i.tiles.delete(e),i.tiles.size||(this._overlayContainer.removeChild(i.overlay),i.overlay.destroy(),i.elementView.destroy(),this._elementReferences.delete(t.uid),this.elements.remove(t),this._debugGraphicsView?.graphics.remove(i.debugGraphic))}_elementUpdateHandler(e){let t=this._elementReferences.get(e.uid);if(t){const i=t.elementView.normalizedCoords;if(null==i)return this._overlayContainer.removeChild(t.overlay),t.overlay.destroy(),t.elementView.destroy(),this._elementReferences.delete(e.uid),this.elements.remove(e),void this._debugGraphicsView?.graphics.remove(t.debugGraphic);const r=[],s=[];for(const e of this._tileStrategy.tiles){const o=q(this.view.featuresTilingScheme,e,i);t.tiles.has(e)?o||s.push(e):o&&r.push(e)}for(const t of r)this._referenceElement(t,e);for(const t of s)this._dereferenceElement(t,e);return t=this._elementReferences.get(e.uid),void(t?.debugGraphic&&(t.debugGraphic.geometry=t.elementView.normalizedCoords,this._debugGraphicsView.graphicUpdateHandler({graphic:t.debugGraphic,property:"geometry"})))}const i=new _({element:e,spatialReference:this.view.spatialReference}).normalizedCoords;if(null!=i)for(const r of this._tileStrategy.tiles){q(this.view.featuresTilingScheme,r,i)&&this._referenceElement(r,e)}}};e([h({readOnly:!0})],G.prototype,"elements",void 0),G=e([d("esri.views.2d.layers.MediaLayerView2D")],G);const C=g(),V={xmin:0,ymin:0,xmax:0,ymax:0};function q(e,t,i){return e.getTileBounds(C,t.key,!0),V.xmin=C[0],V.ymin=C[1],V.xmax=C[2],V.ymax=C[3],j(V,i)}class x{constructor(e){this.key=e,this.elements=null,this.isReady=!1,this.visible=!0}setElements(e){const t=[],i=new Set(this.elements);this.elements=e;for(const r of e)i.has(r)?i.delete(r):t.push(r);return this.isReady=!0,[t,Array.from(i)]}destroy(){}}const M=G;export{M as default};
2
+ import{__decorate as e}from"tslib";import"../../../Graphic.js";import t from"../../../core/Collection.js";import i from"../../../core/Error.js";import"../../../core/has.js";import{some as r}from"../../../core/iteratorUtils.js";import s from"../../../core/Logger.js";import{getOrCreateMapValue as o}from"../../../core/MapUtils.js";import{isAbortError as n}from"../../../core/promiseUtils.js";import l from"../../../core/ReactiveMap.js";import{watch as a,syncAndInitial as m,on as c}from"../../../core/reactiveUtils.js";import{isScreenRect as p}from"../../../core/screenUtils.js";import{property as h,subclass as d}from"../../../core/accessorSupport/decorators.js";import u from"../../../geometry/Extent.js";import{create as g}from"../../../geometry/support/aaBoundingRect.js";import{ringsContainsCoords as f}from"../../../geometry/support/contains.js";import{targetIntersectsPolygon as y,extentIntersectsPolygon as j}from"../../../geometry/support/intersectsBase.js";import{MediaElementView as _}from"../../../layers/support/MediaElementView.js";import"../../../renderers/SimpleRenderer.js";import"../../../symbols/SimpleFillSymbol.js";import"../engine/Stage.js";import"../../../Color.js";import"../../../core/libs/gl-matrix-2/factories/vec4f32.js";import"../../../geometry/Point.js";import"../../../chunks/pe.js";import"../../../core/units.js";import"../../../geometry/ellipsoidUtils.js";import"../../../geometry/support/spatialReferenceUtils.js";import"../../../core/RandomLCG.js";import"../../../core/Accessor.js";import"../engine/transitions/FadeTransition.js";import"../../webgl/BufferObject.js";import"../../webgl/FramebufferObject.js";import"../../webgl/Program.js";import"../../webgl/Renderbuffer.js";import"../../webgl/Texture.js";import"../../webgl/enums.js";import"../../webgl/Util.js";import"../engine/webgl/meshing/definitions.js";import"../engine/webgl/shaderGraph/techniques/shaders/VideoScreenShader.js";import"../LabelManager.js";import"./graphics/GraphicsView2D.js";import"../../../layers/effects/EffectView.js";import"../engine/webgl/shaderGraph/techniques/clip/ClipTechnique.js";import"../engine/webgl/AFeatureTile.js";import"../engine/webgl/DisplayEntity.js";import"../../../core/libs/gl-matrix-2/factories/vec2f32.js";import"../engine/webgl/number.js";import"../engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js";import"../engine/webgl/cpuMapped/GpuMeshState.js";import"../engine/webgl/shaderGraph/techniques/shaders/TileDebugInfoShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/TileStencilShader.js";import"../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import"../../../core/libs/gl-matrix-2/factories/vec3f32.js";import"../../../geometry/support/normalizeUtils.js";import"./support/util.js";import"../navigation/MapViewNavigation.js";import"../../../request.js";import"../../../core/asyncUtils.js";import"../../../core/support/UpdatingHandles.js";import"../../../core/mathUtils.js";import"../../../core/urlUtils.js";import"../engine/webgl/shaderGraph/techniques/shaders/MagnifierShader.js";import"../../../geometry/Geometry.js";import"../../../geometry/Multipoint.js";import"../../../geometry/Polygon.js";import"../../../geometry/Polyline.js";import"../../../geometry/SpatialReference.js";import"../../../geometry/spatialReferenceEllipsoidUtils.js";import"../../../geometry/operators/support/GeographicTransformation.js";import"../../../geometry/projection/projectors.js";import"../engine/webgl/shaderGraph/techniques/shaders/GridShader.js";import"../../../geometry/support/geodesicConstants.js";import"../../../geometry/support/Ellipsoid.js";import"../tiling/TileInfoView.js";import"../tiling/TileKey.js";import w from"../tiling/TileQueue.js";import v from"../tiling/TileStrategy.js";import b from"../engine/webgl/Overlay.js";import S from"../engine/webgl/OverlayContainer.js";import{LayerView2D as E}from"./LayerView2D.js";import{getMapPointsFromScreen as T}from"../support/hitTestUtils.js";import R from"../../layers/MediaLayerView.js";import{TaskPriority as U}from"../../support/Scheduler.js";let G=class extends(E(R)){constructor(){super(...arguments),this._overlayContainer=null,this._fetchQueue=null,this._tileStrategy=null,this._elementReferences=new l,this._debugGraphicsView=null,this._interaction=null,this.elements=new t}initialize(){this.addHandles([a(()=>[this.interactive,this.suspended],async()=>{if(this.interactive&&!this._interaction){const{MediaLayerInteraction:e}=await this._updatingHandles.addPromise(import("./support/MediaLayerInteraction.js"));if(this.destroyed)return;this._interaction=new e({view:this.view,layer:this.layer}),this.selectedElement!==this._interaction.selectedElement&&(this._interaction.selectedElement=this.selectedElement),this.interactionOptions!==this._interaction.options&&(this._interaction.options=this.interactionOptions)}this._interaction&&(this._interaction.enabled=!this.suspended&&this.interactive)},m),a(()=>this.interactionOptions,e=>{this._interaction&&(this._interaction.options=e)},m),a(()=>this.selectedElement,e=>{this._interaction&&(this._interaction.selectedElement=e)},m)])}isUpdating(){return!0===this._interaction?.updating||r(this._elementReferences.values(),({overlay:e})=>!e.isReady)}attach(){this.addAttachHandles([c(()=>this.layer.effectiveSource,"refresh",()=>{this._tileStrategy.refresh(e=>this._updateTile(e)),this.requestUpdate()}),c(()=>this.layer.effectiveSource,"change",({element:e})=>this._elementUpdateHandler(e))]),this._overlayContainer=new S,this.container.addChild(this._overlayContainer),this._fetchQueue=new w({tileInfoView:this.view.featuresTilingScheme,concurrency:10,process:(e,t)=>this._queryElements(e,t),scheduler:this.scheduler,priority:U.MAPVIEW_FETCH_QUEUE}),this._tileStrategy=new v({cachePolicy:"purge",resampling:!0,acquireTile:e=>this._acquireTile(e),releaseTile:e=>this._releaseTile(e),tileInfoView:this.view.featuresTilingScheme}),this.requestUpdate()}detach(){this.elements.removeAll(),this._tileStrategy.destroy(),this._fetchQueue.destroy(),this._overlayContainer.removeAllChildren(),this.container.removeAllChildren(),this._elementReferences.clear(),this._debugGraphicsView?.destroy()}supportsSpatialReference(e){return!0}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}update(e){this._tileStrategy.update(e),this._debugGraphicsView?.update(e)}async hitTest(e,t){const i=[],r=e.normalize(),s=[r.x,r.y],o=p(t);for(const{elementView:{normalizedCoords:n,element:l}}of this._elementReferences.values())if(o){const r=T(this.view,t).map(e=>[e.x,e.y]);null!=n&&y(r,n.rings)&&i.push({type:"media",element:l,layer:this.layer,mapPoint:null,sourcePoint:l.toSource(e)})}else null!=n&&f(n.rings,s)&&i.push({type:"media",element:l,layer:this.layer,mapPoint:e,sourcePoint:l.toSource(e)});return i.reverse()}canResume(){return null!=this.layer.source&&super.canResume()}async doRefresh(){this._fetchQueue.reset(),this._tileStrategy.refresh(e=>this._updateTile(e))}_acquireTile(e){const t=new x(e.clone());return this._updateTile(t),t}_updateTile(e){this._updatingHandles.consumePromise(this._fetchQueue.push(e.key).then(t=>{const[i,r]=e.setElements(t);this._referenceElements(e,i),this._dereferenceElements(e,r),this.requestUpdate()},e=>{n(e)||s.getLogger(this).error(e)}))}_releaseTile(e){this._fetchQueue.abort(e.key.id),e.elements&&this._dereferenceElements(e,e.elements),this.requestUpdate()}async _queryElements(e,t){const i=this.layer.effectiveSource;if(null==i)return[];this.view.featuresTilingScheme.getTileBounds(C,e,!0);const r=new u({xmin:C[0],ymin:C[1],xmax:C[2],ymax:C[3],spatialReference:this.view.spatialReference});return i.queryElements(r,t)}_referenceElements(e,t){if(null!=this.layer.source)for(const i of t)this._referenceElement(e,i)}_referenceElement(e,t){o(this._elementReferences,t.uid,()=>{const e=new _({element:t,spatialReference:this.view.spatialReference}),r=new b(e);return this._overlayContainer.addChild(r),this.elements.add(t),this._updatingHandles.consumePromise(t.load().catch(e=>{s.getLogger("esri.views.2d.layers.MediaLayerView2D").error(new i("element-load-error","Element cannot be displayed",{element:t,error:e}))})),{debugGraphic:null,elementView:e,overlay:r,tiles:new Set}}).tiles.add(e)}_dereferenceElements(e,t){for(const i of t)this._dereferenceElement(e,i)}_dereferenceElement(e,t){const i=this._elementReferences.get(t.uid);i.tiles.delete(e),i.tiles.size||(this._overlayContainer.removeChild(i.overlay),i.overlay.destroy(),i.elementView.destroy(),this._elementReferences.delete(t.uid),this.elements.remove(t),this._debugGraphicsView?.graphics.remove(i.debugGraphic))}_elementUpdateHandler(e){let t=this._elementReferences.get(e.uid);if(t){const i=t.elementView.normalizedCoords;if(null==i)return this._overlayContainer.removeChild(t.overlay),t.overlay.destroy(),t.elementView.destroy(),this._elementReferences.delete(e.uid),this.elements.remove(e),void this._debugGraphicsView?.graphics.remove(t.debugGraphic);const r=[],s=[];for(const e of this._tileStrategy.tiles){const o=q(this.view.featuresTilingScheme,e,i);t.tiles.has(e)?o||s.push(e):o&&r.push(e)}for(const t of r)this._referenceElement(t,e);for(const t of s)this._dereferenceElement(t,e);return t=this._elementReferences.get(e.uid),void(t?.debugGraphic&&(t.debugGraphic.geometry=t.elementView.normalizedCoords,this._debugGraphicsView.graphicUpdateHandler({graphic:t.debugGraphic,property:"geometry"})))}const i=new _({element:e,spatialReference:this.view.spatialReference}).normalizedCoords;if(null!=i)for(const r of this._tileStrategy.tiles){q(this.view.featuresTilingScheme,r,i)&&this._referenceElement(r,e)}}};e([h({readOnly:!0})],G.prototype,"elements",void 0),G=e([d("esri.views.2d.layers.MediaLayerView2D")],G);const C=g(),V={xmin:0,ymin:0,xmax:0,ymax:0};function q(e,t,i){return e.getTileBounds(C,t.key,!0),V.xmin=C[0],V.ymin=C[1],V.xmax=C[2],V.ymax=C[3],j(V,i)}class x{constructor(e){this.key=e,this.elements=null,this.isReady=!1,this.visible=!0}setElements(e){const t=[],i=new Set(this.elements);this.elements=e;for(const r of e)i.has(r)?i.delete(r):t.push(r);return this.isReady=!0,[t,Array.from(i)]}destroy(){}}const M=G;export{M as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{makeHandle as i}from"../../../core/handleUtils.js";import t from"../../../core/Logger.js";import{isAbortError as s,waitTick as r}from"../../../core/promiseUtils.js";import{property as h,subclass as a}from"../../../core/accessorSupport/decorators.js";import{equals as o}from"../../../geometry/support/spatialReferenceUtils.js";import{GraphicsCollection as l}from"../../../support/GraphicsCollection.js";import"../engine/Stage.js";import"../../../Color.js";import"../../../core/Accessor.js";import"../../../core/has.js";import"../../../core/mathUtils.js";import"../../../core/libs/gl-matrix-2/factories/vec4f32.js";import"../../../geometry/Point.js";import"../../../chunks/pe.js";import"../../../core/units.js";import"../../../geometry/ellipsoidUtils.js";import"../../../core/RandomLCG.js";import"../engine/transitions/FadeTransition.js";import"../../webgl/BufferObject.js";import"../../webgl/FramebufferObject.js";import"../../webgl/Program.js";import"../../webgl/Renderbuffer.js";import"../../webgl/Texture.js";import"../../webgl/enums.js";import"../../webgl/Util.js";import"../engine/webgl/meshing/definitions.js";import"../engine/webgl/shaderGraph/techniques/shaders/VideoScreenShader.js";import"../LabelManager.js";import p from"./graphics/GraphicsView2D.js";import"../../../layers/effects/EffectView.js";import"../engine/webgl/shaderGraph/techniques/clip/ClipTechnique.js";import"../engine/webgl/AFeatureTile.js";import"../engine/webgl/DisplayEntity.js";import"../../../core/libs/gl-matrix-2/factories/vec2f32.js";import"../engine/webgl/number.js";import"../engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js";import"../engine/webgl/cpuMapped/GpuMeshState.js";import"../engine/webgl/shaderGraph/techniques/shaders/TileDebugInfoShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/TileStencilShader.js";import"../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import"../../../core/libs/gl-matrix-2/factories/vec3f32.js";import"../../../geometry/support/normalizeUtils.js";import"./support/util.js";import"../navigation/MapViewNavigation.js";import"../../../request.js";import"../../../core/asyncUtils.js";import"../../../core/accessorSupport/watch.js";import"../../../core/accessorSupport/tracking/SimpleTrackingTarget.js";import"../../../core/support/UpdatingHandles.js";import"../../../core/urlUtils.js";import"../engine/webgl/shaderGraph/techniques/shaders/MagnifierShader.js";import"../../../geometry/Extent.js";import"../../../geometry/Geometry.js";import"../../../geometry/Multipoint.js";import"../../../geometry/Polygon.js";import"../../../geometry/Polyline.js";import"../../../geometry/SpatialReference.js";import"../../../geometry/spatialReferenceEllipsoidUtils.js";import"../../../geometry/operators/support/GeographicTransformation.js";import"../../../geometry/projection/projectors.js";import"../engine/webgl/shaderGraph/techniques/shaders/GridShader.js";import"../../../geometry/support/geodesicConstants.js";import"../../../geometry/support/Ellipsoid.js";import{BitmapTileLayerView2D as n}from"./BitmapTileLayerView2D.js";import{LayerView2D as c}from"./LayerView2D.js";import g from"./graphics/HighlightGraphicContainer.js";import{createBlankImage as m,resampleImage as u}from"./support/imageUtils.js";import d from"../tiling/TileInfoView.js";import f from"../tiling/TileKey.js";import y from"../tiling/TileQueue.js";import w from"../tiling/TileStrategy.js";import j from"../../layers/LayerView.js";import{RefreshableLayerView as _}from"../../layers/RefreshableLayerView.js";import{getHighlightGraphics as T}from"../../layers/support/highlightUtils.js";import{isMapServiceLayerView as b,MapServiceLayerViewHelper as V}from"../../layers/support/MapServiceLayerViewHelper.js";import{createQueryGeometry as v}from"../../support/drapedUtils.js";import{getHighlightName as U}from"../../support/highlightOptionsUtils.js";import{TaskPriority as H}from"../../support/Scheduler.js";const I=[0,0];let q=class extends(_(n(c(j)))){constructor(){super(...arguments),this._fetchQueue=null,this._highlightGraphics=new l,this._highlightView=null,this._popupHighlightHelper=null,this._tileStrategy=null,this.layer=null}get resampling(){return!("resampling"in this.layer)||!1!==this.layer.resampling}get tilemapCache(){return"tilemapCache"in this.layer?this.layer.tilemapCache:null}update(e){this._fetchQueue.pause(),this._fetchQueue.state=e.state,this._tileStrategy.update(e),this._fetchQueue.resume(),this._highlightView?.processUpdate(e)}attach(){const e="tileServers"in this.layer?this.layer.tileServers:null,i=this.tilemapCache;if(this._tileInfoView=new d(this.layer.tileInfo,this.layer.fullExtent,i?.effectiveMinLOD,i?.effectiveMaxLOD),this._fetchQueue=new y({tileInfoView:this._tileInfoView,concurrency:e&&10*e.length||10,process:(e,i)=>this.fetchTile(e,i),scheduler:this.scheduler,priority:H.MAPVIEW_FETCH_QUEUE}),this._tileStrategy=new w({cachePolicy:"keep",resampling:this.resampling,acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),tileInfoView:this._tileInfoView}),b(this,this.layer)){const e=this._highlightView=new p({view:this.view,graphics:this._highlightGraphics,requestUpdateCallback:()=>this.requestUpdate(),container:new g(this.view.featuresTilingScheme),defaultPointSymbolEnabled:!1});this.container.addChild(this._highlightView.container),this._popupHighlightHelper=new V({createFetchPopupFeaturesQueryGeometry:(e,i)=>v(e,i,this.view),highlightGraphics:this._highlightGraphics,highlightGraphicUpdated:({graphic:i,property:t})=>e.graphicUpdateHandler({graphic:i,property:t}),layerView:this,updatingHandles:this._updatingHandles})}this.requestUpdate(),this.addAttachHandles(this._updatingHandles.add(()=>this.resampling,()=>{this.doRefresh()})),super.attach()}detach(){super.detach(),this._tileStrategy.destroy(),this._fetchQueue.clear(),this.container.removeAllChildren(),this._popupHighlightHelper?.destroy(),this._highlightView?.destroy(),this._fetchQueue=this._tileStrategy=this._tileInfoView=this._popupHighlightHelper=null}async fetchPopupFeaturesAtTarget(e,i,t){return this._popupHighlightHelper?this._popupHighlightHelper.fetchPopupFeaturesAtTarget(i,t):[]}highlight(e,t){const s=T(e);if(0===s.length)return i();const r=U(t);return this._addHighlightGraphics(s,r),i(()=>!this.destroyed&&this._removeHighlightGraphics(s,r))}_processHighlight(){const e=this._getHighlights();this._highlightView?.setHighlight(e)}_addHighlightGraphics(e,i){this._highlightGraphics.addMany(e),this._addHighlights(e.map(e=>e.uid),i)}_removeHighlightGraphics(e,i){this._highlightGraphics.removeMany(e),this._removeHighlights(e.map(e=>e.uid),i)}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}supportsSpatialReference(e){return o(this.layer.tileInfo?.spatialReference,e)}async doRefresh(){if(this.attached){if(this.suspended)return this._tileStrategy.clear(),void this.requestUpdate();this._fetchQueue.reset(),this._tileStrategy.refresh(e=>this._updatingHandles.addPromise(this._enqueueTileFetch(e)))}}acquireTile(e){const i=this._bitmapView.createTile(e),t=i.bitmap;return[t.x,t.y]=this._tileInfoView.getTileCoords(I,i.key),t.resolution=this._tileInfoView.getTileResolution(i.key),[t.width,t.height]=this._tileInfoView.size,this._updatingHandles.consumePromise(this._enqueueTileFetch(i)),this._bitmapView.addChild(i),this.requestUpdate(),i}releaseTile(e){this._fetchQueue.abort(e.key.id),this._bitmapView.removeChild(e),e.once("detach",()=>e.destroy()),this.requestUpdate()}async fetchTile(e,i={}){return this.tilemapCache?this._fetchTileWithTilemapCache(e,i):this._fetchTileWithoutTilemapCache(e,i)}async _fetchTileWithoutTilemapCache(e,i={}){const{signal:t,resamplingLevel:r=0}=i;try{return await this._fetchImage(e,t)}catch(h){if(s(h))throw h;if(!this.resampling)return m(this._tileInfoView.size);if(r<3){const t=this._tileInfoView.getTileParentId(e.id);if(t){const s=new f(t),h=await this._fetchTileWithoutTilemapCache(s,{...i,resamplingLevel:r+1});return u(this._tileInfoView,h,s,e)}}return m(this._tileInfoView.size)}}async _fetchTileWithTilemapCache(e,i={}){const t=this.tilemapCache,{signal:h,resamplingLevel:a=0}=i,o=new f(0,0,0,0);let l,p=null;try{if(p=await t.fetchAvailabilityUpsample(e.level,e.row,e.col,o,{signal:h}),!this.resampling&&o.level!==e.level)return await r(i),m(this._tileInfoView.size);l=await this._fetchImage(o,h)}catch(n){if(s(n))throw n;if(this.resampling&&"unknown"===p&&a<3){const t=this._tileInfoView.getTileParentId(e.id);if(t){o.set(t);try{l=await this._fetchTileWithTilemapCache(o,{...i,resamplingLevel:a+1})}catch{}}}}return l?this.resampling?u(this._tileInfoView,l,o,e):l:m(this._tileInfoView.size)}async _enqueueTileFetch(e){if(!this._fetchQueue.has(e.key.id)){try{const i=await this._fetchQueue.push(e.key);e.bitmap.source=i,e.bitmap.width=this._tileInfoView.size[0],e.bitmap.height=this._tileInfoView.size[1],e.once("attach",()=>this.requestUpdate()),e.once("isReady",()=>this.requestUpdate())}catch(i){s(i)||t.getLogger(this).error(i)}this.requestUpdate()}}async _fetchImage(e,i){return this.layer.fetchImageBitmapTile(e.level,e.row,e.col,{signal:i}).then(({bitmap:e})=>e)}};e([h()],q.prototype,"resampling",null),e([h()],q.prototype,"tilemapCache",null),q=e([a("esri.views.2d.layers.TileLayerView2D")],q);const S=q;export{S as default};
2
+ import{__decorate as e}from"tslib";import{makeHandle as i}from"../../../core/handleUtils.js";import t from"../../../core/Logger.js";import{isAbortError as s,waitTick as r}from"../../../core/promiseUtils.js";import{property as h,subclass as a}from"../../../core/accessorSupport/decorators.js";import{equals as o}from"../../../geometry/support/spatialReferenceUtils.js";import{GraphicsCollection as l}from"../../../support/GraphicsCollection.js";import"../engine/Stage.js";import"../../../Color.js";import"../../../core/libs/gl-matrix-2/factories/vec4f32.js";import"../../../geometry/Point.js";import"../../../chunks/pe.js";import"../../../core/units.js";import"../../../geometry/ellipsoidUtils.js";import"../../../core/RandomLCG.js";import"../../../core/Accessor.js";import"../../../core/has.js";import"../engine/transitions/FadeTransition.js";import"../../webgl/BufferObject.js";import"../../webgl/FramebufferObject.js";import"../../webgl/Program.js";import"../../webgl/Renderbuffer.js";import"../../webgl/Texture.js";import"../../webgl/enums.js";import"../../webgl/Util.js";import"../engine/webgl/meshing/definitions.js";import"../engine/webgl/shaderGraph/techniques/shaders/VideoScreenShader.js";import"../LabelManager.js";import p from"./graphics/GraphicsView2D.js";import"../../../layers/effects/EffectView.js";import"../engine/webgl/shaderGraph/techniques/clip/ClipTechnique.js";import"../engine/webgl/AFeatureTile.js";import"../engine/webgl/DisplayEntity.js";import"../../../core/libs/gl-matrix-2/factories/vec2f32.js";import"../engine/webgl/number.js";import"../engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js";import"../engine/webgl/cpuMapped/GpuMeshState.js";import"../engine/webgl/shaderGraph/techniques/shaders/TileDebugInfoShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/TileStencilShader.js";import"../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import"../../../core/libs/gl-matrix-2/factories/vec3f32.js";import"../../../geometry/support/normalizeUtils.js";import"./support/util.js";import"../navigation/MapViewNavigation.js";import"../../../request.js";import"../../../core/asyncUtils.js";import"../../../core/accessorSupport/watch.js";import"../../../core/accessorSupport/tracking/SimpleTrackingTarget.js";import"../../../core/support/UpdatingHandles.js";import"../../../core/mathUtils.js";import"../../../core/urlUtils.js";import"../engine/webgl/shaderGraph/techniques/shaders/MagnifierShader.js";import"../../../geometry/Extent.js";import"../../../geometry/Geometry.js";import"../../../geometry/Multipoint.js";import"../../../geometry/Polygon.js";import"../../../geometry/Polyline.js";import"../../../geometry/SpatialReference.js";import"../../../geometry/spatialReferenceEllipsoidUtils.js";import"../../../geometry/operators/support/GeographicTransformation.js";import"../../../geometry/projection/projectors.js";import"../engine/webgl/shaderGraph/techniques/shaders/GridShader.js";import"../../../geometry/support/geodesicConstants.js";import"../../../geometry/support/Ellipsoid.js";import{BitmapTileLayerView2D as n}from"./BitmapTileLayerView2D.js";import{LayerView2D as c}from"./LayerView2D.js";import g from"./graphics/HighlightGraphicContainer.js";import{createBlankImage as m,resampleImage as u}from"./support/imageUtils.js";import d from"../tiling/TileInfoView.js";import f from"../tiling/TileKey.js";import y from"../tiling/TileQueue.js";import w from"../tiling/TileStrategy.js";import j from"../../layers/LayerView.js";import{RefreshableLayerView as _}from"../../layers/RefreshableLayerView.js";import{getHighlightGraphics as T}from"../../layers/support/highlightUtils.js";import{isMapServiceLayerView as b,MapServiceLayerViewHelper as V}from"../../layers/support/MapServiceLayerViewHelper.js";import{createQueryGeometry as v}from"../../support/drapedUtils.js";import{getHighlightName as U}from"../../support/highlightOptionsUtils.js";import{TaskPriority as H}from"../../support/Scheduler.js";const I=[0,0];let q=class extends(_(n(c(j)))){constructor(){super(...arguments),this._fetchQueue=null,this._highlightGraphics=new l,this._highlightView=null,this._popupHighlightHelper=null,this._tileStrategy=null,this.layer=null}get resampling(){return!("resampling"in this.layer)||!1!==this.layer.resampling}get tilemapCache(){return"tilemapCache"in this.layer?this.layer.tilemapCache:null}update(e){this._fetchQueue.pause(),this._fetchQueue.state=e.state,this._tileStrategy.update(e),this._fetchQueue.resume(),this._highlightView?.processUpdate(e)}attach(){const e="tileServers"in this.layer?this.layer.tileServers:null,i=this.tilemapCache;if(this._tileInfoView=new d(this.layer.tileInfo,this.layer.fullExtent,i?.effectiveMinLOD,i?.effectiveMaxLOD),this._fetchQueue=new y({tileInfoView:this._tileInfoView,concurrency:e&&10*e.length||10,process:(e,i)=>this.fetchTile(e,i),scheduler:this.scheduler,priority:H.MAPVIEW_FETCH_QUEUE}),this._tileStrategy=new w({cachePolicy:"keep",resampling:this.resampling,acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),tileInfoView:this._tileInfoView}),b(this,this.layer)){const e=this._highlightView=new p({view:this.view,graphics:this._highlightGraphics,requestUpdateCallback:()=>this.requestUpdate(),container:new g(this.view.featuresTilingScheme),defaultPointSymbolEnabled:!1});this.container.addChild(this._highlightView.container),this._popupHighlightHelper=new V({createFetchPopupFeaturesQueryGeometry:(e,i)=>v(e,i,this.view),highlightGraphics:this._highlightGraphics,highlightGraphicUpdated:({graphic:i,property:t})=>e.graphicUpdateHandler({graphic:i,property:t}),layerView:this,updatingHandles:this._updatingHandles})}this.requestUpdate(),this.addAttachHandles(this._updatingHandles.add(()=>this.resampling,()=>{this.doRefresh()})),super.attach()}detach(){super.detach(),this._tileStrategy.destroy(),this._fetchQueue.clear(),this.container.removeAllChildren(),this._popupHighlightHelper?.destroy(),this._highlightView?.destroy(),this._fetchQueue=this._tileStrategy=this._tileInfoView=this._popupHighlightHelper=null}async fetchPopupFeaturesAtTarget(e,i,t){return this._popupHighlightHelper?this._popupHighlightHelper.fetchPopupFeaturesAtTarget(i,t):[]}highlight(e,t){const s=T(e);if(0===s.length)return i();const r=U(t);return this._addHighlightGraphics(s,r),i(()=>!this.destroyed&&this._removeHighlightGraphics(s,r))}_processHighlight(){const e=this._getHighlights();this._highlightView?.setHighlight(e)}_addHighlightGraphics(e,i){this._highlightGraphics.addMany(e),this._addHighlights(e.map(e=>e.uid),i)}_removeHighlightGraphics(e,i){this._highlightGraphics.removeMany(e),this._removeHighlights(e.map(e=>e.uid),i)}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}supportsSpatialReference(e){return o(this.layer.tileInfo?.spatialReference,e)}async doRefresh(){if(this.attached){if(this.suspended)return this._tileStrategy.clear(),void this.requestUpdate();this._fetchQueue.reset(),this._tileStrategy.refresh(e=>this._updatingHandles.addPromise(this._enqueueTileFetch(e)))}}acquireTile(e){const i=this._bitmapView.createTile(e),t=i.bitmap;return[t.x,t.y]=this._tileInfoView.getTileCoords(I,i.key),t.resolution=this._tileInfoView.getTileResolution(i.key),[t.width,t.height]=this._tileInfoView.size,this._updatingHandles.consumePromise(this._enqueueTileFetch(i)),this._bitmapView.addChild(i),this.requestUpdate(),i}releaseTile(e){this._fetchQueue.abort(e.key.id),this._bitmapView.removeChild(e),e.once("detach",()=>e.destroy()),this.requestUpdate()}async fetchTile(e,i={}){return this.tilemapCache?this._fetchTileWithTilemapCache(e,i):this._fetchTileWithoutTilemapCache(e,i)}async _fetchTileWithoutTilemapCache(e,i={}){const{signal:t,resamplingLevel:r=0}=i;try{return await this._fetchImage(e,t)}catch(h){if(s(h))throw h;if(!this.resampling)return m(this._tileInfoView.size);if(r<3){const t=this._tileInfoView.getTileParentId(e.id);if(t){const s=new f(t),h=await this._fetchTileWithoutTilemapCache(s,{...i,resamplingLevel:r+1});return u(this._tileInfoView,h,s,e)}}return m(this._tileInfoView.size)}}async _fetchTileWithTilemapCache(e,i={}){const t=this.tilemapCache,{signal:h,resamplingLevel:a=0}=i,o=new f(0,0,0,0);let l,p=null;try{if(p=await t.fetchAvailabilityUpsample(e.level,e.row,e.col,o,{signal:h}),!this.resampling&&o.level!==e.level)return await r(i),m(this._tileInfoView.size);l=await this._fetchImage(o,h)}catch(n){if(s(n))throw n;if(this.resampling&&"unknown"===p&&a<3){const t=this._tileInfoView.getTileParentId(e.id);if(t){o.set(t);try{l=await this._fetchTileWithTilemapCache(o,{...i,resamplingLevel:a+1})}catch{}}}}return l?this.resampling?u(this._tileInfoView,l,o,e):l:m(this._tileInfoView.size)}async _enqueueTileFetch(e){if(!this._fetchQueue.has(e.key.id)){try{const i=await this._fetchQueue.push(e.key);e.bitmap.source=i,e.bitmap.width=this._tileInfoView.size[0],e.bitmap.height=this._tileInfoView.size[1],e.once("attach",()=>this.requestUpdate()),e.once("isReady",()=>this.requestUpdate())}catch(i){s(i)||t.getLogger(this).error(i)}this.requestUpdate()}}async _fetchImage(e,i){return this.layer.fetchImageBitmapTile(e.level,e.row,e.col,{signal:i}).then(({bitmap:e})=>e)}};e([h()],q.prototype,"resampling",null),e([h()],q.prototype,"tilemapCache",null),q=e([a("esri.views.2d.layers.TileLayerView2D")],q);const S=q;export{S as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import has from"../../../../core/has.js";import{destroyMaybe as e}from"../../../../core/maybe.js";import{notDeepEqual as t}from"../../../../core/object.js";import{throwIfAborted as s,after as r}from"../../../../core/promiseUtils.js";import{diff as i}from"../../../../core/accessorSupport/diffUtils.js";import{ignoreConnectionErrors as a}from"../../../../core/workers/utils.js";import{normalizeTransform as o,quantizeX as n,quantizeY as c}from"../../../../geometry/support/quantizationUtils.js";import{MultiTileMeshData as h}from"../../engine/webgl/mesh/MultiTileMeshData.js";import{FeatureMeshFactory as u}from"../../engine/webgl/mesh/factories/FeatureMeshFactory.js";import{ResourceProxy as p}from"../../engine/webgl/mesh/factories/ResourceProxy.js";import{MeshWriterRegistry as g}from"../../engine/webgl/shaderGraph/techniques/mesh/MeshWriterRegistry.js";import{MatcherContext as y}from"../../engine/webgl/util/MatcherContext.js";import{BinningStrategy as d}from"./processor/BinningStrategy.js";import{ClusterStrategy as _}from"./processor/ClusterStrategy.js";import{FeatureUpdateStrategy as l}from"./processor/FeatureUpdateStrategy.js";import{TrackStrategy as m}from"./processor/TrackStrategy.js";import{AttributeStore as f}from"./support/AttributeStore.js";import{ComputedAttributeStorage as b}from"./support/ComputedAttributeStorage.js";class w{constructor(e,t){this._connection=e,this._source=t,this._version=1,this._registry=new g,this._proxy=new p({fetch:(e,t)=>this._connection.layerView.fetch(e,t),fetchDictionary:(e,t)=>this._connection.layerView.fetchDictionary(e,t),fetchMesh:(e,t)=>this._connection.layerView.fetchMesh(e,t)}),this._attributeStore=new f({isLocal:!1,update:e=>a(this._connection.container.updateAttributeView(e))})}destroy(){this._proxy.destroy(),this._strategy?.destroy(),this._attributeStore.destroy()}get hasClusters(){return"cluster"===this._schema?.mesh.strategy.type}get aggregateQueryEngine(){return this._strategy?.aggregateQueryEngine}get usedMemory(){let e=0;return e+=this._attributeStore.usedMemory,this._strategy&&(e+=this._strategy.usedMemory),e}get version(){return this._version}getDisplayFeatures(e){return this._strategy?this._strategy.getDisplayFeatures(e):{features:[],aggregates:[],tracks:[]}}getDisplayIds(e){const t={};return this._strategy?(this._strategy.displayMap(e,e=>e,(e,s,r)=>{t[r]=e}),t):t}getFeatureObjectIdsForAggregate(e){return this._strategy?this._strategy.getFeatureObjectIdsForAggregate(e):[]}onSubscribe(e){this._strategy?.onSubscribe(e)}onUnsubscribe(e){this._strategy?.onUnsubscribe(e)}requiresInvalidation(e){return this._strategy?.requiresInvalidation(e)??!1}async update(e,s,r,a,o){const n=e.processor,c=t(this._schema?.storage,n.storage),h=t(this._schema?.mesh.properties,n.mesh.properties),p=t(this._schema?.mesh.factory,n.mesh.factory),g=t(this._schema?.mesh.strategy,n.mesh.strategy),d=S(this._schema?.expressionProperties,n.expressionProperties),_=d.some(e=>this._attributeStore.hasArcadeDependency(e)),l=d.some(e=>this._factory?.hasArcadeDependency(e)??!1),m=d.some(e=>this._strategy?.hasArcadeDependency(e))||this._strategy?.isAggregate&&_,f=l||m,w=h||p||g;if(!(c||w||(l||_||m))&&!a)return!1;has("esri-2d-update-debug")&&console.debug(`Version[${this._version}] SymbolProcessor.update`,{changes:i(this._schema,n),schema:n}),this._schema=n;const j=new b({fields:this._source.metadata.fieldsIndex,spatialReference:this._source.metadata.outSpatialReference}),I={currentUser:n.mesh.properties.currentUser};if((c||w||_)&&(await this._attributeStore.update(n.storage,j,this._source.metadata,s),this._strategy?.invalidateAttributeData(v(n))),!a&&!w&&!f)return!1;(g||h||f)&&await this._updateStrategy(n.mesh.strategy,o,v(n),I),this._updateSortKey(j,"sortKey"in n.mesh.properties?n.mesh.properties.sortKey:null);const M="dictionary"===n.mesh.factory.symbology.type?n.mesh.factory.symbology.fieldMap:null,x=new y(j,this._proxy,r,this._registry,M);return(p||"dictionary"===n.mesh.factory.symbology.type)&&(this._factory=await u.create(x,n.mesh.factory)),this._version=s,!0}async applyOverrideUpdate(e,t){if(this._strategy)try{const s=await this._strategy.applyOverrideUpdate(e);s&&await this._process(s,t)}catch(s){}}async updateChunks(e,t,s){await this._doUpdateChunks(e,t,s),this._strategy?.afterUpdateChunks()}async removeChunks(e){this._strategy?.removeChunks(e),this._attributeStore.incrementDisplayIdGeneration()}updateHighlight({highlights:e}){if(!this._strategy||!this._strategy.hasSubscribers)return void this._attributeStore.setHighlight(e.map(({objectId:e,highlightFlags:t})=>({objectId:e,highlightFlags:t,displayId:-1})),e);const t=this._strategy.displayMap(e,({objectId:e})=>e,(e,{highlightFlags:t},s)=>({objectId:s,displayId:e,highlightFlags:t}));this._attributeStore.setHighlight(t,e)}invalidate(){this._strategy&&this._strategy.invalidate()}async _doUpdateChunks(e,t,s){if(this._strategy){try{const r=await this._strategy.updateChunks(e,t);r&&await this._process(r,s)}catch(r){}has("esri-2d-update-debug")&&console.log("SendUpdates"),this._attributeStore.sendUpdates(),has("esri-2d-update-debug")&&console.log("SendUpdates.await")}}async _updateStrategy(e,t,s,r){switch(this._strategy?.destroy(),e.type){case"feature":this._strategy=new l(this._source,this._attributeStore,s,r);break;case"binning":this._strategy=await d.create(e,this._source,this._attributeStore,s,r);break;case"cluster":this._strategy=await _.create(this._connection,e,this._source,this._attributeStore,s,r);break;case"track":this._strategy=await m.create(e,this._source,this._attributeStore,s,r)}for(const i of t)this._strategy.onSubscribe(i)}async _updateSortKey(t,s){if(this._sortInfo=e(this._sortInfo?.computed),null!=s){const e=s.byRenderer?null:await t.createComputedField(s);this._sortInfo={...s,computed:e}}}async _process(e,t){switch(e.type){case"level-replace":return this._processLevelBatch(e,t);case"append":case"update":return this._processStandardBatch(e,t)}}async _processLevelBatch(e,t){const s=await this._connection.container.beginLevelMeshUpdate(e.level);await this._processBatchMessages(e.messages,t),await this._connection.container.applyLevelMeshUpdate(s)}async _processStandardBatch(e,t){return this._processBatchMessages(e.messages,t)}async _processBatchMessages(e,t){for(const r of e){const e=r.subscription;if(has("esri-2d-update-debug")){const t=e.tile;console.debug(`Version[${this._version}] Tile[${t.key.id}, end=${r.end}] Processor._process`)}const i={currentUser:this._schema?.mesh.properties.currentUser};await this._fetchResources(r,i),s(e.signal);const a=await this._write(r,e.tile.createArcadeEvaluationOptions(v(this._schema)),i,t),o=e.tile.tileInfoView.getLODInfoAt(e.tile.key);s(e.signal);const{message:n,transferList:c}=a.serialize(o),h={objectIdMap:null,inner:r.createMessage(n,this._version,this._attributeStore.epoch)};if(this._schema?.mesh.properties.returnMeshObjectId){h.objectIdMap={};const e=r.reader?.getCursor();if(e)for(;e.next();)h.objectIdMap[e.getDisplayId()]=e.getObjectId()}if(s(e.signal),await this._connection.container.onMessage(h,{signal:e.signal,transferList:c}),this._attributeStore.sendUpdates(),has("esri-2d-update-debug")){const t=e.tile;console.debug(`Version[${this._version}] Tile[${t.key.id}, end=${r.end}] Processor._process.await`)}}}async _fetchResources(e,t){await this._fetchMatcherResources(e),await this._fetchWriterResources(e,t)}async _fetchMatcherResources(e){if(!e.reader)return;const t=e.subscription.tile.createArcadeEvaluationOptions(v(this._schema));return this._factory.enqueueMatcherRequests(this._proxy,e.reader,{scale:t.$view.scale,viewingMode:"2d"},e.id)}async _fetchWriterResources(e,t){if(!e.reader)return;const s=e.reader.getCursor(),r=e.subscription.tile.createArcadeEvaluationOptions(v(this._schema));for(;s.next();)this._factory.enqueueWriterRequests(this._proxy,s,r,t);await this._proxy.fetchEnqueuedResources()}async _write(e,t,i,a){const o=e.subscription.tile,n=e.reader?.getCursor(),c=n?.getSize()??0,u=o.tileInfoView.tileInfo.isWrappable,p=o.tileInfoView.spatialReference.isWGS84,g=this._schema?.mesh.factory.referenceScale,y=new h(o.key,this._strategy.enablePixelBuffering,u,p,c);if(!n)return y;const d=j(o.transform,a),_=o.createArcadeEvaluationOptions(v(this._schema));let l=0;for(;n.next();){++l%1e3||(await r(0),s(e.subscription));const a=this._getSortKeyValue(n,t);y.entityStart(n.getDisplayId(),a);try{this._factory.write(y,this._proxy,n,_,i,o.level,d,g)}catch(m){}y.entityEnd()}return y}_getSortKeyValue(e,t){if(!this._sortInfo)return 0;const{computed:s,order:r,byRenderer:i}=this._sortInfo,a=i?this._factory.getSortKey(e,t):s?.read(e,t);return null==a||isNaN(a)?0:a*("asc"===r?-1:1)}}function S(e,t){const s=[];return e?.timeExtent?.start===t.timeExtent?.start&&e?.timeExtent?.end===t.timeExtent?.end||s.push("timeProperties"),s}function v(e){const{timeZone:t}=e?.mesh.properties??{},{timeExtent:s}=e?.expressionProperties??{};return{timeZone:t,timeExtent:s}}function j(e,t){const s=o(e),r=[];for(const i of t.rings){const e=[];for(const t of i)e.push([n(s,t[0]),c(s,t[1])]);r.push(e)}return{rings:r}}export{w as default};
2
+ import has from"../../../../core/has.js";import{destroyMaybe as e}from"../../../../core/maybe.js";import{notDeepEqual as t}from"../../../../core/object.js";import{throwIfAborted as s,after as r}from"../../../../core/promiseUtils.js";import{diff as i}from"../../../../core/accessorSupport/diffUtils.js";import{ignoreConnectionErrors as a}from"../../../../core/workers/utils.js";import{normalizeTransform as o,quantizeX as n,quantizeY as c}from"../../../../geometry/support/quantizationUtils.js";import{checkProjectionSupport as h}from"../../../../layers/graphics/data/projectionSupport.js";import{MultiTileMeshData as u}from"../../engine/webgl/mesh/MultiTileMeshData.js";import{FeatureMeshFactory as p}from"../../engine/webgl/mesh/factories/FeatureMeshFactory.js";import{ResourceProxy as g}from"../../engine/webgl/mesh/factories/ResourceProxy.js";import{MeshWriterRegistry as y}from"../../engine/webgl/shaderGraph/techniques/mesh/MeshWriterRegistry.js";import{MatcherContext as d}from"../../engine/webgl/util/MatcherContext.js";import{BinningStrategy as _}from"./processor/BinningStrategy.js";import{ClusterStrategy as l}from"./processor/ClusterStrategy.js";import{FeatureUpdateStrategy as m}from"./processor/FeatureUpdateStrategy.js";import{TrackStrategy as f}from"./processor/TrackStrategy.js";import{AttributeStore as b}from"./support/AttributeStore.js";import{ComputedAttributeStorage as w}from"./support/ComputedAttributeStorage.js";class S{constructor(e,t){this._connection=e,this._source=t,this._version=1,this._registry=new y,this._proxy=new g({fetch:(e,t)=>this._connection.layerView.fetch(e,t),fetchDictionary:(e,t)=>this._connection.layerView.fetchDictionary(e,t),fetchMesh:(e,t)=>this._connection.layerView.fetchMesh(e,t)}),this._attributeStore=new b({isLocal:!1,update:e=>a(this._connection.container.updateAttributeView(e))})}destroy(){this._proxy.destroy(),this._strategy?.destroy(),this._attributeStore.destroy()}get hasClusters(){return"cluster"===this._schema?.mesh.strategy.type}get aggregateQueryEngine(){return this._strategy?.aggregateQueryEngine}get usedMemory(){let e=0;return e+=this._attributeStore.usedMemory,this._strategy&&(e+=this._strategy.usedMemory),e}get version(){return this._version}getDisplayFeatures(e){return this._strategy?this._strategy.getDisplayFeatures(e):{features:[],aggregates:[],tracks:[]}}getDisplayIds(e){const t={};return this._strategy?(this._strategy.displayMap(e,e=>e,(e,s,r)=>{t[r]=e}),t):t}getFeatureObjectIdsForAggregate(e){return this._strategy?this._strategy.getFeatureObjectIdsForAggregate(e):[]}onSubscribe(e){this._strategy?.onSubscribe(e)}onUnsubscribe(e){this._strategy?.onUnsubscribe(e)}requiresInvalidation(e){return this._strategy?.requiresInvalidation(e)??!1}async update(e,s,r,a,o){const n=e.processor,c=t(this._schema?.storage,n.storage),u=t(this._schema?.mesh.properties,n.mesh.properties),g=t(this._schema?.mesh.factory,n.mesh.factory),y=t(this._schema?.mesh.strategy,n.mesh.strategy),_=j(this._schema?.expressionProperties,n.expressionProperties),l=_.some(e=>this._attributeStore.hasArcadeDependency(e)),m=_.some(e=>this._factory?.hasArcadeDependency(e)??!1),f=_.some(e=>this._strategy?.hasArcadeDependency(e))||this._strategy?.isAggregate&&l,b=m||f,S=u||g||y;if(!(c||S||(m||l||f))&&!a)return!1;if(has("esri-2d-update-debug")&&console.debug(`Version[${this._version}] SymbolProcessor.update`,{changes:i(this._schema,n),schema:n}),this._schema=n,"annotation-feature"===n.mesh.factory.symbology.type||"dimension-feature"===n.mesh.factory.symbology.type){const e=this._source.metadata.outSpatialReference,t=this._source.metadata.attributeSpatialReference??this._source.metadata.spatialReference??e;await h(t,e)}const I=new w({fields:this._source.metadata.fieldsIndex,spatialReference:this._source.metadata.outSpatialReference}),M={currentUser:n.mesh.properties.currentUser};if((c||S||l)&&(await this._attributeStore.update(n.storage,I,this._source.metadata,s),this._strategy?.invalidateAttributeData(v(n))),!a&&!S&&!b)return!1;(y||u||b)&&await this._updateStrategy(n.mesh.strategy,o,v(n),M),this._updateSortKey(I,"sortKey"in n.mesh.properties?n.mesh.properties.sortKey:null);const x="dictionary"===n.mesh.factory.symbology.type?n.mesh.factory.symbology.fieldMap:null,U=new d(I,this._proxy,r,this._registry,x);return(g||"dictionary"===n.mesh.factory.symbology.type)&&(this._factory=await p.create(U,n.mesh.factory)),this._version=s,!0}async applyOverrideUpdate(e,t){if(this._strategy)try{const s=await this._strategy.applyOverrideUpdate(e);s&&await this._process(s,t)}catch(s){}}async updateChunks(e,t,s){await this._doUpdateChunks(e,t,s),this._strategy?.afterUpdateChunks()}async removeChunks(e){this._strategy?.removeChunks(e),this._attributeStore.incrementDisplayIdGeneration()}updateHighlight({highlights:e}){if(!this._strategy||!this._strategy.hasSubscribers)return void this._attributeStore.setHighlight(e.map(({objectId:e,highlightFlags:t})=>({objectId:e,highlightFlags:t,displayId:-1})),e);const t=this._strategy.displayMap(e,({objectId:e})=>e,(e,{highlightFlags:t},s)=>({objectId:s,displayId:e,highlightFlags:t}));this._attributeStore.setHighlight(t,e)}invalidate(){this._strategy&&this._strategy.invalidate()}async _doUpdateChunks(e,t,s){if(this._strategy){try{const r=await this._strategy.updateChunks(e,t);r&&await this._process(r,s)}catch(r){}has("esri-2d-update-debug")&&console.log("SendUpdates"),this._attributeStore.sendUpdates(),has("esri-2d-update-debug")&&console.log("SendUpdates.await")}}async _updateStrategy(e,t,s,r){switch(this._strategy?.destroy(),e.type){case"feature":this._strategy=new m(this._source,this._attributeStore,s,r);break;case"binning":this._strategy=await _.create(e,this._source,this._attributeStore,s,r);break;case"cluster":this._strategy=await l.create(this._connection,e,this._source,this._attributeStore,s,r);break;case"track":this._strategy=await f.create(e,this._source,this._attributeStore,s,r)}for(const i of t)this._strategy.onSubscribe(i)}async _updateSortKey(t,s){if(this._sortInfo=e(this._sortInfo?.computed),null!=s){const e=s.byRenderer?null:await t.createComputedField(s);this._sortInfo={...s,computed:e}}}async _process(e,t){switch(e.type){case"level-replace":return this._processLevelBatch(e,t);case"append":case"update":return this._processStandardBatch(e,t)}}async _processLevelBatch(e,t){const s=await this._connection.container.beginLevelMeshUpdate(e.level);await this._processBatchMessages(e.messages,t),await this._connection.container.applyLevelMeshUpdate(s)}async _processStandardBatch(e,t){return this._processBatchMessages(e.messages,t)}async _processBatchMessages(e,t){for(const r of e){const e=r.subscription;if(has("esri-2d-update-debug")){const t=e.tile;console.debug(`Version[${this._version}] Tile[${t.key.id}, end=${r.end}] Processor._process`)}const i={currentUser:this._schema?.mesh.properties.currentUser};await this._fetchResources(r,i),s(e.signal);const a=await this._write(r,e.tile.createArcadeEvaluationOptions(v(this._schema)),i,t),o=e.tile.tileInfoView.getLODInfoAt(e.tile.key);s(e.signal);const{message:n,transferList:c}=a.serialize(o),h={objectIdMap:null,inner:r.createMessage(n,this._version,this._attributeStore.epoch)};if(this._schema?.mesh.properties.returnMeshObjectId){h.objectIdMap={};const e=r.reader?.getCursor();if(e)for(;e.next();)h.objectIdMap[e.getDisplayId()]=e.getObjectId()}if(s(e.signal),await this._connection.container.onMessage(h,{signal:e.signal,transferList:c}),this._attributeStore.sendUpdates(),has("esri-2d-update-debug")){const t=e.tile;console.debug(`Version[${this._version}] Tile[${t.key.id}, end=${r.end}] Processor._process.await`)}}}async _fetchResources(e,t){await this._fetchMatcherResources(e),await this._fetchWriterResources(e,t)}async _fetchMatcherResources(e){if(!e.reader)return;const t=e.subscription.tile.createArcadeEvaluationOptions(v(this._schema));return this._factory.enqueueMatcherRequests(this._proxy,e.reader,{scale:t.$view.scale,viewingMode:"2d"},e.id)}async _fetchWriterResources(e,t){if(!e.reader)return;const s=e.reader.getCursor(),r=e.subscription.tile.createArcadeEvaluationOptions(v(this._schema));for(;s.next();)this._factory.enqueueWriterRequests(this._proxy,s,r,t,e.id);await this._proxy.fetchEnqueuedResources()}async _write(e,t,i,a){const o=e.subscription.tile,n=e.reader?.getCursor(),c=n?.getSize()??0,h=o.tileInfoView.tileInfo.isWrappable,p=o.tileInfoView.spatialReference.isWGS84,g=this._schema?.mesh.factory.referenceScale,y=new u(o.key,this._strategy.enablePixelBuffering,h,p,c);if(!n)return y;const d=I(o.transform,a),_=o.createArcadeEvaluationOptions(v(this._schema));let l=0;for(;n.next();){++l%1e3||(await r(0),s(e.subscription));const a=this._getSortKeyValue(n,t);y.entityStart(n.getDisplayId(),a);try{this._factory.write(y,this._proxy,n,_,i,o.level,d,g)}catch(m){}y.entityEnd()}return y}_getSortKeyValue(e,t){if(!this._sortInfo)return 0;const{computed:s,order:r,byRenderer:i}=this._sortInfo,a=i?this._factory.getSortKey(e,t):s?.read(e,t);return null==a||isNaN(a)?0:a*("asc"===r?-1:1)}}function j(e,t){const s=[];return e?.timeExtent?.start===t.timeExtent?.start&&e?.timeExtent?.end===t.timeExtent?.end||s.push("timeProperties"),s}function v(e){const{timeZone:t}=e?.mesh.properties??{},{timeExtent:s}=e?.expressionProperties??{};return{timeZone:t,timeExtent:s}}function I(e,t){const s=o(e),r=[];for(const i of t.rings){const e=[];for(const t of i)e.push([n(s,t[0]),c(s,t[1])]);r.push(e)}return{rings:r}}export{S as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{clone as e}from"../../../../../core/lang.js";import{sqlNotIn as t,sqlAnd as r}from"../../../../../core/sql.js";import{isHostedAgolService as s}from"../../../../../layers/support/arcgisLayerUrl.js";import a from"../../../../../layers/support/FeatureFilter.js";import{createFeatureIdInfo as i}from"./featureServiceUtils.js";import{addFloorFilter as o,hasFloorFilter as n}from"./floorFilterUtils.js";import{getServiceGeometryType as l}from"./geometryUtils.js";import{ExceedsLimitCache as p}from"../schema/ExceedsLimitCache.js";import{createSnapshotInfo as u,createFeatureSourceSchema as c}from"../schema/SourceSchema.js";import{getSortKey as m}from"../schema/processor/SimpleProcessorSchema.js";import{createStorageSchema as y}from"../schema/processor/StorageSchema.js";import{getAnnotationMatcherSchema as d}from"../../support/annodime/annotationSchema.js";import{annotationRealFields as h,annotationVirtualFields as f}from"../../support/annodime/fields.js";import{getReferenceScale as g}from"../../support/annodime/utils.js";class S{constructor(e){this.layer=e,this._cache=new p}getLabelingDeconflictionInfo(){return[]}async createSourceSchema(e,t){const r=this._createServiceInfo(e),s=null!=this.layer.editingInfo?.lastEditDate,a=this.layer.refreshInterval>0,i=!s&&a,o=u("isSourceHosted"in r&&r.isSourceHosted,i,this.layer.capabilities,r.metadata.geometryType,e.extent,this.layer.fullExtent);let n=[];return n=e.availableFields.concat(...h),c(r,o,{definitionExpression:this.layer.definitionExpression,queryScaleRanges:[],displayFilterEnabled:!1,displayFilterInfo:null,customParameters:this.layer.customParameters,gdbVersion:this.layer.gdbVersion,historicMoment:this.layer.historicMoment,timeExtent:this.layer.timeExtent,apiKey:this.layer.apiKey,sourceRefreshVersion:t,availableFields:n,cache:this._cache,postQueryFilter:null,returnM:!1,returnZ:!1})}async createProcessorSchema(e,t,r){const{meshes:s,referenceScale:a}=await this._fetchAnnotationDataElementRequest(e,{type:"annotation-data-element-request"}),{objectIdField:i}=this.layer,o=m(null,null,i);return{storage:y(null,t.filters),mesh:{properties:{sortKey:o,timeZone:t.timeZone,returnMeshObjectId:!1,displayRefreshVersion:r,currentUser:t.currentUser},strategy:{type:"feature"},factory:{symbology:s,labels:{type:"label",classes:[]},referenceScale:a}},expressionProperties:{timeExtent:null}}}get hasRequiredSupport(){return!0}get timeOptions(){return this.layer}addFilters(e,s){e=o(this.layer,e,s);const i=this.layer.sublayers.filter(e=>!e.visible).map(e=>e.subtypeCode);if(!i.length)return e;e??=new a;const n=t(this.layer.subtypeField,i.toArray());return e.where=r(e.where,n),e}getUpdateHashProperties(e){return this.layer.destroyed?[]:[()=>this.layer.apiKey,()=>this.layer.customParameters,()=>this.layer.definitionExpression,()=>n(this.layer,e)?e.floors:null,()=>this.layer.gdbVersion,()=>this.layer.historicMoment,()=>this.layer.outFields,()=>this.layer.sublayers.map(({visible:e})=>({visible:e}))]}getRenderer(){return null}setGraphicOrigin(e){const t=this.layer.findSublayerForFeature(e);e.layer=e.sourceLayer=this.layer,e.origin=t?.graphicOrigin}_createServiceInfo(t){const r=this.layer,a=r.fieldsIndex.toJSON();a.fields.push(...f);const{capabilities:o,editingInfo:n,globalIdField:p,datesInUnknownTimezone:u,dateFieldsTimeZone:c,subtypeField:m}=r,y=l(r),d=r.timeInfo?.toJSON(),h=r.spatialReference.toJSON(),g=e(this.layer.parsedUrl),S=this.layer.objectIdField,b=s(g.path),F=t.spatialReference.toJSON();return{type:"feature-service",source:g,isSourceHosted:b,orderByFields:S,outSpatialReference:F,metadata:{timeReferenceUnknownClient:u,dateFieldsTimeZone:c,subtypeField:m,globalIdField:p,fieldsIndex:a,geometryType:y,featureIdInfo:i(r),timeInfo:d,spatialReference:h,outSpatialReference:F,subtypes:this.layer.subtypes?.map(e=>e.toJSON()),typeIdField:null,types:null,layerType:r.type,hasM:!1,hasZ:!1},queryMetadata:{supportsFormatPBF:o.query.supportsFormatPBF,supportsQuantization:!1,maxRecordCount:o.query.maxRecordCount,tileMaxRecordCount:o.query.tileMaxRecordCount,supportsCompactGeometry:o.query.supportsCompactGeometry,supportsDefaultSpatialReference:o.query.supportsDefaultSpatialReference,supportsMaxRecordCountFactor:o.query.supportsMaxRecordCountFactor,supportsCentroidOnDegeneratedQuantizedGeometry:o.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:o.query.supportsDegeneratedQuantizedGeometry,lastEditDate:n?.lastEditDate?.getTime(),supportsReturnExceededLimitGeometries:o.query.supportsReturnExceededLimitGeometries}}}async _fetchAnnotationDataElementRequest(e,t){const r={cimAnalyzer:e.cimAnalyzer,cimResourceManager:e.cimResourceManager,store:e.store,scaleExpression:null},s=this.layer,a=await s.fetchDataElement(),i=g(a);return{type:"annotation-data-element-response",dataElement:a,meshes:await d(a,r),referenceScale:i}}}export{S as AnnotationLayerAdapter};
2
+ import{clone as e}from"../../../../../core/lang.js";import{sqlNotIn as t,sqlAnd as r}from"../../../../../core/sql.js";import{isHostedAgolService as s}from"../../../../../layers/support/arcgisLayerUrl.js";import a from"../../../../../layers/support/FeatureFilter.js";import{createFeatureIdInfo as i}from"./featureServiceUtils.js";import{addFloorFilter as o,hasFloorFilter as n}from"./floorFilterUtils.js";import{getServiceGeometryType as l}from"./geometryUtils.js";import{ExceedsLimitCache as p}from"../schema/ExceedsLimitCache.js";import{createSnapshotInfo as u,createFeatureSourceSchema as c}from"../schema/SourceSchema.js";import{getSortKey as m}from"../schema/processor/SimpleProcessorSchema.js";import{createStorageSchema as y}from"../schema/processor/StorageSchema.js";import{getAnnotationMatcherSchema as d}from"../../support/annodime/annotationSchema.js";import{annotationRealFields as h,annotationVirtualFields as f}from"../../support/annodime/fields.js";import{getReferenceScale as g}from"../../support/annodime/utils.js";class S{constructor(e){this.layer=e,this._cache=new p}getLabelingDeconflictionInfo(){return[]}async createSourceSchema(e,t){const r=this._createServiceInfo(e),s=null!=this.layer.editingInfo?.lastEditDate,a=this.layer.refreshInterval>0,i=!s&&a,o=u("isSourceHosted"in r&&r.isSourceHosted,i,this.layer.capabilities,r.metadata.geometryType,e.extent,this.layer.fullExtent);let n=[];return n=e.availableFields.concat(...h),c(r,o,{definitionExpression:this.layer.definitionExpression,queryScaleRanges:[],displayFilterEnabled:!1,displayFilterInfo:null,customParameters:this.layer.customParameters,gdbVersion:this.layer.gdbVersion,historicMoment:this.layer.historicMoment,timeExtent:this.layer.timeExtent,apiKey:this.layer.apiKey,sourceRefreshVersion:t,availableFields:n,cache:this._cache,postQueryFilter:null,returnM:!1,returnZ:!1})}async createProcessorSchema(e,t,r){const{meshes:s,referenceScale:a}=await this._fetchAnnotationDataElementRequest(e,{type:"annotation-data-element-request"}),{objectIdField:i}=this.layer,o=m(null,null,i);return{storage:y(null,t.filters),mesh:{properties:{sortKey:o,timeZone:t.timeZone,returnMeshObjectId:!1,displayRefreshVersion:r,currentUser:t.currentUser},strategy:{type:"feature"},factory:{symbology:s,labels:{type:"label",classes:[]},referenceScale:a}},expressionProperties:{timeExtent:null}}}get hasRequiredSupport(){return!0}get timeOptions(){return this.layer}addFilters(e,s){e=o(this.layer,e,s);const i=this.layer.sublayers.filter(e=>!e.visible).map(e=>e.subtypeCode);if(!i.length)return e;e??=new a;const n=t(this.layer.subtypeField,i.toArray());return e.where=r(e.where,n),e}getUpdateHashProperties(e){return this.layer.destroyed?[]:[()=>this.layer.apiKey,()=>this.layer.customParameters,()=>this.layer.definitionExpression,()=>n(this.layer,e)?e.floors:null,()=>this.layer.gdbVersion,()=>this.layer.historicMoment,()=>this.layer.outFields,()=>this.layer.sublayers.map(({visible:e})=>({visible:e}))]}getRenderer(){return null}setGraphicOrigin(e){const t=this.layer.findSublayerForFeature(e);e.layer=e.sourceLayer=this.layer,e.origin=t?.graphicOrigin}_createServiceInfo(t){const r=this.layer,a=r.fieldsIndex.toJSON();a.fields.push(...f);const{capabilities:o,editingInfo:n,globalIdField:p,datesInUnknownTimezone:u,dateFieldsTimeZone:c,subtypeField:m}=r,y=l(r),d=r.timeInfo?.toJSON(),h=r.spatialReference.toJSON(),g=e(this.layer.parsedUrl),S=this.layer.objectIdField,b=s(g.path),F=t.spatialReference.toJSON();return{type:"feature-service",source:g,isSourceHosted:b,orderByFields:S,outSpatialReference:F,metadata:{timeReferenceUnknownClient:u,dateFieldsTimeZone:c,subtypeField:m,globalIdField:p,fieldsIndex:a,geometryType:y,featureIdInfo:i(r),timeInfo:d,spatialReference:h,outSpatialReference:F,attributeSpatialReference:this.layer.attributeSpatialReference?.toJSON(),subtypes:this.layer.subtypes?.map(e=>e.toJSON()),typeIdField:null,types:null,layerType:r.type,hasM:!1,hasZ:!1},queryMetadata:{supportsFormatPBF:o.query.supportsFormatPBF,supportsQuantization:!1,maxRecordCount:o.query.maxRecordCount,tileMaxRecordCount:o.query.tileMaxRecordCount,supportsCompactGeometry:o.query.supportsCompactGeometry,supportsDefaultSpatialReference:o.query.supportsDefaultSpatialReference,supportsMaxRecordCountFactor:o.query.supportsMaxRecordCountFactor,supportsCentroidOnDegeneratedQuantizedGeometry:o.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:o.query.supportsDegeneratedQuantizedGeometry,lastEditDate:n?.lastEditDate?.getTime(),supportsReturnExceededLimitGeometries:o.query.supportsReturnExceededLimitGeometries}}}async _fetchAnnotationDataElementRequest(e,t){const r={cimAnalyzer:e.cimAnalyzer,cimResourceManager:e.cimResourceManager,store:e.store,scaleExpression:null},s=this.layer,a=await s.fetchDataElement(),i=g(a);return{type:"annotation-data-element-response",dataElement:a,meshes:await d(a,r),referenceScale:i}}}export{S as AnnotationLayerAdapter};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{clone as e}from"../../../../../core/lang.js";import{isHostedAgolService as r}from"../../../../../layers/support/arcgisLayerUrl.js";import{getServiceGeometryType as t}from"./geometryUtils.js";import{createLabelVVEvaluator as i}from"./labelingUtils.js";import{ExceedsLimitCache as s}from"../schema/ExceedsLimitCache.js";import{createFeatureSourceSchema as a}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as o}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as l}from"../support/rendererUtils.js";class n{constructor(e){this.layer=e,this._cache=new s}getLabelingDeconflictionInfo(){return[{vvEvaluators:{0:i(this.layer.renderer)}}]}async createSourceSchema(e,r){const t=this._createServiceInfo(e);return a(t,null,{definitionExpression:this.layer.definitionExpression,returnZ:e.returnZ,returnM:e.returnM,queryScaleRanges:[],displayFilterEnabled:e.displayFilterEnabled,displayFilterInfo:this.layer.displayFilterInfo,customParameters:this.layer.customParameters,gdbVersion:null,historicMoment:null,postQueryFilter:null,timeExtent:this.layer.timeExtent,apiKey:this.layer.apiKey,sourceRefreshVersion:r,availableFields:e.availableFields,cache:this._cache})}createProcessorSchema(e,r,t){const{fields:i,geometryType:s,orderBy:a,objectIdField:l,renderer:n,labelingInfo:u,labelsVisible:d}=this.layer,p={featureReduction:null,labelingInfoSource:this.layer.id,fields:i.map(e=>e.toJSON()),geometryType:s,labelingInfo:u,labelsVisible:d,objectIdField:l,orderBy:a??"default",renderer:n?.clone()};return o(e,r,p,t)}get hasRequiredSupport(){return l(this.layer.renderer)}get timeOptions(){return this.layer}getUpdateHashProperties(e){return[()=>this.layer.apiKey,()=>this.layer.customParameters,()=>this.layer.definitionExpression,()=>this.layer.outFields,()=>this.layer.renderer,()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>this.layer.orderBy]}getRenderer(){return this.layer.renderer}setGraphicOrigin(e){e.origin=this.layer.graphicOrigin}_createServiceInfo(i){const s=this.layer,{capabilities:a,editingInfo:o,objectIdField:l,globalIdField:n,datesInUnknownTimezone:u,dateFieldsTimeZone:d,orderBy:p,parsedUrl:c,hasZ:y,hasM:m}=s,h=s.fieldsIndex.toJSON(),f=t(s),g=s.timeInfo?.toJSON(),b=s.spatialReference.toJSON(),F=e(c);let I=l;if(p?.length){const e=!p[0].valueExpression&&p[0].field;e&&(I=e)}const S=r(F.path),R=i.spatialReference.toJSON();return{type:"feature-service",source:F,isSourceHosted:S,orderByFields:I,outSpatialReference:R,metadata:{timeReferenceUnknownClient:u,dateFieldsTimeZone:d,globalIdField:n,fieldsIndex:h,geometryType:f,hasZ:y??!1,hasM:m??!1,featureIdInfo:{type:"object-id",fieldName:l},timeInfo:g,spatialReference:b,outSpatialReference:R,subtypeField:null,subtypes:null,typeIdField:null,types:null},queryMetadata:{maxRecordCount:a.query.maxRecordCount,tileMaxRecordCount:a.query.tileMaxRecordCount,supportsCompactGeometry:a.query.supportsCompactGeometry,supportsDefaultSpatialReference:a.query.supportsDefaultSpatialReference,supportsFormatPBF:a.query.supportsFormatPBF,supportsMaxRecordCountFactor:a.query.supportsMaxRecordCountFactor,supportsQuantization:a.query.supportsQuantization,supportsCentroidOnDegeneratedQuantizedGeometry:a.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:a.query.supportsDegeneratedQuantizedGeometry,supportsReturnExceededLimitGeometries:a.query.supportsReturnExceededLimitGeometries,lastEditDate:o?.lastEditDate?.getTime()}}}}export{n as CatalogFootprintLayerAdapter};
2
+ import{clone as e}from"../../../../../core/lang.js";import{isHostedAgolService as r}from"../../../../../layers/support/arcgisLayerUrl.js";import{getServiceGeometryType as t}from"./geometryUtils.js";import{createLabelVVEvaluator as i}from"./labelingUtils.js";import{ExceedsLimitCache as s}from"../schema/ExceedsLimitCache.js";import{createFeatureSourceSchema as a}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as o}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as l}from"../support/rendererUtils.js";class n{constructor(e){this.layer=e,this._cache=new s}getLabelingDeconflictionInfo(){return[{vvEvaluators:{0:i(this.layer.renderer)}}]}async createSourceSchema(e,r){const t=this._createServiceInfo(e);return a(t,null,{definitionExpression:this.layer.definitionExpression,returnZ:e.returnZ,returnM:e.returnM,queryScaleRanges:[],displayFilterEnabled:e.displayFilterEnabled,displayFilterInfo:this.layer.displayFilterInfo,customParameters:this.layer.customParameters,gdbVersion:null,historicMoment:null,postQueryFilter:null,timeExtent:this.layer.timeExtent,apiKey:this.layer.apiKey,sourceRefreshVersion:r,availableFields:e.availableFields,cache:this._cache})}createProcessorSchema(e,r,t){const{fields:i,geometryType:s,orderBy:a,objectIdField:l,renderer:n,labelingInfo:u,labelsVisible:p}=this.layer,d={featureReduction:null,labelingInfoSource:this.layer.id,fields:i.map(e=>e.toJSON()),geometryType:s,labelingInfo:u,labelsVisible:p,objectIdField:l,orderBy:a??"default",renderer:n?.clone()};return o(e,r,d,t)}get hasRequiredSupport(){return l(this.layer.renderer)}get timeOptions(){return this.layer}getUpdateHashProperties(e){return[()=>this.layer.apiKey,()=>this.layer.customParameters,()=>this.layer.definitionExpression,()=>this.layer.outFields,()=>this.layer.renderer,()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>this.layer.orderBy]}getRenderer(){return this.layer.renderer}setGraphicOrigin(e){e.origin=this.layer.graphicOrigin}_createServiceInfo(i){const s=this.layer,{capabilities:a,editingInfo:o,objectIdField:l,globalIdField:n,datesInUnknownTimezone:u,dateFieldsTimeZone:p,orderBy:d,parsedUrl:c,hasZ:y,hasM:m}=s,f=s.fieldsIndex.toJSON(),h=t(s),g=s.timeInfo?.toJSON(),b=s.spatialReference.toJSON(),F=e(c);let I=l;if(d?.length){const e=!d[0].valueExpression&&d[0].field;e&&(I=e)}const S=r(F.path),R=i.spatialReference.toJSON();return{type:"feature-service",source:F,isSourceHosted:S,orderByFields:I,outSpatialReference:R,metadata:{timeReferenceUnknownClient:u,dateFieldsTimeZone:p,globalIdField:n,fieldsIndex:f,geometryType:h,hasZ:y??!1,hasM:m??!1,featureIdInfo:{type:"object-id",fieldName:l},timeInfo:g,spatialReference:b,outSpatialReference:R,attributeSpatialReference:null,subtypeField:null,subtypes:null,typeIdField:null,types:null},queryMetadata:{maxRecordCount:a.query.maxRecordCount,tileMaxRecordCount:a.query.tileMaxRecordCount,supportsCompactGeometry:a.query.supportsCompactGeometry,supportsDefaultSpatialReference:a.query.supportsDefaultSpatialReference,supportsFormatPBF:a.query.supportsFormatPBF,supportsMaxRecordCountFactor:a.query.supportsMaxRecordCountFactor,supportsQuantization:a.query.supportsQuantization,supportsCentroidOnDegeneratedQuantizedGeometry:a.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:a.query.supportsDegeneratedQuantizedGeometry,supportsReturnExceededLimitGeometries:a.query.supportsReturnExceededLimitGeometries,lastEditDate:o?.lastEditDate?.getTime()}}}}export{n as CatalogFootprintLayerAdapter};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{clone as e}from"../../../../../core/lang.js";import{isHostedAgolService as t}from"../../../../../layers/support/arcgisLayerUrl.js";import{createFeatureIdInfo as r}from"./featureServiceUtils.js";import{getServiceGeometryType as s}from"./geometryUtils.js";import{ExceedsLimitCache as i}from"../schema/ExceedsLimitCache.js";import{createSnapshotInfo as a,createFeatureSourceSchema as o}from"../schema/SourceSchema.js";import{getSortKey as n}from"../schema/processor/SimpleProcessorSchema.js";import{createStorageSchema as l}from"../schema/processor/StorageSchema.js";import{getDimensionMatcherSchema as c}from"../../support/annodime/dimensionSchema.js";import{dimensionRealFields as p,dimensionVirtualFields as u}from"../../support/annodime/fields.js";import{getReferenceScale as m}from"../../support/annodime/utils.js";class d{constructor(e){this.layer=e,this._cache=new i}getLabelingDeconflictionInfo(){return[]}async createSourceSchema(e,t){const r=this._createServiceInfo(e),s=null!=this.layer.editingInfo?.lastEditDate,i=this.layer.refreshInterval>0,n=!s&&i,l=a("isSourceHosted"in r&&r.isSourceHosted,n,this.layer.capabilities,r.metadata.geometryType,e.extent,this.layer.fullExtent);let c=[];return c=e.availableFields.concat(...p),o(r,l,{definitionExpression:this.layer.definitionExpression,queryScaleRanges:[],displayFilterEnabled:!1,displayFilterInfo:null,customParameters:this.layer.customParameters,gdbVersion:this.layer.gdbVersion,historicMoment:this.layer.historicMoment,timeExtent:this.layer.timeExtent,apiKey:this.layer.apiKey,sourceRefreshVersion:t,availableFields:c,cache:this._cache,postQueryFilter:null,returnM:!1,returnZ:!1})}async createProcessorSchema(e,t,r){const{meshes:s,referenceScale:i}=await this._fetchDimensionDataElementRequest(e,{type:"dimension-data-element-request"}),{objectIdField:a}=this.layer,o=n(null,null,a);return{storage:l(null,t.filters),mesh:{properties:{sortKey:o,timeZone:t.timeZone,returnMeshObjectId:!1,displayRefreshVersion:r,currentUser:t.currentUser},strategy:{type:"feature"},factory:{symbology:s,labels:{type:"label",classes:[]},referenceScale:i}},expressionProperties:{timeExtent:null}}}get hasRequiredSupport(){return!0}get timeOptions(){return this.layer}addFilters(e){return e}getUpdateHashProperties(){return this.layer.destroyed?[]:[()=>this.layer.apiKey,()=>this.layer.customParameters,()=>this.layer.definitionExpression,()=>this.layer.gdbVersion,()=>this.layer.historicMoment,()=>this.layer.outFields]}getRenderer(){return null}setGraphicOrigin(e){e.origin=this.layer.graphicOrigin}_createServiceInfo(i){const a=this.layer,o=a.fieldsIndex.toJSON();o.fields.push(...u);const{capabilities:n,editingInfo:l,globalIdField:c,datesInUnknownTimezone:p,dateFieldsTimeZone:m,subtypeField:d}=a,y=s(a),h=a.timeInfo?.toJSON(),f=a.spatialReference.toJSON(),g=e(this.layer.parsedUrl),S=this.layer.objectIdField,R=t(g.path),F=i.spatialReference.toJSON();return{type:"feature-service",source:g,isSourceHosted:R,orderByFields:S,outSpatialReference:F,metadata:{timeReferenceUnknownClient:p,dateFieldsTimeZone:m,subtypeField:d,globalIdField:c,fieldsIndex:o,geometryType:y,featureIdInfo:r(a),timeInfo:h,spatialReference:f,outSpatialReference:F,subtypes:this.layer.subtypes?.map(e=>e.toJSON()),typeIdField:null,types:null,layerType:a.type,hasM:!1,hasZ:!1},queryMetadata:{supportsFormatPBF:n.query.supportsFormatPBF,supportsQuantization:!1,maxRecordCount:n.query.maxRecordCount,tileMaxRecordCount:n.query.tileMaxRecordCount,supportsCompactGeometry:n.query.supportsCompactGeometry,supportsDefaultSpatialReference:n.query.supportsDefaultSpatialReference,supportsMaxRecordCountFactor:n.query.supportsMaxRecordCountFactor,supportsCentroidOnDegeneratedQuantizedGeometry:n.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:n.query.supportsDegeneratedQuantizedGeometry,lastEditDate:l?.lastEditDate?.getTime(),supportsReturnExceededLimitGeometries:n.query.supportsReturnExceededLimitGeometries}}}async _fetchDimensionDataElementRequest(e,t){const r={cimAnalyzer:e.cimAnalyzer,cimResourceManager:e.cimResourceManager,store:e.store,scaleExpression:null},s=this.layer,i=await s.fetchDataElement(),a=m(i);return{type:"dimension-data-element-response",dataElement:i,meshes:await c(i,r),referenceScale:a}}}export{d as DimensionLayerAdapter};
2
+ import{clone as e}from"../../../../../core/lang.js";import{isHostedAgolService as t}from"../../../../../layers/support/arcgisLayerUrl.js";import{createFeatureIdInfo as r}from"./featureServiceUtils.js";import{getServiceGeometryType as s}from"./geometryUtils.js";import{ExceedsLimitCache as i}from"../schema/ExceedsLimitCache.js";import{createSnapshotInfo as a,createFeatureSourceSchema as o}from"../schema/SourceSchema.js";import{getSortKey as n}from"../schema/processor/SimpleProcessorSchema.js";import{createStorageSchema as l}from"../schema/processor/StorageSchema.js";import{getDimensionMatcherSchema as c}from"../../support/annodime/dimensionSchema.js";import{dimensionRealFields as p,dimensionVirtualFields as u}from"../../support/annodime/fields.js";import{getReferenceScale as m}from"../../support/annodime/utils.js";class d{constructor(e){this.layer=e,this._cache=new i}getLabelingDeconflictionInfo(){return[]}async createSourceSchema(e,t){const r=this._createServiceInfo(e),s=null!=this.layer.editingInfo?.lastEditDate,i=this.layer.refreshInterval>0,n=!s&&i,l=a("isSourceHosted"in r&&r.isSourceHosted,n,this.layer.capabilities,r.metadata.geometryType,e.extent,this.layer.fullExtent);let c=[];return c=e.availableFields.concat(...p),o(r,l,{definitionExpression:this.layer.definitionExpression,queryScaleRanges:[],displayFilterEnabled:!1,displayFilterInfo:null,customParameters:this.layer.customParameters,gdbVersion:this.layer.gdbVersion,historicMoment:this.layer.historicMoment,timeExtent:this.layer.timeExtent,apiKey:this.layer.apiKey,sourceRefreshVersion:t,availableFields:c,cache:this._cache,postQueryFilter:null,returnM:!1,returnZ:!1})}async createProcessorSchema(e,t,r){const{meshes:s,referenceScale:i}=await this._fetchDimensionDataElementRequest(e,{type:"dimension-data-element-request"}),{objectIdField:a}=this.layer,o=n(null,null,a);return{storage:l(null,t.filters),mesh:{properties:{sortKey:o,timeZone:t.timeZone,returnMeshObjectId:!1,displayRefreshVersion:r,currentUser:t.currentUser},strategy:{type:"feature"},factory:{symbology:s,labels:{type:"label",classes:[]},referenceScale:i}},expressionProperties:{timeExtent:null}}}get hasRequiredSupport(){return!0}get timeOptions(){return this.layer}addFilters(e){return e}getUpdateHashProperties(){return this.layer.destroyed?[]:[()=>this.layer.apiKey,()=>this.layer.customParameters,()=>this.layer.definitionExpression,()=>this.layer.gdbVersion,()=>this.layer.historicMoment,()=>this.layer.outFields]}getRenderer(){return null}setGraphicOrigin(e){e.origin=this.layer.graphicOrigin}_createServiceInfo(i){const a=this.layer,o=a.fieldsIndex.toJSON();o.fields.push(...u);const{capabilities:n,editingInfo:l,globalIdField:c,datesInUnknownTimezone:p,dateFieldsTimeZone:m,subtypeField:d}=a,y=s(a),h=a.timeInfo?.toJSON(),f=a.spatialReference.toJSON(),g=e(this.layer.parsedUrl),S=this.layer.objectIdField,R=t(g.path),b=i.spatialReference.toJSON();return{type:"feature-service",source:g,isSourceHosted:R,orderByFields:S,outSpatialReference:b,metadata:{timeReferenceUnknownClient:p,dateFieldsTimeZone:m,subtypeField:d,globalIdField:c,fieldsIndex:o,geometryType:y,featureIdInfo:r(a),timeInfo:h,spatialReference:f,outSpatialReference:b,attributeSpatialReference:this.layer.attributeSpatialReference?.toJSON(),subtypes:this.layer.subtypes?.map(e=>e.toJSON()),typeIdField:null,types:null,layerType:a.type,hasM:!1,hasZ:!1},queryMetadata:{supportsFormatPBF:n.query.supportsFormatPBF,supportsQuantization:!1,maxRecordCount:n.query.maxRecordCount,tileMaxRecordCount:n.query.tileMaxRecordCount,supportsCompactGeometry:n.query.supportsCompactGeometry,supportsDefaultSpatialReference:n.query.supportsDefaultSpatialReference,supportsMaxRecordCountFactor:n.query.supportsMaxRecordCountFactor,supportsCentroidOnDegeneratedQuantizedGeometry:n.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:n.query.supportsDegeneratedQuantizedGeometry,lastEditDate:l?.lastEditDate?.getTime(),supportsReturnExceededLimitGeometries:n.query.supportsReturnExceededLimitGeometries}}}async _fetchDimensionDataElementRequest(e,t){const r={cimAnalyzer:e.cimAnalyzer,cimResourceManager:e.cimResourceManager,store:e.store,scaleExpression:null},s=this.layer,i=await s.fetchDataElement(),a=m(i);return{type:"dimension-data-element-response",dataElement:i,meshes:await c(i,r),referenceScale:a}}}export{d as DimensionLayerAdapter};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{clone as e}from"../../../../../core/lang.js";import{sqlAnd as r}from"../../../../../core/sql.js";import{isHostedAgolService as t}from"../../../../../layers/support/arcgisLayerUrl.js";import{canConvertSqlRelativeTime as i,sqlRelativeTimeToAbsolute as s}from"../../../../../layers/support/relativeTimeQueryUtils.js";import{getUtilityNetworkFields as a}from"../../../../../networks/support/networkFieldUtils.js";import{getEffectiveFeatureReduction as o}from"./featureReductionUtils.js";import{createFeatureIdInfo as l}from"./featureServiceUtils.js";import{addFloorFilter as n,hasFloorFilter as y}from"./floorFilterUtils.js";import{getServiceGeometryType as d}from"./geometryUtils.js";import{createLabelVVEvaluator as p}from"./labelingUtils.js";import{ExceedsLimitCache as u}from"../schema/ExceedsLimitCache.js";import{createSnapshotInfo as c,createFeatureSourceSchema as m}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as h}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as f}from"../support/rendererUtils.js";class g{constructor(e){this.layer=e,this._cache=new u}getLabelingDeconflictionInfo(){return[{vvEvaluators:{0:p(this.layer.renderer)}}]}async createSourceSchema(e,t){const a=this._createServiceInfo(e),o=null!=this.layer.editingInfo?.lastEditDate,l=this.layer.refreshInterval>0,n=!o&&l,y=c(a.isSourceHosted,n,this.layer.capabilities,a.metadata.geometryType,e.extent,this.layer.fullExtent),d=null!=this.layer.subtypeCode?`${this.layer.subtypeField} = ${this.layer.subtypeCode}`:null,p=r(this.layer.definitionExpression,d),u=i(p)?await s(this.layer.fieldsIndex,p,this.layer.capabilities.query.relativeTimeBinWindow):p,h=p!==u?{where:p}:null,{gdbVersion:f,apiKey:g,historicMoment:b,timeExtent:F,customParameters:I,displayFilterInfo:S}=this.layer;return m(a,y,{definitionExpression:u,returnZ:e.returnZ,returnM:e.returnM,postQueryFilter:h,queryScaleRanges:[],displayFilterEnabled:e.displayFilterEnabled,displayFilterInfo:S,customParameters:I,gdbVersion:f,historicMoment:b,timeExtent:F,apiKey:g,sourceRefreshVersion:t,availableFields:e.availableFields,cache:this._cache})}createProcessorSchema(e,r,t){const{fields:i,renderer:s,geometryType:a,labelingInfo:l,labelsVisible:n,orderBy:y,objectIdField:d,trackInfo:p,symbolLayerDrawing:u}=this.layer,c={fields:i.map(e=>e.toJSON()),renderer:s?.clone(),labelingInfoSource:this.layer.id,featureReduction:o(this.layer,r),geometryType:a,labelingInfo:l,labelsVisible:n,objectIdField:d,orderBy:y??"default",trackInfo:p,symbolLayerDrawing:u};return h(e,r,c,t)}get hasRequiredSupport(){return f(this.layer.renderer)}get timeOptions(){return this.layer}addFilters(e,r){return n(this.layer,e,r)}getUpdateHashProperties(e){return this.layer.destroyed?[]:[()=>this.layer.apiKey,()=>this.layer.customParameters,()=>this.layer.definitionExpression,()=>o(this.layer,e),()=>y(this.layer,e)?e.floors:null,()=>this.layer.gdbVersion,()=>this.layer.historicMoment,()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>this.layer.orderBy,()=>this.layer.outFields,()=>this.layer.renderer,()=>this.layer.subtypeCode,()=>this.layer.trackInfo,()=>this.layer.symbolLayerDrawing?.drawOrder,()=>this.layer.symbolLayerDrawing?.enabled,()=>e?.requiredFieldsOptions?.featureTitleFields&&this.layer.featureTitleFields,()=>e?.requiredFieldsOptions?.utilityNetworkFields&&a(e,this.layer)]}getRenderer(){return this.layer.renderer}setGraphicOrigin(e){e.origin=this.layer.graphicOrigin}setAggregateGraphicOrigin(e){e.origin=this.layer.aggregateGraphicOrigin}setTrackGraphicOrigin(e){e.origin=this.layer.trackGraphicOrigin}_createServiceInfo(r){const i=this.layer,{capabilities:s,editingInfo:a,typeIdField:o,globalIdField:n,datesInUnknownTimezone:y,dateFieldsTimeZone:p,orderBy:u,subtypeField:c}=i,m=i.fieldsIndex.toJSON(),h=d(i),{hasZ:f,hasM:g}=i,b=i.timeInfo?.toJSON(),F=i.spatialReference.toJSON(),I=i.types?.map(e=>e.toJSON()),S=e(this.layer.parsedUrl);this.layer.dynamicDataSource&&(S.query={layer:JSON.stringify({source:this.layer.dynamicDataSource})});let R=this.layer.objectIdField;if(u?.length){const e=!u[0].valueExpression&&u[0].field;e&&(R=e)}const x=t(S.path),O=r.spatialReference.toJSON();return{type:"feature-service",source:S,isSourceHosted:x,orderByFields:R,outSpatialReference:O,metadata:{typeIdField:o??void 0,types:I,timeReferenceUnknownClient:y,dateFieldsTimeZone:p,subtypeField:c,globalIdField:n,fieldsIndex:m,geometryType:h,hasZ:f,hasM:g,featureIdInfo:l(i),timeInfo:b,spatialReference:F,outSpatialReference:O,subtypes:this.layer.subtypes?.map(e=>e.toJSON())},queryMetadata:{maxRecordCount:s.query.maxRecordCount,tileMaxRecordCount:s.query.tileMaxRecordCount,supportsCompactGeometry:s.query.supportsCompactGeometry,supportsDefaultSpatialReference:s.query.supportsDefaultSpatialReference,supportsFormatPBF:s.query.supportsFormatPBF,supportsMaxRecordCountFactor:s.query.supportsMaxRecordCountFactor,supportsQuantization:s.query.supportsQuantization,supportsCentroidOnDegeneratedQuantizedGeometry:s.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:s.query.supportsDegeneratedQuantizedGeometry,supportsReturnExceededLimitGeometries:s.query.supportsReturnExceededLimitGeometries,lastEditDate:a?.lastEditDate?.getTime()}}}}export{g as FeatureLayerAdapter};
2
+ import{clone as e}from"../../../../../core/lang.js";import{sqlAnd as r}from"../../../../../core/sql.js";import{isHostedAgolService as t}from"../../../../../layers/support/arcgisLayerUrl.js";import{canConvertSqlRelativeTime as i,sqlRelativeTimeToAbsolute as s}from"../../../../../layers/support/relativeTimeQueryUtils.js";import{getUtilityNetworkFields as a}from"../../../../../networks/support/networkFieldUtils.js";import{getEffectiveFeatureReduction as o}from"./featureReductionUtils.js";import{createFeatureIdInfo as l}from"./featureServiceUtils.js";import{addFloorFilter as n,hasFloorFilter as y}from"./floorFilterUtils.js";import{getServiceGeometryType as d}from"./geometryUtils.js";import{createLabelVVEvaluator as p}from"./labelingUtils.js";import{ExceedsLimitCache as u}from"../schema/ExceedsLimitCache.js";import{createSnapshotInfo as c,createFeatureSourceSchema as m}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as h}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as f}from"../support/rendererUtils.js";class g{constructor(e){this.layer=e,this._cache=new u}getLabelingDeconflictionInfo(){return[{vvEvaluators:{0:p(this.layer.renderer)}}]}async createSourceSchema(e,t){const a=this._createServiceInfo(e),o=null!=this.layer.editingInfo?.lastEditDate,l=this.layer.refreshInterval>0,n=!o&&l,y=c(a.isSourceHosted,n,this.layer.capabilities,a.metadata.geometryType,e.extent,this.layer.fullExtent),d=null!=this.layer.subtypeCode?`${this.layer.subtypeField} = ${this.layer.subtypeCode}`:null,p=r(this.layer.definitionExpression,d),u=i(p)?await s(this.layer.fieldsIndex,p,this.layer.capabilities.query.relativeTimeBinWindow):p,h=p!==u?{where:p}:null,{gdbVersion:f,apiKey:g,historicMoment:b,timeExtent:F,customParameters:I,displayFilterInfo:S}=this.layer;return m(a,y,{definitionExpression:u,returnZ:e.returnZ,returnM:e.returnM,postQueryFilter:h,queryScaleRanges:[],displayFilterEnabled:e.displayFilterEnabled,displayFilterInfo:S,customParameters:I,gdbVersion:f,historicMoment:b,timeExtent:F,apiKey:g,sourceRefreshVersion:t,availableFields:e.availableFields,cache:this._cache})}createProcessorSchema(e,r,t){const{fields:i,renderer:s,geometryType:a,labelingInfo:l,labelsVisible:n,orderBy:y,objectIdField:d,trackInfo:p,symbolLayerDrawing:u}=this.layer,c={fields:i.map(e=>e.toJSON()),renderer:s?.clone(),labelingInfoSource:this.layer.id,featureReduction:o(this.layer,r),geometryType:a,labelingInfo:l,labelsVisible:n,objectIdField:d,orderBy:y??"default",trackInfo:p,symbolLayerDrawing:u};return h(e,r,c,t)}get hasRequiredSupport(){return f(this.layer.renderer)}get timeOptions(){return this.layer}addFilters(e,r){return n(this.layer,e,r)}getUpdateHashProperties(e){return this.layer.destroyed?[]:[()=>this.layer.apiKey,()=>this.layer.customParameters,()=>this.layer.definitionExpression,()=>o(this.layer,e),()=>y(this.layer,e)?e.floors:null,()=>this.layer.gdbVersion,()=>this.layer.historicMoment,()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>this.layer.orderBy,()=>this.layer.outFields,()=>this.layer.renderer,()=>this.layer.subtypeCode,()=>this.layer.trackInfo,()=>this.layer.symbolLayerDrawing?.drawOrder,()=>this.layer.symbolLayerDrawing?.enabled,()=>e?.requiredFieldsOptions?.featureTitleFields&&this.layer.featureTitleFields,()=>e?.requiredFieldsOptions?.utilityNetworkFields&&a(e,this.layer)]}getRenderer(){return this.layer.renderer}setGraphicOrigin(e){e.origin=this.layer.graphicOrigin}setAggregateGraphicOrigin(e){e.origin=this.layer.aggregateGraphicOrigin}setTrackGraphicOrigin(e){e.origin=this.layer.trackGraphicOrigin}_createServiceInfo(r){const i=this.layer,{capabilities:s,editingInfo:a,typeIdField:o,globalIdField:n,datesInUnknownTimezone:y,dateFieldsTimeZone:p,orderBy:u,subtypeField:c}=i,m=i.fieldsIndex.toJSON(),h=d(i),{hasZ:f,hasM:g}=i,b=i.timeInfo?.toJSON(),F=i.spatialReference.toJSON(),I=i.types?.map(e=>e.toJSON()),S=e(this.layer.parsedUrl);this.layer.dynamicDataSource&&(S.query={layer:JSON.stringify({source:this.layer.dynamicDataSource})});let R=this.layer.objectIdField;if(u?.length){const e=!u[0].valueExpression&&u[0].field;e&&(R=e)}const x=t(S.path),O=r.spatialReference.toJSON();return{type:"feature-service",source:S,isSourceHosted:x,orderByFields:R,outSpatialReference:O,metadata:{typeIdField:o??void 0,types:I,timeReferenceUnknownClient:y,dateFieldsTimeZone:p,subtypeField:c,globalIdField:n,fieldsIndex:m,geometryType:h,hasZ:f,hasM:g,featureIdInfo:l(i),timeInfo:b,spatialReference:F,outSpatialReference:O,attributeSpatialReference:null,subtypes:this.layer.subtypes?.map(e=>e.toJSON())},queryMetadata:{maxRecordCount:s.query.maxRecordCount,tileMaxRecordCount:s.query.tileMaxRecordCount,supportsCompactGeometry:s.query.supportsCompactGeometry,supportsDefaultSpatialReference:s.query.supportsDefaultSpatialReference,supportsFormatPBF:s.query.supportsFormatPBF,supportsMaxRecordCountFactor:s.query.supportsMaxRecordCountFactor,supportsQuantization:s.query.supportsQuantization,supportsCentroidOnDegeneratedQuantizedGeometry:s.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:s.query.supportsDegeneratedQuantizedGeometry,supportsReturnExceededLimitGeometries:s.query.supportsReturnExceededLimitGeometries,lastEditDate:a?.lastEditDate?.getTime()}}}}export{g as FeatureLayerAdapter};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import e from"../../../../../core/Error.js";import{hasTimeOptions as r}from"../../../../../layers/support/timeSupport.js";import{getEffectiveFeatureReduction as t}from"./featureReductionUtils.js";import{createFeatureIdInfo as i}from"./featureServiceUtils.js";import{getServiceGeometryType as s}from"./geometryUtils.js";import{createLabelVVEvaluator as o}from"./labelingUtils.js";import{ExceedsLimitCache as n}from"../schema/ExceedsLimitCache.js";import{createFeatureSourceSchema as a}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as l}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as u}from"../support/rendererUtils.js";function p(r){if(!("openPorts"in r))throw new e("featurelayer:source-not-supported","source is not supported")}class c{constructor(e){this.layer=e,this._cache=new n}openMessagePorts(){return p(this.layer.source),this.layer.source.openPorts()}getLabelingDeconflictionInfo(){return[{vvEvaluators:{0:o(this.layer.renderer)}}]}async createSourceSchema(e,r){const t=this._createServiceInfo(e);return a(t,null,{definitionExpression:this.layer.definitionExpression,returnZ:e.returnZ,returnM:e.returnM,queryScaleRanges:[],displayFilterEnabled:e.displayFilterEnabled,displayFilterInfo:this.layer.displayFilterInfo,customParameters:this.layer.customParameters,gdbVersion:null,historicMoment:null,timeExtent:"timeExtent"in this.layer?this.layer.timeExtent:null,apiKey:null,sourceRefreshVersion:r,availableFields:e.availableFields,cache:this._cache,postQueryFilter:null})}createProcessorSchema(e,r,i){const{fields:s,renderer:o,geometryType:n,labelingInfo:a,labelsVisible:u,orderBy:p,objectIdField:c}=this.layer,d="trackInfo"in this.layer?this.layer.trackInfo:null,y={fields:s.map(e=>e.toJSON()),renderer:o?.clone(),labelingInfoSource:this.layer.id,featureReduction:t(this.layer,r),geometryType:n,labelingInfo:a,labelsVisible:u,objectIdField:c,orderBy:p??"default",trackInfo:d};return l(e,r,y,i)}get hasRequiredSupport(){return u(this.layer.renderer)}get timeOptions(){return r(this.layer)?this.layer:null}getUpdateHashProperties(e){return[()=>this.layer.definitionExpression,()=>this.layer.displayFilterInfo,()=>this.layer.orderBy,()=>"outFields"in this.layer?this.layer.outFields:null,()=>this.layer.renderer,()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>t(this.layer,e),()=>"trackInfo"in this.layer?this.layer.trackInfo:null]}setGraphicOrigin(e){e.origin=this.layer.graphicOrigin}setAggregateGraphicOrigin(e){e.origin=this.layer.aggregateGraphicOrigin}setTrackGraphicOrigin(e){"trackGraphicOrigin"in this.layer&&(e.origin=this.layer.trackGraphicOrigin)}getRenderer(){return this.layer.renderer}_createServiceInfo(e){const r=this.layer,{capabilities:t,objectIdField:o}=r,n=r.fieldsIndex.toJSON(),a=s(r),l="timeInfo"in r?r.timeInfo?.toJSON():null,u=r.spatialReference.toJSON();p(r.source);const c=o,d=e.spatialReference.toJSON();return{type:"memory",orderByFields:c,outSpatialReference:d,metadata:{fieldsIndex:n,geometryType:a,featureIdInfo:i(r),hasZ:"hasZ"in r&&r.hasZ,hasM:"hasM"in r&&r.hasM,timeInfo:l,spatialReference:u,outSpatialReference:d,subtypes:null,subtypeField:null,globalIdField:null,typeIdField:null,types:null,timeReferenceUnknownClient:"datesInUnknownTimezone"in r?r.datesInUnknownTimezone:null,dateFieldsTimeZone:"dateFieldsTimeZone"in r?r.dateFieldsTimeZone:null},queryMetadata:{maxRecordCount:t.query.maxRecordCount,tileMaxRecordCount:t.query.tileMaxRecordCount,supportsCompactGeometry:t.query.supportsCompactGeometry,supportsDefaultSpatialReference:t.query.supportsDefaultSpatialReference,supportsFormatPBF:t.query.supportsFormatPBF,supportsMaxRecordCountFactor:t.query.supportsMaxRecordCountFactor,supportsQuantization:t.query.supportsQuantization,supportsCentroidOnDegeneratedQuantizedGeometry:t.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:t.query.supportsDegeneratedQuantizedGeometry,supportsReturnExceededLimitGeometries:t.query.supportsReturnExceededLimitGeometries,lastEditDate:null}}}}export{c as InMemoryLayerAdapter};
2
+ import e from"../../../../../core/Error.js";import{hasTimeOptions as r}from"../../../../../layers/support/timeSupport.js";import{getEffectiveFeatureReduction as t}from"./featureReductionUtils.js";import{createFeatureIdInfo as i}from"./featureServiceUtils.js";import{getServiceGeometryType as s}from"./geometryUtils.js";import{createLabelVVEvaluator as n}from"./labelingUtils.js";import{ExceedsLimitCache as o}from"../schema/ExceedsLimitCache.js";import{createFeatureSourceSchema as a}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as l}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as u}from"../support/rendererUtils.js";function p(r){if(!("openPorts"in r))throw new e("featurelayer:source-not-supported","source is not supported")}class c{constructor(e){this.layer=e,this._cache=new o}openMessagePorts(){return p(this.layer.source),this.layer.source.openPorts()}getLabelingDeconflictionInfo(){return[{vvEvaluators:{0:n(this.layer.renderer)}}]}async createSourceSchema(e,r){const t=this._createServiceInfo(e);return a(t,null,{definitionExpression:this.layer.definitionExpression,returnZ:e.returnZ,returnM:e.returnM,queryScaleRanges:[],displayFilterEnabled:e.displayFilterEnabled,displayFilterInfo:this.layer.displayFilterInfo,customParameters:this.layer.customParameters,gdbVersion:null,historicMoment:null,timeExtent:"timeExtent"in this.layer?this.layer.timeExtent:null,apiKey:null,sourceRefreshVersion:r,availableFields:e.availableFields,cache:this._cache,postQueryFilter:null})}createProcessorSchema(e,r,i){const{fields:s,renderer:n,geometryType:o,labelingInfo:a,labelsVisible:u,orderBy:p,objectIdField:c}=this.layer,d="trackInfo"in this.layer?this.layer.trackInfo:null,y={fields:s.map(e=>e.toJSON()),renderer:n?.clone(),labelingInfoSource:this.layer.id,featureReduction:t(this.layer,r),geometryType:o,labelingInfo:a,labelsVisible:u,objectIdField:c,orderBy:p??"default",trackInfo:d};return l(e,r,y,i)}get hasRequiredSupport(){return u(this.layer.renderer)}get timeOptions(){return r(this.layer)?this.layer:null}getUpdateHashProperties(e){return[()=>this.layer.definitionExpression,()=>this.layer.displayFilterInfo,()=>this.layer.orderBy,()=>"outFields"in this.layer?this.layer.outFields:null,()=>this.layer.renderer,()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>t(this.layer,e),()=>"trackInfo"in this.layer?this.layer.trackInfo:null]}setGraphicOrigin(e){e.origin=this.layer.graphicOrigin}setAggregateGraphicOrigin(e){e.origin=this.layer.aggregateGraphicOrigin}setTrackGraphicOrigin(e){"trackGraphicOrigin"in this.layer&&(e.origin=this.layer.trackGraphicOrigin)}getRenderer(){return this.layer.renderer}_createServiceInfo(e){const r=this.layer,{capabilities:t,objectIdField:n}=r,o=r.fieldsIndex.toJSON(),a=s(r),l="timeInfo"in r?r.timeInfo?.toJSON():null,u=r.spatialReference.toJSON();p(r.source);const c=n,d=e.spatialReference.toJSON();return{type:"memory",orderByFields:c,outSpatialReference:d,metadata:{fieldsIndex:o,geometryType:a,featureIdInfo:i(r),hasZ:"hasZ"in r&&r.hasZ,hasM:"hasM"in r&&r.hasM,timeInfo:l,spatialReference:u,outSpatialReference:d,attributeSpatialReference:null,subtypes:null,subtypeField:null,globalIdField:null,typeIdField:null,types:null,timeReferenceUnknownClient:"datesInUnknownTimezone"in r?r.datesInUnknownTimezone:null,dateFieldsTimeZone:"dateFieldsTimeZone"in r?r.dateFieldsTimeZone:null},queryMetadata:{maxRecordCount:t.query.maxRecordCount,tileMaxRecordCount:t.query.tileMaxRecordCount,supportsCompactGeometry:t.query.supportsCompactGeometry,supportsDefaultSpatialReference:t.query.supportsDefaultSpatialReference,supportsFormatPBF:t.query.supportsFormatPBF,supportsMaxRecordCountFactor:t.query.supportsMaxRecordCountFactor,supportsQuantization:t.query.supportsQuantization,supportsCentroidOnDegeneratedQuantizedGeometry:t.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:t.query.supportsDegeneratedQuantizedGeometry,supportsReturnExceededLimitGeometries:t.query.supportsReturnExceededLimitGeometries,lastEditDate:null}}}}export{c as InMemoryLayerAdapter};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{sqlAnd as e}from"../../../../../core/sql.js";import{systemIsSpatialFieldName as r}from"../../../../../layers/knowledgeGraph/constants.js";import t from"../../../../../layers/support/FeatureFilter.js";import{getEffectiveFeatureReduction as i}from"./featureReductionUtils.js";import{getServiceGeometryType as s}from"./geometryUtils.js";import{createLabelVVEvaluator as a}from"./labelingUtils.js";import{ExceedsLimitCache as o}from"../schema/ExceedsLimitCache.js";import{createFeatureSourceSchema as n}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as l}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as p}from"../support/rendererUtils.js";class u{constructor(e){this.layer=e,this._cache=new o}getLabelingDeconflictionInfo(){return[{vvEvaluators:{0:a(this.layer.renderer)}}]}async createSourceSchema(e,r){const t=this._createServiceInfo(e);return n(t,null,{definitionExpression:this.layer.definitionExpression,returnZ:e.returnZ,returnM:e.returnM,queryScaleRanges:[],displayFilterEnabled:e.displayFilterEnabled,displayFilterInfo:this.layer.displayFilterInfo,customParameters:null,gdbVersion:null,historicMoment:null,timeExtent:this.layer.timeExtent,apiKey:null,sourceRefreshVersion:r,availableFields:e.availableFields,cache:this._cache,postQueryFilter:null})}createProcessorSchema(e,r,t){const{fields:s,renderer:a,geometryType:o,labelingInfo:n,labelsVisible:p,objectIdField:u}=this.layer,d={fields:s.map(e=>e.toJSON()),renderer:a?.clone(),labelingInfoSource:this.layer.id,featureReduction:i(this.layer,r),geometryType:o,labelingInfo:n,labelsVisible:p,objectIdField:u,orderBy:"default"};return l(e,r,d,t)}get hasRequiredSupport(){return p(this.layer.renderer)}get timeOptions(){return this.layer}getUpdateHashProperties(e){return[()=>this.layer.definitionExpression,()=>this.layer.renderer,()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>i(this.layer,e),()=>null!=this.layer.parentCompositeLayer&&d(this.layer.parentCompositeLayer)]}getRenderer(){return this.layer.renderer}hasFilters(e){return null!=this.layer.parentCompositeLayer&&d(this.layer.parentCompositeLayer)}addFilters(i,s){if(null!=this.layer.parentCompositeLayer&&d(this.layer.parentCompositeLayer)){const s=e(i?.where,`${r}=1`);if(!s)return i;i??=new t,i.where=s}return i}setGraphicOrigin(e){e.origin=this.layer.graphicOrigin}setAggregateGraphicOrigin(e){e.origin=this.layer.aggregateGraphicOrigin}openMessagePorts(){return this.layer.source.openPorts()}_createServiceInfo(e){const r=this.layer,{capabilities:t,objectIdField:i}=r,a=r.fieldsIndex.toJSON(),o=s(r),n=r.spatialReference.toJSON(),l=i,p=e.spatialReference.toJSON();return{type:"memory",orderByFields:l,outSpatialReference:p,metadata:{fieldsIndex:a,geometryType:o,hasZ:this.layer.hasZ,hasM:this.layer.hasM,featureIdInfo:{type:"object-id",fieldName:r.objectIdField},spatialReference:n,outSpatialReference:p,globalIdField:null,subtypeField:null,subtypes:null,timeInfo:r.timeInfo?.toJSON(),timeReferenceUnknownClient:null,dateFieldsTimeZone:null,typeIdField:null,types:null},queryMetadata:{maxRecordCount:t.query.maxRecordCount,tileMaxRecordCount:t.query.tileMaxRecordCount,supportsCompactGeometry:t.query.supportsCompactGeometry,supportsDefaultSpatialReference:t.query.supportsDefaultSpatialReference,supportsFormatPBF:t.query.supportsFormatPBF,supportsMaxRecordCountFactor:t.query.supportsMaxRecordCountFactor,supportsQuantization:t.query.supportsQuantization,supportsCentroidOnDegeneratedQuantizedGeometry:t.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:t.query.supportsDegeneratedQuantizedGeometry,supportsReturnExceededLimitGeometries:t.query.supportsReturnExceededLimitGeometries,lastEditDate:null}}}}function d(e){return"link-chart"===e.type&&"hidden"===e.linkChart?.linkChartProperties.nonspatialDataDisplay?.mode}export{u as KnowledgeGraphSublayerAdapter};
2
+ import{sqlAnd as e}from"../../../../../core/sql.js";import{systemIsSpatialFieldName as r}from"../../../../../layers/knowledgeGraph/constants.js";import t from"../../../../../layers/support/FeatureFilter.js";import{getEffectiveFeatureReduction as i}from"./featureReductionUtils.js";import{getServiceGeometryType as a}from"./geometryUtils.js";import{createLabelVVEvaluator as s}from"./labelingUtils.js";import{ExceedsLimitCache as o}from"../schema/ExceedsLimitCache.js";import{createFeatureSourceSchema as n}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as l}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as p}from"../support/rendererUtils.js";class u{constructor(e){this.layer=e,this._cache=new o}getLabelingDeconflictionInfo(){return[{vvEvaluators:{0:s(this.layer.renderer)}}]}async createSourceSchema(e,r){const t=this._createServiceInfo(e);return n(t,null,{definitionExpression:this.layer.definitionExpression,returnZ:e.returnZ,returnM:e.returnM,queryScaleRanges:[],displayFilterEnabled:e.displayFilterEnabled,displayFilterInfo:this.layer.displayFilterInfo,customParameters:null,gdbVersion:null,historicMoment:null,timeExtent:this.layer.timeExtent,apiKey:null,sourceRefreshVersion:r,availableFields:e.availableFields,cache:this._cache,postQueryFilter:null})}createProcessorSchema(e,r,t){const{fields:a,renderer:s,geometryType:o,labelingInfo:n,labelsVisible:p,objectIdField:u}=this.layer,d={fields:a.map(e=>e.toJSON()),renderer:s?.clone(),labelingInfoSource:this.layer.id,featureReduction:i(this.layer,r),geometryType:o,labelingInfo:n,labelsVisible:p,objectIdField:u,orderBy:"default"};return l(e,r,d,t)}get hasRequiredSupport(){return p(this.layer.renderer)}get timeOptions(){return this.layer}getUpdateHashProperties(e){return[()=>this.layer.definitionExpression,()=>this.layer.renderer,()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>i(this.layer,e),()=>null!=this.layer.parentCompositeLayer&&d(this.layer.parentCompositeLayer)]}getRenderer(){return this.layer.renderer}hasFilters(e){return null!=this.layer.parentCompositeLayer&&d(this.layer.parentCompositeLayer)}addFilters(i,a){if(null!=this.layer.parentCompositeLayer&&d(this.layer.parentCompositeLayer)){const a=e(i?.where,`${r}=1`);if(!a)return i;i??=new t,i.where=a}return i}setGraphicOrigin(e){e.origin=this.layer.graphicOrigin}setAggregateGraphicOrigin(e){e.origin=this.layer.aggregateGraphicOrigin}openMessagePorts(){return this.layer.source.openPorts()}_createServiceInfo(e){const r=this.layer,{capabilities:t,objectIdField:i}=r,s=r.fieldsIndex.toJSON(),o=a(r),n=r.spatialReference.toJSON(),l=i,p=e.spatialReference.toJSON();return{type:"memory",orderByFields:l,outSpatialReference:p,metadata:{fieldsIndex:s,geometryType:o,hasZ:this.layer.hasZ,hasM:this.layer.hasM,featureIdInfo:{type:"object-id",fieldName:r.objectIdField},spatialReference:n,outSpatialReference:p,attributeSpatialReference:null,globalIdField:null,subtypeField:null,subtypes:null,timeInfo:r.timeInfo?.toJSON(),timeReferenceUnknownClient:null,dateFieldsTimeZone:null,typeIdField:null,types:null},queryMetadata:{maxRecordCount:t.query.maxRecordCount,tileMaxRecordCount:t.query.tileMaxRecordCount,supportsCompactGeometry:t.query.supportsCompactGeometry,supportsDefaultSpatialReference:t.query.supportsDefaultSpatialReference,supportsFormatPBF:t.query.supportsFormatPBF,supportsMaxRecordCountFactor:t.query.supportsMaxRecordCountFactor,supportsQuantization:t.query.supportsQuantization,supportsCentroidOnDegeneratedQuantizedGeometry:t.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:t.query.supportsDegeneratedQuantizedGeometry,supportsReturnExceededLimitGeometries:t.query.supportsReturnExceededLimitGeometries,lastEditDate:null}}}}function d(e){return"link-chart"===e.type&&"hidden"===e.linkChart?.linkChartProperties.nonspatialDataDisplay?.mode}export{u as KnowledgeGraphSublayerAdapter};