@arcgis/core 4.33.0-next.20250514 → 4.33.0-next.20250515

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 (399) hide show
  1. package/Graphic.js +1 -1
  2. package/Map.js +1 -1
  3. package/WebScene.js +1 -1
  4. package/applications/Components/SelectionOperation.js +1 -1
  5. package/arcade/functions/featuresetbase.js +1 -1
  6. package/assets/esri/core/workers/RemoteClient.js +1 -1
  7. package/assets/esri/core/workers/chunks/009730713ed9bc7c7388.js +1 -0
  8. package/assets/esri/core/workers/chunks/02853ab923245459b32e.js +1 -0
  9. package/assets/esri/core/workers/chunks/0624ae07d3af8d5f1ac8.js +1 -0
  10. package/assets/esri/core/workers/chunks/{6e8c6c9112ecb867b7be.js → 0817ddd885ce8b2459cb.js} +1 -1
  11. package/assets/esri/core/workers/chunks/{69e8aabe5a1eb2d1e414.js → 0832bd5195b5791dd803.js} +1 -1
  12. package/assets/esri/core/workers/chunks/0d23610475c85385fbff.js +1 -0
  13. package/assets/esri/core/workers/chunks/{b4f38fe9cc948a39ad87.js → 0fd6d80393722132e044.js} +2 -2
  14. package/assets/esri/core/workers/chunks/{b4f38fe9cc948a39ad87.js.LICENSE.txt → 0fd6d80393722132e044.js.LICENSE.txt} +1 -1
  15. package/assets/esri/core/workers/chunks/1051a5a57b2fb843a555.js +1 -0
  16. package/assets/esri/core/workers/chunks/133e4bde346828d4510b.js +1 -0
  17. package/assets/esri/core/workers/chunks/19a58adc75a34f84b0ef.js +1 -0
  18. package/assets/esri/core/workers/chunks/1d7f2abfccc54659d6f2.js +1 -0
  19. package/assets/esri/core/workers/chunks/{339e7a900e2bba9d3647.js → 1f19bd3ef795c6765384.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{837f886f759fc6f0489d.js → 1f4fd9e3849f4e593375.js} +1 -1
  21. package/assets/esri/core/workers/chunks/1f9c6fbcd4d0eae1e574.js +1 -0
  22. package/assets/esri/core/workers/chunks/234117cc5cb7c6863313.js +1 -0
  23. package/assets/esri/core/workers/chunks/{1c025beaaac5ec7c04fb.js → 2adf558cd8d8155d07d7.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{47f64a340b5d56bf9e59.js → 2cf82d3645c75d311e99.js} +1 -1
  25. package/assets/esri/core/workers/chunks/{f7ab3511f6627f467796.js → 377a7f0f7d304ff9fe5b.js} +1 -1
  26. package/assets/esri/core/workers/chunks/3b4b4f84d594db8945f9.js +1 -0
  27. package/assets/esri/core/workers/chunks/3bf1cf6c3cba172e2f6d.js +1 -0
  28. package/assets/esri/core/workers/chunks/{b3ca65d6112079fb1d00.js → 3ce5d7ad16e41eea05be.js} +1 -1
  29. package/assets/esri/core/workers/chunks/465f2db4ab8aa9c9f907.js +1 -0
  30. package/assets/esri/core/workers/chunks/{1e13e03aad422f9e871e.js → 47fe2379f2214bf50036.js} +1 -1
  31. package/assets/esri/core/workers/chunks/{b8b5dfd2d73a8410fba2.js → 4954e0cf4a40e45d237f.js} +1 -1
  32. package/assets/esri/core/workers/chunks/4a362a35bcdb8405a53a.js +1 -0
  33. package/assets/esri/core/workers/chunks/4f8ebd9f0758b801835c.js +1 -0
  34. package/assets/esri/core/workers/chunks/5228d39c05d660a135b6.js +1 -0
  35. package/assets/esri/core/workers/chunks/{736cb9f74bf050b70f4c.js → 52a3d0e041717da7697e.js} +1 -1
  36. package/assets/esri/core/workers/chunks/54ea93f416ab52b413c1.js +1 -0
  37. package/assets/esri/core/workers/chunks/554a8bf4626336e68798.js +1 -0
  38. package/assets/esri/core/workers/chunks/55f087bca75c3f2a4515.js +1 -0
  39. package/assets/esri/core/workers/chunks/{bbaadce582df7e20397b.js → 56d2a20c1b143697aa19.js} +1 -1
  40. package/assets/esri/core/workers/chunks/57211c35a9646f088d86.js +1 -0
  41. package/assets/esri/core/workers/chunks/58526def64536b6581ab.js +1 -0
  42. package/assets/esri/core/workers/chunks/5890740d5a761b038560.js +1 -0
  43. package/assets/esri/core/workers/chunks/{9a641fb94819574e48f6.js → 5a73d8b7b01758ed4fdd.js} +1 -1
  44. package/assets/esri/core/workers/chunks/5dbd8d81d94cfda5bb32.js +1 -0
  45. package/assets/esri/core/workers/chunks/5e52c1c076a1502f9fe4.js +1 -0
  46. package/assets/esri/core/workers/chunks/609c7c9b7046b3a7acde.js +1 -0
  47. package/assets/esri/core/workers/chunks/{30f3014c0ac6e2bc14bf.js → 622c0552ca3cd674d46c.js} +1 -1
  48. package/assets/esri/core/workers/chunks/{6e64ce0958c3432004b6.js → 62798f66872dc32e77d6.js} +1 -1
  49. package/assets/esri/core/workers/chunks/6409160d226a0bea5ac6.js +1 -0
  50. package/assets/esri/core/workers/chunks/65fd971d0574d69cbc26.js +1 -0
  51. package/assets/esri/core/workers/chunks/6993a59cbb78bc26f029.js +1 -0
  52. package/assets/esri/core/workers/chunks/6b23ca6570357f9fb724.js +1 -0
  53. package/assets/esri/core/workers/chunks/6c37a5bd00d255d1337a.js +1 -0
  54. package/assets/esri/core/workers/chunks/6ce4327f63e6eb92bba8.js +1 -0
  55. package/assets/esri/core/workers/chunks/6f9b8df290b0ce09beae.js +1 -0
  56. package/assets/esri/core/workers/chunks/{e0247252c6a0f3340e33.js → 6fa1a5b7276a037dbd6a.js} +84 -106
  57. package/assets/esri/core/workers/chunks/7c819b3e6d69c526f4b2.js +1 -0
  58. package/assets/esri/core/workers/chunks/7df147da40474b028705.js +1 -0
  59. package/assets/esri/core/workers/chunks/{0766ecb677d667e5fb83.js → 7e1dc8e5e18f18dd21e2.js} +2 -2
  60. package/assets/esri/core/workers/chunks/{0766ecb677d667e5fb83.js.LICENSE.txt → 7e1dc8e5e18f18dd21e2.js.LICENSE.txt} +1 -1
  61. package/assets/esri/core/workers/chunks/{e662c86b8bafc5512d3d.js → 847e88e1d6da1e74cdc8.js} +1 -1
  62. package/assets/esri/core/workers/chunks/{6f5ec9bf7cf8a36d8e8b.js → 87eca6de502d18d8b7eb.js} +1 -1
  63. package/assets/esri/core/workers/chunks/{10e6dffa57aa1a626708.js → 8a6aac37b3133de74cce.js} +1 -1
  64. package/assets/esri/core/workers/chunks/8a87c181b85d0b86b9bb.js.LICENSE.txt +1 -1
  65. package/assets/esri/core/workers/chunks/8f1fbfdac04e694f621d.js +1 -0
  66. package/assets/esri/core/workers/chunks/91cd29f53f07bc38fe75.js +1 -0
  67. package/assets/esri/core/workers/chunks/{5583d18032ed8bc17c74.js → 938f1eebc48871be64e9.js} +1 -1
  68. package/assets/esri/core/workers/chunks/97c148adf0347c69a79c.js +1 -0
  69. package/assets/esri/core/workers/chunks/{029a118e6dfb3f544a5c.js → 98ef17d15517368d2383.js} +1 -1
  70. package/assets/esri/core/workers/chunks/9c8224ca29475556e5ea.js +1 -0
  71. package/assets/esri/core/workers/chunks/{fd24dd602a3fed88d90e.js → 9d5eac3bd1526e2b33e3.js} +1 -1
  72. package/assets/esri/core/workers/chunks/{38f5e6a202ce292edd9f.js → 9eb9c8db2510154c09cc.js} +1 -1
  73. package/assets/esri/core/workers/chunks/a036503087baa1f9fd00.js +1 -0
  74. package/assets/esri/core/workers/chunks/a673128da9e6656ead2e.js +1 -0
  75. package/assets/esri/core/workers/chunks/{90ae15ce22a49bd84876.js → ab9614555a15f04396f6.js} +2 -2
  76. package/assets/esri/core/workers/chunks/{90ae15ce22a49bd84876.js.LICENSE.txt → ab9614555a15f04396f6.js.LICENSE.txt} +1 -1
  77. package/assets/esri/core/workers/chunks/ae733c963d61065faa54.js +1 -0
  78. package/assets/esri/core/workers/chunks/b0522dffa5600345c07e.js +1 -0
  79. package/assets/esri/core/workers/chunks/{d1f7bfb8daf11ecada9f.js → b4273381dc069f4e1fa2.js} +1 -1
  80. package/assets/esri/core/workers/chunks/{fb2e28e6a87956267d1c.js → b92a34f88569c481ed10.js} +1 -1
  81. package/assets/esri/core/workers/chunks/{352b7dcd1633e0c98194.js → ba940ebdae84b174a7be.js} +1 -1
  82. package/assets/esri/core/workers/chunks/bf9b6b74654d303a6dae.js +1 -0
  83. package/assets/esri/core/workers/chunks/c07c1bb7ae09136dc1f6.js +1 -0
  84. package/assets/esri/core/workers/chunks/c938f5d269ba202d10ef.js +1 -0
  85. package/assets/esri/core/workers/chunks/cbbca011f8b176d4b5db.js +1 -0
  86. package/assets/esri/core/workers/chunks/{c604fefedccfd4db9953.js → ce321fd8fc5551e190ec.js} +1 -1
  87. package/assets/esri/core/workers/chunks/ce53ddda04e09ba2f860.js +1 -0
  88. package/assets/esri/core/workers/chunks/d166f805990353578494.js +1 -0
  89. package/assets/esri/core/workers/chunks/d9a23fb0c6c936d5e8ec.js +1 -0
  90. package/assets/esri/core/workers/chunks/db3f710d770adf631b28.js +2 -0
  91. package/assets/esri/core/workers/chunks/{6394ab6f629aa90292e6.js.LICENSE.txt → db3f710d770adf631b28.js.LICENSE.txt} +1 -1
  92. package/assets/esri/core/workers/chunks/{6805e7b43d6ecf3ea93c.js → dcf5719f38ad40b92941.js} +1 -1
  93. package/assets/esri/core/workers/chunks/e2cada6644c49b1b6e79.js +1 -0
  94. package/assets/esri/core/workers/chunks/e2fb4bebce3aee406efa.js +1 -0
  95. package/assets/esri/core/workers/chunks/e3638f9d4c0fda238f4b.js +1 -0
  96. package/assets/esri/core/workers/chunks/e85f892ea44d67d53ff0.js +2 -0
  97. package/assets/esri/core/workers/chunks/{3596540ef49e5330ceb2.js.LICENSE.txt → e85f892ea44d67d53ff0.js.LICENSE.txt} +1 -1
  98. package/assets/esri/core/workers/chunks/e89345c7af9d3d4d8452.js +1 -0
  99. package/assets/esri/core/workers/chunks/{a31658f544ac6e1801d6.js → ead5d4e271effc04def3.js} +1 -1
  100. package/assets/esri/core/workers/chunks/ece68a25651ef03fc95d.js +1 -0
  101. package/assets/esri/core/workers/chunks/f218a190015de1444018.js +1 -0
  102. package/assets/esri/core/workers/chunks/f229044615af3142bcb0.js +1 -0
  103. package/assets/esri/core/workers/chunks/f2692f25ef693cf12ce0.js +1 -0
  104. package/assets/esri/core/workers/chunks/f4c6ea630cecf0f260d7.js +2 -0
  105. package/assets/esri/core/workers/chunks/{e0dc8794343c2a949ffb.js.LICENSE.txt → f4c6ea630cecf0f260d7.js.LICENSE.txt} +1 -1
  106. package/assets/esri/core/workers/chunks/f718cb847c4eb1e43ad9.js +1 -0
  107. package/assets/esri/core/workers/chunks/faa40ef04604c7cce706.js +1 -0
  108. package/assets/esri/core/workers/chunks/{218a66d53f7cf4f285aa.js → fbd2f45d5adce4ca323f.js} +2 -2
  109. package/assets/esri/core/workers/chunks/{218a66d53f7cf4f285aa.js.LICENSE.txt → fbd2f45d5adce4ca323f.js.LICENSE.txt} +1 -1
  110. package/assets/esri/core/workers/chunks/{498886c321a2501658bc.js → ffaa977cd97a2b7190c5.js} +1 -1
  111. package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
  112. package/assets/esri/themes/base/widgets/_SelectionToolbar.scss +5 -0
  113. package/assets/esri/themes/dark/main.css +1 -1
  114. package/assets/esri/themes/light/main.css +1 -1
  115. package/assets/esri/themes/light/view.css +1 -1
  116. package/chunks/Envelope.js +1 -1
  117. package/chunks/Jpg.js +1 -1
  118. package/chunks/LineSeries.js +1 -1
  119. package/chunks/ProjectionTransformation.js +1 -1
  120. package/chunks/QuadraticBezier.js +1 -1
  121. package/chunks/ShadowCastAccumulate.glsl.js +7 -5
  122. package/chunks/ShadowCastVisualize.glsl.js +1 -1
  123. package/chunks/ShadowHighlight.glsl.js +8 -7
  124. package/chunks/Transformation2D.js +1 -1
  125. package/chunks/arcgis-knowledge-client-core-simd.js +1 -1
  126. package/chunks/arcgis-knowledge-client-core.js +1 -1
  127. package/chunks/basis_encoder.js +1 -1
  128. package/chunks/basis_transcoder.js +1 -1
  129. package/chunks/bundle.js +1 -1
  130. package/chunks/chartUtilsAm5.js +1 -1
  131. package/chunks/dxt_encoder.js +1 -1
  132. package/chunks/geometryEngineBase.js +1 -1
  133. package/chunks/i3s.js +1 -1
  134. package/chunks/lclayout.js +1 -1
  135. package/chunks/libtess-asm.js +1 -1
  136. package/chunks/lyr3DMain.js +1 -1
  137. package/chunks/lyr3DWorker.js +1 -1
  138. package/chunks/vec4.js +1 -1
  139. package/chunks/vxlLayer.js +1 -1
  140. package/core/arrayUtils.js +1 -1
  141. package/core/image/apng.js +1 -1
  142. package/core/image/gif.js +1 -1
  143. package/core/mathUtils.js +1 -1
  144. package/core/workers/Connection.js +1 -1
  145. package/geometry/operators/densifyOperator.d.ts +0 -1
  146. package/geometry/operators/gx/operatorOffset.js +1 -1
  147. package/geometry/operators/gx/operatorPolygonSlicer.js +1 -1
  148. package/geometry/support/meshProperties.js +1 -1
  149. package/geometry/support/normalizeUtilsSync.js +1 -1
  150. package/interfaces.d.ts +200 -147
  151. package/intl/date.js +1 -1
  152. package/intl/number.js +1 -1
  153. package/layers/BingMapsLayer.js +1 -1
  154. package/layers/graphics/OptimizedFeatureSet.js +1 -1
  155. package/layers/graphics/controllers/StreamController.js +1 -1
  156. package/layers/graphics/data/FeatureIdInfo.js +5 -0
  157. package/layers/graphics/data/QueryEngine.js +1 -1
  158. package/layers/graphics/data/StreamFeatureManager.js +1 -1
  159. package/layers/graphics/data/createFeatureId.js +5 -0
  160. package/layers/graphics/featureConversionUtils.js +1 -1
  161. package/layers/graphics/sources/WFSSourceWorker.js +1 -1
  162. package/layers/graphics/sources/geojson/GeoJSONSourceWorker.js +1 -1
  163. package/layers/graphics/sources/support/CSVSourceWorker.js +1 -1
  164. package/layers/graphics/sources/support/MemorySourceWorker.js +1 -1
  165. package/layers/knowledgeGraph/KnowledgeGraphSublayer.js +1 -1
  166. package/layers/ogc/ogcFeatureUtils.js +1 -1
  167. package/layers/orientedImagery/core/coverageUtils.js +1 -1
  168. package/layers/orientedImagery/core/utils.js +1 -1
  169. package/layers/orientedImagery/queries.js +1 -1
  170. package/layers/orientedImagery/transformations/utils.js +1 -1
  171. package/layers/support/LercWorker.js +1 -1
  172. package/layers/support/rasterDatasets/BaseRaster.js +1 -1
  173. package/layers/support/rasterFunctions/rasterProjectionHelper.js +1 -1
  174. package/layers/support/rasterFunctions/stretchUtils.js +1 -1
  175. package/layers/support/wmsUtils.js +1 -1
  176. package/layers/video/VideoController.js +1 -1
  177. package/package.json +1 -1
  178. package/rest/networks/support/Association.js +1 -1
  179. package/rest/networks/support/NetworkElement.js +1 -1
  180. package/rest/networks/support/QueryAssociationsParameters.js +1 -1
  181. package/rest/networks/support/TelecomNetworkElement.js +1 -1
  182. package/rest/networks/support/TraceResult.js +1 -1
  183. package/rest/query/operations/pbfDehydratedFeatureSet.js +1 -1
  184. package/rest/query/operations/pbfJSONFeatureSet.js +1 -1
  185. package/rest/query/operations/queryRelatedRecords.js +1 -1
  186. package/smartMapping/support/adapters/InMemoryLayerAdapter.js +1 -1
  187. package/support/revision.js +1 -1
  188. package/symbols/cim/effects/EffectControlMeasureLine.js +1 -1
  189. package/views/2d/engine/ManagedCanvas.js +1 -1
  190. package/views/2d/engine/Stage.js +1 -1
  191. package/views/2d/engine/vectorTiles/VectorTile.js +1 -1
  192. package/views/2d/engine/webgl/TileContainer.js +1 -1
  193. package/views/2d/engine/webgl/grouping.js +1 -1
  194. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  195. package/views/2d/layers/features/layerAdapters/CatalogFootprintLayerAdapter.js +1 -1
  196. package/views/2d/layers/features/layerAdapters/FeatureLayerAdapter.js +1 -1
  197. package/views/2d/layers/features/layerAdapters/InMemoryLayerAdapter.js +1 -1
  198. package/views/2d/layers/features/layerAdapters/KnowledgeGraphSublayerAdapter.js +1 -1
  199. package/views/2d/layers/features/layerAdapters/OGCFeatureLayerAdapter.js +1 -1
  200. package/views/2d/layers/features/layerAdapters/OrientedImageryLayerAdapter.js +1 -1
  201. package/views/2d/layers/features/layerAdapters/ParquetLayerAdapter.js +1 -1
  202. package/views/2d/layers/features/layerAdapters/StreamLayerAdapter.js +1 -1
  203. package/views/2d/layers/features/layerAdapters/SubtypeGroupLayerAdapter.js +1 -1
  204. package/views/2d/layers/features/layerAdapters/featureServiceUtils.js +1 -1
  205. package/views/2d/layers/features/processor/AAggregateStrategy.js +1 -1
  206. package/views/2d/layers/features/processor/BinningStrategy.js +1 -1
  207. package/views/2d/layers/features/processor/ClusterStrategy.js +1 -1
  208. package/views/2d/layers/features/processor/TrackStrategy.js +1 -1
  209. package/views/2d/layers/features/sources/FeatureSource.js +1 -1
  210. package/views/2d/layers/features/sources/FeatureSourceQueryInfo.js +1 -1
  211. package/views/2d/layers/features/sources/strategies/StreamLoadStrategy.js +1 -1
  212. package/views/2d/layers/features/sources/strategies/support/queryAdapters.js +1 -1
  213. package/views/2d/layers/features/support/AttributeStore.js +1 -1
  214. package/views/2d/layers/features/support/FeatureMetadata.js +1 -1
  215. package/views/2d/layers/features/support/FeatureSetReaderJSON.js +1 -1
  216. package/views/2d/layers/features/support/FeatureSetReaderPBF.js +1 -1
  217. package/views/2d/layers/features/support/FeatureSetReaderPBFHeader.js +1 -1
  218. package/views/2d/layers/features/support/FeatureSetReaderParquet.js +1 -1
  219. package/views/3d/FocusAreasView.js +1 -1
  220. package/views/3d/analysis/AnalysisViewManager3D.js +1 -1
  221. package/views/3d/analysis/DimensionAnalysisView3D.d.ts +4 -0
  222. package/views/3d/analysis/DimensionAnalysisView3D.js +1 -1
  223. package/views/3d/camera/constraintUtils/common.js +1 -1
  224. package/views/3d/interactive/Manipulator3D.js +1 -1
  225. package/views/3d/interactive/SnappingVisualizer3D.js +1 -1
  226. package/views/3d/layers/DimensionLayerView3D.js +1 -1
  227. package/views/3d/layers/I3SMeshView3D.js +1 -1
  228. package/views/3d/layers/LineOfSightLayerView3D.js +1 -1
  229. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  230. package/views/3d/layers/ViewshedLayerView3D.js +1 -1
  231. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  232. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  233. package/views/3d/layers/graphics/Graphics3DGraphic.js +1 -1
  234. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  235. package/views/3d/layers/graphics/Graphics3DSymbolLayer.js +1 -1
  236. package/views/3d/layers/graphics/Graphics3DTextSymbolLayer.js +1 -1
  237. package/views/3d/layers/graphics/Graphics3DWebStyleSymbol.js +1 -1
  238. package/views/3d/layers/graphics/Labeler.js +1 -1
  239. package/views/3d/layers/graphics/QueryEngine.js +1 -1
  240. package/views/3d/layers/graphics/focusAreaStyle.js +5 -0
  241. package/views/3d/layers/graphics/pipeline/Feature3DPipelineWorker.js +1 -1
  242. package/views/3d/layers/i3s/I3SBinaryReader.js +1 -1
  243. package/views/3d/layers/i3s/I3SMaterialUtil.js +1 -1
  244. package/views/3d/layers/i3s/I3SNodeLoader.js +1 -1
  245. package/views/3d/layers/i3s/I3SQueryEngine.js +1 -1
  246. package/views/3d/layers/i3s/PagedNodeIndex.js +1 -1
  247. package/views/3d/layers/i3s/PointCloudWorkerUtil.js +1 -1
  248. package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
  249. package/views/3d/layers/support/LayerViewAnalysisViewManager.js +5 -0
  250. package/views/3d/terrain/PatchRenderData.js +1 -1
  251. package/views/3d/terrain/TerrainRenderer.js +1 -1
  252. package/views/3d/terrain/TerrainSurface.js +1 -1
  253. package/views/3d/terrain/TileAgent.js +1 -1
  254. package/views/3d/webgl-engine/collections/Component/IndexRange/ComponentRange.js +1 -1
  255. package/views/3d/webgl-engine/core/FBOCache.js +1 -1
  256. package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js +3 -3
  257. package/views/3d/webgl-engine/core/shaderLibrary/shading/ShadowmapFiltering.glsl.js +3 -25
  258. package/views/3d/webgl-engine/core/shaderLibrary/shading/calculateUVZShadow.glsl.js +1 -1
  259. package/views/3d/webgl-engine/core/shaderModules/Texture2DShadowBindUniform.js +5 -0
  260. package/views/3d/webgl-engine/effects/RenderPluginManager.js +1 -1
  261. package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +3 -3
  262. package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskNode.js +1 -1
  263. package/views/3d/webgl-engine/lib/BoundingInfo.js +1 -1
  264. package/views/3d/webgl-engine/lib/DepthRange.js +1 -1
  265. package/views/3d/webgl-engine/lib/GPUPointOcclusionQuery.js +1 -1
  266. package/views/3d/webgl-engine/lib/Geometry.js +1 -1
  267. package/views/3d/webgl-engine/lib/Material.js +1 -1
  268. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  269. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  270. package/views/3d/webgl-engine/lib/ShadowCastRenderer.js +1 -1
  271. package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
  272. package/views/3d/webgl-engine/lib/ViewshedShadowMap.js +1 -1
  273. package/views/3d/webgl-engine/lib/lodRendering/InstanceData.js +1 -1
  274. package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
  275. package/views/3d/webgl-engine/lib/verticalOffsetUtils.js +1 -1
  276. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  277. package/views/3d/webgl-engine/shaders/ShadowCastAccumulate.glsl.js +1 -1
  278. package/views/3d/webgl-engine/shaders/ShadowHighlight.glsl.js +1 -1
  279. package/views/3d/webgl.js +1 -1
  280. package/views/FocusArea.js +1 -1
  281. package/views/FocusAreas.js +1 -1
  282. package/views/GroundView.js +1 -1
  283. package/views/SceneView.js +1 -1
  284. package/views/View.js +1 -1
  285. package/views/draw/support/Box.js +1 -1
  286. package/views/draw/support/GraphicMover.js +1 -1
  287. package/views/draw/support/Reshape.js +1 -1
  288. package/views/input/InputManager.js +1 -1
  289. package/views/interactive/snapping/featureSources/GraphicsSnappingSource.js +1 -1
  290. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorker.js +1 -1
  291. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiledFetcher.js +1 -1
  292. package/views/layers/FeatureLayerView.js +1 -1
  293. package/views/support/LayerViewManager.js +1 -1
  294. package/views/webgl/RenderingContext.js +1 -1
  295. package/views/webgl/ShaderBuilder.js +1 -1
  296. package/views/webgl/Texture.js +1 -1
  297. package/views/webgl/TextureDescriptor.js +1 -1
  298. package/views/webgl/textureUtils.js +1 -1
  299. package/webscene/Slide.js +1 -1
  300. package/widgets/AreaMeasurement2D/AreaMeasurement2DTool.js +1 -1
  301. package/widgets/AreaMeasurement2D/AreaMeasurement2DViewModel.js +1 -1
  302. package/widgets/CoordinateConversion.js +1 -1
  303. package/widgets/Directions.js +1 -1
  304. package/widgets/DistanceMeasurement2D/DistanceMeasurement2DTool.js +1 -1
  305. package/widgets/DistanceMeasurement2D/DistanceMeasurement2DViewModel.js +1 -1
  306. package/widgets/ElevationProfile/support/profileUtils.js +1 -1
  307. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
  308. package/widgets/FeatureForm.js +1 -1
  309. package/widgets/LayerList/LayerListItem.js +1 -1
  310. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  311. package/widgets/OrientedImageryViewer/components/ImageViewer.js +1 -1
  312. package/widgets/OrientedImageryViewer/components/ImageViewerViewModel.js +1 -1
  313. package/widgets/OrientedImageryViewer/components/NavigationUI.js +1 -1
  314. package/widgets/OrientedImageryViewer/components/NavigationUIPanoramicViewModel.js +5 -0
  315. package/widgets/OrientedImageryViewer/components/NavigationUIViewModel.js +1 -1
  316. package/widgets/OrientedImageryViewer/components/imageNavigationUtils.js +1 -1
  317. package/widgets/OrientedImageryViewer/constants.js +1 -1
  318. package/widgets/OrientedImageryViewer/navigation/NavigationManager.js +5 -0
  319. package/widgets/OrientedImageryViewer/navigation/NavigationManagerPanoramic.js +5 -0
  320. package/widgets/OrientedImageryViewer/navigation/errors.js +5 -0
  321. package/widgets/OrientedImageryViewer/navigation/queries.js +5 -0
  322. package/widgets/OrientedImageryViewer/navigation/utils.js +5 -0
  323. package/widgets/PanoramicViewer/PanoramicViewerViewModel.js +1 -1
  324. package/widgets/PanoramicViewer.js +1 -1
  325. package/widgets/ShadowCast/ShadowCastViewModel.js +1 -1
  326. package/widgets/Sketch/SketchViewModel.js +1 -1
  327. package/widgets/Sketch.js +1 -1
  328. package/widgets/support/SelectionToolbar/SelectionToolbarViewModel.js +1 -1
  329. package/widgets/support/SelectionToolbar.js +1 -1
  330. package/widgets/support/Selector2D/SelectionOperation.js +1 -1
  331. package/widgets/support/SnappingControls.js +1 -1
  332. package/widgets/support/UtilityNetworkAssociations/FeatureUtilityNetworkAssociationsViewModel.js +1 -1
  333. package/widgets/support/UtilityNetworkAssociations/utils/createAssociation.js +1 -1
  334. package/assets/esri/core/workers/chunks/0516bd18334d3af6c555.js +0 -1
  335. package/assets/esri/core/workers/chunks/0d8a635c1f9aeaf7564c.js +0 -1
  336. package/assets/esri/core/workers/chunks/191a45a594ecaf7f1abb.js +0 -1
  337. package/assets/esri/core/workers/chunks/1abd026ed12c863e1d94.js +0 -1
  338. package/assets/esri/core/workers/chunks/1c6542315390037053a6.js +0 -1
  339. package/assets/esri/core/workers/chunks/201db423e3c6f947b77c.js +0 -1
  340. package/assets/esri/core/workers/chunks/23de8aeed5b82c682cbe.js +0 -1
  341. package/assets/esri/core/workers/chunks/2e0af748eba93f3ea6cb.js +0 -1
  342. package/assets/esri/core/workers/chunks/3596540ef49e5330ceb2.js +0 -2
  343. package/assets/esri/core/workers/chunks/3604a77c93cf2927787b.js +0 -1
  344. package/assets/esri/core/workers/chunks/391b1c3e736a62befbaf.js +0 -1
  345. package/assets/esri/core/workers/chunks/40e556a0645af8658658.js +0 -1
  346. package/assets/esri/core/workers/chunks/4402336db7210cd583e0.js +0 -1
  347. package/assets/esri/core/workers/chunks/4899cdc8bb5085c356f9.js +0 -1
  348. package/assets/esri/core/workers/chunks/4bd5cbf6e0be2fc7e84d.js +0 -1
  349. package/assets/esri/core/workers/chunks/4c8052e81916579841f4.js +0 -1
  350. package/assets/esri/core/workers/chunks/4c9aa1dafdc0d9537231.js +0 -1
  351. package/assets/esri/core/workers/chunks/4feb774f123da26e9f2a.js +0 -1
  352. package/assets/esri/core/workers/chunks/51b5dfc7085272d26b89.js +0 -1
  353. package/assets/esri/core/workers/chunks/566c2ce50af225e556ac.js +0 -1
  354. package/assets/esri/core/workers/chunks/5ddf463c85c33428e807.js +0 -1
  355. package/assets/esri/core/workers/chunks/61032b5050464cb48056.js +0 -1
  356. package/assets/esri/core/workers/chunks/6394ab6f629aa90292e6.js +0 -2
  357. package/assets/esri/core/workers/chunks/63dade3e1cc7f5b76846.js +0 -1
  358. package/assets/esri/core/workers/chunks/64af433e88d4dd21a2ff.js +0 -1
  359. package/assets/esri/core/workers/chunks/6e12900a9f4c3c9941ec.js +0 -1
  360. package/assets/esri/core/workers/chunks/6e5d8a6b29c06a27998c.js +0 -1
  361. package/assets/esri/core/workers/chunks/6f506303017903b9a06f.js +0 -1
  362. package/assets/esri/core/workers/chunks/71e46e866c23372b0b58.js +0 -1
  363. package/assets/esri/core/workers/chunks/75fa861b5757551f8fdc.js +0 -1
  364. package/assets/esri/core/workers/chunks/7c49a8877bd744daa3d5.js +0 -1
  365. package/assets/esri/core/workers/chunks/7ea5bbb52e84be9a608e.js +0 -1
  366. package/assets/esri/core/workers/chunks/82c395d8649096609a8a.js +0 -1
  367. package/assets/esri/core/workers/chunks/86138c297095af1ac604.js +0 -1
  368. package/assets/esri/core/workers/chunks/8c21cc9af4ce9652cc5c.js +0 -1
  369. package/assets/esri/core/workers/chunks/8e6301006abdf47cc88d.js +0 -1
  370. package/assets/esri/core/workers/chunks/90f93091fe088875f80f.js +0 -1
  371. package/assets/esri/core/workers/chunks/91a02ee91f61cf841111.js +0 -1
  372. package/assets/esri/core/workers/chunks/9baeb3b5733acdda4e7c.js +0 -1
  373. package/assets/esri/core/workers/chunks/a1d697e2be1e892a666a.js +0 -1
  374. package/assets/esri/core/workers/chunks/a1f27c4f4b5ef3e359f7.js +0 -1
  375. package/assets/esri/core/workers/chunks/a348ff2dd936c6bf9399.js +0 -1
  376. package/assets/esri/core/workers/chunks/b64f708f821dd2bb51cd.js +0 -1
  377. package/assets/esri/core/workers/chunks/bf453744067267e84d1b.js +0 -1
  378. package/assets/esri/core/workers/chunks/c1175477dfcdee90a453.js +0 -1
  379. package/assets/esri/core/workers/chunks/c4e2b75b9135920babc3.js +0 -1
  380. package/assets/esri/core/workers/chunks/cb80b7ddc9acf625d754.js +0 -1
  381. package/assets/esri/core/workers/chunks/d22f91bc16a7641bcbef.js +0 -1
  382. package/assets/esri/core/workers/chunks/d52cf7b795ee52034f9e.js +0 -1
  383. package/assets/esri/core/workers/chunks/d971571a957de70d5a8d.js +0 -1
  384. package/assets/esri/core/workers/chunks/d9d9d4f99140e579eabb.js +0 -1
  385. package/assets/esri/core/workers/chunks/dc3a6beb3028009b3c23.js +0 -1
  386. package/assets/esri/core/workers/chunks/e0dc8794343c2a949ffb.js +0 -2
  387. package/assets/esri/core/workers/chunks/e483d2f169e51a361742.js +0 -1
  388. package/assets/esri/core/workers/chunks/e5608e5232e983531f72.js +0 -1
  389. package/assets/esri/core/workers/chunks/e613df03ceb39e29befa.js +0 -1
  390. package/assets/esri/core/workers/chunks/e697dd4508f02dcfe329.js +0 -1
  391. package/assets/esri/core/workers/chunks/eabfab23246d4a052ea3.js +0 -1
  392. package/assets/esri/core/workers/chunks/ec8e8048b3df2c92008d.js +0 -1
  393. package/assets/esri/core/workers/chunks/ed6d0fea159dea638c2f.js +0 -1
  394. package/assets/esri/core/workers/chunks/f5fcba6ca6f43bf1d65d.js +0 -1
  395. package/assets/esri/core/workers/chunks/f92d76b694ff0cdb212c.js +0 -1
  396. package/chunks/NetworkElement.js +0 -5
  397. package/views/FocusAreasUtils.js +0 -5
  398. package/views/analysis/DimensionAnalysisView.d.ts +0 -4
  399. package/views/analysis/DimensionAnalysisView.js +0 -5
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import"../../intl.js";import{deprecatedProperty as t}from"../../core/deprecate.js";import{handlesGroup as o}from"../../core/handleUtils.js";import i from"../../core/Logger.js";import{removeMaybe as s}from"../../core/maybe.js";import{property as l}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as r}from"../../core/accessorSupport/decorators/subclass.js";import n from"../Widget.js";import{loadCalciteComponents as a}from"./componentsUtils.js";import{globalCss as c}from"./globalCss.js";import"./widgetUtils.js";import{messageBundle as p}from"./decorators/messageBundle.js";import{tsx as d}from"./jsxFactory.js";import h from"./SelectionToolbar/SelectionToolbarViewModel.js";import u from"./SelectionToolbar/VisibleElements.js";import{formatNumber as f}from"../../intl/number.js";const v="esri-selection-toolbar",m={base:v,container:`${v}__container`,toolButton:`${v}__tool-button`};let g=class extends n{constructor(e,t){super(e,t),this._viewModelHandlesGroup=null,this.activeToolInfo=null,this.defaultLassoToolOptions={createTool:"polygon",mode:"freehand"},this.defaultPointToolOptions={createTool:"point"},this.defaultRectangleToolOptions={createTool:"rectangle"},this.disabled=!1,this.layout="horizontal",this.messages=null,this.scale="s",this.toolConfigs=[],this.viewModel=new h,this.visibleElements=new u,this._viewModelHandlesGroup=o([this.viewModel.on("complete",(e=>{this._set("activeToolInfo",null),this.emit("complete",e)}))])}destroy(){this._viewModelHandlesGroup=s(this._viewModelHandlesGroup)}loadDependencies(){return a({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),chip:()=>import("@esri/calcite-components/dist/components/calcite-chip")})}get _effectiveDisabled(){return this.disabled||"disabled"===this.state}get activeOperation(){return this.viewModel.activeOperation}get effectiveSelectionManager(){return this.viewModel.effectiveSelectionManager}get effectiveSources(){return this.viewModel.effectiveSources}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get layers(){return t(i.getLogger(this),"layers",{replacement:"Use SelectionToolbar.sources instead."}),this.viewModel.sources}set layers(e){t(i.getLogger(this),"layers",{replacement:"Use SelectionToolbar.sources instead."}),this.viewModel.sources=e}get layerViewPreferenceEnabled(){return this.viewModel.layerViewPreferenceEnabled}set layerViewPreferenceEnabled(e){this.viewModel.layerViewPreferenceEnabled=e}get selectionManager(){return this.viewModel.selectionManager}set selectionManager(e){this.viewModel.selectionManager=e}get state(){return this.viewModel.state}get sources(){return this.viewModel.sources}set sources(e){this.viewModel.sources=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visibleToolCount(){const{view:e,toolConfigs:t,visibleElements:o}=this;return(t?.length??0)+("2d"===e?.type?(o.lassoTool?1:0)+(o.rectangleTool?1:0):0)}activate(e){if(this.cancel(),!this._effectiveDisabled)switch(e){case"lasso":this._activateTool("lasso");break;case"rectangle":this._activateTool("rectangle");break;default:this._activateTool(e)}}cancel(){this.viewModel.cancel(),this._set("activeToolInfo",null)}render(){return d("div",{"aria-label":this.label,class:this.classes(m.base,c.widget)},d("div",{class:m.container},this._renderDefaultTools(),this._renderCustomTools()))}_renderDefaultTools(){if("2d"===this.view?.type)return[this._renderPanAction(),this._renderPointTool(),this._renderRectangleTool(),this._renderLassoTool(),this._renderChip()]}_renderPanAction(){if(!this.visibleElements.pan)return;const e=this.messages.pan,t=`${this.id}-tool-pan`;return this._renderAction({active:!this.activeToolInfo,disabled:this._effectiveDisabled,icon:"pan",id:t,key:t,onclick:()=>this.cancel(),text:e,title:e})}_renderChip(){if(!this.visibleElements.chip)return;const{effectiveSelectionManager:e}=this,t=e?.count??0,o=f(t);return d("calcite-chip",{appearance:"outline",closable:t>0,closed:0===t,disabled:this._effectiveDisabled||0===t,label:o,scale:this.scale,title:this.messages.clearSelection,onCalciteChipClose:()=>e?.clear()},o)}_renderCustomTools(){if(this.toolConfigs?.length)return this.toolConfigs.map((({toolName:e,icon:t,toolKey:o})=>this._renderToolWithTooltip(e,o,t)))}_renderPointTool(){if(this.visibleElements.pointTool)return this._renderToolWithTooltip("point","point","selection-set",this.messages.selectByPoint)}_renderLassoTool(){if(this.visibleElements.lassoTool)return this._renderToolWithTooltip("lasso","lasso","lasso-select",this.messages.selectByLasso)}_renderRectangleTool(){if(this.visibleElements.rectangleTool)return this._renderToolWithTooltip("rectangle","rectangle","cursor-marquee",this.messages.selectByRectangle)}_renderToolWithTooltip(e,t,o,i=e){const s=`${this.id}-tool-${t}`;return this._renderAction({active:this.activeToolInfo?.toolName===e,disabled:this._effectiveDisabled,icon:o||"selection",id:s,key:s,onclick:()=>this._toggleTool(e),text:i,title:i})}_renderAction(e){return d("calcite-action",{...e,bind:this,class:m.toolButton,scale:this.scale})}_activateTool(e){const t=this._getToolOptions(e);if(!t)return;const o=this.viewModel.activate(t);o&&this._set("activeToolInfo",{toolName:e,operation:o})}_toggleTool(e){if(this.activeToolInfo){const t=this.activeToolInfo.toolName;if(this.cancel(),t===e)return}this._activateTool(e)}_getToolOptions(e){return"lasso"===e?this.defaultLassoToolOptions:"point"===e?this.defaultPointToolOptions:"rectangle"===e?this.defaultRectangleToolOptions:this.toolConfigs.find((t=>t.toolName===e))}};e([l()],g.prototype,"_effectiveDisabled",null),e([l()],g.prototype,"activeOperation",null),e([l({readOnly:!0})],g.prototype,"activeToolInfo",void 0),e([l()],g.prototype,"defaultLassoToolOptions",void 0),e([l()],g.prototype,"defaultPointToolOptions",void 0),e([l()],g.prototype,"defaultRectangleToolOptions",void 0),e([l()],g.prototype,"disabled",void 0),e([l()],g.prototype,"effectiveSelectionManager",null),e([l()],g.prototype,"effectiveSources",null),e([l()],g.prototype,"label",null),e([l()],g.prototype,"layers",null),e([l()],g.prototype,"layerViewPreferenceEnabled",null),e([l()],g.prototype,"layout",void 0),e([l(),p("esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar")],g.prototype,"messages",void 0),e([l()],g.prototype,"scale",void 0),e([l()],g.prototype,"selectionManager",null),e([l()],g.prototype,"state",null),e([l()],g.prototype,"sources",null),e([l()],g.prototype,"toolConfigs",void 0),e([l()],g.prototype,"view",null),e([l()],g.prototype,"viewModel",void 0),e([l({type:u,nonNullable:!0})],g.prototype,"visibleElements",void 0),e([l()],g.prototype,"visibleToolCount",null),g=e([r("esri.widgets.support.SelectionToolbar")],g);export{g as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import"../../intl.js";import{deprecatedProperty as t}from"../../core/deprecate.js";import{handlesGroup as o}from"../../core/handleUtils.js";import i from"../../core/Logger.js";import{removeMaybe as s}from"../../core/maybe.js";import{on as l}from"../../core/reactiveUtils.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as n}from"../../core/accessorSupport/decorators/subclass.js";import a from"../Widget.js";import{loadCalciteComponents as c}from"./componentsUtils.js";import{globalCss as p}from"./globalCss.js";import"./widgetUtils.js";import{messageBundle as d}from"./decorators/messageBundle.js";import{tsx as h}from"./jsxFactory.js";import u from"./SelectionToolbar/SelectionToolbarViewModel.js";import v from"./SelectionToolbar/VisibleElements.js";import{formatNumber as f}from"../../intl/number.js";const m="esri-selection-toolbar",g={base:m,container:`${m}__container`,toolButton:`${m}__tool-button`};let b=class extends a{constructor(e,t){super(e,t),this._viewModelHandlesGroup=null,this.defaultLassoToolOptions={createTool:"polygon",mode:"freehand"},this.defaultPointToolOptions={createTool:"point"},this.defaultRectangleToolOptions={createTool:"rectangle"},this.disabled=!1,this.layout="horizontal",this.messages=null,this.scale="s",this.toolConfigs=[],this.viewModel=new u,this.visibleElements=new v}initialize(){this._viewModelHandlesGroup=o([l((()=>this.viewModel),"selection-change",(e=>this.emit("selection-change",e))),l((()=>this.viewModel),"complete",(e=>this.emit("complete",e)))])}destroy(){this._viewModelHandlesGroup=s(this._viewModelHandlesGroup)}loadDependencies(){return c({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),"action-bar":()=>import("@esri/calcite-components/dist/components/calcite-action-bar"),chip:()=>import("@esri/calcite-components/dist/components/calcite-chip")})}get _effectiveDisabled(){return this.disabled||"disabled"===this.state}get activeOperation(){return this.viewModel.activeOperation}get effectiveSelectionManager(){return this.viewModel.effectiveSelectionManager}get effectiveSources(){return this.viewModel.effectiveSources}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get layers(){return t(i.getLogger(this),"layers",{replacement:"Use SelectionToolbar.sources instead."}),this.viewModel.sources}set layers(e){t(i.getLogger(this),"layers",{replacement:"Use SelectionToolbar.sources instead."}),this.viewModel.sources=e}get layerViewPreferenceEnabled(){return this.viewModel.layerViewPreferenceEnabled}set layerViewPreferenceEnabled(e){this.viewModel.layerViewPreferenceEnabled=e}get selectionManager(){return this.viewModel.selectionManager}set selectionManager(e){this.viewModel.selectionManager=e}get state(){return this.viewModel.state}get sources(){return this.viewModel.sources}set sources(e){this.viewModel.sources=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visibleToolCount(){const{view:e,toolConfigs:t,visibleElements:o}=this;return(t?.length??0)+("2d"===e?.type?(o.lassoTool?1:0)+(o.rectangleTool?1:0):0)}activate(e){if(this.cancel(),!this._effectiveDisabled)return this.activate(e)}activateTool(e){if(this.cancel(),!this._effectiveDisabled)switch(e){case"lasso":return this._activateTool("lasso");case"rectangle":return this._activateTool("rectangle");default:return this._activateTool(e)}}cancel(){this.viewModel.cancel()}render(){return h("div",{"aria-label":this.label,class:this.classes(g.base,p.widget)},h("div",{class:g.container},h("calcite-action-bar",{expandDisabled:!0,layout:"horizontal",scale:this.scale},this._renderDefaultTools(),this._renderCustomTools(),this._renderChip())))}_renderDefaultTools(){if("2d"===this.view?.type)return[this._renderPanAction(),this._renderPointTool(),this._renderRectangleTool(),this._renderLassoTool()]}_renderPanAction(){if(!this.visibleElements.pan)return;const e=this.messages.pan,t=`${this.id}-tool-pan`;return this._renderAction({active:!this.activeOperation,disabled:this._effectiveDisabled,icon:"pan",id:t,key:t,onclick:()=>this.cancel(),text:e,title:e})}_renderChip(){if(!this.visibleElements.chip)return;const{effectiveSelectionManager:e}=this,t=e?.count??0,o=f(t);return h("calcite-chip",{appearance:"outline",closable:t>0,closed:0===t,disabled:this._effectiveDisabled||0===t,label:o,scale:this.scale,slot:"actions-end",title:this.messages.clearSelection,onCalciteChipClose:()=>e?.clear()},o)}_renderCustomTools(){if(this.toolConfigs?.length)return this.toolConfigs.map((({toolName:e,icon:t,toolKey:o})=>this._renderToolWithTooltip(e,o,t)))}_renderPointTool(){if(this.visibleElements.pointTool)return this._renderToolWithTooltip("point","point","selection-set",this.messages.selectByPoint)}_renderLassoTool(){if(this.visibleElements.lassoTool)return this._renderToolWithTooltip("lasso","lasso","lasso-select",this.messages.selectByLasso)}_renderRectangleTool(){if(this.visibleElements.rectangleTool)return this._renderToolWithTooltip("rectangle","rectangle","cursor-marquee",this.messages.selectByRectangle)}_renderToolWithTooltip(e,t,o,i=e){const s=`${this.id}-tool-${t}`;return this._renderAction({active:this.activeOperation?.name===e,disabled:this._effectiveDisabled,icon:o||"selection",id:s,key:s,onclick:()=>this._toggleTool(e),text:i,title:i})}_renderAction(e){return h("calcite-action",{...e,bind:this,class:g.toolButton,scale:this.scale})}_activateTool(e){const t=this._getToolOptions(e);if(t)return this.viewModel.activate(t)}_toggleTool(e){const{activeOperation:t}=this;if(t){const o=t.name;if(this.cancel(),o===e)return}this._activateTool(e)}_getToolOptions(e){return"lasso"===e?this.defaultLassoToolOptions:"point"===e?this.defaultPointToolOptions:"rectangle"===e?this.defaultRectangleToolOptions:this.toolConfigs.find((t=>t.toolName===e))}};e([r()],b.prototype,"_effectiveDisabled",null),e([r()],b.prototype,"activeOperation",null),e([r()],b.prototype,"defaultLassoToolOptions",void 0),e([r()],b.prototype,"defaultPointToolOptions",void 0),e([r()],b.prototype,"defaultRectangleToolOptions",void 0),e([r()],b.prototype,"disabled",void 0),e([r()],b.prototype,"effectiveSelectionManager",null),e([r()],b.prototype,"effectiveSources",null),e([r()],b.prototype,"label",null),e([r()],b.prototype,"layers",null),e([r()],b.prototype,"layerViewPreferenceEnabled",null),e([r()],b.prototype,"layout",void 0),e([r(),d("esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar")],b.prototype,"messages",void 0),e([r()],b.prototype,"scale",void 0),e([r()],b.prototype,"selectionManager",null),e([r()],b.prototype,"state",null),e([r()],b.prototype,"sources",null),e([r()],b.prototype,"toolConfigs",void 0),e([r()],b.prototype,"view",null),e([r()],b.prototype,"viewModel",void 0),e([r({type:v,nonNullable:!0})],b.prototype,"visibleElements",void 0),e([r()],b.prototype,"visibleToolCount",null),b=e([n("esri.widgets.support.SelectionToolbar")],b);export{b as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import{createTask as t}from"../../../core/asyncUtils.js";import o from"../../../core/Collection.js";import r from"../../../core/Evented.js";import{makeHandle as s}from"../../../core/handleUtils.js";import i from"../../../core/Logger.js";import{abortMaybe as n}from"../../../core/maybe.js";import{debounce as l,onAbort as a,ignoreAbortErrors as c}from"../../../core/promiseUtils.js";import{createScreenPoint as p}from"../../../core/screenUtils.js";import{property as d}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as h}from"../../../core/accessorSupport/decorators/subclass.js";import m from"../../../geometry/Point.js";import y from"../../../geometry/Polygon.js";import{isClockwise as u}from"../../../geometry/support/coordsUtils.js";import{sketchKeys as f,selectionKeys as g}from"../../../views/interactive/keybindings.js";import{getSelectionFromGeometry as v}from"./selectorUtils.js";const _=100;let w=class extends r.EventedAccessor{constructor(e){super(e),this._isConstraintKeyDown=!1,this._processTask=null,this.options=null,this.selection=new o,this.selectionManager=null,this.sources=null,this.type="add",this._process=l((async(e,o)=>{const{callback:r,selector:s,completed:i}=e,n=t((async e=>{const{effectiveSelectionManager:t,options:o,selection:n,sources:l,view:a}=this,c=!l?.length&&!t.sources.length;if(n.removeAll(),!c&&a){if(s&&null!=l){const r=await v({returnGeometry:o?.returnGeometry,selector:s,signal:e,sources:l,view:a});if(n.addMany(r),i&&!1!==o?.persistSelection)switch(this.effectiveType){case"remove":t.updateSelection({current:[],added:[],removed:r});break;case"replace":t.clear(),t.updateSelection({current:r,added:[],removed:[]});break;default:t.updateSelection({current:r,added:[],removed:[]})}}r&&r()}}));return a(o,(()=>n.abort())),this._processTask=n,n.promise}),_),this._onOperationFinish=this._onOperationFinish.bind(this)}initialize(){this._setup()}get _selectionArea(){const e=this._tool.coordinates;if(0===e.length)return;const t=p(),o=this.view.spatialReference,r=e=>{t.x=e[0],t.y=e[1];const o=this.view.toMap(t);return[o?.x??0,o?.y??0]};if(1===e.length||e.every((([t,o])=>t===e[0][0]&&o===e[0][1]))){const[t,s]=r(e[0]);return new m({x:t,y:s,spatialReference:o})}const s=e.map(r);if(0===s.length)return;u(s)||s.reverse();return new y({spatialReference:o,rings:[s]})}get effectiveSelectionManager(){return this.selectionManager??this.view.selectionManager}get effectiveType(){const e=this.type??"add";if(this._isConstraintKeyDown)switch(e){case"add":return"remove";case"remove":case"replace":return"add";default:return e}return e}get processingFinalSelection(){return!(!this._processTask||!this._tool?.drawOperation.isCompleted)}cancel(){this.selection.removeAll(),this._onOperationFinish(!0)}destroy(){this._toolImportController=n(this._toolImportController)}async _setup(){const{view:e}=this;if(await e.whenReady(),this.destroyed||this._toolImportController)return;const t=new AbortController;this._toolImportController=t;const o=await import("../../../views/draw/DrawScreenTool.js");if(t.signal.aborted)return;const{options:r}=this,n=r?.createTool??"rectangle",l=r?.mode??("polygon"===n?"click":"hybrid"),a=Symbol();try{this._tool=new o.DrawScreenTool({view:e,mode:l,geometryType:n})}finally{this._toolImportController=null}this._tool?(r?.selectOnComplete||this.addHandles(this._tool.on(["cursor-update","vertex-add","vertex-remove"],(()=>c(this._process({selector:this._selectionArea})))),a),this.addHandles([e.on("key-down",(e=>{if(!e.repeat)switch(e.key){case f.constraint:this._tool.uniformSizeToggled=!0,e.stopPropagation();break;case f.center:this._tool.centeredToggled=!0,e.stopPropagation()}})),e.on("key-up",(e=>{switch(e.key){case f.constraint:this._tool.uniformSizeToggled=!1,e.stopPropagation();break;case f.center:this._tool.centeredToggled=!1,e.stopPropagation()}})),this._tool.on("complete",(async t=>{this._isConstraintKeyDown=g.invertType.some((t=>e.inputManager.isModifierKeyDown(t))),this.removeHandles(a),t.aborted?this.cancel():(this._tool.cursor="progress",await this._process({selector:this._selectionArea,callback:this._onOperationFinish,completed:!0}))}))],a),this.addHandles(s((()=>e.tools.remove(this._tool)))),e.addAndActivateTool(this._tool)):i.getLogger(this).warn("Unable to import Draw module. SelectionOperation failed to load.")}_onOperationFinish(e=!1){this.removeAllHandles(),this._processTask?.abort(),this.emit("complete",{aborted:e,operationType:this.effectiveType,selection:this.selection.toArray()})}};e([d()],w.prototype,"_isConstraintKeyDown",void 0),e([d()],w.prototype,"_processTask",void 0),e([d()],w.prototype,"_selectionArea",null),e([d()],w.prototype,"effectiveSelectionManager",null),e([d()],w.prototype,"effectiveType",null),e([d()],w.prototype,"options",void 0),e([d()],w.prototype,"processingFinalSelection",null),e([d({readOnly:!0})],w.prototype,"selection",void 0),e([d()],w.prototype,"selectionManager",void 0),e([d()],w.prototype,"sources",void 0),e([d({constructOnly:!0})],w.prototype,"type",void 0),e([d({constructOnly:!0})],w.prototype,"view",void 0),w=e([h("esri.widgets.support.Selector2D.SelectionOperation")],w);export{w as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import{createTask as t}from"../../../core/asyncUtils.js";import o from"../../../core/Collection.js";import r from"../../../core/Evented.js";import{makeHandle as s}from"../../../core/handleUtils.js";import i from"../../../core/Logger.js";import{abortMaybe as n}from"../../../core/maybe.js";import{debounce as c,onAbort as l,ignoreAbortErrors as a}from"../../../core/promiseUtils.js";import{createScreenPoint as p}from"../../../core/screenUtils.js";import{property as d}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as h}from"../../../core/accessorSupport/decorators/subclass.js";import m from"../../../geometry/Point.js";import y from"../../../geometry/Polygon.js";import{isClockwise as u}from"../../../geometry/support/coordsUtils.js";import{sketchKeys as f,selectionKeys as v}from"../../../views/interactive/keybindings.js";import{getSelectionFromGeometry as g}from"./selectorUtils.js";const _=100;let w=class extends r.EventedAccessor{constructor(e){super(e),this._isConstraintKeyDown=!1,this._processTask=null,this.createTool="rectangle",this.mode=null,this.name="",this.persistSelection=!0,this.returnGeometry=!0,this.selection=new o,this.selectionManager=null,this.selectOnComplete=!0,this.sources=null,this.type="add",this._process=c((async(e,o)=>{const{callback:r,selector:s,completed:i}=e,n=t((async e=>{const{effectiveSelectionManager:t,returnGeometry:o,selection:n,sources:c,view:l}=this,a=!c?.length&&!t.sources.length;if(n.removeAll(),!a&&l){if(s&&null!=c){const r=await g({returnGeometry:o,selector:s,signal:e,sources:c,view:l});if(n.addMany(r),i&&this.persistSelection)switch(this.effectiveType){case"remove":t.updateSelection({current:[],added:[],removed:r});break;case"replace":t.clear(),t.updateSelection({current:r,added:[],removed:[]});break;default:t.updateSelection({current:r,added:[],removed:[]})}}r&&r()}}));return l(o,(()=>n.abort())),this._processTask=n,n.promise}),_),this._onOperationFinish=this._onOperationFinish.bind(this)}initialize(){this._setup()}get _defaultMode(){return"polygon"===this.createTool?"click":"hybrid"}get _selectionArea(){const e=this._tool.coordinates;if(0===e.length)return;const t=p(),o=this.view.spatialReference,r=e=>{t.x=e[0],t.y=e[1];const o=this.view.toMap(t);return[o?.x??0,o?.y??0]};if(1===e.length||e.every((([t,o])=>t===e[0][0]&&o===e[0][1]))){const[t,s]=r(e[0]);return new m({x:t,y:s,spatialReference:o})}const s=e.map(r);if(0===s.length)return;u(s)||s.reverse();return new y({spatialReference:o,rings:[s]})}get effectiveSelectionManager(){return this.selectionManager??this.view.selectionManager}get effectiveType(){const e=this.type??"add";if(this._isConstraintKeyDown)switch(e){case"add":return"remove";case"remove":case"replace":return"add";default:return e}return e}get processingFinalSelection(){return!(!this._processTask||!this._tool?.drawOperation.isCompleted)}cancel(){this.selection.removeAll(),this._onOperationFinish(!0)}destroy(){this._toolImportController=n(this._toolImportController)}async _setup(){const{createTool:e,view:t}=this;if(await t.whenReady(),this.destroyed||this._toolImportController)return;const o=new AbortController;this._toolImportController=o;const r=await import("../../../views/draw/DrawScreenTool.js");if(o.signal.aborted)return;const n=Symbol();try{this._tool=new r.DrawScreenTool({view:t,mode:this.mode??this._defaultMode,geometryType:e})}finally{this._toolImportController=null}this._tool?(this.selectOnComplete||this.addHandles(this._tool.on(["cursor-update","vertex-add","vertex-remove"],(()=>{this._syncConstraintKeyDown(),a(this._process({selector:this._selectionArea}))})),n),this.addHandles([t.on("key-down",(e=>{if(!e.repeat)switch(e.key){case f.constraint:this._tool.uniformSizeToggled=!0,e.stopPropagation();break;case f.center:this._tool.centeredToggled=!0,e.stopPropagation()}})),t.on("key-up",(e=>{switch(e.key){case f.constraint:this._tool.uniformSizeToggled=!1,e.stopPropagation();break;case f.center:this._tool.centeredToggled=!1,e.stopPropagation()}})),this.selection.on("change",(e=>this.emit("selection-change",{operationType:this.effectiveType,...e}))),this._tool.on("complete",(async e=>{this._syncConstraintKeyDown(),this.removeHandles(n),e.aborted?this.cancel():(this._tool.cursor="progress",await this._process({selector:this._selectionArea,callback:this._onOperationFinish,completed:!0}))}))],n),this.addHandles(s((()=>t.tools.remove(this._tool)))),t.addAndActivateTool(this._tool)):i.getLogger(this).warn("Unable to import Draw module. SelectionOperation failed to load.")}_syncConstraintKeyDown(){const{inputManager:e}=this.view;this._isConstraintKeyDown=v.invertType.some((t=>e.isModifierKeyDown(t)))}_onOperationFinish(e=!1){this.removeAllHandles(),this._processTask?.abort(),this.emit("complete",{aborted:e,operationType:this.effectiveType,selection:this.selection.toArray()})}};e([d()],w.prototype,"_defaultMode",null),e([d()],w.prototype,"_isConstraintKeyDown",void 0),e([d()],w.prototype,"_processTask",void 0),e([d()],w.prototype,"_selectionArea",null),e([d({constructOnly:!0})],w.prototype,"createTool",void 0),e([d()],w.prototype,"effectiveSelectionManager",null),e([d()],w.prototype,"effectiveType",null),e([d({constructOnly:!0})],w.prototype,"mode",void 0),e([d({constructOnly:!0})],w.prototype,"name",void 0),e([d()],w.prototype,"persistSelection",void 0),e([d()],w.prototype,"processingFinalSelection",null),e([d()],w.prototype,"returnGeometry",void 0),e([d({readOnly:!0})],w.prototype,"selection",void 0),e([d({constructOnly:!0})],w.prototype,"selectionManager",void 0),e([d({constructOnly:!0})],w.prototype,"selectOnComplete",void 0),e([d()],w.prototype,"sources",void 0),e([d({constructOnly:!0})],w.prototype,"type",void 0),e([d({constructOnly:!0})],w.prototype,"view",void 0),w=e([h("esri.widgets.support.Selector2D.SelectionOperation")],w);export{w as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import{isSome as t}from"../../core/arrayUtils.js";import{createTask as i}from"../../core/asyncUtils.js";import{destroyMaybe as s}from"../../core/maybe.js";import{watch as l}from"../../core/reactiveUtils.js";import{generateUID as n}from"../../core/uid.js";import{property as o}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import{subclass as a}from"../../core/accessorSupport/decorators/subclass.js";import r from"../Widget.js";import{loadCalciteComponents as d}from"./componentsUtils.js";import{globalCss as p}from"./globalCss.js";import{loadLabeledSwitchComponents as c,LabeledSwitch as g}from"./LabeledSwitch.js";import{setFocus as h}from"./widgetUtils.js";import{messageBundle as b}from"./decorators/messageBundle.js";import{tsx as m}from"./jsxFactory.js";import u from"./SnappingControls/SnappingControlsViewModel.js";import{itemTitleMatchesFilter as y}from"./SnappingControls/snappingLayerListUtils.js";import _ from"./SnappingControls/VisibleElements.js";const L="esri-snapping-controls",w={base:L,container:`${L}__container`,toggleBlock:`${L}__toggle-block`,layerListBlock:`${L}__layer-list-block`,layerList:`${L}__layer-list`,layerListFilter:`${L}__layer-list__filter`,layerListButton:`${L}__layer-list__button`,layerListItem:`${L}__layer-list__item`,layerListGroup:`${L}__layer-list__group`,nestedContainer:`${L}__nested-container`};let v=class extends r{constructor(e,t){super(e,t),this._defaultViewModel=null,this._layerListFilter=null,this._gridLoadTask=null,this.layerListOpen=!0,this.gridOptionsOpen=!1,this.messages=null,this.messagesCommon=null,this.snappingManager=null,this.visibleElements=new _,this._enableSnappingSwitchChange=e=>{this.snappingOptions.enabled=e},this._featureEnabledSwitchChange=e=>{this.snappingOptions.featureEnabled=e},this._gridEnabledSwitchChange=e=>{this.snappingOptions.gridEnabled=e,e&&this._startLoadGrid()},this._selfEnabledSwitchChange=e=>{this.snappingOptions.selfEnabled=e},this._onToggleLayersButtonClick=e=>{this.viewModel.toggleSnappingForAllLayers(!this.viewModel.allLayersEnabled),h(e.target)};const{snappingOptions:i,view:s,viewModel:l}=e;this.viewModel=l??(this._defaultViewModel=new u({snappingOptions:i,view:s}))}normalizeCtorArgs(e){const{snappingOptions:t,view:i,viewModel:s,...l}=e;return l}destroy(){this.viewModel!==this._defaultViewModel&&(this._defaultViewModel=s(this._defaultViewModel))}loadDependencies(){return Promise.all([d({block:()=>import("@esri/calcite-components/dist/components/calcite-block"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),input:()=>import("@esri/calcite-components/dist/components/calcite-input"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),checkbox:()=>import("@esri/calcite-components/dist/components/calcite-checkbox"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader")}),c()])}initialize(){this.addHandles(l((()=>"2d"===this.view?.type&&!!this.view.grid),(e=>{this.visibleElements.gridControls&&(this.snappingOptions.gridEnabled=e)})))}get _openAndReady(){return this.gridOptionsOpen&&this.snappingOptions.gridEnabled&&this.snappingOptions.enabled}get icon(){return"snap-to-point"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get snappingOptions(){return this.viewModel.snappingOptions}set snappingOptions(e){this.viewModel.snappingOptions=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}set viewModel(e){e!==this._get("viewModel")&&(null!=this._defaultViewModel&&this._defaultViewModel===e||(this._defaultViewModel=s(this._defaultViewModel)),this._set("viewModel",e))}render(){const{label:e}=this;return m("div",{"aria-label":e,class:this.classes(w.base,p.widget)},m("div",{class:w.container},this._renderContent()))}_renderContent(){return[this._renderToggles(),this._renderLayerList(),"2d"===this.view?.type&&this.visibleElements.gridControls?this._renderGridOptions():null]}_renderToggles(){const{visibleElements:e,view:i}=this,s=[e.selfEnabledToggle?this._renderSelfEnabledToggle():null,e.featureEnabledToggle?this._renderFeatureEnabledToggle():null,e.gridEnabledToggle&&"2d"===i?.type?this._renderGridEnabledToggle():null].filter(t),l=[e.enabledToggle?this._renderEnabledToggle():null,s.length>0?m("div",{class:w.nestedContainer},s):null].filter(t);return 0===l.length?null:m("calcite-block",{class:w.toggleBlock,expanded:!0,heading:e.header?this.label:"",key:"toggle-block",label:this.label},l)}_renderEnabledToggle(){return m(g,{checked:this.viewModel.snappingOptions.enabled,disabled:this._enabledToggleDisabled,key:`${this.id}__enabled-toggle`,label:this.messages.enableSnapping,onChange:this._enableSnappingSwitchChange})}_renderSelfEnabledToggle(){return m(g,{checked:this.viewModel.snappingOptions.selfEnabled,disabled:this._secondaryElementsDisabled,key:`${this.id}__self-enabled-toggle`,label:this.messages.geometryGuides,onChange:this._selfEnabledSwitchChange})}_renderFeatureEnabledToggle(){return m(g,{checked:this.viewModel.snappingOptions.featureEnabled,disabled:this._secondaryElementsDisabled,key:`${this.id}__feature-enabled-toggle`,label:this.messages.featureToFeature,onChange:this._featureEnabledSwitchChange})}_renderGridEnabledToggle(){return m(g,{checked:this.viewModel.snappingOptions.gridEnabled,disabled:this._secondaryElementsDisabled,key:`${this.id}__grid-enabled-toggle`,label:this.messages.grid,onChange:this._gridEnabledSwitchChange})}_renderLayerList(){if(!this.visibleElements.layerList)return null;const{messages:e,viewModel:t}=this,i=t.layerListViewModel.operationalItems.length>9?m("calcite-input",{class:w.layerListFilter,clearable:!0,placeholder:e?.searchLayers,onCalciteInputInput:({currentTarget:{value:e}})=>{this._layerListFilter=""===e?null:new RegExp(e,"i")}}):null,s=this._secondaryElementsDisabled,l=this.layerListOpen&&!s,n=t.layerListViewModel.operationalItems?.find((e=>!!e.children.length));return m("calcite-block",{class:w.layerListBlock,collapsible:!0,disabled:this._secondaryElementsDisabled,expanded:l,heading:e.snappingLayers,key:"list-block",onCalciteBlockToggle:e=>this.layerListOpen=e.currentTarget.open},i,this._renderToggleLayersButton(),m("calcite-list",{class:w.layerList,displayMode:n?"nested":"flat",label:e?.snappingLayers,selectionMode:"none"},this._renderLayerListItemCollection(t.layerListViewModel.operationalItems)))}_renderGridOptions(){const{view:e,visibleElements:t,snappingManager:i,snappingOptions:s,_openAndReady:l}=this,{gridEnabled:n,enabled:o}=s;(l||"2d"===e?.type&&e.grid)&&this._startLoadGrid();const a=this._gridLoadTask?.value,r=a&&"2d"===e?.type&&m(a,{snappingManager:i,snappingOptions:s,view:e,visibleElements:t.gridControlsElements});return m("calcite-block",{class:w.layerListBlock,collapsible:!0,disabled:!n||!o,expanded:l,heading:this.messages.gridOptionsHeading,key:"grid-block",onCalciteBlockClose:()=>this.gridOptionsOpen=!1,onCalciteBlockOpen:()=>this.gridOptionsOpen=!0},r??m("calcite-loader",{label:this.messagesCommon.loading,scale:"s",text:this.messagesCommon.loading}))}async _startLoadGrid(){!this._gridLoadTask&&this.visibleElements.gridControls&&"2d"===this.view?.type&&(this._gridLoadTask=i((async()=>(await import("./GridControls.js")).default)))}_renderLayerListItemCollection(e){const i=this._layerListFilter;return e.map((e=>{switch(i?y(e,i):null){case"children":{const t=e.children.filter((e=>!1!==y(e,i)));return this._renderLayerListItemGroup(e,t)}case"self":case null:return this._renderLayerListItemOrGroup(e);case!1:return"self"===y(e.parent,i)?this._renderLayerListItemOrGroup(e):null}})).toArray().filter(t)}_renderToggleLayersButton(){if(!this.visibleElements.layerListToggleLayersButton)return null;const{viewModel:{allLayersEnabled:e},messages:t}=this,i=e?t.disableAllLayers:t.enableAllLayers;return m("calcite-button",{appearance:"transparent",class:w.layerListButton,label:i,name:"layer-toggle",onclick:this._onToggleLayersButtonClick},i)}_renderLayerListItemOrGroup(e){if(e.children.length)return this._renderLayerListItemGroup(e);const{messages:{untitledLayer:t}}=this,i=e.title||t,s=()=>{this.viewModel.toggleSnappingForLayers([e.layer?.id],"enabled"!==e.enabled)};return m("calcite-list-item",{class:w.layerListItem,key:`${this.id}-list-item-${e.uid}`,label:i,onCalciteListItemSelect:e=>{e.stopPropagation(),s()}},m("calcite-checkbox",{checked:"enabled"===e.enabled,slot:"actions-start",onCalciteCheckboxChange:s}))}_renderLayerListItemGroup(e,t){const{messages:i}=this,{children:s,title:l}=e,o=l||i.untitledLayer,a=l&&""!==l?l:n(),r=!!t?.length,d=t??s,p=()=>{this.viewModel.toggleSnappingForLayers(e.childLayerIds,"enabled"!==e.enabled)},c=d?.find((e=>!!e.children.length));return m("calcite-list-item",{class:w.layerListGroup,expanded:r,key:a,label:o,onCalciteListItemSelect:e=>{e.stopPropagation(),p()}},m("calcite-checkbox",{checked:"enabled"===e.enabled,indeterminate:"indeterminate"===e.enabled,slot:"actions-start",onCalciteCheckboxChange:p}),m("calcite-list",{displayMode:c?"nested":"flat",label:i?.snappingLayers,selectionMode:"none"},this._renderLayerListItemCollection(d)))}get _enabledToggleDisabled(){const e=this.snappingOptions;return e.enabledToggled||e.forceDisabled}get _secondaryElementsDisabled(){return this._enabledToggleDisabled||!this.snappingOptions.enabled}};e([o()],v.prototype,"_defaultViewModel",void 0),e([o()],v.prototype,"_layerListFilter",void 0),e([o()],v.prototype,"_gridLoadTask",void 0),e([o()],v.prototype,"_openAndReady",null),e([o()],v.prototype,"label",null),e([o({type:Boolean,nonNullable:!0})],v.prototype,"layerListOpen",void 0),e([o({type:Boolean,nonNullable:!0})],v.prototype,"gridOptionsOpen",void 0),e([o(),b("esri/widgets/support/SnappingControls/t9n/SnappingControls")],v.prototype,"messages",void 0),e([o(),b("esri/t9n/common")],v.prototype,"messagesCommon",void 0),e([o()],v.prototype,"snappingOptions",null),e([o()],v.prototype,"snappingManager",void 0),e([o()],v.prototype,"view",null),e([o()],v.prototype,"viewModel",null),e([o({type:_,nonNullable:!0})],v.prototype,"visibleElements",void 0),e([o()],v.prototype,"_enabledToggleDisabled",null),e([o()],v.prototype,"_secondaryElementsDisabled",null),v=e([a("esri.widgets.support.SnappingControls")],v);const f=v;export{f as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import{isSome as t}from"../../core/arrayUtils.js";import{createTask as i}from"../../core/asyncUtils.js";import{destroyMaybe as s}from"../../core/maybe.js";import{watch as l}from"../../core/reactiveUtils.js";import{generateUID as n}from"../../core/uid.js";import{property as o}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import{subclass as a}from"../../core/accessorSupport/decorators/subclass.js";import r from"../Widget.js";import{loadCalciteComponents as d}from"./componentsUtils.js";import{globalCss as p}from"./globalCss.js";import{loadLabeledSwitchComponents as c,LabeledSwitch as g}from"./LabeledSwitch.js";import{setFocus as h}from"./widgetUtils.js";import{messageBundle as b}from"./decorators/messageBundle.js";import{tsx as m}from"./jsxFactory.js";import u from"./SnappingControls/SnappingControlsViewModel.js";import{itemTitleMatchesFilter as y}from"./SnappingControls/snappingLayerListUtils.js";import _ from"./SnappingControls/VisibleElements.js";const L="esri-snapping-controls",w={base:L,container:`${L}__container`,toggleBlock:`${L}__toggle-block`,layerListBlock:`${L}__layer-list-block`,layerList:`${L}__layer-list`,layerListFilter:`${L}__layer-list__filter`,layerListButton:`${L}__layer-list__button`,layerListItem:`${L}__layer-list__item`,layerListGroup:`${L}__layer-list__group`,nestedContainer:`${L}__nested-container`};let v=class extends r{constructor(e,t){super(e,t),this._defaultViewModel=null,this._layerListFilter=null,this._gridLoadTask=null,this.layerListOpen=!0,this.gridOptionsOpen=!1,this.messages=null,this.messagesCommon=null,this.snappingManager=null,this.visibleElements=new _,this._enableSnappingSwitchChange=e=>{this.snappingOptions.enabled=e},this._featureEnabledSwitchChange=e=>{this.snappingOptions.featureEnabled=e},this._gridEnabledSwitchChange=e=>{this.snappingOptions.gridEnabled=e,e&&this._startLoadGrid()},this._selfEnabledSwitchChange=e=>{this.snappingOptions.selfEnabled=e},this._onToggleLayersButtonClick=e=>{this.viewModel.toggleSnappingForAllLayers(!this.viewModel.allLayersEnabled),h(e.target)};const{snappingOptions:i,view:s,viewModel:l}=e;this.viewModel=l??(this._defaultViewModel=new u({snappingOptions:i,view:s}))}normalizeCtorArgs(e){const{snappingOptions:t,view:i,viewModel:s,...l}=e;return l}destroy(){this.viewModel!==this._defaultViewModel&&(this._defaultViewModel=s(this._defaultViewModel))}loadDependencies(){return Promise.all([d({block:()=>import("@esri/calcite-components/dist/components/calcite-block"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),input:()=>import("@esri/calcite-components/dist/components/calcite-input"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),checkbox:()=>import("@esri/calcite-components/dist/components/calcite-checkbox"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader")}),c()])}initialize(){this.addHandles(l((()=>"2d"===this.view?.type&&!!this.view.grid),(e=>{this.visibleElements.gridControls&&(this.snappingOptions.gridEnabled=e)})))}get _openAndReady(){return this.gridOptionsOpen&&this.snappingOptions.gridEnabled&&this.snappingOptions.enabled}get icon(){return"snap-to-point"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get snappingOptions(){return this.viewModel.snappingOptions}set snappingOptions(e){this.viewModel.snappingOptions=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}set viewModel(e){e!==this._get("viewModel")&&(null!=this._defaultViewModel&&this._defaultViewModel===e||(this._defaultViewModel=s(this._defaultViewModel)),this._set("viewModel",e))}render(){const{label:e}=this;return m("div",{"aria-label":e,class:this.classes(w.base,p.widget)},m("div",{class:w.container},this._renderContent()))}_renderContent(){return[this._renderToggles(),this._renderLayerList(),"2d"===this.view?.type&&this.visibleElements.gridControls?this._renderGridOptions():null]}_renderToggles(){const{visibleElements:e,view:i}=this,s=[e.selfEnabledToggle?this._renderSelfEnabledToggle():null,e.featureEnabledToggle?this._renderFeatureEnabledToggle():null,e.gridEnabledToggle&&"2d"===i?.type?this._renderGridEnabledToggle():null].filter(t),l=[e.enabledToggle?this._renderEnabledToggle():null,s.length>0?m("div",{class:w.nestedContainer},s):null].filter(t);return 0===l.length?null:m("calcite-block",{class:w.toggleBlock,expanded:!0,heading:e.header?this.label:"",key:"toggle-block",label:this.label},l)}_renderEnabledToggle(){return m(g,{checked:this.viewModel.snappingOptions.enabled,disabled:this._enabledToggleDisabled,key:`${this.id}__enabled-toggle`,label:this.messages.enableSnapping,onChange:this._enableSnappingSwitchChange})}_renderSelfEnabledToggle(){return m(g,{checked:this.viewModel.snappingOptions.selfEnabled,disabled:this._secondaryElementsDisabled,key:`${this.id}__self-enabled-toggle`,label:this.messages.geometryGuides,onChange:this._selfEnabledSwitchChange})}_renderFeatureEnabledToggle(){return m(g,{checked:this.viewModel.snappingOptions.featureEnabled,disabled:this._secondaryElementsDisabled,key:`${this.id}__feature-enabled-toggle`,label:this.messages.featureToFeature,onChange:this._featureEnabledSwitchChange})}_renderGridEnabledToggle(){return m(g,{checked:this.viewModel.snappingOptions.gridEnabled,disabled:this._secondaryElementsDisabled,key:`${this.id}__grid-enabled-toggle`,label:this.messages.grid,onChange:this._gridEnabledSwitchChange})}_renderLayerList(){if(!this.visibleElements.layerList)return null;const{messages:e,viewModel:t}=this,i=t.layerListViewModel.operationalItems.length>9?m("calcite-input",{class:w.layerListFilter,clearable:!0,placeholder:e?.searchLayers,onCalciteInputInput:({currentTarget:{value:e}})=>{this._layerListFilter=""===e?null:new RegExp(e,"i")}}):null,s=this._secondaryElementsDisabled,l=this.layerListOpen&&!s,n=t.layerListViewModel.operationalItems?.find((e=>!!e.children.length));return m("calcite-block",{class:w.layerListBlock,collapsible:!0,disabled:this._secondaryElementsDisabled,expanded:l,heading:e.snappingLayers,key:"list-block",onCalciteBlockToggle:e=>this.layerListOpen=e.currentTarget.expanded},i,this._renderToggleLayersButton(),m("calcite-list",{class:w.layerList,displayMode:n?"nested":"flat",label:e?.snappingLayers,selectionMode:"none"},this._renderLayerListItemCollection(t.layerListViewModel.operationalItems)))}_renderGridOptions(){const{view:e,visibleElements:t,snappingManager:i,snappingOptions:s,_openAndReady:l}=this,{gridEnabled:n,enabled:o}=s;(l||"2d"===e?.type&&e.grid)&&this._startLoadGrid();const a=this._gridLoadTask?.value,r=a&&"2d"===e?.type&&m(a,{snappingManager:i,snappingOptions:s,view:e,visibleElements:t.gridControlsElements});return m("calcite-block",{class:w.layerListBlock,collapsible:!0,disabled:!n||!o,expanded:l,heading:this.messages.gridOptionsHeading,key:"grid-block",onCalciteBlockClose:()=>this.gridOptionsOpen=!1,onCalciteBlockOpen:()=>this.gridOptionsOpen=!0},r??m("calcite-loader",{label:this.messagesCommon.loading,scale:"s",text:this.messagesCommon.loading}))}async _startLoadGrid(){!this._gridLoadTask&&this.visibleElements.gridControls&&"2d"===this.view?.type&&(this._gridLoadTask=i((async()=>(await import("./GridControls.js")).default)))}_renderLayerListItemCollection(e){const i=this._layerListFilter;return e.map((e=>{switch(i?y(e,i):null){case"children":{const t=e.children.filter((e=>!1!==y(e,i)));return this._renderLayerListItemGroup(e,t)}case"self":case null:return this._renderLayerListItemOrGroup(e);case!1:return"self"===y(e.parent,i)?this._renderLayerListItemOrGroup(e):null}})).toArray().filter(t)}_renderToggleLayersButton(){if(!this.visibleElements.layerListToggleLayersButton)return null;const{viewModel:{allLayersEnabled:e},messages:t}=this,i=e?t.disableAllLayers:t.enableAllLayers;return m("calcite-button",{appearance:"transparent",class:w.layerListButton,label:i,name:"layer-toggle",onclick:this._onToggleLayersButtonClick},i)}_renderLayerListItemOrGroup(e){if(e.children.length)return this._renderLayerListItemGroup(e);const{messages:{untitledLayer:t}}=this,i=e.title||t,s=()=>{this.viewModel.toggleSnappingForLayers([e.layer?.id],"enabled"!==e.enabled)};return m("calcite-list-item",{class:w.layerListItem,key:`${this.id}-list-item-${e.uid}`,label:i,onCalciteListItemSelect:e=>{e.stopPropagation(),s()}},m("calcite-checkbox",{checked:"enabled"===e.enabled,slot:"actions-start",onCalciteCheckboxChange:s}))}_renderLayerListItemGroup(e,t){const{messages:i}=this,{children:s,title:l}=e,o=l||i.untitledLayer,a=l&&""!==l?l:n(),r=!!t?.length,d=t??s,p=()=>{this.viewModel.toggleSnappingForLayers(e.childLayerIds,"enabled"!==e.enabled)},c=d?.find((e=>!!e.children.length));return m("calcite-list-item",{class:w.layerListGroup,expanded:r,key:a,label:o,onCalciteListItemSelect:e=>{e.stopPropagation(),p()}},m("calcite-checkbox",{checked:"enabled"===e.enabled,indeterminate:"indeterminate"===e.enabled,slot:"actions-start",onCalciteCheckboxChange:p}),m("calcite-list",{displayMode:c?"nested":"flat",label:i?.snappingLayers,selectionMode:"none"},this._renderLayerListItemCollection(d)))}get _enabledToggleDisabled(){const e=this.snappingOptions;return e.enabledToggled||e.forceDisabled}get _secondaryElementsDisabled(){return this._enabledToggleDisabled||!this.snappingOptions.enabled}};e([o()],v.prototype,"_defaultViewModel",void 0),e([o()],v.prototype,"_layerListFilter",void 0),e([o()],v.prototype,"_gridLoadTask",void 0),e([o()],v.prototype,"_openAndReady",null),e([o()],v.prototype,"label",null),e([o({type:Boolean,nonNullable:!0})],v.prototype,"layerListOpen",void 0),e([o({type:Boolean,nonNullable:!0})],v.prototype,"gridOptionsOpen",void 0),e([o(),b("esri/widgets/support/SnappingControls/t9n/SnappingControls")],v.prototype,"messages",void 0),e([o(),b("esri/t9n/common")],v.prototype,"messagesCommon",void 0),e([o()],v.prototype,"snappingOptions",null),e([o()],v.prototype,"snappingManager",void 0),e([o()],v.prototype,"view",null),e([o()],v.prototype,"viewModel",null),e([o({type:_,nonNullable:!0})],v.prototype,"visibleElements",void 0),e([o()],v.prototype,"_enabledToggleDisabled",null),e([o()],v.prototype,"_secondaryElementsDisabled",null),v=e([a("esri.widgets.support.SnappingControls")],v);const f=v;export{f as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../../chunks/tslib.es6.js";import e from"../../../Graphic.js";import o from"../../../core/Accessor.js";import s from"../../../core/Clonable.js";import r from"../../../core/Collection.js";import a from"../../../core/Identifiable.js";import{ignoreAbortErrors as i,debounce as n}from"../../../core/promiseUtils.js";import c from"../../../core/ReactiveMap.js";import{watch as l,initial as u}from"../../../core/reactiveUtils.js";import{sqlIn as y}from"../../../core/sql.js";import{property as d}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as h}from"../../../core/accessorSupport/decorators/subclass.js";import{queryAllJSON as p}from"../../../layers/support/featureQueryAll.js";import{isSubtypeSublayer as m,isSubtypeGroupLayer as g}from"../../../layers/support/layerUtils.js";import{N as b}from"../../../chunks/NetworkElement.js";import w from"../../../rest/support/FeatureSet.js";import _ from"../../../rest/support/Query.js";import{featureUtilityNetworkFields as A}from"../../Feature/FeatureUtilityNetworkAssociations/resources.js";import{findUtilityNetwork as f}from"../../Feature/support/featureUtils.js";const C=100;let F=class extends(s.ClonableMixin(a.IdentifiableMixin(o))){constructor(t){super(t),this._loaded=!1,this._queryAbortController=null,this._queryPageAbortController=null,this._queryFeatureCountAbortController=null,this.networkSourceIdsInUse=new Set,this.source="popup",this.description=null,this.graphic=null,this.layer=null,this.map=null,this.featureCount=0,this.associationTypes=null,this.showAllEnabled=!1,this.title=null,this.attachmentsFeatureCount=0,this.structureFeatureCount=0,this.contentFeatureCount=0,this.containerFeatureCount=0,this.connectivityFeatureCount=0,this._queryOpenAssociationType=async()=>{this.activeAssociationType&&await this._queryDebounced(this.activeAssociationType)},this._cancelQuery=()=>{const{_queryAbortController:t}=this;t&&t.abort(),this._queryAbortController=null},this._cancelQueryFeatureCount=()=>{const{_queryFeatureCountAbortController:t}=this;t&&t.abort(),this._queryFeatureCountAbortController=null},this._queryController=async t=>{this._cancelQuery();const e=new AbortController;this._queryAbortController=e,await i(this._query(t)),this._queryAbortController===e&&(this._queryAbortController=null)},this._queryFeatureCountController=async()=>{this._loaded=!1,this._cancelQueryFeatureCount();const t=new AbortController;this._queryFeatureCountAbortController=t,await i(this._queryFeatureCount()),this._queryFeatureCountAbortController===t&&(this._queryFeatureCountAbortController=null),this._loaded=!0},this._queryDebounced=n(this._queryController,C),this._queryFeatureCountDebounced=n(this._queryFeatureCountController,C)}initialize(){this.addHandles([l((()=>[this.graphic,this.layer,this.map,this.associationTypes,this.objectId,this.globalId,this.canQuery]),(()=>this.refresh()),u),l((()=>this.activeAssociationType),(t=>this._queryDebounced(t)),u)])}destroy(){this._cancelQuery(),this._cancelQueryFeatureCount(),this._destroyAssociatedFeatureViewModels()}get supportsCacheHint(){return!!this.layer?.capabilities?.query?.supportsCacheHint}get canLoad(){return!!this.map&&!!this.associationTypes&&"string"==typeof this.globalId}get canQuery(){const t=this.layer?.capabilities?.query;return!!this.associationTypes&&"string"==typeof this.globalId&&!!t?.supportsPagination}set displayCount(t){const e=0,o=3;this._set("displayCount",Math.max(t??o,e))}get displayCount(){return this._get("displayCount")}get objectId(){return(this.objectIdField&&this.graphic?.attributes?.[this.objectIdField])??null}get objectIdField(){return this.layer?.objectIdField||null}get globalId(){return(this.globalIdField&&this.graphic?.attributes?.[this.globalIdField])??null}get globalIdField(){const{layer:t}=this;return t?.globalIdField}get activeAssociationType(){return this._get("activeAssociationType")}set activeAssociationType(t){t&&!this.associationTypes.includes(t)||this._set("activeAssociationType",t)}get state(){const{_queryAbortController:t,_queryFeatureCountAbortController:e,_queryPageAbortController:o,canQuery:s,_loaded:r,canLoad:a,source:i}=this;return e||a&&!r?"loading":t||o?"querying":!s||"popup"===i&&0===this.featureCount?"disabled":"ready"}get utilityNetwork(){const{layer:t,map:e}=this;if(!t?.loaded||!e)return null;const o=m(t)?t.parent:t;return f(e,o)}get attachmentsAssociations(){return this._get("attachmentsAssociations")||new r}get structureAssociations(){return this._get("structureAssociations")||new r}get contentAssociations(){return this._get("contentAssociations")||new r}get containerAssociations(){return this._get("containerAssociations")||new r}get connectivityAssociations(){return this._get("connectivityAssociations")||new r}get associationFeatures(){return this._get("associationFeatures")||new c}get associationViewModels(){return this._get("associationViewModels")||new Map}async refresh(){await this._queryFeatureCountDebounced(),await this._queryOpenAssociationType()}getFeatureCountForAssociationType(t){switch(t){case"attachment":return this.attachmentsFeatureCount;case"structure":return this.structureFeatureCount;case"content":return this.contentFeatureCount;case"container":return this.containerFeatureCount;case"connectivity":return this.connectivityFeatureCount}}_destroyAssociatedFeatureViewModels(){this.associationViewModels.forEach((t=>t.destroyAll()))}async _loadUtiltyNetworks(){const t=this.map;if(!t)return;await Promise.allSettled(t.utilityNetworks?.map((async t=>{await t.load()}))??[]);const e=this.utilityNetwork;if(e){const o=t=>{if("layerId"in t&&e.isUtilityLayer(t)){const o=e.getSourceIdByLayerId(t.layerId);null!==o&&this.networkSourceIdsInUse.add(o)}};this._set("networkSourceIdsInUse",new Set),t.allLayers.forEach(o),t.allTables.forEach(o)}}async _findLayersBySourceId(t){const{utilityNetwork:e,map:o}=this,s=t=>{const o=t;if(!t.url)return!1;if(o.layerId===r){return t.url.replace(/\/\d+$/,"")===e?.featureServiceUrl}return!1};await(e?.load());const r=e.getLayerIdBySourceId(t),a=o.allLayers.filter(s),i=o.allTables.filter(s),n=a.concat(i).toArray();return await Promise.allSettled(n.map((t=>t.load()))),n}_clearAssociations(){this.attachmentsAssociations.removeAll(),this.structureAssociations.removeAll(),this.contentAssociations.removeAll(),this.containerAssociations.removeAll(),this.connectivityAssociations.removeAll()}_clearFeatures(){this.associationFeatures.forEach((t=>t.removeAll())),this.associationFeatures.clear()}_getAssociationsByType(t){switch(t){case"attachment":return this.attachmentsAssociations;case"structure":return this.structureAssociations;case"connectivity":return this.connectivityAssociations;case"container":return this.containerAssociations;case"content":return this.contentAssociations}}async _queryLayer(t,e,o,s,r){const a=this._getFeatureQueryWhereClause(t,e,o,s),i=new _({where:a,outFields:["*"],cacheHint:this.supportsCacheHint}),n=w.fromJSON(await p(t,i,r));return n.features.forEach((e=>{e.layer=e.sourceLayer=g(t)?t.findSublayerForFeature(e):t})),n.features}async _createAssociationFeatureObjects(t,e,o,s,r,a){if(0===t.length)return[];const i=new Map;for(const[c,l]of e){const t=await this._findLayersBySourceId(c);for(const e of t){(await this._queryLayer(e,l,s,r,a)).forEach((t=>{if("popup"===this.source?t.layer&&t.getEffectivePopupTemplate():!!t.layer){const o=i.get(t.attributes[e.globalIdField])??[];o.push(t),i.set(t.attributes[e.globalIdField],o)}}))}}const n=[];return await Promise.all(t.toArray().map((async t=>{const{fromNetworkElement:e,toNetworkElement:s}=t,r=e.globalId===o?s:e,a=i.get(r.globalId)??[];await Promise.all(a.map((async e=>{const o=this.utilityNetwork?.getTerminalById(r?.terminalId)?.name;if(e.layer&&"getFeatureTitle"in e.layer){const s=await e.layer.getFeatureTitle(e);n.push({title:s,association:t,feature:e,terminalName:o})}else n.push({association:t,feature:e,terminalName:o})})))}))),n}_parseFeatureObjects(t,e){t.forEach((t=>{const o=t?.feature,s=o.layer,a=e.get(s)??new r;a.add(t),e.set(s,a)}))}async _queryAssociations(t){const{layer:e,globalId:o,associationTypes:s,utilityNetwork:r,canQuery:a}=this;if(await Promise.allSettled([e?.load(),r?.load()]),this._clearAssociations(),!(a&&e&&s&&r&&o))return;const i=m(e)?e.parent:e,n=new b({globalId:o,networkSourceId:r.getSourceIdByLayerId(i.layerId)}),c=new Set;s.forEach((t=>{switch(t.type){case"attachment":case"structure":c.add("attachment");break;case"container":case"content":c.add("containment");break;case"connectivity":c.add("connectivity"),c.add("junction-junction-connectivity"),c.add("junction-edge-from-connectivity"),c.add("junction-edge-midspan-connectivity"),c.add("junction-edge-to-connectivity")}}));const l=await(r?.queryAssociations({elements:[n],types:Array.from(c)},{signal:t?.signal})),u=new Map,y=new Map;s.forEach((t=>{y.set(t.type,t),u.set(t.type,[])})),l.forEach((t=>{const{toNetworkElement:e,fromNetworkElement:s}=t;switch(t.associationType){case"connectivity":case"junction-junction-connectivity":case"junction-edge-from-connectivity":case"junction-edge-midspan-connectivity":case"junction-edge-to-connectivity":if(s?.globalId===o){if(this._shouldDiscardNetworkElement(e,"connectivity",y))break;u.get("connectivity")?.push(e.globalId)}else{if(this._shouldDiscardNetworkElement(s,"connectivity",y))break;u.get("connectivity")?.push(s.globalId)}this.connectivityAssociations.add(t);break;case"containment":if(s?.globalId===o){if(this._shouldDiscardNetworkElement(e,"content",y))break;u.get("content")?.push(e.globalId),this.contentAssociations.add(t)}else{if(this._shouldDiscardNetworkElement(s,"container",y))break;u.get("container")?.push(s.globalId),this.containerAssociations.add(t)}break;case"attachment":if(s?.globalId===o){if(this._shouldDiscardNetworkElement(e,"attachment",y))break;u.get("attachment")?.push(e.globalId),this.attachmentsAssociations.add(t)}else{if(this._shouldDiscardNetworkElement(s,"structure",y))break;u.get("structure")?.push(s.globalId),this.structureAssociations.add(t)}}}));const d=s.map((async e=>{const{associatedNetworkSourceId:o,associatedAssetGroup:s,associatedAssetType:r}=e,a=u.get(e.type),i=null!=s?await this._countAssociatedFeatures(o,a,s,r,t):a.length;switch(e.type){case"attachment":this._set("attachmentsFeatureCount",i);break;case"structure":this._set("structureFeatureCount",i);break;case"content":this._set("contentFeatureCount",i);break;case"container":this._set("containerFeatureCount",i);break;case"connectivity":this._set("connectivityFeatureCount",i)}}));await Promise.allSettled(d)}async _countAssociatedFeatureCount(t,e,o,s,r){const a=this._getFeatureQueryWhereClause(t,e,o,s);return t.queryFeatureCount({where:a,outFields:["*"],returnGeometry:!1},{signal:r?.signal})}async _countAssociatedFeatures(t,e,o,s,r){if(0===e.length)return 0;const a=(await this._findLayersBySourceId(t)).map((async t=>this._countAssociatedFeatureCount(t,e,o,s,r)));return(await Promise.all(a)).reduce(((t,e)=>t+e),0)}async _queryAssociatedFeatures(t,e){const{layer:o,globalId:s,associationTypes:r,utilityNetwork:a,canQuery:i,associationFeatures:n}=this;if(await Promise.allSettled([o?.load(),a?.load()]),!(i&&o&&r&&a))return;const c=this._getAssociationsByType(t.type),{associatedAssetGroup:l,associatedAssetType:u}=t,y=new Map;c.forEach((t=>{const{fromNetworkElement:e,toNetworkElement:o}=t,{networkSourceId:r,elementGlobalId:a}=e.globalId===s?{networkSourceId:o.networkSourceId,elementGlobalId:o.globalId}:{networkSourceId:e.networkSourceId,elementGlobalId:e.globalId},i=y.get(r)||[];i.push(a),y.set(r,i)}));const d=await this._createAssociationFeatureObjects(c,y,s,l,u,e);this._parseFeatureObjects(d,n)}async _queryFeatureCount(){await this._loadUtiltyNetworks();const{_queryFeatureCountAbortController:t,canQuery:e}=this;e?(await this._queryAssociations(t),this._set("featureCount",this.attachmentsFeatureCount+this.structureFeatureCount+this.contentFeatureCount+this.containerFeatureCount+this.connectivityFeatureCount)):this._set("featureCount",0)}async _query(t){if(!t)return;await this._loadUtiltyNetworks();const{_queryAbortController:e}=this;this._destroyAssociatedFeatureViewModels(),this._clearFeatures(),0!==this.featureCount&&(this.destroyed||await this._queryAssociatedFeatures(t,{signal:e?.signal}))}_shouldDiscardNetworkElement(t,e,o){if(!t)return!1;const{networkSourceIdsInUse:s}=this,{networkSourceId:r}=t,a=o.get(e)?.associatedNetworkSourceId,i=s.has(r);return null!=a&&a!==r||!i}_getFeatureQueryWhereClause(t,e,o,s){const r=t.globalIdField,a=t.fieldsIndex.get(A.assetGroup),i=t.fieldsIndex.get(A.assetType),n=null!=o,c=null!=s;return[r?y(r,e):null,n?`(${a?.name} = ${o})`:null,n&&c?`(${i?.name} = ${s})`:null].filter(Boolean).join(" AND ")}};t([d()],F.prototype,"_loaded",void 0),t([d()],F.prototype,"_queryAbortController",void 0),t([d()],F.prototype,"_queryPageAbortController",void 0),t([d()],F.prototype,"_queryFeatureCountAbortController",void 0),t([d({readOnly:!0})],F.prototype,"supportsCacheHint",null),t([d({readOnly:!0})],F.prototype,"canLoad",null),t([d({readOnly:!0})],F.prototype,"canQuery",null),t([d()],F.prototype,"networkSourceIdsInUse",void 0),t([d({constructOnly:!0})],F.prototype,"source",void 0),t([d()],F.prototype,"description",void 0),t([d({value:3})],F.prototype,"displayCount",null),t([d({type:e})],F.prototype,"graphic",void 0),t([d()],F.prototype,"layer",void 0),t([d()],F.prototype,"map",void 0),t([d({readOnly:!0})],F.prototype,"objectId",null),t([d({readOnly:!0})],F.prototype,"objectIdField",null),t([d({readOnly:!0})],F.prototype,"globalId",null),t([d({readOnly:!0})],F.prototype,"globalIdField",null),t([d()],F.prototype,"featureCount",void 0),t([d()],F.prototype,"associationTypes",void 0),t([d()],F.prototype,"activeAssociationType",null),t([d()],F.prototype,"showAllEnabled",void 0),t([d()],F.prototype,"state",null),t([d()],F.prototype,"title",void 0),t([d({readOnly:!0})],F.prototype,"utilityNetwork",null),t([d({readOnly:!0})],F.prototype,"attachmentsFeatureCount",void 0),t([d({readOnly:!0})],F.prototype,"structureFeatureCount",void 0),t([d({readOnly:!0})],F.prototype,"attachmentsAssociations",null),t([d({readOnly:!0})],F.prototype,"structureAssociations",null),t([d({readOnly:!0})],F.prototype,"contentFeatureCount",void 0),t([d({readOnly:!0})],F.prototype,"containerFeatureCount",void 0),t([d({readOnly:!0})],F.prototype,"contentAssociations",null),t([d({readOnly:!0})],F.prototype,"containerAssociations",null),t([d({readOnly:!0})],F.prototype,"connectivityFeatureCount",void 0),t([d({readOnly:!0})],F.prototype,"connectivityAssociations",null),t([d({readOnly:!0})],F.prototype,"associationFeatures",null),t([d({readOnly:!0})],F.prototype,"associationViewModels",null),F=t([h("esri.widgets.support.UtilityNetworkAssociations.FeatureUtilityNetworkAssociationsViewModel")],F);export{F as default};
5
+ import{_ as t}from"../../../chunks/tslib.es6.js";import e from"../../../Graphic.js";import o from"../../../core/Accessor.js";import s from"../../../core/Clonable.js";import r from"../../../core/Collection.js";import a from"../../../core/Identifiable.js";import{ignoreAbortErrors as i,debounce as n}from"../../../core/promiseUtils.js";import c from"../../../core/ReactiveMap.js";import{watch as l,initial as u}from"../../../core/reactiveUtils.js";import{sqlIn as y}from"../../../core/sql.js";import{property as d}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as h}from"../../../core/accessorSupport/decorators/subclass.js";import{queryAllJSON as p}from"../../../layers/support/featureQueryAll.js";import{isSubtypeSublayer as m,isSubtypeGroupLayer as g}from"../../../layers/support/layerUtils.js";import b from"../../../rest/networks/support/NetworkElement.js";import w from"../../../rest/support/FeatureSet.js";import _ from"../../../rest/support/Query.js";import{featureUtilityNetworkFields as A}from"../../Feature/FeatureUtilityNetworkAssociations/resources.js";import{findUtilityNetwork as f}from"../../Feature/support/featureUtils.js";const C=100;let F=class extends(s.ClonableMixin(a.IdentifiableMixin(o))){constructor(t){super(t),this._loaded=!1,this._queryAbortController=null,this._queryPageAbortController=null,this._queryFeatureCountAbortController=null,this.networkSourceIdsInUse=new Set,this.source="popup",this.description=null,this.graphic=null,this.layer=null,this.map=null,this.featureCount=0,this.associationTypes=null,this.showAllEnabled=!1,this.title=null,this.attachmentsFeatureCount=0,this.structureFeatureCount=0,this.contentFeatureCount=0,this.containerFeatureCount=0,this.connectivityFeatureCount=0,this._queryOpenAssociationType=async()=>{this.activeAssociationType&&await this._queryDebounced(this.activeAssociationType)},this._cancelQuery=()=>{const{_queryAbortController:t}=this;t&&t.abort(),this._queryAbortController=null},this._cancelQueryFeatureCount=()=>{const{_queryFeatureCountAbortController:t}=this;t&&t.abort(),this._queryFeatureCountAbortController=null},this._queryController=async t=>{this._cancelQuery();const e=new AbortController;this._queryAbortController=e,await i(this._query(t)),this._queryAbortController===e&&(this._queryAbortController=null)},this._queryFeatureCountController=async()=>{this._loaded=!1,this._cancelQueryFeatureCount();const t=new AbortController;this._queryFeatureCountAbortController=t,await i(this._queryFeatureCount()),this._queryFeatureCountAbortController===t&&(this._queryFeatureCountAbortController=null),this._loaded=!0},this._queryDebounced=n(this._queryController,C),this._queryFeatureCountDebounced=n(this._queryFeatureCountController,C)}initialize(){this.addHandles([l((()=>[this.graphic,this.layer,this.map,this.associationTypes,this.objectId,this.globalId,this.canQuery]),(()=>this.refresh()),u),l((()=>this.activeAssociationType),(t=>this._queryDebounced(t)),u)])}destroy(){this._cancelQuery(),this._cancelQueryFeatureCount(),this._destroyAssociatedFeatureViewModels()}get supportsCacheHint(){return!!this.layer?.capabilities?.query?.supportsCacheHint}get canLoad(){return!!this.map&&!!this.associationTypes&&"string"==typeof this.globalId}get canQuery(){const t=this.layer?.capabilities?.query;return!!this.associationTypes&&"string"==typeof this.globalId&&!!t?.supportsPagination}set displayCount(t){const e=0,o=3;this._set("displayCount",Math.max(t??o,e))}get displayCount(){return this._get("displayCount")}get objectId(){return(this.objectIdField&&this.graphic?.attributes?.[this.objectIdField])??null}get objectIdField(){return this.layer?.objectIdField||null}get globalId(){return(this.globalIdField&&this.graphic?.attributes?.[this.globalIdField])??null}get globalIdField(){const{layer:t}=this;return t?.globalIdField}get activeAssociationType(){return this._get("activeAssociationType")}set activeAssociationType(t){t&&!this.associationTypes.includes(t)||this._set("activeAssociationType",t)}get state(){const{_queryAbortController:t,_queryFeatureCountAbortController:e,_queryPageAbortController:o,canQuery:s,_loaded:r,canLoad:a,source:i}=this;return e||a&&!r?"loading":t||o?"querying":!s||"popup"===i&&0===this.featureCount?"disabled":"ready"}get utilityNetwork(){const{layer:t,map:e}=this;if(!t?.loaded||!e)return null;const o=m(t)?t.parent:t;return f(e,o)}get attachmentsAssociations(){return this._get("attachmentsAssociations")||new r}get structureAssociations(){return this._get("structureAssociations")||new r}get contentAssociations(){return this._get("contentAssociations")||new r}get containerAssociations(){return this._get("containerAssociations")||new r}get connectivityAssociations(){return this._get("connectivityAssociations")||new r}get associationFeatures(){return this._get("associationFeatures")||new c}get associationViewModels(){return this._get("associationViewModels")||new Map}async refresh(){await this._queryFeatureCountDebounced(),await this._queryOpenAssociationType()}getFeatureCountForAssociationType(t){switch(t){case"attachment":return this.attachmentsFeatureCount;case"structure":return this.structureFeatureCount;case"content":return this.contentFeatureCount;case"container":return this.containerFeatureCount;case"connectivity":return this.connectivityFeatureCount}}_destroyAssociatedFeatureViewModels(){this.associationViewModels.forEach((t=>t.destroyAll()))}async _loadUtiltyNetworks(){const t=this.map;if(!t)return;await Promise.allSettled(t.utilityNetworks?.map((async t=>{await t.load()}))??[]);const e=this.utilityNetwork;if(e){const o=t=>{if("layerId"in t&&e.isUtilityLayer(t)){const o=e.getSourceIdByLayerId(t.layerId);null!==o&&this.networkSourceIdsInUse.add(o)}};this._set("networkSourceIdsInUse",new Set),t.allLayers.forEach(o),t.allTables.forEach(o)}}async _findLayersBySourceId(t){const{utilityNetwork:e,map:o}=this,s=t=>{const o=t;if(!t.url)return!1;if(o.layerId===r){return t.url.replace(/\/\d+$/,"")===e?.featureServiceUrl}return!1};await(e?.load());const r=e.getLayerIdBySourceId(t),a=o.allLayers.filter(s),i=o.allTables.filter(s),n=a.concat(i).toArray();return await Promise.allSettled(n.map((t=>t.load()))),n}_clearAssociations(){this.attachmentsAssociations.removeAll(),this.structureAssociations.removeAll(),this.contentAssociations.removeAll(),this.containerAssociations.removeAll(),this.connectivityAssociations.removeAll()}_clearFeatures(){this.associationFeatures.forEach((t=>t.removeAll())),this.associationFeatures.clear()}_getAssociationsByType(t){switch(t){case"attachment":return this.attachmentsAssociations;case"structure":return this.structureAssociations;case"connectivity":return this.connectivityAssociations;case"container":return this.containerAssociations;case"content":return this.contentAssociations}}async _queryLayer(t,e,o,s,r){const a=this._getFeatureQueryWhereClause(t,e,o,s),i=new _({where:a,outFields:["*"],cacheHint:this.supportsCacheHint}),n=w.fromJSON(await p(t,i,r));return n.features.forEach((e=>{e.layer=e.sourceLayer=g(t)?t.findSublayerForFeature(e):t})),n.features}async _createAssociationFeatureObjects(t,e,o,s,r,a){if(0===t.length)return[];const i=new Map;for(const[c,l]of e){const t=await this._findLayersBySourceId(c);for(const e of t){(await this._queryLayer(e,l,s,r,a)).forEach((t=>{if("popup"===this.source?t.layer&&t.getEffectivePopupTemplate():!!t.layer){const o=i.get(t.attributes[e.globalIdField])??[];o.push(t),i.set(t.attributes[e.globalIdField],o)}}))}}const n=[];return await Promise.all(t.toArray().map((async t=>{const{fromNetworkElement:e,toNetworkElement:s}=t,r=e.globalId===o?s:e,a=i.get(r.globalId)??[];await Promise.all(a.map((async e=>{const o=this.utilityNetwork?.getTerminalById(r?.terminalId)?.name;if(e.layer&&"getFeatureTitle"in e.layer){const s=await e.layer.getFeatureTitle(e);n.push({title:s,association:t,feature:e,terminalName:o})}else n.push({association:t,feature:e,terminalName:o})})))}))),n}_parseFeatureObjects(t,e){t.forEach((t=>{const o=t?.feature,s=o.layer,a=e.get(s)??new r;a.add(t),e.set(s,a)}))}async _queryAssociations(t){const{layer:e,globalId:o,associationTypes:s,utilityNetwork:r,canQuery:a}=this;if(await Promise.allSettled([e?.load(),r?.load()]),this._clearAssociations(),!(a&&e&&s&&r&&o))return;const i=m(e)?e.parent:e,n=new b({globalId:o,networkSourceId:r.getSourceIdByLayerId(i.layerId)}),c=new Set;s.forEach((t=>{switch(t.type){case"attachment":case"structure":c.add("attachment");break;case"container":case"content":c.add("containment");break;case"connectivity":c.add("connectivity"),c.add("junction-junction-connectivity"),c.add("junction-edge-from-connectivity"),c.add("junction-edge-midspan-connectivity"),c.add("junction-edge-to-connectivity")}}));const l=await(r?.queryAssociations({elements:[n],types:Array.from(c)},{signal:t?.signal})),u=new Map,y=new Map;s.forEach((t=>{y.set(t.type,t),u.set(t.type,[])})),l.forEach((t=>{const{toNetworkElement:e,fromNetworkElement:s}=t;switch(t.associationType){case"connectivity":case"junction-junction-connectivity":case"junction-edge-from-connectivity":case"junction-edge-midspan-connectivity":case"junction-edge-to-connectivity":if(s?.globalId===o){if(this._shouldDiscardNetworkElement(e,"connectivity",y))break;u.get("connectivity")?.push(e.globalId)}else{if(this._shouldDiscardNetworkElement(s,"connectivity",y))break;u.get("connectivity")?.push(s.globalId)}this.connectivityAssociations.add(t);break;case"containment":if(s?.globalId===o){if(this._shouldDiscardNetworkElement(e,"content",y))break;u.get("content")?.push(e.globalId),this.contentAssociations.add(t)}else{if(this._shouldDiscardNetworkElement(s,"container",y))break;u.get("container")?.push(s.globalId),this.containerAssociations.add(t)}break;case"attachment":if(s?.globalId===o){if(this._shouldDiscardNetworkElement(e,"attachment",y))break;u.get("attachment")?.push(e.globalId),this.attachmentsAssociations.add(t)}else{if(this._shouldDiscardNetworkElement(s,"structure",y))break;u.get("structure")?.push(s.globalId),this.structureAssociations.add(t)}}}));const d=s.map((async e=>{const{associatedNetworkSourceId:o,associatedAssetGroup:s,associatedAssetType:r}=e,a=u.get(e.type),i=null!=s?await this._countAssociatedFeatures(o,a,s,r,t):a.length;switch(e.type){case"attachment":this._set("attachmentsFeatureCount",i);break;case"structure":this._set("structureFeatureCount",i);break;case"content":this._set("contentFeatureCount",i);break;case"container":this._set("containerFeatureCount",i);break;case"connectivity":this._set("connectivityFeatureCount",i)}}));await Promise.allSettled(d)}async _countAssociatedFeatureCount(t,e,o,s,r){const a=this._getFeatureQueryWhereClause(t,e,o,s);return t.queryFeatureCount({where:a,outFields:["*"],returnGeometry:!1},{signal:r?.signal})}async _countAssociatedFeatures(t,e,o,s,r){if(0===e.length)return 0;const a=(await this._findLayersBySourceId(t)).map((async t=>this._countAssociatedFeatureCount(t,e,o,s,r)));return(await Promise.all(a)).reduce(((t,e)=>t+e),0)}async _queryAssociatedFeatures(t,e){const{layer:o,globalId:s,associationTypes:r,utilityNetwork:a,canQuery:i,associationFeatures:n}=this;if(await Promise.allSettled([o?.load(),a?.load()]),!(i&&o&&r&&a))return;const c=this._getAssociationsByType(t.type),{associatedAssetGroup:l,associatedAssetType:u}=t,y=new Map;c.forEach((t=>{const{fromNetworkElement:e,toNetworkElement:o}=t,{networkSourceId:r,elementGlobalId:a}=e.globalId===s?{networkSourceId:o.networkSourceId,elementGlobalId:o.globalId}:{networkSourceId:e.networkSourceId,elementGlobalId:e.globalId},i=y.get(r)||[];i.push(a),y.set(r,i)}));const d=await this._createAssociationFeatureObjects(c,y,s,l,u,e);this._parseFeatureObjects(d,n)}async _queryFeatureCount(){await this._loadUtiltyNetworks();const{_queryFeatureCountAbortController:t,canQuery:e}=this;e?(await this._queryAssociations(t),this._set("featureCount",this.attachmentsFeatureCount+this.structureFeatureCount+this.contentFeatureCount+this.containerFeatureCount+this.connectivityFeatureCount)):this._set("featureCount",0)}async _query(t){if(!t)return;await this._loadUtiltyNetworks();const{_queryAbortController:e}=this;this._destroyAssociatedFeatureViewModels(),this._clearFeatures(),0!==this.featureCount&&(this.destroyed||await this._queryAssociatedFeatures(t,{signal:e?.signal}))}_shouldDiscardNetworkElement(t,e,o){if(!t)return!1;const{networkSourceIdsInUse:s}=this,{networkSourceId:r}=t,a=o.get(e)?.associatedNetworkSourceId,i=s.has(r);return null!=a&&a!==r||!i}_getFeatureQueryWhereClause(t,e,o,s){const r=t.globalIdField,a=t.fieldsIndex.get(A.assetGroup),i=t.fieldsIndex.get(A.assetType),n=null!=o,c=null!=s;return[r?y(r,e):null,n?`(${a?.name} = ${o})`:null,n&&c?`(${i?.name} = ${s})`:null].filter(Boolean).join(" AND ")}};t([d()],F.prototype,"_loaded",void 0),t([d()],F.prototype,"_queryAbortController",void 0),t([d()],F.prototype,"_queryPageAbortController",void 0),t([d()],F.prototype,"_queryFeatureCountAbortController",void 0),t([d({readOnly:!0})],F.prototype,"supportsCacheHint",null),t([d({readOnly:!0})],F.prototype,"canLoad",null),t([d({readOnly:!0})],F.prototype,"canQuery",null),t([d()],F.prototype,"networkSourceIdsInUse",void 0),t([d({constructOnly:!0})],F.prototype,"source",void 0),t([d()],F.prototype,"description",void 0),t([d({value:3})],F.prototype,"displayCount",null),t([d({type:e})],F.prototype,"graphic",void 0),t([d()],F.prototype,"layer",void 0),t([d()],F.prototype,"map",void 0),t([d({readOnly:!0})],F.prototype,"objectId",null),t([d({readOnly:!0})],F.prototype,"objectIdField",null),t([d({readOnly:!0})],F.prototype,"globalId",null),t([d({readOnly:!0})],F.prototype,"globalIdField",null),t([d()],F.prototype,"featureCount",void 0),t([d()],F.prototype,"associationTypes",void 0),t([d()],F.prototype,"activeAssociationType",null),t([d()],F.prototype,"showAllEnabled",void 0),t([d()],F.prototype,"state",null),t([d()],F.prototype,"title",void 0),t([d({readOnly:!0})],F.prototype,"utilityNetwork",null),t([d({readOnly:!0})],F.prototype,"attachmentsFeatureCount",void 0),t([d({readOnly:!0})],F.prototype,"structureFeatureCount",void 0),t([d({readOnly:!0})],F.prototype,"attachmentsAssociations",null),t([d({readOnly:!0})],F.prototype,"structureAssociations",null),t([d({readOnly:!0})],F.prototype,"contentFeatureCount",void 0),t([d({readOnly:!0})],F.prototype,"containerFeatureCount",void 0),t([d({readOnly:!0})],F.prototype,"contentAssociations",null),t([d({readOnly:!0})],F.prototype,"containerAssociations",null),t([d({readOnly:!0})],F.prototype,"connectivityFeatureCount",void 0),t([d({readOnly:!0})],F.prototype,"connectivityAssociations",null),t([d({readOnly:!0})],F.prototype,"associationFeatures",null),t([d({readOnly:!0})],F.prototype,"associationViewModels",null),F=t([h("esri.widgets.support.UtilityNetworkAssociations.FeatureUtilityNetworkAssociationsViewModel")],F);export{F as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{generateBracedUUID as e}from"../../../../core/uuid.js";import{isSubtypeSublayer as t}from"../../../../layers/support/layerUtils.js";import o from"../../../../rest/networks/support/Association.js";import{N as r}from"../../../../chunks/NetworkElement.js";function i(t){return new o({fromNetworkElement:s(t.fromFeature,t.utilityNetwork),toNetworkElement:s(t.toFeature,t.utilityNetwork),associationType:t.associationType,globalId:e()})}function s(e,o){const i=t(e.sourceLayer)?e.sourceLayer.parent:e.sourceLayer;if(i&&"globalIdField"in i&&"layerId"in i&&i.globalIdField){const t=o.getSourceIdByLayerId(i.layerId),s="junction"===o.getSourceTypeById(t)?o.getTerminalConfiguration(e):void 0,a=s?.terminals.at(0)?.id,n=i.fieldsIndex.get("assetGroup").name,l=i.fieldsIndex.get("assetType").name,u=e.attributes[n],d=e.attributes[l],m=e.attributes[i.globalIdField];if(m&&null!=t)return new r({globalId:m,networkSourceId:t,assetGroupCode:u,assetTypeCode:d,terminalId:a})}}export{i as createAssociation};
5
+ import{generateBracedUUID as e}from"../../../../core/uuid.js";import{isSubtypeSublayer as t}from"../../../../layers/support/layerUtils.js";import r from"../../../../rest/networks/support/Association.js";import o from"../../../../rest/networks/support/NetworkElement.js";function i(t){return new r({fromNetworkElement:s(t.fromFeature,t.utilityNetwork),toNetworkElement:s(t.toFeature,t.utilityNetwork),associationType:t.associationType,globalId:e()})}function s(e,r){const i=t(e.sourceLayer)?e.sourceLayer.parent:e.sourceLayer;if(i&&"globalIdField"in i&&"layerId"in i&&i.globalIdField){const t=r.getSourceIdByLayerId(i.layerId),s="junction"===r.getSourceTypeById(t)?r.getTerminalConfiguration(e):void 0,a=s?.terminals.at(0)?.id,n=i.fieldsIndex.get("assetGroup").name,l=i.fieldsIndex.get("assetType").name,u=e.attributes[n],d=e.attributes[l],p=e.attributes[i.globalIdField];if(p&&null!=t)return new o({globalId:p,networkSourceId:t,assetGroupCode:u,assetTypeCode:d,terminalId:a})}}export{i as createAssociation};
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[1100,3186,3890,4342,4812],{4197:(e,t,n)=>{n.d(t,{jh:()=>i,l5:()=>o,xm:()=>s});var r=n(34275);function i(e,t=!1){return e<=r.y9?t?new Array(e).fill(0):new Array(e):new Float64Array(e)}function s(e){return((0,r.iu)(e)?e.byteLength/8:e.length)<=r.y9?Array.from(e):new Float64Array(e)}function o(e,t,n){return Array.isArray(e)?e.slice(t,t+n):e.subarray(t,t+n)}},13069:(e,t,n)=>{n.d(t,{AG:()=>a,lk:()=>i,vD:()=>o,yS:()=>s});const r="randomUUID"in crypto;function i(){if(r)return crypto.randomUUID();const e=crypto.getRandomValues(new Uint16Array(8));e[3]=4095&e[3]|16384,e[4]=16383&e[4]|32768;const t=t=>e[t].toString(16).padStart(4,"0");return t(0)+t(1)+"-"+t(2)+"-"+t(3)+"-"+t(4)+"-"+t(5)+t(6)+t(7)}function s(){return`{${i().toUpperCase()}}`}function o(){return`{${i()}}`}function a(e){const t=e.toUpperCase();return"{"!==e[0]?`{${t}}`:t}},17311:(e,t,n)=>{n.d(t,{A:()=>d});var r=n(90237),i=n(69622),s=n(60999),o=n(5503),a=n(10107),l=(n(44208),n(53966),n(87811),n(40608)),u=n(30524),c=n(43668);let d=class extends i.A{constructor(e){super(e),this._featureUtils=null,this.effectivePopupTemplate=null}get _arcadeTask(){return this.expressionsUsedInTitle.length>0?this._get("_arcadeTask")||(0,s.UT)((()=>(0,c.l)())):null}get featureUtilsPromise(){return this._get("featureUtilsPromise")??n.e(9926).then(n.bind(n,29926)).then((e=>this._featureUtils=e))}get calculatedExpressions(){const e=new o.A;if(!this.expressionsUsedInTitle.length)return e;if(!this._arcadeTask?.value){for(const t of this.expressionsUsedInTitle??[])e.push({name:t.name,invalid:!0});return e}for(const t of this.expressionsUsedInTitle)try{const n=this._arcadeTask.value.arcade.parseScript(t.expression,["$layer","$map","$datastore"]);if(n.isAsync){e.push({name:t.name,invalid:!0});break}e.push({name:t.name,syntax:n,invalid:!1,func:this._arcadeTask.value.arcade.compileScript(n,{vars:{$feature:"any"}})})}catch{e.push({name:t.name,invalid:!0});break}return e}get expressionsUsedInTitle(){let e=this.effectivePopupTemplate?.title??"";return"string"!=typeof e?[]:(e=e.toLowerCase(),this.effectivePopupTemplate?.expressionInfos?.filter((t=>e.includes(`{expression/${t.name.toLowerCase()}}`)))??[])}get fieldInfoMap(){return this._featureUtils?this._createFieldInfoMap(this._featureUtils.getAllFieldInfos(this.effectivePopupTemplate)):null}get hasBadExpressions(){return this.calculatedExpressions.some((e=>!0===e.invalid))}get requiredFields(){const e=new Set;if(this._arcadeTask?.value&&!this.hasBadExpressions)for(const t of this.calculatedExpressions?.toArray()??[])try{const n=this._arcadeTask.value.arcade.extractFieldLiterals(t.syntax);for(const t of n){const n=t.split("."),r=this.fieldsIndex.get(n.at(-1)??"");r&&e.add(r.name)}}catch{}const t=this._extractFieldNames(this.workingTitle);for(const n of t){const t=this.fieldsIndex.get(n);t&&e.add(t.name)}return e}get titleFromDisplayField(){let e="";return this.displayField&&(e=this.fieldsIndex.get(this.displayField)?.name??""),e||(e=this.fieldsIndex.get(this.objectIdField)?.name??""),e?`{${e}}`:""}get workingTitle(){const e=this.effectivePopupTemplate?this.effectivePopupTemplate.title:"";return""===e||null==e||this.hasBadExpressions||"string"!=typeof e?this.titleFromDisplayField:e}async getTitle(e,t,n){try{const{attributes:r}=t,i=n?.timeZone??"system",[{substituteFieldsInLinksAndAttributes:s}]=await Promise.all([this.featureUtilsPromise,this._arcadeTask?.promise]);if(n.fetchMissingFields&&(t=await this._checkAndReQueryGraphic(e,t)),this.workingTitle&&this.fieldInfoMap){const n=this._createFormattedAttributes(e,t,i).global;return s({attributes:r,expressionAttributes:null,fieldInfoMap:this.fieldInfoMap,globalAttributes:n,layer:e,text:this.workingTitle})}return""}catch{}return""}async _checkAndReQueryGraphic(e,t){const n=t.getObjectId();if(null==n)return t;if(!(0,u.Kl)(this.requiredFields,t)){const t=e.createQuery();t.where="1=1",t.outFields=[...this.requiredFields],t.objectIds=[n];const r=await e.queryFeatures(t);if(1===r?.features.length)return r.features[0]}return t}_createFieldInfoMap(e){const t=new Map;if(!e)return t;for(const n of e){if(!n.fieldName)continue;const e=this.fieldsIndex.get(n.fieldName),r=e?.name??n.fieldName;n.fieldName=r,t.set(r.toLowerCase(),n)}return t}_createFormattedAttributes(e,t,n="system"){const r=this.effectivePopupTemplate?.fieldInfos??[],i={};if(!this._featureUtils)return{};if(!this.hasBadExpressions&&this.calculatedExpressions.length>0&&this._arcadeTask?.value){const n=this._arcadeTask.value.Feature.createFromGraphicLikeObject(t.geometry,t.attributes,e,null);for(const e of this.calculatedExpressions)try{i[`expression/${e.name}`]=e.func({vars:{$feature:n}})}catch{}}const s={...t.attributes,...i};return{global:this._featureUtils.formatAttributes({fieldInfos:r,attributes:s,graphic:t,timeZone:n,layer:e,fieldInfoMap:this.fieldInfoMap}),content:[]}}_extractFieldNames(e){return(0,u.nw)(e).filter((e=>!(0===e.indexOf("relationships/")||0===e.indexOf("expression/"))))}};(0,r._)([(0,a.MZ)({readOnly:!0})],d.prototype,"_arcadeTask",null),(0,r._)([(0,a.MZ)()],d.prototype,"_featureUtils",void 0),(0,r._)([(0,a.MZ)({readOnly:!0})],d.prototype,"featureUtilsPromise",null),(0,r._)([(0,a.MZ)({readOnly:!0})],d.prototype,"calculatedExpressions",null),(0,r._)([(0,a.MZ)()],d.prototype,"displayField",void 0),(0,r._)([(0,a.MZ)()],d.prototype,"effectivePopupTemplate",void 0),(0,r._)([(0,a.MZ)()],d.prototype,"expressionsUsedInTitle",null),(0,r._)([(0,a.MZ)()],d.prototype,"fieldsIndex",void 0),(0,r._)([(0,a.MZ)()],d.prototype,"fieldInfoMap",null),(0,r._)([(0,a.MZ)()],d.prototype,"fields",void 0),(0,r._)([(0,a.MZ)()],d.prototype,"objectIdField",void 0),(0,r._)([(0,a.MZ)()],d.prototype,"requiredFields",null),d=(0,r._)([(0,l.$)("esri.layers.support.TitleCreator")],d)},22671:(e,t,n)=>{n.d(t,{A:()=>_});var r,i=n(90237),s=n(52106),o=n(66552),a=n(25482),l=n(4718),u=n(10107),c=(n(44208),n(53966),n(36005)),d=n(40608),p=n(43937),f=n(16930),m=n(65864),h=n(50498),y=n(20437);const g=new o.J({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh","":null});let _=r=class extends a.A{constructor(e){super(e),this.displayFieldName=null,this.exceededTransferLimit=!1,this.features=[],this.fields=null,this.geometryType=null,this.hasM=!1,this.hasZ=!1,this.queryGeometry=null,this.spatialReference=null}readFeatures(e,t){return this.readFeaturesWithClass(e,t,s.A)}writeGeometryType(e,t,n,r){if(e)return void g.write(e,t,n,r);const{features:i}=this;if(i)for(const e of i)if(null!=e?.geometry)return void g.write(e.geometry.type,t,n,r)}readQueryGeometry(e,t){if(!e)return null;const n=!!e.spatialReference,r=(0,m.rS)(e);return r&&!n&&t.spatialReference&&(r.spatialReference=f.A.fromJSON(t.spatialReference)),r}writeSpatialReference(e,t){if(e)return void(t.spatialReference=e.toJSON());const{features:n}=this;if(n)for(const e of n)if(e&&null!=e.geometry&&e.geometry.spatialReference)return void(t.spatialReference=e.geometry.spatialReference.toJSON())}clone(){return new r(this.cloneProperties())}cloneProperties(){return(0,l.o8)({displayFieldName:this.displayFieldName,exceededTransferLimit:this.exceededTransferLimit,features:this.features,fields:this.fields,geometryType:this.geometryType,hasM:this.hasM,hasZ:this.hasZ,queryGeometry:this.queryGeometry,spatialReference:this.spatialReference,transform:this.transform})}toJSON(e){const t=this.write();if(t.features&&Array.isArray(e)&&e.length>0)for(let n=0;n<t.features.length;n++){const r=t.features[n];if(r.geometry){const t=e?.[n];r.geometry=t?.toJSON()||r.geometry}}return t}quantize(e){const{scale:[t,n],translate:[r,i]}=e,s=this.features,o=this._getQuantizationFunction(this.geometryType,(e=>Math.round((e-r)/t)),(e=>Math.round((i-e)/n)));for(let e=0,t=s.length;e<t;e++)o?.(s[e].geometry)||(s.splice(e,1),e--,t--);return this.transform=e,this}unquantize(){const{geometryType:e,features:t,transform:n}=this;if(!n)return this;const{translate:[r,i],scale:[s,o]}=n;let a=null,l=null;if(this.hasZ&&null!=n?.scale?.[2]){const{translate:[,,e],scale:[,,t]}=n;a=n=>n*t+e}if(this.hasM&&null!=n?.scale?.[3]){const{translate:[,,,e],scale:[,,,t]}=n;l=n=>null==n?n:n*t+e}const u=this._getHydrationFunction(e,(e=>e*s+r),(e=>i-e*o),a,l);for(const{geometry:e}of t)null!=e&&u&&u(e);return this.transform=null,this}readFeaturesWithClass(e,t,n){const r=f.A.fromJSON(t.spatialReference),i=[];for(let t=0;t<e.length;t++){const s=e[t],o=n.fromJSON(s),a=s.geometry?.spatialReference;null==o.geometry||a||(o.geometry.spatialReference=r);const l=s.aggregateGeometries,u=o.aggregateGeometries;if(l&&null!=u)for(const e in u){const t=u[e],n=l[e],i=n?.spatialReference;null==t||i||(t.spatialReference=r)}i.push(o)}return i}_quantizePoints(e,t,n){let r,i;const s=[];for(let o=0,a=e.length;o<a;o++){const a=e[o];if(o>0){const e=t(a[0]),o=n(a[1]);e===r&&o===i||(s.push([e-r,o-i]),r=e,i=o)}else r=t(a[0]),i=n(a[1]),s.push([r,i])}return s.length>0?s:null}_getQuantizationFunction(e,t,n){return"point"===e?e=>(e.x=t(e.x),e.y=n(e.y),e):"polyline"===e||"polygon"===e?e=>{const r=(0,m.Bi)(e)?e.rings:e.paths,i=[];for(let e=0,s=r.length;e<s;e++){const s=r[e],o=this._quantizePoints(s,t,n);o&&i.push(o)}return i.length>0?((0,m.Bi)(e)?e.rings=i:e.paths=i,e):null}:"multipoint"===e?e=>{const r=this._quantizePoints(e.points,t,n);return r&&r.length>0?(e.points=r,e):null}:"extent"===e?e=>e:null}_getHydrationFunction(e,t,n,r,i){return"point"===e?e=>{e.x=t(e.x),e.y=n(e.y),r&&(e.z=r(e.z))}:"polyline"===e||"polygon"===e?e=>{const s=(0,m.Bi)(e)?e.rings:e.paths;let o,a;for(let e=0,r=s.length;e<r;e++){const r=s[e];for(let e=0,i=r.length;e<i;e++){const i=r[e];e>0?(o+=i[0],a+=i[1]):(o=i[0],a=i[1]),i[0]=t(o),i[1]=n(a)}}if(r&&i)for(let e=0,t=s.length;e<t;e++){const t=s[e];for(let e=0,n=t.length;e<n;e++){const n=t[e];n[2]=r(n[2]),n[3]=i(n[3])}}else if(r)for(let e=0,t=s.length;e<t;e++){const t=s[e];for(let e=0,n=t.length;e<n;e++){const n=t[e];n[2]=r(n[2])}}else if(i)for(let e=0,t=s.length;e<t;e++){const t=s[e];for(let e=0,n=t.length;e<n;e++){const n=t[e];n[2]=i(n[2])}}}:"extent"===e?e=>{e.xmin=t(e.xmin),e.ymin=n(e.ymin),e.xmax=t(e.xmax),e.ymax=n(e.ymax),r&&null!=e.zmax&&null!=e.zmin&&(e.zmax=r(e.zmax),e.zmin=r(e.zmin)),i&&null!=e.mmax&&null!=e.mmin&&(e.mmax=i(e.mmax),e.mmin=i(e.mmin))}:"multipoint"===e?e=>{const s=e.points;let o,a;for(let e=0,r=s.length;e<r;e++){const r=s[e];e>0?(o+=r[0],a+=r[1]):(o=r[0],a=r[1]),r[0]=t(o),r[1]=n(a)}if(r&&i)for(let e=0,t=s.length;e<t;e++){const t=s[e];t[2]=r(t[2]),t[3]=i(t[3])}else if(r)for(let e=0,t=s.length;e<t;e++){const t=s[e];t[2]=r(t[2])}else if(i)for(let e=0,t=s.length;e<t;e++){const t=s[e];t[2]=i(t[2])}}:null}};(0,i._)([(0,u.MZ)({type:String,json:{write:!0}})],_.prototype,"displayFieldName",void 0),(0,i._)([(0,u.MZ)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],_.prototype,"exceededTransferLimit",void 0),(0,i._)([(0,u.MZ)({type:[s.A],json:{write:!0}})],_.prototype,"features",void 0),(0,i._)([(0,c.w)("features")],_.prototype,"readFeatures",null),(0,i._)([(0,u.MZ)({type:[y.A],json:{write:!0}})],_.prototype,"fields",void 0),(0,i._)([(0,u.MZ)({type:["point","multipoint","polyline","polygon","extent","mesh"],json:{read:{reader:g.read}}})],_.prototype,"geometryType",void 0),(0,i._)([(0,p.K)("geometryType")],_.prototype,"writeGeometryType",null),(0,i._)([(0,u.MZ)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],_.prototype,"hasM",void 0),(0,i._)([(0,u.MZ)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],_.prototype,"hasZ",void 0),(0,i._)([(0,u.MZ)({types:h.yR,json:{write:!0}})],_.prototype,"queryGeometry",void 0),(0,i._)([(0,c.w)("queryGeometry")],_.prototype,"readQueryGeometry",null),(0,i._)([(0,u.MZ)({type:f.A,json:{write:!0}})],_.prototype,"spatialReference",void 0),(0,i._)([(0,p.K)("spatialReference")],_.prototype,"writeSpatialReference",null),(0,i._)([(0,u.MZ)({json:{write:!0}})],_.prototype,"transform",void 0),_=r=(0,i._)([(0,d.$)("esri.rest.support.FeatureSet")],_),_.prototype.toJSON.isDefaultToJSON=!0},32730:(e,t,n)=>{n.d(t,{BI:()=>y,D3:()=>m,XJ:()=>h,lc:()=>f,mX:()=>_,rU:()=>g,tH:()=>F});var r=n(799);const i="__begin__",s="__end__",o=new RegExp(i,"ig"),a=new RegExp(s,"ig"),l=new RegExp("^"+i,"i"),u=new RegExp(s+"$","i"),c='"',d=c+" + ",p=" + "+c;function f(e){return e.replaceAll(new RegExp("\\[","g"),"{").replaceAll(new RegExp("\\]","g"),"}")}function m(e){return e.replaceAll(new RegExp("\\{","g"),"[").replaceAll(new RegExp("\\}","g"),"]")}function h(e){const t={expression:"",type:"none"};return e.labelExpressionInfo?e.labelExpressionInfo.value?(t.expression=e.labelExpressionInfo.value,t.type="conventional"):e.labelExpressionInfo.expression&&(t.expression=e.labelExpressionInfo.expression,t.type="arcade"):null!=e.labelExpression&&(t.expression=f(e.labelExpression),t.type="conventional"),t}function y(e){const t=h(e);if(!t)return null;switch(t.type){case"conventional":return _(t.expression);case"arcade":return t.expression}return null}function g(e){const t=h(e);if(!t)return null;switch(t.type){case"conventional":return function(e){const t=e?.match(x);return t?.[1].trim()||null}(t.expression);case"arcade":return F(t.expression)}return null}function _(e){let t;return e?(t=(0,r.HC)(e,(e=>i+'$feature["'+e+'"]'+s)),t=l.test(t)?t.replace(l,""):c+t,t=u.test(t)?t.replace(u,""):t+c,t=t.replaceAll(o,d).replaceAll(a,p)):t='""',t}const x=/^\s*\{([^}]+)\}\s*$/i,w=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])(.+)(\2)\]));?\s*$/i,T=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])(.+)(\2)\]));?\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])(\1|\3)(\5)\s*\));?\s*$/i,v=/^\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])(.+)(\1)\s*\));?\s*$/i;function F(e){if(!e)return null;let t=w.exec(e)||T.exec(e);return t?t[1]||t[3]:(t=v.exec(e),t?t[2]:null)}},32756:(e,t,n)=>{n.d(t,{Rr:()=>l,fY:()=>c,ne:()=>u});var r=n(90237),i=n(93637),s=n(10107),o=(n(44208),n(53966),n(87811),n(40608)),a=n(91880);function l(e,t,n){if(!e)return null;const r=e.find((e=>!!e.field));if(!r)return null;const i=new a.A;return i.read(r,n),[i]}const u={type:[a.A],json:{origins:{"web-scene":{write:!1,read:!1}},name:"layerDefinition.orderBy",read:{reader:l},write:{writer:function(e,t,n,r){const s=e.find((e=>!!e.field));s&&(0,i.sM)(n,[s.toJSON()],t)}}}},c=e=>{let t=class extends e{constructor(){super(...arguments),this.orderBy=null}};return(0,r._)([(0,s.MZ)(u)],t.prototype,"orderBy",void 0),t=(0,r._)([(0,o.$)("esri.layers.mixins.OrderedLayer")],t),t}},33143:(e,t,n)=>{n.d(t,{A:()=>p});var r=n(90237),i=n(69540),s=n(25482),o=n(10107),a=(n(44208),n(53966),n(87811),n(36005)),l=n(40608),u=n(43937),c=n(80451),d=n(29005);let p=class extends(i.A.ClonableMixin(s.A)){constructor(e){super(e),this.id=null,this.name=null,this.domains=null,this.templates=null}readDomains(e){const t={};for(const n of Object.keys(e))t[n]=(0,c.rS)(e[n]);return t}writeDomains(e,t){const n={};for(const t of Object.keys(e))e[t]&&(n[t]=e[t]?.toJSON());t.domains=n}};(0,r._)([(0,o.MZ)({json:{write:!0}})],p.prototype,"id",void 0),(0,r._)([(0,o.MZ)({json:{write:!0}})],p.prototype,"name",void 0),(0,r._)([(0,o.MZ)({json:{write:!0}})],p.prototype,"domains",void 0),(0,r._)([(0,a.w)("domains")],p.prototype,"readDomains",null),(0,r._)([(0,u.K)("domains")],p.prototype,"writeDomains",null),(0,r._)([(0,o.MZ)({type:[d.A],json:{write:!0}})],p.prototype,"templates",void 0),p=(0,r._)([(0,l.$)("esri.layers.support.FeatureType")],p)},39516:(e,t,n)=>{let r;async function i(){return null==r&&(r=Promise.all([n.e(8368),n.e(4123)]).then(n.bind(n,44123)).then((e=>new e.WhereClauseCache(500,500)))),r}async function s(e,t){const n=await i(),r=n.get(e,t);if(null==r)throw n.getError(e,t);return r}function o(e,t){return e||=null,t||=null,"1=1"===e?t??e:"1=1"===t?e??t:e&&t?`(${e}) AND (${t})`:e??t}function a(e,t){return e||=null,t||=null,"1=1"===e||"1=1"===t||e===t?"1=1"===e?e:t:e&&t?`(${e}) OR (${t})`:e??t}n.d(t,{GP:()=>s,IW:()=>a,mA:()=>o})},41366:(e,t,n)=>{n.d(t,{K:()=>p,Q:()=>u});var r=n(90237),i=n(66552),s=n(53966),o=n(10107),a=(n(44208),n(87811),n(93223)),l=n(40608);const u=(0,i.O)()({naturalLog:"natural-log",squareRoot:"square-root",percentOfTotal:"percent-of-total",log:"log",field:"field"}),c="percent-of-total",d="field",p=e=>{let t=class extends e{constructor(){super(...arguments),this.normalizationField=null,this.normalizationMaxValue=null,this.normalizationMinValue=null,this.normalizationTotal=null}get normalizationType(){let e=this._get("normalizationType");const t=!!this.normalizationField,n=null!=this.normalizationTotal;return t||n?(e=t&&d||n&&c||null,t&&n&&s.A.getLogger(this).warn("warning: both normalizationField and normalizationTotal are set!")):e!==d&&e!==c||(e=null),e}set normalizationType(e){this._set("normalizationType",e)}};return(0,r._)([(0,o.MZ)({type:String,json:{name:"parameters.normalizationField",write:!0}})],t.prototype,"normalizationField",void 0),(0,r._)([(0,o.MZ)({type:Number,json:{name:"parameters.normalizationMaxValue",write:!0}})],t.prototype,"normalizationMaxValue",void 0),(0,r._)([(0,o.MZ)({type:Number,json:{name:"parameters.normalizationMinValue",write:!0}})],t.prototype,"normalizationMinValue",void 0),(0,r._)([(0,o.MZ)({type:Number,json:{name:"parameters.normalizationTotal",write:!0}})],t.prototype,"normalizationTotal",void 0),(0,r._)([(0,a.e)(u,{name:"parameters.normalizationType"})],t.prototype,"normalizationType",null),t=(0,r._)([(0,l.$)("esri.rest.support.NormalizationBinParametersMixin")],t),t}},41560:(e,t,n)=>{n.d(t,{Ch:()=>o,mW:()=>s});var r=n(34727),i=n(39516);function s(e,t){return{...t,filterMode:e.mode}}function o(e,t,n){const s=function(e){if("manual"===u(e))return null;const t=[Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY];for(const{minScale:n,maxScale:r}of e.filters)t[0]=Math.max(t[0],c(n)),t[1]=Math.min(t[1],d(r));return t}(e);if(s&&((0,r.gg)(t,s[0])||(0,r.ZH)(n,s[1])))return"";const o=Array.from(a(e,t,n)),l=function(e,t,n){if(0===e.length)return!0;const i=c(e.at(0)?.minScale),s=d(e.at(-1)?.maxScale);if((0,r.ZH)(i,t)||(0,r.gg)(s,n))return!0;for(let t=0;t<e.length-1;t++){const n=e[t],i=e[t+1];if((0,r.ZH)(c(i.minScale),d(n.maxScale)))return!0}return!1}(o,t,n)?"1=1":o.map((e=>e.where||"1=1")).reduce(((e,t)=>(0,i.IW)(e,t)),"");return l&&"1=1"!==l?l:""}function*a(e,t,n){if("manual"===u(e)){const t=e.filters.find((t=>t.id===e.activeFilterId));t&&(yield t)}else{"object"==typeof t&&(t=t.scale);for(const r of e.filters)l(r.minScale,r.maxScale,t,n)&&(yield r)}}function l(e,t,n,i){return e=c(e),n=c(n),t=d(t),!(!(0,r.Sp)(n,e)&&(i??n)>e||(0,r.Hx)(t,n)||void 0!==i&&(0,r.Sp)(i,e))}function u(e){return"mode"in e?e.mode:e.filterMode}function c(e){return e||Number.POSITIVE_INFINITY}function d(e){return e||0}},46140:(e,t,n)=>{n.d(t,{R:()=>i});var r=n(49186);let i=class e{constructor(e,t,n=""){this.major=e,this.minor=t,this._context=n}lessThan(e,t){return this.major<e||e===this.major&&this.minor<t}greaterEqual(e,t){return!this.lessThan(e,t)}validate(e){if(this.major!==e.major){const t=this._context&&this._context+":",n=this._context&&this._context+" ";throw new r.A(t+"unsupported-version",`Required major ${n}version is '${this.major}', but got '\${version.major}.\${version.minor}'`,{version:e})}}clone(){return new e(this.major,this.minor,this._context)}static parse(t,n=""){const[i,s]=t.split("."),o=/^\s*\d+\s*$/;if(!i?.match||!o.test(i))throw new r.A((n&&n+":")+"invalid-version","Expected major version to be a number, but got '${version}'",{version:t});if(!s?.match||!o.test(s))throw new r.A((n&&n+":")+"invalid-version","Expected minor version to be a number, but got '${version}'",{version:t});const a=parseInt(i,10),l=parseInt(s,10);return new e(a,l,n)}}},55674:(e,t,n)=>{n.d(t,{Ad:()=>f,Gj:()=>y,QY:()=>p,lL:()=>g,xR:()=>m});var r=n(66131),i=n(49186),s=(n(44208),n(44729)),o=n(15032),a=n(65864),l=n(95466),u=n(43668),c=n(98623);const d=["geometry","scale","timeProperties"];function p(e,t){if(null!=t)for(const n of d)t.hasArcadeDependency(n)&&e.add(n);return e}function f(e,t){return h.create(e,t,null,["$feature","$view"])}function m(e,t,n){return h.create(e,t,n,["$feature","$view","$config"])}class h{static async create(e,t,n,r){const{arcade:s,Dictionary:o}=await(0,u.l)();let a;try{a=s.parseScript(e)}catch(t){throw new i.A("arcade-bad-expression","Failed to parse arcade script",{script:e,error:t})}const l=s.scriptUsesGeometryEngine(a);l&&await s.enableGeometrySupport(),await s.loadDependentModules(new Set,a,null,!1,l);const c={vars:r.reduce(((e,t)=>({...e,[t]:null})),{}),spatialReference:t,useAsync:!1},d=s.compileScript(a,c);let p=null;null!=n&&(p=new o(n),p.immutable=!0);const f=new o;return f.immutable=!1,f.setField("scale",0),new h(e,s,a,d,t,f,p,o)}constructor(e,t,n,r,i,s,o,a){this.script=e,this._arcade=t,this._syntaxTree=n,this._compiled=r,this._spatialReference=i,this._viewDict=s,this._configDict=o,this._dictionaryCtor=a,this._dependencies=new Map,this._featureReader=new y,this._dependencies.set("geometry",t.scriptTouchesGeometry(this._syntaxTree)),this._dependencies.set("scale",this._arcade.referencesMember(this._syntaxTree,"scale")),this._dependencies.set("timeProperties",this._arcade.scriptUsesViewProperties(this._syntaxTree,["timeProperties"]))}evaluate(e,t){const n=t.$view?.timeZone;if(t.$view){let e;if(this._viewDict.setField("scale",t.$view.scale),null!=t.$view.timeProperties){const{currentStart:i,currentEnd:s}=t.$view.timeProperties;e=new this._dictionaryCtor({currentStart:null!=i?null!=n?r.lY.epochToArcadeDate(i,n):r.lY.unknownEpochToArcadeDate(i):void 0,currentEnd:null!=s?null!=n?r.lY.epochToArcadeDate(s,n):r.lY.unknownEpochToArcadeDate(s):void 0,startIncluded:!0,endIncluded:!0})}this._viewDict.setField("timeProperties",e)}return this._compiled({vars:{$view:this._viewDict,$config:this._configDict,$feature:e},spatialReference:this._spatialReference,timeZone:n})}repurposeFeature(e,t){return this._featureReader.bind(e,t,this._spatialReference),this._featureReader}references(e){return this._dependencies.get(e)??!1}}class y{constructor(){this._boundTarget=null,this._boundSchema={fields:null,fieldsIndex:null,spatialReference:null,get geometryType(){return null},get objectIdField(){return null}},this.arcadeDeclaredClass="esri.arcade.Feature",this._contextTimeZone=null}bind(e,t,n){const r=t??new l.A(g(e.attributes));this._boundTarget=e,this._boundSchema.fields=r.fields,this._boundSchema.fieldsIndex=r,this._boundSchema.spatialReference=n}_getField(e){return this._boundSchema.fieldsIndex.get(e)}get contextTimeZone(){return this._contextTimeZone}set contextTimeZone(e){this._contextTimeZone=e}readArcadeFeature(){return this}hasField(e){return this._boundSchema.fieldsIndex.has(e)}geometry(){if("fromJSON"in this._boundTarget)return this._boundTarget.geometry;const e=(0,a.rS)(this._boundTarget.geometry);if(e){if(!this._boundSchema.spatialReference)throw new Error("InternalError: Expected spatial reference to be defined");e.spatialReference=this._boundSchema.spatialReference}return e}isUnknownDateTimeField(e){return this._boundSchema.fieldsIndex.getTimeZone(e)===c.L5}field(e,t=!0){const n=this._getField(e);if(n)switch(n.type){case"date-only":case"esriFieldTypeDateOnly":return s.n.fromReader(this._boundTarget.attributes[n.name]);case"time-only":case"esriFieldTypeTimeOnly":return o.k.fromReader(this._boundTarget.attributes[n.name]);case"esriFieldTypeTimestampOffset":case"timestamp-offset":return r.lY.fromReaderAsTimeStampOffset(this._boundTarget.attributes[n.name]);case"date":case"esriFieldTypeDate":{const t=this._boundTarget.attributes[n.name];return this.isUnknownDateTimeField(e)?r.lY.unknownEpochToArcadeDate(t):r.lY.epochToArcadeDate(t,this.contextTimeZone??c.qU)}default:return this._boundTarget.attributes[n.name]}if(t)throw new Error(`Field ${e} does not exist`);return null}setField(e,t){throw new Error("Unable to update feature attribute values, feature is readonly")}keys(){return this._boundSchema.fieldsIndex.fields.map((e=>e.name))}castToText(e=!1){return JSON.stringify(this._boundTarget)}gdbVersion(){return null}fullSchema(){return this._boundSchema}castAsJson(e=null){return{attributes:this._boundTarget.attributes,geometry:!0===e?.keepGeometryType?this.geometry():this.geometry()?.toJSON()??null}}castAsJsonAsync(e=null,t=null){return Promise.resolve(this.castAsJson(t))}}function g(e){const t=[];for(const n in e)t.push({name:n,alias:n,type:"string"==typeof e[n]?"esriFieldTypeString":"esriFieldTypeDouble"});return t}},58501:(e,t,n)=>{n.d(t,{q:()=>i});var r=n(62815);function i(e,t,n){if(!n?.features||!n.hasZ)return;const i=(0,r.N)(n.geometryType,t,e.outSpatialReference);if(null!=i)for(const e of n.features)i(e.geometry)}},70328:(e,t,n)=>{n.d(t,{BI:()=>_,Ej:()=>p,Ie:()=>y,Jt:()=>g,Ne:()=>f,RF:()=>c,aI:()=>w,fA:()=>o,gE:()=>l,hZ:()=>h,iT:()=>d,is:()=>x,qv:()=>T,vI:()=>m,vY:()=>a,v_:()=>v,vt:()=>s,w1:()=>u});var r=n(5443),i=(n(19419),n(4197));function s(e=v){return[e[0],e[1],e[2],e[3],e[4],e[5]]}function o(e,t,n,r,i,o,a=s()){return a[0]=e,a[1]=t,a[2]=n,a[3]=r,a[4]=i,a[5]=o,a}function a(e,t=s()){return function(e,t,n,r=s()){return h(r,T),function(e,t,n=0,r=t.length/3){let i=e[0],s=e[1],o=e[2],a=e[3],l=e[4],u=e[5];for(let e=0;e<r;e++)i=Math.min(i,t[n+3*e]),s=Math.min(s,t[n+3*e+1]),o=Math.min(o,t[n+3*e+2]),a=Math.max(a,t[n+3*e]),l=Math.max(l,t[n+3*e+1]),u=Math.max(u,t[n+3*e+2]);e[0]=i,e[1]=s,e[2]=o,e[3]=a,e[4]=l,e[5]=u}(r,e,t,n),r}(e,0,e.length/3,t)}function l(e,t=(0,i.jh)(24)){const[n,r,s,o,a,l]=e;return t[0]=n,t[1]=r,t[2]=s,t[3]=n,t[4]=r,t[5]=l,t[6]=n,t[7]=a,t[8]=s,t[9]=n,t[10]=a,t[11]=l,t[12]=o,t[13]=r,t[14]=s,t[15]=o,t[16]=r,t[17]=l,t[18]=o,t[19]=a,t[20]=s,t[21]=o,t[22]=a,t[23]=l,t}function u(e,t){const n=isFinite(e[2])||isFinite(e[5]);return new r.A(n?{xmin:e[0],xmax:e[3],ymin:e[1],ymax:e[4],zmin:e[2],zmax:e[5],spatialReference:t}:{xmin:e[0],xmax:e[3],ymin:e[1],ymax:e[4],spatialReference:t})}function c(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.min(e[2],t[2]),e[3]=Math.max(e[3],t[3]),e[4]=Math.max(e[4],t[4]),e[5]=Math.max(e[5],t[5])}function d(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.min(e[2],t[2]),e[3]=Math.max(e[3],t[0]),e[4]=Math.max(e[4],t[1]),e[5]=Math.max(e[5],t[2])}function p(e,t=[0,0,0]){return t[0]=function(e){return e[0]>=e[3]?0:e[3]-e[0]}(e),t[1]=function(e){return e[1]>=e[4]?0:e[4]-e[1]}(e),t[2]=function(e){return e[2]>=e[5]?0:e[5]-e[2]}(e),t}function f(e,t,n=e){return n[0]=t[0],n[1]=t[1],n[2]=t[2],n!==e&&(n[3]=e[3],n[4]=e[4],n[5]=e[5]),n}function m(e,t,n=e){return n[3]=t[0],n[4]=t[1],n[5]=t[2],n!==e&&(n[0]=e[0],n[1]=e[1],n[2]=e[2]),e}function h(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function y(e){return e?h(e,T):s(T)}function g(e,t){return e[0]=t[0],e[1]=t[1],e[2]=Number.NEGATIVE_INFINITY,e[3]=t[2],e[4]=t[3],e[5]=Number.POSITIVE_INFINITY,e}function _(e,t,n,r,i){return e[0]=t,e[1]=n,e[2]=Number.NEGATIVE_INFINITY,e[3]=r,e[4]=i,e[5]=Number.POSITIVE_INFINITY,e}function x(e){return 6===e.length}function w(e,t,n){if(null==e||null==t)return e===t;if(!x(e)||!x(t))return!1;if(n){for(let r=0;r<e.length;r++)if(!n(e[r],t[r]))return!1}else for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}const T=[1/0,1/0,1/0,-1/0,-1/0,-1/0],v=[0,0,0,0,0,0];s()},73681:(e,t,n)=>{n.d(t,{n:()=>l});var r=n(49186),i=n(53966),s=n(46140),o=n(95466),a=n(55674);class l{static async from(e,t,n){const o=e.dictionary_version?s.R.parse(e.dictionary_version):null,c=new Set(e.itemsNames),d={};if(t)for(const e in t)d[e]=t[e];if(e.authoringInfo.configuration)for(const t of e.authoringInfo.configuration)d.hasOwnProperty(t.name)||(d[t.name]=t.value);const p=new Set(e.authoringInfo.symbol);for(const e of Object.keys(n))p.delete(e);p.size&&i.A.getLogger("esri.renderers.support.DictionaryScriptEvaluator").warnOnce("missing-fields: fieldMap entries for the following symbol fields are missing",{symbolFields:p});const f=await(0,a.xR)(e.expression,null,d);if(!f)throw new r.A("dictionary-renderer:expression-error","Unable to create dictionary renderer expression");const m=!o||!o.greaterEqual(4,0);m&&i.A.getLogger("esri.renderers.support.DictionaryScriptEvaluator").warnOnce("Dictionary script does not support native field types. Applying fallback",{version:o});const h=new u(n,m);return new l(m,c,f,h)}constructor(e,t,n,r){this._requiresFieldCoercionToString=e,this._itemNames=t,this._compiled=n,this._reader=r}get itemNames(){return this._itemNames}evaluate(e,t,n,r){try{return this._reader.bind(e,n,r),this._compiled.evaluate(this._reader,{$view:{scale:t}})}catch(e){i.A.getLogger("esri.renderers.support.DictionaryScriptEvaluator").warnOnce("arcade: dictionary script evaluation failed",{error:e})}return null}createDictionaryFieldsIndex(e){if(!this._requiresFieldCoercionToString)return new o.A(e);const t=e.map((e=>({...e,type:"esriFieldTypeString"})));return new o.A(t)}}class u extends a.Gj{constructor(e,t){super(),this._fieldMap=e,this._requiresFieldCoercionToString=t}_getField(e){const t=this._fieldMap[e]??e;return this._boundSchema.fieldsIndex.get(t)}field(e){if(!this._requiresFieldCoercionToString)return super.field(e,!1);const t=this._getField(e);return null==t?"":""+this._boundTarget.attributes[t.name]}}},91880:(e,t,n)=>{n.d(t,{A:()=>c});var r,i=n(90237),s=n(66552),o=n(25482),a=n(10107),l=(n(44208),n(53966),n(87811),n(40608));const u=new s.J({asc:"ascending",desc:"descending"});let c=class extends o.A{static{r=this}constructor(e){super(e),this.field=null,this.valueExpression=null,this.order="ascending"}clone(){return new r({field:this.field,valueExpression:this.valueExpression,order:this.order})}};(0,i._)([(0,a.MZ)({type:String,json:{write:!0}})],c.prototype,"field",void 0),(0,i._)([(0,a.MZ)({type:String,json:{write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],c.prototype,"valueExpression",void 0),(0,i._)([(0,a.MZ)({type:u.apiValues,json:{type:u.jsonValues,read:u.read,write:u.write}})],c.prototype,"order",void 0),c=r=(0,i._)([(0,l.$)("esri.layers.support.OrderByInfo")],c)},92935:(e,t,n)=>{var r;n.d(t,{X:()=>r}),function(e){e[e.SAVE=0]="SAVE",e[e.SAVE_AS=1]="SAVE_AS"}(r||(r={}))},95466:(e,t,n)=>{n.d(t,{A:()=>f});var r=n(49186),i=n(53966),s=n(91869),o=n(3330),a=n(12195),l=n(30524),u=n(98623),c=n(56400),d=n(96285);const p=new Map;class f{static fromJSON(e){return new f(e.fields,e.timeZoneByFieldName)}static fromLayer(e){return new f(e.fields??[],g(e))}static fromLayerJSON(e){return new f(e.fields??[],g(e))}constructor(e=[],t){this._fieldsMap=new Map,this._normalizedFieldsMap=new Map,this._dateFieldsSet=new Set,this._numericFieldsSet=new Set,this._requiredFields=null,this.dateFields=[],this.numericFields=[],this.fields=e||[],this._timeZoneByFieldName=t?new Map(t):null;const n=[];for(const e of this.fields){const t=e?.name,r=h(t);if(t&&r){const i=m(t);this._fieldsMap.set(t,e),this._fieldsMap.set(i,e),this._normalizedFieldsMap.set(r,e),n.push(`${i}:${e.type}:${this._timeZoneByFieldName?.get(t)}`),(0,l.vE)(e)?(this.dateFields.push(e),this._dateFieldsSet.add(e)):(0,l.WA)(e)&&(this._numericFieldsSet.add(e),this.numericFields.push(e)),(0,l.te)(e)||(0,l.Xz)(e)||(e.editable=null==e.editable||!!e.editable,e.nullable=null==e.nullable||!!e.nullable)}}n.sort(),this.uid=n.join()}get requiredFields(){if(!this._requiredFields){this._requiredFields=[];for(const e of this.fields)(0,l.te)(e)||(0,l.Xz)(e)||e.nullable||void 0!==(0,l.lD)(e)||this._requiredFields.push(e)}return this._requiredFields}equals(e){return this.uid===e?.uid}has(e){return null!=this.get(e)}get(e){if(!e)return;let t=this._fieldsMap.get(e);return t||(t=this._fieldsMap.get(m(e))??this._normalizedFieldsMap.get(h(e)),t&&this._fieldsMap.set(e,t),t)}getTimeZone(e){const t=this.get(e&&"string"!=typeof e?e.name:e);return t?this._timeZoneByFieldName?this._timeZoneByFieldName.get(t.name):"date"===t.type||"esriFieldTypeDate"===t.type?(i.A.getLogger("esri.layers.support.FieldsIndex").errorOnce(new r.A("getTimeZone:no-timezone-information",`no time zone information for field '${t.name}'`)),u.n$):y.has(t.type)?u.L5:null:null}getLuxonTimeZone(e){const t=this.getTimeZone(e);return t?t===u.L5?o.GB.instance:t===u.n$?d.mQ.utcInstance:(0,s.tE)(p,t,(()=>d.oh.create(t))):null}isDateField(e){return this._dateFieldsSet.has(this.get(e))}isTimeOnlyField(e){return(0,l.OH)(this.get(e))}isNumericField(e){return this._numericFieldsSet.has(this.get(e))}normalizeFieldName(e){return this.get(e)?.name??void 0}toJSON(){return{fields:this.fields.map((e=>(0,a.W)(e)?e.toJSON():e)),timeZoneByFieldName:this._timeZoneByFieldName?Array.from(this._timeZoneByFieldName.entries()):null}}}function m(e){return e.trim().toLowerCase()}function h(e){return(0,l.rS)(e)?.toLowerCase()??""}const y=new Set(["time-only","date-only","timestamp-offset","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"]);function g(e){const t=new Map;if(!e.fields)return t;const n=!0===e.datesInUnknownTimezone,{timeInfo:r,editFieldsInfo:i}=e,s=(r?"startField"in r?r.startField:r.startTimeField:"")??"",o=(r?"endField"in r?r.endField:r.endTimeField:"")??"",a=function(e){return"dateFieldsTimeZone"in e}(e)?e.dateFieldsTimeZone??null:e.dateFieldsTimeReference?(0,c.ZS)(e.dateFieldsTimeReference):null,l=i?function(e){return"timeZone"in e}(i)?i.timeZone??a:i.dateFieldsTimeReference?(0,c.ZS)(i.dateFieldsTimeReference):a??u.n$:null,d=r?function(e){return"timeZone"in e}(r)?r.timeZone??a:r.timeReference?(0,c.ZS)(r.timeReference):a:null,p=new Map([[m(i?.creationDateField??""),l],[m(i?.editDateField??""),l],[m(s),d],[m(o),d]]);for(const{name:r,type:i}of e.fields)if(y.has(i))t.set(r,u.L5);else if("date"!==i&&"esriFieldTypeDate"!==i)t.set(r,null);else if(n)t.set(r,u.L5);else{const e=p.get(m(r??""))??a;t.set(r,e)}return t}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[7425],{12543:(e,t,s)=>{s.r(t),s.d(t,{default:()=>Ee});var i=s(90237),r=s(65529),n=s(74887),o=s(36708),a=s(10107),l=(s(44208),s(53966)),u=(s(87811),s(40608)),h=s(79897),c=s(16930),d=s(65864),f=s(58376),p=s(83221),_=s(68298),y=s(87045),m=s(61956),g=s(88625),T=s(66344),E=s(91869),F=s(83047),v=s(16271);function C(e=!1,t){if(e){const{elevationInfo:e,alignPointsInFeatures:s}=t;return new S(e,s)}return new w}class w{async alignCandidates(e,t,s){return e}notifyElevationSourceChange(){}}class S{constructor(e,t){this._elevationInfo=e,this._alignPointsInFeatures=t,this._alignmentsCache=new T.q(1024),this._cacheVersion=0}async alignCandidates(e,t,s){const i=this._elevationInfo;return null==i||"absolute-height"!==i.mode||i.featureExpressionInfo?this._alignComputedElevationCandidates(e,t,s):(function(e,t,s){const{offset:i,unit:r}=s;if(null==i)return;const n=(0,F.G9)(t),o=i*((0,v.Ao)(r??"meters")/n);for(const t of e)switch(t.type){case"edge":t.start.z+=o,t.end.z+=o;continue;case"vertex":t.target.z+=o;continue}}(e,t,i),e)}notifyElevationSourceChange(){this._alignmentsCache.clear(),this._cacheVersion++}async _alignComputedElevationCandidates(e,t,s){const i=new Map;for(const t of e)(0,E.tE)(i,t.objectId,x).push(t);const[r,o,a]=this._prepareQuery(i,t),l=await this._alignPointsInFeatures(r,s);if((0,n.Te)(s),a!==this._cacheVersion)return this._alignComputedElevationCandidates(e,t,s);this._applyCacheAndResponse(r,l,o);const{drapedObjectIds:u,failedObjectIds:h}=l,c=[];for(const t of e){const{objectId:e}=t;u.has(e)&&"edge"===t.type&&(t.draped=!0),h.has(e)||c.push(t)}return c}_prepareQuery(e,t){const s=[],i=[];for(const[t,r]of e){const e=[];for(const s of r)this._addToQueriesOrCachedResult(t,s.target,e,i),"edge"===s.type&&(this._addToQueriesOrCachedResult(t,s.start,e,i),this._addToQueriesOrCachedResult(t,s.end,e,i));0!==e.length&&s.push({objectId:t,points:e})}return[{spatialReference:t.toJSON(),pointsInFeatures:s},i,this._cacheVersion]}_addToQueriesOrCachedResult(e,t,s,i){const r=b(e,t),n=this._alignmentsCache.get(r);null==n?s.push(t):i.push(new I(t,n))}_applyCacheAndResponse(e,{elevations:t,drapedObjectIds:s,failedObjectIds:i},r){for(const e of r)e.apply();let n=0;const o=this._alignmentsCache;for(const{objectId:r,points:a}of e.pointsInFeatures){if(i.has(r)){n+=a.length;continue}const e=!s.has(r);for(const s of a){const i=b(r,s),a=t[n++];s.z=a,e&&o.put(i,a,1)}}}}class I{constructor(e,t){this.point=e,this.z=t}apply(){this.point.z=this.z}}function b(e,{x:t,y:s,z:i,spatialReference:r}){return`${e}-${t}-${s}-${i??0}}-wkid:${r?.wkid}`}function x(){return[]}class A{filter(e,t){return t}notifyElevationSourceChange(){}}class M{filter(e,t){const{point:s,distance:i}=e,{z:r}=s;if(null==r)return t;if(0===t.length)return t;const n=function(e){return"number"==typeof e?{x:e,y:e,z:e}:e}(i),o=this._updateCandidatesTo3D(t,s,n).filter(O);return o.sort(D),o}_updateCandidatesTo3D(e,t,s){for(const i of e)switch(i.type){case"edge":P(i,t,s);continue;case"vertex":H(i,t,s);continue}return e}}function O(e){return e.distance<=1}function R(e=!1){return e?new M:new A}function P(e,t,{x:s,y:i,z:r}){const{start:n,end:o,target:a}=e;e.draped||function(e,t,s,i){const r=i.x-s.x,n=i.y-s.y,o=i.z-s.z,a=r*r+n*n+o*o,l=(t.x-s.x)*r+(t.y-s.y)*n+o*(t.z-s.z),u=Math.min(1,Math.max(0,l/a)),h=s.x+r*u,c=s.y+n*u,d=s.z+o*u;e.x=h,e.y=c,e.z=d}(a,t,n,o);const l=(t.x-a.x)/s,u=(t.y-a.y)/i,h=(t.z-a.z)/r;e.distance=Math.sqrt(l*l+u*u+h*h)}function H(e,t,{x:s,y:i,z:r}){const{target:n}=e,o=(t.x-n.x)/s,a=(t.y-n.y)/i,l=(t.z-n.z)/r,u=Math.sqrt(o*o+a*a+l*l);e.distance=u}function D(e,t){return e.distance-t.distance}var U=s(4718),N=s(799);function j(e=!1,t){return e?new z(t):new Z}class Z{async fetch(){return[]}notifySymbologyChange(){}}class z{constructor(e){this._getSymbologyCandidates=e,this._candidatesCache=new T.q(1024),this._cacheVersion=0}async fetch(e,t){if(0===e.length)return[];const s=[],i=[],r=this._candidatesCache;for(const t of e){const e=q(t),n=r.get(e);if(n)for(const e of n)i.push((0,U.o8)(e));else s.push(t),r.put(e,[],1)}if(0===s.length)return i;const o=this._cacheVersion,{candidates:a,sourceCandidateIndices:l}=await this._getSymbologyCandidates(s,t);if((0,n.Te)(t),o!==this._cacheVersion)return this.fetch(e,t);const u=[],{length:h}=a;for(let e=0;e<h;++e){const t=a[e],i=q(s[l[e]]),n=r.get(i);n.push(t),r.put(i,n,n.length),u.push((0,U.o8)(t))}return i.concat(u)}notifySymbologyChange(){this._candidatesCache.clear(),this._cacheVersion++}}function q(e){switch(e.type){case"vertex":{const{objectId:t,target:s}=e,i=`${t}-vertex-${s.x}-${s.y}-${s.z??0}`;return(0,N.Wm)(i).toString()}case"edge":{const{objectId:t,start:s,end:i}=e,r=`${t}-edge-${s.x}-${s.y}-${s.z??0}-to-${i.x}-${i.y}-${i.z??0}`;return(0,N.Wm)(r).toString()}default:return""}}var B,k=s(69622),G=s(4576),L=s(60999),V=s(3483),$=s(13069),J=s(5443),Q=s(19419),K=s(90708),Y=s(60694),W=s(69418),X=s(80893);class ee{constructor(e,t){this.data=e,this.resolution=t,this.state={type:B.CREATED},this.alive=!0}process(e){switch(this.state.type){case B.CREATED:return this.state=this._gotoFetchCount(this.state,e),this.state.task.promise.then(e.resume,e.resume);case B.FETCH_COUNT:break;case B.FETCHED_COUNT:return this.state=this._gotoFetchFeatures(this.state,e),this.state.task.promise.then(e.resume,e.resume);case B.FETCH_FEATURES:break;case B.FETCHED_FEATURES:this.state=this._goToDone(this.state,e);case B.DONE:}return null}get debugInfo(){return{data:this.data,featureCount:this._featureCount,state:this._stateToString}}get _featureCount(){switch(this.state.type){case B.CREATED:case B.FETCH_COUNT:return 0;case B.FETCHED_COUNT:return this.state.featureCount;case B.FETCH_FEATURES:return this.state.previous.featureCount;case B.FETCHED_FEATURES:return this.state.features.length;case B.DONE:return this.state.previous.features.length}}get _stateToString(){switch(this.state.type){case B.CREATED:return"created";case B.FETCH_COUNT:return"fetch-count";case B.FETCHED_COUNT:return"fetched-count";case B.FETCH_FEATURES:return"fetch-features";case B.FETCHED_FEATURES:return"fetched-features";case B.DONE:return"done"}}_gotoFetchCount(e,t){return{type:B.FETCH_COUNT,previous:e,task:(0,L.UT)((async e=>{const s=await(0,L.DZ)(t.fetchCount(this,e));this.state.type===B.FETCH_COUNT&&(this.state=function(e,t){return{type:B.FETCHED_COUNT,featureCount:t,previous:e}}(this.state,s.ok?s.value:1/0))}))}}_gotoFetchFeatures(e,t){return{type:B.FETCH_FEATURES,previous:e,task:(0,L.UT)((async s=>{const i=await(0,L.DZ)(t.fetchFeatures(this,e.featureCount,s));this.state.type===B.FETCH_FEATURES&&(this.state=function(e,t){return{type:B.FETCHED_FEATURES,previous:e,features:t}}(this.state,i.ok?i.value:[]))}))}}_goToDone(e,t){return t.finish(this,e.features),{type:B.DONE,previous:e}}reset(){const e=this.state;switch(this.state={type:B.CREATED},e.type){case B.CREATED:case B.FETCHED_COUNT:case B.FETCHED_FEATURES:case B.DONE:break;case B.FETCH_COUNT:case B.FETCH_FEATURES:e.task.abort()}}intersects(e){return null==e||!this.data.extent||((0,Q.VY)(e,te),(0,Q.HY)(this.data.extent,te))}}!function(e){e[e.CREATED=0]="CREATED",e[e.FETCH_COUNT=1]="FETCH_COUNT",e[e.FETCHED_COUNT=2]="FETCHED_COUNT",e[e.FETCH_FEATURES=3]="FETCH_FEATURES",e[e.FETCHED_FEATURES=4]="FETCHED_FEATURES",e[e.DONE=5]="DONE"}(B||(B={}));const te=(0,Q.vt)();let se=class extends k.A{get _minimumVerticesPerFeature(){switch(this.store?.featureStore.geometryType){case"esriGeometryPoint":case"esriGeometryMultipoint":return 1;case"esriGeometryPolygon":return 4;case"esriGeometryPolyline":return 2}}get _mandatoryOutFields(){const e=new Set;return this.objectIdField&&e.add(this.objectIdField),this.globalIdField&&e.add(this.globalIdField),e}set outFields(e){const t=this._get("outFields"),s=(0,V.KC)(e,this._mandatoryOutFields);(0,V.aI)(s,t)||(this._set("outFields",s),(0,V.Yy)(s,t)||this.refresh())}get outFields(){return this._get("outFields")??this._mandatoryOutFields}set filter(e){const t=this._get("filter"),s=this._filterProperties(e);JSON.stringify(t)!==JSON.stringify(s)&&this._set("filter",s)}set customParameters(e){const t=this._get("customParameters");JSON.stringify(t)!==JSON.stringify(e)&&this._set("customParameters",e)}get _configuration(){return{filter:this.filter,customParameters:this.customParameters,tileInfo:this.tileInfo,tileSize:this.tileSize}}set tileInfo(e){const t=this._get("tileInfo");t!==e&&(null!=e&&null!=t&&JSON.stringify(e)===JSON.stringify(t)||(this._set("tileInfo",e),this.store.tileInfo=e))}set tileSize(e){this._get("tileSize")!==e&&this._set("tileSize",e)}get updating(){return this._updatingHandles.updating}get hasZ(){return this.store.featureStore.hasZ}constructor(e){super(e),this.suspended=!0,this._historicMoment=null,this.tilesOfInterest=[],this.availability=0,this._pendingTiles=new Map,this._updatingHandles=new h.U}initialize(){this._initializeFetchExtent(),this._updatingHandles.add((()=>this._configuration),(()=>this.refresh())),this._updatingHandles.add((()=>this.tilesOfInterest),(()=>{this._updatePriorities(),this._process()}),{sync:!0,initial:!0,equals:(e,t)=>(0,G.aI)(e,t,(({id:e},{id:t})=>e===t))}),this.addHandles((0,o.z7)((()=>!this.suspended),(()=>this._process())))}_updatePriorities(){this.store.setPriorityOrderByKey(this.tilesOfInterest.map((e=>e.id??""))??[])}destroy(){this._pendingTiles.forEach((e=>this._deletePendingTile(e))),this._pendingTiles.clear(),this.store.destroy(),this.tilesOfInterest.length=0,this._updatingHandles.destroy()}refresh(){this.store.refresh(),this._pendingTiles.forEach((e=>this._deletePendingTile(e))),this._process()}async handleEdits(e){if(e.historicMoment&&(this._historicMoment=e.historicMoment),!e.addedFeatures.length&&!e.updatedFeatures.length&&!e.deletedFeatures.length)return;for(const e of this._pendingTiles.values())e.reset();const t={...e,deletedFeatures:e.deletedFeatures.map((({objectId:e,globalId:t})=>e&&-1!==e?e:this._lookupObjectIdByGlobalId(t)))},s=(0,L.UT)((async e=>{try{await this.store.processEdits(t,((e,t)=>this._queryFeaturesById(e,t)),e),this._processPendingTiles()}catch(e){(0,n.QP)(e),l.A.getLogger(this).warn("Failed to apply edits",e)}}));this.addHandles(s),await this._updatingHandles.addPromise(s.promise)}setHistoricMoment(e){e?.getTime()!==this._historicMoment?.getTime()&&(this._historicMoment=e,this.refresh())}_initializeFetchExtent(){if(!this.capabilities.query.supportsExtent||!(0,Y.Wo)(this.url))return;const e=(0,L.UT)((async e=>{try{const t=await(0,X.Jf)(this.url,new m.A({where:"1=1",outSpatialReference:this.spatialReference,cacheHint:this.capabilities.query.supportsCacheHint??void 0}),{query:this._configuration.customParameters,signal:e});this.store.extent=J.A.fromJSON(t.data?.extent)}catch(e){(0,n.QP)(e),l.A.getLogger(this).warn("Failed to fetch data extent",e)}}));this._updatingHandles.addPromise(e.promise.then((()=>this._process()))),this.addHandles(e)}get debugInfo(){return{numberOfFeatures:this.store.featureStore.numFeatures,tilesOfInterest:this.tilesOfInterest,pendingTiles:Array.from(this._pendingTiles.values()).map((e=>e.debugInfo)),storedTiles:this.store.debugInfo}}_process(){this._markTilesNotAlive(),this._createPendingTiles(),this._deletePendingTiles(),this._processPendingTiles()}_markTilesNotAlive(){for(const e of this._pendingTiles.values())e.alive=!1}_createPendingTiles(){if(this.suspended)return;const e=this._collectMissingTilesInfo();if(this._setAvailability(null==e?1:e.coveredArea/e.fullArea),null!=e)for(const{data:t,resolution:s}of e.missingTiles){const e=this._pendingTiles.get(t.id);e?(e.resolution=s,e.alive=!0):this._createPendingTile(t,s)}}_collectMissingTilesInfo(){let e=null;for(const t of this.tilesOfInterest){const s=this.store.process(t,((e,t)=>this._verifyTileComplexity(e,t)),this.outFields);null==e?e=s:e.prepend(s)}return e}_deletePendingTiles(){for(const e of this._pendingTiles.values())e.alive||this._deletePendingTile(e)}_processPendingTiles(){const e={fetchCount:(e,t)=>this._fetchCount(e,t),fetchFeatures:(e,t,s)=>this._fetchFeatures(e,t,s),finish:(e,t)=>this._finishPendingTile(e,t),resume:()=>this._processPendingTiles()};if(this._ensureFetchAllCounts(e))for(const t of this._pendingTiles.values())this._verifyTileComplexity(this.store.getFeatureCount(t.data),t.resolution)&&this._updatingHandles.addPromise(t.process(e))}_verifyTileComplexity(e,t){return this._verifyVertexComplexity(e)&&this._verifyFeatureDensity(e,t)}_verifyVertexComplexity(e){return e*this._minimumVerticesPerFeature<ne}_verifyFeatureDensity(e,t){if(null==this.tileInfo)return!1;const s=this.tileSize*t;return e*(oe/(s*s))<ae}_ensureFetchAllCounts(e){let t=!0;for(const s of this._pendingTiles.values())s.state.type<B.FETCHED_COUNT&&this._updatingHandles.addPromise(s.process(e)),s.state.type<=B.FETCH_COUNT&&(t=!1);return t}_finishPendingTile(e,t){this.store.add(e.data,t),this._deletePendingTile(e),this._updateAvailability()}_updateAvailability(){const e=this._collectMissingTilesInfo();this._setAvailability(null==e?1:e.coveredArea/e.fullArea)}_setAvailability(e){this._set("availability",e)}_createPendingTile(e,t){const s=new ee(e,t);return this._pendingTiles.set(e.id,s),s}_deletePendingTile(e){e.reset(),this._pendingTiles.delete(e.data.id)}async _fetchCount(e,t){return this.store.fetchCount(e.data,this.url,this._createCountQuery(e),{query:this.customParameters,timeout:re,signal:t})}async _fetchFeatures(e,t,s){let i=0;const r=[];let n=0,o=t;for(;;){const a=this._createFeaturesQuery(e),l=this._setPagingParameters(a,i,o),{features:u,exceededTransferLimit:h}=await this._queryFeatures(a,s);l&&(i+=a.num),n+=u.length;for(const e of u)r.push(e);if(o=t-n,!l||!h||o<=0)return r}}_filterProperties(e){return null==e?{where:"1=1",gdbVersion:void 0,timeExtent:void 0}:{where:e.where||"1=1",timeExtent:e.timeExtent,gdbVersion:e.gdbVersion}}_lookupObjectIdByGlobalId(e){const t=this.globalIdField,s=this.objectIdField;if(null==t)throw new Error("Expected globalIdField to be defined");let i=null;const r=e?(0,$.AG)(e):e;if(this.store.featureStore.forEach((e=>{r===(0,$.AG)(e.attributes[t])&&(i=e.objectId??e.attributes[s])})),null==i)throw new Error(`Expected to find a feature with globalId ${e}`);return i}_queryFeaturesById(e,t){const s=this._createFeaturesQuery();return s.objectIds=e,this._queryFeatures(s,t)}_queryFeatures(e,t){return this.capabilities.query.supportsFormatPBF?this._queryFeaturesPBF(e,t):this._queryFeaturesJSON(e,t)}async _queryFeaturesPBF(e,t){const{sourceSpatialReference:s}=this,{data:i}=await(0,X.IJ)(this.url,e,new W.S({sourceSpatialReference:s}),{query:this._configuration.customParameters,timeout:re,signal:t});return(0,K.eY)(i)}async _queryFeaturesJSON(e,t){const{sourceSpatialReference:s}=this,{data:i}=await(0,X.eW)(this.url,e,s,{query:this._configuration.customParameters,timeout:re,signal:t});return(0,K.q3)(i,this.objectIdField)}_createCountQuery(e){const t=this._createBaseQuery(e);return this.capabilities.query.supportsCacheHint&&(t.cacheHint=!0),t}_createFeaturesQuery(e=null){const t=this._createBaseQuery(e),s=null!=e?.data?this.store.getAttributesForTile(e?.data?.id):null,i=(0,V.KC)((0,V.iv)(this.outFields,s??new Set),this._mandatoryOutFields);return t.outFields=Array.from(i),t.returnGeometry=!0,null!=e&&(this.capabilities.query.supportsResultType?t.resultType="tile":this.capabilities.query.supportsCacheHint&&(t.cacheHint=!0)),t}_createBaseQuery(e){const t=new m.A({returnZ:this.hasZ,returnM:!1,historicMoment:this._historicMoment,geometry:null!=this.tileInfo&&null!=e?(0,Q.w1)(e.data.extent,this.tileInfo.spatialReference):void 0}),s=this._configuration.filter;return null!=s&&(t.where=s.where,t.gdbVersion=s.gdbVersion,t.timeExtent=s.timeExtent),t.outSpatialReference=this.spatialReference,t}_setPagingParameters(e,t,s){if(!this.capabilities.query.supportsPagination)return!1;const{supportsMaxRecordCountFactor:i,supportsCacheHint:r,tileMaxRecordCount:n,maxRecordCount:o,supportsResultType:a}=this.capabilities.query,l=i?m.A.MAX_MAX_RECORD_COUNT_FACTOR:1,u=l*((a||r)&&n?n:o||ie);return e.start=t,i?(e.maxRecordCountFactor=Math.min(l,Math.ceil(s/u)),e.num=Math.min(s,e.maxRecordCountFactor*u)):e.num=Math.min(s,u),!0}};(0,i._)([(0,a.MZ)({constructOnly:!0})],se.prototype,"url",void 0),(0,i._)([(0,a.MZ)({constructOnly:!0})],se.prototype,"objectIdField",void 0),(0,i._)([(0,a.MZ)({constructOnly:!0})],se.prototype,"globalIdField",void 0),(0,i._)([(0,a.MZ)({constructOnly:!0})],se.prototype,"capabilities",void 0),(0,i._)([(0,a.MZ)({constructOnly:!0})],se.prototype,"sourceSpatialReference",void 0),(0,i._)([(0,a.MZ)({constructOnly:!0})],se.prototype,"spatialReference",void 0),(0,i._)([(0,a.MZ)({constructOnly:!0})],se.prototype,"store",void 0),(0,i._)([(0,a.MZ)({readOnly:!0})],se.prototype,"_minimumVerticesPerFeature",null),(0,i._)([(0,a.MZ)()],se.prototype,"_mandatoryOutFields",null),(0,i._)([(0,a.MZ)()],se.prototype,"outFields",null),(0,i._)([(0,a.MZ)()],se.prototype,"suspended",void 0),(0,i._)([(0,a.MZ)()],se.prototype,"_historicMoment",void 0),(0,i._)([(0,a.MZ)()],se.prototype,"filter",null),(0,i._)([(0,a.MZ)()],se.prototype,"customParameters",null),(0,i._)([(0,a.MZ)({readOnly:!0})],se.prototype,"_configuration",null),(0,i._)([(0,a.MZ)()],se.prototype,"tileInfo",null),(0,i._)([(0,a.MZ)()],se.prototype,"tileSize",null),(0,i._)([(0,a.MZ)()],se.prototype,"tilesOfInterest",void 0),(0,i._)([(0,a.MZ)({readOnly:!0})],se.prototype,"updating",null),(0,i._)([(0,a.MZ)({readOnly:!0})],se.prototype,"availability",void 0),(0,i._)([(0,a.MZ)()],se.prototype,"hasZ",null),se=(0,i._)([(0,u.$)("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTiledFetcher")],se);const ie=2e3,re=6e5,ne=1e6,oe=25,ae=1;var le=s(71903),ue=s(6518),he=s(72802);class ce{constructor(){this._store=new Map,this._priorities=new Map}get size(){return this._store.size}setPriorityOrderByKey(e){this._priorities.clear();for(let t=e.length-1;t>=0;t--)this._priorities.set(e[t],e.length-t)}hasLowerPriority(e){const t=this._priorities.get(e);if(null==t)return!0;for(const[e]of this._store){const s=this._priorities.get(e);if(null==s||s<t)return!0}return!1}someFromLowestToHighestPriority(e){const{_priorities:t}=this;for(const[s,i]of this._store)if(!t.has(s)&&e(i,s))return!0;for(const[s]of t){const t=this._store.get(s);if(t&&e(t,s))return!0}return!1}set(e,t){this._store.set(e,t)}delete(e){return this._store.delete(e)}get(e){return this._store.get(e)}has(e){return this._store.has(e)}clear(){this._store.clear()}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}}let de=class extends k.A{setPriorityOrderByKey(e){this._tiles.setPriorityOrderByKey(e)}get _memoryLimitExceeded(){return this.featureStore.usedMemory>=this.maximumByteSize}constructor(e){super(e),this.tileInfo=null,this.extent=null,this.maximumByteSize=10*le.u.MEGABYTES,this._tileBounds=new ue.F,this._tiles=new ce,this._refCounts=new Map,this._tileFeatureCounts=new Map,this._tmpBoundingRect=(0,Q.vt)()}add(e,t){for(const e of t)this._referenceFeature(e.objectId);const s=this.featureStore.upsertMany(t),i=s.map((e=>new Set(Object.keys(e.attributes)))).reduce(((e,t)=>(0,V.E$)(e,t)),new Set(Object.keys(s[0]?.attributes??[]))),r=this._memoryLimitExceeded;this._addTileStorage(e,new Set(s.map((e=>e.objectId))),i),r&&this._applyCacheMemoryLimits()}_applyCacheMemoryLimits(){if(!this._memoryLimitExceeded)return;const{_tiles:e,featureStore:t,maximumByteSize:s}=this;e.someFromLowestToHighestPriority((e=>!this._memoryLimitExceeded||t.usedMemory-this._estimateRemoveTileMemoryReduction(e)<s||(this._removeTileStorage(e),!1)))}_estimateRemoveTileMemoryReduction(e){let t=0;for(const s of e.objectIds)if(1===this._refCounts.get(s)){const e=this.featureStore.getFeature(s);e&&(t+=this.featureStore.estimateFeatureUsedMemory?.(e)??0)}return t}getAttributesForTile(e){return e?this._tiles.get(e)?.attributeKeys:null}destroy(){this.clear(),this._tileFeatureCounts.clear()}clear(){this.featureStore.clear(),this._tileBounds.clear(),this._tiles.clear(),this._refCounts.clear()}refresh(){this.clear(),this._tileFeatureCounts.clear()}processEdits(e,t,s){return this._processEditsDelete(e.deletedFeatures.concat(e.updatedFeatures)),this._processEditsRefetch(e.addedFeatures.concat(e.updatedFeatures),t,s)}_addTileStorage(e,t,s){const i=e.id;this._tiles.set(i,new fe(e,t,s)),this._tileBounds.set(i,e.extent),this._tileFeatureCounts.set(i,t.size)}_remove({id:e}){const t=this._tiles.get(e);t&&this._removeTileStorage(t)}_removeTileStorage(e){const t=[];for(const s of e.objectIds)this._unreferenceFeature(s)===ge.REMOVED&&t.push(s);this.featureStore.removeManyById(t);const s=e.data.id;this._tiles.delete(s),this._tileBounds.delete(s)}_processEditsDelete(e){this.featureStore.removeManyById(e);for(const t of this._tiles.values()){for(const s of e)t.objectIds.delete(s);this._tileFeatureCounts.set(t.data.id,t.objectIds.size)}for(const t of e)this._refCounts.delete(t)}async _processEditsRefetch(e,t,s){if(!e.length)return;const i=(await t(e,s)).features,{hasZ:r,hasM:n}=this.featureStore;for(const e of i){const t=(0,K.jQ)(this._tmpBoundingRect,e.geometry,r,n);null!=t&&this._tileBounds.forEachInBounds(t,(t=>{const s=this._tiles.get(t);this.featureStore.add(e);const i=e.objectId;s.objectIds.has(i)||(s.objectIds.add(i),this._referenceFeature(i),this._tileFeatureCounts.set(s.data.id,s.objectIds.size))}))}}process(e,t=()=>!0,s){if(null==this.tileInfo||!e.extent||null!=this.extent&&!(0,Q.HY)((0,Q.VY)(this.extent,this._tmpBoundingRect),e.extent))return new _e(e);if(this._memoryLimitExceeded&&!this._tiles.hasLowerPriority(e.id??""))return new _e(e);const i=this.getAttributesForTile(e.id);if((0,V.Yy)(s,i))return new _e(e);const r=this._createTileTree(e,this.tileInfo);return this._simplify(r,t,null,0,1),this._collectMissingTiles(e,r,this.tileInfo,s)}get debugInfo(){return Array.from(this._tiles.values()).map((({data:e})=>({data:e,featureCount:this._tileFeatureCounts.get(e.id)||0})))}getFeatureCount(e){return this._tileFeatureCounts.get(e.id)??0}async fetchCount(e,t,s,i){const r=this._tileFeatureCounts.get(e.id);if(null!=r)return r;const n=await(0,X.gW)(t,s,i);return this._tileFeatureCounts.set(e.id,n.data.count),n.data.count}_createTileTree(e,t){const s=new pe(e.level,e.row,e.col);return t.updateTileInfo(s,y.A.ExtrapolateOptions.POWER_OF_TWO),this._tileBounds.forEachInBounds(e.extent,(i=>{const r=this._tiles.get(i)?.data;r&&function(e,t){if(!e||!t)return!1;if(e.level===t.level)return e.row===t.row&&e.col===t.col;const s=e.level<t.level,i=s?e:t,r=s?t:e,n=1<<r.level-i.level;return Math.floor(r.row/n)===i.row&&Math.floor(r.col/n)===i.col}(e,r)&&this._populateChildren(s,r,t,this._tileFeatureCounts.get(r.id)||0)})),s}_populateChildren(e,t,s,i){const r=t.level-e.level-1;if(r<0)return void(e.isLeaf=!0);const n=t.row>>r,o=t.col>>r,a=e.row<<1,l=o-(e.col<<1)+(n-a<<1),u=e.children[l];if(null!=u)this._populateChildren(u,t,s,i);else{const r=new pe(e.level+1,n,o);s.updateTileInfo(r,y.A.ExtrapolateOptions.POWER_OF_TWO),e.children[l]=r,this._populateChildren(r,t,s,i)}}_simplify(e,t,s,i,r){const n=r*r;if(e.isLeaf)return t(this.getFeatureCount(e),r)?0:(this._remove(e),null!=s&&(s.children[i]=null),n);const o=r/2,a=o*o;let l=0;for(let s=0;s<e.children.length;s++){const i=e.children[s];l+=null!=i?this._simplify(i,t,e,s,o):a}return 0===l?this._mergeChildren(e):1-l/n<me&&(this._purge(e),null!=s&&(s.children[i]=null),l=n),l}_mergeChildren(e){const t=new Set;let s;this._forEachLeaf(e,(e=>{const i=this._tiles.get(e.id);if(i){s=s?(0,V.E$)(s,i.attributeKeys):new Set(i.attributeKeys);for(const e of i.objectIds)t.has(e)||(t.add(e),this._referenceFeature(e));this._remove(e)}})),this._addTileStorage(e,t,s??new Set),e.isLeaf=!0,e.children[0]=e.children[1]=e.children[2]=e.children[3]=null,this._tileFeatureCounts.set(e.id,t.size)}_forEachLeaf(e,t){for(const s of e.children)null!=s&&(s.isLeaf?t(s):this._forEachLeaf(s,t))}_purge(e){if(null!=e)if(e.isLeaf)this._remove(e);else for(let t=0;t<e.children.length;t++){const s=e.children[t];this._purge(s),e.children[t]=null}}_collectMissingTiles(e,t,s,i){const r=new ye(s,e,this.extent);return this._collectMissingTilesRecurse(t,r,1,i),r.info}_collectMissingTilesRecurse(e,t,s,i){const r=this.getAttributesForTile(e.id),n=r&&!(0,V.Yy)(i,r);if(n&&t.addMissing(e.level,e.row,e.col,s),e.isLeaf)return;if(!e.hasChildren)return void(n||t.addMissing(e.level,e.row,e.col,s));const o=s/2;for(let s=0;s<e.children.length;s++){const r=e.children[s];null==r?t.addMissing(e.level+1,(e.row<<1)+((2&s)>>1),(e.col<<1)+(1&s),o):this._collectMissingTilesRecurse(r,t,o,i)}}_referenceFeature(e){const t=(this._refCounts.get(e)||0)+1;return this._refCounts.set(e,t),1===t?ge.ADDED:ge.UNCHANGED}_unreferenceFeature(e){const t=(this._refCounts.get(e)||0)-1;return 0===t?(this._refCounts.delete(e),ge.REMOVED):(t>0&&this._refCounts.set(e,t),ge.UNCHANGED)}get test(){}};(0,i._)([(0,a.MZ)({constructOnly:!0})],de.prototype,"featureStore",void 0),(0,i._)([(0,a.MZ)()],de.prototype,"tileInfo",void 0),(0,i._)([(0,a.MZ)()],de.prototype,"extent",void 0),(0,i._)([(0,a.MZ)()],de.prototype,"maximumByteSize",void 0),de=(0,i._)([(0,u.$)("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTileStore")],de);class fe{constructor(e,t,s){this.data=e,this.objectIds=t,this.attributeKeys=s}}class pe{constructor(e,t,s){this.level=e,this.row=t,this.col=s,this.isLeaf=!1,this.extent=null,this.children=[null,null,null,null]}get hasChildren(){return!this.isLeaf&&(null!=this.children[0]||null!=this.children[1]||null!=this.children[2]||null!=this.children[3])}}class _e{constructor(e,t=[]){this.missingTiles=t,this.fullArea=0,this.coveredArea=0,this.fullArea=(0,Q.Wc)(e.extent),this.coveredArea=this.fullArea}prepend(e){this.missingTiles=e.missingTiles.concat(this.missingTiles),this.coveredArea+=e.coveredArea,this.fullArea+=e.fullArea}}class ye{constructor(e,t,s){this._tileInfo=e,this._extent=null,this.info=new _e(t),null!=s&&(this._extent=(0,Q.VY)(s))}addMissing(e,t,s,i){const r=new he.U(null,e,t,s);this._tileInfo.updateTileInfo(r,y.A.ExtrapolateOptions.POWER_OF_TWO),null==r.extent||null!=this._extent&&!(0,Q.HY)(this._extent,r.extent)||(this.info.missingTiles.push({data:r,resolution:i}),this.info.coveredArea-=(0,Q.Wc)(r.extent))}}const me=.18751;var ge;!function(e){e[e.ADDED=0]="ADDED",e[e.REMOVED=1]="REMOVED",e[e.UNCHANGED=2]="UNCHANGED"}(ge||(ge={}));let Te=class extends r.A.EventedAccessor{constructor(){super(...arguments),this._isInitializing=!0,this.remoteClient=null,this._whenSetup=(0,n.Tw)(),this._elevationAligner=C(),this._elevationFilter=R(),this._symbologyCandidatesFetcher=j(),this._updatingHandles=new h.U,this._alignPointsInFeatures=async(e,t)=>{const s={query:e},i=await this.remoteClient.invoke("alignElevation",s,{signal:t});return(0,n.Te)(t),i},this._getSymbologyCandidates=async(e,t)=>{const s={candidates:e,spatialReference:this._spatialReference.toJSON()},i=await this.remoteClient.invoke("getSymbologyCandidates",s,{signal:t});return(0,n.Te)(t),i}}get updating(){return this._isInitializing||this._updatingHandles.updating||this._featureFetcher.updating}destroy(){this._featureFetcher?.destroy(),this._queryEngine?.destroy(),this._featureStore?.clear()}async setup(e){if(this.destroyed)return{result:{}};const{geometryType:t,objectIdField:s,timeInfo:i,fieldsIndex:r}=e.serviceInfo,{hasZ:n}=e,a=c.A.fromJSON(e.spatialReference);this._spatialReference=a,this._featureStore=new p.A({...e.serviceInfo,hasZ:n,hasM:!1}),this._featureStore.estimateFeatureUsedMemory=e=>e.usedMemory,this._queryEngine=new _.do({spatialReference:e.spatialReference,featureStore:this._featureStore,geometryType:t,fieldsIndex:r,hasZ:n,hasM:!1,objectIdField:s,timeInfo:i}),this._featureFetcher=new se({store:new de({featureStore:this._featureStore}),url:e.serviceInfo.url,objectIdField:e.serviceInfo.objectIdField,globalIdField:e.serviceInfo.globalIdField,capabilities:e.serviceInfo.capabilities,spatialReference:a,sourceSpatialReference:c.A.fromJSON(e.serviceInfo.spatialReference),customParameters:e.configuration.customParameters});const l="3d"===e.configuration.viewType;return this._elevationAligner=C(l,{elevationInfo:null!=e.elevationInfo?g.A.fromJSON(e.elevationInfo):null,alignPointsInFeatures:this._alignPointsInFeatures}),this._elevationFilter=R(l),this.addHandles([(0,o.wB)((()=>this._featureFetcher.availability),(e=>this.emit("notify-availability",{availability:e})),o.OH),(0,o.wB)((()=>this.updating),(()=>this._notifyUpdating()))]),this._whenSetup.resolve(),this._isInitializing=!1,this.configure(e.configuration)}async configure(e){return await this._updatingHandles.addPromise(this._whenSetup.promise),this._updateFeatureFetcherConfiguration(e),Fe}async setSuspended(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),(0,n.Te)(t),this._featureFetcher.suspended=e,Fe}async updateOutFields(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),(0,n.Te)(t),this._featureFetcher.outFields=new Set(e??[]),Fe}async fetchCandidates(e,t){await this._whenSetup.promise,(0,n.Te)(t);const s=function(e,t){const s=!!t||void 0;if(!e.filter)return{...e,query:{where:"1=1",returnZ:s}};const{distance:i,units:r,spatialRel:n,where:o,timeExtent:a,objectIds:l}=e.filter,u={geometry:e.filter.geometry?(0,d.rS)(e.filter.geometry):void 0,distance:i,units:r,spatialRel:n,timeExtent:a,objectIds:l,returnZ:s,where:o??"1=1"};return{...e,query:u}}(e,this._featureStore.hasZ),i=t?.signal,r=await(0,f.J)(this._queryEngine,s,i);(0,n.Te)(i);const o=await this._elevationAligner.alignCandidates(r.candidates,c.A.fromJSON(e.point.spatialReference)??c.A.WGS84,i);(0,n.Te)(i);const a=await this._symbologyCandidatesFetcher.fetch(o,i);(0,n.Te)(i);const l=0===a.length?o:o.concat(a);return{result:{candidates:this._elevationFilter.filter(s,l)}}}async updateTiles(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),(0,n.Te)(t),this._featureFetcher.tileSize=e.tileSize,this._featureFetcher.tilesOfInterest=e.tiles,this._featureFetcher.tileInfo=null!=e.tileInfo?y.A.fromJSON(e.tileInfo):null,Fe}async refresh(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),(0,n.Te)(t),this._featureFetcher.refresh(),Fe}async whenNotUpdating(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),(0,n.Te)(t),await(0,o.C_)((()=>!this.updating),t),(0,n.Te)(t),Fe}async getDebugInfo(e,t){return(0,n.Te)(t),{result:this._featureFetcher.debugInfo}}async handleEdits(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),(0,n.Te)(t),await this._updatingHandles.addPromise(this._featureFetcher.handleEdits(e)),(0,n.Te)(t),Fe}async setHistoricMoment(e,t){return this._featureFetcher.setHistoricMoment(e.moment),Fe}async notifyElevationSourceChange(e,t){return this._elevationAligner.notifyElevationSourceChange(),Fe}async notifySymbologyChange(e,t){return this._symbologyCandidatesFetcher.notifySymbologyChange(),Fe}async setSymbologySnappingSupported(e){return this._symbologyCandidatesFetcher=j(e,this._getSymbologyCandidates),Fe}_updateFeatureFetcherConfiguration(e){this._featureFetcher.filter=null!=e.filter?m.A.fromJSON(e.filter):null,this._featureFetcher.customParameters=e.customParameters}_notifyUpdating(){this.emit("notify-updating",{updating:this.updating})}};(0,i._)([(0,a.MZ)({readOnly:!0})],Te.prototype,"updating",null),(0,i._)([(0,a.MZ)()],Te.prototype,"_isInitializing",void 0),Te=(0,i._)([(0,u.$)("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceSnappingSourceWorker")],Te);const Ee=Te,Fe={result:{}}},16271:(e,t,s)=>{s.d(t,{Ao:()=>n,KQ:()=>o});var i=s(4576),r=s(31756);function n(e){return 1/(r.j[e]||1)}const o=function(){const e=Object.keys(r.j);return(0,i.TF)(e,"decimal-degrees"),e.sort(),e}()},31756:(e,t,s)=>{s.d(t,{j:()=>n});var i=s(83047),r=s(79258);const n={unknown:1,inches:(0,i.oU)(1,"meters","inches"),feet:(0,i.oU)(1,"meters","feet"),"us-feet":(0,i.oU)(1,"meters","us-feet"),yards:(0,i.oU)(1,"meters","yards"),miles:(0,i.oU)(1,"meters","miles"),"nautical-miles":(0,i.oU)(1,"meters","nautical-miles"),millimeters:(0,i.oU)(1,"meters","millimeters"),centimeters:(0,i.oU)(1,"meters","centimeters"),decimeters:(0,i.oU)(1,"meters","decimeters"),meters:(0,i.oU)(1,"meters","meters"),kilometers:(0,i.oU)(1,"meters","kilometers"),"decimal-degrees":1/(0,i.vl)(1,"meters",r.$O.radius)}},50498:(e,t,s)=>{s.d(t,{Ye:()=>c,gy:()=>h,yR:()=>d});var i=s(66552),r=s(5443),n=s(91075),o=s(48526),a=s(86738),l=s(39829),u=s(82799);const h=(0,i.O)()({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon"}),c=(0,i.O)()({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh"}),d={base:n.A,key:"type",typeMap:{extent:r.A,multipoint:o.A,point:a.A,polyline:u.A,polygon:l.A}}},60999:(e,t,s)=>{s.d(t,{DZ:()=>p,Ke:()=>f,Tj:()=>h,UT:()=>_,jJ:()=>u});var i=s(90237),r=s(69622),n=s(97768),o=s(74887),a=s(10107),l=s(40608);function u(e,t,s){return(0,o.Lx)(e.map(((e,i)=>t.apply(s,[e,i]))))}async function h(e,t,s){return(await(0,o.Lx)(e.map(((e,i)=>t.apply(s,[e,i]))))).map((e=>e.value))}function c(e){return{ok:!0,value:e}}function d(e){return{ok:!1,error:e}}async function f(e){if(null==e)return{ok:!1,error:new Error("no promise provided")};try{return c(await e)}catch(e){return d(e)}}async function p(e){try{return c(await e)}catch(e){return(0,o.QP)(e),d(e)}}function _(e,t){return new y(e,t)}let y=class extends r.A{get value(){return null!=(e=this._result)&&!0===e.ok?e.value:null;var e}get error(){return null!=(e=this._result)&&!1===e.ok?e.error:null;var e}get finished(){return null!=this._result}constructor(e,t){super({}),this._result=null,this._abortHandle=null,this.abort=()=>{this._abortController=(0,n.DC)(this._abortController)},this.remove=this.abort,this._abortController=new AbortController;const{signal:s}=this._abortController;this.promise=e(s),this.promise.then((e=>{this._result=c(e),this._cleanup()}),(e=>{this._result=d(e),this._cleanup()})),this._abortHandle=(0,o.u7)(t,this.abort)}normalizeCtorArgs(){return{}}destroy(){this.abort()}_cleanup(){this._abortHandle=(0,n.xt)(this._abortHandle),this._abortController=null}};(0,i._)([(0,a.MZ)()],y.prototype,"value",null),(0,i._)([(0,a.MZ)()],y.prototype,"error",null),(0,i._)([(0,a.MZ)()],y.prototype,"finished",null),(0,i._)([(0,a.MZ)()],y.prototype,"promise",void 0),(0,i._)([(0,a.MZ)()],y.prototype,"_result",void 0),y=(0,i._)([(0,l.$)("esri.core.asyncUtils.ReactiveTask")],y)},64272:(e,t,s)=>{s.d(t,{T:()=>d});var i,r=s(90237),n=s(25482),o=s(88930),a=s(10107),l=(s(44208),s(53966),s(87811),s(36005)),u=s(40608),h=s(43937),c=s(98623);let d=class extends n.A{static{i=this}static get allTime(){return f}static get empty(){return p}static fromArray(e){return new i({start:null!=e[0]?new Date(e[0]):e[0],end:null!=e[1]?new Date(e[1]):e[1]})}constructor(e){super(e),this.end=null,this.start=null}readEnd(e,t){return null!=t.end?new Date(t.end):null}writeEnd(e,t){t.end=e?.getTime()??null}get isAllTime(){return this.equals(i.allTime)}get isEmpty(){return this.equals(i.empty)}readStart(e,t){return null!=t.start?new Date(t.start):null}writeStart(e,t){t.start=e?.getTime()??null}clone(){return new i({end:this.end,start:this.start})}equals(e){if(!e)return!1;const t=this.start?.getTime()??this.start,s=this.end?.getTime()??this.end,i=e.start?.getTime()??e.start,r=e.end?.getTime()??e.end;return t===i&&s===r}expandTo(e,t=c.qU){if(this.isEmpty||this.isAllTime)return this.clone();let s=this.start;s&&(s=(0,o.lL)(s,e,t));let r=this.end;if(r){const s=(0,o.lL)(r,e,t);r=r.getTime()===s.getTime()?s:(0,o.S1)(s,1,e,t)}return new i({start:s,end:r})}intersection(e){if(!e)return this.clone();if(this.isEmpty||e.isEmpty)return i.empty;if(this.isAllTime)return e.clone();if(e.isAllTime)return this.clone();const t=this.start?.getTime()??-1/0,s=this.end?.getTime()??1/0,r=e.start?.getTime()??-1/0,n=e.end?.getTime()??1/0;let o,a;return r>=t&&r<=s?o=r:t>=r&&t<=n&&(o=t),s>=r&&s<=n?a=s:n>=t&&n<=s&&(a=n),null==o||null==a||isNaN(o)||isNaN(a)?i.empty:new i({start:o===-1/0?null:new Date(o),end:a===1/0?null:new Date(a)})}offset(e,t,s=c.qU){if(this.isEmpty||this.isAllTime)return this.clone();const r=new i,{start:n,end:a}=this;return null!=n&&(r.start=(0,o.S1)(n,e,t,s)),null!=a&&(r.end=(0,o.S1)(a,e,t,s)),r}toArray(){return this.isEmpty?[void 0,void 0]:[this.start?.getTime()??null,this.end?.getTime()??null]}union(e){if(!e||e.isEmpty)return this.clone();if(this.isEmpty)return e.clone();if(this.isAllTime||e.isAllTime)return f.clone();const t=null!=this.start&&null!=e.start?new Date(Math.min(this.start.getTime(),e.start.getTime())):null,s=null!=this.end&&null!=e.end?new Date(Math.max(this.end.getTime(),e.end.getTime())):null;return new i({start:t,end:s})}};(0,r._)([(0,a.MZ)({type:Date,json:{write:{allowNull:!0}}})],d.prototype,"end",void 0),(0,r._)([(0,l.w)("end")],d.prototype,"readEnd",null),(0,r._)([(0,h.K)("end")],d.prototype,"writeEnd",null),(0,r._)([(0,a.MZ)({readOnly:!0,json:{read:!1}})],d.prototype,"isAllTime",null),(0,r._)([(0,a.MZ)({readOnly:!0,json:{read:!1}})],d.prototype,"isEmpty",null),(0,r._)([(0,a.MZ)({type:Date,json:{write:{allowNull:!0}}})],d.prototype,"start",void 0),(0,r._)([(0,l.w)("start")],d.prototype,"readStart",null),(0,r._)([(0,h.K)("start")],d.prototype,"writeStart",null),d=i=(0,r._)([(0,u.$)("esri.time.TimeExtent")],d);const f=new d,p=new d({start:void 0,end:void 0})},71903:(e,t,s)=>{var i;s.d(t,{u:()=>i}),function(e){e[e.KILOBYTES=1024]="KILOBYTES",e[e.MEGABYTES=1048576]="MEGABYTES",e[e.GIGABYTES=1073741824]="GIGABYTES"}(i||(i={}))},88625:(e,t,s)=>{s.d(t,{A:()=>T});var i,r=s(90237),n=s(66552),o=s(25482),a=s(97768),l=s(10107),u=(s(44208),s(53966),s(87811),s(36005)),h=s(40608),c=s(43937),d=s(30524);let f=i=class extends o.A{constructor(e){super(e)}async collectRequiredFields(e,t){return(0,d.Dx)(e,t,this.expression)}clone(){return new i({expression:this.expression,title:this.title})}equals(e){return this.expression===e.expression&&this.title===e.title}};(0,r._)([(0,l.MZ)({type:String,json:{write:{isRequired:!0}}})],f.prototype,"expression",void 0),(0,r._)([(0,l.MZ)({type:String,json:{write:!0}})],f.prototype,"title",void 0),f=i=(0,r._)([(0,h.$)("esri.symbols.support.FeatureExpressionInfo")],f);const p=f;var _,y=s(16271);const m=(0,n.O)()({onTheGround:"on-the-ground",relativeToGround:"relative-to-ground",relativeToScene:"relative-to-scene",absoluteHeight:"absolute-height"}),g=new n.J({foot:"feet",kilometer:"kilometers",meter:"meters",mile:"miles","us-foot":"us-feet",yard:"yards"});let T=class extends o.A{static{_=this}constructor(e){super(e),this.featureExpressionInfo=void 0,this.offset=null}readFeatureExpressionInfo(e,t){return null!=e?e.expression?e:void 0:t.featureExpression&&0===t.featureExpression.value?{expression:"0"}:void 0}writeFeatureExpressionInfo(e,t,s,i){t[s]=e.write({},i),"0"===e.expression&&(t.featureExpression={value:0})}get mode(){const{offset:e,featureExpressionInfo:t}=this;return this._isOverridden("mode")?this._get("mode"):null!=e||t?"relative-to-ground":"on-the-ground"}set mode(e){this._override("mode",e)}set unit(e){this._set("unit",e)}write(e,t){return this.offset||this.mode||this.featureExpressionInfo||this.unit?super.write(e,t):null}clone(){return new _({mode:this.mode,offset:this.offset,featureExpressionInfo:this.featureExpressionInfo?this.featureExpressionInfo.clone():void 0,unit:this.unit})}equals(e){return this.mode===e.mode&&this.offset===e.offset&&this.unit===e.unit&&(0,a.CM)(this.featureExpressionInfo,e.featureExpressionInfo)}};(0,r._)([(0,l.MZ)({type:p,json:{write:!0}})],T.prototype,"featureExpressionInfo",void 0),(0,r._)([(0,u.w)("featureExpressionInfo",["featureExpressionInfo","featureExpression"])],T.prototype,"readFeatureExpressionInfo",null),(0,r._)([(0,c.K)("featureExpressionInfo",{featureExpressionInfo:{type:p},"featureExpression.value":{type:[0]}})],T.prototype,"writeFeatureExpressionInfo",null),(0,r._)([(0,l.MZ)({type:m.apiValues,nonNullable:!0,json:{type:m.jsonValues,read:m.read,write:{writer:m.write,isRequired:!0}}})],T.prototype,"mode",null),(0,r._)([(0,l.MZ)({type:Number,json:{write:!0}})],T.prototype,"offset",void 0),(0,r._)([(0,l.MZ)({type:y.KQ,json:{type:String,read:g.read,write:g.write}})],T.prototype,"unit",null),T=_=(0,r._)([(0,h.$)("esri.symbols.support.ElevationInfo")],T)}}]);