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

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 (365) 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/02e7359162cf974b41b6.js +1 -0
  6. package/assets/esri/core/workers/chunks/{17d5f8dba6ebb1184506.js → 042cd64e1f4eb326c30f.js} +1 -1
  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/0f735b0dec173142f3b6.js +2 -0
  11. package/assets/esri/core/workers/chunks/{a8f998b8ec8c56150479.js.LICENSE.txt → 0f735b0dec173142f3b6.js.LICENSE.txt} +1 -1
  12. package/assets/esri/core/workers/chunks/{73487b9d85e726e9c012.js → 1257c37bf04d39c27b62.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{398f356b11fd33bd3831.js → 136a7d781dad05a7463b.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{1e4e7aedf4b779241a02.js → 15c7c10ff9ac63f0e792.js} +1 -1
  15. package/assets/esri/core/workers/chunks/17784cf16fa91504b9ea.js +1 -0
  16. package/assets/esri/core/workers/chunks/{a395373e3173e6458a56.js → 1ab37e13947d0e2e4181.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{f03635ddf56e2ef90e4c.js → 1d06fcae4c2f02fb1c95.js} +1 -1
  18. package/assets/esri/core/workers/chunks/1dfca37f95f2b968aa54.js +1 -0
  19. package/assets/esri/core/workers/chunks/{5bd36dbf46c25bd961c8.js → 21293b0c6405a10ec7b6.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{285762ff92d5388b6024.js → 2166238a7ad63a2d43c7.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{620a94b54be3ed78350d.js → 22ca80f491e070b2a5e7.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{88074189fa10c335370b.js → 24cd7b84cd0f3de4bff2.js} +1 -1
  23. package/assets/esri/core/workers/chunks/{ccc0da0e01f023c8aa1f.js → 28d1f2cf6aae547615c3.js} +1 -1
  24. package/assets/esri/core/workers/chunks/292daac70bb828e4923f.js +1 -0
  25. package/assets/esri/core/workers/chunks/{7e43c105f1cfc44b7bd0.js → 2fa01bd3f3608616fd7f.js} +1 -1
  26. package/assets/esri/core/workers/chunks/30e220f4f843681a4cdd.js +1 -0
  27. package/assets/esri/core/workers/chunks/{5d3661d1fe46dd29aae9.js → 311b564e44ae637c960d.js} +1 -1
  28. package/assets/esri/core/workers/chunks/{f4d0ae6be1b3984228d0.js → 31b6406960261da21dd4.js} +1 -1
  29. package/assets/esri/core/workers/chunks/31c7ce65e16f7858400f.js +1 -0
  30. package/assets/esri/core/workers/chunks/31dbe07047dc61303d7d.js +1 -0
  31. package/assets/esri/core/workers/chunks/{8a314b3790313e6dc5db.js → 333b62dad3811cff0f14.js} +1 -1
  32. package/assets/esri/core/workers/chunks/{c8733cd621105afab2ac.js → 35c9b24e4430bd6c2b6b.js} +1 -1
  33. package/assets/esri/core/workers/chunks/{e31192ae920e3e19b6aa.js → 37c1f155da14de91565a.js} +1 -1
  34. package/assets/esri/core/workers/chunks/{c55c096669677321a227.js → 38cd3648932bf2534b0f.js} +1 -1
  35. package/assets/esri/core/workers/chunks/3a457e718a901a45902e.js.LICENSE.txt +1 -1
  36. package/assets/esri/core/workers/chunks/{f5e47eea8720ba84665b.js → 3c07aa2015ab1dff5f7b.js} +1 -1
  37. package/assets/esri/core/workers/chunks/{e9311386f58f3cb95c22.js → 42a1e71d09e8583a7327.js} +1 -1
  38. package/assets/esri/core/workers/chunks/443dfe7029ec208f670c.js +1 -0
  39. package/assets/esri/core/workers/chunks/{b75930d60449eceb0f1c.js → 4baf6f6e7ddedb25f806.js} +1 -1
  40. package/assets/esri/core/workers/chunks/{bb5484b5eeacc9ad2ceb.js → 4d0cbf9584446f411a37.js} +1 -1
  41. package/assets/esri/core/workers/chunks/{17103e6542aae53c7301.js → 4e3e27673d0671fc2b58.js} +1 -1
  42. package/assets/esri/core/workers/chunks/4fb5f1c671892001a4fd.js +1 -0
  43. package/assets/esri/core/workers/chunks/{5fc7b61f467f1d60a284.js → 51ab2acac4ecc1ca9c34.js} +1 -1
  44. package/assets/esri/core/workers/chunks/{fc4417d1260b717a9385.js → 52282f767bd0e99ddca0.js} +1 -1
  45. package/assets/esri/core/workers/chunks/{dedc4583b5f32a278124.js → 5350d50b47b6a4e0e169.js} +1 -1
  46. package/assets/esri/core/workers/chunks/{fc06014fb484fc8c697e.js → 53654edd766d9b4ef750.js} +1 -1
  47. package/assets/esri/core/workers/chunks/{90f8b4bda28af43ea019.js → 538f509d7fc8337d37ac.js} +1 -1
  48. package/assets/esri/core/workers/chunks/{ed8a85efbd90241512bb.js → 588533c3abe876f20f62.js} +1 -1
  49. package/assets/esri/core/workers/chunks/58e59ead33368ce38c8f.js +1 -0
  50. package/assets/esri/core/workers/chunks/5db37547963857295273.js +1 -0
  51. package/assets/esri/core/workers/chunks/{72846fb9c87c6642daf0.js → 5e2ce34def5e053913b2.js} +1 -1
  52. package/assets/esri/core/workers/chunks/{8c056eac35d05d9524b7.js → 5f29422a051311ef9b3c.js} +1 -1
  53. package/assets/esri/core/workers/chunks/{ac26e3e77df4302f47a2.js → 604777417722d4effe06.js} +1 -1
  54. package/assets/esri/core/workers/chunks/{ff35a077ac6776469805.js → 61d970ed75c2c358b1e9.js} +1 -1
  55. package/assets/esri/core/workers/chunks/{7a6a96edc892d7060b7d.js → 629127877042ad784ad2.js} +1 -1
  56. package/assets/esri/core/workers/chunks/{90b2b43b8b54c9a1ec35.js → 664ae441617afe4b17ec.js} +1 -1
  57. package/assets/esri/core/workers/chunks/67f03d042455cd0f7009.js +1 -0
  58. package/assets/esri/core/workers/chunks/{4c5a7249a311070d8f43.js → 6af18d7a0d314d7c1756.js} +1 -1
  59. package/assets/esri/core/workers/chunks/{f35aaa04cca676c2d3f8.js → 6b59f94040c7d2f6728a.js} +1 -1
  60. package/assets/esri/core/workers/chunks/6d9f2b113d6bde936a04.js +1 -0
  61. package/assets/esri/core/workers/chunks/{5132ca68e8c7af111a47.js → 6e22b02a9715c10578d0.js} +1 -1
  62. package/assets/esri/core/workers/chunks/{f0e0a63962784acb4ba1.js → 6f0aec7428021e440ac9.js} +1 -1
  63. package/assets/esri/core/workers/chunks/{deb2854bb7d082a26f52.js → 7005d956c990a04ee8b2.js} +1 -1
  64. package/assets/esri/core/workers/chunks/{a3991ae8caa713d4ddcd.js → 731f7b552dde0fb325cd.js} +1 -1
  65. package/assets/esri/core/workers/chunks/7565b382f6b3d2cb46a3.js +2 -0
  66. package/assets/esri/core/workers/chunks/{b96eb0ea506379182d62.js.LICENSE.txt → 7565b382f6b3d2cb46a3.js.LICENSE.txt} +1 -1
  67. package/assets/esri/core/workers/chunks/{464d42bebb365287808d.js → 773f2c6c9d38db76dfed.js} +1 -1
  68. package/assets/esri/core/workers/chunks/{3f3d492f1093b7832aab.js → 7803495f8862d9025bcd.js} +1 -1
  69. package/assets/esri/core/workers/chunks/7d641f2f5edd95b9bc18.js +1 -0
  70. package/assets/esri/core/workers/chunks/7e4c14d4502e3f06d94b.js +1 -0
  71. package/assets/esri/core/workers/chunks/812f2ccc01f44e3cfd41.js +1 -0
  72. package/assets/esri/core/workers/chunks/826fa0dfb63df77bfd95.js +1 -0
  73. package/assets/esri/core/workers/chunks/{7544316a75dbd981aea6.js → 86cb097deec50b0da3f3.js} +1 -1
  74. package/assets/esri/core/workers/chunks/87921f3fa9001f5801ed.js +1 -0
  75. package/assets/esri/core/workers/chunks/{95c594a87b732f5c4979.js → 89b748e064ca90b4f76a.js} +1 -1
  76. package/assets/esri/core/workers/chunks/8a40ed2ee4b032822c30.js +1 -0
  77. package/assets/esri/core/workers/chunks/{09de8be660174a229efb.js → 8cbb28476151a37ae958.js} +1 -1
  78. package/assets/esri/core/workers/chunks/{fe77ae6cf232a7a3298e.js → 8d9d3797c6d62fdfff9d.js} +1 -1
  79. package/assets/esri/core/workers/chunks/{62a49cfd9a2508950e9f.js → 8fedfd33c37172dba6bf.js} +1 -1
  80. package/assets/esri/core/workers/chunks/91aa1157da32f650983b.js +1 -0
  81. package/assets/esri/core/workers/chunks/{e7638b9ab6674bc8a18f.js → 91dfd29e2dba200eab09.js} +1 -1
  82. package/assets/esri/core/workers/chunks/{794748fd1edc29a621cd.js → 9698f36c143953a975d4.js} +1 -1
  83. package/assets/esri/core/workers/chunks/98584902c9db6faa3e4d.js +1 -0
  84. package/assets/esri/core/workers/chunks/9e5e05d6430712b0b1bc.js +1 -0
  85. package/assets/esri/core/workers/chunks/{e5a06ce0ef6a9a90e100.js → 9f21436016ff7a899e79.js} +1 -1
  86. package/assets/esri/core/workers/chunks/{67d9cfe02613cb73ee37.js → 9ff8ee6ed6b98c03ae7e.js} +2 -2
  87. package/assets/esri/core/workers/chunks/{67d9cfe02613cb73ee37.js.LICENSE.txt → 9ff8ee6ed6b98c03ae7e.js.LICENSE.txt} +1 -1
  88. package/assets/esri/core/workers/chunks/a6ee40dfc471d6612f3c.js +1 -0
  89. package/assets/esri/core/workers/chunks/aa78b69219d9a0ef1c54.js.LICENSE.txt +1 -1
  90. package/assets/esri/core/workers/chunks/{a4db5c9a90107e097df8.js → af47272aaaef0ea57e71.js} +1 -1
  91. package/assets/esri/core/workers/chunks/b05208d56a724a8f1661.js +1 -0
  92. package/assets/esri/core/workers/chunks/{79968c183135281d2a6f.js → b3613a38178cad2ebc82.js} +1 -1
  93. package/assets/esri/core/workers/chunks/{22d6b8102e75bdef204c.js → b7eb486354994dc70855.js} +1 -1
  94. package/assets/esri/core/workers/chunks/bc19a232076d98825eef.js +1 -0
  95. package/assets/esri/core/workers/chunks/c29486c4eeb3e72effff.js +1 -0
  96. package/assets/esri/core/workers/chunks/{2b94623cabc6ae0f86ce.js → c37f7756d48ff9af2656.js} +1 -1
  97. package/assets/esri/core/workers/chunks/{1c52999a6392370844a6.js → c4090a60d149a5962179.js} +1 -1
  98. package/assets/esri/core/workers/chunks/c715fd32f814a0f14f40.js +1 -0
  99. package/assets/esri/core/workers/chunks/{73c1d43070b4fe1e5c1e.js → c8e686efe344a33a0258.js} +1 -1
  100. package/assets/esri/core/workers/chunks/{6bb5158de43c4b59107f.js → c9b16fd41cd59d452522.js} +1 -1
  101. package/assets/esri/core/workers/chunks/ce16489cf7eb0d78c741.js.LICENSE.txt +1 -1
  102. package/assets/esri/core/workers/chunks/cf971e7b1b98d9c502d3.js +1 -0
  103. package/assets/esri/core/workers/chunks/{279366e6b743f9680603.js → cfff044859e6e6dcc75d.js} +1 -1
  104. package/assets/esri/core/workers/chunks/d07f911d40bf05fc0306.js +1 -0
  105. package/assets/esri/core/workers/chunks/{8833c3d168951be4bf20.js → d0d79dd3e88eecf5c314.js} +1 -1
  106. package/assets/esri/core/workers/chunks/d1ca7c3a32ce00ed8b81.js +1 -0
  107. package/assets/esri/core/workers/chunks/{76ae1702fecc7ad7017c.js → d1e97cce5047f1791e22.js} +1 -1
  108. package/assets/esri/core/workers/chunks/{17acde0245ecd956306c.js → d233cc33497a663450f9.js} +1 -1
  109. package/assets/esri/core/workers/chunks/{b017bac40dc8328013e3.js → d391bfbaf0e790cd10d6.js} +2 -2
  110. package/assets/esri/core/workers/chunks/{b017bac40dc8328013e3.js.LICENSE.txt → d391bfbaf0e790cd10d6.js.LICENSE.txt} +1 -1
  111. package/assets/esri/core/workers/chunks/d6e0528eacee7ea4c1ce.js.LICENSE.txt +1 -1
  112. package/assets/esri/core/workers/chunks/{36fe6b8228e622407ec2.js → d8793eead02491136841.js} +1 -1
  113. package/assets/esri/core/workers/chunks/{4d599008e1ea42321b37.js → da24ad57747714ac5eda.js} +1 -1
  114. package/assets/esri/core/workers/chunks/db678a6e352275e507a9.js +1 -0
  115. package/assets/esri/core/workers/chunks/{facb3886714222772ab2.js → ddfd01bb9ba8577c3ffc.js} +1 -1
  116. package/assets/esri/core/workers/chunks/de2ebd9cc3d9e68d435b.js +1 -0
  117. package/assets/esri/core/workers/chunks/{50d9f69d5255af4b29bb.js → df5afa06c6deb6b40109.js} +1 -1
  118. package/assets/esri/core/workers/chunks/e25c4b4a03270d48f408.js +1 -0
  119. package/assets/esri/core/workers/chunks/e3294318daf1192b8319.js +1 -0
  120. package/assets/esri/core/workers/chunks/e599125e746c27de106e.js +1 -0
  121. package/assets/esri/core/workers/chunks/{da573ecc68e6aa8f6da9.js → e767f83f9e2de6650f80.js} +1 -1
  122. package/assets/esri/core/workers/chunks/e9d4cae2144974489d6e.js +1 -0
  123. package/assets/esri/core/workers/chunks/{91df8638b8b904e6d8c5.js → ead8d0cbcebd12dbfad7.js} +1 -1
  124. package/assets/esri/core/workers/chunks/{f9324e88c359c03f35aa.js → eb9c166db0db6fa60e95.js} +1 -1
  125. package/assets/esri/core/workers/chunks/ebcc94234d9d4be1941f.js +316 -0
  126. package/assets/esri/core/workers/chunks/ee5f0fd5384caa11c986.js +1 -0
  127. package/assets/esri/core/workers/chunks/{bc241c7735e4efba734a.js → f34e3fa0c5b28531e289.js} +1 -1
  128. package/assets/esri/core/workers/chunks/f64037a88ab03662dc2a.js +1 -0
  129. package/assets/esri/core/workers/chunks/f651c05604eab83aef5f.js.LICENSE.txt +1 -1
  130. package/assets/esri/core/workers/chunks/{d97fadbc69e055d183a0.js → f77f4bd6a577b92cf66f.js} +1 -1
  131. package/assets/esri/core/workers/chunks/f80f5dbf96c343ac4df6.js +1 -0
  132. package/assets/esri/core/workers/chunks/{16d66770ef841564ee3f.js → f89c90f98c85667b0ebc.js} +1 -1
  133. package/assets/esri/core/workers/chunks/{4c4227b0ea21a5e429ab.js → fb192de7e4fa152342bb.js} +1 -1
  134. package/assets/esri/core/workers/chunks/fbd8d2f61f8a15bcf3db.js +1 -0
  135. package/assets/esri/core/workers/chunks/fccd931f95d81ecc57b2.js +1 -0
  136. package/assets/esri/core/workers/chunks/{2f78861afe0e9037dd8d.js → fe49321dca22dc60d105.js} +1 -1
  137. package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
  138. package/assets/esri/themes/base/widgets/_NavigationToggle.scss +1 -1
  139. package/assets/esri/themes/base/widgets/_OrientedImageryViewer.scss +4 -4
  140. package/assets/esri/themes/base/widgets/_Widget.scss +1 -1
  141. package/assets/esri/themes/dark/main.css +1 -1
  142. package/assets/esri/themes/light/main.css +1 -1
  143. package/assets/esri/themes/light/view.css +1 -1
  144. package/chunks/MultiPathImpl.js +1 -1
  145. package/chunks/Point2D.js +1 -1
  146. package/chunks/UnitFactory.js +1 -1
  147. package/config.js +1 -1
  148. package/core/QueueProcessor.js +1 -1
  149. package/core/SetUtils.js +1 -1
  150. package/core/has.js +1 -1
  151. package/form/FormTemplate.js +1 -1
  152. package/form/elements/Element.js +1 -1
  153. package/form/elements/FieldElement.js +1 -1
  154. package/form/elements/GroupElement.js +1 -1
  155. package/geometry/operators/gx/operatorOffset.js +1 -1
  156. package/geometry/support/meshUtils/loadGLTFMesh.js +1 -1
  157. package/identity/Credential.js +1 -1
  158. package/identity/IdentityManager.js +1 -1
  159. package/identity/IdentityManagerBase.js +1 -1
  160. package/interfaces.d.ts +92 -50
  161. package/kernel.js +1 -1
  162. package/layers/FeatureLayer.js +1 -1
  163. package/layers/SceneLayer.js +1 -1
  164. package/layers/graphics/controllers/FeatureTileController3D.js +1 -1
  165. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  166. package/layers/graphics/sources/connections/GeoEventConnection.js +1 -1
  167. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  168. package/layers/knowledgeGraph/KnowledgeGraphSublayer.js +1 -1
  169. package/layers/knowledgeGraph/layerUtils.js +1 -1
  170. package/layers/orientedImagery/core/ExposurePoint.js +1 -1
  171. package/layers/orientedImagery/transformations/imageToWorld.js +1 -1
  172. package/layers/support/RasterJobHandler.js +1 -1
  173. package/layers/support/RasterWorker.js +1 -1
  174. package/layers/support/fieldConfigUtils.js +1 -1
  175. package/layers/support/rasterDatasets/pixelReader.js +1 -1
  176. package/layers/support/rasterFunctions/pixelTransformUtils.js +5 -0
  177. package/layers/support/rasterFunctions/pixelUtils.js +1 -1
  178. package/layers/support/source/DataLayerSource.js +1 -1
  179. package/package.json +4 -4
  180. package/popup/FieldInfo.js +1 -1
  181. package/processRequest.js +5 -0
  182. package/request.js +1 -1
  183. package/requestConfig.js +5 -0
  184. package/requestQueue.js +5 -0
  185. package/rest/query/executeForCount.js +1 -1
  186. package/rest/query/executeForExtent.js +1 -1
  187. package/rest/query/executeForIds.js +1 -1
  188. package/rest/query/executeQueryJSON.js +1 -1
  189. package/rest/query/executeQueryPBF.js +1 -1
  190. package/rest/query/operations/query.js +1 -1
  191. package/rest/support/BaseImageMeasureResultValue.js +5 -0
  192. package/rest/support/ImageAreaResult.js +1 -1
  193. package/rest/support/ImageDistanceResult.js +1 -1
  194. package/rest/support/ImageHeightResult.js +1 -1
  195. package/rest/support/ImageMeasureResultAngleValue.js +5 -0
  196. package/rest/support/ImageMeasureResultAreaValue.js +5 -0
  197. package/rest/support/ImageMeasureResultLengthValue.js +5 -0
  198. package/rest/support/ImageWithType.js +5 -0
  199. package/rest/support/imageMeasureUtils.js +1 -1
  200. package/smartMapping/renderers/size.js +1 -1
  201. package/smartMapping/support/adapters/FeatureLayerAdapter.js +1 -1
  202. package/smartMapping/support/adapters/InMemoryLayerAdapter.js +1 -1
  203. package/smartMapping/support/adapters/support/histogramUtils.js +1 -1
  204. package/smartMapping/support/adapters/support/utils.js +1 -1
  205. package/support/revision.js +1 -1
  206. package/symbols/support/utils.js +1 -1
  207. package/views/2d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles2D.js +1 -1
  208. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  209. package/views/2d/layers/features/FeaturePipelineWorker.js +1 -1
  210. package/views/2d/layers/features/schema/SourceSchema.js +1 -1
  211. package/views/2d/layers/features/sources/FeatureSource.js +1 -1
  212. package/views/2d/layers/features/sources/strategies/AFeatureLoadStrategy.js +1 -1
  213. package/views/2d/layers/features/sources/strategies/ALoadStrategy.js +1 -1
  214. package/views/2d/layers/features/sources/strategies/ParquetSnapshotLoadStrategy.js +1 -1
  215. package/views/2d/layers/features/sources/strategies/ParquetTileLoadStrategy.js +1 -1
  216. package/views/2d/layers/features/sources/strategies/chunks/Overrides.js +1 -1
  217. package/views/2d/layers/features/sources/strategies/chunks/SourceChunkStore.js +1 -1
  218. package/views/{3d/support/ImageWithType.js → 2d/layers/features/sources/strategies/constants.js} +1 -1
  219. package/views/2d/layers/features/sources/strategies/support/queryAdapters.js +1 -1
  220. package/views/3d/GroundView3D.js +1 -1
  221. package/views/3d/analysis/Dimension/LengthDimensionSubTool.js +1 -1
  222. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillController.js +1 -1
  223. package/views/3d/analysis/VolumeMeasurement/volumeMeasurementErrors.js +1 -1
  224. package/views/3d/glTF/DefaultLoadingContext.js +1 -1
  225. package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DTool.js +1 -1
  226. package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DTool.js +1 -1
  227. package/views/3d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles3D.js +1 -1
  228. package/views/3d/layers/ElevationLayerView3D.js +1 -1
  229. package/views/3d/layers/FeatureLayerViewBase3D.js +1 -1
  230. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  231. package/views/3d/layers/graphics/FeatureGraphics3DGraphicsPipeline.js +1 -1
  232. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  233. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  234. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  235. package/views/3d/layers/graphics/Graphics3DSymbolCreationContext.js +1 -1
  236. package/views/3d/layers/graphics/ObjectResourceCache.js +1 -1
  237. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  238. package/views/3d/layers/graphics/pipeline/Feature3DPipeline.js +1 -1
  239. package/views/3d/layers/graphics/pipeline/fetching/Tile3DFetcher.js +1 -1
  240. package/views/3d/layers/graphics/wosrLoader.js +1 -1
  241. package/views/3d/layers/i3s/I3SDataRequester.js +5 -0
  242. package/views/3d/layers/i3s/I3SIndex.js +1 -1
  243. package/views/3d/layers/i3s/I3SNodeLoader.js +1 -1
  244. package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
  245. package/views/3d/layers/support/FeatureTile.js +1 -1
  246. package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
  247. package/views/3d/layers/support/MediaLayerInteractionOptions.js +1 -1
  248. package/views/3d/layers/support/MediaLayerInteractionReshapeOptions.js +5 -0
  249. package/views/3d/layers/support/SampledGeometryMaxDistanceRatio.js +5 -0
  250. package/views/3d/layers/support/featureTileQuery3D.js +1 -1
  251. package/views/3d/layers/support/fetchTile.js +1 -1
  252. package/views/3d/support/ResourceController.js +1 -1
  253. package/views/3d/support/SharedSymbolResources.js +1 -1
  254. package/views/3d/support/StreamTextureCollection.js +1 -1
  255. package/views/3d/terrain/TerrainSurface.js +1 -1
  256. package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
  257. package/views/3d/webgl-engine/lighting/SceneLighting.js +1 -1
  258. package/views/3d/webgl-engine/shaders/AnimatedLine.glsl.js +6 -0
  259. package/views/SceneView.js +1 -1
  260. package/views/analysis/ElevationProfile/ElevationProfileTool.js +1 -1
  261. package/views/analysis/ElevationProfile/elevationProfileGeometryUtils.js +1 -1
  262. package/views/draw/MultipointDrawAction.js +1 -1
  263. package/views/draw/PointDrawAction.js +1 -1
  264. package/views/draw/PolygonDrawAction.js +1 -1
  265. package/views/draw/PolylineDrawAction.js +1 -1
  266. package/views/draw/SegmentDrawAction.js +1 -1
  267. package/views/draw/input/CursorUpdateEvents.js +5 -0
  268. package/views/draw/input/DrawCompleteEvent.js +5 -0
  269. package/views/draw/input/VertexAddEvent.js +5 -0
  270. package/views/draw/input/VertexRemoveEvent.js +5 -0
  271. package/views/draw/input/VertexUpdateEvent.js +5 -0
  272. package/views/interactive/editGeometry/CheckpointingEditGeometryOperations.js +5 -0
  273. package/views/interactive/editGeometry/EditGeometry.js +1 -1
  274. package/views/interactive/editGeometry/operations/ReplayableAppendVertex.js +5 -0
  275. package/views/interactive/snapping/featureSources/FeatureServiceSnappingSource.js +1 -1
  276. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorkerHandle.js +1 -1
  277. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTileStore.js +1 -1
  278. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiledFetcher.js +1 -1
  279. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTilesSimple.js +1 -1
  280. package/views/support/PromiseQueue.js +1 -1
  281. package/views/support/Scheduler.js +1 -1
  282. package/webscene/spec-certification/api.js +1 -1
  283. package/widgets/CoordinateConversion/CoordinateConversionViewModel.js +1 -1
  284. package/widgets/CoordinateConversion.js +1 -1
  285. package/widgets/Editor/AddAssociationWorkflow.js +1 -1
  286. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  287. package/widgets/Editor/EditorViewModel.js +1 -1
  288. package/widgets/Editor/MergeFeaturesWorkflow.js +1 -1
  289. package/widgets/Editor/SplitFeatureWorkflow.js +1 -1
  290. package/widgets/Editor/UpdateFeatureWorkflow.js +1 -1
  291. package/widgets/Editor/UpdateFeaturesWorkflow.js +1 -1
  292. package/widgets/Editor/UpdateRecordWorkflow.js +1 -1
  293. package/widgets/Editor/UpdateRecordWorkflowData.js +1 -1
  294. package/widgets/Editor/UpdateWorkflow.js +1 -1
  295. package/widgets/Editor/UpdateWorkflowData.js +1 -1
  296. package/widgets/Editor/support/SketchController.js +1 -1
  297. package/widgets/Editor/support/errors.js +5 -0
  298. package/widgets/Editor/workflowUtils.js +1 -1
  299. package/widgets/Editor.js +1 -1
  300. package/widgets/Legend/LegendViewModel.js +1 -1
  301. package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
  302. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  303. package/widgets/OrientedImageryViewer/adapters/sketch/TriangulatedMeasurementAdapter.js +1 -1
  304. package/widgets/OrientedImageryViewer/adapters/view/SceneViewAdapter.js +1 -1
  305. package/widgets/OrientedImageryViewer/galleryUtils.js +1 -1
  306. package/widgets/OrientedImageryViewer/services/DepthImageService.js +1 -1
  307. package/widgets/PanoramicViewer/PanoramicViewerViewModel.js +1 -1
  308. package/widgets/PanoramicViewer/PanoramicZoomManager.js +1 -1
  309. package/widgets/PanoramicViewer/support/PanoramicMeshManager.js +1 -1
  310. package/widgets/PanoramicViewer/support/PanoramicTileNode.js +1 -1
  311. package/widgets/PanoramicViewer/support/PanoramicTilePyramid.js +1 -1
  312. package/widgets/PanoramicViewer/support/getVisibleTiles.js +5 -0
  313. package/widgets/Sketch/CreateToolVisibilityMap.js +5 -0
  314. package/widgets/Sketch/SelectionToolVisibilityMap.js +5 -0
  315. package/widgets/Sketch/VisibleElements.js +1 -1
  316. package/widgets/Sketch.js +1 -1
  317. package/assets/esri/core/workers/chunks/020c8913d8e35d63080b.js +0 -1
  318. package/assets/esri/core/workers/chunks/02e69f0c63d97661da60.js +0 -1
  319. package/assets/esri/core/workers/chunks/05eee334d58a0b9f6316.js +0 -1
  320. package/assets/esri/core/workers/chunks/06ba43843e9c4988049b.js +0 -1
  321. package/assets/esri/core/workers/chunks/087973e7c4fea5fcfa5e.js +0 -1
  322. package/assets/esri/core/workers/chunks/326a76a4e80269d4029d.js +0 -1
  323. package/assets/esri/core/workers/chunks/377a66034e7c1bad5599.js +0 -1
  324. package/assets/esri/core/workers/chunks/4442817beb7a76c95770.js +0 -1
  325. package/assets/esri/core/workers/chunks/459a67928bde4a62b6a4.js +0 -1
  326. package/assets/esri/core/workers/chunks/4eebd74ebc20579dade8.js +0 -1
  327. package/assets/esri/core/workers/chunks/53bd8996e8812f1ad7b2.js +0 -1
  328. package/assets/esri/core/workers/chunks/557960763695abee4a83.js +0 -1
  329. package/assets/esri/core/workers/chunks/6201356f7f91e5c06425.js +0 -1
  330. package/assets/esri/core/workers/chunks/6c3b99209d542efa64d4.js +0 -1
  331. package/assets/esri/core/workers/chunks/6f4bd0ee85e7e5a74340.js +0 -1
  332. package/assets/esri/core/workers/chunks/7413e582bc2b16af6a0f.js +0 -1
  333. package/assets/esri/core/workers/chunks/7461124454bfb4fb6474.js +0 -1
  334. package/assets/esri/core/workers/chunks/75bf27271a31e26e1b21.js +0 -1
  335. package/assets/esri/core/workers/chunks/7aaaebbabee27690283c.js +0 -1
  336. package/assets/esri/core/workers/chunks/7c4a63aeead2505d6f02.js +0 -1
  337. package/assets/esri/core/workers/chunks/811d4c46c75cf6a63e78.js +0 -1
  338. package/assets/esri/core/workers/chunks/8ffd4710d168c2fcfd96.js +0 -1
  339. package/assets/esri/core/workers/chunks/90250e9239c173aace88.js +0 -1
  340. package/assets/esri/core/workers/chunks/9786f91455350eaae493.js +0 -1
  341. package/assets/esri/core/workers/chunks/99859dce1925b406ccd0.js +0 -1
  342. package/assets/esri/core/workers/chunks/9c5cbf8810f37b1a4718.js +0 -1
  343. package/assets/esri/core/workers/chunks/9e8dceef4c961f56940d.js +0 -1
  344. package/assets/esri/core/workers/chunks/9fac5a12e878cd745354.js +0 -1
  345. package/assets/esri/core/workers/chunks/a06bac9b8f9e18874de8.js +0 -316
  346. package/assets/esri/core/workers/chunks/a712cdff78fc826acd8c.js +0 -1
  347. package/assets/esri/core/workers/chunks/a8f998b8ec8c56150479.js +0 -2
  348. package/assets/esri/core/workers/chunks/aa54b6f2aba6952af149.js +0 -1
  349. package/assets/esri/core/workers/chunks/b96eb0ea506379182d62.js +0 -2
  350. package/assets/esri/core/workers/chunks/c476643002387f60ea42.js +0 -1
  351. package/assets/esri/core/workers/chunks/c4e4da69969499a89a2c.js +0 -1
  352. package/assets/esri/core/workers/chunks/cd1930f08e1fc8b30b14.js +0 -1
  353. package/assets/esri/core/workers/chunks/d1fe816b6990918c13c7.js +0 -1
  354. package/assets/esri/core/workers/chunks/d305a21666b1ed5bf33d.js +0 -1
  355. package/assets/esri/core/workers/chunks/d40f57f9fc47f9a9f97c.js +0 -1
  356. package/assets/esri/core/workers/chunks/e0bbfbe1ed39c82f1bd4.js +0 -1
  357. package/assets/esri/core/workers/chunks/e82f5437bd66779c6740.js +0 -1
  358. package/assets/esri/core/workers/chunks/f6c8beb60f6d29945a2e.js +0 -1
  359. package/assets/esri/core/workers/chunks/f746e3f7ebff2bbdf333.js +0 -1
  360. package/assets/esri/core/workers/chunks/fd2efd1d1cf9d95a87e6.js +0 -1
  361. package/views/3d/layers/i3s/I3SStreamDataController.js +0 -5
  362. package/views/3d/support/StreamDataLoader.js +0 -5
  363. package/views/3d/support/StreamDataRequester.js +0 -5
  364. package/views/3d/support/downloadSlots.js +0 -5
  365. package/views/draw/input/DrawEvents.js +0 -5
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[6647],{20816:(e,t,i)=>{i.d(t,{TA:()=>o,We:()=>d,Z3:()=>s,ZJ:()=>l,w5:()=>a});var r=i(43773);const o=(0,i(13069).vD)(),s=new Map,n=new Map;async function d(e,t,i){if(!e||!i)return!1;if(!t)return!0;const o=new URL(e).host;let n=s.get(o);if(!n){const t=e.replace(/\/FeatureServer/i,"/VersionManagementServer").replace(/\/\d*$/,"");n=(await(0,r.A)(t,{responseType:"json",query:{f:"json"}})).data.defaultVersionName}return n===t}async function l(e,t,r=!1){if(!e||!t)return!0;const s=e.replace(/\/FeatureServer/i,"/VersionManagementServer").replace(/\/\d*$/,""),d=n.get(s)?.entries();if(d)for(const[e,n]of d)if(n.name===t){const t=!n.stack?.hasForwardEdits();if(!t&&r){const[{deleteForwardEdits:t},{default:r}]=await Promise.all([i.e(2186).then(i.bind(i,32186)),i.e(2558).then(i.bind(i,32558))]),d=await t(s,e,new r({sessionId:o,moment:n.moment}));return d.success&&n.stack?.clearForwardEdits(),d.success}return t}return!0}function a(e,t){if(!e)return!1;const i=e.replace(/\/FeatureServer/i,"/VersionManagementServer").replace(/\/\d*$/,""),r=n.get(i)?.entries();if(r)for(const[e,i]of r)if(i.name===t)return"edit"===i.lockType;return!1}new Map},47685:(e,t,i)=>{i.d(t,{Mk:()=>y,Zk:()=>h,w6:()=>v});var r=i(31635),o=i(65529),s=i(4718),n=i(74887),d=i(10107),l=(i(44208),i(53966),i(64108)),a=i(20816);const p=new o.bk;function u(e){return p.on("apply-edits",new WeakRef(e))}function c(e){return p.on("update-moment",new WeakRef(e))}function h(e,t,i=null,r=!1){const o=(0,n.Tw)();return r=null==t||r,p.emit("apply-edits",{serviceUrl:e,layerId:t,gdbVersion:i,mayReceiveServiceEdits:r,result:o.promise}),o}const g=Symbol();function y(e){return null!=e&&"object"==typeof e&&g in e}function f(e){return null!=e&&"object"==typeof e&&"gdbVersion"in e}function m(e,t,i){const r=new URL(e).host,o=a.Z3.get(r),s=e=>!e||e===o;return s(t)&&s(i)||t===i}const v=e=>{var t;const i=e;let o=class extends i{static{t=g}constructor(...e){super(...e),this[t]=!0,this._applyEditsHandler=e=>{const{serviceUrl:t,layerId:i,gdbVersion:r,mayReceiveServiceEdits:o,result:n}=e,d=t===this.url,l=null!=i&&null!=this.layerId&&i===this.layerId,a=f(this),p=f(this)&&m(t,r,this.gdbVersion);if(!d||a&&!p||!l&&!o)return;const u=n.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,s.o8)(e)),e;const i=e.editedFeatures?.find(({layerId:e})=>e===this.layerId);if(i){const{adds:t,updates:r,deletes:o}=i.editedFeatures,n={edits:null,addedAttachments:[],deletedAttachments:[],updatedAttachments:[],addedFeatures:t?t.map(({attributes:e})=>({objectId:this.objectIdField&&e[this.objectIdField],globalId:this.globalIdField&&e[this.globalIdField]})):[],deletedFeatures:o?o.map(({attributes:e})=>({objectId:this.objectIdField&&e[this.objectIdField],globalId:this.globalIdField&&e[this.globalIdField]})):[],updatedFeatures:r?r.map(({current:{attributes:e}})=>({objectId:this.objectIdField&&e[this.objectIdField],globalId:this.globalIdField&&e[this.globalIdField]})):[],editedFeatures:(0,s.o8)(e.editedFeatures),exceededTransferLimit:!1,historicMoment:(0,s.o8)(e.historicMoment)};return this.emit("edits",n),n}const o={edits:null,addedAttachments:[],deletedAttachments:[],updatedAttachments:[],addedFeatures:[],deletedFeatures:[],updatedFeatures:[],editedFeatures:(0,s.o8)(e.editedFeatures),exceededTransferLimit:!1,historicMoment:(0,s.o8)(e.historicMoment)};return"historicMoment"in this&&this._shouldUpdateHistoricMoment(t,r,o.historicMoment)&&this.emit("edits",o),o}).then(e=>("historicMoment"in this&&this._shouldUpdateHistoricMoment(t,r,e.historicMoment)&&(this.historicMoment=e.historicMoment),e));this.emit("apply-edits",{result:u})},this._updateMomentHandler=e=>{const{serviceUrl:t,gdbVersion:i,moment:r}=e,o=t===this.url,s=f(this),n=f(this)&&m(t,i,this.gdbVersion),d=f(this)&&!m(t,this.gdbVersion,null);o&&s&&n&&d&&"historicMoment"in this&&this.historicMoment!==r&&(this.historicMoment=r)},this.when().then(()=>{this.addHandles(u(this._applyEditsHandler)),"historicMoment"in this&&this.addHandles(c(this._updateMomentHandler))},()=>{})}_shouldUpdateHistoricMoment(e,t,i){return"historicMoment"in this&&this.historicMoment!==i&&(0,a.w5)(e,t)}};return(0,r.Cg)([(0,d.MZ)()],o.prototype,"lastEditsEventDate",void 0),o=(0,r.Cg)([(0,l.$)("esri.layers.mixins.EditBusLayer")],o),o}},54239:(e,t,i)=>{i.d(t,{A:()=>m});var r,o=i(31635),s=i(4576),n=i(66552),d=i(25482),l=i(83047),a=i(67076),p=i(10107),u=(i(44208),i(53966),i(36005)),c=i(64108),h=i(43937);const g=(0,n.O)()({orthometric:"gravity-related-height",gravity_related_height:"gravity-related-height",ellipsoidal:"ellipsoidal"}),y=g.jsonValues.slice();(0,s.Xy)(y,"orthometric");const f=(0,n.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=r=class extends d.o{constructor(e){super(e),this.heightModel="gravity-related-height",this.heightUnit="meters",this.vertCRS=null}writeHeightModel(e,t,i){return g.write(e,t,i)}readHeightModel(e,t,i){return g.read(e)||(i?.messages&&i.messages.push(function(e,t){return new a.A("height-model:unsupported",`Height model of value '${e}' is not supported`,t)}(e,{context:i})),null)}readHeightUnit(e,t,i){return f.read(e)||(i?.messages&&i.messages.push(v(e,{context:i})),null)}readHeightUnitService(e,t,i){return(0,l.LA)(e)||f.read(e)||(i?.messages&&i.messages.push(v(e,{context:i})),null)}readVertCRS(e,t){return t.vertCRS||t.ellipsoid||t.geoid}clone(){return new r({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 i=(0,l.k1)(t);return new r({heightModel:e.heightModel,heightUnit:i??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 r;return t.read(e,{origin:"web-scene"}),t}};function v(e,t){return new a.A("height-unit:unsupported",`Height unit of value '${e}' is not supported`,t)}(0,o.Cg)([(0,p.MZ)({type:g.apiValues,constructOnly:!0,json:{origins:{"web-scene":{type:y,default:"ellipsoidal",write:{isRequired:!0}}}}})],m.prototype,"heightModel",void 0),(0,o.Cg)([(0,h.K)("web-scene","heightModel")],m.prototype,"writeHeightModel",null),(0,o.Cg)([(0,u.w)(["web-scene","service"],"heightModel")],m.prototype,"readHeightModel",null),(0,o.Cg)([(0,p.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,o.Cg)([(0,u.w)("web-scene","heightUnit")],m.prototype,"readHeightUnit",null),(0,o.Cg)([(0,u.w)("service","heightUnit")],m.prototype,"readHeightUnitService",null),(0,o.Cg)([(0,p.MZ)({type:String,constructOnly:!0,json:{origins:{"web-scene":{write:!0}}}})],m.prototype,"vertCRS",void 0),(0,o.Cg)([(0,u.w)("service","vertCRS",["vertCRS","ellipsoid","geoid"])],m.prototype,"readVertCRS",null),m=r=(0,o.Cg)([(0,c.$)("esri.geometry.HeightModelInfo")],m)},73179:(e,t,i)=>{i.d(t,{b:()=>l,h:()=>a});var r=i(4718),o=i(53966),s=i(84952),n=i(60694),d=i(10873);function l(e){const{nonStandardUrlAllowed:t=!1,separator:i}=e??{},s=(0,r.o8)(d.OZ),l=s.json?.write;return"object"==typeof l&&l&&(l.writer=function(e,t,r,o){(0,n.LS)(this,e,i,t,o)}),{...s,set:function(e){if(null==e)return void this._set("url",e);const i=(0,n.HZ)({layer:this,url:e,nonStandardUrlAllowed:t,logger:o.A.getLogger(this)});this._set("url",i.url),null!=i.layerId&&this._set("layerId",i.layerId)}}}function a(e,t){const{separator:i}=t??{},r=(0,s.An)(e.url);return null!=r&&(null!=e.dynamicDataSource?r.path=(0,s.fj)(r.path,"dynamicLayer"):null!=e.layerId&&(r.path=(0,s.fj)(r.path,i??"",e.layerId.toString()))),r}},87796:(e,t,i)=>{i.d(t,{j:()=>D});var r=i(31635),o=i(7762),s=i(4718),n=i(84952),d=i(10107),l=(i(44208),i(53966),i(36005)),a=i(64108),p=i(89317),u=i(35666),c=i(5443),h=i(54239),g=i(16930),y=i(10873),f=i(69540),m=i(25482),v=(i(87811),i(56400));let M=class extends((0,f.OU)(m.o)){constructor(e){super(e),this.creatorField=null,this.creationDateField=null,this.editorField=null,this.editDateField=null,this.realm=null,this.timeZone=null}};(0,r.Cg)([(0,d.MZ)()],M.prototype,"creatorField",void 0),(0,r.Cg)([(0,d.MZ)()],M.prototype,"creationDateField",void 0),(0,r.Cg)([(0,d.MZ)()],M.prototype,"editorField",void 0),(0,r.Cg)([(0,d.MZ)()],M.prototype,"editDateField",void 0),(0,r.Cg)([(0,d.MZ)()],M.prototype,"realm",void 0),(0,r.Cg)([(0,d.MZ)((0,v.P6)("dateFieldsTimeReference",!0))],M.prototype,"timeZone",void 0),M=(0,r.Cg)([(0,a.$)("esri.layers.support.EditFieldsInfo")],M);let C=class extends((0,f.OU)(m.o)){constructor(e){super(e)}};(0,r.Cg)([(0,d.MZ)({constructOnly:!0,json:{write:!0}})],C.prototype,"name",void 0),(0,r.Cg)([(0,d.MZ)({constructOnly:!0,json:{write:!0}})],C.prototype,"fields",void 0),(0,r.Cg)([(0,d.MZ)({constructOnly:!0,json:{write:!0}})],C.prototype,"isAscending",void 0),(0,r.Cg)([(0,d.MZ)({constructOnly:!0,json:{write:!0}})],C.prototype,"indexType",void 0),(0,r.Cg)([(0,d.MZ)({constructOnly:!0,json:{write:!0}})],C.prototype,"isUnique",void 0),(0,r.Cg)([(0,d.MZ)({constructOnly:!0,json:{write:!0}})],C.prototype,"description",void 0),C=(0,r.Cg)([(0,a.$)("esri.layers.support.FeatureIndex")],C);var F=i(15426),I=i(83047);let b=class extends((0,f.OU)(m.o)){constructor(e){super(e),this.shapeAreaField=null,this.shapeLengthField=null,this.units=null}};(0,r.Cg)([(0,d.MZ)({type:String,json:{read:{source:"shapeAreaFieldName"}}})],b.prototype,"shapeAreaField",void 0),(0,r.Cg)([(0,d.MZ)({type:String,json:{read:{source:"shapeLengthFieldName"}}})],b.prototype,"shapeLengthField",void 0),(0,r.Cg)([(0,d.MZ)({type:String,json:{read:e=>I.dk.read(e)||I.Sk.read(e)}})],b.prototype,"units",void 0),b=(0,r.Cg)([(0,a.$)("esri.layers.support.GeometryFieldsInfo")],b);var w=i(37352),S=i(77548),Z=i(73179),U=i(45067),j=i(22453),O=i(43937),E=i(80451);let x=class extends((0,f.OU)(m.o)){constructor(e){super(e),this.code=null,this.defaultValues={},this.domains=null,this.name=null}readDomains(e){if(!e)return null;const t={};for(const i of Object.keys(e))t[i]=(0,E.rS)(e[i]);return t}writeDomains(e,t){if(!e)return;const i={};for(const t of Object.keys(e))e[t]&&(i[t]=e[t]?.toJSON());t.domains=i}};(0,r.Cg)([(0,d.MZ)({type:Number,json:{write:!0}})],x.prototype,"code",void 0),(0,r.Cg)([(0,d.MZ)({type:Object,json:{write:!0}})],x.prototype,"defaultValues",void 0),(0,r.Cg)([(0,d.MZ)({json:{write:!0}})],x.prototype,"domains",void 0),(0,r.Cg)([(0,l.w)("domains")],x.prototype,"readDomains",null),(0,r.Cg)([(0,O.K)("domains")],x.prototype,"writeDomains",null),(0,r.Cg)([(0,d.MZ)({type:String,json:{write:!0}})],x.prototype,"name",void 0),x=(0,r.Cg)([(0,a.$)("esri.layers.support.Subtype")],x);var A=i(10407);const D=e=>{const t=e;let i=class extends t{constructor(){super(...arguments),this.copyright=null,this.capabilities=null,this.dateFieldsTimeZone=null,this.datesInUnknownTimezone=!1,this.definitionExpression=null,this.displayField=null,this.editFieldsInfo=null,this.editingInfo=null,this.elevationInfo=null,this.fieldsIndex=null,this.floorInfo=null,this.fullExtent=null,this.gdbVersion=null,this.geometryFieldsInfo=null,this.geometryType=null,this.globalIdField=null,this.hasM=void 0,this.hasZ=void 0,this.heightModelInfo=null,this.historicMoment=null,this.indexes=new(o.A.ofType(C)),this.isTable=!1,this.layerId=void 0,this.maxScale=0,this.minScale=0,this.objectIdField=null,this.preferredTimeZone=null,this.relationships=null,this.returnM=void 0,this.returnZ=void 0,this.serviceDefinitionExpression=null,this.serviceItemId=null,this.sourceJSON=null,this.spatialReference=g.A.WGS84,this.subtypeField=null,this.subtypes=null,this.trackIdField=null,this.uniqueIdFields=null,this.url=null,this.version=void 0,this._isUrlHostModified=!1,this._isUrlHostModificationEnabled=!1}getFieldDomain(e,t){throw new Error("Not implemented")}getField(e){return this.fieldsIndex.get(e)}get authenticationTriggerEvent(){if(!this.url)return null;const{capabilities:e}=this;if(e){const{query:t,operations:i,editing:r}=e;if(!t.supportsQueryByOthers||!t.supportsQueryByAnonymous)return"load";if(i.supportsEditing&&!(r.supportsUpdateByOthers&&r.supportsUpdateByAnonymous&&r.supportsDeleteByOthers&&r.supportsDeleteByAnonymous))return"load"}if((0,F.rQ)(this.serviceDefinitionExpression)||(0,F.rQ)(this.definitionExpression))return"load";if(this.userHasUpdateItemPrivileges){if((0,F.tG)(this))return"load";if(this.hasUpdateItemRestrictions)return e.operations.supportsQuery?"editing":"load"}if(this.userHasFullEditingPrivileges&&this.hasFullEditingRestrictions)return"editing";const t=this.editFieldsInfo;return(t?.creatorField||t?.editorField)&&e?.operations.supportsEditing?"editing":null}readCapabilitiesFromService(e,t){return(0,j.S)(t,this.url)}readEditingInfo(e,t){const{editingInfo:i}=t;return i?{lastEditDate:null!=i.lastEditDate?new Date(i.lastEditDate):null}:null}get effectiveCapabilities(){const e=this.capabilities;if(!e)return null;const t=(0,s.o8)(e),{operations:i,editing:r}=t;return(0,F.Pt)(this)?(this.userHasUpdateItemPrivileges&&(i.supportsQuery=!0),t):this.userHasUpdateItemPrivileges?(i.supportsAdd=i.supportsDelete=i.supportsEditing=i.supportsQuery=i.supportsUpdate=r.supportsDeleteByOthers=r.supportsGeometryUpdate=r.supportsUpdateByOthers=!0,t):(this.userHasFullEditingPrivileges&&i.supportsEditing&&(i.supportsAdd=i.supportsDelete=i.supportsUpdate=r.supportsGeometryUpdate=!0),t)}get effectiveEditingEnabled(){return!1}readGlobalIdFieldFromService(e,t){return(0,F.jD)(t)}get hasFullEditingRestrictions(){const e=this.capabilities;if(!e||(0,F.Pt)(this))return!1;const{operations:t,editing:i}=e;return t.supportsEditing&&!(t.supportsAdd&&t.supportsDelete&&t.supportsUpdate&&i.supportsGeometryUpdate)}get hasUpdateItemRestrictions(){const e=this.capabilities;if(!e)return!1;const{operations:t,editing:i}=e;return(0,F.Pt)(this)?!t.supportsQuery:!(t.supportsAdd&&t.supportsDelete&&t.supportsEditing&&t.supportsQuery&&t.supportsUpdate&&i.supportsDeleteByOthers&&i.supportsGeometryUpdate&&i.supportsUpdateByOthers)}readIsTableFromService(e,t){return"Table"===t.type}readMaxScale(e,t){return t.effectiveMaxScale||e||0}readMinScale(e,t){return t.effectiveMinScale||e||0}readObjectIdFieldFromService(e,t){return(0,F.Zm)(t)}get parsedUrl(){return(0,Z.h)(this)}readServiceDefinitionExpression(e,t){return t.definitionQuery||t.definitionExpression}readUniqueIdFields(e,t){return t.uniqueIdInfo?.OIDFieldContainsHashValue?t.uniqueIdInfo.fields:null}readVersion(e,t){return(0,F.$4)(t)}get isUrlHostModified(){const{loaded:e,url:t,_isUrlHostModified:i}=this;if(i)return!0;if(!e||!t)return!1;if(this.originIdOf("url")<7)return!1;const r=this.sourceJSON?.preferredHost;if(!r)return!1;if(!(0,n.FX)(t,`https://${r}`,!0))return!1;for(let e=6;e>=3;e--){const i=this.getAtOrigin("url",(0,u.OL)(e));if(i)return!(0,n.FX)(t,i,!0)}return!1}applyPreferredHost(e){const{url:t,portalItem:i}=this;if(!t||!(0,S.OP)(i))return;const r=(0,S.$x)();r&&this._isUrlHostModificationEnabled&&(this._set("url",r),this._isUrlHostModified=!0,i&&(0,S.Gh)(i,(0,S.G$)()))}applyHostFromPortalItem(){const{url:e,portalItem:t}=this;if(!e||7===this.originIdOf("url")||!t?.url||!(0,S.OP)(t)||!(0,A.Y)(t,A.mm.HOSTED_SERVICE)||(0,n.FX)(e,t.url,!0)||!this._isUrlHostModificationEnabled)return;const i=(0,n.Ln)(t.url);this._set("url",(0,n.hf)(e,i)),this._isUrlHostModified=!0}};return(0,r.Cg)([(0,d.MZ)({readOnly:!0})],i.prototype,"authenticationTriggerEvent",null),(0,r.Cg)([(0,d.MZ)({type:String,json:{origins:{service:{read:{source:"copyrightText"}}}}})],i.prototype,"copyright",void 0),(0,r.Cg)([(0,d.MZ)({readOnly:!0,json:{read:!1,origins:{service:{read:{source:["advancedQueryCapabilities","allowGeometryUpdates","allowUpdateWithoutMValues","archivingInfo","capabilities","datesInUnknownTimezone","hasAttachments","hasM","hasZ","isDataBranchVersioned","isDataVersioned","maxRecordCount","maxRecordCountFactor","maxUniqueIDCount","ownershipBasedAccessControlForFeatures","standardMaxRecordCount","supportedQueryFormats","supportsAdvancedQueries","supportsApplyEditsWithGlobalIds","supportsAttachmentsByUploadId","supportsAttachmentsResizing","supportsCalculate","supportsCoordinatesQuantization","supportsExceedsLimitStatistics","supportsFieldDescriptionProperty","supportsQuantizationEditMode","supportsRollbackOnFailureParameter","supportsStatistics","supportsTruncate","supportsValidateSql","tileMaxRecordCount","useStandardizedQueries"]}}}}})],i.prototype,"capabilities",void 0),(0,r.Cg)([(0,l.w)("service","capabilities")],i.prototype,"readCapabilitiesFromService",null),(0,r.Cg)([(0,d.MZ)((0,v.P6)("dateFieldsTimeReference"))],i.prototype,"dateFieldsTimeZone",void 0),(0,r.Cg)([(0,d.MZ)({type:Boolean})],i.prototype,"datesInUnknownTimezone",void 0),(0,r.Cg)([(0,d.MZ)({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],i.prototype,"definitionExpression",void 0),(0,r.Cg)([(0,d.MZ)({type:String,json:{origins:{service:{read:{source:"displayField"}}}}})],i.prototype,"displayField",void 0),(0,r.Cg)([(0,d.MZ)({readOnly:!0,type:M})],i.prototype,"editFieldsInfo",void 0),(0,r.Cg)([(0,d.MZ)({readOnly:!0})],i.prototype,"editingInfo",void 0),(0,r.Cg)([(0,l.w)("editingInfo")],i.prototype,"readEditingInfo",null),(0,r.Cg)([(0,d.MZ)({readOnly:!0})],i.prototype,"effectiveCapabilities",null),(0,r.Cg)([(0,d.MZ)()],i.prototype,"effectiveEditingEnabled",null),(0,r.Cg)([(0,d.MZ)((()=>{const e=(0,s.o8)(y.Yj),t=e.json.origins;return t["web-map"]={read:!1,write:!1},t["portal-item"]={read:!1,write:!1},e})())],i.prototype,"elevationInfo",void 0),(0,r.Cg)([(0,d.MZ)()],i.prototype,"fieldsIndex",void 0),(0,r.Cg)([(0,d.MZ)({type:w.A,json:{name:"layerDefinition.floorInfo",write:{layerContainerTypes:p.K}}})],i.prototype,"floorInfo",void 0),(0,r.Cg)([(0,d.MZ)({type:c.A,json:{origins:{service:{read:{source:"extent"}}}}})],i.prototype,"fullExtent",void 0),(0,r.Cg)([(0,d.MZ)()],i.prototype,"gdbVersion",void 0),(0,r.Cg)([(0,d.MZ)({readOnly:!0,type:b,json:{read:{source:"geometryProperties"}}})],i.prototype,"geometryFieldsInfo",void 0),(0,r.Cg)([(0,d.MZ)({type:["point","polygon","polyline","multipoint","multipatch","mesh"],json:{origins:{service:{read:F.iX.read}}}})],i.prototype,"geometryType",void 0),(0,r.Cg)([(0,d.MZ)({type:String})],i.prototype,"globalIdField",void 0),(0,r.Cg)([(0,l.w)("service","globalIdField",["globalIdField","fields"])],i.prototype,"readGlobalIdFieldFromService",null),(0,r.Cg)([(0,d.MZ)({readOnly:!0})],i.prototype,"hasFullEditingRestrictions",null),(0,r.Cg)([(0,d.MZ)({type:Boolean,json:{origins:{service:{read:!0}}}})],i.prototype,"hasM",void 0),(0,r.Cg)([(0,d.MZ)({readOnly:!0})],i.prototype,"hasUpdateItemRestrictions",null),(0,r.Cg)([(0,d.MZ)({type:Boolean,json:{origins:{service:{read:!0}}}})],i.prototype,"hasZ",void 0),(0,r.Cg)([(0,d.MZ)({readOnly:!0,type:h.A})],i.prototype,"heightModelInfo",void 0),(0,r.Cg)([(0,d.MZ)({type:Date})],i.prototype,"historicMoment",void 0),(0,r.Cg)([(0,d.MZ)({type:o.A.ofType(C),readOnly:!0})],i.prototype,"indexes",void 0),(0,r.Cg)([(0,d.MZ)({readOnly:!0})],i.prototype,"isTable",void 0),(0,r.Cg)([(0,l.w)("service","isTable",["type"])],i.prototype,"readIsTableFromService",null),(0,r.Cg)([(0,d.MZ)({type:Number,json:{origins:{service:{read:{source:"id"}},"portal-item":{read:!1,write:{target:"id"}}},read:!1}})],i.prototype,"layerId",void 0),(0,r.Cg)([(0,d.MZ)(y.hG)],i.prototype,"maxScale",void 0),(0,r.Cg)([(0,l.w)("service","maxScale",["maxScale","effectiveMaxScale"])],i.prototype,"readMaxScale",null),(0,r.Cg)([(0,d.MZ)(y.hn)],i.prototype,"minScale",void 0),(0,r.Cg)([(0,l.w)("service","minScale",["minScale","effectiveMinScale"])],i.prototype,"readMinScale",null),(0,r.Cg)([(0,d.MZ)({type:String})],i.prototype,"objectIdField",void 0),(0,r.Cg)([(0,l.w)("service","objectIdField",["objectIdField","fields"])],i.prototype,"readObjectIdFieldFromService",null),(0,r.Cg)([(0,d.MZ)({readOnly:!0})],i.prototype,"parsedUrl",null),(0,r.Cg)([(0,d.MZ)((0,v.P6)("preferredTimeReference"))],i.prototype,"preferredTimeZone",void 0),(0,r.Cg)([(0,d.MZ)({type:[U.A],readOnly:!0})],i.prototype,"relationships",void 0),(0,r.Cg)([(0,d.MZ)({type:Boolean})],i.prototype,"returnM",void 0),(0,r.Cg)([(0,d.MZ)({type:Boolean})],i.prototype,"returnZ",void 0),(0,r.Cg)([(0,d.MZ)({readOnly:!0,json:{write:!1}})],i.prototype,"serverGens",void 0),(0,r.Cg)([(0,d.MZ)({readOnly:!0})],i.prototype,"serviceDefinitionExpression",void 0),(0,r.Cg)([(0,l.w)("service","serviceDefinitionExpression",["definitionQuery","definitionExpression"])],i.prototype,"readServiceDefinitionExpression",null),(0,r.Cg)([(0,d.MZ)({type:String,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],i.prototype,"serviceItemId",void 0),(0,r.Cg)([(0,d.MZ)()],i.prototype,"sourceJSON",void 0),(0,r.Cg)([(0,d.MZ)({type:g.A,json:{origins:{service:{read:{source:"extent.spatialReference"}}}}})],i.prototype,"spatialReference",void 0),(0,r.Cg)([(0,d.MZ)({type:String,readOnly:!0,json:{origins:{service:{read:!0}}}})],i.prototype,"subtypeField",void 0),(0,r.Cg)([(0,d.MZ)({type:[x],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],i.prototype,"subtypes",void 0),(0,r.Cg)([(0,d.MZ)({type:String,json:{read:{source:"timeInfo.trackIdField"}}})],i.prototype,"trackIdField",void 0),(0,r.Cg)([(0,d.MZ)({type:[String],readOnly:!0})],i.prototype,"uniqueIdFields",void 0),(0,r.Cg)([(0,l.w)("service","uniqueIdFields",["uniqueIdInfo.OIDFieldContainsHashValue","uniqueIdInfo.fields"])],i.prototype,"readUniqueIdFields",null),(0,r.Cg)([(0,d.MZ)((0,Z.b)({nonStandardUrlAllowed:!0}))],i.prototype,"url",void 0),(0,r.Cg)([(0,d.MZ)({json:{origins:{service:{read:!0}},read:!1}})],i.prototype,"version",void 0),(0,r.Cg)([(0,l.w)("service","version",["currentVersion","capabilities","drawingInfo","hasAttachments","htmlPopupType","relationships","timeInfo","typeIdField","types"])],i.prototype,"readVersion",null),(0,r.Cg)([(0,d.MZ)({readOnly:!0})],i.prototype,"isUrlHostModified",null),i=(0,r.Cg)([(0,a.$)("esri.layers.mixins.FeatureLayerBase")],i),i}},91908:(e,t,i)=>{i.d(t,{D:()=>s});var r=i(60694);const o=[];function s(e,t){if((0,r.Wo)(e.url??""))return!0;const{wkid:i}=t;for(const t of o){if((e.version??0)>=t[0])return!0;if("function"==typeof t[1]&&(t[1]=t[1]()),t[1].has(i))return!1}return!0}o.push([10.91,()=>{const e=new Set([9709,9716,9741,9761,9766]);for(let t=9712;t<=9713;t++)e.add(t);for(let t=9748;t<=9749;t++)e.add(t);for(let t=20904;t<=20932;t++)e.add(t);for(let t=21004;t<=21032;t++)e.add(t);for(let t=21207;t<=21264;t++)e.add(t);for(let t=21307;t<=21364;t++)e.add(t);for(let t=23301;t<=23333;t++)e.add(t);for(let t=102759;t<=102760;t++)e.add(t);for(let t=102934;t<=102955;t++)e.add(t);return e}]),o.push([10.9,()=>{const e=new Set([9300,9354,9364,9367,9373,9377,9387,9456,9473,9498,9678,9680,29874,103599,103872,104028]);for(let t=9356;t<=9360;t++)e.add(t);for(let t=9404;t<=9407;t++)e.add(t);for(let t=9476;t<=9482;t++)e.add(t);for(let t=9487;t<=9494;t++)e.add(t);for(let t=9697;t<=9699;t++)e.add(t);return e}]),o.push([10.81,()=>{const e=new Set([9265,9333,103598,103699]);for(let t=9248;t<=9254;t++)e.add(t);for(let t=9271;t<=9273;t++)e.add(t);for(let t=9284;t<=9285;t++)e.add(t);for(let t=21453;t<=21463;t++)e.add(t);return e}]),o.push([10.8,()=>{const e=new Set([8088,8395,8428,8433,8531,8687,8692,8694,8699,8900,9003,9006,9009,9012,9017,9191]);for(let t=8035;t<=8036;t++)e.add(t);for(let t=8455;t<=8456;t++)e.add(t);for(let t=8518;t<=8529;t++)e.add(t);for(let t=8533;t<=8536;t++)e.add(t);for(let t=8538;t<=8540;t++)e.add(t);for(let t=8677;t<=8679;t++)e.add(t);for(let t=8902;t<=8903;t++)e.add(t);for(let t=8907;t<=8910;t++)e.add(t);for(let t=8949;t<=8951;t++)e.add(t);for(let t=8972;t<=8987;t++)e.add(t);for(let t=9039;t<=9040;t++)e.add(t);for(let t=9068;t<=9069;t++)e.add(t);for(let t=9140;t<=9141;t++)e.add(t);for(let t=9148;t<=9150;t++)e.add(t);for(let t=9153;t<=9159;t++)e.add(t);for(let t=9205;t<=9218;t++)e.add(t);for(let t=9221;t<=9222;t++)e.add(t);for(let t=54098;t<=54101;t++)e.add(t);return e}]),o.push([10.71,()=>{const e=new Set([6316]);for(let t=8351;t<=8353;t++)e.add(t);for(let t=9294;t<=9297;t++)e.add(t);for(let t=22619;t<=22621;t++)e.add(t);for(let t=103586;t<=103594;t++)e.add(t);return e}])}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[7136],{17136:(e,t,n)=>{n.d(t,{Y_:()=>j,O7:()=>S,el:()=>k});var s=n(92602),i=n(69052),r=n(49186),o=n(53966),c=n(39829),a=n(82799),l=n(16930),u=n(80754),f=n(21325),h=n(28735),p=n(78888),m=n(65864),g=n(2272),y=n(84952),d=n(92300);const M=()=>o.A.getLogger("esri.geometry.support.normalizeUtils");function A(e){return"polygon"===e[0].type}function x(e){return"polyline"===e[0].type}function w(e,t,n){if(t){const t=function(e,t){if(!(e instanceof a.A||e instanceof c.A)){const e="straightLineDensify: the input geometry is neither polyline nor polygon";throw M().error(e),new r.A("internal:geometry",e)}const n=(0,u.r8)(e),s=[];for(const e of n){const n=[];s.push(n),n.push([e[0][0],e[0][1]]);for(let s=0;s<e.length-1;s++){const i=e[s][0],r=e[s][1],o=e[s+1][0],c=e[s+1][1],a=Math.sqrt((o-i)*(o-i)+(c-r)*(c-r)),l=(c-r)/a,u=(o-i)/a,f=a/t;if(f>1){for(let e=1;e<=f-1;e++){const s=e*t,o=u*s+i,c=l*s+r;n.push([o,c])}const e=(a+Math.floor(f-1)*t)/2,s=u*e+i,o=l*e+r;n.push([s,o])}n.push([o,c])}}return function(e){return"polygon"===e.type}(e)?new c.A({rings:s,spatialReference:e.spatialReference}):new a.A({paths:s,spatialReference:e.spatialReference})}(e,1e6);e=(0,h.ci)(t,!0)}return n&&(e=(0,u.kS)(e,n)),e}function b(e,t,n){if(Array.isArray(e)){const s=e[0];if(s>t){const n=(0,u.kd)(s,t);e[0]=s+n*(-2*t)}else if(s<n){const t=(0,u.kd)(s,n);e[0]=s+t*(-2*n)}}else{const s=e.x;if(s>t){const n=(0,u.kd)(s,t);e=e.clone().offset(n*(-2*t),0)}else if(s<n){const t=(0,u.kd)(s,n);e=e.clone().offset(t*(-2*n),0)}}return e}function R(e,t){let n=-1;for(let s=0;s<t.cutIndexes.length;s++){const i=t.cutIndexes[s],r=t.geometries[s],o=(0,u.r8)(r);for(let e=0;e<o.length;e++){const t=o[e];t.some(n=>{if(n[0]<180)return!0;{let n=0;for(let e=0;e<t.length;e++){const s=t[e][0];n=s>n?s:n}n=Number(n.toFixed(9));const s=-360*(0,u.kd)(n,180);for(let n=0;n<t.length;n++){const t=r.getPoint(e,n);r.setPoint(e,n,t.clone().offset(s,0))}return!0}})}if(i===n){if(A(e))for(const t of(0,u.r8)(r))e[i]=e[i].addRing(t);else if(x(e))for(const t of(0,u.r8)(r))e[i]=e[i].addPath(t)}else n=i,e[i]=r}return e}async function k(e,t,n){if(!Array.isArray(e))return k([e],t);t&&"string"!=typeof t&&M().warn("normalizeCentralMeridian()","The url object is deprecated, use the url string instead");const i="string"==typeof t?t:t?.url??s.A.geometryServiceUrl;let r,o,l,A,x,S,X,j,L=0;const N=[],v=[];for(const t of e)if(null!=t)if(r||(r=t.spatialReference,o=(0,f.Vp)(r),l=r.isWebMercator,S=l?102100:4326,A=u.j7[S].maxX,x=u.j7[S].minX,X=u.j7[S].plus180Line,j=u.j7[S].minus180Line),o)if("mesh"===t.type)v.push(t);else if("point"===t.type)v.push(b(t.clone(),A,x));else if("multipoint"===t.type){const e=t.clone();e.points=e.points.map(e=>b(e,A,x)),v.push(e)}else if("extent"===t.type){const e=t.clone()._normalize(!1,!1,o);v.push(e.rings?new c.A(e):e)}else if(t.extent){const e=t.extent,n=(0,u.kd)(e.xmin,x)*(2*A);let s=0===n?t.clone():(0,u.kS)(t.clone(),n);e.offset(n,0);let{xmin:i,xmax:r}=e;i=Number(i.toFixed(9)),r=Number(r.toFixed(9)),e.intersects(X)&&r!==A?(L=r>L?r:L,s=w(s,l),N.push(s),v.push("cut")):e.intersects(j)&&i!==x?(L=r*(2*A)>L?r*(2*A):L,s=w(s,l,360),N.push(s),v.push("cut")):v.push(s)}else v.push(t.clone());else v.push(t);else v.push(t);let z=(0,u.kd)(L,A),I=-90;const P=z,W=new a.A;for(;z>0;){const e=360*z-180;W.addPath([[e,I],[e,-1*I]]),I*=-1,z--}if(N.length>0&&P>0){const t=R(N,await async function(e,t,n,s){const i=(0,g.Dl)(e),r=t[0].spatialReference,o={...s,responseType:"json",query:{...i.query,f:"json",sr:(0,f.YX)(r),target:JSON.stringify({geometryType:(0,m.$B)(t[0]),geometries:t}),cutter:JSON.stringify(n)}},c=await(0,p.A)(i.path+"/cut",o),{cutIndexes:a,geometries:l=[]}=c.data;return{cutIndexes:a,geometries:l.map(e=>{const t=(0,m.rS)(e);return t.spatialReference=r,t})}}(i,N,W,n)),s=[],r=[];for(let n=0;n<v.length;n++){const i=v[n];if("cut"!==i)r.push(i);else{const i=t.shift(),o=e[n];null!=o&&"polygon"===o.type&&o.rings&&o.rings.length>1&&i.rings.length>=o.rings.length?(s.push(i),r.push("simplify")):r.push(l?(0,h.Gh)(i):i)}}if(!s.length)return r;const o=await async function(e,t,n){const s="string"==typeof e?(0,y.An)(e):e,i=t[0].spatialReference,r=(0,m.$B)(t[0]),o={...n,query:{...s.query,f:"json",sr:(0,f.YX)(i),geometries:JSON.stringify((0,d.X)(t))}},{data:c}=await(0,p.A)(s.path+"/simplify",o);return(0,d.V)(c.geometries,r,i)}(i,s,n),c=[];for(let e=0;e<r.length;e++){const t=r[e];"simplify"!==t?c.push(t):c.push(l?(0,h.Gh)(o.shift()):o.shift())}return c}const q=[];for(let e=0;e<v.length;e++){const t=v[e];if("cut"!==t)q.push(t);else{const e=N.shift();q.push(!0===l?(0,h.Gh)(e):e)}}return q}function S(e,t,n){const s=(0,f.Vp)(n);if(null==s)return e;const[i,r]=s.valid,o=2*r;let c=0,a=0;t>r?c=Math.ceil(Math.abs(t-r)/o):t<i&&(c=-Math.ceil(Math.abs(t-i)/o)),e>r?a=Math.ceil(Math.abs(e-r)/o):e<i&&(a=-Math.ceil(Math.abs(e-i)/o));let l=e+(c-a)*o;const u=l-t;return u>r?l-=o:u<i&&(l+=o),l}function X(e){const t=(0,f.Vp)(e);if(null==t)return null;const[n,s]=t.valid;return new i.hr(n,s)}const j=X(l.A.WGS84);X(l.A.WebMercator)},69052:(e,t,n)=>{n.d(t,{hr:()=>i,ie:()=>a,uC:()=>c});var s=n(34727);class i{constructor(e,t){this.min=e,this.max=t,this.range=t-e}normalize(e,t=0,n=!1){return r(this.range,this.min,this.max,e,t,n)}clamp(e,t=0){return(0,s.qE)(e-t,this.min,this.max)+t}monotonic(e,t,n){return e<t?t:t+o(this.range,e-t,n)}minimalMonotonic(e,t,n){return r(this.range,e,e+this.range,t,n)}center(e,t,n){return t=this.monotonic(e,t,n),this.normalize((e+t)/2,n)}diff(e,t,n){return this.monotonic(e,t,n)-e}shortestSignedDiff(e,t){e=this.normalize(e);const n=(t=this.normalize(t))-e,s=t<e?this.minimalMonotonic(e,t)-e:t-this.minimalMonotonic(t,e);return Math.abs(n)<Math.abs(s)?n:s}contains(e,t,n){return t=this.minimalMonotonic(e,t),(n=this.minimalMonotonic(e,n))>e&&n<t}}function r(e,t,n,s,i=0,r=!1){return(s-=i)<t?s+=o(e,t-s):s>n&&(s-=o(e,s-n)),r&&s===n&&(s=t),s+i}function o(e,t,n=0){return Math.ceil((t-n)/e)*e+n}const c=new i(0,2*Math.PI),a=(new i(-Math.PI,Math.PI),new i(0,360))},80754:(e,t,n)=>{n.d(t,{j7:()=>o,kS:()=>a,kd:()=>c,r8:()=>l});var s=n(82799),i=n(16930),r=n(65864);const o={102100:{maxX:20037508.342788905,minX:-20037508.342788905,plus180Line:new s.A({paths:[[[20037508.342788905,-20037508.342788905],[20037508.342788905,20037508.342788905]]],spatialReference:i.A.WebMercator}),minus180Line:new s.A({paths:[[[-20037508.342788905,-20037508.342788905],[-20037508.342788905,20037508.342788905]]],spatialReference:i.A.WebMercator})},4326:{maxX:180,minX:-180,plus180Line:new s.A({paths:[[[180,-180],[180,180]]],spatialReference:i.A.WGS84}),minus180Line:new s.A({paths:[[[-180,-180],[-180,180]]],spatialReference:i.A.WGS84})}};function c(e,t){return Math.ceil((e-t)/(2*t))}function a(e,t){const n=l(e);for(const e of n)for(const n of e)n[0]+=t;return e}function l(e){return(0,r.Bi)(e)?e.rings:e.paths}},92300:(e,t,n)=>{n.d(t,{V:()=>r,X:()=>i});var s=n(65864);function i(e){return{geometryType:(0,s.$B)(e[0]),geometries:e.map(e=>e.toJSON())}}function r(e,t,n){const i=(0,s.xD)(t);return e.map(e=>{const t=i.fromJSON(e);return t.spatialReference=n,t})}}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[7136],{17136:(e,t,n)=>{n.d(t,{Y_:()=>j,O7:()=>S,el:()=>k});var s=n(92602),i=n(69052),r=n(49186),o=n(53966),c=n(39829),a=n(82799),l=n(16930),u=n(80754),f=n(21325),h=n(28735),p=n(43773),m=n(65864),g=n(2272),y=n(84952),d=n(92300);const M=()=>o.A.getLogger("esri.geometry.support.normalizeUtils");function A(e){return"polygon"===e[0].type}function x(e){return"polyline"===e[0].type}function w(e,t,n){if(t){const t=function(e,t){if(!(e instanceof a.A||e instanceof c.A)){const e="straightLineDensify: the input geometry is neither polyline nor polygon";throw M().error(e),new r.A("internal:geometry",e)}const n=(0,u.r8)(e),s=[];for(const e of n){const n=[];s.push(n),n.push([e[0][0],e[0][1]]);for(let s=0;s<e.length-1;s++){const i=e[s][0],r=e[s][1],o=e[s+1][0],c=e[s+1][1],a=Math.sqrt((o-i)*(o-i)+(c-r)*(c-r)),l=(c-r)/a,u=(o-i)/a,f=a/t;if(f>1){for(let e=1;e<=f-1;e++){const s=e*t,o=u*s+i,c=l*s+r;n.push([o,c])}const e=(a+Math.floor(f-1)*t)/2,s=u*e+i,o=l*e+r;n.push([s,o])}n.push([o,c])}}return function(e){return"polygon"===e.type}(e)?new c.A({rings:s,spatialReference:e.spatialReference}):new a.A({paths:s,spatialReference:e.spatialReference})}(e,1e6);e=(0,h.ci)(t,!0)}return n&&(e=(0,u.kS)(e,n)),e}function b(e,t,n){if(Array.isArray(e)){const s=e[0];if(s>t){const n=(0,u.kd)(s,t);e[0]=s+n*(-2*t)}else if(s<n){const t=(0,u.kd)(s,n);e[0]=s+t*(-2*n)}}else{const s=e.x;if(s>t){const n=(0,u.kd)(s,t);e=e.clone().offset(n*(-2*t),0)}else if(s<n){const t=(0,u.kd)(s,n);e=e.clone().offset(t*(-2*n),0)}}return e}function R(e,t){let n=-1;for(let s=0;s<t.cutIndexes.length;s++){const i=t.cutIndexes[s],r=t.geometries[s],o=(0,u.r8)(r);for(let e=0;e<o.length;e++){const t=o[e];t.some(n=>{if(n[0]<180)return!0;{let n=0;for(let e=0;e<t.length;e++){const s=t[e][0];n=s>n?s:n}n=Number(n.toFixed(9));const s=-360*(0,u.kd)(n,180);for(let n=0;n<t.length;n++){const t=r.getPoint(e,n);r.setPoint(e,n,t.clone().offset(s,0))}return!0}})}if(i===n){if(A(e))for(const t of(0,u.r8)(r))e[i]=e[i].addRing(t);else if(x(e))for(const t of(0,u.r8)(r))e[i]=e[i].addPath(t)}else n=i,e[i]=r}return e}async function k(e,t,n){if(!Array.isArray(e))return k([e],t);t&&"string"!=typeof t&&M().warn("normalizeCentralMeridian()","The url object is deprecated, use the url string instead");const i="string"==typeof t?t:t?.url??s.A.geometryServiceUrl;let r,o,l,A,x,S,X,j,L=0;const N=[],v=[];for(const t of e)if(null!=t)if(r||(r=t.spatialReference,o=(0,f.Vp)(r),l=r.isWebMercator,S=l?102100:4326,A=u.j7[S].maxX,x=u.j7[S].minX,X=u.j7[S].plus180Line,j=u.j7[S].minus180Line),o)if("mesh"===t.type)v.push(t);else if("point"===t.type)v.push(b(t.clone(),A,x));else if("multipoint"===t.type){const e=t.clone();e.points=e.points.map(e=>b(e,A,x)),v.push(e)}else if("extent"===t.type){const e=t.clone()._normalize(!1,!1,o);v.push(e.rings?new c.A(e):e)}else if(t.extent){const e=t.extent,n=(0,u.kd)(e.xmin,x)*(2*A);let s=0===n?t.clone():(0,u.kS)(t.clone(),n);e.offset(n,0);let{xmin:i,xmax:r}=e;i=Number(i.toFixed(9)),r=Number(r.toFixed(9)),e.intersects(X)&&r!==A?(L=r>L?r:L,s=w(s,l),N.push(s),v.push("cut")):e.intersects(j)&&i!==x?(L=r*(2*A)>L?r*(2*A):L,s=w(s,l,360),N.push(s),v.push("cut")):v.push(s)}else v.push(t.clone());else v.push(t);else v.push(t);let z=(0,u.kd)(L,A),I=-90;const P=z,W=new a.A;for(;z>0;){const e=360*z-180;W.addPath([[e,I],[e,-1*I]]),I*=-1,z--}if(N.length>0&&P>0){const t=R(N,await async function(e,t,n,s){const i=(0,g.Dl)(e),r=t[0].spatialReference,o={...s,responseType:"json",query:{...i.query,f:"json",sr:(0,f.YX)(r),target:JSON.stringify({geometryType:(0,m.$B)(t[0]),geometries:t}),cutter:JSON.stringify(n)}},c=await(0,p.A)(i.path+"/cut",o),{cutIndexes:a,geometries:l=[]}=c.data;return{cutIndexes:a,geometries:l.map(e=>{const t=(0,m.rS)(e);return t.spatialReference=r,t})}}(i,N,W,n)),s=[],r=[];for(let n=0;n<v.length;n++){const i=v[n];if("cut"!==i)r.push(i);else{const i=t.shift(),o=e[n];null!=o&&"polygon"===o.type&&o.rings&&o.rings.length>1&&i.rings.length>=o.rings.length?(s.push(i),r.push("simplify")):r.push(l?(0,h.Gh)(i):i)}}if(!s.length)return r;const o=await async function(e,t,n){const s="string"==typeof e?(0,y.An)(e):e,i=t[0].spatialReference,r=(0,m.$B)(t[0]),o={...n,query:{...s.query,f:"json",sr:(0,f.YX)(i),geometries:JSON.stringify((0,d.X)(t))}},{data:c}=await(0,p.A)(s.path+"/simplify",o);return(0,d.V)(c.geometries,r,i)}(i,s,n),c=[];for(let e=0;e<r.length;e++){const t=r[e];"simplify"!==t?c.push(t):c.push(l?(0,h.Gh)(o.shift()):o.shift())}return c}const q=[];for(let e=0;e<v.length;e++){const t=v[e];if("cut"!==t)q.push(t);else{const e=N.shift();q.push(!0===l?(0,h.Gh)(e):e)}}return q}function S(e,t,n){const s=(0,f.Vp)(n);if(null==s)return e;const[i,r]=s.valid,o=2*r;let c=0,a=0;t>r?c=Math.ceil(Math.abs(t-r)/o):t<i&&(c=-Math.ceil(Math.abs(t-i)/o)),e>r?a=Math.ceil(Math.abs(e-r)/o):e<i&&(a=-Math.ceil(Math.abs(e-i)/o));let l=e+(c-a)*o;const u=l-t;return u>r?l-=o:u<i&&(l+=o),l}function X(e){const t=(0,f.Vp)(e);if(null==t)return null;const[n,s]=t.valid;return new i.hr(n,s)}const j=X(l.A.WGS84);X(l.A.WebMercator)},69052:(e,t,n)=>{n.d(t,{hr:()=>i,ie:()=>a,uC:()=>c});var s=n(34727);class i{constructor(e,t){this.min=e,this.max=t,this.range=t-e}normalize(e,t=0,n=!1){return r(this.range,this.min,this.max,e,t,n)}clamp(e,t=0){return(0,s.qE)(e-t,this.min,this.max)+t}monotonic(e,t,n){return e<t?t:t+o(this.range,e-t,n)}minimalMonotonic(e,t,n){return r(this.range,e,e+this.range,t,n)}center(e,t,n){return t=this.monotonic(e,t,n),this.normalize((e+t)/2,n)}diff(e,t,n){return this.monotonic(e,t,n)-e}shortestSignedDiff(e,t){e=this.normalize(e);const n=(t=this.normalize(t))-e,s=t<e?this.minimalMonotonic(e,t)-e:t-this.minimalMonotonic(t,e);return Math.abs(n)<Math.abs(s)?n:s}contains(e,t,n){return t=this.minimalMonotonic(e,t),(n=this.minimalMonotonic(e,n))>e&&n<t}}function r(e,t,n,s,i=0,r=!1){return(s-=i)<t?s+=o(e,t-s):s>n&&(s-=o(e,s-n)),r&&s===n&&(s=t),s+i}function o(e,t,n=0){return Math.ceil((t-n)/e)*e+n}const c=new i(0,2*Math.PI),a=(new i(-Math.PI,Math.PI),new i(0,360))},80754:(e,t,n)=>{n.d(t,{j7:()=>o,kS:()=>a,kd:()=>c,r8:()=>l});var s=n(82799),i=n(16930),r=n(65864);const o={102100:{maxX:20037508.342788905,minX:-20037508.342788905,plus180Line:new s.A({paths:[[[20037508.342788905,-20037508.342788905],[20037508.342788905,20037508.342788905]]],spatialReference:i.A.WebMercator}),minus180Line:new s.A({paths:[[[-20037508.342788905,-20037508.342788905],[-20037508.342788905,20037508.342788905]]],spatialReference:i.A.WebMercator})},4326:{maxX:180,minX:-180,plus180Line:new s.A({paths:[[[180,-180],[180,180]]],spatialReference:i.A.WGS84}),minus180Line:new s.A({paths:[[[-180,-180],[-180,180]]],spatialReference:i.A.WGS84})}};function c(e,t){return Math.ceil((e-t)/(2*t))}function a(e,t){const n=l(e);for(const e of n)for(const n of e)n[0]+=t;return e}function l(e){return(0,r.Bi)(e)?e.rings:e.paths}},92300:(e,t,n)=>{n.d(t,{V:()=>r,X:()=>i});var s=n(65864);function i(e){return{geometryType:(0,s.$B)(e[0]),geometries:e.map(e=>e.toJSON())}}function r(e,t,n){const i=(0,s.xD)(t);return e.map(e=>{const t=i.fromJSON(e);return t.spatialReference=n,t})}}}]);
@@ -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[]}}}}]);