@arcgis/core 5.0.0-next.7 → 5.0.0-next.8

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 (286) hide show
  1. package/applications/KnowledgeStudio/resourceSerializationUtils.js +1 -1
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/{8f56f298e7c1a283f407.js → 0030d68d9edf42b4af57.js} +1 -1
  4. package/assets/esri/core/workers/chunks/01d460398f3ba6767a37.js +1 -0
  5. package/assets/esri/core/workers/chunks/{17d5f8dba6ebb1184506.js → 042cd64e1f4eb326c30f.js} +1 -1
  6. package/assets/esri/core/workers/chunks/05429f9d292a7a714309.js +316 -0
  7. package/assets/esri/core/workers/chunks/{66db5f77e09d25e33951.js → 063905fbf9a0c6586949.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{9486032af3e934d85582.js → 0a5d74414dd02a2fb8e1.js} +1 -1
  9. package/assets/esri/core/workers/chunks/{3815ffa13e7b439bca6e.js → 0d5212f59e9b62c16164.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{73487b9d85e726e9c012.js → 1257c37bf04d39c27b62.js} +1 -1
  11. package/assets/esri/core/workers/chunks/{398f356b11fd33bd3831.js → 136a7d781dad05a7463b.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{1e4e7aedf4b779241a02.js → 15c7c10ff9ac63f0e792.js} +1 -1
  13. package/assets/esri/core/workers/chunks/17784cf16fa91504b9ea.js +1 -0
  14. package/assets/esri/core/workers/chunks/{a395373e3173e6458a56.js → 1ab37e13947d0e2e4181.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{f03635ddf56e2ef90e4c.js → 1d06fcae4c2f02fb1c95.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{020c8913d8e35d63080b.js → 1d15d1b20dc10fde6def.js} +1 -1
  17. package/assets/esri/core/workers/chunks/1dfca37f95f2b968aa54.js +1 -0
  18. package/assets/esri/core/workers/chunks/20975513be0a3a1da286.js +1 -0
  19. package/assets/esri/core/workers/chunks/{285762ff92d5388b6024.js → 2166238a7ad63a2d43c7.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{620a94b54be3ed78350d.js → 22ca80f491e070b2a5e7.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{88074189fa10c335370b.js → 24cd7b84cd0f3de4bff2.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{9fac5a12e878cd745354.js → 28020063048e644f17a5.js} +1 -1
  23. package/assets/esri/core/workers/chunks/{95c594a87b732f5c4979.js → 2a8dff8521e1e6a10cf6.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{7e43c105f1cfc44b7bd0.js → 2fa01bd3f3608616fd7f.js} +1 -1
  25. package/assets/esri/core/workers/chunks/30e220f4f843681a4cdd.js +1 -0
  26. package/assets/esri/core/workers/chunks/{5d3661d1fe46dd29aae9.js → 311b564e44ae637c960d.js} +1 -1
  27. package/assets/esri/core/workers/chunks/31c7ce65e16f7858400f.js +1 -0
  28. package/assets/esri/core/workers/chunks/{8a314b3790313e6dc5db.js → 333b62dad3811cff0f14.js} +1 -1
  29. package/assets/esri/core/workers/chunks/36d067c8d03d7a894f5f.js +1 -0
  30. package/assets/esri/core/workers/chunks/{e31192ae920e3e19b6aa.js → 37c1f155da14de91565a.js} +1 -1
  31. package/assets/esri/core/workers/chunks/{aa54b6f2aba6952af149.js → 38cc18fd93c18815ded0.js} +1 -1
  32. package/assets/esri/core/workers/chunks/{c55c096669677321a227.js → 38cd3648932bf2534b0f.js} +1 -1
  33. package/assets/esri/core/workers/chunks/{ac26e3e77df4302f47a2.js → 3afb83f5de033dda89ec.js} +1 -1
  34. package/assets/esri/core/workers/chunks/{f5e47eea8720ba84665b.js → 3c07aa2015ab1dff5f7b.js} +1 -1
  35. package/assets/esri/core/workers/chunks/{e9311386f58f3cb95c22.js → 42a1e71d09e8583a7327.js} +1 -1
  36. package/assets/esri/core/workers/chunks/443dfe7029ec208f670c.js +1 -0
  37. package/assets/esri/core/workers/chunks/{b75930d60449eceb0f1c.js → 4baf6f6e7ddedb25f806.js} +1 -1
  38. package/assets/esri/core/workers/chunks/{bb5484b5eeacc9ad2ceb.js → 4d0cbf9584446f411a37.js} +1 -1
  39. package/assets/esri/core/workers/chunks/{17103e6542aae53c7301.js → 4e3e27673d0671fc2b58.js} +1 -1
  40. package/assets/esri/core/workers/chunks/{5fc7b61f467f1d60a284.js → 51ab2acac4ecc1ca9c34.js} +1 -1
  41. package/assets/esri/core/workers/chunks/{fc4417d1260b717a9385.js → 52282f767bd0e99ddca0.js} +1 -1
  42. package/assets/esri/core/workers/chunks/{fc06014fb484fc8c697e.js → 53654edd766d9b4ef750.js} +1 -1
  43. package/assets/esri/core/workers/chunks/{90f8b4bda28af43ea019.js → 538f509d7fc8337d37ac.js} +1 -1
  44. package/assets/esri/core/workers/chunks/{ed8a85efbd90241512bb.js → 588533c3abe876f20f62.js} +1 -1
  45. package/assets/esri/core/workers/chunks/{c8733cd621105afab2ac.js → 59d3cac32ad6dad941dc.js} +1 -1
  46. package/assets/esri/core/workers/chunks/{72846fb9c87c6642daf0.js → 5e2ce34def5e053913b2.js} +1 -1
  47. package/assets/esri/core/workers/chunks/{8c056eac35d05d9524b7.js → 5f29422a051311ef9b3c.js} +1 -1
  48. package/assets/esri/core/workers/chunks/5f402b3c00bc4afc77b2.js +1 -0
  49. package/assets/esri/core/workers/chunks/{ff35a077ac6776469805.js → 61d970ed75c2c358b1e9.js} +1 -1
  50. package/assets/esri/core/workers/chunks/{7a6a96edc892d7060b7d.js → 629127877042ad784ad2.js} +1 -1
  51. package/assets/esri/core/workers/chunks/{fd2efd1d1cf9d95a87e6.js → 63a6f3e70d2b6ea57e40.js} +1 -1
  52. package/assets/esri/core/workers/chunks/{90b2b43b8b54c9a1ec35.js → 664ae441617afe4b17ec.js} +1 -1
  53. package/assets/esri/core/workers/chunks/{c4e4da69969499a89a2c.js → 695cdef5057e5461078a.js} +1 -1
  54. package/assets/esri/core/workers/chunks/{4c5a7249a311070d8f43.js → 6af18d7a0d314d7c1756.js} +1 -1
  55. package/assets/esri/core/workers/chunks/{f35aaa04cca676c2d3f8.js → 6b59f94040c7d2f6728a.js} +1 -1
  56. package/assets/esri/core/workers/chunks/{811d4c46c75cf6a63e78.js → 6bb7dbc46787b8e34bd9.js} +1 -1
  57. package/assets/esri/core/workers/chunks/6d9f2b113d6bde936a04.js +1 -0
  58. package/assets/esri/core/workers/chunks/{5132ca68e8c7af111a47.js → 6e22b02a9715c10578d0.js} +1 -1
  59. package/assets/esri/core/workers/chunks/{cd1930f08e1fc8b30b14.js → 6ee2f0f708494102a493.js} +1 -1
  60. package/assets/esri/core/workers/chunks/{f0e0a63962784acb4ba1.js → 6f0aec7428021e440ac9.js} +1 -1
  61. package/assets/esri/core/workers/chunks/{deb2854bb7d082a26f52.js → 7005d956c990a04ee8b2.js} +1 -1
  62. package/assets/esri/core/workers/chunks/{a3991ae8caa713d4ddcd.js → 731f7b552dde0fb325cd.js} +1 -1
  63. package/assets/esri/core/workers/chunks/{464d42bebb365287808d.js → 773f2c6c9d38db76dfed.js} +1 -1
  64. package/assets/esri/core/workers/chunks/{3f3d492f1093b7832aab.js → 7803495f8862d9025bcd.js} +1 -1
  65. package/assets/esri/core/workers/chunks/78694ad8229347903f41.js +1 -0
  66. package/assets/esri/core/workers/chunks/7e4c14d4502e3f06d94b.js +1 -0
  67. package/assets/esri/core/workers/chunks/{7544316a75dbd981aea6.js → 86cb097deec50b0da3f3.js} +1 -1
  68. package/assets/esri/core/workers/chunks/8a40ed2ee4b032822c30.js +1 -0
  69. package/assets/esri/core/workers/chunks/{09de8be660174a229efb.js → 8cbb28476151a37ae958.js} +1 -1
  70. package/assets/esri/core/workers/chunks/{62a49cfd9a2508950e9f.js → 8fedfd33c37172dba6bf.js} +1 -1
  71. package/assets/esri/core/workers/chunks/90cbd627d4113db3b686.js +1 -0
  72. package/assets/esri/core/workers/chunks/91aa1157da32f650983b.js +1 -0
  73. package/assets/esri/core/workers/chunks/{e7638b9ab6674bc8a18f.js → 91dfd29e2dba200eab09.js} +1 -1
  74. package/assets/esri/core/workers/chunks/{794748fd1edc29a621cd.js → 9698f36c143953a975d4.js} +1 -1
  75. package/assets/esri/core/workers/chunks/98584902c9db6faa3e4d.js +1 -0
  76. package/assets/esri/core/workers/chunks/9e5e05d6430712b0b1bc.js +1 -0
  77. package/assets/esri/core/workers/chunks/{6f4bd0ee85e7e5a74340.js → a31635a6366347dcef0f.js} +1 -1
  78. package/assets/esri/core/workers/chunks/a6ee40dfc471d6612f3c.js +1 -0
  79. package/assets/esri/core/workers/chunks/{ccc0da0e01f023c8aa1f.js → a876d6159ca120c1567e.js} +1 -1
  80. package/assets/esri/core/workers/chunks/{a4db5c9a90107e097df8.js → af47272aaaef0ea57e71.js} +1 -1
  81. package/assets/esri/core/workers/chunks/{d1fe816b6990918c13c7.js → afc13d5b842275db7dbc.js} +1 -1
  82. package/assets/esri/core/workers/chunks/aff8e40a641c6822af1d.js +1 -0
  83. package/assets/esri/core/workers/chunks/{22d6b8102e75bdef204c.js → b0365cbc3d2a41969e3b.js} +1 -1
  84. package/assets/esri/core/workers/chunks/{79968c183135281d2a6f.js → b3613a38178cad2ebc82.js} +1 -1
  85. package/assets/esri/core/workers/chunks/b548910e820d731ffe8a.js +1 -0
  86. package/assets/esri/core/workers/chunks/{5bd36dbf46c25bd961c8.js → b708792c84620b73c847.js} +1 -1
  87. package/assets/esri/core/workers/chunks/c29486c4eeb3e72effff.js +1 -0
  88. package/assets/esri/core/workers/chunks/{2b94623cabc6ae0f86ce.js → c37f7756d48ff9af2656.js} +1 -1
  89. package/assets/esri/core/workers/chunks/{1c52999a6392370844a6.js → c4090a60d149a5962179.js} +1 -1
  90. package/assets/esri/core/workers/chunks/{73c1d43070b4fe1e5c1e.js → c8e686efe344a33a0258.js} +1 -1
  91. package/assets/esri/core/workers/chunks/{6bb5158de43c4b59107f.js → c9b16fd41cd59d452522.js} +1 -1
  92. package/assets/esri/core/workers/chunks/ce98416437cc1a89d8ea.js +1 -0
  93. package/assets/esri/core/workers/chunks/{279366e6b743f9680603.js → cfff044859e6e6dcc75d.js} +1 -1
  94. package/assets/esri/core/workers/chunks/d07f911d40bf05fc0306.js +1 -0
  95. package/assets/esri/core/workers/chunks/{8833c3d168951be4bf20.js → d0d79dd3e88eecf5c314.js} +1 -1
  96. package/assets/esri/core/workers/chunks/{76ae1702fecc7ad7017c.js → d1e97cce5047f1791e22.js} +1 -1
  97. package/assets/esri/core/workers/chunks/{17acde0245ecd956306c.js → d233cc33497a663450f9.js} +1 -1
  98. package/assets/esri/core/workers/chunks/{36fe6b8228e622407ec2.js → d8793eead02491136841.js} +1 -1
  99. package/assets/esri/core/workers/chunks/{dedc4583b5f32a278124.js → d88f2fe680b8d5603ef8.js} +1 -1
  100. package/assets/esri/core/workers/chunks/{4d599008e1ea42321b37.js → da24ad57747714ac5eda.js} +1 -1
  101. package/assets/esri/core/workers/chunks/{facb3886714222772ab2.js → ddfd01bb9ba8577c3ffc.js} +1 -1
  102. package/assets/esri/core/workers/chunks/{50d9f69d5255af4b29bb.js → df5afa06c6deb6b40109.js} +1 -1
  103. package/assets/esri/core/workers/chunks/e25c4b4a03270d48f408.js +1 -0
  104. package/assets/esri/core/workers/chunks/e3294318daf1192b8319.js +1 -0
  105. package/assets/esri/core/workers/chunks/{da573ecc68e6aa8f6da9.js → e767f83f9e2de6650f80.js} +1 -1
  106. package/assets/esri/core/workers/chunks/e9d4cae2144974489d6e.js +1 -0
  107. package/assets/esri/core/workers/chunks/{91df8638b8b904e6d8c5.js → ead8d0cbcebd12dbfad7.js} +1 -1
  108. package/assets/esri/core/workers/chunks/{f9324e88c359c03f35aa.js → eb9c166db0db6fa60e95.js} +1 -1
  109. package/assets/esri/core/workers/chunks/{8ffd4710d168c2fcfd96.js → ebf23b46db56aaa88841.js} +1 -1
  110. package/assets/esri/core/workers/chunks/{bc241c7735e4efba734a.js → f34e3fa0c5b28531e289.js} +1 -1
  111. package/assets/esri/core/workers/chunks/f64037a88ab03662dc2a.js +1 -0
  112. package/assets/esri/core/workers/chunks/{d97fadbc69e055d183a0.js → f77f4bd6a577b92cf66f.js} +1 -1
  113. package/assets/esri/core/workers/chunks/{16d66770ef841564ee3f.js → f89c90f98c85667b0ebc.js} +1 -1
  114. package/assets/esri/core/workers/chunks/{4c4227b0ea21a5e429ab.js → fb192de7e4fa152342bb.js} +1 -1
  115. package/assets/esri/core/workers/chunks/fbd8d2f61f8a15bcf3db.js +1 -0
  116. package/assets/esri/core/workers/chunks/{2f78861afe0e9037dd8d.js → fe49321dca22dc60d105.js} +1 -1
  117. package/assets/esri/core/workers/chunks/{fe77ae6cf232a7a3298e.js → fef45bc59c71f88c60b5.js} +1 -1
  118. package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
  119. package/chunks/MultiPathImpl.js +1 -1
  120. package/chunks/Point2D.js +1 -1
  121. package/chunks/UnitFactory.js +1 -1
  122. package/config.js +1 -1
  123. package/core/QueueProcessor.js +1 -1
  124. package/core/SetUtils.js +1 -1
  125. package/core/has.js +1 -1
  126. package/geometry/operators/gx/operatorOffset.js +1 -1
  127. package/geometry/support/meshUtils/loadGLTFMesh.js +1 -1
  128. package/identity/Credential.js +1 -1
  129. package/identity/IdentityManager.js +1 -1
  130. package/identity/IdentityManagerBase.js +1 -1
  131. package/interfaces.d.ts +67 -27
  132. package/kernel.js +1 -1
  133. package/layers/FeatureLayer.js +1 -1
  134. package/layers/SceneLayer.js +1 -1
  135. package/layers/graphics/controllers/FeatureTileController3D.js +1 -1
  136. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  137. package/layers/graphics/sources/connections/GeoEventConnection.js +1 -1
  138. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  139. package/layers/orientedImagery/core/ExposurePoint.js +1 -1
  140. package/layers/support/fieldConfigUtils.js +1 -1
  141. package/layers/support/rasterDatasets/pixelReader.js +1 -1
  142. package/layers/support/source/DataLayerSource.js +1 -1
  143. package/package.json +3 -3
  144. package/popup/FieldInfo.js +1 -1
  145. package/processRequest.js +5 -0
  146. package/request.js +1 -1
  147. package/requestConfig.js +5 -0
  148. package/requestQueue.js +5 -0
  149. package/rest/query/executeForCount.js +1 -1
  150. package/rest/query/executeForExtent.js +1 -1
  151. package/rest/query/executeForIds.js +1 -1
  152. package/rest/query/executeQueryJSON.js +1 -1
  153. package/rest/query/executeQueryPBF.js +1 -1
  154. package/rest/query/operations/query.js +1 -1
  155. package/rest/support/BaseImageMeasureResultValue.js +5 -0
  156. package/rest/support/ImageAreaResult.js +1 -1
  157. package/rest/support/ImageDistanceResult.js +1 -1
  158. package/rest/support/ImageHeightResult.js +1 -1
  159. package/rest/support/ImageMeasureResultAngleValue.js +5 -0
  160. package/rest/support/ImageMeasureResultAreaValue.js +5 -0
  161. package/rest/support/ImageMeasureResultLengthValue.js +5 -0
  162. package/rest/support/ImageWithType.js +5 -0
  163. package/rest/support/imageMeasureUtils.js +1 -1
  164. package/support/revision.js +1 -1
  165. package/views/2d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles2D.js +1 -1
  166. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  167. package/views/2d/layers/features/FeaturePipelineWorker.js +1 -1
  168. package/views/2d/layers/features/schema/SourceSchema.js +1 -1
  169. package/views/2d/layers/features/sources/FeatureSource.js +1 -1
  170. package/views/2d/layers/features/sources/strategies/AFeatureLoadStrategy.js +1 -1
  171. package/views/2d/layers/features/sources/strategies/ALoadStrategy.js +1 -1
  172. package/views/2d/layers/features/sources/strategies/ParquetSnapshotLoadStrategy.js +1 -1
  173. package/views/2d/layers/features/sources/strategies/ParquetTileLoadStrategy.js +1 -1
  174. package/views/2d/layers/features/sources/strategies/chunks/Overrides.js +1 -1
  175. package/views/2d/layers/features/sources/strategies/chunks/SourceChunkStore.js +1 -1
  176. package/views/{3d/support/ImageWithType.js → 2d/layers/features/sources/strategies/constants.js} +1 -1
  177. package/views/2d/layers/features/sources/strategies/support/queryAdapters.js +1 -1
  178. package/views/3d/analysis/Dimension/LengthDimensionSubTool.js +1 -1
  179. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillController.js +1 -1
  180. package/views/3d/analysis/VolumeMeasurement/volumeMeasurementErrors.js +1 -1
  181. package/views/3d/glTF/DefaultLoadingContext.js +1 -1
  182. package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DTool.js +1 -1
  183. package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DTool.js +1 -1
  184. package/views/3d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles3D.js +1 -1
  185. package/views/3d/layers/ElevationLayerView3D.js +1 -1
  186. package/views/3d/layers/FeatureLayerViewBase3D.js +1 -1
  187. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  188. package/views/3d/layers/graphics/FeatureGraphics3DGraphicsPipeline.js +1 -1
  189. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  190. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  191. package/views/3d/layers/graphics/Graphics3DSymbolCreationContext.js +1 -1
  192. package/views/3d/layers/graphics/ObjectResourceCache.js +1 -1
  193. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  194. package/views/3d/layers/graphics/pipeline/Feature3DPipeline.js +1 -1
  195. package/views/3d/layers/graphics/pipeline/fetching/Tile3DFetcher.js +1 -1
  196. package/views/3d/layers/graphics/wosrLoader.js +1 -1
  197. package/views/3d/layers/i3s/I3SDataRequester.js +5 -0
  198. package/views/3d/layers/i3s/I3SIndex.js +1 -1
  199. package/views/3d/layers/i3s/I3SNodeLoader.js +1 -1
  200. package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
  201. package/views/3d/layers/support/FeatureTile.js +1 -1
  202. package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
  203. package/views/3d/layers/support/MediaLayerInteractionOptions.js +1 -1
  204. package/views/3d/layers/support/MediaLayerInteractionReshapeOptions.js +5 -0
  205. package/views/3d/layers/support/SampledGeometryMaxDistanceRatio.js +5 -0
  206. package/views/3d/layers/support/featureTileQuery3D.js +1 -1
  207. package/views/3d/layers/support/fetchTile.js +1 -1
  208. package/views/3d/support/ResourceController.js +1 -1
  209. package/views/3d/support/SharedSymbolResources.js +1 -1
  210. package/views/3d/support/StreamTextureCollection.js +1 -1
  211. package/views/3d/terrain/TerrainSurface.js +1 -1
  212. package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
  213. package/views/3d/webgl-engine/lighting/SceneLighting.js +1 -1
  214. package/views/3d/webgl-engine/shaders/AnimatedLine.glsl.js +6 -0
  215. package/views/SceneView.js +1 -1
  216. package/views/analysis/ElevationProfile/ElevationProfileTool.js +1 -1
  217. package/views/analysis/ElevationProfile/elevationProfileGeometryUtils.js +1 -1
  218. package/views/draw/MultipointDrawAction.js +1 -1
  219. package/views/draw/PointDrawAction.js +1 -1
  220. package/views/draw/PolygonDrawAction.js +1 -1
  221. package/views/draw/PolylineDrawAction.js +1 -1
  222. package/views/draw/SegmentDrawAction.js +1 -1
  223. package/views/draw/input/CursorUpdateEvents.js +5 -0
  224. package/views/draw/input/DrawCompleteEvent.js +5 -0
  225. package/views/draw/input/VertexAddEvent.js +5 -0
  226. package/views/draw/input/VertexRemoveEvent.js +5 -0
  227. package/views/draw/input/VertexUpdateEvent.js +5 -0
  228. package/views/interactive/editGeometry/CheckpointingEditGeometryOperations.js +5 -0
  229. package/views/interactive/editGeometry/EditGeometry.js +1 -1
  230. package/views/interactive/editGeometry/operations/ReplayableAppendVertex.js +5 -0
  231. package/views/interactive/snapping/featureSources/FeatureServiceSnappingSource.js +1 -1
  232. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorkerHandle.js +1 -1
  233. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTileStore.js +1 -1
  234. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiledFetcher.js +1 -1
  235. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTilesSimple.js +1 -1
  236. package/webscene/spec-certification/api.js +1 -1
  237. package/widgets/CoordinateConversion/CoordinateConversionViewModel.js +1 -1
  238. package/widgets/CoordinateConversion.js +1 -1
  239. package/widgets/Editor.js +1 -1
  240. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  241. package/widgets/OrientedImageryViewer/adapters/sketch/TriangulatedMeasurementAdapter.js +1 -1
  242. package/widgets/OrientedImageryViewer/galleryUtils.js +1 -1
  243. package/widgets/PanoramicViewer/PanoramicViewerViewModel.js +1 -1
  244. package/widgets/PanoramicViewer/PanoramicZoomManager.js +1 -1
  245. package/widgets/PanoramicViewer/support/PanoramicMeshManager.js +1 -1
  246. package/widgets/PanoramicViewer/support/PanoramicTileNode.js +1 -1
  247. package/widgets/PanoramicViewer/support/PanoramicTilePyramid.js +1 -1
  248. package/widgets/PanoramicViewer/support/getVisibleTiles.js +5 -0
  249. package/widgets/Sketch/CreateToolVisibilityMap.js +5 -0
  250. package/widgets/Sketch/SelectionToolVisibilityMap.js +5 -0
  251. package/widgets/Sketch/VisibleElements.js +1 -1
  252. package/widgets/Sketch.js +1 -1
  253. package/assets/esri/core/workers/chunks/02e69f0c63d97661da60.js +0 -1
  254. package/assets/esri/core/workers/chunks/05eee334d58a0b9f6316.js +0 -1
  255. package/assets/esri/core/workers/chunks/087973e7c4fea5fcfa5e.js +0 -1
  256. package/assets/esri/core/workers/chunks/326a76a4e80269d4029d.js +0 -1
  257. package/assets/esri/core/workers/chunks/377a66034e7c1bad5599.js +0 -1
  258. package/assets/esri/core/workers/chunks/4442817beb7a76c95770.js +0 -1
  259. package/assets/esri/core/workers/chunks/459a67928bde4a62b6a4.js +0 -1
  260. package/assets/esri/core/workers/chunks/53bd8996e8812f1ad7b2.js +0 -1
  261. package/assets/esri/core/workers/chunks/557960763695abee4a83.js +0 -1
  262. package/assets/esri/core/workers/chunks/6201356f7f91e5c06425.js +0 -1
  263. package/assets/esri/core/workers/chunks/6c3b99209d542efa64d4.js +0 -1
  264. package/assets/esri/core/workers/chunks/7413e582bc2b16af6a0f.js +0 -1
  265. package/assets/esri/core/workers/chunks/7461124454bfb4fb6474.js +0 -1
  266. package/assets/esri/core/workers/chunks/75bf27271a31e26e1b21.js +0 -1
  267. package/assets/esri/core/workers/chunks/7aaaebbabee27690283c.js +0 -1
  268. package/assets/esri/core/workers/chunks/7c4a63aeead2505d6f02.js +0 -1
  269. package/assets/esri/core/workers/chunks/90250e9239c173aace88.js +0 -1
  270. package/assets/esri/core/workers/chunks/9786f91455350eaae493.js +0 -1
  271. package/assets/esri/core/workers/chunks/99859dce1925b406ccd0.js +0 -1
  272. package/assets/esri/core/workers/chunks/9c5cbf8810f37b1a4718.js +0 -1
  273. package/assets/esri/core/workers/chunks/9e8dceef4c961f56940d.js +0 -1
  274. package/assets/esri/core/workers/chunks/a06bac9b8f9e18874de8.js +0 -316
  275. package/assets/esri/core/workers/chunks/a712cdff78fc826acd8c.js +0 -1
  276. package/assets/esri/core/workers/chunks/d305a21666b1ed5bf33d.js +0 -1
  277. package/assets/esri/core/workers/chunks/d40f57f9fc47f9a9f97c.js +0 -1
  278. package/assets/esri/core/workers/chunks/e82f5437bd66779c6740.js +0 -1
  279. package/assets/esri/core/workers/chunks/f4d0ae6be1b3984228d0.js +0 -1
  280. package/assets/esri/core/workers/chunks/f6c8beb60f6d29945a2e.js +0 -1
  281. package/assets/esri/core/workers/chunks/f746e3f7ebff2bbdf333.js +0 -1
  282. package/views/3d/layers/i3s/I3SStreamDataController.js +0 -5
  283. package/views/3d/support/StreamDataLoader.js +0 -5
  284. package/views/3d/support/StreamDataRequester.js +0 -5
  285. package/views/3d/support/downloadSlots.js +0 -5
  286. package/views/draw/input/DrawEvents.js +0 -5
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3693],{3693:(e,t,n)=>{n.r(t),n.d(t,{registerFunctions:()=>_e});var r=n(52106),i=n(66131),a=n(47609),s=n(66395),o=n(59534),l=n(85935),u=n(93833),d=n(47423),c=n(93818),f=n(78878),p=n(80672),h=n(48938),m=n(78502),y=n(87449),g=n(11221),w=n(33325),I=n(80609),F=n(1262),b=n(88368),A=n(16930);class N{constructor(e){this.field=e,this.sqlRewritable=!1}postInitialization(e,t){}}class S extends N{constructor(e){super(e),this.sqlRewritable=!0}extractValue(e){return e.attributes[this.field.name]}rewriteSql(e){return{rewritten:this.sqlRewritable,where:e}}}class T extends N{constructor(e,t,n){super((0,w.ke)(e)),this.originalField=e,this.sqlRewritable=!0,this.field.name=t,this.field.alias=n}rewriteSql(e,t){return{rewritten:this.sqlRewritable,where:(0,I.bD)(e,this.field.name,this.originalField.name,t.getFieldsIndex())}}extractValue(e){return e.attributes[this.originalField.name]}}class _ extends N{constructor(e,t,n){super(e),this.codefield=t,this.lkp=n,this.reverseLkp={};for(const e in n)this.reverseLkp[n[e]]=e;this.sqlRewritable=!0}static{this.BADNESS="_!!!_BAD_LKP_!!!!"}rewriteSql(e,t){const n=this.evaluateNodeToWhereClause(e.parseTree,0,this.field.name,this.codefield instanceof b.A?(0,I.YY)(this.codefield,0):this.codefield,e.parameters);return n.includes(_.BADNESS)?{rewritten:!1,where:e}:{rewritten:this.sqlRewritable,where:b.A.create(n,{fieldsIndex:t._parent.getFieldsIndex(),timeZone:t.dateFieldsTimeZoneDefaultUTC})}}evaluateNodeToWhereClause(e,t,n=null,r=null,i){let a,s,o,l;switch(e.type){case"interval":return(0,I.oj)(this.evaluateNodeToWhereClause(e.value,t,n,r,i),e.qualifier,e.op);case"case-expression":{let r=" CASE ";"simple"===e.format&&(r+=this.evaluateNodeToWhereClause(e.operand,t,n,_.BADNESS,i));for(let a=0;a<e.clauses.length;a++)r+=" WHEN "+this.evaluateNodeToWhereClause(e.clauses[a].operand,t,n,_.BADNESS,i)+" THEN "+this.evaluateNodeToWhereClause(e.clauses[a].value,t,n,_.BADNESS,i);return null!==e.else&&(r+=" ELSE "+this.evaluateNodeToWhereClause(e.else,t,n,_.BADNESS,i)),r+=" END ",r}case"parameter":{const n=i[e.value.toLowerCase()];if("string"==typeof n)return"'"+n.toString().replaceAll("'","''")+"'";if((0,w.$P)(n))return(0,I.bm)(n,t);if((0,w.Lk)(n))return(0,I.bm)(n,t);if((0,w.eg)(n))return(0,I.F1)(n,t);if((0,w.rX)(n))return(0,I.R8)(n,t);if((0,w.f0)(n))return(0,I.Nf)(n,t);if(Array.isArray(n)){const e=[];for(let r=0;r<n.length;r++)"string"==typeof n[r]?e.push("'"+n[r].toString().replaceAll("'","''")+"'"):(0,w.$P)(n[r])||(0,w.Lk)(n[r])?e.push((0,I.bm)(n[r],t)):(0,w.eg)(n[r])?e.push((0,I.F1)(n[r],t)):(0,w.rX)(n[r])?e.push((0,I.R8)(n[r],t)):(0,w.f0)(n[r])?e.push((0,I.Nf)(n[r],t)):e.push(n[r].toString());return e}return n.toString()}case"expression-list":s=[];for(const a of e.value)s.push(this.evaluateNodeToWhereClause(a,t,n,r,i));return s;case"unary-expression":return" ( NOT "+this.evaluateNodeToWhereClause(e.expr,t,n,_.BADNESS,i)+" ) ";case"binary-expression":switch(e.operator){case"AND":return" ("+this.evaluateNodeToWhereClause(e.left,t,n,r,i)+" AND "+this.evaluateNodeToWhereClause(e.right,t,n,r,i)+") ";case"OR":return" ("+this.evaluateNodeToWhereClause(e.left,t,n,r,i)+" OR "+this.evaluateNodeToWhereClause(e.right,t,n,r,i)+") ";case"IS":if("null"!==e.right.type)throw new F.L("UnsupportedIsRhs");return" ("+this.evaluateNodeToWhereClause(e.left,t,n,r,i)+" IS NULL )";case"ISNOT":if("null"!==e.right.type)throw new F.L("UnsupportedIsRhs");return" ("+this.evaluateNodeToWhereClause(e.left,t,n,r,i)+" IS NOT NULL )";case"IN":if(a=[],"expression-list"===e.right.type){if("column-reference"===e.left.type&&e.left.column.toUpperCase()===this.field.name.toUpperCase()){const a=[];let s=!0;for(const t of e.right.value){if("string"!==t.type){s=!1;break}if(void 0===this.lkp[t.value]){s=!1;break}a.push(this.lkp[t.value].toString())}if(s)return" ("+this.evaluateNodeToWhereClause(e.left,t,n,r,i)+" IN ("+a.join(",")+")) "}return a=this.evaluateNodeToWhereClause(e.right,t,n,r,i)," ("+this.evaluateNodeToWhereClause(e.left,t,n,r,i)+" IN ("+a.join(",")+")) "}return l=this.evaluateNodeToWhereClause(e.right,t,n,r,i),Array.isArray(l)?" ("+this.evaluateNodeToWhereClause(e.left,t,n,r,i)+" IN ("+l.join(",")+")) ":" ("+this.evaluateNodeToWhereClause(e.left,t,n,r,i)+" IN ("+l+")) ";case"NOT IN":if(a=[],"expression-list"===e.right.type){if("column-reference"===e.left.type&&e.left.column.toUpperCase()===this.field.name.toUpperCase()){const a=[];let s=!0;for(const t of e.right.value){if("string"!==t.type){s=!1;break}if(void 0===this.lkp[t.value]){s=!1;break}a.push(this.lkp[t.value].toString())}if(s)return" ("+this.evaluateNodeToWhereClause(e.left,t,n,r,i)+" NOT IN ("+a.join(",")+")) "}return a=this.evaluateNodeToWhereClause(e.right,t,n,r,i)," ("+this.evaluateNodeToWhereClause(e.left,t,n,r,i)+" NOT IN ("+a.join(",")+")) "}return l=this.evaluateNodeToWhereClause(e.right,t,n,r,i),Array.isArray(l)?" ("+this.evaluateNodeToWhereClause(e.left,t,n,r,i)+" NOT IN ("+l.join(",")+")) ":" ("+this.evaluateNodeToWhereClause(e.left,t,n,r,i)+" NOT IN ("+l+")) ";case"BETWEEN":return o=this.evaluateNodeToWhereClause(e.right,t,n,_.BADNESS,i)," ("+this.evaluateNodeToWhereClause(e.left,t,n,_.BADNESS,i)+" BETWEEN "+o[0]+" AND "+o[1]+" ) ";case"NOTBETWEEN":return o=this.evaluateNodeToWhereClause(e.right,t,n,_.BADNESS,i)," ("+this.evaluateNodeToWhereClause(e.left,t,n,_.BADNESS,i)+" NOT BETWEEN "+o[0]+" AND "+o[1]+" ) ";case"LIKE":return""!==e.escape?" ("+this.evaluateNodeToWhereClause(e.left,t,n,_.BADNESS,i)+" LIKE "+this.evaluateNodeToWhereClause(e.right,t,n,_.BADNESS,i)+" ESCAPE '"+e.escape+"') ":" ("+this.evaluateNodeToWhereClause(e.left,t,n,_.BADNESS,i)+" LIKE "+this.evaluateNodeToWhereClause(e.right,t,n,_.BADNESS,i)+") ";case"NOT LIKE":return""!==e.escape?" ("+this.evaluateNodeToWhereClause(e.left,t,n,_.BADNESS,i)+" NOT LIKE "+this.evaluateNodeToWhereClause(e.right,t,n,_.BADNESS,i)+" ESCAPE '"+e.escape+"') ":" ("+this.evaluateNodeToWhereClause(e.left,t,n,_.BADNESS,i)+" NOT LIKE "+this.evaluateNodeToWhereClause(e.right,t,n,_.BADNESS,i)+") ";case"<>":case"=":if("column-reference"===e.left.type&&"string"===e.right.type){if(e.left.column.toUpperCase()===this.field.name.toUpperCase()&&void 0!==this.lkp[e.right.value.toString()])return" ("+r+" "+e.operator+" "+this.lkp[e.right.value.toString()].toString()+") "}else if("column-reference"===e.right.type&&"string"===e.left.type&&e.right.column.toUpperCase()===this.field.name.toUpperCase())return" ("+this.lkp[e.right.value.toString()].toString()+" "+e.operator+" "+r+") ";return" ("+this.evaluateNodeToWhereClause(e.left,t,n,_.BADNESS,i)+" "+e.operator+" "+this.evaluateNodeToWhereClause(e.right,t,n,_.BADNESS,i)+") ";case"<":case">":case">=":case"<=":case"*":case"-":case"+":case"/":case"||":return" ("+this.evaluateNodeToWhereClause(e.left,t,n,_.BADNESS,i)+" "+e.operator+" "+this.evaluateNodeToWhereClause(e.right,t,n,_.BADNESS,i)+") "}case"null":return"null";case"boolean":return!0===e.value?"1":"0";case"string":return"'"+e.value.toString().replaceAll("'","''")+"'";case"timestamp":return`timestamp '${e.value}'`;case"date":return`date '${e.value}'`;case"time":return`time '${e.value}'`;case"number":return e.value.toString();case"current-time":return(0,I.C6)(e.mode,t);case"current-user":return"CURRENT_USER";case"column-reference":return n&&n.toLowerCase()===e.column.toLowerCase()?"("+r+")":(0,I.Kb)(e.column);case"data-type":return e.value;case"function":{const r=this.evaluateNodeToWhereClause(e.args,t,n,_.BADNESS,i);return(0,I.F6)(e.name,r,t)}}throw new F.L("UnsupportedSyntax",{node:e.type})}extractValue(e){if(this.codefield instanceof b.A){const t=this.codefield.calculateValueCompiled(e);return this.reverseLkp[b.A.convertValueToStorageFormat(t)]}return this.reverseLkp[e.attributes[this.codefield]]}}class C extends N{constructor(e,t){super(e),this._sql=t}rewriteSql(e,t){return{rewritten:!0,where:(0,I.bD)(e,this.field.name,(0,I.YY)(this._sql,0),t.getFieldsIndex())}}extractValue(e){return b.A.convertValueToStorageFormat(this._sql.calculateValueCompiled(e),this.field.type)}}class v extends g.t{static findField(e,t){for(const n of e)if(n.name.toLowerCase()===t.toString().toLowerCase())return n;return null}constructor(e){super(e),this.declaredClass="esri.arcade.featureset.actions.Adapted",this.adaptedFields=[],this._extraFilter=null,this._extraFilter=e.extraFilter,this._parent=e.parentfeatureset,this._maxProcessing=30,this.adaptedFields=e.adaptedFields}_initialiseFeatureSet(){null!==this._parent?(this.geometryType=this._parent.geometryType,this.objectIdField=this._parent.objectIdField,this.globalIdField=this._parent.globalIdField,this.spatialReference=this._parent.spatialReference,this.hasM=this._parent.hasM,this.hasZ=this._parent.hasZ,this.typeIdField=this._parent.typeIdField,this.types=this._parent.types):(this.spatialReference=new A.A({wkid:4326}),this.objectIdField="",this.globalIdField="",this.geometryType=w.ik.point,this.typeIdField="",this.types=null,this.subtypeField=null,this.subtypes=null),this.fields=[];for(const e of this.adaptedFields)e.postInitialization(this,this._parent),this.fields.push(e.field)}async _queryAll(){return await this._ensureLoaded(),this._extraFilter?(await this.query({abortSignal:h._})).features:this._calculateFields(await this._parent.queryAll(h._))}async query(e){let t=!1,n=e.where??null;const r=this._reformulateWithoutAdaptions(n);t=r.cannot,n=r.where;let i=!1,a=e.orderBy;if(null!=a){i=!0;const e=[];for(const t of this.adaptedFields)if(!(t instanceof S)&&!0===a.scanForField(t.field.name)){if(!(t instanceof T)){a=null,i=!1;break}e.push({field:t.field.name,newfield:t.originalField.name})}a&&e.length>0&&(a=a.replaceFields(e))}null!=n?null!=this._extraFilter&&(n=(0,I.kg)(this._extraFilter,n)):n=this._extraFilter,await this._ensureLoaded();const s=await this._parent.query({...e,where:n,orderBy:a});return(0,y.dZ)(e.abortSignal),!0===t?{...s,filterApplied:!1,ordered:!0===i&&s.ordered,features:this._calculateFields(s.features)}:{...s,ordered:!0===i&&s.ordered,features:this._calculateFields(s.features)}}async*_calculateFields(e){for await(const t of e)yield t.map(e=>{const t={};for(const n of this.adaptedFields)t[n.field.name]=n.extractValue(e);return new r.A({attributes:t,geometry:(0,m.Yq)(e.geometry)})})}async queryStat(e){let t=!1,n=e.field,r=this._reformulateWithoutAdaptions(n);t=r.cannot,n=r.where;let i=e.where??null;if(r=this._reformulateWithoutAdaptions(i),t=t||r.cannot,i=r.where,null!=i?null!==this._extraFilter&&(i=(0,I.kg)(this._extraFilter,i)):i=this._extraFilter,!0===t)return null==i&&null==e.spatialFilter?this._manualStat(e.stat,n,e.limit??w.gO,e.abortSignal):{calculated:!1};const a=await this._parent.queryStat({...e,field:n,where:i});return!1===a.calculated?null==i&&null==e.spatialFilter?this._manualStat(e.stat,n,e.limit??w.gO,e.abortSignal):{calculated:!1}:a}async canQueryAggregate(e){if(null===this._parent)return!1;for(let t=0;t<e.groupBy.length;t++)for(const n of this.adaptedFields)if(e.groupBy[t].toLowerCase()===n.field.name.toLowerCase()&&!(n instanceof S))return!1;const t=[];for(let n=0;n<e.statistics.length;n++){const r=e.statistics[n];if(null!==r.workingexpr){const e=this._reformulateWithoutAdaptions(r.workingexpr);if(e.cannot)return!1;const n=r.clone();n.workingexpr=e.where,t.push(n)}else t.push(r)}let n=e.where??null;const r=this._reformulateWithoutAdaptions(n);return!r.cannot&&(n=r.where,null!==n?null!==this._extraFilter&&(n=(0,I.kg)(this._extraFilter,n)):n=this._extraFilter,this._parent.canQueryAggregate({...e,statistics:t,where:n}))}async queryAggregate(e){if(null===this._parent)throw new y.dr("NeverReach");const t=[];for(let n=0;n<e.statistics.length;n++){const r=e.statistics[n];if(null!==r.workingexpr){const e=this._reformulateWithoutAdaptions(r.workingexpr);if(e.cannot)throw new y.dr("NeverReach");const n=r.clone();n.workingexpr=e.where,t.push(n)}else t.push(r)}let n=e.where??null;const r=this._reformulateWithoutAdaptions(n);if(r.cannot)throw new y.dr("NeverReach");return n=r.where,null!==n?null!==this._extraFilter&&(n=(0,I.kg)(this._extraFilter,n)):n=this._extraFilter,this._parent.queryAggregate({...e,statistics:t,where:n})}_reformulateWithoutAdaptions(e){const t={cannot:!1,where:e};if(null!==e)for(const n of this.adaptedFields)if(!0===(0,I.Ju)(e,n.field.name)){const r=n.rewriteSql(e,this);if(!0!==r.rewritten){t.cannot=!0,t.where=null;break}t.where=r.where}return t}}var x=n(35704),D=n(4576);class E extends g.t{constructor(e){super(e),this.declaredClass="esri.arcade.featureset.actions.OrderBy",this._maxProcessing=100,this._orderbyclause=e.orderbyclause,this._parent=e.parentfeatureset}async _queryAll(){return(await this.query({abortSignal:h._})).features}async query(e){await this._ensureLoaded();const t=await this._parent.query({...e,orderBy:null==e.orderBy?this._orderbyclause:e.orderBy});return(0,y.dZ)(e.abortSignal),!1===t.ordered?{...t,ordered:!0,features:this._sortFeatures(t.features,e.abortSignal)}:t}async*_sortFeatures(e,t){const n=[];for await(const r of e)n.push(r),await(0,f.a2)(),(0,y.dZ)(t);const r=n.flat();this._orderbyclause.order(r);for(const e of(0,D.Ho)(r,this._maxQueryRate()))yield e}async queryStat(e){const t=await this._parent.queryStat(e);return!1===t.calculated?null==e.where&&null==e.spatialFilter?this._manualStat(e.stat,e.field,e.limit??w.gO,e.abortSignal):{calculated:!1}:t}async canQueryAggregate(e){return this._parent.canQueryAggregate(e)}async queryAggregate(e){return this._parent.queryAggregate(e)}getFieldsIndex(){return this._parent.getFieldsIndex()}}function k(e,t){return e===t?0:null===e?-1:null===t?1:e<t?-1:1}class L{constructor(e){const t=e.split(",");this._fields=[],this._directions=[];for(let e=0;e<t.length;e++){const n=t[e].match(/\S+/g);this._fields.push(n[0]),2===n.length?"asc"===n[1].toLowerCase()?this._directions.push(1):this._directions.push(0):this._directions.push(1)}}constructClause(){let e="";for(let t=0;t<this._fields.length;t++)0!==t&&(e+=","),e+=this._fields[t],1===this._directions[t]?e+=" ASC":e+=" DESC";return e}order(e){e.sort((e,t)=>{for(let n=0;n<this._fields.length;n++){const r=this.featureValue(e,this._fields[n],n),i=this.featureValue(t,this._fields[n],n);let a=0;if(a=1===this._directions[n]?k(r,i):-1*k(r,i),0!==a)return a}return 0})}scanForField(e){for(let t=0;t<this._fields.length;t++)if(this._fields[t].toLowerCase().trim()===e.toLowerCase().trim())return!0;return!1}replaceFields(e){let t="";for(let n=0;n<this._fields.length;n++){0!==n&&(t+=",");let r=this._fields[n];for(const t of e)if(r.toLowerCase()===t.field.toLowerCase()){r=t.newfield;break}t+=r,1===this._directions[n]?t+=" ASC":t+=" DESC"}return new L(t)}featureValue(e,t,n){const r=e.attributes[t];if(void 0!==r)return r;for(const r in e.attributes)if(t.toLowerCase()===r.toLowerCase())return this._fields[n]=r,e.attributes[r];return null}}class U{constructor(){this.field="",this.tofieldname="",this.typeofstat="MIN",this.workingexpr=null}clone(){const e=new U;return e.field=this.field,e.tofieldname=this.tofieldname,e.typeofstat=this.typeofstat,e.workingexpr=this.workingexpr,e}static parseStatField(e,t,n,r){const i=new U;i.field=e;const a=b.A.create(t,{fieldsIndex:n,timeZone:r}),s=function(e){if("function"===e.parseTree.type){if(0===e.parseTree.args.value.length)return{name:e.parseTree.name,expr:null};if(e.parseTree.args.value.length>1)throw new F.L("MissingStatisticParameters");const t=b.A.create((0,I.Mi)(e.parseTree.args.value[0],0,e.parameters),{fieldsIndex:e.fieldsIndex,timeZone:e.timeZone,currentUser:e.currentUser});return{name:e.parseTree.name,expr:t}}return null}(a);if(null===s)throw new F.L("UnsupportedSqlFunction",{function:""});const o=s.name.toUpperCase().trim();if("MIN"===o){if(i.typeofstat="MIN",i.workingexpr=s.expr,null===a)throw new F.L("InvalidFunctionParameters",{function:"min"})}else if("MAX"===o){if(i.typeofstat="MAX",i.workingexpr=s.expr,null===a)throw new F.L("InvalidFunctionParameters",{function:"max"})}else if("COUNT"===o)i.typeofstat="COUNT",i.workingexpr=s.expr;else if("STDEV"===o){if(i.typeofstat="STDDEV",i.workingexpr=s.expr,null===a)throw new F.L("InvalidFunctionParameters",{function:"stdev"})}else if("SUM"===o){if(i.typeofstat="SUM",i.workingexpr=s.expr,null===a)throw new F.L("InvalidFunctionParameters",{function:"sum"})}else if("MEAN"===o){if(i.typeofstat="AVG",i.workingexpr=s.expr,null===a)throw new F.L("InvalidFunctionParameters",{function:o})}else if("AVG"===o){if(i.typeofstat="AVG",i.workingexpr=s.expr,null===a)throw new F.L("InvalidFunctionParameters",{function:"avg"})}else{if("VAR"!==o)throw new F.L("UnsupportedSqlFunction",{function:o});if(i.typeofstat="VAR",i.workingexpr=s.expr,null===a)throw new F.L("InvalidFunctionParameters",{function:"var"})}return i}toStatisticsName(){switch(this.typeofstat.toUpperCase()){case"MIN":return"min";case"MAX":return"max";case"SUM":return"sum";case"COUNT":default:return"count";case"VAR":return"var";case"STDDEV":return"stddev";case"AVG":return"avg"}}}var j=n(80200),$=n(74639),Z=n(44729),M=n(55612),W=n(15032),R=n(20437),B=n(95466);const q=new o.b(["MIN","MAX","VAR","STDDEV","COUNT","SUM","AVG"],[["VARIANCE","VAR"],["AVERAGE","AVG"],["MEAN","AVG"],["STDEV","STDDEV"]]);class P extends g.t{constructor(e){super(e),this._decodedStatsfield=[],this._decodedGroupbyfield=[],this._candosimplegroupby=!0,this.phsyicalgroupbyfields=[],this.objectIdField="ROW__ID",this._internalObjectIdField="ROW__ID",this._adaptedFields=[],this.declaredClass="esri.arcade.featureset.actions.Aggregate",this._uniqueIds=1,this._maxQuery=10,this._maxProcessing=10,this._parent=e.parentfeatureset,this._config=e}isTable(){return!0}_nextUniqueName(e){for(;1===e["T"+this._uniqueIds.toString()];)this._uniqueIds++;const t="T"+this._uniqueIds.toString();return e[t]=1,t}_convertToEsriFieldType(e){return e}_initialiseFeatureSet(){const e={};let t=!1,n=1;const r=this._parent?this._parent.getFieldsIndex():new B.A([]);for(this.objectIdField="ROW__ID",this.globalIdField="";!1===t;){let e=!1;for(let t=0;t<this._config.groupbyfields.length;t++)if(this._config.groupbyfields[t].name.toLowerCase()===this.objectIdField.toLowerCase()){e=!0;break}if(!1===e)for(let t=0;t<this._config.statsfields.length;t++)if(this._config.statsfields[t].name.toLowerCase()===this.objectIdField.toLowerCase()){e=!0;break}!1===e?t=!0:(this.objectIdField="ROW__ID"+n.toString(),n++)}for(const e of this._config.statsfields){const t=new U;t.field=e.name,t.tofieldname=e.name,t.workingexpr=e.expression instanceof b.A?e.expression:b.A.create(e.expression,{fieldsIndex:r,timeZone:this.dateFieldsTimeZoneDefaultUTC}),t.typeofstat=q.lookup(e.statistic)??"COUNT",this._decodedStatsfield.push(t)}this._decodedGroupbyfield=[];for(const e of this._config.groupbyfields){const t={name:e.name,singlefield:null,tofieldname:e.name,expression:e.expression instanceof b.A?e.expression:b.A.create(e.expression,{fieldsIndex:r,timeZone:this.dateFieldsTimeZoneDefaultUTC}),sqlType:null};this._decodedGroupbyfield.push(t)}if(null!==this._parent){this.geometryType=this._parent.geometryType,this.spatialReference=this._parent.spatialReference,this.hasM=this._parent.hasM,this.hasZ=this._parent.hasZ,this.typeIdField="";for(const t of this._parent.fields)e[t.name.toUpperCase()]=1;this.types=null,this.subtypes=null,this.subtypeField=""}else this.geometryType=w.ik.point,this.typeIdField="",this.types=null,this.subtypes=null,this.subtypeField="",this.spatialReference=new A.A({wkid:4326});this.fields=[];const i=new U;i.field=this._nextUniqueName(e),i.tofieldname=this.objectIdField,i.workingexpr=b.A.create(this._parent.objectIdField,{fieldsIndex:this._parent.getFieldsIndex(),timeZone:this.dateFieldsTimeZoneDefaultUTC}),i.typeofstat="MIN",this._decodedStatsfield.push(i);for(const t of this._decodedGroupbyfield){const n=new R.A;if(t.name=this._nextUniqueName(e),n.name=t.tofieldname,n.alias=n.name,(0,I.DA)(t.expression)){const e=this._parent.getField((0,I.YY)(t.expression,0));if(!e)throw new y.dr("AggregationFieldNotFound");t.name=e.name,t.singlefield=e.name,this.phsyicalgroupbyfields.push(e.name),n.type=e.type,t.sqlType=e.type}else{n.type=this._convertToEsriFieldType((0,I.IY)(t.expression,this._parent.fields));const e=new R.A;e.name=t.name,e.alias=e.name,this.phsyicalgroupbyfields.push(t.name),this._adaptedFields.push(new C(e,t.expression)),this._candosimplegroupby=!1,t.sqlType=n.type}this.fields.push(n)}if(this._adaptedFields.length>0)for(const e of this._parent.fields)this._adaptedFields.push(new S(e));for(let t=0;t<this._decodedStatsfield.length;t++){const n=new R.A;let r=null;const i=this._decodedStatsfield[t];i.field=this._nextUniqueName(e),i.tofieldname===this.objectIdField&&(this._internalObjectIdField=i.field),n.name=i.tofieldname,n.alias=n.name;const a=null!==i.workingexpr&&(0,I.DA)(i.workingexpr)?(0,I.YY)(i.workingexpr,0):"";switch(this._decodedStatsfield[t].typeofstat){case"SUM":if(""!==a){if(r=this._parent.getField(a),!r)throw new y.dr("AggregationFieldNotFound");n.type=r.type}else n.type="double";break;case"MIN":case"MAX":if(""!==a){if(r=this._parent.getField(a),!r)throw new y.dr("AggregationFieldNotFound");n.type=r.type}else n.type="double";break;case"COUNT":n.type="integer";break;case"STDDEV":case"VAR":case"AVG":if(""!==a&&(r=this._parent.getField(a),!r))throw new y.dr("AggregationFieldNotFound");n.type="double"}this.fields.push(n)}}async _queryAll(){return(await this.query({abortSignal:h._})).features}async query(e){if(null!=e.spatialFilter)return g.A;const t={ordered:!1,nowhereclause:!1};await this._ensureLoaded();let n=e.where;if(null!=n)for(let e=0;e<this._decodedStatsfield.length;e++)if(!0===(0,I.Ju)(n,this._decodedStatsfield[e].tofieldname)){t.nowhereclause=!0,n=null;break}let r=e.orderBy;if(null!=r){t.ordered=!0;for(let e=0;e<this._decodedStatsfield.length;e++)if(!0===r.scanForField(this._decodedStatsfield[e].tofieldname)){r=null,t.ordered=!1;break}if(null!==r)for(const e of this._decodedGroupbyfield)if(null===e.singlefield&&!0===r.scanForField(e.tofieldname)){r=null,t.ordered=!1;break}}if(!1!==this._candosimplegroupby&&await this._parent.canQueryAggregate({groupBy:this.phsyicalgroupbyfields,statistics:this._decodedStatsfield,where:null,spatialFilter:null,abortSignal:e.abortSignal})){let i=null;n&&(i=this._reformulateWhereClauseWithoutGroupByFields(n));let a=null;r&&(a=this._reformulateOrderClauseWithoutGroupByFields(r));const s=await this._parent.queryAggregate({groupBy:this.phsyicalgroupbyfields,statistics:this._decodedStatsfield,where:i,spatialFilter:null,orderBy:a,abortSignal:e.abortSignal});return(0,y.dZ)(e.abortSignal),{...s,filterApplied:!t.nowhereclause&&s.filterApplied,ordered:!0===t.ordered&&s.ordered,features:this._fixAggregateAttributeNames(s.features)}}let i=this._parent;if(this._adaptedFields.length>0&&(i=new v({parentfeatureset:this._parent,adaptedFields:this._adaptedFields,extraFilter:null})),!0===t.nowhereclause){const t=new E({parentfeatureset:i,orderbyclause:new L(this.phsyicalgroupbyfields.join(",")+","+this._parent.objectIdField+" ASC")});return{filterApplied:!1,spatialFilterApplied:!1,ordered:!1,features:this._aggregateSortedFeatureGroups((await t.query({abortSignal:e.abortSignal})).features,this._maxQuery,e.abortSignal)}}let a=i;if(null!==n){let e=null;n&&(e=this._reformulateWhereClauseWithoutGroupByFields(n)),a=new x.A({parentfeatureset:a,whereclause:e})}const s=new E({parentfeatureset:a,orderbyclause:new L(this.phsyicalgroupbyfields.join(",")+","+this._parent.objectIdField+" ASC")});return{filterApplied:!1,spatialFilterApplied:!1,ordered:!1,features:this._aggregateSortedFeatureGroups((await s.query({abortSignal:e.abortSignal})).features,this._maxQuery,e.abortSignal)}}async*_fixAggregateAttributeNames(e){for await(const t of e)yield t.map(e=>{const t={geometry:e.geometry,attributes:{}},n={};for(const t in e.attributes)n[t.toLowerCase()]=e.attributes[t];for(const e of this._decodedGroupbyfield)t.attributes[e.tofieldname]=n[e.name.toLowerCase()];for(const e of this._decodedStatsfield)t.attributes[e.tofieldname]=n[e.field.toLowerCase()];return new r.A(t)})}async*_aggregateSortedFeatureGroups(e,t,n){let r=null,i=[];for await(const a of e){await(0,f.a2)(),(0,y.dZ)(n);for(const e of a){const t=this._generateAggregateHash(e);null==r?r={features:[e],id:t}:t!==r.id?(i.push(this._calculateAndAppendAggregateItem(r)),r=null,r={features:[e],id:t}):r.features.push(e)}i.length>=t&&(yield i,i=[])}null!=r&&(i.push(this._calculateAndAppendAggregateItem(r)),yield i)}async queryStat(e){return{calculated:!1}}async canQueryAggregate(e){return!1}async queryAggregate(e){throw new y.dr("NeverReach")}_reformulateWhereClauseWithoutStatsFields(e){for(const t of this._decodedStatsfield)e=(0,I.bD)(e,t.tofieldname,(0,I.YY)(t.workingexpr,0),this._parent.getFieldsIndex());return e}_reformulateWhereClauseWithoutGroupByFields(e){for(const t of this._decodedGroupbyfield)t.tofieldname!==t.name&&(e=(0,I.bD)(e,t.tofieldname,(0,I.YY)(t.expression,0),this._parent.getFieldsIndex()));return e}_reformulateOrderClauseWithoutGroupByFields(e){const t=[];for(const e of this._decodedGroupbyfield)e.tofieldname!==e.name&&t.push({field:e.tofieldname,newfield:e.name});return t.length>0?e.replaceFields(t):e}_calculateFieldStat(e,t,n){const r=[];for(const n of e.features)if(null!==t.workingexpr){const e=t.workingexpr.calculateValue(n);null!==e&&(e instanceof Z.n||e instanceof W.k?r.push(e.toNumber()):e instanceof M.g?r.push(e.toMilliseconds()):r.push(e))}else r.push(null);n.attributes[t.tofieldname]=(0,$.s)(t.typeofstat,[r])}_calculateAndAppendAggregateItem(e){const t={attributes:{},geometry:null};for(const n of this._decodedGroupbyfield){const r=n.singlefield?e.features[0].attributes[n.singlefield]:b.A.convertValueToStorageFormat(n.expression.calculateValue(e.features[0]),n.sqlType);t.attributes[n.tofieldname]=r}for(const n of this._decodedStatsfield)this._calculateFieldStat(e,n,t);const n=[];for(let r=0;r<this._decodedStatsfield.length;r++)n.push(this._calculateFieldStat(e,this._decodedStatsfield[r],t));return new r.A({attributes:t.attributes,geometry:t.geometry})}_generateAggregateHash(e){let t="";for(const n of this._decodedGroupbyfield){const r=n.singlefield?e.attributes[n.singlefield]:n.expression.calculateValue(e);t+=null==r?":":":"+r.toString()}return(0,j.d)(t,j.T.String)}async getFeatureByObjectId(){return null}}class O extends g.t{constructor(e){super(e),this._topnum=0,this.declaredClass="esri.arcade.featureset.actions.Top",this._maxProcessing=100,this._topnum=e.topnum,this._parent=e.parentfeatureset}async _queryAll(){return(await this.query({abortSignal:h._})).features}async query(e){await this._ensureLoaded();const t=await this._parent.queryAll(e.abortSignal);return{filterApplied:null==e.where,spatialFilterApplied:null==e.spatialFilter,ordered:!1,features:this._limit(t,this._topnum)}}async*_limit(e,t){let n=t;for await(const t of e)if(n>=t.length?(n-=t.length,yield t):(yield t.slice(0,n),n=0),n<=0)break}async queryStat(e){return{calculated:!1}}async canQueryAggregate(e){return!1}async queryAggregate(e){throw new y.dr("NeverReach")}getFieldsIndex(){return this._parent.getFieldsIndex()}}var V=n(85978),G=n(30235),K=n(334),J=n(74887),H=n(68654),z=n(20655),Q=n(78888),Y=n(51447),X=n(53966),ee=n(66552);new ee.J({Clean:"clean",Dirty:"dirty"}),new ee.J({Physical:"physical",Virtual:"virtual"}),new ee.J({"Start and end":"start-and-end",Start:"start",Midspan:"midspan",End:"end"}),new ee.J({startingPoint:"starting-point",barrier:"barrier",stoppingPoint:"stopping-point"}),new ee.J({connected:"connected",upstream:"upstream",downstream:"downstream",shortestPath:"shortest-path",subnetwork:"subnetwork",subnetworkController:"subnetwork-controller",loops:"loops",isolation:"isolation",path:"path",circuit:"circuit"});const te="{00000000-0000-0000-0000-000000000000}",ne=new ee.J({junctionJunctionConnectivity:"junction-junction-connectivity",connectivity:"connectivity",attachment:"attachment",containment:"containment",junctionEdgeFromConnectivity:"junction-edge-from-connectivity",junctionEdgeMidspanConnectivity:"junction-edge-midspan-connectivity",junctionEdgeToConnectivity:"junction-edge-to-connectivity"});new ee.J({normal:"normal",rebuild:"rebuild",forceRebuild:"force-rebuild"});var re=n(2272),ie=n(31635),ae=n(25482),se=n(10107),oe=(n(44208),n(87811),n(64108)),le=n(36005),ue=n(43937),de=n(82799);let ce=class extends ae.o{constructor(e){super(e),this.type="networkElement",this.assetGroupCode=null,this.assetTypeCode=null,this.globalId=null,this.networkSourceId=null,this.objectId=null,this.positionFrom=null,this.positionTo=null,this.terminalId=null}};(0,ie.Cg)([(0,se.MZ)({json:{write:!1}})],ce.prototype,"type",void 0),(0,ie.Cg)([(0,se.MZ)({type:Number,json:{write:!0}})],ce.prototype,"assetGroupCode",void 0),(0,ie.Cg)([(0,se.MZ)({type:Number,json:{write:!0}})],ce.prototype,"assetTypeCode",void 0),(0,ie.Cg)([(0,se.MZ)({type:String,json:{write:!0}})],ce.prototype,"globalId",void 0),(0,ie.Cg)([(0,se.MZ)({type:Number,json:{write:!0}})],ce.prototype,"networkSourceId",void 0),(0,ie.Cg)([(0,se.MZ)({type:Number,json:{write:!0}})],ce.prototype,"objectId",void 0),(0,ie.Cg)([(0,se.MZ)({type:Number,json:{write:!0}})],ce.prototype,"positionFrom",void 0),(0,ie.Cg)([(0,se.MZ)({type:Number,json:{write:!0}})],ce.prototype,"positionTo",void 0),(0,ie.Cg)([(0,se.MZ)({type:Number,json:{write:!0}})],ce.prototype,"terminalId",void 0),ce=(0,ie.Cg)([(0,oe.$)("esri.rest.networks.support.NetworkElement")],ce);let fe=class extends ce{constructor(e){super(e),this.type="telecomNetworkElement",this.firstUnit=null,this.numUnits=null}};(0,ie.Cg)([(0,se.MZ)({json:{write:!1}})],fe.prototype,"type",void 0),(0,ie.Cg)([(0,se.MZ)({json:{write:!0}})],fe.prototype,"firstUnit",void 0),(0,ie.Cg)([(0,se.MZ)({json:{write:!0}})],fe.prototype,"numUnits",void 0),fe=(0,ie.Cg)([(0,oe.$)("esri.rest.networks.support.TelecomNetworkElement")],fe);let pe=class extends ae.o{constructor(e){super(e),this.globalId=null,this.associationType=null,this.fromNetworkElement=null,this.toNetworkElement=null,this.geometry=null,this.errorMessage=null,this.percentAlong=null,this.errorCode=null,this.isContentVisible=null,this.status=null}readFromNetworkElement(e,t){return t.fromFirstUnit||t.fromNumUnits?new fe({globalId:t.fromGlobalId,networkSourceId:t.fromNetworkSourceId,terminalId:t.fromTerminalId,firstUnit:t.fromFirstUnit,numUnits:t.fromNumUnits}):new ce({globalId:t.fromGlobalId,networkSourceId:t.fromNetworkSourceId,terminalId:t.fromTerminalId})}writeFromNetworkElement(e,t){if(e&&(t.fromGlobalId=e.globalId,t.fromNetworkSourceId=e.networkSourceId,t.fromTerminalId=e.terminalId,"telecomNetworkElement"===e.type)){const n=e;t.fromFirstUnit=n.firstUnit,t.fromNumUnits=n.numUnits}}readToNetworkElement(e,t){return t.toFirstUnit||t.toNumUnits?new fe({globalId:t.toGlobalId,networkSourceId:t.toNetworkSourceId,terminalId:t.toTerminalId,firstUnit:t.toFirstUnit,numUnits:t.toNumUnits}):new ce({globalId:t.toGlobalId,networkSourceId:t.toNetworkSourceId,terminalId:t.toTerminalId})}writeToNetworkElement(e,t){if(e&&(t.toGlobalId=e.globalId,t.toNetworkSourceId=e.networkSourceId,t.toTerminalId=e.terminalId,"telecomNetworkElement"===e.type)){const n=e;t.toFirstUnit=n.firstUnit,t.toNumUnits=n.numUnits}}equals(e){if(this.globalId===te&&e.globalId===te){function t(e,t){return e.networkSourceId===t.networkSourceId&&e.globalId===t.globalId&&e.terminalId===t.terminalId&&e.firstUnit===t.firstUnit&&e.numUnits===t.numUnits}const n=this.fromNetworkElement,r=this.toNetworkElement,i=e.fromNetworkElement,a=e.toNetworkElement,s=t(n,i),o=t(r,a);return s&&o&&this.associationType===e.associationType}return null!=this.globalId&&null!=e.globalId&&this.globalId===e.globalId}};(0,ie.Cg)([(0,se.MZ)({type:String,json:{write:!0}})],pe.prototype,"globalId",void 0),(0,ie.Cg)([(0,se.MZ)({type:ne.apiValues,json:{type:ne.jsonValues,read:ne.read,write:ne.write}})],pe.prototype,"associationType",void 0),(0,ie.Cg)([(0,se.MZ)({type:ce,json:{write:{target:{fromGlobalId:{type:String},fromNetworkSourceId:{type:Number},fromTerminalId:{type:Number},fromFirstUnit:{type:Number},fromNumUnits:{type:Number}}},read:{source:["fromGlobalId","fromNetworkSourceId","fromTerminalId","fromFirstUnit","fromNumUnits"]}}})],pe.prototype,"fromNetworkElement",void 0),(0,ie.Cg)([(0,le.w)("fromNetworkElement")],pe.prototype,"readFromNetworkElement",null),(0,ie.Cg)([(0,ue.K)("fromNetworkElement")],pe.prototype,"writeFromNetworkElement",null),(0,ie.Cg)([(0,se.MZ)({type:ce,json:{write:{target:{toGlobalId:{type:String},toNetworkSourceId:{type:Number},toTerminalId:{type:Number},toFirstUnit:{type:Number},toNumUnits:{type:Number}}},read:{source:["toGlobalId","toNetworkSourceId","toTerminalId","toFirstUnit","toNumUnits"]}}})],pe.prototype,"toNetworkElement",void 0),(0,ie.Cg)([(0,le.w)("toNetworkElement")],pe.prototype,"readToNetworkElement",null),(0,ie.Cg)([(0,ue.K)("toNetworkElement")],pe.prototype,"writeToNetworkElement",null),(0,ie.Cg)([(0,se.MZ)({type:de.A,json:{write:!0}})],pe.prototype,"geometry",void 0),(0,ie.Cg)([(0,se.MZ)({type:String,json:{write:!0}})],pe.prototype,"errorMessage",void 0),(0,ie.Cg)([(0,se.MZ)({type:Number,json:{write:!0}})],pe.prototype,"percentAlong",void 0),(0,ie.Cg)([(0,se.MZ)({type:Number,json:{write:!0}})],pe.prototype,"errorCode",void 0),(0,ie.Cg)([(0,se.MZ)({type:Boolean,json:{write:!0}})],pe.prototype,"isContentVisible",void 0),(0,ie.Cg)([(0,se.MZ)({type:Number,json:{write:!0}})],pe.prototype,"status",void 0),pe=(0,ie.Cg)([(0,oe.$)("esri.rest.networks.support.Association")],pe);let he=class extends ae.o{constructor(e){super(e),this.associations=[]}};function me(e){const{returnDeletes:t,elements:n,gdbVersion:r,moment:i}=e.toJSON();return{returnDeletes:t,elements:JSON.stringify(n.map(e=>({globalId:e.globalId,networkSourceId:e.networkSourceId,terminalId:e.terminalId}))),types:JSON.stringify(e.types.map(e=>ne.toJSON(e))).replaceAll('"connectivity"','"junctionJunctionConnectivity"'),gdbVersion:r,moment:i??Date.now()}}(0,ie.Cg)([(0,se.MZ)({type:[pe],json:{write:!0}})],he.prototype,"associations",void 0),he=(0,ie.Cg)([(0,oe.$)("esri.rest.networks.support.QueryAssociationsResult")],he);var ye,ge=n(56507);let we=ye=class extends ae.o{static from(e){return(0,ge.PZ)(ye,e)}constructor(e){super(e),this.returnDeletes=!1,this.elements=[],this.types=[],this.gdbVersion=null,this.moment=null}};(0,ie.Cg)([(0,se.MZ)({type:Boolean,json:{write:!0}})],we.prototype,"returnDeletes",void 0),(0,ie.Cg)([(0,se.MZ)({type:[ce],json:{write:!0}})],we.prototype,"elements",void 0),(0,ie.Cg)([(0,se.MZ)({type:[ne.apiValues],json:{type:ne.jsonValues,read:ne.read,write:ne.write}})],we.prototype,"types",void 0),(0,ie.Cg)([(0,se.MZ)({type:String,json:{write:!0}})],we.prototype,"gdbVersion",void 0),(0,ie.Cg)([(0,se.MZ)({type:Date,json:{type:Number,write:{writer:(e,t)=>{t.moment=e?.getTime()}}}})],we.prototype,"moment",void 0),we=ye=(0,ie.Cg)([(0,oe.$)("esri.rest.networks.support.QueryAssociationsParameters")],we);var Ie=n(54218);function Fe(e,t,n){const r=e.getVariables();if(r.length>0){const i={};for(const e of r)i[e]=t.evaluateIdentifier(n,{name:e});e.parameters=i}return e}function be(e,t,n=null){for(const n in e)if(n.toLowerCase()===t.toLowerCase())return e[n];return n}function Ae(e){if(null===e)return null;const t={type:be(e,"type",""),name:be(e,"name","")};if("range"===t.type)t.range=be(e,"range",[]);else{t.codedValues=[];for(const n of be(e,"codedValues",[]))t.codedValues.push({name:be(n,"name",""),code:be(n,"code",null)})}return t}function Ne(e){if(null===e)return null;const t={},n=be(e,"wkt");null!==n&&(t.wkt=n);const r=be(e,"wkid");return null!==r&&(t.wkid=r),t}function Se(e){if(null===e)return null;const t={hasZ:be(e,"hasz",!1),hasM:be(e,"hasm",!1)},n=be(e,"spatialreference");null!=n&&(t.spatialReference=Ne(n));const r=be(e,"x",null);if(null!==r)return t.x=r,t.y=be(e,"y",null),t.hasZ&&(t.z=be(e,"z",null)),t.hasM&&(t.m=be(e,"m",null)),t;const i=be(e,"rings",null);if(null!==i)return t.rings=i,t;const a=be(e,"paths",null);if(null!==a)return t.paths=a,t;const s=be(e,"points",null);if(null!==s)return t.points=s,t;for(const n of["xmin","xmax","ymin","ymax","zmin","zmax","mmin","mmax"]){const r=be(e,n,null);null!==r&&(t[n]=r)}return t}function Te(e){return"utc"===e?.toLowerCase()?"UTC":"unknown"===e?.toLowerCase()?"Unknown":e}function _e(e){if("async"===e.mode){e.functions.timezone=function(t,n){return e.standardFunctionAsync(t,n,async(e,r,a)=>{if((0,f.B)(a,1,2,t,n),(0,f.g)(a[0]))return"Unknown";if((0,f.f)(a[0]))return"Unknown";if((0,f.m)(a[0])){if(await a[0].load(),1===a.length||null===a[1])return a[0].datesInUnknownTimezone?Te("unknown"):Te(a[0].dateFieldsTimeZone);if(!(a[1]instanceof s.A)||!1===a[1].hasField("type"))throw new l.D$(t,"InvalidParameter",n);const e=a[1].field("type");if(!1===(0,Ie.Kg)(e))throw new l.D$(t,"InvalidParameter",n);switch((0,f.u)(e).toLowerCase()){case"preferredtimezone":return Te(a[0].preferredTimeZone);case"editfieldsinfo":return Te(a[0].editFieldsInfo?.timeZone??null);case"timeinfo":return Te(a[0].timeInfo?.timeZone??null);case"field":if(a[1].hasField("fieldname")&&(0,Ie.Kg)(a[1].field("fieldname")))return Te(a[0].fieldTimeZone((0,f.u)(a[1].field("fieldname"))))}throw new l.D$(t,"InvalidParameter",n)}const o=(0,f.O)(a[0],(0,f.K)(t));if(null===o)return null;const u=o.timeZone;return"system"===u?i.lY.systemTimeZoneCanonicalName:"utc"===u.toLowerCase()?"UTC":"unknown"===u.toLowerCase()?"Unknown":u})},e.functions.sqltimestamp=function(t,n){return e.standardFunctionAsync(t,n,async(e,r,i)=>{(0,f.B)(i,1,3,t,n);const a=i[0];if((0,f.e)(a)){if(1===i.length)return a.toSQLWithKeyword();if(2===i.length)return a.changeTimeZone((0,f.u)(i[1])).toSQLWithKeyword();throw new l.D$(t,"InvalidParameter",n)}if((0,f.f)(a))return a.toSQLWithKeyword();if((0,f.m)(a)){if(3!==i.length)throw new l.D$(t,"InvalidParameter",n);await a.load();const e=(0,f.u)(i[1]);if((0,f.f)(i[2]))return i[2].toSQLWithKeyword();if(!1===(0,f.e)(i[2]))throw new l.D$(t,"InvalidParameter",n);const r=a.fieldTimeZone(e);return null==r?i[2].toSQLWithKeyword():i[2].changeTimeZone(r).toSQLWithKeyword()}throw new l.D$(t,"InvalidParameter",n)})},e.signatures.push({name:"sqltimestamp",min:2,max:4}),e.functions.featuresetbyid=function(t,n){return e.standardFunctionAsync(t,n,(e,r,i)=>{if((0,f.B)(i,2,4,t,n),(0,f.l)(i[0])){const e=(0,f.u)(i[1]);let r=(0,f.J)(i[2],null);const a=(0,f.H)((0,f.J)(i[3],!0));if(null===r&&(r=["*"]),!1===(0,Ie.cy)(r))throw new l.D$(t,"InvalidParameter",n);return i[0].featureSetById(e,a,r)}throw new l.D$(t,"InvalidParameter",n)})},e.signatures.push({name:"featuresetbyid",min:2,max:4});const t=new o.b(["datasource","parent","root"]);e.functions.getfeatureset=function(n,r){return e.standardFunctionAsync(n,r,async(e,i,a)=>{if((0,f.B)(a,1,2,n,r),(0,f.k)(a[0])){const e=null==a[1]?"datasource":t.lookup((0,f.u)(a[1]));return(0,d.convertToFeatureSet)(a[0].fullSchema(),e,n.lrucache,n.interceptor,n.spatialReference)}throw new l.D$(n,"InvalidParameter",r)})},e.signatures.push({name:"getfeatureset",min:1,max:2}),e.functions.featuresetbyportalitem=function(t,n){return e.standardFunctionAsync(t,n,(e,r,i)=>{if((0,f.B)(i,2,5,t,n),null===i[0])throw new l.D$(t,"PortalRequired",n);if(i[0]instanceof a.A){const e=(0,f.u)(i[1]),r=(0,f.u)(i[2]);let a=(0,f.J)(i[3],null);const s=(0,f.H)((0,f.J)(i[4],!0));if(null===a&&(a=["*"]),!1===(0,Ie.cy)(a))throw new l.D$(t,"InvalidParameter",n);let o;return o=t.services?.portal?t.services.portal:z.A.getDefault(),o=(0,p.R)(i[0],o),(0,d.constructFeatureSetFromPortalItem)(e,r,t.spatialReference,a,s,o,t.lrucache,t.interceptor)}if(!1===(0,Ie.Kg)(i[0]))throw new l.D$(t,"PortalRequired",n);const s=(0,f.u)(i[0]),o=(0,f.u)(i[1]);let u=(0,f.J)(i[2],null);const c=(0,f.H)((0,f.J)(i[3],!0));if(null===u&&(u=["*"]),!1===(0,Ie.cy)(u))throw new l.D$(t,"InvalidParameter",n);return(0,d.constructFeatureSetFromPortalItem)(s,o,t.spatialReference,u,c,t.services?.portal??z.A.getDefault(),t.lrucache,t.interceptor)})},e.signatures.push({name:"featuresetbyportalitem",min:2,max:5}),e.functions.featuresetbyname=function(t,n){return e.standardFunctionAsync(t,n,(e,r,i)=>{if((0,f.B)(i,2,4,t,n),(0,f.l)(i[0])){const e=(0,f.u)(i[1]);let r=(0,f.J)(i[2],null);const a=(0,f.H)((0,f.J)(i[3],!0));if(null===r&&(r=["*"]),!1===(0,Ie.cy)(r))throw new l.D$(t,"InvalidParameter",n);return i[0].featureSetByName(e,a,r)}throw new l.D$(t,"InvalidParameter",n)})},e.signatures.push({name:"featuresetbyname",min:2,max:4}),e.functions.featureset=function(t,n){return e.standardFunction(t,n,(e,r,i)=>{(0,f.B)(i,1,1,t,n);const a={layerDefinition:{geometryType:"",objectIdField:"",globalIdField:"",typeIdField:"",hasM:!1,hasZ:!1,fields:[]},featureSet:{geometryType:"",features:[]}};if((0,Ie.Kg)(i[0])){const e=JSON.parse(i[0]);void 0!==e.layerDefinition?(a.layerDefinition=e.layerDefinition,a.featureSet=e.featureSet,e.layerDefinition.spatialReference&&(a.layerDefinition.spatialReference=e.layerDefinition.spatialReference)):(a.featureSet.features=e.features,a.featureSet.geometryType=e.geometryType,a.layerDefinition.geometryType=a.featureSet.geometryType,a.layerDefinition.objectIdField=e.objectIdFieldName??"",a.layerDefinition.typeIdField=e.typeIdFieldName,a.layerDefinition.globalIdField=e.globalIdFieldName,a.layerDefinition.fields=e.fields,e.spatialReference&&(a.layerDefinition.spatialReference=e.spatialReference))}else{if(!(i[0]instanceof s.A))throw new l.D$(t,"InvalidParameter",n);{const e=JSON.parse(i[0].castToText(!0)),r=be(e,"layerdefinition");if(null!==r){a.layerDefinition.geometryType=be(r,"geometrytype",""),a.featureSet.geometryType=a.layerDefinition.geometryType,a.layerDefinition.globalIdField=be(r,"globalidfield",""),a.layerDefinition.objectIdField=be(r,"objectidfield",""),a.layerDefinition.typeIdField=be(r,"typeidfield",""),a.layerDefinition.hasZ=!0===be(r,"hasz",!1),a.layerDefinition.hasM=!0===be(r,"hasm",!1);const t=be(r,"spatialreference");t&&(a.layerDefinition.spatialReference=Ne(t));const n=[];for(const e of be(r,"fields",[])){const t={name:be(e,"name",""),alias:be(e,"alias",""),type:be(e,"type",""),nullable:be(e,"nullable",!0),editable:be(e,"editable",!0),length:be(e,"length",null),domain:Ae(be(e,"domain"))};n.push(t)}a.layerDefinition.fields=n;const i=be(e,"featureset");if(i){const e={};for(const t of n)e[t.name.toLowerCase()]=t.name;for(const t of be(i,"features",[])){const n={},r=be(t,"attributes",{});for(const t in r)n[e[t.toLowerCase()]]=r[t];a.featureSet.features.push({attributes:n,geometry:Se(be(t,"geometry"))})}}}else{a.layerDefinition.hasZ=!0===be(e,"hasz",!1),a.layerDefinition.hasM=!0===be(e,"hasm",!1),a.layerDefinition.geometryType=be(e,"geometrytype",""),a.featureSet.geometryType=a.layerDefinition.geometryType,a.layerDefinition.objectIdField=be(e,"objectidfieldname",""),a.layerDefinition.typeIdField=be(e,"typeidfieldname","");const r=be(e,"spatialreference");r&&(a.layerDefinition.spatialReference=Ne(r));const i=[],s=be(e,"fields",null);if(!(0,Ie.cy)(s))throw new l.D$(t,"InvalidParameter",n);for(const e of s){const t={name:be(e,"name",""),alias:be(e,"alias",""),type:be(e,"type",""),nullable:be(e,"nullable",!0),editable:be(e,"editable",!0),length:be(e,"length",null),domain:Ae(be(e,"domain"))};i.push(t)}a.layerDefinition.fields=i;const o={};for(const e of i)o[e.name.toLowerCase()]=e.name;let u=be(e,"features",null);if((0,Ie.cy)(u))for(const e of u){const t={},n=be(e,"attributes",{});for(const e in n)t[o[e.toLowerCase()]]=n[e];a.featureSet.features.push({attributes:t,geometry:Se(be(e,"geometry",null))})}else u=null,a.featureSet.features=u}}}if(!1===function(e){return!!e.layerDefinition&&!!e.featureSet&&!1!==function(e){for(const t of["",null,"esriGeometryNull","esriGeometryPoint","esriGeometryPolyline","esriGeometryPolygon","esriGeometryMultipoint","esriGeometryEnvelope"])if(t===e)return!0;return!1}(e.layerDefinition.geometryType)&&!1!==(0,Ie.cy)(e.layerDefinition.fields)&&!1!==(0,Ie.cy)(e.featureSet.features)}(a))throw new l.D$(t,"InvalidParameter",n);return a.layerDefinition.geometryType||(a.layerDefinition.geometryType="esriGeometryNull"),G.A.create(a,t.spatialReference)})},e.signatures.push({name:"featureset",min:1,max:1}),e.functions.filter=function(t,n){return e.standardFunctionAsync(t,n,async(r,i,a)=>{if((0,f.B)(a,2,2,t,n),(0,Ie.cy)(a[0])||(0,f.j)(a[0])){const e=[];let r,i=a[0];if(i instanceof c.A&&(i=i.toArray()),!(0,f.i)(a[1]))throw new l.D$(t,"InvalidParameter",n);r=a[1].createFunction(t);for(const t of i){const n=r(t);(0,J.$X)(n)?!0===await n&&e.push(t):!0===n&&e.push(t)}return e}if((0,f.m)(a[0])){const n=await a[0].load(),r=b.A.create(a[1],{fieldsIndex:n.getFieldsIndex(),timeZone:n.dateFieldsTimeZoneDefaultUTC}),i=r.getVariables();if(i.length>0){const n={};for(const r of i)n[r]=e.evaluateIdentifier(t,{name:r});r.parameters=n}return new x.A({parentfeatureset:a[0],whereclause:r})}throw new l.D$(t,"InvalidParameter",n)})},e.signatures.push({name:"filter",min:2,max:2}),e.functions.orderby=function(t,n){return e.standardFunctionAsync(t,n,async(e,r,i)=>{if((0,f.B)(i,2,2,t,n),(0,f.m)(i[0])){const e=new L(i[1]);return new E({parentfeatureset:i[0],orderbyclause:e})}throw new l.D$(t,"InvalidParameter",n)})},e.signatures.push({name:"orderby",min:2,max:2}),e.functions.top=function(t,n){return e.standardFunctionAsync(t,n,async(e,r,i)=>{if((0,f.B)(i,2,2,t,n),(0,f.m)(i[0]))return new O({parentfeatureset:i[0],topnum:i[1]});if((0,Ie.cy)(i[0]))return(0,f.s)(i[1])>=i[0].length?i[0].slice():i[0].slice(0,(0,f.s)(i[1]));if((0,f.j)(i[0]))return(0,f.s)(i[1])>=i[0].length()?i[0].slice():i[0].slice(0,(0,f.s)(i[1]));throw new l.D$(t,"InvalidParameter",n)})},e.signatures.push({name:"top",min:2,max:2}),e.functions.first=function(t,n){return e.standardFunctionAsync(t,n,async(e,r,i)=>{if((0,f.B)(i,1,1,t,n),(0,f.m)(i[0])){const n=await i[0].first(e.abortSignal);if(null!==n){const e=u.Xj.createFromGraphicLikeObject(n.geometry,n.attributes,i[0],t.timeZone);return e._underlyingGraphic=n,e}return n}return(0,Ie.cy)(i[0])?0===i[0].length?null:i[0][0]:(0,f.j)(i[0])?0===i[0].length()?null:i[0].get(0):null})},e.signatures.push({name:"first",min:1,max:1}),e.functions.attachments=function(t,n){return e.standardFunctionAsync(t,n,async(e,r,i)=>{(0,f.B)(i,1,2,t,n);const a={minsize:-1,maxsize:-1,types:null,returnMetadata:!1};if(i.length>1)if(i[1]instanceof s.A){if(i[1].hasField("minsize")&&(a.minsize=(0,f.s)(i[1].field("minsize"))),i[1].hasField("metadata")&&(a.returnMetadata=(0,f.H)(i[1].field("metadata"))),i[1].hasField("maxsize")&&(a.maxsize=(0,f.s)(i[1].field("maxsize"))),i[1].hasField("types")){const e=(0,f.M)(i[1].field("types"),!1);e.length>0&&(a.types=e)}}else if(null!==i[1])throw new l.D$(t,"InvalidParameter",n);if((0,f.k)(i[0])){const e=i[0]._layer;let n;if((0,f.m)(e))n=e;else{if(null==e||!(0,w.eB)(e))return[];n=(0,d.constructFeatureSet)(e,t.spatialReference,["*"],!0,t.lrucache,t.interceptor)}return await n.load(),n.queryAttachments(i[0].field(n.objectIdField),a.minsize,a.maxsize,a.types,a.returnMetadata)}if(null===i[0])return[];throw new l.D$(t,"InvalidParameter",n)})},e.signatures.push({name:"attachments",min:1,max:2}),e.functions.featuresetbyrelationshipname=function(t,n){return e.standardFunctionAsync(t,n,async(e,r,i)=>{(0,f.B)(i,2,4,t,n);const a=i[0],s=(0,f.u)(i[1]);let o=(0,f.J)(i[2],null);const u=(0,f.H)((0,f.J)(i[3],!0));if(null===o&&(o=["*"]),!1===(0,Ie.cy)(o))throw new l.D$(t,"InvalidParameter",n);if(null===i[0])return null;if(!(0,f.k)(i[0]))throw new l.D$(t,"InvalidParameter",n);const c=a._layer;let p;if((0,f.m)(c))p=c;else{if(null==c||!(0,w.eB)(c))return null;p=(0,d.constructFeatureSet)(c,t.spatialReference,["*"],!0,t.lrucache,t.interceptor)}p=await p.load();const h=p.relationshipMetaData().filter(e=>e.name===s);if(0===h.length)return null;if(void 0!==h[0].relationshipTableId&&null!==h[0].relationshipTableId&&h[0].relationshipTableId>-1)return(0,d.constructFeatureSetFromRelationship)(p,h[0],a.field(p.objectIdField),p.spatialReference,o,u,t.lrucache,t.interceptor);let m=p.serviceUrl();if(!m)return null;m=m.endsWith("/")?m+h[0].relatedTableId.toString():m+"/"+h[0].relatedTableId.toString();const y=await(0,d.constructFeatureSetFromUrl)(m,p.spatialReference,o,u,t.lrucache,t.interceptor);await y.load();let g=y.relationshipMetaData();if(g=g.filter(e=>e.id===h[0].id),!1===a.hasField(h[0].keyField)||null===a.field(h[0].keyField)){const e=await p.getFeatureByObjectId(a.field(p.objectIdField),[h[0].keyField]);if(e){const t=b.A.create(g[0].keyField+"= @id",{fieldsIndex:y.getFieldsIndex(),timeZone:y.dateFieldsTimeZoneDefaultUTC});return t.parameters={id:e.attributes[h[0].keyField]},new x.A({parentfeatureset:y,whereclause:t})}return new V.A({parentfeatureset:y})}const I=b.A.create(g[0].keyField+"= @id",{fieldsIndex:y.getFieldsIndex(),timeZone:y.dateFieldsTimeZoneDefaultUTC});return I.parameters={id:a.field(h[0].keyField)},new x.A({parentfeatureset:y,whereclause:I})})},e.signatures.push({name:"featuresetbyrelationshipname",min:2,max:4}),e.functions.featuresetbyassociation=function(t,n){return e.standardFunctionAsync(t,n,async(e,i,a)=>{(0,f.B)(a,2,3,t,n);const s=a[0],u=(0,o.B)((0,f.u)((0,f.J)(a[1],""))),c=(0,Ie.Kg)(a[2])?(0,f.u)(a[2]):null;if(null===a[0])return null;if(!(0,f.k)(a[0]))throw new l.D$(t,"InvalidParameter",n);let p=s._layer;if(p instanceof H.default&&(p=(0,d.constructFeatureSet)(p,t.spatialReference,["*"],!0,t.lrucache,t.interceptor)),null===p)return null;if(!1===(0,f.m)(p))return null;await p.load();const h=p.serviceUrl(),m=await(0,d.constructAssociationMetaDataFeatureSetFromUrl)(h,t.spatialReference,!0);if(m.unVersion>=8)return await async function(e,t,n,i,a,s,o){const u=await e.getFeatureSetInfo();if(null===(u?.layerId??null))return null;if(!a.layerIdLookup.get(u.layerId))return null;const c=e.serviceUrl().replace(/\/FeatureServer/i,"/UtilityNetworkServer"),f=[];switch(n){case"connected":f.push("connectivity"),f.push("junction-edge-from-connectivity"),f.push("junction-edge-to-connectivity"),f.push("junction-edge-midspan-connectivity"),f.push("junction-junction-connectivity");break;case"container":case"content":f.push("containment");break;case"structure":case"attached":f.push("attachment");break;case"junctionedge":f.push("junction-edge-from-connectivity"),f.push("junction-edge-to-connectivity");break;case"midspan":f.push("junction-edge-midspan-connectivity");break;default:throw new l.D$(s,"InvalidParameter",o)}let p=null,h=!1;if(null!==i&&""!==i&&void 0!==i){for(const e of a.terminals)e.terminalName===i&&(p=e.terminalId);null===p&&(h=!0)}const m=[];if(!h){const i=new ce({globalId:t.field(e.globalIdField),networkSourceId:a.layerIdLookup.get(u.layerId).sourceId,...p?{terminalId:p}:""}),s=await async function(e,t){const n=(0,re.Dl)(e),r={...me(t),f:"json"},i=(0,re.lF)({...n.query,...r}),a=(0,re.jV)(i,{method:"post"}),s=`${n.path}/associations/query`,{data:o}=await(0,Q.A)(s,a),l=he.fromJSON(o);return t.types.includes("connectivity")&&(0,Y.Lx)(X.A.getLogger("esri/rest/networks/support/QueryAssociationsParameters"),"types",{replacement:"Please use 'junction-junction-connectivity' instead of 'connectivity'.",see:"https://arcg.is/11Tr8a#types",version:"4.29",warnOnce:!0}),l}(c,new we({types:f,elements:[i]}));let o=0;for(const e of s.associations){let t=null,s="",l="";if(e.fromNetworkElement?.globalId===i.globalId?(t=e.toNetworkElement,l="to"):e.toNetworkElement?.globalId===i.globalId&&(t=e.fromNetworkElement,l="from"),!t)continue;switch(n){case"attached":if("attachment"!==e.associationType)continue;if("to"!==l)continue;break;case"structure":if("attachment"!==e.associationType)continue;if("from"!==l)continue;break;case"container":if("containment"!==e.associationType)continue;if("from"!==l)continue;break;case"content":if("containment"!==e.associationType)continue;if("to"!==l)continue;break;case"connected":break;case"junctionedge":"junction-edge-to-connectivity"===e.associationType?s="to":"junction-edge-from-connectivity"===e.associationType&&(s="from");break;case"midspan":if("junction-edge-midspan-connectivity"!==e.associationType)continue}const u=a.sourceIdLookup.get(t.networkSourceId)?.className??"";m.push(new r.A({geometry:null,attributes:{objectId:o++,globalId:t.globalId,percentAlong:e.percentAlong??0,isContentVisible:e.isContentVisible?0:1,className:u,side:s}}))}}const y=new H.default({source:m,geometryType:null,objectIdField:"objectId",globalIdField:"globalId",fields:[new R.A({name:"objectId",alias:"objectId",type:"oid"}),new R.A({name:"globalId",alias:"globalId",type:"global-id"}),new R.A({name:"percentAlong",alias:"percentAlong",type:"double"}),new R.A({name:"side",alias:"side",type:"string"}),new R.A({name:"isContentVisible",alias:"isContentVisible",type:"integer"}),new R.A({name:"className",alias:"className",type:"string"})]});return(0,d.constructFeatureSet)(y)}(p,s,u,c,m,t,n);const y=m.associations;let g=null,I=null,F=!1;if(null!==c&&""!==c&&void 0!==c){for(const e of m.terminals)e.terminalName===c&&(I=e.terminalId);null===I&&(F=!0)}const A=y.getFieldsIndex(),N=A.get("TOGLOBALID").name,x=A.get("FROMGLOBALID").name,D=A.get("TOTERMINALID").name,E=A.get("FROMTERMINALID").name,k=A.get("FROMNETWORKSOURCEID").name,L=A.get("TONETWORKSOURCEID").name,U=A.get("ASSOCIATIONTYPE").name,j=A.get("ISCONTENTVISIBLE").name,$=A.get("OBJECTID").name;for(const e of p.fields)if("global-id"===e.type){g=s.field(e.name);break}let Z=null,M=new C(new R.A({name:"percentalong",alias:"percentalong",type:"double"}),b.A.create("0",{fieldsIndex:y.getFieldsIndex(),timeZone:y.dateFieldsTimeZoneDefaultUTC})),W=new C(new R.A({name:"side",alias:"side",type:"string"}),b.A.create("''",{fieldsIndex:y.getFieldsIndex(),timeZone:y.dateFieldsTimeZoneDefaultUTC}));const B="globalid",q="globalId",P={};for(const e in m.lkp)P[e]=m.lkp[e].sourceId;const O=new _(new R.A({name:"classname",alias:"classname",type:"string"}),null,P);let V="";switch(u){case"midspan":{V=`((${N}='${g}') OR ( ${x}='${g}')) AND (${U} IN (5))`,O.codefield=b.A.create(`CASE WHEN (${N}='${g}') THEN ${k} ELSE ${L} END`,{fieldsIndex:y.getFieldsIndex(),timeZone:y.dateFieldsTimeZoneDefaultUTC});const e=(0,w.ke)(v.findField(y.fields,x));e.name=B,e.alias=B,Z=new C(e,b.A.create(`CASE WHEN (${x}='${g}') THEN ${N} ELSE ${x} END`,{fieldsIndex:y.getFieldsIndex(),timeZone:y.dateFieldsTimeZoneDefaultUTC})),M=m.unVersion>=4?new S(v.findField(y.fields,A.get("PERCENTALONG").name)):new C(new R.A({name:"percentalong",alias:"percentalong",type:"double"}),b.A.create("0",{fieldsIndex:y.getFieldsIndex(),timeZone:y.dateFieldsTimeZoneDefaultUTC}));break}case"junctionedge":{V=`((${N}='${g}') OR ( ${x}='${g}')) AND (${U} IN (4,6))`,O.codefield=b.A.create(`CASE WHEN (${N}='${g}') THEN ${k} ELSE ${L} END`,{fieldsIndex:y.getFieldsIndex(),timeZone:y.dateFieldsTimeZoneDefaultUTC});const e=(0,w.ke)(v.findField(y.fields,x));e.name=B,e.alias=B,Z=new C(e,b.A.create(`CASE WHEN (${x}='${g}') THEN ${N} ELSE ${x} END`,{fieldsIndex:y.getFieldsIndex(),timeZone:y.dateFieldsTimeZoneDefaultUTC})),W=new C(new R.A({name:"side",alias:"side",type:"string"}),b.A.create(`CASE WHEN (${U}=4) THEN 'from' ELSE 'to' END`,{fieldsIndex:y.getFieldsIndex(),timeZone:y.dateFieldsTimeZoneDefaultUTC}));break}case"connected":{let e=`${N}='@T'`,t=`${x}='@T'`;null!==I&&(e+=` AND ${D}=@A`,t+=` AND ${E}=@A`),V="(("+e+") OR ("+t+"))",V=(0,f._)(V,"@T",g??""),e=(0,f._)(e,"@T",g??""),null!==I&&(e=(0,f._)(e,"@A",I.toString()),V=(0,f._)(V,"@A",I.toString())),O.codefield=b.A.create("CASE WHEN "+e+` THEN ${k} ELSE ${L} END`,{fieldsIndex:y.getFieldsIndex(),timeZone:y.dateFieldsTimeZoneDefaultUTC});const n=(0,w.ke)(v.findField(y.fields,x));n.name=B,n.alias=B,Z=new C(n,b.A.create("CASE WHEN "+e+` THEN ${x} ELSE ${N} END`,{fieldsIndex:y.getFieldsIndex(),timeZone:y.dateFieldsTimeZoneDefaultUTC}));break}case"container":V=`${N}='${g}' AND ${U} = 2`,null!==I&&(V+=` AND ${D} = `+I.toString()),O.codefield=k,V="( "+V+" )",Z=new T(v.findField(y.fields,x),B,B);break;case"content":V=`(${x}='${g}' AND ${U} = 2)`,null!==I&&(V+=` AND ${E} = `+I.toString()),O.codefield=L,V="( "+V+" )",Z=new T(v.findField(y.fields,N),B,B);break;case"structure":V=`(${N}='${g}' AND ${U} = 3)`,null!==I&&(V+=` AND ${D} = `+I.toString()),O.codefield=k,V="( "+V+" )",Z=new T(v.findField(y.fields,x),B,q);break;case"attached":V=`(${x}='${g}' AND ${U} = 3)`,null!==I&&(V+=` AND ${E} = `+I.toString()),O.codefield=L,V="( "+V+" )",Z=new T(v.findField(y.fields,N),B,q);break;default:throw new l.D$(t,"InvalidParameter",n)}return F&&(V="1 <> 1"),new v({parentfeatureset:y,adaptedFields:[new S(v.findField(y.fields,$)),new S(v.findField(y.fields,j)),Z,W,O,M],extraFilter:V?b.A.create(V,{fieldsIndex:y.getFieldsIndex(),timeZone:y.dateFieldsTimeZoneDefaultUTC}):null})})},e.signatures.push({name:"featuresetbyassociation",min:2,max:6}),e.functions.groupby=function(t,n){return e.standardFunctionAsync(t,n,async(r,i,a)=>{if((0,f.B)(a,3,3,t,n),!(0,f.m)(a[0]))throw new l.D$(t,"InvalidParameter",n);const o=await a[0].load(),u=[],d=[];let c=!1,p=[];if((0,Ie.Kg)(a[1]))p.push(a[1]);else if(a[1]instanceof s.A)p.push(a[1]);else if((0,Ie.cy)(a[1]))p=a[1];else{if(!(0,f.j)(a[1]))throw new l.D$(t,"InvalidParameter",n);p=a[1].toArray()}for(const e of p)if((0,Ie.Kg)(e)){const t=b.A.create((0,f.u)(e),{fieldsIndex:o.getFieldsIndex(),timeZone:o.dateFieldsTimeZoneDefaultUTC}),n=!0===(0,I.DA)(t)?(0,f.u)(e):"%%%%FIELDNAME";u.push({name:n,expression:t}),"%%%%FIELDNAME"===n&&(c=!0)}else{if(!(e instanceof s.A))throw new l.D$(t,"InvalidParameter",n);{const r=e.hasField("name")?e.field("name"):"%%%%FIELDNAME",i=e.hasField("expression")?e.field("expression"):"";if("%%%%FIELDNAME"===r&&(c=!0),!r)throw new l.D$(t,"InvalidParameter",n);u.push({name:r,expression:b.A.create(i||r,{fieldsIndex:o.getFieldsIndex(),timeZone:o.dateFieldsTimeZoneDefaultUTC})})}}if(p=[],(0,Ie.Kg)(a[2]))p.push(a[2]);else if((0,Ie.cy)(a[2]))p=a[2];else if((0,f.j)(a[2]))p=a[2].toArray();else{if(!(a[2]instanceof s.A))throw new l.D$(t,"InvalidParameter",n);p.push(a[2])}for(const e of p){if(!(e instanceof s.A))throw new l.D$(t,"InvalidParameter",n);{const r=e.hasField("name")?e.field("name"):"",i=e.hasField("statistic")?e.field("statistic"):"",a=e.hasField("expression")?e.field("expression"):"";if(!(r&&i&&(0,Ie.Kg)(i)&&a))throw new l.D$(t,"InvalidParameter",n);d.push({name:r,statistic:i,expression:b.A.create(a,{fieldsIndex:o.getFieldsIndex(),timeZone:o.dateFieldsTimeZoneDefaultUTC})})}}if(c){const e={};for(const t of o.fields)e[t.name.toLowerCase()]=1;for(const t of u)"%%%%FIELDNAME"!==t.name&&(e[t.name.toLowerCase()]=1);for(const t of d)"%%%%FIELDNAME"!==t.name&&(e[t.name.toLowerCase()]=1);let t=0;for(const n of u)if("%%%%FIELDNAME"===n.name){for(;1===e["field_"+t.toString()];)t++;e["field_"+t.toString()]=1,n.name="FIELD_"+t.toString()}}for(const n of u)Fe(n.expression,e,t);for(const n of d)Fe(n.expression,e,t);return new P({parentfeatureset:a[0],groupbyfields:u,statsfields:d})})},e.signatures.push({name:"groupby",min:3,max:3}),e.functions.distinct=function(t,n){return e.standardFunctionAsync(t,n,async(r,i,a)=>{if((0,f.m)(a[0])){(0,f.B)(a,2,2,t,n);const r=await a[0].load(),i=[];let o=[];if((0,Ie.Kg)(a[1]))o.push(a[1]);else if(a[1]instanceof s.A)o.push(a[1]);else if((0,Ie.cy)(a[1]))o=a[1];else{if(!(0,f.j)(a[1]))throw new l.D$(t,"InvalidParameter",n);o=a[1].toArray()}let u=!1;for(const e of o)if((0,Ie.Kg)(e)){const t=b.A.create((0,f.u)(e),{fieldsIndex:r.getFieldsIndex(),timeZone:r.dateFieldsTimeZoneDefaultUTC}),n=!0===(0,I.DA)(t)?(0,f.u)(e):"%%%%FIELDNAME";i.push({name:n,expression:t}),"%%%%FIELDNAME"===n&&(u=!0)}else{if(!(e instanceof s.A))throw new l.D$(t,"InvalidParameter",n);{const a=e.hasField("name")?e.field("name"):"%%%%FIELDNAME",s=e.hasField("expression")?e.field("expression"):"";if("%%%%FIELDNAME"===a&&(u=!0),!a)throw new l.D$(t,"InvalidParameter",n);i.push({name:a,expression:b.A.create(s||a,{fieldsIndex:r.getFieldsIndex(),timeZone:r.dateFieldsTimeZoneDefaultUTC})})}}if(u){const e={};for(const t of r.fields)e[t.name.toLowerCase()]=1;for(const t of i)"%%%%FIELDNAME"!==t.name&&(e[t.name.toLowerCase()]=1);let t=0;for(const n of i)if("%%%%FIELDNAME"===n.name){for(;1===e["field_"+t.toString()];)t++;e["field_"+t.toString()]=1,n.name="FIELD_"+t.toString()}}for(const n of i)Fe(n.expression,e,t);return new P({parentfeatureset:a[0],groupbyfields:i,statsfields:[]})}return function(e){if(1===e.length){if((0,Ie.cy)(e[0]))return(0,K.t)("distinct",e[0],-1);if((0,f.j)(e[0]))return(0,K.t)("distinct",e[0].toArray(),-1)}return(0,K.t)("distinct",e,-1)}(a)})},e.functions.getfeaturesetinfo=function(t,n){return e.standardFunctionAsync(t,n,async(e,r,i)=>{if((0,f.B)(i,1,1,t,n),!(0,f.m)(i[0]))return null;const a=await i[0].getFeatureSetInfo();return a?s.A.convertObjectToArcadeDictionary({layerId:a.layerId,layerName:a.layerName,itemId:a.itemId,serviceLayerUrl:a.serviceLayerUrl,webMapLayerId:a.webMapLayerId??null,webMapLayerTitle:a.webMapLayerTitle??null,className:null,objectClassId:null},(0,f.K)(t),!1,!1):null})},e.signatures.push({name:"getfeaturesetinfo",min:1,max:1}),e.functions.filterbysubtypecode=function(t,n){return e.standardFunctionAsync(t,n,async(e,r,i)=>{if((0,f.B)(i,2,2,t,n),(0,f.m)(i[0])){const e=await i[0].load(),r=i[1];if(!(0,Ie.Fq)(r))throw new l.D$(t,"InvalidParameter",n);if(e.subtypeField){const t=b.A.create(`${e.subtypeField}= ${i[1]}`,{fieldsIndex:e.getFieldsIndex(),timeZone:e.dateFieldsTimeZoneDefaultUTC});return new x.A({parentfeatureset:i[0],whereclause:t})}if(null===e.typeIdField||""===e.typeIdField)throw new l.D$(t,"FeatureSetDoesNotHaveSubtypes",n);const a=b.A.create(`${e.typeIdField}= ${i[1]}`,{fieldsIndex:e.getFieldsIndex(),timeZone:e.dateFieldsTimeZoneDefaultUTC});return new x.A({parentfeatureset:i[0],whereclause:a})}throw new l.D$(t,"InvalidParameter",n)})},e.signatures.push({name:"filterbysubtypecode",min:2,max:2})}}},80672:(e,t,n)=>{n.d(t,{R:()=>i});var r=n(20655);function i(e,t){return null===e?t:new r.A({url:e.field("url")})}},85978:(e,t,n)=>{n.d(t,{A:()=>s});var r=n(87449),i=n(11221),a=n(33325);class s extends i.t{constructor(e){super(e),this.declaredClass="esri.layers.featureset.sources.Empty",this._maxProcessing=1e3,this._parent=e.parentfeatureset,this._databaseType=0}async _queryAll(){return i.A.features}async query(e){return i.A}async queryStat(e){return await this._manualStat(e.stat,e.field,e.limit??a.gO,e.abortSignal)}async canQueryAggregate(e){return!1}async queryAggregate(e){throw new r.dr("NeverReach")}async queryAttachments(){return[]}}}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3693],{3693:(e,t,n)=>{n.r(t),n.d(t,{registerFunctions:()=>_e});var r=n(52106),i=n(66131),a=n(47609),s=n(66395),o=n(59534),l=n(85935),u=n(93833),d=n(47423),c=n(93818),f=n(78878),p=n(80672),h=n(48938),m=n(78502),y=n(87449),g=n(11221),w=n(33325),I=n(80609),F=n(1262),b=n(88368),A=n(16930);class N{constructor(e){this.field=e,this.sqlRewritable=!1}postInitialization(e,t){}}class S extends N{constructor(e){super(e),this.sqlRewritable=!0}extractValue(e){return e.attributes[this.field.name]}rewriteSql(e){return{rewritten:this.sqlRewritable,where:e}}}class T extends N{constructor(e,t,n){super((0,w.ke)(e)),this.originalField=e,this.sqlRewritable=!0,this.field.name=t,this.field.alias=n}rewriteSql(e,t){return{rewritten:this.sqlRewritable,where:(0,I.bD)(e,this.field.name,this.originalField.name,t.getFieldsIndex())}}extractValue(e){return e.attributes[this.originalField.name]}}class _ extends N{constructor(e,t,n){super(e),this.codefield=t,this.lkp=n,this.reverseLkp={};for(const e in n)this.reverseLkp[n[e]]=e;this.sqlRewritable=!0}static{this.BADNESS="_!!!_BAD_LKP_!!!!"}rewriteSql(e,t){const n=this.evaluateNodeToWhereClause(e.parseTree,0,this.field.name,this.codefield instanceof b.A?(0,I.YY)(this.codefield,0):this.codefield,e.parameters);return n.includes(_.BADNESS)?{rewritten:!1,where:e}:{rewritten:this.sqlRewritable,where:b.A.create(n,{fieldsIndex:t._parent.getFieldsIndex(),timeZone:t.dateFieldsTimeZoneDefaultUTC})}}evaluateNodeToWhereClause(e,t,n=null,r=null,i){let a,s,o,l;switch(e.type){case"interval":return(0,I.oj)(this.evaluateNodeToWhereClause(e.value,t,n,r,i),e.qualifier,e.op);case"case-expression":{let r=" CASE ";"simple"===e.format&&(r+=this.evaluateNodeToWhereClause(e.operand,t,n,_.BADNESS,i));for(let a=0;a<e.clauses.length;a++)r+=" WHEN "+this.evaluateNodeToWhereClause(e.clauses[a].operand,t,n,_.BADNESS,i)+" THEN "+this.evaluateNodeToWhereClause(e.clauses[a].value,t,n,_.BADNESS,i);return null!==e.else&&(r+=" ELSE "+this.evaluateNodeToWhereClause(e.else,t,n,_.BADNESS,i)),r+=" END ",r}case"parameter":{const n=i[e.value.toLowerCase()];if("string"==typeof n)return"'"+n.toString().replaceAll("'","''")+"'";if((0,w.$P)(n))return(0,I.bm)(n,t);if((0,w.Lk)(n))return(0,I.bm)(n,t);if((0,w.eg)(n))return(0,I.F1)(n,t);if((0,w.rX)(n))return(0,I.R8)(n,t);if((0,w.f0)(n))return(0,I.Nf)(n,t);if(Array.isArray(n)){const e=[];for(let r=0;r<n.length;r++)"string"==typeof n[r]?e.push("'"+n[r].toString().replaceAll("'","''")+"'"):(0,w.$P)(n[r])||(0,w.Lk)(n[r])?e.push((0,I.bm)(n[r],t)):(0,w.eg)(n[r])?e.push((0,I.F1)(n[r],t)):(0,w.rX)(n[r])?e.push((0,I.R8)(n[r],t)):(0,w.f0)(n[r])?e.push((0,I.Nf)(n[r],t)):e.push(n[r].toString());return e}return n.toString()}case"expression-list":s=[];for(const a of e.value)s.push(this.evaluateNodeToWhereClause(a,t,n,r,i));return s;case"unary-expression":return" ( NOT "+this.evaluateNodeToWhereClause(e.expr,t,n,_.BADNESS,i)+" ) ";case"binary-expression":switch(e.operator){case"AND":return" ("+this.evaluateNodeToWhereClause(e.left,t,n,r,i)+" AND "+this.evaluateNodeToWhereClause(e.right,t,n,r,i)+") ";case"OR":return" ("+this.evaluateNodeToWhereClause(e.left,t,n,r,i)+" OR "+this.evaluateNodeToWhereClause(e.right,t,n,r,i)+") ";case"IS":if("null"!==e.right.type)throw new F.L("UnsupportedIsRhs");return" ("+this.evaluateNodeToWhereClause(e.left,t,n,r,i)+" IS NULL )";case"ISNOT":if("null"!==e.right.type)throw new F.L("UnsupportedIsRhs");return" ("+this.evaluateNodeToWhereClause(e.left,t,n,r,i)+" IS NOT NULL )";case"IN":if(a=[],"expression-list"===e.right.type){if("column-reference"===e.left.type&&e.left.column.toUpperCase()===this.field.name.toUpperCase()){const a=[];let s=!0;for(const t of e.right.value){if("string"!==t.type){s=!1;break}if(void 0===this.lkp[t.value]){s=!1;break}a.push(this.lkp[t.value].toString())}if(s)return" ("+this.evaluateNodeToWhereClause(e.left,t,n,r,i)+" IN ("+a.join(",")+")) "}return a=this.evaluateNodeToWhereClause(e.right,t,n,r,i)," ("+this.evaluateNodeToWhereClause(e.left,t,n,r,i)+" IN ("+a.join(",")+")) "}return l=this.evaluateNodeToWhereClause(e.right,t,n,r,i),Array.isArray(l)?" ("+this.evaluateNodeToWhereClause(e.left,t,n,r,i)+" IN ("+l.join(",")+")) ":" ("+this.evaluateNodeToWhereClause(e.left,t,n,r,i)+" IN ("+l+")) ";case"NOT IN":if(a=[],"expression-list"===e.right.type){if("column-reference"===e.left.type&&e.left.column.toUpperCase()===this.field.name.toUpperCase()){const a=[];let s=!0;for(const t of e.right.value){if("string"!==t.type){s=!1;break}if(void 0===this.lkp[t.value]){s=!1;break}a.push(this.lkp[t.value].toString())}if(s)return" ("+this.evaluateNodeToWhereClause(e.left,t,n,r,i)+" NOT IN ("+a.join(",")+")) "}return a=this.evaluateNodeToWhereClause(e.right,t,n,r,i)," ("+this.evaluateNodeToWhereClause(e.left,t,n,r,i)+" NOT IN ("+a.join(",")+")) "}return l=this.evaluateNodeToWhereClause(e.right,t,n,r,i),Array.isArray(l)?" ("+this.evaluateNodeToWhereClause(e.left,t,n,r,i)+" NOT IN ("+l.join(",")+")) ":" ("+this.evaluateNodeToWhereClause(e.left,t,n,r,i)+" NOT IN ("+l+")) ";case"BETWEEN":return o=this.evaluateNodeToWhereClause(e.right,t,n,_.BADNESS,i)," ("+this.evaluateNodeToWhereClause(e.left,t,n,_.BADNESS,i)+" BETWEEN "+o[0]+" AND "+o[1]+" ) ";case"NOTBETWEEN":return o=this.evaluateNodeToWhereClause(e.right,t,n,_.BADNESS,i)," ("+this.evaluateNodeToWhereClause(e.left,t,n,_.BADNESS,i)+" NOT BETWEEN "+o[0]+" AND "+o[1]+" ) ";case"LIKE":return""!==e.escape?" ("+this.evaluateNodeToWhereClause(e.left,t,n,_.BADNESS,i)+" LIKE "+this.evaluateNodeToWhereClause(e.right,t,n,_.BADNESS,i)+" ESCAPE '"+e.escape+"') ":" ("+this.evaluateNodeToWhereClause(e.left,t,n,_.BADNESS,i)+" LIKE "+this.evaluateNodeToWhereClause(e.right,t,n,_.BADNESS,i)+") ";case"NOT LIKE":return""!==e.escape?" ("+this.evaluateNodeToWhereClause(e.left,t,n,_.BADNESS,i)+" NOT LIKE "+this.evaluateNodeToWhereClause(e.right,t,n,_.BADNESS,i)+" ESCAPE '"+e.escape+"') ":" ("+this.evaluateNodeToWhereClause(e.left,t,n,_.BADNESS,i)+" NOT LIKE "+this.evaluateNodeToWhereClause(e.right,t,n,_.BADNESS,i)+") ";case"<>":case"=":if("column-reference"===e.left.type&&"string"===e.right.type){if(e.left.column.toUpperCase()===this.field.name.toUpperCase()&&void 0!==this.lkp[e.right.value.toString()])return" ("+r+" "+e.operator+" "+this.lkp[e.right.value.toString()].toString()+") "}else if("column-reference"===e.right.type&&"string"===e.left.type&&e.right.column.toUpperCase()===this.field.name.toUpperCase())return" ("+this.lkp[e.right.value.toString()].toString()+" "+e.operator+" "+r+") ";return" ("+this.evaluateNodeToWhereClause(e.left,t,n,_.BADNESS,i)+" "+e.operator+" "+this.evaluateNodeToWhereClause(e.right,t,n,_.BADNESS,i)+") ";case"<":case">":case">=":case"<=":case"*":case"-":case"+":case"/":case"||":return" ("+this.evaluateNodeToWhereClause(e.left,t,n,_.BADNESS,i)+" "+e.operator+" "+this.evaluateNodeToWhereClause(e.right,t,n,_.BADNESS,i)+") "}case"null":return"null";case"boolean":return!0===e.value?"1":"0";case"string":return"'"+e.value.toString().replaceAll("'","''")+"'";case"timestamp":return`timestamp '${e.value}'`;case"date":return`date '${e.value}'`;case"time":return`time '${e.value}'`;case"number":return e.value.toString();case"current-time":return(0,I.C6)(e.mode,t);case"current-user":return"CURRENT_USER";case"column-reference":return n&&n.toLowerCase()===e.column.toLowerCase()?"("+r+")":(0,I.Kb)(e.column);case"data-type":return e.value;case"function":{const r=this.evaluateNodeToWhereClause(e.args,t,n,_.BADNESS,i);return(0,I.F6)(e.name,r,t)}}throw new F.L("UnsupportedSyntax",{node:e.type})}extractValue(e){if(this.codefield instanceof b.A){const t=this.codefield.calculateValueCompiled(e);return this.reverseLkp[b.A.convertValueToStorageFormat(t)]}return this.reverseLkp[e.attributes[this.codefield]]}}class C extends N{constructor(e,t){super(e),this._sql=t}rewriteSql(e,t){return{rewritten:!0,where:(0,I.bD)(e,this.field.name,(0,I.YY)(this._sql,0),t.getFieldsIndex())}}extractValue(e){return b.A.convertValueToStorageFormat(this._sql.calculateValueCompiled(e),this.field.type)}}class v extends g.t{static findField(e,t){for(const n of e)if(n.name.toLowerCase()===t.toString().toLowerCase())return n;return null}constructor(e){super(e),this.declaredClass="esri.arcade.featureset.actions.Adapted",this.adaptedFields=[],this._extraFilter=null,this._extraFilter=e.extraFilter,this._parent=e.parentfeatureset,this._maxProcessing=30,this.adaptedFields=e.adaptedFields}_initialiseFeatureSet(){null!==this._parent?(this.geometryType=this._parent.geometryType,this.objectIdField=this._parent.objectIdField,this.globalIdField=this._parent.globalIdField,this.spatialReference=this._parent.spatialReference,this.hasM=this._parent.hasM,this.hasZ=this._parent.hasZ,this.typeIdField=this._parent.typeIdField,this.types=this._parent.types):(this.spatialReference=new A.A({wkid:4326}),this.objectIdField="",this.globalIdField="",this.geometryType=w.ik.point,this.typeIdField="",this.types=null,this.subtypeField=null,this.subtypes=null),this.fields=[];for(const e of this.adaptedFields)e.postInitialization(this,this._parent),this.fields.push(e.field)}async _queryAll(){return await this._ensureLoaded(),this._extraFilter?(await this.query({abortSignal:h._})).features:this._calculateFields(await this._parent.queryAll(h._))}async query(e){let t=!1,n=e.where??null;const r=this._reformulateWithoutAdaptions(n);t=r.cannot,n=r.where;let i=!1,a=e.orderBy;if(null!=a){i=!0;const e=[];for(const t of this.adaptedFields)if(!(t instanceof S)&&!0===a.scanForField(t.field.name)){if(!(t instanceof T)){a=null,i=!1;break}e.push({field:t.field.name,newfield:t.originalField.name})}a&&e.length>0&&(a=a.replaceFields(e))}null!=n?null!=this._extraFilter&&(n=(0,I.kg)(this._extraFilter,n)):n=this._extraFilter,await this._ensureLoaded();const s=await this._parent.query({...e,where:n,orderBy:a});return(0,y.dZ)(e.abortSignal),!0===t?{...s,filterApplied:!1,ordered:!0===i&&s.ordered,features:this._calculateFields(s.features)}:{...s,ordered:!0===i&&s.ordered,features:this._calculateFields(s.features)}}async*_calculateFields(e){for await(const t of e)yield t.map(e=>{const t={};for(const n of this.adaptedFields)t[n.field.name]=n.extractValue(e);return new r.A({attributes:t,geometry:(0,m.Yq)(e.geometry)})})}async queryStat(e){let t=!1,n=e.field,r=this._reformulateWithoutAdaptions(n);t=r.cannot,n=r.where;let i=e.where??null;if(r=this._reformulateWithoutAdaptions(i),t=t||r.cannot,i=r.where,null!=i?null!==this._extraFilter&&(i=(0,I.kg)(this._extraFilter,i)):i=this._extraFilter,!0===t)return null==i&&null==e.spatialFilter?this._manualStat(e.stat,n,e.limit??w.gO,e.abortSignal):{calculated:!1};const a=await this._parent.queryStat({...e,field:n,where:i});return!1===a.calculated?null==i&&null==e.spatialFilter?this._manualStat(e.stat,n,e.limit??w.gO,e.abortSignal):{calculated:!1}:a}async canQueryAggregate(e){if(null===this._parent)return!1;for(let t=0;t<e.groupBy.length;t++)for(const n of this.adaptedFields)if(e.groupBy[t].toLowerCase()===n.field.name.toLowerCase()&&!(n instanceof S))return!1;const t=[];for(let n=0;n<e.statistics.length;n++){const r=e.statistics[n];if(null!==r.workingexpr){const e=this._reformulateWithoutAdaptions(r.workingexpr);if(e.cannot)return!1;const n=r.clone();n.workingexpr=e.where,t.push(n)}else t.push(r)}let n=e.where??null;const r=this._reformulateWithoutAdaptions(n);return!r.cannot&&(n=r.where,null!==n?null!==this._extraFilter&&(n=(0,I.kg)(this._extraFilter,n)):n=this._extraFilter,this._parent.canQueryAggregate({...e,statistics:t,where:n}))}async queryAggregate(e){if(null===this._parent)throw new y.dr("NeverReach");const t=[];for(let n=0;n<e.statistics.length;n++){const r=e.statistics[n];if(null!==r.workingexpr){const e=this._reformulateWithoutAdaptions(r.workingexpr);if(e.cannot)throw new y.dr("NeverReach");const n=r.clone();n.workingexpr=e.where,t.push(n)}else t.push(r)}let n=e.where??null;const r=this._reformulateWithoutAdaptions(n);if(r.cannot)throw new y.dr("NeverReach");return n=r.where,null!==n?null!==this._extraFilter&&(n=(0,I.kg)(this._extraFilter,n)):n=this._extraFilter,this._parent.queryAggregate({...e,statistics:t,where:n})}_reformulateWithoutAdaptions(e){const t={cannot:!1,where:e};if(null!==e)for(const n of this.adaptedFields)if(!0===(0,I.Ju)(e,n.field.name)){const r=n.rewriteSql(e,this);if(!0!==r.rewritten){t.cannot=!0,t.where=null;break}t.where=r.where}return t}}var x=n(35704),D=n(4576);class E extends g.t{constructor(e){super(e),this.declaredClass="esri.arcade.featureset.actions.OrderBy",this._maxProcessing=100,this._orderbyclause=e.orderbyclause,this._parent=e.parentfeatureset}async _queryAll(){return(await this.query({abortSignal:h._})).features}async query(e){await this._ensureLoaded();const t=await this._parent.query({...e,orderBy:null==e.orderBy?this._orderbyclause:e.orderBy});return(0,y.dZ)(e.abortSignal),!1===t.ordered?{...t,ordered:!0,features:this._sortFeatures(t.features,e.abortSignal)}:t}async*_sortFeatures(e,t){const n=[];for await(const r of e)n.push(r),await(0,f.a2)(),(0,y.dZ)(t);const r=n.flat();this._orderbyclause.order(r);for(const e of(0,D.Ho)(r,this._maxQueryRate()))yield e}async queryStat(e){const t=await this._parent.queryStat(e);return!1===t.calculated?null==e.where&&null==e.spatialFilter?this._manualStat(e.stat,e.field,e.limit??w.gO,e.abortSignal):{calculated:!1}:t}async canQueryAggregate(e){return this._parent.canQueryAggregate(e)}async queryAggregate(e){return this._parent.queryAggregate(e)}getFieldsIndex(){return this._parent.getFieldsIndex()}}function k(e,t){return e===t?0:null===e?-1:null===t?1:e<t?-1:1}class L{constructor(e){const t=e.split(",");this._fields=[],this._directions=[];for(let e=0;e<t.length;e++){const n=t[e].match(/\S+/g);this._fields.push(n[0]),2===n.length?"asc"===n[1].toLowerCase()?this._directions.push(1):this._directions.push(0):this._directions.push(1)}}constructClause(){let e="";for(let t=0;t<this._fields.length;t++)0!==t&&(e+=","),e+=this._fields[t],1===this._directions[t]?e+=" ASC":e+=" DESC";return e}order(e){e.sort((e,t)=>{for(let n=0;n<this._fields.length;n++){const r=this.featureValue(e,this._fields[n],n),i=this.featureValue(t,this._fields[n],n);let a=0;if(a=1===this._directions[n]?k(r,i):-1*k(r,i),0!==a)return a}return 0})}scanForField(e){for(let t=0;t<this._fields.length;t++)if(this._fields[t].toLowerCase().trim()===e.toLowerCase().trim())return!0;return!1}replaceFields(e){let t="";for(let n=0;n<this._fields.length;n++){0!==n&&(t+=",");let r=this._fields[n];for(const t of e)if(r.toLowerCase()===t.field.toLowerCase()){r=t.newfield;break}t+=r,1===this._directions[n]?t+=" ASC":t+=" DESC"}return new L(t)}featureValue(e,t,n){const r=e.attributes[t];if(void 0!==r)return r;for(const r in e.attributes)if(t.toLowerCase()===r.toLowerCase())return this._fields[n]=r,e.attributes[r];return null}}class U{constructor(){this.field="",this.tofieldname="",this.typeofstat="MIN",this.workingexpr=null}clone(){const e=new U;return e.field=this.field,e.tofieldname=this.tofieldname,e.typeofstat=this.typeofstat,e.workingexpr=this.workingexpr,e}static parseStatField(e,t,n,r){const i=new U;i.field=e;const a=b.A.create(t,{fieldsIndex:n,timeZone:r}),s=function(e){if("function"===e.parseTree.type){if(0===e.parseTree.args.value.length)return{name:e.parseTree.name,expr:null};if(e.parseTree.args.value.length>1)throw new F.L("MissingStatisticParameters");const t=b.A.create((0,I.Mi)(e.parseTree.args.value[0],0,e.parameters),{fieldsIndex:e.fieldsIndex,timeZone:e.timeZone,currentUser:e.currentUser});return{name:e.parseTree.name,expr:t}}return null}(a);if(null===s)throw new F.L("UnsupportedSqlFunction",{function:""});const o=s.name.toUpperCase().trim();if("MIN"===o){if(i.typeofstat="MIN",i.workingexpr=s.expr,null===a)throw new F.L("InvalidFunctionParameters",{function:"min"})}else if("MAX"===o){if(i.typeofstat="MAX",i.workingexpr=s.expr,null===a)throw new F.L("InvalidFunctionParameters",{function:"max"})}else if("COUNT"===o)i.typeofstat="COUNT",i.workingexpr=s.expr;else if("STDEV"===o){if(i.typeofstat="STDDEV",i.workingexpr=s.expr,null===a)throw new F.L("InvalidFunctionParameters",{function:"stdev"})}else if("SUM"===o){if(i.typeofstat="SUM",i.workingexpr=s.expr,null===a)throw new F.L("InvalidFunctionParameters",{function:"sum"})}else if("MEAN"===o){if(i.typeofstat="AVG",i.workingexpr=s.expr,null===a)throw new F.L("InvalidFunctionParameters",{function:o})}else if("AVG"===o){if(i.typeofstat="AVG",i.workingexpr=s.expr,null===a)throw new F.L("InvalidFunctionParameters",{function:"avg"})}else{if("VAR"!==o)throw new F.L("UnsupportedSqlFunction",{function:o});if(i.typeofstat="VAR",i.workingexpr=s.expr,null===a)throw new F.L("InvalidFunctionParameters",{function:"var"})}return i}toStatisticsName(){switch(this.typeofstat.toUpperCase()){case"MIN":return"min";case"MAX":return"max";case"SUM":return"sum";case"COUNT":default:return"count";case"VAR":return"var";case"STDDEV":return"stddev";case"AVG":return"avg"}}}var j=n(80200),$=n(74639),Z=n(44729),M=n(55612),W=n(15032),R=n(20437),B=n(95466);const q=new o.b(["MIN","MAX","VAR","STDDEV","COUNT","SUM","AVG"],[["VARIANCE","VAR"],["AVERAGE","AVG"],["MEAN","AVG"],["STDEV","STDDEV"]]);class P extends g.t{constructor(e){super(e),this._decodedStatsfield=[],this._decodedGroupbyfield=[],this._candosimplegroupby=!0,this.phsyicalgroupbyfields=[],this.objectIdField="ROW__ID",this._internalObjectIdField="ROW__ID",this._adaptedFields=[],this.declaredClass="esri.arcade.featureset.actions.Aggregate",this._uniqueIds=1,this._maxQuery=10,this._maxProcessing=10,this._parent=e.parentfeatureset,this._config=e}isTable(){return!0}_nextUniqueName(e){for(;1===e["T"+this._uniqueIds.toString()];)this._uniqueIds++;const t="T"+this._uniqueIds.toString();return e[t]=1,t}_convertToEsriFieldType(e){return e}_initialiseFeatureSet(){const e={};let t=!1,n=1;const r=this._parent?this._parent.getFieldsIndex():new B.A([]);for(this.objectIdField="ROW__ID",this.globalIdField="";!1===t;){let e=!1;for(let t=0;t<this._config.groupbyfields.length;t++)if(this._config.groupbyfields[t].name.toLowerCase()===this.objectIdField.toLowerCase()){e=!0;break}if(!1===e)for(let t=0;t<this._config.statsfields.length;t++)if(this._config.statsfields[t].name.toLowerCase()===this.objectIdField.toLowerCase()){e=!0;break}!1===e?t=!0:(this.objectIdField="ROW__ID"+n.toString(),n++)}for(const e of this._config.statsfields){const t=new U;t.field=e.name,t.tofieldname=e.name,t.workingexpr=e.expression instanceof b.A?e.expression:b.A.create(e.expression,{fieldsIndex:r,timeZone:this.dateFieldsTimeZoneDefaultUTC}),t.typeofstat=q.lookup(e.statistic)??"COUNT",this._decodedStatsfield.push(t)}this._decodedGroupbyfield=[];for(const e of this._config.groupbyfields){const t={name:e.name,singlefield:null,tofieldname:e.name,expression:e.expression instanceof b.A?e.expression:b.A.create(e.expression,{fieldsIndex:r,timeZone:this.dateFieldsTimeZoneDefaultUTC}),sqlType:null};this._decodedGroupbyfield.push(t)}if(null!==this._parent){this.geometryType=this._parent.geometryType,this.spatialReference=this._parent.spatialReference,this.hasM=this._parent.hasM,this.hasZ=this._parent.hasZ,this.typeIdField="";for(const t of this._parent.fields)e[t.name.toUpperCase()]=1;this.types=null,this.subtypes=null,this.subtypeField=""}else this.geometryType=w.ik.point,this.typeIdField="",this.types=null,this.subtypes=null,this.subtypeField="",this.spatialReference=new A.A({wkid:4326});this.fields=[];const i=new U;i.field=this._nextUniqueName(e),i.tofieldname=this.objectIdField,i.workingexpr=b.A.create(this._parent.objectIdField,{fieldsIndex:this._parent.getFieldsIndex(),timeZone:this.dateFieldsTimeZoneDefaultUTC}),i.typeofstat="MIN",this._decodedStatsfield.push(i);for(const t of this._decodedGroupbyfield){const n=new R.A;if(t.name=this._nextUniqueName(e),n.name=t.tofieldname,n.alias=n.name,(0,I.DA)(t.expression)){const e=this._parent.getField((0,I.YY)(t.expression,0));if(!e)throw new y.dr("AggregationFieldNotFound");t.name=e.name,t.singlefield=e.name,this.phsyicalgroupbyfields.push(e.name),n.type=e.type,t.sqlType=e.type}else{n.type=this._convertToEsriFieldType((0,I.IY)(t.expression,this._parent.fields));const e=new R.A;e.name=t.name,e.alias=e.name,this.phsyicalgroupbyfields.push(t.name),this._adaptedFields.push(new C(e,t.expression)),this._candosimplegroupby=!1,t.sqlType=n.type}this.fields.push(n)}if(this._adaptedFields.length>0)for(const e of this._parent.fields)this._adaptedFields.push(new S(e));for(let t=0;t<this._decodedStatsfield.length;t++){const n=new R.A;let r=null;const i=this._decodedStatsfield[t];i.field=this._nextUniqueName(e),i.tofieldname===this.objectIdField&&(this._internalObjectIdField=i.field),n.name=i.tofieldname,n.alias=n.name;const a=null!==i.workingexpr&&(0,I.DA)(i.workingexpr)?(0,I.YY)(i.workingexpr,0):"";switch(this._decodedStatsfield[t].typeofstat){case"SUM":if(""!==a){if(r=this._parent.getField(a),!r)throw new y.dr("AggregationFieldNotFound");n.type=r.type}else n.type="double";break;case"MIN":case"MAX":if(""!==a){if(r=this._parent.getField(a),!r)throw new y.dr("AggregationFieldNotFound");n.type=r.type}else n.type="double";break;case"COUNT":n.type="integer";break;case"STDDEV":case"VAR":case"AVG":if(""!==a&&(r=this._parent.getField(a),!r))throw new y.dr("AggregationFieldNotFound");n.type="double"}this.fields.push(n)}}async _queryAll(){return(await this.query({abortSignal:h._})).features}async query(e){if(null!=e.spatialFilter)return g.A;const t={ordered:!1,nowhereclause:!1};await this._ensureLoaded();let n=e.where;if(null!=n)for(let e=0;e<this._decodedStatsfield.length;e++)if(!0===(0,I.Ju)(n,this._decodedStatsfield[e].tofieldname)){t.nowhereclause=!0,n=null;break}let r=e.orderBy;if(null!=r){t.ordered=!0;for(let e=0;e<this._decodedStatsfield.length;e++)if(!0===r.scanForField(this._decodedStatsfield[e].tofieldname)){r=null,t.ordered=!1;break}if(null!==r)for(const e of this._decodedGroupbyfield)if(null===e.singlefield&&!0===r.scanForField(e.tofieldname)){r=null,t.ordered=!1;break}}if(!1!==this._candosimplegroupby&&await this._parent.canQueryAggregate({groupBy:this.phsyicalgroupbyfields,statistics:this._decodedStatsfield,where:null,spatialFilter:null,abortSignal:e.abortSignal})){let i=null;n&&(i=this._reformulateWhereClauseWithoutGroupByFields(n));let a=null;r&&(a=this._reformulateOrderClauseWithoutGroupByFields(r));const s=await this._parent.queryAggregate({groupBy:this.phsyicalgroupbyfields,statistics:this._decodedStatsfield,where:i,spatialFilter:null,orderBy:a,abortSignal:e.abortSignal});return(0,y.dZ)(e.abortSignal),{...s,filterApplied:!t.nowhereclause&&s.filterApplied,ordered:!0===t.ordered&&s.ordered,features:this._fixAggregateAttributeNames(s.features)}}let i=this._parent;if(this._adaptedFields.length>0&&(i=new v({parentfeatureset:this._parent,adaptedFields:this._adaptedFields,extraFilter:null})),!0===t.nowhereclause){const t=new E({parentfeatureset:i,orderbyclause:new L(this.phsyicalgroupbyfields.join(",")+","+this._parent.objectIdField+" ASC")});return{filterApplied:!1,spatialFilterApplied:!1,ordered:!1,features:this._aggregateSortedFeatureGroups((await t.query({abortSignal:e.abortSignal})).features,this._maxQuery,e.abortSignal)}}let a=i;if(null!==n){let e=null;n&&(e=this._reformulateWhereClauseWithoutGroupByFields(n)),a=new x.A({parentfeatureset:a,whereclause:e})}const s=new E({parentfeatureset:a,orderbyclause:new L(this.phsyicalgroupbyfields.join(",")+","+this._parent.objectIdField+" ASC")});return{filterApplied:!1,spatialFilterApplied:!1,ordered:!1,features:this._aggregateSortedFeatureGroups((await s.query({abortSignal:e.abortSignal})).features,this._maxQuery,e.abortSignal)}}async*_fixAggregateAttributeNames(e){for await(const t of e)yield t.map(e=>{const t={geometry:e.geometry,attributes:{}},n={};for(const t in e.attributes)n[t.toLowerCase()]=e.attributes[t];for(const e of this._decodedGroupbyfield)t.attributes[e.tofieldname]=n[e.name.toLowerCase()];for(const e of this._decodedStatsfield)t.attributes[e.tofieldname]=n[e.field.toLowerCase()];return new r.A(t)})}async*_aggregateSortedFeatureGroups(e,t,n){let r=null,i=[];for await(const a of e){await(0,f.a2)(),(0,y.dZ)(n);for(const e of a){const t=this._generateAggregateHash(e);null==r?r={features:[e],id:t}:t!==r.id?(i.push(this._calculateAndAppendAggregateItem(r)),r=null,r={features:[e],id:t}):r.features.push(e)}i.length>=t&&(yield i,i=[])}null!=r&&(i.push(this._calculateAndAppendAggregateItem(r)),yield i)}async queryStat(e){return{calculated:!1}}async canQueryAggregate(e){return!1}async queryAggregate(e){throw new y.dr("NeverReach")}_reformulateWhereClauseWithoutStatsFields(e){for(const t of this._decodedStatsfield)e=(0,I.bD)(e,t.tofieldname,(0,I.YY)(t.workingexpr,0),this._parent.getFieldsIndex());return e}_reformulateWhereClauseWithoutGroupByFields(e){for(const t of this._decodedGroupbyfield)t.tofieldname!==t.name&&(e=(0,I.bD)(e,t.tofieldname,(0,I.YY)(t.expression,0),this._parent.getFieldsIndex()));return e}_reformulateOrderClauseWithoutGroupByFields(e){const t=[];for(const e of this._decodedGroupbyfield)e.tofieldname!==e.name&&t.push({field:e.tofieldname,newfield:e.name});return t.length>0?e.replaceFields(t):e}_calculateFieldStat(e,t,n){const r=[];for(const n of e.features)if(null!==t.workingexpr){const e=t.workingexpr.calculateValue(n);null!==e&&(e instanceof Z.n||e instanceof W.k?r.push(e.toNumber()):e instanceof M.g?r.push(e.toMilliseconds()):r.push(e))}else r.push(null);n.attributes[t.tofieldname]=(0,$.s)(t.typeofstat,[r])}_calculateAndAppendAggregateItem(e){const t={attributes:{},geometry:null};for(const n of this._decodedGroupbyfield){const r=n.singlefield?e.features[0].attributes[n.singlefield]:b.A.convertValueToStorageFormat(n.expression.calculateValue(e.features[0]),n.sqlType);t.attributes[n.tofieldname]=r}for(const n of this._decodedStatsfield)this._calculateFieldStat(e,n,t);const n=[];for(let r=0;r<this._decodedStatsfield.length;r++)n.push(this._calculateFieldStat(e,this._decodedStatsfield[r],t));return new r.A({attributes:t.attributes,geometry:t.geometry})}_generateAggregateHash(e){let t="";for(const n of this._decodedGroupbyfield){const r=n.singlefield?e.attributes[n.singlefield]:n.expression.calculateValue(e);t+=null==r?":":":"+r.toString()}return(0,j.d)(t,j.T.String)}async getFeatureByObjectId(){return null}}class O extends g.t{constructor(e){super(e),this._topnum=0,this.declaredClass="esri.arcade.featureset.actions.Top",this._maxProcessing=100,this._topnum=e.topnum,this._parent=e.parentfeatureset}async _queryAll(){return(await this.query({abortSignal:h._})).features}async query(e){await this._ensureLoaded();const t=await this._parent.queryAll(e.abortSignal);return{filterApplied:null==e.where,spatialFilterApplied:null==e.spatialFilter,ordered:!1,features:this._limit(t,this._topnum)}}async*_limit(e,t){let n=t;for await(const t of e)if(n>=t.length?(n-=t.length,yield t):(yield t.slice(0,n),n=0),n<=0)break}async queryStat(e){return{calculated:!1}}async canQueryAggregate(e){return!1}async queryAggregate(e){throw new y.dr("NeverReach")}getFieldsIndex(){return this._parent.getFieldsIndex()}}var V=n(85978),G=n(30235),K=n(334),J=n(74887),H=n(68654),z=n(20655),Q=n(43773),Y=n(51447),X=n(53966),ee=n(66552);new ee.J({Clean:"clean",Dirty:"dirty"}),new ee.J({Physical:"physical",Virtual:"virtual"}),new ee.J({"Start and end":"start-and-end",Start:"start",Midspan:"midspan",End:"end"}),new ee.J({startingPoint:"starting-point",barrier:"barrier",stoppingPoint:"stopping-point"}),new ee.J({connected:"connected",upstream:"upstream",downstream:"downstream",shortestPath:"shortest-path",subnetwork:"subnetwork",subnetworkController:"subnetwork-controller",loops:"loops",isolation:"isolation",path:"path",circuit:"circuit"});const te="{00000000-0000-0000-0000-000000000000}",ne=new ee.J({junctionJunctionConnectivity:"junction-junction-connectivity",connectivity:"connectivity",attachment:"attachment",containment:"containment",junctionEdgeFromConnectivity:"junction-edge-from-connectivity",junctionEdgeMidspanConnectivity:"junction-edge-midspan-connectivity",junctionEdgeToConnectivity:"junction-edge-to-connectivity"});new ee.J({normal:"normal",rebuild:"rebuild",forceRebuild:"force-rebuild"});var re=n(2272),ie=n(31635),ae=n(25482),se=n(10107),oe=(n(44208),n(87811),n(64108)),le=n(36005),ue=n(43937),de=n(82799);let ce=class extends ae.o{constructor(e){super(e),this.type="networkElement",this.assetGroupCode=null,this.assetTypeCode=null,this.globalId=null,this.networkSourceId=null,this.objectId=null,this.positionFrom=null,this.positionTo=null,this.terminalId=null}};(0,ie.Cg)([(0,se.MZ)({json:{write:!1}})],ce.prototype,"type",void 0),(0,ie.Cg)([(0,se.MZ)({type:Number,json:{write:!0}})],ce.prototype,"assetGroupCode",void 0),(0,ie.Cg)([(0,se.MZ)({type:Number,json:{write:!0}})],ce.prototype,"assetTypeCode",void 0),(0,ie.Cg)([(0,se.MZ)({type:String,json:{write:!0}})],ce.prototype,"globalId",void 0),(0,ie.Cg)([(0,se.MZ)({type:Number,json:{write:!0}})],ce.prototype,"networkSourceId",void 0),(0,ie.Cg)([(0,se.MZ)({type:Number,json:{write:!0}})],ce.prototype,"objectId",void 0),(0,ie.Cg)([(0,se.MZ)({type:Number,json:{write:!0}})],ce.prototype,"positionFrom",void 0),(0,ie.Cg)([(0,se.MZ)({type:Number,json:{write:!0}})],ce.prototype,"positionTo",void 0),(0,ie.Cg)([(0,se.MZ)({type:Number,json:{write:!0}})],ce.prototype,"terminalId",void 0),ce=(0,ie.Cg)([(0,oe.$)("esri.rest.networks.support.NetworkElement")],ce);let fe=class extends ce{constructor(e){super(e),this.type="telecomNetworkElement",this.firstUnit=null,this.numUnits=null}};(0,ie.Cg)([(0,se.MZ)({json:{write:!1}})],fe.prototype,"type",void 0),(0,ie.Cg)([(0,se.MZ)({json:{write:!0}})],fe.prototype,"firstUnit",void 0),(0,ie.Cg)([(0,se.MZ)({json:{write:!0}})],fe.prototype,"numUnits",void 0),fe=(0,ie.Cg)([(0,oe.$)("esri.rest.networks.support.TelecomNetworkElement")],fe);let pe=class extends ae.o{constructor(e){super(e),this.globalId=null,this.associationType=null,this.fromNetworkElement=null,this.toNetworkElement=null,this.geometry=null,this.errorMessage=null,this.percentAlong=null,this.errorCode=null,this.isContentVisible=null,this.status=null}readFromNetworkElement(e,t){return t.fromFirstUnit||t.fromNumUnits?new fe({globalId:t.fromGlobalId,networkSourceId:t.fromNetworkSourceId,terminalId:t.fromTerminalId,firstUnit:t.fromFirstUnit,numUnits:t.fromNumUnits}):new ce({globalId:t.fromGlobalId,networkSourceId:t.fromNetworkSourceId,terminalId:t.fromTerminalId})}writeFromNetworkElement(e,t){if(e&&(t.fromGlobalId=e.globalId,t.fromNetworkSourceId=e.networkSourceId,t.fromTerminalId=e.terminalId,"telecomNetworkElement"===e.type)){const n=e;t.fromFirstUnit=n.firstUnit,t.fromNumUnits=n.numUnits}}readToNetworkElement(e,t){return t.toFirstUnit||t.toNumUnits?new fe({globalId:t.toGlobalId,networkSourceId:t.toNetworkSourceId,terminalId:t.toTerminalId,firstUnit:t.toFirstUnit,numUnits:t.toNumUnits}):new ce({globalId:t.toGlobalId,networkSourceId:t.toNetworkSourceId,terminalId:t.toTerminalId})}writeToNetworkElement(e,t){if(e&&(t.toGlobalId=e.globalId,t.toNetworkSourceId=e.networkSourceId,t.toTerminalId=e.terminalId,"telecomNetworkElement"===e.type)){const n=e;t.toFirstUnit=n.firstUnit,t.toNumUnits=n.numUnits}}equals(e){if(this.globalId===te&&e.globalId===te){function t(e,t){return e.networkSourceId===t.networkSourceId&&e.globalId===t.globalId&&e.terminalId===t.terminalId&&e.firstUnit===t.firstUnit&&e.numUnits===t.numUnits}const n=this.fromNetworkElement,r=this.toNetworkElement,i=e.fromNetworkElement,a=e.toNetworkElement,s=t(n,i),o=t(r,a);return s&&o&&this.associationType===e.associationType}return null!=this.globalId&&null!=e.globalId&&this.globalId===e.globalId}};(0,ie.Cg)([(0,se.MZ)({type:String,json:{write:!0}})],pe.prototype,"globalId",void 0),(0,ie.Cg)([(0,se.MZ)({type:ne.apiValues,json:{type:ne.jsonValues,read:ne.read,write:ne.write}})],pe.prototype,"associationType",void 0),(0,ie.Cg)([(0,se.MZ)({type:ce,json:{write:{target:{fromGlobalId:{type:String},fromNetworkSourceId:{type:Number},fromTerminalId:{type:Number},fromFirstUnit:{type:Number},fromNumUnits:{type:Number}}},read:{source:["fromGlobalId","fromNetworkSourceId","fromTerminalId","fromFirstUnit","fromNumUnits"]}}})],pe.prototype,"fromNetworkElement",void 0),(0,ie.Cg)([(0,le.w)("fromNetworkElement")],pe.prototype,"readFromNetworkElement",null),(0,ie.Cg)([(0,ue.K)("fromNetworkElement")],pe.prototype,"writeFromNetworkElement",null),(0,ie.Cg)([(0,se.MZ)({type:ce,json:{write:{target:{toGlobalId:{type:String},toNetworkSourceId:{type:Number},toTerminalId:{type:Number},toFirstUnit:{type:Number},toNumUnits:{type:Number}}},read:{source:["toGlobalId","toNetworkSourceId","toTerminalId","toFirstUnit","toNumUnits"]}}})],pe.prototype,"toNetworkElement",void 0),(0,ie.Cg)([(0,le.w)("toNetworkElement")],pe.prototype,"readToNetworkElement",null),(0,ie.Cg)([(0,ue.K)("toNetworkElement")],pe.prototype,"writeToNetworkElement",null),(0,ie.Cg)([(0,se.MZ)({type:de.A,json:{write:!0}})],pe.prototype,"geometry",void 0),(0,ie.Cg)([(0,se.MZ)({type:String,json:{write:!0}})],pe.prototype,"errorMessage",void 0),(0,ie.Cg)([(0,se.MZ)({type:Number,json:{write:!0}})],pe.prototype,"percentAlong",void 0),(0,ie.Cg)([(0,se.MZ)({type:Number,json:{write:!0}})],pe.prototype,"errorCode",void 0),(0,ie.Cg)([(0,se.MZ)({type:Boolean,json:{write:!0}})],pe.prototype,"isContentVisible",void 0),(0,ie.Cg)([(0,se.MZ)({type:Number,json:{write:!0}})],pe.prototype,"status",void 0),pe=(0,ie.Cg)([(0,oe.$)("esri.rest.networks.support.Association")],pe);let he=class extends ae.o{constructor(e){super(e),this.associations=[]}};function me(e){const{returnDeletes:t,elements:n,gdbVersion:r,moment:i}=e.toJSON();return{returnDeletes:t,elements:JSON.stringify(n.map(e=>({globalId:e.globalId,networkSourceId:e.networkSourceId,terminalId:e.terminalId}))),types:JSON.stringify(e.types.map(e=>ne.toJSON(e))).replaceAll('"connectivity"','"junctionJunctionConnectivity"'),gdbVersion:r,moment:i??Date.now()}}(0,ie.Cg)([(0,se.MZ)({type:[pe],json:{write:!0}})],he.prototype,"associations",void 0),he=(0,ie.Cg)([(0,oe.$)("esri.rest.networks.support.QueryAssociationsResult")],he);var ye,ge=n(56507);let we=ye=class extends ae.o{static from(e){return(0,ge.PZ)(ye,e)}constructor(e){super(e),this.returnDeletes=!1,this.elements=[],this.types=[],this.gdbVersion=null,this.moment=null}};(0,ie.Cg)([(0,se.MZ)({type:Boolean,json:{write:!0}})],we.prototype,"returnDeletes",void 0),(0,ie.Cg)([(0,se.MZ)({type:[ce],json:{write:!0}})],we.prototype,"elements",void 0),(0,ie.Cg)([(0,se.MZ)({type:[ne.apiValues],json:{type:ne.jsonValues,read:ne.read,write:ne.write}})],we.prototype,"types",void 0),(0,ie.Cg)([(0,se.MZ)({type:String,json:{write:!0}})],we.prototype,"gdbVersion",void 0),(0,ie.Cg)([(0,se.MZ)({type:Date,json:{type:Number,write:{writer:(e,t)=>{t.moment=e?.getTime()}}}})],we.prototype,"moment",void 0),we=ye=(0,ie.Cg)([(0,oe.$)("esri.rest.networks.support.QueryAssociationsParameters")],we);var Ie=n(54218);function Fe(e,t,n){const r=e.getVariables();if(r.length>0){const i={};for(const e of r)i[e]=t.evaluateIdentifier(n,{name:e});e.parameters=i}return e}function be(e,t,n=null){for(const n in e)if(n.toLowerCase()===t.toLowerCase())return e[n];return n}function Ae(e){if(null===e)return null;const t={type:be(e,"type",""),name:be(e,"name","")};if("range"===t.type)t.range=be(e,"range",[]);else{t.codedValues=[];for(const n of be(e,"codedValues",[]))t.codedValues.push({name:be(n,"name",""),code:be(n,"code",null)})}return t}function Ne(e){if(null===e)return null;const t={},n=be(e,"wkt");null!==n&&(t.wkt=n);const r=be(e,"wkid");return null!==r&&(t.wkid=r),t}function Se(e){if(null===e)return null;const t={hasZ:be(e,"hasz",!1),hasM:be(e,"hasm",!1)},n=be(e,"spatialreference");null!=n&&(t.spatialReference=Ne(n));const r=be(e,"x",null);if(null!==r)return t.x=r,t.y=be(e,"y",null),t.hasZ&&(t.z=be(e,"z",null)),t.hasM&&(t.m=be(e,"m",null)),t;const i=be(e,"rings",null);if(null!==i)return t.rings=i,t;const a=be(e,"paths",null);if(null!==a)return t.paths=a,t;const s=be(e,"points",null);if(null!==s)return t.points=s,t;for(const n of["xmin","xmax","ymin","ymax","zmin","zmax","mmin","mmax"]){const r=be(e,n,null);null!==r&&(t[n]=r)}return t}function Te(e){return"utc"===e?.toLowerCase()?"UTC":"unknown"===e?.toLowerCase()?"Unknown":e}function _e(e){if("async"===e.mode){e.functions.timezone=function(t,n){return e.standardFunctionAsync(t,n,async(e,r,a)=>{if((0,f.B)(a,1,2,t,n),(0,f.g)(a[0]))return"Unknown";if((0,f.f)(a[0]))return"Unknown";if((0,f.m)(a[0])){if(await a[0].load(),1===a.length||null===a[1])return a[0].datesInUnknownTimezone?Te("unknown"):Te(a[0].dateFieldsTimeZone);if(!(a[1]instanceof s.A)||!1===a[1].hasField("type"))throw new l.D$(t,"InvalidParameter",n);const e=a[1].field("type");if(!1===(0,Ie.Kg)(e))throw new l.D$(t,"InvalidParameter",n);switch((0,f.u)(e).toLowerCase()){case"preferredtimezone":return Te(a[0].preferredTimeZone);case"editfieldsinfo":return Te(a[0].editFieldsInfo?.timeZone??null);case"timeinfo":return Te(a[0].timeInfo?.timeZone??null);case"field":if(a[1].hasField("fieldname")&&(0,Ie.Kg)(a[1].field("fieldname")))return Te(a[0].fieldTimeZone((0,f.u)(a[1].field("fieldname"))))}throw new l.D$(t,"InvalidParameter",n)}const o=(0,f.O)(a[0],(0,f.K)(t));if(null===o)return null;const u=o.timeZone;return"system"===u?i.lY.systemTimeZoneCanonicalName:"utc"===u.toLowerCase()?"UTC":"unknown"===u.toLowerCase()?"Unknown":u})},e.functions.sqltimestamp=function(t,n){return e.standardFunctionAsync(t,n,async(e,r,i)=>{(0,f.B)(i,1,3,t,n);const a=i[0];if((0,f.e)(a)){if(1===i.length)return a.toSQLWithKeyword();if(2===i.length)return a.changeTimeZone((0,f.u)(i[1])).toSQLWithKeyword();throw new l.D$(t,"InvalidParameter",n)}if((0,f.f)(a))return a.toSQLWithKeyword();if((0,f.m)(a)){if(3!==i.length)throw new l.D$(t,"InvalidParameter",n);await a.load();const e=(0,f.u)(i[1]);if((0,f.f)(i[2]))return i[2].toSQLWithKeyword();if(!1===(0,f.e)(i[2]))throw new l.D$(t,"InvalidParameter",n);const r=a.fieldTimeZone(e);return null==r?i[2].toSQLWithKeyword():i[2].changeTimeZone(r).toSQLWithKeyword()}throw new l.D$(t,"InvalidParameter",n)})},e.signatures.push({name:"sqltimestamp",min:2,max:4}),e.functions.featuresetbyid=function(t,n){return e.standardFunctionAsync(t,n,(e,r,i)=>{if((0,f.B)(i,2,4,t,n),(0,f.l)(i[0])){const e=(0,f.u)(i[1]);let r=(0,f.J)(i[2],null);const a=(0,f.H)((0,f.J)(i[3],!0));if(null===r&&(r=["*"]),!1===(0,Ie.cy)(r))throw new l.D$(t,"InvalidParameter",n);return i[0].featureSetById(e,a,r)}throw new l.D$(t,"InvalidParameter",n)})},e.signatures.push({name:"featuresetbyid",min:2,max:4});const t=new o.b(["datasource","parent","root"]);e.functions.getfeatureset=function(n,r){return e.standardFunctionAsync(n,r,async(e,i,a)=>{if((0,f.B)(a,1,2,n,r),(0,f.k)(a[0])){const e=null==a[1]?"datasource":t.lookup((0,f.u)(a[1]));return(0,d.convertToFeatureSet)(a[0].fullSchema(),e,n.lrucache,n.interceptor,n.spatialReference)}throw new l.D$(n,"InvalidParameter",r)})},e.signatures.push({name:"getfeatureset",min:1,max:2}),e.functions.featuresetbyportalitem=function(t,n){return e.standardFunctionAsync(t,n,(e,r,i)=>{if((0,f.B)(i,2,5,t,n),null===i[0])throw new l.D$(t,"PortalRequired",n);if(i[0]instanceof a.A){const e=(0,f.u)(i[1]),r=(0,f.u)(i[2]);let a=(0,f.J)(i[3],null);const s=(0,f.H)((0,f.J)(i[4],!0));if(null===a&&(a=["*"]),!1===(0,Ie.cy)(a))throw new l.D$(t,"InvalidParameter",n);let o;return o=t.services?.portal?t.services.portal:z.A.getDefault(),o=(0,p.R)(i[0],o),(0,d.constructFeatureSetFromPortalItem)(e,r,t.spatialReference,a,s,o,t.lrucache,t.interceptor)}if(!1===(0,Ie.Kg)(i[0]))throw new l.D$(t,"PortalRequired",n);const s=(0,f.u)(i[0]),o=(0,f.u)(i[1]);let u=(0,f.J)(i[2],null);const c=(0,f.H)((0,f.J)(i[3],!0));if(null===u&&(u=["*"]),!1===(0,Ie.cy)(u))throw new l.D$(t,"InvalidParameter",n);return(0,d.constructFeatureSetFromPortalItem)(s,o,t.spatialReference,u,c,t.services?.portal??z.A.getDefault(),t.lrucache,t.interceptor)})},e.signatures.push({name:"featuresetbyportalitem",min:2,max:5}),e.functions.featuresetbyname=function(t,n){return e.standardFunctionAsync(t,n,(e,r,i)=>{if((0,f.B)(i,2,4,t,n),(0,f.l)(i[0])){const e=(0,f.u)(i[1]);let r=(0,f.J)(i[2],null);const a=(0,f.H)((0,f.J)(i[3],!0));if(null===r&&(r=["*"]),!1===(0,Ie.cy)(r))throw new l.D$(t,"InvalidParameter",n);return i[0].featureSetByName(e,a,r)}throw new l.D$(t,"InvalidParameter",n)})},e.signatures.push({name:"featuresetbyname",min:2,max:4}),e.functions.featureset=function(t,n){return e.standardFunction(t,n,(e,r,i)=>{(0,f.B)(i,1,1,t,n);const a={layerDefinition:{geometryType:"",objectIdField:"",globalIdField:"",typeIdField:"",hasM:!1,hasZ:!1,fields:[]},featureSet:{geometryType:"",features:[]}};if((0,Ie.Kg)(i[0])){const e=JSON.parse(i[0]);void 0!==e.layerDefinition?(a.layerDefinition=e.layerDefinition,a.featureSet=e.featureSet,e.layerDefinition.spatialReference&&(a.layerDefinition.spatialReference=e.layerDefinition.spatialReference)):(a.featureSet.features=e.features,a.featureSet.geometryType=e.geometryType,a.layerDefinition.geometryType=a.featureSet.geometryType,a.layerDefinition.objectIdField=e.objectIdFieldName??"",a.layerDefinition.typeIdField=e.typeIdFieldName,a.layerDefinition.globalIdField=e.globalIdFieldName,a.layerDefinition.fields=e.fields,e.spatialReference&&(a.layerDefinition.spatialReference=e.spatialReference))}else{if(!(i[0]instanceof s.A))throw new l.D$(t,"InvalidParameter",n);{const e=JSON.parse(i[0].castToText(!0)),r=be(e,"layerdefinition");if(null!==r){a.layerDefinition.geometryType=be(r,"geometrytype",""),a.featureSet.geometryType=a.layerDefinition.geometryType,a.layerDefinition.globalIdField=be(r,"globalidfield",""),a.layerDefinition.objectIdField=be(r,"objectidfield",""),a.layerDefinition.typeIdField=be(r,"typeidfield",""),a.layerDefinition.hasZ=!0===be(r,"hasz",!1),a.layerDefinition.hasM=!0===be(r,"hasm",!1);const t=be(r,"spatialreference");t&&(a.layerDefinition.spatialReference=Ne(t));const n=[];for(const e of be(r,"fields",[])){const t={name:be(e,"name",""),alias:be(e,"alias",""),type:be(e,"type",""),nullable:be(e,"nullable",!0),editable:be(e,"editable",!0),length:be(e,"length",null),domain:Ae(be(e,"domain"))};n.push(t)}a.layerDefinition.fields=n;const i=be(e,"featureset");if(i){const e={};for(const t of n)e[t.name.toLowerCase()]=t.name;for(const t of be(i,"features",[])){const n={},r=be(t,"attributes",{});for(const t in r)n[e[t.toLowerCase()]]=r[t];a.featureSet.features.push({attributes:n,geometry:Se(be(t,"geometry"))})}}}else{a.layerDefinition.hasZ=!0===be(e,"hasz",!1),a.layerDefinition.hasM=!0===be(e,"hasm",!1),a.layerDefinition.geometryType=be(e,"geometrytype",""),a.featureSet.geometryType=a.layerDefinition.geometryType,a.layerDefinition.objectIdField=be(e,"objectidfieldname",""),a.layerDefinition.typeIdField=be(e,"typeidfieldname","");const r=be(e,"spatialreference");r&&(a.layerDefinition.spatialReference=Ne(r));const i=[],s=be(e,"fields",null);if(!(0,Ie.cy)(s))throw new l.D$(t,"InvalidParameter",n);for(const e of s){const t={name:be(e,"name",""),alias:be(e,"alias",""),type:be(e,"type",""),nullable:be(e,"nullable",!0),editable:be(e,"editable",!0),length:be(e,"length",null),domain:Ae(be(e,"domain"))};i.push(t)}a.layerDefinition.fields=i;const o={};for(const e of i)o[e.name.toLowerCase()]=e.name;let u=be(e,"features",null);if((0,Ie.cy)(u))for(const e of u){const t={},n=be(e,"attributes",{});for(const e in n)t[o[e.toLowerCase()]]=n[e];a.featureSet.features.push({attributes:t,geometry:Se(be(e,"geometry",null))})}else u=null,a.featureSet.features=u}}}if(!1===function(e){return!!e.layerDefinition&&!!e.featureSet&&!1!==function(e){for(const t of["",null,"esriGeometryNull","esriGeometryPoint","esriGeometryPolyline","esriGeometryPolygon","esriGeometryMultipoint","esriGeometryEnvelope"])if(t===e)return!0;return!1}(e.layerDefinition.geometryType)&&!1!==(0,Ie.cy)(e.layerDefinition.fields)&&!1!==(0,Ie.cy)(e.featureSet.features)}(a))throw new l.D$(t,"InvalidParameter",n);return a.layerDefinition.geometryType||(a.layerDefinition.geometryType="esriGeometryNull"),G.A.create(a,t.spatialReference)})},e.signatures.push({name:"featureset",min:1,max:1}),e.functions.filter=function(t,n){return e.standardFunctionAsync(t,n,async(r,i,a)=>{if((0,f.B)(a,2,2,t,n),(0,Ie.cy)(a[0])||(0,f.j)(a[0])){const e=[];let r,i=a[0];if(i instanceof c.A&&(i=i.toArray()),!(0,f.i)(a[1]))throw new l.D$(t,"InvalidParameter",n);r=a[1].createFunction(t);for(const t of i){const n=r(t);(0,J.$X)(n)?!0===await n&&e.push(t):!0===n&&e.push(t)}return e}if((0,f.m)(a[0])){const n=await a[0].load(),r=b.A.create(a[1],{fieldsIndex:n.getFieldsIndex(),timeZone:n.dateFieldsTimeZoneDefaultUTC}),i=r.getVariables();if(i.length>0){const n={};for(const r of i)n[r]=e.evaluateIdentifier(t,{name:r});r.parameters=n}return new x.A({parentfeatureset:a[0],whereclause:r})}throw new l.D$(t,"InvalidParameter",n)})},e.signatures.push({name:"filter",min:2,max:2}),e.functions.orderby=function(t,n){return e.standardFunctionAsync(t,n,async(e,r,i)=>{if((0,f.B)(i,2,2,t,n),(0,f.m)(i[0])){const e=new L(i[1]);return new E({parentfeatureset:i[0],orderbyclause:e})}throw new l.D$(t,"InvalidParameter",n)})},e.signatures.push({name:"orderby",min:2,max:2}),e.functions.top=function(t,n){return e.standardFunctionAsync(t,n,async(e,r,i)=>{if((0,f.B)(i,2,2,t,n),(0,f.m)(i[0]))return new O({parentfeatureset:i[0],topnum:i[1]});if((0,Ie.cy)(i[0]))return(0,f.s)(i[1])>=i[0].length?i[0].slice():i[0].slice(0,(0,f.s)(i[1]));if((0,f.j)(i[0]))return(0,f.s)(i[1])>=i[0].length()?i[0].slice():i[0].slice(0,(0,f.s)(i[1]));throw new l.D$(t,"InvalidParameter",n)})},e.signatures.push({name:"top",min:2,max:2}),e.functions.first=function(t,n){return e.standardFunctionAsync(t,n,async(e,r,i)=>{if((0,f.B)(i,1,1,t,n),(0,f.m)(i[0])){const n=await i[0].first(e.abortSignal);if(null!==n){const e=u.Xj.createFromGraphicLikeObject(n.geometry,n.attributes,i[0],t.timeZone);return e._underlyingGraphic=n,e}return n}return(0,Ie.cy)(i[0])?0===i[0].length?null:i[0][0]:(0,f.j)(i[0])?0===i[0].length()?null:i[0].get(0):null})},e.signatures.push({name:"first",min:1,max:1}),e.functions.attachments=function(t,n){return e.standardFunctionAsync(t,n,async(e,r,i)=>{(0,f.B)(i,1,2,t,n);const a={minsize:-1,maxsize:-1,types:null,returnMetadata:!1};if(i.length>1)if(i[1]instanceof s.A){if(i[1].hasField("minsize")&&(a.minsize=(0,f.s)(i[1].field("minsize"))),i[1].hasField("metadata")&&(a.returnMetadata=(0,f.H)(i[1].field("metadata"))),i[1].hasField("maxsize")&&(a.maxsize=(0,f.s)(i[1].field("maxsize"))),i[1].hasField("types")){const e=(0,f.M)(i[1].field("types"),!1);e.length>0&&(a.types=e)}}else if(null!==i[1])throw new l.D$(t,"InvalidParameter",n);if((0,f.k)(i[0])){const e=i[0]._layer;let n;if((0,f.m)(e))n=e;else{if(null==e||!(0,w.eB)(e))return[];n=(0,d.constructFeatureSet)(e,t.spatialReference,["*"],!0,t.lrucache,t.interceptor)}return await n.load(),n.queryAttachments(i[0].field(n.objectIdField),a.minsize,a.maxsize,a.types,a.returnMetadata)}if(null===i[0])return[];throw new l.D$(t,"InvalidParameter",n)})},e.signatures.push({name:"attachments",min:1,max:2}),e.functions.featuresetbyrelationshipname=function(t,n){return e.standardFunctionAsync(t,n,async(e,r,i)=>{(0,f.B)(i,2,4,t,n);const a=i[0],s=(0,f.u)(i[1]);let o=(0,f.J)(i[2],null);const u=(0,f.H)((0,f.J)(i[3],!0));if(null===o&&(o=["*"]),!1===(0,Ie.cy)(o))throw new l.D$(t,"InvalidParameter",n);if(null===i[0])return null;if(!(0,f.k)(i[0]))throw new l.D$(t,"InvalidParameter",n);const c=a._layer;let p;if((0,f.m)(c))p=c;else{if(null==c||!(0,w.eB)(c))return null;p=(0,d.constructFeatureSet)(c,t.spatialReference,["*"],!0,t.lrucache,t.interceptor)}p=await p.load();const h=p.relationshipMetaData().filter(e=>e.name===s);if(0===h.length)return null;if(void 0!==h[0].relationshipTableId&&null!==h[0].relationshipTableId&&h[0].relationshipTableId>-1)return(0,d.constructFeatureSetFromRelationship)(p,h[0],a.field(p.objectIdField),p.spatialReference,o,u,t.lrucache,t.interceptor);let m=p.serviceUrl();if(!m)return null;m=m.endsWith("/")?m+h[0].relatedTableId.toString():m+"/"+h[0].relatedTableId.toString();const y=await(0,d.constructFeatureSetFromUrl)(m,p.spatialReference,o,u,t.lrucache,t.interceptor);await y.load();let g=y.relationshipMetaData();if(g=g.filter(e=>e.id===h[0].id),!1===a.hasField(h[0].keyField)||null===a.field(h[0].keyField)){const e=await p.getFeatureByObjectId(a.field(p.objectIdField),[h[0].keyField]);if(e){const t=b.A.create(g[0].keyField+"= @id",{fieldsIndex:y.getFieldsIndex(),timeZone:y.dateFieldsTimeZoneDefaultUTC});return t.parameters={id:e.attributes[h[0].keyField]},new x.A({parentfeatureset:y,whereclause:t})}return new V.A({parentfeatureset:y})}const I=b.A.create(g[0].keyField+"= @id",{fieldsIndex:y.getFieldsIndex(),timeZone:y.dateFieldsTimeZoneDefaultUTC});return I.parameters={id:a.field(h[0].keyField)},new x.A({parentfeatureset:y,whereclause:I})})},e.signatures.push({name:"featuresetbyrelationshipname",min:2,max:4}),e.functions.featuresetbyassociation=function(t,n){return e.standardFunctionAsync(t,n,async(e,i,a)=>{(0,f.B)(a,2,3,t,n);const s=a[0],u=(0,o.B)((0,f.u)((0,f.J)(a[1],""))),c=(0,Ie.Kg)(a[2])?(0,f.u)(a[2]):null;if(null===a[0])return null;if(!(0,f.k)(a[0]))throw new l.D$(t,"InvalidParameter",n);let p=s._layer;if(p instanceof H.default&&(p=(0,d.constructFeatureSet)(p,t.spatialReference,["*"],!0,t.lrucache,t.interceptor)),null===p)return null;if(!1===(0,f.m)(p))return null;await p.load();const h=p.serviceUrl(),m=await(0,d.constructAssociationMetaDataFeatureSetFromUrl)(h,t.spatialReference,!0);if(m.unVersion>=8)return await async function(e,t,n,i,a,s,o){const u=await e.getFeatureSetInfo();if(null===(u?.layerId??null))return null;if(!a.layerIdLookup.get(u.layerId))return null;const c=e.serviceUrl().replace(/\/FeatureServer/i,"/UtilityNetworkServer"),f=[];switch(n){case"connected":f.push("connectivity"),f.push("junction-edge-from-connectivity"),f.push("junction-edge-to-connectivity"),f.push("junction-edge-midspan-connectivity"),f.push("junction-junction-connectivity");break;case"container":case"content":f.push("containment");break;case"structure":case"attached":f.push("attachment");break;case"junctionedge":f.push("junction-edge-from-connectivity"),f.push("junction-edge-to-connectivity");break;case"midspan":f.push("junction-edge-midspan-connectivity");break;default:throw new l.D$(s,"InvalidParameter",o)}let p=null,h=!1;if(null!==i&&""!==i&&void 0!==i){for(const e of a.terminals)e.terminalName===i&&(p=e.terminalId);null===p&&(h=!0)}const m=[];if(!h){const i=new ce({globalId:t.field(e.globalIdField),networkSourceId:a.layerIdLookup.get(u.layerId).sourceId,...p?{terminalId:p}:""}),s=await async function(e,t){const n=(0,re.Dl)(e),r={...me(t),f:"json"},i=(0,re.lF)({...n.query,...r}),a=(0,re.jV)(i,{method:"post"}),s=`${n.path}/associations/query`,{data:o}=await(0,Q.A)(s,a),l=he.fromJSON(o);return t.types.includes("connectivity")&&(0,Y.Lx)(X.A.getLogger("esri/rest/networks/support/QueryAssociationsParameters"),"types",{replacement:"Please use 'junction-junction-connectivity' instead of 'connectivity'.",see:"https://arcg.is/11Tr8a#types",version:"4.29",warnOnce:!0}),l}(c,new we({types:f,elements:[i]}));let o=0;for(const e of s.associations){let t=null,s="",l="";if(e.fromNetworkElement?.globalId===i.globalId?(t=e.toNetworkElement,l="to"):e.toNetworkElement?.globalId===i.globalId&&(t=e.fromNetworkElement,l="from"),!t)continue;switch(n){case"attached":if("attachment"!==e.associationType)continue;if("to"!==l)continue;break;case"structure":if("attachment"!==e.associationType)continue;if("from"!==l)continue;break;case"container":if("containment"!==e.associationType)continue;if("from"!==l)continue;break;case"content":if("containment"!==e.associationType)continue;if("to"!==l)continue;break;case"connected":break;case"junctionedge":"junction-edge-to-connectivity"===e.associationType?s="to":"junction-edge-from-connectivity"===e.associationType&&(s="from");break;case"midspan":if("junction-edge-midspan-connectivity"!==e.associationType)continue}const u=a.sourceIdLookup.get(t.networkSourceId)?.className??"";m.push(new r.A({geometry:null,attributes:{objectId:o++,globalId:t.globalId,percentAlong:e.percentAlong??0,isContentVisible:e.isContentVisible?0:1,className:u,side:s}}))}}const y=new H.default({source:m,geometryType:null,objectIdField:"objectId",globalIdField:"globalId",fields:[new R.A({name:"objectId",alias:"objectId",type:"oid"}),new R.A({name:"globalId",alias:"globalId",type:"global-id"}),new R.A({name:"percentAlong",alias:"percentAlong",type:"double"}),new R.A({name:"side",alias:"side",type:"string"}),new R.A({name:"isContentVisible",alias:"isContentVisible",type:"integer"}),new R.A({name:"className",alias:"className",type:"string"})]});return(0,d.constructFeatureSet)(y)}(p,s,u,c,m,t,n);const y=m.associations;let g=null,I=null,F=!1;if(null!==c&&""!==c&&void 0!==c){for(const e of m.terminals)e.terminalName===c&&(I=e.terminalId);null===I&&(F=!0)}const A=y.getFieldsIndex(),N=A.get("TOGLOBALID").name,x=A.get("FROMGLOBALID").name,D=A.get("TOTERMINALID").name,E=A.get("FROMTERMINALID").name,k=A.get("FROMNETWORKSOURCEID").name,L=A.get("TONETWORKSOURCEID").name,U=A.get("ASSOCIATIONTYPE").name,j=A.get("ISCONTENTVISIBLE").name,$=A.get("OBJECTID").name;for(const e of p.fields)if("global-id"===e.type){g=s.field(e.name);break}let Z=null,M=new C(new R.A({name:"percentalong",alias:"percentalong",type:"double"}),b.A.create("0",{fieldsIndex:y.getFieldsIndex(),timeZone:y.dateFieldsTimeZoneDefaultUTC})),W=new C(new R.A({name:"side",alias:"side",type:"string"}),b.A.create("''",{fieldsIndex:y.getFieldsIndex(),timeZone:y.dateFieldsTimeZoneDefaultUTC}));const B="globalid",q="globalId",P={};for(const e in m.lkp)P[e]=m.lkp[e].sourceId;const O=new _(new R.A({name:"classname",alias:"classname",type:"string"}),null,P);let V="";switch(u){case"midspan":{V=`((${N}='${g}') OR ( ${x}='${g}')) AND (${U} IN (5))`,O.codefield=b.A.create(`CASE WHEN (${N}='${g}') THEN ${k} ELSE ${L} END`,{fieldsIndex:y.getFieldsIndex(),timeZone:y.dateFieldsTimeZoneDefaultUTC});const e=(0,w.ke)(v.findField(y.fields,x));e.name=B,e.alias=B,Z=new C(e,b.A.create(`CASE WHEN (${x}='${g}') THEN ${N} ELSE ${x} END`,{fieldsIndex:y.getFieldsIndex(),timeZone:y.dateFieldsTimeZoneDefaultUTC})),M=m.unVersion>=4?new S(v.findField(y.fields,A.get("PERCENTALONG").name)):new C(new R.A({name:"percentalong",alias:"percentalong",type:"double"}),b.A.create("0",{fieldsIndex:y.getFieldsIndex(),timeZone:y.dateFieldsTimeZoneDefaultUTC}));break}case"junctionedge":{V=`((${N}='${g}') OR ( ${x}='${g}')) AND (${U} IN (4,6))`,O.codefield=b.A.create(`CASE WHEN (${N}='${g}') THEN ${k} ELSE ${L} END`,{fieldsIndex:y.getFieldsIndex(),timeZone:y.dateFieldsTimeZoneDefaultUTC});const e=(0,w.ke)(v.findField(y.fields,x));e.name=B,e.alias=B,Z=new C(e,b.A.create(`CASE WHEN (${x}='${g}') THEN ${N} ELSE ${x} END`,{fieldsIndex:y.getFieldsIndex(),timeZone:y.dateFieldsTimeZoneDefaultUTC})),W=new C(new R.A({name:"side",alias:"side",type:"string"}),b.A.create(`CASE WHEN (${U}=4) THEN 'from' ELSE 'to' END`,{fieldsIndex:y.getFieldsIndex(),timeZone:y.dateFieldsTimeZoneDefaultUTC}));break}case"connected":{let e=`${N}='@T'`,t=`${x}='@T'`;null!==I&&(e+=` AND ${D}=@A`,t+=` AND ${E}=@A`),V="(("+e+") OR ("+t+"))",V=(0,f._)(V,"@T",g??""),e=(0,f._)(e,"@T",g??""),null!==I&&(e=(0,f._)(e,"@A",I.toString()),V=(0,f._)(V,"@A",I.toString())),O.codefield=b.A.create("CASE WHEN "+e+` THEN ${k} ELSE ${L} END`,{fieldsIndex:y.getFieldsIndex(),timeZone:y.dateFieldsTimeZoneDefaultUTC});const n=(0,w.ke)(v.findField(y.fields,x));n.name=B,n.alias=B,Z=new C(n,b.A.create("CASE WHEN "+e+` THEN ${x} ELSE ${N} END`,{fieldsIndex:y.getFieldsIndex(),timeZone:y.dateFieldsTimeZoneDefaultUTC}));break}case"container":V=`${N}='${g}' AND ${U} = 2`,null!==I&&(V+=` AND ${D} = `+I.toString()),O.codefield=k,V="( "+V+" )",Z=new T(v.findField(y.fields,x),B,B);break;case"content":V=`(${x}='${g}' AND ${U} = 2)`,null!==I&&(V+=` AND ${E} = `+I.toString()),O.codefield=L,V="( "+V+" )",Z=new T(v.findField(y.fields,N),B,B);break;case"structure":V=`(${N}='${g}' AND ${U} = 3)`,null!==I&&(V+=` AND ${D} = `+I.toString()),O.codefield=k,V="( "+V+" )",Z=new T(v.findField(y.fields,x),B,q);break;case"attached":V=`(${x}='${g}' AND ${U} = 3)`,null!==I&&(V+=` AND ${E} = `+I.toString()),O.codefield=L,V="( "+V+" )",Z=new T(v.findField(y.fields,N),B,q);break;default:throw new l.D$(t,"InvalidParameter",n)}return F&&(V="1 <> 1"),new v({parentfeatureset:y,adaptedFields:[new S(v.findField(y.fields,$)),new S(v.findField(y.fields,j)),Z,W,O,M],extraFilter:V?b.A.create(V,{fieldsIndex:y.getFieldsIndex(),timeZone:y.dateFieldsTimeZoneDefaultUTC}):null})})},e.signatures.push({name:"featuresetbyassociation",min:2,max:6}),e.functions.groupby=function(t,n){return e.standardFunctionAsync(t,n,async(r,i,a)=>{if((0,f.B)(a,3,3,t,n),!(0,f.m)(a[0]))throw new l.D$(t,"InvalidParameter",n);const o=await a[0].load(),u=[],d=[];let c=!1,p=[];if((0,Ie.Kg)(a[1]))p.push(a[1]);else if(a[1]instanceof s.A)p.push(a[1]);else if((0,Ie.cy)(a[1]))p=a[1];else{if(!(0,f.j)(a[1]))throw new l.D$(t,"InvalidParameter",n);p=a[1].toArray()}for(const e of p)if((0,Ie.Kg)(e)){const t=b.A.create((0,f.u)(e),{fieldsIndex:o.getFieldsIndex(),timeZone:o.dateFieldsTimeZoneDefaultUTC}),n=!0===(0,I.DA)(t)?(0,f.u)(e):"%%%%FIELDNAME";u.push({name:n,expression:t}),"%%%%FIELDNAME"===n&&(c=!0)}else{if(!(e instanceof s.A))throw new l.D$(t,"InvalidParameter",n);{const r=e.hasField("name")?e.field("name"):"%%%%FIELDNAME",i=e.hasField("expression")?e.field("expression"):"";if("%%%%FIELDNAME"===r&&(c=!0),!r)throw new l.D$(t,"InvalidParameter",n);u.push({name:r,expression:b.A.create(i||r,{fieldsIndex:o.getFieldsIndex(),timeZone:o.dateFieldsTimeZoneDefaultUTC})})}}if(p=[],(0,Ie.Kg)(a[2]))p.push(a[2]);else if((0,Ie.cy)(a[2]))p=a[2];else if((0,f.j)(a[2]))p=a[2].toArray();else{if(!(a[2]instanceof s.A))throw new l.D$(t,"InvalidParameter",n);p.push(a[2])}for(const e of p){if(!(e instanceof s.A))throw new l.D$(t,"InvalidParameter",n);{const r=e.hasField("name")?e.field("name"):"",i=e.hasField("statistic")?e.field("statistic"):"",a=e.hasField("expression")?e.field("expression"):"";if(!(r&&i&&(0,Ie.Kg)(i)&&a))throw new l.D$(t,"InvalidParameter",n);d.push({name:r,statistic:i,expression:b.A.create(a,{fieldsIndex:o.getFieldsIndex(),timeZone:o.dateFieldsTimeZoneDefaultUTC})})}}if(c){const e={};for(const t of o.fields)e[t.name.toLowerCase()]=1;for(const t of u)"%%%%FIELDNAME"!==t.name&&(e[t.name.toLowerCase()]=1);for(const t of d)"%%%%FIELDNAME"!==t.name&&(e[t.name.toLowerCase()]=1);let t=0;for(const n of u)if("%%%%FIELDNAME"===n.name){for(;1===e["field_"+t.toString()];)t++;e["field_"+t.toString()]=1,n.name="FIELD_"+t.toString()}}for(const n of u)Fe(n.expression,e,t);for(const n of d)Fe(n.expression,e,t);return new P({parentfeatureset:a[0],groupbyfields:u,statsfields:d})})},e.signatures.push({name:"groupby",min:3,max:3}),e.functions.distinct=function(t,n){return e.standardFunctionAsync(t,n,async(r,i,a)=>{if((0,f.m)(a[0])){(0,f.B)(a,2,2,t,n);const r=await a[0].load(),i=[];let o=[];if((0,Ie.Kg)(a[1]))o.push(a[1]);else if(a[1]instanceof s.A)o.push(a[1]);else if((0,Ie.cy)(a[1]))o=a[1];else{if(!(0,f.j)(a[1]))throw new l.D$(t,"InvalidParameter",n);o=a[1].toArray()}let u=!1;for(const e of o)if((0,Ie.Kg)(e)){const t=b.A.create((0,f.u)(e),{fieldsIndex:r.getFieldsIndex(),timeZone:r.dateFieldsTimeZoneDefaultUTC}),n=!0===(0,I.DA)(t)?(0,f.u)(e):"%%%%FIELDNAME";i.push({name:n,expression:t}),"%%%%FIELDNAME"===n&&(u=!0)}else{if(!(e instanceof s.A))throw new l.D$(t,"InvalidParameter",n);{const a=e.hasField("name")?e.field("name"):"%%%%FIELDNAME",s=e.hasField("expression")?e.field("expression"):"";if("%%%%FIELDNAME"===a&&(u=!0),!a)throw new l.D$(t,"InvalidParameter",n);i.push({name:a,expression:b.A.create(s||a,{fieldsIndex:r.getFieldsIndex(),timeZone:r.dateFieldsTimeZoneDefaultUTC})})}}if(u){const e={};for(const t of r.fields)e[t.name.toLowerCase()]=1;for(const t of i)"%%%%FIELDNAME"!==t.name&&(e[t.name.toLowerCase()]=1);let t=0;for(const n of i)if("%%%%FIELDNAME"===n.name){for(;1===e["field_"+t.toString()];)t++;e["field_"+t.toString()]=1,n.name="FIELD_"+t.toString()}}for(const n of i)Fe(n.expression,e,t);return new P({parentfeatureset:a[0],groupbyfields:i,statsfields:[]})}return function(e){if(1===e.length){if((0,Ie.cy)(e[0]))return(0,K.t)("distinct",e[0],-1);if((0,f.j)(e[0]))return(0,K.t)("distinct",e[0].toArray(),-1)}return(0,K.t)("distinct",e,-1)}(a)})},e.functions.getfeaturesetinfo=function(t,n){return e.standardFunctionAsync(t,n,async(e,r,i)=>{if((0,f.B)(i,1,1,t,n),!(0,f.m)(i[0]))return null;const a=await i[0].getFeatureSetInfo();return a?s.A.convertObjectToArcadeDictionary({layerId:a.layerId,layerName:a.layerName,itemId:a.itemId,serviceLayerUrl:a.serviceLayerUrl,webMapLayerId:a.webMapLayerId??null,webMapLayerTitle:a.webMapLayerTitle??null,className:null,objectClassId:null},(0,f.K)(t),!1,!1):null})},e.signatures.push({name:"getfeaturesetinfo",min:1,max:1}),e.functions.filterbysubtypecode=function(t,n){return e.standardFunctionAsync(t,n,async(e,r,i)=>{if((0,f.B)(i,2,2,t,n),(0,f.m)(i[0])){const e=await i[0].load(),r=i[1];if(!(0,Ie.Fq)(r))throw new l.D$(t,"InvalidParameter",n);if(e.subtypeField){const t=b.A.create(`${e.subtypeField}= ${i[1]}`,{fieldsIndex:e.getFieldsIndex(),timeZone:e.dateFieldsTimeZoneDefaultUTC});return new x.A({parentfeatureset:i[0],whereclause:t})}if(null===e.typeIdField||""===e.typeIdField)throw new l.D$(t,"FeatureSetDoesNotHaveSubtypes",n);const a=b.A.create(`${e.typeIdField}= ${i[1]}`,{fieldsIndex:e.getFieldsIndex(),timeZone:e.dateFieldsTimeZoneDefaultUTC});return new x.A({parentfeatureset:i[0],whereclause:a})}throw new l.D$(t,"InvalidParameter",n)})},e.signatures.push({name:"filterbysubtypecode",min:2,max:2})}}},80672:(e,t,n)=>{n.d(t,{R:()=>i});var r=n(20655);function i(e,t){return null===e?t:new r.A({url:e.field("url")})}},85978:(e,t,n)=>{n.d(t,{A:()=>s});var r=n(87449),i=n(11221),a=n(33325);class s extends i.t{constructor(e){super(e),this.declaredClass="esri.layers.featureset.sources.Empty",this._maxProcessing=1e3,this._parent=e.parentfeatureset,this._databaseType=0}async _queryAll(){return i.A.features}async query(e){return i.A}async queryStat(e){return await this._manualStat(e.stat,e.field,e.limit??a.gO,e.abortSignal)}async canQueryAggregate(e){return!1}async queryAggregate(e){throw new r.dr("NeverReach")}async queryAttachments(){return[]}}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[1713,3513],{8303:(e,t,r)=>{r.d(t,{A:()=>A});var i=r(31635),s=r(92602),n=r(70333),o=r(43773),a=r(60999),l=r(49186),d=r(53966),u=r(97768),c=r(74887),p=r(84952),h=r(10107),y=(r(44208),r(87811),r(36005)),g=r(64108),f=r(43937),m=r(77548),v=r(20655),w=r(80812),b=r(41318),I=r(10407);const A=e=>{const t=e;let A=class extends t{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0,this.userHasFullEditingPrivileges=!1,this.userHasUpdateItemPrivileges=!1}destroy(){this.portalItem=(0,u.pR)(this.portalItem),this.resourceReferences.portalItem=null,this.resourceReferences.paths.length=0}set portalItem(e){e!==this._get("portalItem")&&(this.removeOrigin("portal-item"),this._set("portalItem",e))}readPortalItem(e,t,r){if(t.itemId)return new w.default({id:t.itemId,portal:r?.portal})}writePortalItem(e,t){e?.id&&(t.itemId=e.id)}async loadFromPortal(e,t){if(this.portalItem?.id)try{const{load:i}=await r.e(1204).then(r.bind(r,41204));return(0,c.Te)(t),await i({instance:this,supportedTypes:e.supportedTypes,validateItem:e.validateItem,supportsData:e.supportsData,layerModuleTypeMap:e.layerModuleTypeMap,populateGroupLayer:e.populateGroupLayer},t)}catch(e){throw(0,c.zf)(e)||d.A.getLogger(this).warn(`Failed to load layer (${this.title}, ${this.id}) portal item (${this.portalItem.id})\n ${e}`),e}}async finishLoadEditablePortalLayer(e){this._set("userHasEditingPrivileges",await this._fetchUserHasEditingPrivileges(e).catch(e=>((0,c.QP)(e),!0)))}async setUserPrivileges(e,t){if(!s.A.userPrivilegesApplied)return this.finishLoadEditablePortalLayer(t);if(this.url)try{const{features:{edit:r,fullEdit:i},content:{updateItem:s}}=await this._fetchUserPrivileges(e,t);this._set("userHasEditingPrivileges",r),this._set("userHasFullEditingPrivileges",i),this._set("userHasUpdateItemPrivileges",s)}catch(e){(0,c.QP)(e)}}async _fetchUserPrivileges(e,t){let r=this.portalItem;if(!e||!r||!r.loaded||r.sourceUrl)return this._fetchFallbackUserPrivileges(t);const i=!n.id?.findCredential(this.url),s=e===r.id;if(s&&r.portal.user)return this._getUserPrivileges(r,i);let o,a;if(s)o=r.portal.url;else try{o=await(0,m.wI)(this.url,t)}catch(e){(0,c.QP)(e)}if(!o||!(0,p.b8)(o,r.portal.url))return this._fetchFallbackUserPrivileges(t);try{const e=null!=t?t.signal:null;a=await(n.id?.getCredential(`${o}/sharing`,{prompt:!1,signal:e}))}catch(e){(0,c.QP)(e)}const l=!0,d=!1,u=!1;if(!a)return{features:{edit:l,fullEdit:d},content:{updateItem:u}};try{if(s?await r.reload():(r=new w.default({id:e,portal:{url:o}}),await r.load(t)),r.portal.user)return this._getUserPrivileges(r,i)}catch(e){(0,c.QP)(e)}return{features:{edit:l,fullEdit:d},content:{updateItem:u}}}_getUserPrivileges(e,t){const r=(0,I.It)(e);return t&&(r.features.edit=!0),r}async _fetchFallbackUserPrivileges(e){let t=!0;try{t=await this._fetchUserHasEditingPrivileges(e)}catch(e){(0,c.QP)(e)}return{features:{edit:t,fullEdit:!1},content:{updateItem:!1}}}async _fetchUserHasEditingPrivileges(e){const t=this.url?n.id?.findCredential(this.url):null;if(!t)return!0;const r=S.credential===t?S.user:await this._fetchEditingUser(e);return S.credential=t,S.user=r,null==r?.privileges||r.privileges.includes("features:user:edit")}async _fetchEditingUser(e){const t=this.portalItem?.portal?.user;if(t)return t;const r=n.id?.findServerInfo(this.url??"");if(!r?.owningSystemUrl)return null;const i=`${r.owningSystemUrl}/sharing/rest`,s=v.A.getDefault();if(s&&s.loaded&&(0,p.S8)(s.restUrl)===(0,p.S8)(i))return s.user;const l=`${i}/community/self`,d=null!=e?e.signal:null,u=await(0,a.Ke)((0,o.A)(l,{authMode:"no-prompt",query:{f:"json"},signal:d}));return u.ok?b.A.fromJSON(u.value.data):null}read(e,t){t&&(t.layer=this),super.read(e,t)}write(e,t){const r=t?.portal,i=this.portalItem?.id&&(this.portalItem.portal||v.A.getDefault());return r&&i&&!(0,p.ut)(i.restUrl,r.restUrl)?(t.messages&&t.messages.push(new l.A("layer:cross-portal",`The layer '${this.title} (${this.id})' cannot be persisted because it refers to an item on a different portal than the one being saved to. To save, set layer.portalItem to null or save to the same portal as the item associated with the layer`,{layer:this})),null):super.write(e,{...t,layer:this})}};return(0,i.Cg)([(0,h.MZ)({type:w.default})],A.prototype,"portalItem",null),(0,i.Cg)([(0,y.w)("web-document","portalItem",["itemId"])],A.prototype,"readPortalItem",null),(0,i.Cg)([(0,f.K)("web-document","portalItem",{itemId:{type:String}})],A.prototype,"writePortalItem",null),(0,i.Cg)([(0,h.MZ)({clonable:!1})],A.prototype,"resourceReferences",void 0),(0,i.Cg)([(0,h.MZ)({type:Boolean,readOnly:!0})],A.prototype,"userHasEditingPrivileges",void 0),(0,i.Cg)([(0,h.MZ)({type:Boolean,readOnly:!0})],A.prototype,"userHasFullEditingPrivileges",void 0),(0,i.Cg)([(0,h.MZ)({type:Boolean,readOnly:!0})],A.prototype,"userHasUpdateItemPrivileges",void 0),A=(0,i.Cg)([(0,g.$)("esri.layers.mixins.PortalLayer")],A),A},S={credential:null,user:null}},8947:(e,t,r)=>{r.d(t,{L:()=>o});var i=r(60999),s=r(74887),n=r(67076);async function o(e,t,r){const o=e&&e.getAtOrigin&&e.getAtOrigin("renderer",t.origin);if(o&&"unique-value"===o.type&&o.styleOrigin){const a=await(0,i.Ke)(o.populateFromStyle());if((0,s.Te)(r),!1===a.ok){const r=a.error;t?.messages&&t.messages.push(new n.A("renderer:style-reference",`Failed to create unique value renderer from style reference: ${r.message}`,{error:r,context:t})),e.clear("renderer",t?.origin)}}}},10184:(e,t,r)=>{r.d(t,{A:()=>c});var i=r(31635),s=r(69540),n=r(25482),o=r(88930),a=r(10107),l=(r(44208),r(53966),r(87811),r(93223)),d=r(64108),u=r(73133);let c=class extends((0,s.OU)(n.o)){constructor(e){super(e),this.unit="milliseconds",this.value=0}toMilliseconds(){return(0,o.t)(this.value,this.unit,"milliseconds")}};(0,i.Cg)([(0,l.e)(u.j,{nonNullable:!0})],c.prototype,"unit",void 0),(0,i.Cg)([(0,a.MZ)({type:Number,json:{write:!0},nonNullable:!0})],c.prototype,"value",void 0),c=(0,i.Cg)([(0,d.$)("esri.time.TimeInterval")],c)},10407:(e,t,r)=>{r.d(t,{It:()=>h,LG:()=>o,OM:()=>d,Sm:()=>u,Y:()=>a,bK:()=>l,mm:()=>p,sQ:()=>c});var i=r(91218),s=r(16930),n=r(28735);function o(e,t){if(!a(e,t)){const r=e.typeKeywords;r?r.push(t):e.typeKeywords=[t]}}function a(e,t){return!!e.typeKeywords?.includes(t)}function l(e){return a(e,p.HOSTED_SERVICE)}function d(e,t){const r=e.typeKeywords;if(r){const e=r.indexOf(t);e>-1&&r.splice(e,1)}}function u(e,t,r){r?o(e,t):d(e,t)}async function c(e){const t=e.clone().normalize();let r;if(t.length>1)for(const e of t)r?e.width>r.width&&(r=e):r=e;else r=t[0];return async function(e){const t=e.spatialReference;if(t.isWGS84)return e.clone();if(t.isWebMercator)return(0,n.ci)(e);const r=s.A.WGS84;return await(0,i.initializeProjection)(t,r),(0,i.project)(e,r)}(r)}const p={CHARTS:"Charts",DYNAMIC:"Dynamic",DEVELOPER_BASEMAP:"DeveloperBasemap",GROUP_LAYER_MAP:"Map",HOSTED_SERVICE:"Hosted Service",JSAPI:"ArcGIS API for JavaScript",LOCAL_SCENE:"ViewingMode-Local",METADATA:"Metadata",MULTI_LAYER:"Multilayer",ORIENTED_IMAGERY_LAYER:"OrientedImageryLayer",SINGLE_LAYER:"Singlelayer",SUBTYPE_GROUP_LAYER:"SubtypeGroupLayer",SUBTYPE_GROUP_TABLE:"SubtypeGroupTable",TABLE:"Table",TILED_IMAGERY:"Tiled Imagery"};function h(e){const{portal:t,isOrgItem:r,itemControl:i}=e,s=t.user?.privileges;let n=!s||s.includes("features:user:edit"),o=!!r&&!!s?.includes("features:user:fullEdit");const a="update"===i||"admin"===i;return a?o=n=!0:o&&(n=!0),{features:{edit:n,fullEdit:o},content:{updateItem:a}}}},17036:(e,t,r)=>{r.d(t,{p:()=>l});var i=r(44208),s=r(53966),n=r(20437),o=r(95466),a=r(30524);function l(){return{fields:{type:[n.A],value:null,set:function(e){if(e&&(0,i.A)("big-integer-warning-enabled")){const t=e.filter(e=>"big-integer"===e.type||"oid"===e.type&&(e.length||0)>=8);if(t.length){const e=t.map(e=>`'${e.name}'`).join(", ");s.A.getLogger(this).warn("#fields",`Layer (title: '${this.title??"no title"}', id: '${this.id??"no id"}') references big-integer field(s): ${e}, support for which is experimental. Only integers less than ${Number.MAX_SAFE_INTEGER} (Number.MAX_SAFE_INTEGER) are supported.`)}}this._set("fields",e)}},fieldsIndex:{readOnly:!0,get(){return o.A.fromLayer(this)}},outFields:{type:[String],json:{read:!1},set:function(e){this._userOutFields=e,this.notifyChange("outFields")},get:function(){const e=this._userOutFields;if(!e?.length)return null;if(e.includes("*"))return["*"];if(!this.fields)return e;for(const t of e){const r=this.fieldsIndex?.has(t);r||s.A.getLogger("esri.layers.support.fieldProperties").error("field-attributes-layer:invalid-field",`Invalid field ${t} found in outFields`,{layer:this,outFields:e})}return(0,a.DB)(this.fieldsIndex,e)}}}}},18768:(e,t,r)=>{r.d(t,{b:()=>l});var i=r(31635),s=r(53966),n=r(10107),o=(r(44208),r(87811),r(64108)),a=r(60694);const l=e=>{const t=e;let r=class extends t{get title(){if(this._get("title")&&"defaults"!==this.originOf("title"))return this._get("title");if(this.url){const e=(0,a.qg)(this.url);if(e?.title)return e.title}return this._get("title")||""}set title(e){this._set("title",e)}set url(e){this._set("url",(0,a.Jf)(e,s.A.getLogger(this)))}};return(0,i.Cg)([(0,n.MZ)()],r.prototype,"title",null),(0,i.Cg)([(0,n.MZ)({type:String})],r.prototype,"url",null),r=(0,i.Cg)([(0,o.$)("esri.layers.mixins.ArcGISService")],r),r}},20557:(e,t,r)=>{r.d(t,{Fm:()=>l,Hz:()=>h,JQ:()=>p,JZ:()=>b,ND:()=>g,R_:()=>o,U9:()=>c,fu:()=>s,nr:()=>y,oF:()=>n,rq:()=>d,z$:()=>u});const i=[["binary","application/octet-stream","bin",""]];function s(e,t){return null!=m(t.name,e?.supportedFormats??[])}function n(e,t){if(!e)return!1;const r=d(t,e.supportedFormats??[]);return null!=r&&e.editFormats.includes(r)}function o(e,t){return v(function(e,t){const r=e.toLowerCase();return f(t).find(e=>w(e)===r)}(e,t))}function a(e,t){return v(m(e,t))}function l(e,t){return w(function(e,t){return f(t).find(t=>v(t)===e)}(e,t))}function d(e,t){return a(e.name,t)??o(e.type,t)}function u(e,t,r){return o(e,r)??a(t,r)}function c({supportedFormats:e}){return u("model/gltf-binary","glb",e)}function p(e){const t=c(e);return null!=t&&e.editFormats.includes(t)}function h(e){if(!e)return null;const t=c(e),r=function({supportedFormats:e}){return u("model/gltf+json","gltf",e)}(e);let i=null;for(const s of e.queryFormats){if(s===t)return s;s===r&&(i=s)}return i}function y({supportedFormats:e}){return u("application/esri3do-SR_world","wld",e)}function g({supportedFormats:e}){return u("application/esri3do-SR_prj","prj",e)}function f(e){return[...i,...e]}function m(e,t){const r=e.toLowerCase();return f(t).find(e=>function(e){return e?.[2].split(",").map(e=>e.toLowerCase())??[]}(e).some(e=>r.endsWith(e)))}function v(e){return e?.[0]}function w(e){return e?.[1].toLowerCase()}function b(e){return e.tables?.find(e=>"assetMaps"===e.role)}},20816:(e,t,r)=>{r.d(t,{TA:()=>s,We:()=>a,Z3:()=>n,ZJ:()=>l,w5:()=>d});var i=r(43773);const s=(0,r(13069).vD)(),n=new Map,o=new Map;async function a(e,t,r){if(!e||!r)return!1;if(!t)return!0;const s=new URL(e).host;let o=n.get(s);if(!o){const t=e.replace(/\/FeatureServer/i,"/VersionManagementServer").replace(/\/\d*$/,"");o=(await(0,i.A)(t,{responseType:"json",query:{f:"json"}})).data.defaultVersionName}return o===t}async function l(e,t,i=!1){if(!e||!t)return!0;const n=e.replace(/\/FeatureServer/i,"/VersionManagementServer").replace(/\/\d*$/,""),a=o.get(n)?.entries();if(a)for(const[e,o]of a)if(o.name===t){const t=!o.stack?.hasForwardEdits();if(!t&&i){const[{deleteForwardEdits:t},{default:i}]=await Promise.all([r.e(2186).then(r.bind(r,32186)),r.e(2558).then(r.bind(r,32558))]),a=await t(n,e,new i({sessionId:s,moment:o.moment}));return a.success&&o.stack?.clearForwardEdits(),a.success}return t}return!0}function d(e,t){if(!e)return!1;const r=e.replace(/\/FeatureServer/i,"/VersionManagementServer").replace(/\/\d*$/,""),i=o.get(r)?.entries();if(i)for(const[e,r]of i)if(r.name===t)return"edit"===r.lockType;return!1}new Map},24770:(e,t,r)=>{r.d(t,{$I:()=>f,AU:()=>h,g7:()=>g,i4:()=>u,ui:()=>c,up:()=>v,vt:()=>d,yo:()=>y});var i=r(34727),s=r(58083),n=r(67026),o=r(82534),a=r(38954),l=r(51850);function d(e=v){return[e[0],e[1],e[2],e[3]]}function u(e,t,r=d()){return(0,a.d)(r,e),r[3]=t,r}function c(e,t=d()){const r=(0,s.l)(w,e);return m(t,(0,i.KJ)((0,n.Xd)(t,r))),t}function p(e,t,r=d()){return(0,n.x8)(w,e,f(e)),(0,n.x8)(b,t,f(t)),(0,n.lw)(w,b,w),m(r,(0,i.KJ)((0,n.Xd)(r,w)))}function h(e,t,r,i=d()){return u(l.Cw,e,I),u(l.JP,t,A),u(l.Cb,r,S),p(I,A,I),p(I,S,i),i}function y(e){return e}function g(e){return e[3]}function f(e){return(0,i.kU)(e[3])}function m(e,t){return e[3]=t,e}const v=[0,0,1,0],w=(0,o.vt)(),b=(0,o.vt)(),I=(d(),d()),A=d(),S=d()},25036:(e,t,r)=>{r.d(t,{j:()=>o});var i=r(31635),s=r(10107),n=(r(44208),r(53966),r(87811),r(64108));const o=e=>{const t=e;let r=class extends t{constructor(){super(...arguments),this.minScale=0,this.maxScale=0}get effectiveScaleRange(){const e={minScale:this.minScale,maxScale:this.maxScale},t=this.parent;void 0!==t?.effectiveScaleRange&&function(e,t){e.minScale=e.minScale>0?t.minScale>0?Math.min(e.minScale,t.minScale):e.minScale:t.minScale,e.maxScale=e.maxScale>0?t.maxScale>0?Math.max(e.maxScale,t.maxScale):e.maxScale:t.maxScale}(e,t.effectiveScaleRange);const r=this._get("effectiveScaleRange");return r&&r.minScale===e.minScale&&r.maxScale===e.maxScale?r:e}};return(0,i.Cg)([(0,s.MZ)({type:Number,nonNullable:!0,json:{write:!0}})],r.prototype,"minScale",void 0),(0,i.Cg)([(0,s.MZ)({type:Number,nonNullable:!0,json:{write:!0}})],r.prototype,"maxScale",void 0),(0,i.Cg)([(0,s.MZ)({readOnly:!0})],r.prototype,"effectiveScaleRange",null),r=(0,i.Cg)([(0,n.$)("esri.layers.mixins.ScaleRangeLayer")],r),r}},36969:(e,t,r)=>{r.r(t),r.d(t,{default:()=>De});var i=r(31635),s=r(52106),n=r(37838),o=r(69540),a=r(7762),l=r(51447),d=r(49186),u=r(36563),c=r(53966),p=r(97768),h=r(25728),y=r(74887),g=r(36708),f=r(10107),m=(r(44208),r(87811),r(88620)),v=r(36005),w=r(64108),b=r(86738),I=r(91218),A=r(55156),S=r(60950),C=r(89808),M=r(99959);const F=Symbol("isSceneGraphicOrigin");var x;class L extends M.A{get[(x=F,S.ym)](){return this.layer}get[A.e](){return this.layer}get[C.Q](){return this.layer}constructor(e){super(),this[x]=!0,this.type="scene",this.layer=e}get id(){return this.layer.id}}var T=r(4146),j=r(55726),E=r(52136),O=r(18768),P=r(69208),_=r(47685),U=r(16131),Z=r(8303),R=r(25036),N=r(58947),D=r(82935),$=r(25482),k=r(30524);function q({associatedLayer:e,serviceUpdateTimeStamp:t}){const r=e?.editingInfo?.lastEditDate,i=e?.serverGens,s=null!=r,n=null!=t,o=s&&n&&t.lastUpdate!==r.getTime();return s&&(o||!n&&i?.minServerGen!==i?.serverGen)}var H=r(96184),G=r(79677),V=r(10184);const Q=e=>{const t=e;let r=class extends t{constructor(){super(...arguments),this.serviceTimeInfo=null}get timeInfo(){const e=this.associatedLayer?.timeInfo;if(null==e)return null;const t=e.clone();return(0,k.sv)(t,this.fieldsIndex),t}set timeInfo(e){(0,k.sv)(e,this.fieldsIndex),this._override("timeInfo",e)}get timeExtent(){return this.associatedLayer?.timeExtent}set timeExtent(e){this._override("timeExtent",e)}get timeOffset(){return this.associatedLayer?.timeOffset}set timeOffset(e){this._override("timeOffset",e)}get datesInUnknownTimezone(){return this.associatedLayer?.datesInUnknownTimezone??!1}set datesInUnknownTimezone(e){this._override("datesInUnknownTimezone",e)}async loadTimeInfoFromService(e){const{serviceTimeInfo:t}=this;if(null==t)return;const{startTimeField:r,endTimeField:i}=t;if(null==r&&null==i)return;if(q({associatedLayer:this.associatedLayer,serviceUpdateTimeStamp:this.serviceUpdateTimeStamp}))return;const s=async t=>{let i=null;try{const r=await(this.fetchStatistics?.(t,e));i=r?.stats}catch{}if(null==i)return null;const{minTimeStr:s,min:n,maxTimeStr:o,max:a}=i,l=t===r?s??n:o??a;return null!=l?new Date(l):null},[n,o]=await Promise.all([s(r),s(i)]);if(null!=r&&null==n||null!=i&&null==o)return;const a=new G.A({start:n,end:o});this.setAtOrigin("timeInfo",new H.A({endField:i,startField:r,fullTimeExtent:a}),"service")}};return(0,i.Cg)([(0,f.MZ)({type:H.A,json:{read:!1,write:!1}})],r.prototype,"timeInfo",null),(0,i.Cg)([(0,f.MZ)({type:G.A,json:{read:!1,write:!1}})],r.prototype,"timeExtent",null),(0,i.Cg)([(0,f.MZ)({type:V.A,json:{read:!1,write:!1}})],r.prototype,"timeOffset",null),(0,i.Cg)([(0,f.MZ)({type:Boolean,nonNullable:!0,json:{read:!1,write:!1}})],r.prototype,"datesInUnknownTimezone",null),(0,i.Cg)([(0,f.MZ)({type:J,readOnly:!0,json:{read:{source:"timeInfo"}},clonable:!1})],r.prototype,"serviceTimeInfo",void 0),r=(0,i.Cg)([(0,w.$)("esri.layers.mixins.TemporalSceneLayer")],r),r};let J=class extends $.o{constructor(){super(...arguments),this.endTimeField=null,this.startTimeField=null}};(0,i.Cg)([(0,f.MZ)({type:String})],J.prototype,"endTimeField",void 0),(0,i.Cg)([(0,f.MZ)({type:String})],J.prototype,"startTimeField",void 0),J=(0,i.Cg)([(0,w.$)("esri.layers.mixins.TemporalSceneLayer.SceneServiceTimeInfo")],J);var K=r(60694),B=r(92009),z=r(4071),W=r(10873),Y=r(15426),X=r(40530),ee=r(67202),te=r(17036),re=r(95466),ie=r(50805),se=r(20557),ne=r(46499),oe=r(39383),ae=r(37352),le=r(4513),de=r(86390);let ue=class extends $.o{constructor(){super(...arguments),this.name=null,this.field=null,this.currentRangeExtent=null,this.fullRangeExtent=null,this.type="rangeInfo"}};(0,i.Cg)([(0,f.MZ)({type:String,json:{read:!0,write:{isRequired:!0}}})],ue.prototype,"name",void 0),(0,i.Cg)([(0,f.MZ)({type:String,json:{read:!0,write:{isRequired:!0}}})],ue.prototype,"field",void 0),(0,i.Cg)([(0,f.MZ)({type:[Number],json:{read:!0,write:!0}})],ue.prototype,"currentRangeExtent",void 0),(0,i.Cg)([(0,f.MZ)({type:[Number],json:{read:!0,write:!0}})],ue.prototype,"fullRangeExtent",void 0),(0,i.Cg)([(0,f.MZ)({type:["rangeInfo"],readOnly:!0,json:{read:!1,write:{isRequired:!0}}})],ue.prototype,"type",void 0),ue=(0,i.Cg)([(0,w.$)("esri.layers.support.RangeInfo")],ue);var ce,pe=r(43773),he=r(4718),ye=r(87024),ge=r(67076),fe=r(39829);let me=ce=class extends((0,$.T)(a.A.ofType(fe.A))){constructor(e){super(e)}clone(){return new ce(this.items.map(e=>e.clone()))}write(e,t){return this.toJSON(t)}toJSON(e){const t=e?.layer?.spatialReference;return t?this.toArray().map(r=>{if(!t.equals(r.spatialReference)){if(!(0,I.canProjectWithoutEngine)(r.spatialReference,t))return e?.messages?.push(new ge.A("scenefilter:unsupported","Scene filters with incompatible spatial references are not supported",{modification:this,spatialReference:e.layer.spatialReference,context:e})),null;const i=new fe.A;(0,I.projectPolygon)(r,i,t),r=i}const i=r.toJSON(e);return delete i.spatialReference,i}).filter(e=>null!=e):this.toArray().map(t=>t.toJSON(e))}static fromJSON(e,t){const r=new ce;return e.forEach(e=>r.add(fe.A.fromJSON(e,t))),r}};me=ce=(0,i.Cg)([(0,w.$)("esri.layers.support.PolygonCollection")],me);const ve=me;var we,be=r(97159);let Ie=we=class extends $.o{constructor(e){super(e),this.spatialRelationship="disjoint",this.geometries=new ve,this._geometriesSource=null}initialize(){this.addHandles((0,g.on)(()=>this.geometries,"after-changes",()=>this.geometries=this.geometries,g.OH))}readGeometries(e,t,r){Array.isArray(e)?this.geometries=ve.fromJSON(e,r):"web-scene"!==r.origin&&"portal-item"!==r.origin||(this._geometriesSource={url:(0,be.f)(e,r),context:r})}async loadGeometries(e,t){if(null==this._geometriesSource)return;const{url:r,context:i}=this._geometriesSource,s=await(0,pe.A)(r,{responseType:"json",signal:t?.signal}),n=e.toJSON(),o=s.data.map(e=>({...e,spatialReference:n}));this.geometries=ve.fromJSON(o,i),this._geometriesSource=null}clone(){const e=new we({geometries:(0,he.o8)(this.geometries),spatialRelationship:this.spatialRelationship});return e._geometriesSource=this._geometriesSource,e}};(0,i.Cg)([(0,f.MZ)({type:["disjoint","contains"],nonNullable:!0,json:{write:{isRequired:!0}}})],Ie.prototype,"spatialRelationship",void 0),(0,i.Cg)([(0,f.MZ)({type:ve,nonNullable:!0,json:{write:!0,origins:{"web-scene":{write:{isRequired:!0}}}}}),(0,ye.P)({origins:["web-scene","portal-item"],type:"resource",prefix:"geometries",contentAddressed:!0})],Ie.prototype,"geometries",void 0),(0,i.Cg)([(0,v.w)(["web-scene","portal-item","service"],"geometries")],Ie.prototype,"readGeometries",null),Ie=we=(0,i.Cg)([(0,w.$)("esri.layers.support.SceneFilter")],Ie);const Ae=Ie;var Se=r(84952),Ce=r(8947),Me=r(41214),Fe=r(61956),xe=r(56776),Le=r(30291);async function Te(e){const t=[];for(const r of e)r.name.toLowerCase().endsWith(".zip")?t.push(je(r)):t.push(Promise.resolve(r));return(await Promise.all(t)).flat()}async function je(e){const{BlobReader:t,ZipReader:i,BlobWriter:s}=await Promise.all([r.e(1967),r.e(9588)]).then(r.bind(r,9588)),n=[],o=new i(new t(e));return(await o.getEntries()).forEach(e=>{if(e.directory||/^__MACOS/i.test(e.filename))return;const t=new s;n.push(e.getData(t).then(t=>new File([t],e.filename)))}),Promise.all(n)}var Ee=r(5682),Oe=r(45671),Pe=r(78553);const _e=new Set(["3DObject","Point"]),Ue=(0,te.p)();let Ze=class extends(Q((0,_.w6)((0,N.w)((0,O.b)((0,U.q)((0,Z.A)((0,R.j)((0,h.P)((0,P.d)((0,E.p)((0,o.OU)(T.A)))))))))))){constructor(...e){super(...e),this.featureReduction=null,this.rangeInfos=null,this.operationalLayerType="ArcGISSceneServiceLayer",this.type="scene",this.fields=null,this.graphicOrigin=new L(this),this.floorInfo=null,this.outFields=null,this.nodePages=null,this.materialDefinitions=null,this.textureSetDefinitions=null,this.geometryDefinitions=null,this.serviceUpdateTimeStamp=null,this.excludeObjectIds=new a.A,this.definitionExpression=null,this.filter=null,this.path=null,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.priority=null,this.semantic=null,this.cachedDrawingInfo={color:!1},this.popupEnabled=!0,this.popupTemplate=null,this.attributeTableTemplate=null,this.objectIdField=null,this.globalIdField=null,this._fieldUsageInfo={},this.screenSizePerspectiveEnabled=!0,this.serviceItemId=void 0}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}destroy(){this._set("renderer",null),this.associatedLayer=(0,p.pR)(this.associatedLayer)}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){const r=this.getField(e)?.domain??null;return this.associatedLayer?(0,Y.Vq)(this.associatedLayer,e,t,r):r}getFeatureType(e){return e&&this.associatedLayer?this.associatedLayer.getFeatureType(e):null}get types(){return this.associatedLayer?.types??[]}get typeIdField(){return this.associatedLayer?.typeIdField??null}get templates(){return this.associatedLayer?.templates??null}get formTemplate(){return this.associatedLayer?.formTemplate??null}get fieldsIndex(){return new re.A(this.fields)}readNodePages(e,t,r){return"Point"===t.layerType&&(e=t.pointNodePages),null==e||"object"!=typeof e?null:ie.W4.fromJSON(e,r)}set elevationInfo(e){this._set("elevationInfo",e),this.loaded&&this._validateElevationInfo()}get effectiveCapabilities(){return this._capabilitiesFromAssociatedFeatureLayer(this.associatedLayer?.effectiveCapabilities)}get effectiveEditingEnabled(){return null!=this.associatedLayer&&(0,Y.C$)(this.associatedLayer)}get geometryType(){return Ne[this.profile]||"mesh"}set renderer(e){(0,k.yp)(e,this.fieldsIndex),this._set("renderer",e)}readCachedDrawingInfo(e){return null!=e&&"object"==typeof e||(e={}),null==e.color&&(e.color=!1),e}get capabilities(){return this._capabilitiesFromAssociatedFeatureLayer(this.associatedLayer?.capabilities)}_capabilitiesFromAssociatedFeatureLayer(e){e=null!=e?e:z.P;const{query:t,queryRelated:r,editing:{supportsGlobalId:i,supportsRollbackOnFailure:s,supportsUploadWithItemId:n,supportsGeometryUpdate:o,supportsReturnServiceEditsInSourceSpatialReference:a},data:{supportsZ:l,supportsM:d,isVersioned:u,supportsAttachment:c},operations:{supportsEditing:p,supportsAdd:h,supportsUpdate:y,supportsDelete:g,supportsQuery:f,supportsQueryAttachments:m,supportsAsyncConvert3D:v}}=e,w=e.operations.supportsChangeTracking,b=!!this.associatedLayer?.infoFor3D;return{query:t,queryRelated:r,editing:{supportsGlobalId:i,supportsReturnServiceEditsInSourceSpatialReference:a,supportsRollbackOnFailure:s,supportsGeometryUpdate:b&&o,supportsUploadWithItemId:n},data:{supportsAttachment:c,supportsZ:l,supportsM:d,isVersioned:u},operations:{supportsQuery:f,supportsQueryAttachments:m,supportsEditing:p&&w,supportsAdd:b&&h&&w,supportsDelete:b&&g&&w,supportsUpdate:y&&w,supportsAsyncConvert3D:v}}}get editingEnabled(){return this._isOverridden("editingEnabled")?this._get("editingEnabled"):this.associatedLayer?.editingEnabled??!1}set editingEnabled(e){this._overrideIfSome("editingEnabled",e)}get infoFor3D(){return this.associatedLayer?.infoFor3D??null}get relationships(){return this.associatedLayer?.relationships}get defaultPopupTemplate(){return this.associatedLayer||this.attributeStorageInfo?this.createPopupTemplate():null}readObjectIdField(e,t){return!e&&t.fields&&t.fields.some(t=>("esriFieldTypeOID"===t.type&&(e=t.name),!!e)),e||void 0}readGlobalIdField(e,t){return!e&&t.fields&&t.fields.some(t=>("esriFieldTypeGlobalID"===t.type&&(e=t.name),!!e)),e||void 0}get displayField(){return this.associatedLayer?.displayField??null}readProfile(e,t){const r=t.store.profile;return null!=r&&Re[r]?Re[r]:(c.A.getLogger(this).error("Unknown or missing profile",{profile:r,layer:this}),"mesh-pyramids")}get useViewTime(){return this.associatedLayer?.useViewTime??!0}set useViewTime(e){this._override("useViewTime",e)}load(e){return this.addResolvingPromise(this._load(e)),Promise.resolve(this)}async _load(e){const t=null!=e?e.signal:null;await this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(y.QP),await this._fetchService(t),await Promise.all([this._fetchIndexAndUpdateExtent(this.nodePages,t),this._setAssociatedFeatureLayer(t),this._loadFilterGeometries()]),this._validateElevationInfo(),this._applyAssociatedLayerOverrides(),this._populateFieldUsageInfo(),await this.loadTimeInfoFromService(e),await(0,Ce.L)(this,{origin:"service"},t),(0,k.yp)(this.renderer,this.fieldsIndex),await this.finishLoadEditablePortalLayer(e)}async beforeSave(){null!=this.filter&&(this.filter=this.filter.clone(),await this.load())}async _loadFilterGeometries(){if(this.filter)try{await this.filter.loadGeometries(this.spatialReference)}catch(e){c.A.getLogger(this).error("#_loadFilterGeometries()",this,"Failed to load filter geometries. Geometry filter will not be applied for this layer.",{error:e}),this.filter=null}}createQuery(){const e=new Fe.A;return"mesh"===this.geometryType?this.capabilities.query.supportsReturnMesh&&(e.returnGeometry=!0):(e.returnGeometry=!0,e.returnZ=!0),e.where=this.definitionExpression||"1=1",e.sqlFormat="standard",e.outFields=["*"],e}queryExtent(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryExtent(e||this.createQuery(),t))}queryFeatureCount(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryFeatureCount(e||this.createQuery(),t))}queryFeatures(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryFeatures(e||this.createQuery(),t)).then(e=>{if(e?.features)for(const t of e.features)t.layer=this,t.sourceLayer=this,t.origin=this.graphicOrigin;return e})}async queryRelatedFeatures(e,t){if(await this.load(),!this.associatedLayer)throw new d.A("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});return this.associatedLayer.queryRelatedFeatures(e,t)}async queryRelatedFeaturesCount(e,t){if(await this.load(),!this.associatedLayer)throw new d.A("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});return this.associatedLayer.queryRelatedFeaturesCount(e,t)}async queryCachedAttributes(e,t){const r=(0,k.hL)(this.fieldsIndex,await(0,Oe.TO)(this,(0,Oe.D8)(this)));return(0,Ee.s1)(this.parsedUrl?.path??"",this.attributeStorageInfo??[],e,t,r,this.apiKey,this.customParameters)}async queryCachedFeature(e,t){const r=await this.queryCachedAttributes(e,[t]);if(!r||0===r.length)throw new d.A("scenelayer:feature-not-in-cached-data","Feature not found in cached data");const i=new s.A;return i.attributes=r[0],i.layer=this,i.sourceLayer=this,i.origin=this.graphicOrigin,i}queryObjectIds(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryObjectIds(e||this.createQuery(),t))}queryAttachments(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryAttachments(e,t))}getFieldUsageInfo(e){const t={supportsLabelingInfo:!1,supportsRenderer:!1,supportsPopupTemplate:!1,supportsLayerQuery:!1};return this.loaded?this._fieldUsageInfo[e]||t:(c.A.getLogger(this).error("#getFieldUsageInfo()","Unavailable until layer is loaded"),t)}createPopupTemplate(e){return(0,Le.tn)(this,e)}_getAssociatedLayerForQuery(){const e=this.associatedLayer;return e?.loaded?Promise.resolve(e):this._loadAssociatedLayerForQuery()}async _loadAssociatedLayerForQuery(){if(await this.load(),!this.associatedLayer)throw new d.A("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});try{await this.associatedLayer.load()}catch(e){throw new d.A("scenelayer:query-not-available","SceneLayer associated feature layer could not be loaded",{layer:this,error:e})}return this.associatedLayer}hasCachedStatistics(e){return null!=this.statisticsInfo&&this.statisticsInfo.some(t=>t.name===e)}async queryCachedStatistics(e,t){return await this.load(t),await this.fetchStatistics(e,t)}async saveAs(e,t){return this._debouncedSaveOperations(1,{...t,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"};return this._debouncedSaveOperations(0,e)}async applyEdits(e,t){const{applyEdits:i}=await r.e(8628).then(r.bind(r,78628));let s=t;await this.load();const n=this.associatedLayer;if(!n)throw new d.A(`${this.type}-layer:not-editable`,"Service is not editable");await n.load();const{globalIdField:o}=n,a=!!n.infoFor3D,l=s?.globalIdUsed??!0;if(a&&null==o)throw new d.A(`${this.type}-layer:not-editable`,"Valid globalIdField expected on editable SceneLayer");if(a&&!l)throw new d.A(`${this.type}-layer:globalid-required`,"globalIdUsed must not be false for SceneLayer editing as globalIds are required.");return(0,K.Wo)(n.url)&&a&&null!=e.deleteFeatures&&null!=o&&(s={...s,globalIdToObjectId:await(0,Y.GA)(n,e.deleteFeatures,o)}),i(this,n.source,e,s)}async uploadAssets(e,t){if(await this.load(),null==this.associatedLayer)throw new d.A(`${this.type}-layer:not-editable`,"Service is not editable");return await this.associatedLayer.load(),this.associatedLayer.uploadAssets(e,t)}async convertMesh(e,t){t??={},null!=t.location&&(0,l.io)(c.A.getLogger(this),"The 'location' option of convertMesh() has been deprecated in favour of 'origin'.",{version:"4.34",replacement:"origin",warnOnce:!0});const i=e=>{throw c.A.getLogger(this).error(".convertMesh()",e.message),e};await this.load(t),this.infoFor3D||i(new d.A("invalid:layer","SceneLayer has no capability for mesh conversion"));const s=await this.extractAndFilterFiles(e);(0,y.Te)(t);const n=s.reduce((e,t)=>(0,se.oF)(this.infoFor3D,t)?e+1:e,0);0===n&&i(new j.VP),n>1&&i(new j.XQ);const o=this.spatialReference,a=t.origin??t.location,u=await(0,I.projectWithZConversion)(a??t.defaultOrigin??new b.A({x:0,y:0,z:0,spatialReference:o}),o,t),p=u.spatialReference.isGeographic?"local":"georeferenced",{default:h}=await Promise.all([r.e(8487),r.e(36)]).then(r.bind(r,40036));(0,y.Te)(t);const g=h.createWithExternalSource(u,{type:"client",files:s},{vertexSpace:p,transform:(0,de.Z)(u.spatialReference),unitConversionDisabled:!0}),[f]=await this.uploadAssets([g],{...t,useAssetOrigin:!a});return f}async extractAndFilterFiles(e){await this.load();const t=this.infoFor3D;return t?(await Te(e)).filter(e=>(0,se.fu)(t,e)):e}validateLayer(e){if(e.layerType&&!_e.has(e.layerType))throw new d.A("scenelayer:layer-type-not-supported","SceneLayer does not support this layer type",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor))throw new d.A("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"1.x, 2.x"});if(this.version.major>2)throw new d.A("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"1.x, 2.x"});!function(e,t){let r=!1,i=!1;if(null==e)r=!0,i=!0;else{const s=t&&t.isGeographic;switch(e){case"east-north-up":case"earth-centered":r=!0,i=s;break;case"vertex-reference-frame":r=!0,i=!s;break;default:r=!1}}if(!r)throw new d.A("scenelayer:unsupported-normal-reference-frame","Normal reference frame is invalid.");if(!i)throw new d.A("scenelayer:incompatible-normal-reference-frame","Normal reference frame is incompatible with layer spatial reference.")}(this.normalReferenceFrame,this.spatialReference)}_getTypeKeywords(){const e=[];if("points"===this.profile)e.push("Point");else{if("mesh-pyramids"!==this.profile)throw new d.A("scenelayer:unknown-profile","SceneLayer:save() encountered an unknown SceneLayer profile: "+this.profile);e.push("3DObject")}return e}_populateFieldUsageInfo(){if(this._fieldUsageInfo={},this.fields)for(const e of this.fields){const t=!!this.attributeStorageInfo?.some(t=>t.name===e.name),r=!!this.associatedLayer?.fields?.some(t=>t&&e.name===t.name),i={supportsLabelingInfo:t,supportsRenderer:t,supportsPopupTemplate:t||r,supportsLayerQuery:r};this._fieldUsageInfo[e.name]=i}}_applyAssociatedLayerOverrides(){this._applyAssociatedLayerFieldsOverrides(),this._applyAssociatedLayerPropertyOverrides(),this._applyAssociatedLayerExtentOverride(),this._applyAssociatedLayerPrivileges()}_applyAssociatedLayerFieldsOverrides(){if(!this.associatedLayer?.fields)return;let e=null;for(const t of this.associatedLayer.fields){const r=this.getField(t.name);r?(!r.domain&&t.domain&&(r.domain=t.domain.clone()),r.editable=t.editable,r.nullable=t.nullable,r.length=t.length):(e||(e=this.fields?this.fields.slice():[]),e.push(t.clone()))}e&&this._set("fields",e)}_applyAssociatedLayerPropertyOverrides(){if(!this.associatedLayer)return;const e=["popupTemplate","popupEnabled","attributeTableTemplate"],t=(0,m.oY)(this);for(let r=0;r<e.length;r++){const i=e[r],s=this.originIdOf(i),n=this.associatedLayer.originIdOf(i);s<n&&(2===n||3===n)&&t.setAtOrigin(i,this.associatedLayer[i],n)}}_applyAssociatedLayerExtentOverride(){const e=this.associatedLayer?.getAtOrigin("fullExtent","service");null!=this.associatedLayer?.infoFor3D&&e&&(0,K.Wo)(this.associatedLayer?.url)&&q(this)&&(0,m.oY)(this).setAtOrigin("fullExtent",e.clone(),2)}_applyAssociatedLayerPrivileges(){const e=this.associatedLayer;e&&(this._set("userHasEditingPrivileges",e.userHasEditingPrivileges),this._set("userHasFullEditingPrivileges",e.userHasFullEditingPrivileges),this._set("userHasUpdateItemPrivileges",e.userHasUpdateItemPrivileges))}async _setAssociatedFeatureLayer(e){if(["mesh-pyramids","points"].includes(this.profile))try{const{serverUrl:t,layerId:r,portalItem:i}=await(0,B.L)(`${this.url}/layers/${this.layerId}`,{sceneLayerItem:this.portalItem,customParameters:this.customParameters,apiKey:this.apiKey,signal:e}),s=await le.S.FeatureLayer();this.associatedLayer=new s({url:t,customParameters:this.customParameters,layerId:r,portalItem:i}),await this.associatedLayer.load()}catch(e){(0,y.zf)(e)||this._logWarningOnPopupEnabled()}}async _logWarningOnPopupEnabled(){const e=new AbortController;this.addHandles((0,u.rE)(e));try{await(0,g.C_)(()=>this.popupEnabled&&null!=this.popupTemplate,e.signal)}catch(e){return void(0,y.jH)(e)}const t=`this SceneLayer: ${this.title}`;null==this.attributeStorageInfo?c.A.getLogger(this).warn(`Associated FeatureLayer could not be loaded and no binary attributes found. Popups will not work on ${t}`):c.A.getLogger(this).info(`Associated FeatureLayer could not be loaded. Falling back to binary attributes for Popups on ${t}`)}_validateElevationInfo(){const e=this.elevationInfo;"mesh-pyramids"===this.profile&&(0,xe.XF)(c.A.getLogger(this),(0,xe.$7)("Mesh scene layers","relative-to-scene",e)),(0,xe.XF)(c.A.getLogger(this),(0,xe.tW)("Scene layers",e))}async fetchStatistics(e,t){return await async function({fieldName:e,statisticsInfo:t,errorContext:r,fieldsIndex:i,path:s,customParameters:n,apiKey:o,signal:a}){if(null==t)throw new d.A(`${r}:no-cached-statistics`,"Cached statistics are not available for this layer");const l=i.get(e);if(null==l)throw new d.A(`${r}:field-unexisting`,`Field '${e}' does not exist on the layer`);const u=t.find(e=>e.name===l.name);if(null==u)throw new d.A(`${r}:no-cached-statistics`,"Cached statistics for this attribute are not available");const c=(0,Se.fj)(s,u.href),{data:p}=await(0,pe.A)(c,{query:{f:"json",...n,token:o},responseType:"json",signal:a});return p}({fieldName:e,statisticsInfo:this.statisticsInfo,errorContext:"scenelayer",fieldsIndex:this.fieldsIndex,path:this.parsedUrl?.path??"",customParameters:this.customParameters,apiKey:this.apiKey,signal:t?.signal})}};(0,i.Cg)([(0,f.MZ)({types:{key:"type",base:X.c,typeMap:{selection:ee.A}},json:{origins:{"web-scene":{name:"layerDefinition.featureReduction",write:{allowNull:!0}},"portal-item":{name:"layerDefinition.featureReduction",write:{allowNull:!0}}}}})],Ze.prototype,"featureReduction",void 0),(0,i.Cg)([(0,f.MZ)({type:[ue],json:{read:!1,origins:{"web-scene":{name:"layerDefinition.rangeInfos",write:!0},"portal-item":{name:"layerDefinition.rangeInfos",write:!0}}},clonable:!1})],Ze.prototype,"rangeInfos",void 0),(0,i.Cg)([(0,f.MZ)({json:{read:!1}})],Ze.prototype,"associatedLayer",void 0),(0,i.Cg)([(0,f.MZ)({type:["show","hide"]})],Ze.prototype,"listMode",void 0),(0,i.Cg)([(0,f.MZ)({type:["ArcGISSceneServiceLayer"]})],Ze.prototype,"operationalLayerType",void 0),(0,i.Cg)([(0,f.MZ)({json:{read:!1},readOnly:!0})],Ze.prototype,"type",void 0),(0,i.Cg)([(0,f.MZ)({...Ue.fields,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],Ze.prototype,"fields",void 0),(0,i.Cg)([(0,f.MZ)()],Ze.prototype,"types",null),(0,i.Cg)([(0,f.MZ)()],Ze.prototype,"typeIdField",null),(0,i.Cg)([(0,f.MZ)()],Ze.prototype,"templates",null),(0,i.Cg)([(0,f.MZ)()],Ze.prototype,"formTemplate",null),(0,i.Cg)([(0,f.MZ)({readOnly:!0})],Ze.prototype,"graphicOrigin",void 0),(0,i.Cg)([(0,f.MZ)({readOnly:!0,clonable:!1})],Ze.prototype,"fieldsIndex",null),(0,i.Cg)([(0,f.MZ)({type:ae.A,json:{read:{source:"layerDefinition.floorInfo"},write:{target:"layerDefinition.floorInfo"}}})],Ze.prototype,"floorInfo",void 0),(0,i.Cg)([(0,f.MZ)(Ue.outFields)],Ze.prototype,"outFields",void 0),(0,i.Cg)([(0,f.MZ)({type:ie.W4,readOnly:!0,json:{read:!1},clonable:!1})],Ze.prototype,"nodePages",void 0),(0,i.Cg)([(0,v.w)("service","nodePages",["nodePages","pointNodePages"])],Ze.prototype,"readNodePages",null),(0,i.Cg)([(0,f.MZ)({type:[ie.uV],readOnly:!0,clonable:!1})],Ze.prototype,"materialDefinitions",void 0),(0,i.Cg)([(0,f.MZ)({type:[ie.Ot],readOnly:!0,clonable:!1})],Ze.prototype,"textureSetDefinitions",void 0),(0,i.Cg)([(0,f.MZ)({type:[ie.L0],readOnly:!0,clonable:!1})],Ze.prototype,"geometryDefinitions",void 0),(0,i.Cg)([(0,f.MZ)({readOnly:!0})],Ze.prototype,"serviceUpdateTimeStamp",void 0),(0,i.Cg)([(0,f.MZ)({readOnly:!0})],Ze.prototype,"attributeStorageInfo",void 0),(0,i.Cg)([(0,f.MZ)({readOnly:!0})],Ze.prototype,"statisticsInfo",void 0),(0,i.Cg)([(0,f.MZ)({type:a.A.ofType(Number),nonNullable:!0,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.excludeObjectIds",write:{enabled:!0}}})],Ze.prototype,"excludeObjectIds",void 0),(0,i.Cg)([(0,f.MZ)({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],Ze.prototype,"definitionExpression",void 0),(0,i.Cg)([(0,f.MZ)({type:Ae,json:{name:"layerDefinition.polygonFilter",write:{enabled:!0,allowNull:!0},origins:{service:{read:!1,write:!1}}}})],Ze.prototype,"filter",void 0),(0,i.Cg)([(0,f.MZ)({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],Ze.prototype,"path",void 0),(0,i.Cg)([(0,f.MZ)(W.Yj)],Ze.prototype,"elevationInfo",null),(0,i.Cg)([(0,f.MZ)({readOnly:!0,json:{read:!1}})],Ze.prototype,"effectiveCapabilities",null),(0,i.Cg)([(0,f.MZ)({readOnly:!0})],Ze.prototype,"effectiveEditingEnabled",null),(0,i.Cg)([(0,f.MZ)({type:String})],Ze.prototype,"geometryType",null),(0,i.Cg)([(0,f.MZ)(W.kF)],Ze.prototype,"labelsVisible",void 0),(0,i.Cg)([(0,f.MZ)({type:[ne.A],json:{origins:{service:{name:"drawingInfo.labelingInfo",read:{reader:oe.w},write:!1}},name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:oe.w},write:!0}})],Ze.prototype,"labelingInfo",void 0),(0,i.Cg)([(0,f.MZ)(W.fV)],Ze.prototype,"legendEnabled",void 0),(0,i.Cg)([(0,f.MZ)({type:Number,json:{origins:{"web-document":{default:1,write:{enabled:!0,target:{opacity:{type:Number},"layerDefinition.drawingInfo.transparency":{type:Number}}},read:{source:["opacity","layerDefinition.drawingInfo.transparency"],reader(e,t){if("number"==typeof e&&e>=0&&e<=1)return e;const r=t.layerDefinition?.drawingInfo?.transparency;return void 0!==r?(0,Pe.D)(r):void 0}}},"portal-item":{write:!0},service:{read:!1}}}})],Ze.prototype,"opacity",void 0),(0,i.Cg)([(0,f.MZ)({type:["Low","High"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],Ze.prototype,"priority",void 0),(0,i.Cg)([(0,f.MZ)({type:["Labels"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],Ze.prototype,"semantic",void 0),(0,i.Cg)([(0,f.MZ)({types:Me.XJ,json:{origins:{service:{read:{source:"drawingInfo.renderer"}}},name:"layerDefinition.drawingInfo.renderer",write:!0},value:null})],Ze.prototype,"renderer",null),(0,i.Cg)([(0,f.MZ)({json:{read:!1}})],Ze.prototype,"cachedDrawingInfo",void 0),(0,i.Cg)([(0,v.w)("service","cachedDrawingInfo")],Ze.prototype,"readCachedDrawingInfo",null),(0,i.Cg)([(0,f.MZ)({readOnly:!0,json:{read:!1}})],Ze.prototype,"capabilities",null),(0,i.Cg)([(0,f.MZ)({type:Boolean,json:{read:!1}})],Ze.prototype,"editingEnabled",null),(0,i.Cg)([(0,f.MZ)({readOnly:!0,json:{write:!1,read:!1}})],Ze.prototype,"infoFor3D",null),(0,i.Cg)([(0,f.MZ)({readOnly:!0,json:{write:!1,read:!1}})],Ze.prototype,"relationships",null),(0,i.Cg)([(0,f.MZ)(W.M6)],Ze.prototype,"popupEnabled",void 0),(0,i.Cg)([(0,f.MZ)({type:n.A,json:{name:"popupInfo",write:!0}})],Ze.prototype,"popupTemplate",void 0),(0,i.Cg)([(0,f.MZ)({readOnly:!0,json:{read:!1}})],Ze.prototype,"defaultPopupTemplate",null),(0,i.Cg)([(0,f.MZ)(W.zQ)],Ze.prototype,"attributeTableTemplate",void 0),(0,i.Cg)([(0,f.MZ)({type:String,json:{read:!1}})],Ze.prototype,"objectIdField",void 0),(0,i.Cg)([(0,v.w)("service","objectIdField",["objectIdField","fields"])],Ze.prototype,"readObjectIdField",null),(0,i.Cg)([(0,f.MZ)({type:String,json:{read:!1}})],Ze.prototype,"globalIdField",void 0),(0,i.Cg)([(0,v.w)("service","globalIdField",["globalIdField","fields"])],Ze.prototype,"readGlobalIdField",null),(0,i.Cg)([(0,f.MZ)({readOnly:!0,type:String,json:{read:!1}})],Ze.prototype,"displayField",null),(0,i.Cg)([(0,f.MZ)({type:String,json:{read:!1}})],Ze.prototype,"profile",void 0),(0,i.Cg)([(0,v.w)("service","profile",["store.profile"])],Ze.prototype,"readProfile",null),(0,i.Cg)([(0,f.MZ)({readOnly:!0,type:String,json:{origins:{service:{read:{source:"store.normalReferenceFrame"}}},read:!1}})],Ze.prototype,"normalReferenceFrame",void 0),(0,i.Cg)([(0,f.MZ)(W.PY)],Ze.prototype,"screenSizePerspectiveEnabled",void 0),(0,i.Cg)([(0,f.MZ)({json:{read:!1,origins:{service:{read:!0}}}})],Ze.prototype,"serviceItemId",void 0),(0,i.Cg)([(0,f.MZ)(D.B)],Ze.prototype,"useViewTime",null),Ze=(0,i.Cg)([(0,w.$)("esri.layers.SceneLayer")],Ze);const Re={"mesh-pyramids":"mesh-pyramids",meshpyramids:"mesh-pyramids","features-meshes":"mesh-pyramids",points:"points","features-points":"points",lines:"lines","features-lines":"lines",polygons:"polygons","features-polygons":"polygons"},Ne={"mesh-pyramids":"mesh",points:"point"},De=Ze},40530:(e,t,r)=>{r.d(t,{c:()=>a});var i=r(31635),s=r(25482),n=r(10107),o=(r(44208),r(53966),r(87811),r(64108));let a=class extends s.o{constructor(){super(...arguments),this.type=null}};(0,i.Cg)([(0,n.MZ)({type:["selection","cluster","binning"],readOnly:!0,json:{read:!1,write:!0}})],a.prototype,"type",void 0),a=(0,i.Cg)([(0,o.$)("esri.layers.support.FeatureReduction")],a)},47685:(e,t,r)=>{r.d(t,{Mk:()=>g,Zk:()=>h,w6:()=>v});var i=r(31635),s=r(65529),n=r(4718),o=r(74887),a=r(10107),l=(r(44208),r(53966),r(64108)),d=r(20816);const u=new s.bk;function c(e){return u.on("apply-edits",new WeakRef(e))}function p(e){return u.on("update-moment",new WeakRef(e))}function h(e,t,r=null,i=!1){const s=(0,o.Tw)();return i=null==t||i,u.emit("apply-edits",{serviceUrl:e,layerId:t,gdbVersion:r,mayReceiveServiceEdits:i,result:s.promise}),s}const y=Symbol();function g(e){return null!=e&&"object"==typeof e&&y in e}function f(e){return null!=e&&"object"==typeof e&&"gdbVersion"in e}function m(e,t,r){const i=new URL(e).host,s=d.Z3.get(i),n=e=>!e||e===s;return n(t)&&n(r)||t===r}const v=e=>{var t;const r=e;let s=class extends r{static{t=y}constructor(...e){super(...e),this[t]=!0,this._applyEditsHandler=e=>{const{serviceUrl:t,layerId:r,gdbVersion:i,mayReceiveServiceEdits:s,result:o}=e,a=t===this.url,l=null!=r&&null!=this.layerId&&r===this.layerId,d=f(this),u=f(this)&&m(t,i,this.gdbVersion);if(!a||d&&!u||!l&&!s)return;const c=o.then(e=>{if(this.lastEditsEventDate=new Date,l&&(e.addedFeatures.length||e.updatedFeatures.length||e.deletedFeatures.length||e.addedAttachments.length||e.updatedAttachments.length||e.deletedAttachments.length))return this.emit("edits",(0,n.o8)(e)),e;const r=e.editedFeatures?.find(({layerId:e})=>e===this.layerId);if(r){const{adds:t,updates:i,deletes:s}=r.editedFeatures,o={edits:null,addedAttachments:[],deletedAttachments:[],updatedAttachments:[],addedFeatures:t?t.map(({attributes:e})=>({objectId:this.objectIdField&&e[this.objectIdField],globalId:this.globalIdField&&e[this.globalIdField]})):[],deletedFeatures:s?s.map(({attributes:e})=>({objectId:this.objectIdField&&e[this.objectIdField],globalId:this.globalIdField&&e[this.globalIdField]})):[],updatedFeatures:i?i.map(({current:{attributes:e}})=>({objectId:this.objectIdField&&e[this.objectIdField],globalId:this.globalIdField&&e[this.globalIdField]})):[],editedFeatures:(0,n.o8)(e.editedFeatures),exceededTransferLimit:!1,historicMoment:(0,n.o8)(e.historicMoment)};return this.emit("edits",o),o}const s={edits:null,addedAttachments:[],deletedAttachments:[],updatedAttachments:[],addedFeatures:[],deletedFeatures:[],updatedFeatures:[],editedFeatures:(0,n.o8)(e.editedFeatures),exceededTransferLimit:!1,historicMoment:(0,n.o8)(e.historicMoment)};return"historicMoment"in this&&this._shouldUpdateHistoricMoment(t,i,s.historicMoment)&&this.emit("edits",s),s}).then(e=>("historicMoment"in this&&this._shouldUpdateHistoricMoment(t,i,e.historicMoment)&&(this.historicMoment=e.historicMoment),e));this.emit("apply-edits",{result:c})},this._updateMomentHandler=e=>{const{serviceUrl:t,gdbVersion:r,moment:i}=e,s=t===this.url,n=f(this),o=f(this)&&m(t,r,this.gdbVersion),a=f(this)&&!m(t,this.gdbVersion,null);s&&n&&o&&a&&"historicMoment"in this&&this.historicMoment!==i&&(this.historicMoment=i)},this.when().then(()=>{this.addHandles(c(this._applyEditsHandler)),"historicMoment"in this&&this.addHandles(p(this._updateMomentHandler))},()=>{})}_shouldUpdateHistoricMoment(e,t,r){return"historicMoment"in this&&this.historicMoment!==r&&(0,d.w5)(e,t)}};return(0,i.Cg)([(0,a.MZ)()],s.prototype,"lastEditsEventDate",void 0),s=(0,i.Cg)([(0,l.$)("esri.layers.mixins.EditBusLayer")],s),s}},54239:(e,t,r)=>{r.d(t,{A:()=>m});var i,s=r(31635),n=r(4576),o=r(66552),a=r(25482),l=r(83047),d=r(67076),u=r(10107),c=(r(44208),r(53966),r(36005)),p=r(64108),h=r(43937);const y=(0,o.O)()({orthometric:"gravity-related-height",gravity_related_height:"gravity-related-height",ellipsoidal:"ellipsoidal"}),g=y.jsonValues.slice();(0,n.Xy)(g,"orthometric");const f=(0,o.O)()({meter:"meters",foot:"feet","us-foot":"us-feet","clarke-foot":"clarke-feet","clarke-yard":"clarke-yards","clarke-link":"clarke-links","sears-yard":"sears-yards","sears-foot":"sears-feet","sears-chain":"sears-chains","benoit-1895-b-chain":"benoit-1895-b-chains","indian-yard":"indian-yards","indian-1937-yard":"indian-1937-yards","gold-coast-foot":"gold-coast-feet","sears-1922-truncated-chain":"sears-1922-truncated-chains","50-kilometers":"50-kilometers","150-kilometers":"150-kilometers"});let m=i=class extends a.o{constructor(e){super(e),this.heightModel="gravity-related-height",this.heightUnit="meters",this.vertCRS=null}writeHeightModel(e,t,r){return y.write(e,t,r)}readHeightModel(e,t,r){return y.read(e)||(r?.messages&&r.messages.push(function(e,t){return new d.A("height-model:unsupported",`Height model of value '${e}' is not supported`,t)}(e,{context:r})),null)}readHeightUnit(e,t,r){return f.read(e)||(r?.messages&&r.messages.push(v(e,{context:r})),null)}readHeightUnitService(e,t,r){return(0,l.LA)(e)||f.read(e)||(r?.messages&&r.messages.push(v(e,{context:r})),null)}readVertCRS(e,t){return t.vertCRS||t.ellipsoid||t.geoid}clone(){return new i({heightModel:this.heightModel,heightUnit:this.heightUnit,vertCRS:this.vertCRS})}equals(e){return!!e&&(this===e||this.heightModel===e.heightModel&&this.heightUnit===e.heightUnit&&this.vertCRS===e.vertCRS)}static deriveUnitFromSR(e,t){const r=(0,l.k1)(t);return new i({heightModel:e.heightModel,heightUnit:r??void 0,vertCRS:e.vertCRS})}write(e,t){return t={origin:"web-scene",...t},super.write(e,t)}static fromJSON(e){if(!e)return null;const t=new i;return t.read(e,{origin:"web-scene"}),t}};function v(e,t){return new d.A("height-unit:unsupported",`Height unit of value '${e}' is not supported`,t)}(0,s.Cg)([(0,u.MZ)({type:y.apiValues,constructOnly:!0,json:{origins:{"web-scene":{type:g,default:"ellipsoidal",write:{isRequired:!0}}}}})],m.prototype,"heightModel",void 0),(0,s.Cg)([(0,h.K)("web-scene","heightModel")],m.prototype,"writeHeightModel",null),(0,s.Cg)([(0,c.w)(["web-scene","service"],"heightModel")],m.prototype,"readHeightModel",null),(0,s.Cg)([(0,u.MZ)({type:f.apiValues,constructOnly:!0,json:{origins:{"web-scene":{type:f.jsonValues,write:{writer:f.write,isRequired:!0}}}}})],m.prototype,"heightUnit",void 0),(0,s.Cg)([(0,c.w)("web-scene","heightUnit")],m.prototype,"readHeightUnit",null),(0,s.Cg)([(0,c.w)("service","heightUnit")],m.prototype,"readHeightUnitService",null),(0,s.Cg)([(0,u.MZ)({type:String,constructOnly:!0,json:{origins:{"web-scene":{write:!0}}}})],m.prototype,"vertCRS",void 0),(0,s.Cg)([(0,c.w)("service","vertCRS",["vertCRS","ellipsoid","geoid"])],m.prototype,"readVertCRS",null),m=i=(0,s.Cg)([(0,p.$)("esri.geometry.HeightModelInfo")],m)},55726:(e,t,r)=>{r.d(t,{$1:()=>d,H2:()=>h,MT:()=>y,VP:()=>g,WF:()=>u,Wt:()=>o,XQ:()=>f,hK:()=>p,nS:()=>c,uh:()=>a,xY:()=>l});var i=r(49186);const s="upload-assets",n=()=>new Error;class o extends i.A{constructor(){super(`${s}:unsupported`,"Layer does not support asset uploads.",n())}}class a extends i.A{constructor(){super(`${s}:no-glb-support`,"Layer does not support glb.",n())}}class l extends i.A{constructor(){super(`${s}:no-supported-source`,"No supported external source found",n())}}class d extends i.A{constructor(){super(`${s}:not-base-64`,"Expected gltf data in base64 format after conversion.",n())}}class u extends i.A{constructor(){super(`${s}:unable-to-prepare-options`,"Unable to prepare uploadAsset request options.",n())}}class c extends i.A{constructor(e,t){super(`${s}:bad-response`,`Bad response. Uploaded ${e} items and received ${t} results.`,n())}}class p extends i.A{constructor(e,t){super(`${s}-layer:upload-failed`,`Failed to upload mesh file ${e}. Error code: ${t?.code??"-1"}. Error message: ${t?.messages??"unknown"}`,n())}}class h extends i.A{constructor(e){super(`${s}-layer:unsupported-format`,`The service allowed us to upload an asset of FormatID ${e}, but it does not list it in its supported formats.`,n())}}class y extends i.A{constructor(){super(`${s}:convert3D-failed`,"convert3D failed.")}}class g extends i.A{constructor(){super("invalid-input:no-model","No supported model found")}}class f extends i.A{constructor(){super("invalid-input:multiple-models","Multiple supported models found")}}},67202:(e,t,r)=>{r.d(t,{A:()=>l});var i,s=r(31635),n=r(10107),o=(r(44208),r(53966),r(87811),r(64108)),a=r(40530);let l=i=class extends a.c{constructor(e){super(e),this.type="selection"}clone(){return new i}};(0,s.Cg)([(0,n.MZ)({type:["selection"]})],l.prototype,"type",void 0),l=i=(0,s.Cg)([(0,o.$)("esri.layers.support.FeatureReductionSelection")],l)},69208:(e,t,r)=>{r.d(t,{d:()=>o});var i=r(31635),s=r(10107),n=(r(44208),r(53966),r(87811),r(64108));const o=e=>{const t=e;let r=class extends t{constructor(){super(...arguments),this.customParameters=null}};return(0,i.Cg)([(0,s.MZ)({type:Object,json:{write:{overridePolicy:e=>({enabled:!!(e&&Object.keys(e).length>0)})}}})],r.prototype,"customParameters",void 0),r=(0,i.Cg)([(0,n.$)("esri.layers.mixins.CustomParametersMixin")],r),r}},73133:(e,t,r)=>{r.d(t,{j:()=>i});const i=(0,r(66552).O)()({esriTimeUnitsMilliseconds:"milliseconds",esriTimeUnitsSeconds:"seconds",esriTimeUnitsMinutes:"minutes",esriTimeUnitsHours:"hours",esriTimeUnitsDays:"days",esriTimeUnitsWeeks:"weeks",esriTimeUnitsMonths:"months",esriTimeUnitsYears:"years",esriTimeUnitsDecades:"decades",esriTimeUnitsCenturies:"centuries",esriTimeUnitsUnknown:void 0})},73179:(e,t,r)=>{r.d(t,{b:()=>l,h:()=>d});var i=r(4718),s=r(53966),n=r(84952),o=r(60694),a=r(10873);function l(e){const{nonStandardUrlAllowed:t=!1,separator:r}=e??{},n=(0,i.o8)(a.OZ),l=n.json?.write;return"object"==typeof l&&l&&(l.writer=function(e,t,i,s){(0,o.LS)(this,e,r,t,s)}),{...n,set:function(e){if(null==e)return void this._set("url",e);const r=(0,o.HZ)({layer:this,url:e,nonStandardUrlAllowed:t,logger:s.A.getLogger(this)});this._set("url",r.url),null!=r.layerId&&this._set("layerId",r.layerId)}}}function d(e,t){const{separator:r}=t??{},i=(0,n.An)(e.url);return null!=i&&(null!=e.dynamicDataSource?i.path=(0,n.fj)(i.path,"dynamicLayer"):null!=e.layerId&&(i.path=(0,n.fj)(i.path,r??"",e.layerId.toString()))),i}},73836:(e,t,r)=>{r.d(t,{A:()=>y});var i=r(31635),s=r(69540),n=r(25482),o=r(10107),a=(r(44208),r(53966),r(87811),r(64108)),l=r(58083),d=r(9093),u=r(67026),c=r(82534),p=r(51850),h=r(24770);let y=class extends((0,s.OU)(n.o)){constructor(e){super(e),this.translation=(0,p.vt)(),this.rotationAxis=(0,p.ci)(h.up),this.rotationAngle=0,this.scale=(0,p.fA)(1,1,1)}get rotation(){return(0,h.i4)(this.rotationAxis,this.rotationAngle)}set rotation(e){this.rotationAxis=(0,p.o8)((0,h.yo)(e)),this.rotationAngle=(0,h.g7)(e)}get localMatrix(){const e=(0,d.vt)();return(0,u.x8)(g,(0,h.yo)(this.rotation),(0,h.$I)(this.rotation)),(0,l.o1)(e,g,this.translation,this.scale),e}get localMatrixInverse(){return(0,l.B8)((0,d.vt)(),this.localMatrix)}equals(e){return this===e||null!=e&&(0,l.t2)(this.localMatrix,e.localMatrix)}};(0,i.Cg)([(0,o.MZ)({type:[Number],nonNullable:!0,json:{write:!0}})],y.prototype,"translation",void 0),(0,i.Cg)([(0,o.MZ)({type:[Number],nonNullable:!0,json:{write:!0}})],y.prototype,"rotationAxis",void 0),(0,i.Cg)([(0,o.MZ)({type:Number,nonNullable:!0,json:{write:!0}})],y.prototype,"rotationAngle",void 0),(0,i.Cg)([(0,o.MZ)({type:[Number],nonNullable:!0,json:{write:!0}})],y.prototype,"scale",void 0),(0,i.Cg)([(0,o.MZ)()],y.prototype,"rotation",null),(0,i.Cg)([(0,o.MZ)()],y.prototype,"localMatrix",null),(0,i.Cg)([(0,o.MZ)()],y.prototype,"localMatrixInverse",null),y=(0,i.Cg)([(0,a.$)("esri.geometry.support.MeshTransform")],y);const g=(0,c.vt)()},80200:(e,t,r)=>{r.d(t,{T:()=>i,d:()=>g});const i={Base64:0,Hex:1,String:2,Raw:3},s=8,n=(1<<s)-1;function o(e,t){const r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}function a(e){const t=[];for(let r=0,i=e.length*s;r<i;r+=s)t[r>>5]|=(e.charCodeAt(r/s)&n)<<r%32;return t}function l(e){const t=[];for(let r=0,i=32*e.length;r<i;r+=s)t.push(String.fromCharCode(e[r>>5]>>>r%32&n));return t.join("")}function d(e,t,r,i,s,n){return o(function(e,t){return e<<t|e>>>32-t}(o(o(t,e),o(i,n)),s),r)}function u(e,t,r,i,s,n,o){return d(t&r|~t&i,e,t,s,n,o)}function c(e,t,r,i,s,n,o){return d(t&i|r&~i,e,t,s,n,o)}function p(e,t,r,i,s,n,o){return d(t^r^i,e,t,s,n,o)}function h(e,t,r,i,s,n,o){return d(r^(t|~i),e,t,s,n,o)}function y(e,t){e[t>>5]|=128<<t%32,e[14+(t+64>>>9<<4)]=t;let r=1732584193,i=-271733879,s=-1732584194,n=271733878;for(let t=0;t<e.length;t+=16){const a=r,l=i,d=s,y=n;r=u(r,i,s,n,e[t],7,-680876936),n=u(n,r,i,s,e[t+1],12,-389564586),s=u(s,n,r,i,e[t+2],17,606105819),i=u(i,s,n,r,e[t+3],22,-1044525330),r=u(r,i,s,n,e[t+4],7,-176418897),n=u(n,r,i,s,e[t+5],12,1200080426),s=u(s,n,r,i,e[t+6],17,-1473231341),i=u(i,s,n,r,e[t+7],22,-45705983),r=u(r,i,s,n,e[t+8],7,1770035416),n=u(n,r,i,s,e[t+9],12,-1958414417),s=u(s,n,r,i,e[t+10],17,-42063),i=u(i,s,n,r,e[t+11],22,-1990404162),r=u(r,i,s,n,e[t+12],7,1804603682),n=u(n,r,i,s,e[t+13],12,-40341101),s=u(s,n,r,i,e[t+14],17,-1502002290),i=u(i,s,n,r,e[t+15],22,1236535329),r=c(r,i,s,n,e[t+1],5,-165796510),n=c(n,r,i,s,e[t+6],9,-1069501632),s=c(s,n,r,i,e[t+11],14,643717713),i=c(i,s,n,r,e[t],20,-373897302),r=c(r,i,s,n,e[t+5],5,-701558691),n=c(n,r,i,s,e[t+10],9,38016083),s=c(s,n,r,i,e[t+15],14,-660478335),i=c(i,s,n,r,e[t+4],20,-405537848),r=c(r,i,s,n,e[t+9],5,568446438),n=c(n,r,i,s,e[t+14],9,-1019803690),s=c(s,n,r,i,e[t+3],14,-187363961),i=c(i,s,n,r,e[t+8],20,1163531501),r=c(r,i,s,n,e[t+13],5,-1444681467),n=c(n,r,i,s,e[t+2],9,-51403784),s=c(s,n,r,i,e[t+7],14,1735328473),i=c(i,s,n,r,e[t+12],20,-1926607734),r=p(r,i,s,n,e[t+5],4,-378558),n=p(n,r,i,s,e[t+8],11,-2022574463),s=p(s,n,r,i,e[t+11],16,1839030562),i=p(i,s,n,r,e[t+14],23,-35309556),r=p(r,i,s,n,e[t+1],4,-1530992060),n=p(n,r,i,s,e[t+4],11,1272893353),s=p(s,n,r,i,e[t+7],16,-155497632),i=p(i,s,n,r,e[t+10],23,-1094730640),r=p(r,i,s,n,e[t+13],4,681279174),n=p(n,r,i,s,e[t],11,-358537222),s=p(s,n,r,i,e[t+3],16,-722521979),i=p(i,s,n,r,e[t+6],23,76029189),r=p(r,i,s,n,e[t+9],4,-640364487),n=p(n,r,i,s,e[t+12],11,-421815835),s=p(s,n,r,i,e[t+15],16,530742520),i=p(i,s,n,r,e[t+2],23,-995338651),r=h(r,i,s,n,e[t],6,-198630844),n=h(n,r,i,s,e[t+7],10,1126891415),s=h(s,n,r,i,e[t+14],15,-1416354905),i=h(i,s,n,r,e[t+5],21,-57434055),r=h(r,i,s,n,e[t+12],6,1700485571),n=h(n,r,i,s,e[t+3],10,-1894986606),s=h(s,n,r,i,e[t+10],15,-1051523),i=h(i,s,n,r,e[t+1],21,-2054922799),r=h(r,i,s,n,e[t+8],6,1873313359),n=h(n,r,i,s,e[t+15],10,-30611744),s=h(s,n,r,i,e[t+6],15,-1560198380),i=h(i,s,n,r,e[t+13],21,1309151649),r=h(r,i,s,n,e[t+4],6,-145523070),n=h(n,r,i,s,e[t+11],10,-1120210379),s=h(s,n,r,i,e[t+2],15,718787259),i=h(i,s,n,r,e[t+9],21,-343485551),r=o(r,a),i=o(i,l),s=o(s,d),n=o(n,y)}return[r,i,s,n]}function g(e,t=i.Hex){const r=t||i.Base64,n=y(a(e),e.length*s);switch(r){case i.Raw:return n;case i.Hex:return function(e){const t="0123456789abcdef",r=[];for(let i=0,s=4*e.length;i<s;i++)r.push(t.charAt(e[i>>2]>>i%4*8+4&15)+t.charAt(e[i>>2]>>i%4*8&15));return r.join("")}(n);case i.String:return l(n);case i.Base64:return function(e){const t=[];for(let r=0,i=4*e.length;r<i;r+=3){const i=(e[r>>2]>>r%4*8&255)<<16|(e[r+1>>2]>>(r+1)%4*8&255)<<8|e[r+2>>2]>>(r+2)%4*8&255;for(let s=0;s<4;s++)8*r+6*s>32*e.length?t.push("="):t.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(i>>6*(3-s)&63))}return t.join("")}(n)}}},82935:(e,t,r)=>{r.d(t,{B:()=>h,e:()=>y});var i=r(31635),s=r(10107),n=(r(44208),r(53966),r(87811),r(36005)),o=r(64108),a=r(89317),l=r(30524),d=r(96184),u=r(73133),c=r(79677),p=r(10184);const h={type:Boolean,json:{read:{source:"timeAnimation"},write:{target:"timeAnimation",layerContainerTypes:a.K}}},y=e=>{const t=e;let r=class extends t{constructor(){super(...arguments),this.timeExtent=null,this.timeOffset=null,this.useViewTime=!0}readOffset(e,t){const r=t.timeInfo.exportOptions;if(!r)return null;const i=r.timeOffset,s=u.j.fromJSON(r.timeOffsetUnits);return i&&s?new p.A({value:i,unit:s}):null}set timeInfo(e){(0,l.sv)(e,this.fieldsIndex),this._set("timeInfo",e)}};return(0,i.Cg)([(0,s.MZ)({type:c.A,json:{write:!1}})],r.prototype,"timeExtent",void 0),(0,i.Cg)([(0,s.MZ)({type:p.A})],r.prototype,"timeOffset",void 0),(0,i.Cg)([(0,n.w)("service","timeOffset",["timeInfo.exportOptions"])],r.prototype,"readOffset",null),(0,i.Cg)([(0,s.MZ)({value:null,type:d.A,json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],r.prototype,"timeInfo",null),(0,i.Cg)([(0,s.MZ)(h)],r.prototype,"useViewTime",void 0),r=(0,i.Cg)([(0,o.$)("esri.layers.mixins.TemporalLayer")],r),r}},85648:(e,t,r)=>{r.d(t,{n:()=>s});var i=r(84952);function s(e){return n[function(e){return"json"===e.type?"application/json":"blob"===e.type?e.blob.type:function(e){const t=(0,i.Zo)(e);return l[t]||o}(e.url)}(e)]||a}const n={},o="text/plain",a=n[o],l={png:"image/png",jpeg:"image/jpeg",jpg:"image/jpg",bmp:"image/bmp",gif:"image/gif",json:"application/json",txt:"text/plain",xml:"application/xml",svg:"image/svg+xml",zip:"application/zip",pbf:"application/vnd.mapbox-vector-tile",gz:"application/gzip","bin.gz":"application/octet-stream"};for(const e in l)n[l[e]]=e},86390:(e,t,r)=>{r.d(t,{Z:()=>n});var i=r(83047),s=r(73836);function n(e){const t=1/(0,i.GA)(e,1);return 1!==t?new s.A({scale:[t,t,t]}):void 0}},87024:(e,t,r)=>{r.d(t,{P:()=>h});var i=r(49186),s=r(80200),n=r(76553),o=r(84952),a=r(13069),l=r(96156),d=r(35666),u=r(10107),c=r(85648),p=r(97159);function h(e){const t=e?.origins??[void 0];return(r,i)=>{const s=function(e,t,r){if("resource"===e?.type)return function(e,t,r){const i=(0,l.z4)(t,r);return{type:String,read:(e,t,r)=>{const s=(0,p.r)(e,t,r);return i.type===String?s:"function"==typeof i.type?new i.type({url:s}):void 0},write:{isRequired:i.json?.write?.isRequired,writer(t,s,a,l){if(!l?.resources)return"string"==typeof t?void(s[a]=(0,p.t)(t,l)):void(s[a]=t.write({},l));const u=function(e){return null==e?null:"string"==typeof e?e:e.url}(t),h=(0,p.t)(u,{...l,verifyItemRelativeUrls:l?.verifyItemRelativeUrls?{writtenUrls:l.verifyItemRelativeUrls.writtenUrls,rootPath:void 0}:void 0},1),m=i.type!==String&&(!(0,n.H)(this)||l?.origin&&this.originIdOf(r)>(0,d.aB)(l.origin)),v={object:this,propertyName:r,value:t,targetUrl:h,dest:s,targetPropertyName:a,context:l,params:e};l?.portalItem&&h&&!(0,o.oP)(h)?m&&e?.contentAddressed?y(v):m?function(e){const{context:t,targetUrl:r,params:i,value:s,dest:n,targetPropertyName:a}=e;if(!t.portalItem)return;const l=t.portalItem.resourceFromPath(r),d=f(s,r,t),u=(0,c.n)(d),p=(0,o.Zo)(l.path),h=i?.compress??!1;u===p?(t.resources&&g({...e,resource:l,content:d,compress:h,updates:t.resources.toUpdate}),n[a]=r):y(e)}(v):function({context:e,targetUrl:t,dest:r,targetPropertyName:i}){e.portalItem&&e.resources&&(e.resources.toKeep.push({resource:e.portalItem.resourceFromPath(t),compress:!1}),r[i]=t)}(v):l?.portalItem&&(null==h||null!=(0,p.i)(h)||(0,o.w8)(h)||m)?y(v):s[a]=h}}}}(e,t,r);switch(e?.type??"other"){case"other":return{read:!0,write:!0};case"url":{const{read:e,write:t}=p.b;return{read:e,write:t}}}}(e,r,i);for(const e of t){const t=(0,u.rM)(r,e,i);for(const e in s)t[e]=s[e]}}}function y(e){const{targetUrl:t,params:r,value:n,context:l,dest:d,targetPropertyName:u}=e;if(!l.portalItem)return;const h=(0,p.p)(t),y=f(n,t,l);if(r?.contentAddressed&&"json"!==y.type)return void l.messages?.push(new i.A("persistable:contentAddressingUnsupported",`Property "${u}" is trying to serializing a resource with content of type ${y.type} with content addressing. Content addressing is only supported for json resources.`,{content:y}));const m=r?.contentAddressed&&"json"===y.type?(0,s.d)(y.jsonString):h?.filename??(0,a.lk)(),v=(0,o.fj)(r?.prefix??h?.prefix,m),w=`${v}.${(0,c.n)(y)}`;if(r?.contentAddressed&&l.resources&&"json"===y.type){const e=l.resources.toKeep.find(({resource:e})=>e.path===w)??l.resources.toAdd.find(({resource:e})=>e.path===w);if(e)return void(d[u]=e.resource.itemRelativeUrl)}const b=l.portalItem.resourceFromPath(w);(0,o.w8)(t)&&l.resources&&l.resources.pendingOperations.push((0,o.tk)(t).then(e=>{b.path=`${v}.${(0,c.n)({type:"blob",blob:e})}`,d[u]=b.itemRelativeUrl}).catch(()=>{}));const I=r?.compress??!1;l.resources&&g({...e,resource:b,content:y,compress:I,updates:l.resources.toAdd}),d[u]=b.itemRelativeUrl}function g({object:e,propertyName:t,updates:r,resource:i,content:s,compress:n}){r.push({resource:i,content:s,compress:n,finish:r=>{!function(e,t,r){"string"==typeof e[t]?e[t]=r.url:e[t].url=r.url}(e,t,r)}})}function f(e,t,r){return"string"==typeof e?{type:"url",url:t}:{type:"json",jsonString:JSON.stringify(e.toJSON(r))}}},96184:(e,t,r)=>{r.d(t,{A:()=>y});var i=r(31635),s=r(69540),n=r(25482),o=r(10107),a=(r(44208),r(53966),r(87811),r(36005)),l=r(64108),d=r(43937),u=r(79677),c=r(10184),p=r(56400);function h(e,t){return c.A.fromJSON({value:e,unit:t})}let y=class extends((0,s.OU)(n.o)){constructor(e){super(e),this.cumulative=!1,this.endField=null,this.fullTimeExtent=null,this.hasLiveData=!1,this.interval=null,this.startField=null,this.timeZone=null,this.trackIdField=null,this.useTime=!0,this.stops=null}readFullTimeExtent(e,t){return t.timeExtent&&Array.isArray(t.timeExtent)&&2===t.timeExtent.length?u.A.fromArray(t.timeExtent):null}writeFullTimeExtent(e,t){null!=e?.start&&null!=e.end?t.timeExtent=e.toArray():t.timeExtent=null}readInterval(e,t){return t.timeInterval&&t.timeIntervalUnits?h(t.timeInterval,t.timeIntervalUnits):t.defaultTimeInterval&&t.defaultTimeIntervalUnits?h(t.defaultTimeInterval,t.defaultTimeIntervalUnits):null}writeInterval(e,t){t.timeInterval=e?.toJSON().value??null,t.timeIntervalUnits=e?.toJSON().unit??null}};(0,i.Cg)([(0,o.MZ)({type:Boolean,json:{name:"exportOptions.timeDataCumulative",write:!0}})],y.prototype,"cumulative",void 0),(0,i.Cg)([(0,o.MZ)({type:String,json:{name:"endTimeField",write:{enabled:!0,allowNull:!0}}})],y.prototype,"endField",void 0),(0,i.Cg)([(0,o.MZ)({type:u.A,json:{write:{enabled:!0,allowNull:!0}}})],y.prototype,"fullTimeExtent",void 0),(0,i.Cg)([(0,a.w)("fullTimeExtent",["timeExtent"])],y.prototype,"readFullTimeExtent",null),(0,i.Cg)([(0,d.K)("fullTimeExtent")],y.prototype,"writeFullTimeExtent",null),(0,i.Cg)([(0,o.MZ)({type:Boolean,json:{write:!0}})],y.prototype,"hasLiveData",void 0),(0,i.Cg)([(0,o.MZ)({type:c.A,json:{write:{enabled:!0,allowNull:!0}}})],y.prototype,"interval",void 0),(0,i.Cg)([(0,a.w)("interval",["timeInterval","timeIntervalUnits","defaultTimeInterval","defaultTimeIntervalUnits"])],y.prototype,"readInterval",null),(0,i.Cg)([(0,d.K)("interval")],y.prototype,"writeInterval",null),(0,i.Cg)([(0,o.MZ)({type:String,json:{name:"startTimeField",write:{enabled:!0,allowNull:!0}}})],y.prototype,"startField",void 0),(0,i.Cg)([(0,o.MZ)((0,p.P6)("timeReference",!0))],y.prototype,"timeZone",void 0),(0,i.Cg)([(0,o.MZ)({type:String,json:{write:{enabled:!0,allowNull:!0}}})],y.prototype,"trackIdField",void 0),(0,i.Cg)([(0,o.MZ)({type:Boolean,json:{name:"exportOptions.useTime",write:!0}})],y.prototype,"useTime",void 0),(0,i.Cg)([(0,o.MZ)({type:[Date],json:{read:!1}})],y.prototype,"stops",void 0),y=(0,i.Cg)([(0,l.$)("esri.layers.support.TimeInfo")],y)}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[1763],{17126:(e,t,o)=>{o.d(t,{dw:()=>s,qD:()=>c,qW:()=>u});var n=o(78888),r=o(21325),a=o(10536);function s(e,t){const o=e.toJSON();return o.objectIds&&(o.objectIds=o.objectIds.join(",")),o.orderByFields&&(o.orderByFields=o.orderByFields.join(",")),o.outFields&&!t?.returnCountOnly?o.outFields.includes("*")?o.outFields="*":o.outFields=o.outFields.join(","):delete o.outFields,o.outSR&&(o.outSR=(0,r.YX)(o.outSR)),o.dynamicDataSource&&(o.layer=JSON.stringify({source:o.dynamicDataSource}),delete o.dynamicDataSource),o}async function c(e,t,o){const n=await d(e,t,o),r=n.data,a=r.geometryType,s=r.spatialReference,c={};for(const e of r.relatedRecordGroups){const t={fields:void 0,geometryType:a,spatialReference:s,hasZ:!!r.hasZ,hasM:!!r.hasM,features:e.relatedRecords};if(null!=e.objectId)c[e.objectId]=t;else for(const o of Object.keys(e))"relatedRecords"!==o&&(c[e[o]]=t)}return{...n,data:c}}async function u(e,t,o){const n=await d(e,t,o,{returnCountOnly:!0}),r=n.data,a={};for(const e of r.relatedRecordGroups)null!=e.objectId&&(a[e.objectId]=e.count);return{...n,data:a}}async function d(e,t,o={},r){const c=(0,a.z)({...e.query,f:"json",...r,...s(t,r)});return(0,n.A)(e.path+"/queryRelatedRecords",{...o,query:{...o.query,...c}})}},71763:(e,t,o)=>{o.r(t),o.d(t,{executeRelationshipQuery:()=>c,executeRelationshipQueryForCount:()=>u});var n=o(2272),r=o(17126),a=o(22671),s=o(26591);async function c(e,t,o){t=s.default.from(t);const c=(0,n.Dl)(e);return(0,r.qD)(c,t,o).then(e=>{const t=e.data,o={};return Object.keys(t).forEach(e=>o[e]=a.A.fromJSON(t[e])),o})}async function u(e,t,o){t=s.default.from(t);const a=(0,n.Dl)(e);return(0,r.qW)(a,t,{...o}).then(e=>e.data)}}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[1763],{17126:(e,t,o)=>{o.d(t,{dw:()=>s,qD:()=>c,qW:()=>u});var n=o(43773),r=o(21325),a=o(10536);function s(e,t){const o=e.toJSON();return o.objectIds&&(o.objectIds=o.objectIds.join(",")),o.orderByFields&&(o.orderByFields=o.orderByFields.join(",")),o.outFields&&!t?.returnCountOnly?o.outFields.includes("*")?o.outFields="*":o.outFields=o.outFields.join(","):delete o.outFields,o.outSR&&(o.outSR=(0,r.YX)(o.outSR)),o.dynamicDataSource&&(o.layer=JSON.stringify({source:o.dynamicDataSource}),delete o.dynamicDataSource),o}async function c(e,t,o){const n=await d(e,t,o),r=n.data,a=r.geometryType,s=r.spatialReference,c={};for(const e of r.relatedRecordGroups){const t={fields:void 0,geometryType:a,spatialReference:s,hasZ:!!r.hasZ,hasM:!!r.hasM,features:e.relatedRecords};if(null!=e.objectId)c[e.objectId]=t;else for(const o of Object.keys(e))"relatedRecords"!==o&&(c[e[o]]=t)}return{...n,data:c}}async function u(e,t,o){const n=await d(e,t,o,{returnCountOnly:!0}),r=n.data,a={};for(const e of r.relatedRecordGroups)null!=e.objectId&&(a[e.objectId]=e.count);return{...n,data:a}}async function d(e,t,o={},r){const c=(0,a.z)({...e.query,f:"json",...r,...s(t,r)});return(0,n.A)(e.path+"/queryRelatedRecords",{...o,query:{...o.query,...c}})}},71763:(e,t,o)=>{o.r(t),o.d(t,{executeRelationshipQuery:()=>c,executeRelationshipQueryForCount:()=>u});var n=o(2272),r=o(17126),a=o(22671),s=o(26591);async function c(e,t,o){t=s.default.from(t);const c=(0,n.Dl)(e);return(0,r.qD)(c,t,o).then(e=>{const t=e.data,o={};return Object.keys(t).forEach(e=>o[e]=a.A.fromJSON(t[e])),o})}async function u(e,t,o){t=s.default.from(t);const a=(0,n.Dl)(e);return(0,r.qW)(a,t,{...o}).then(e=>e.data)}}}]);