@arcgis/core 4.27.0-next.20230521 → 4.27.0-next.20230523

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 (268) hide show
  1. package/Graphic.js +1 -1
  2. package/WebMap.js +1 -1
  3. package/arcade/featureset/actions/SpatialFilter.js +1 -1
  4. package/arcade/featureset/sources/FeatureLayerDynamic.js +1 -1
  5. package/arcade/featureset/sources/FeatureLayerMemory.js +1 -1
  6. package/arcade/featureset/sources/FeatureLayerRelated.js +1 -1
  7. package/arcade/functions/featuresetbase.js +1 -1
  8. package/assets/esri/core/workers/RemoteClient.js +1 -1
  9. package/assets/esri/core/workers/chunks/030b43764f945cb1f8b0.js +1 -0
  10. package/assets/esri/core/workers/chunks/0d02856e55d20b99fc8b.js +1 -0
  11. package/assets/esri/core/workers/chunks/{69242c66492717c7388c.js → 0fcb8d408696075338e2.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{b91c155de9a89e4e6971.js → 187c3b971ed0fc4363ef.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{85c6ce93aa41e6b65997.js → 18db07d739a713cc0465.js} +1 -1
  14. package/assets/esri/core/workers/chunks/1b6177e23327be645c8c.js +1 -0
  15. package/assets/esri/core/workers/chunks/28286014a575042619ee.js +1 -0
  16. package/assets/esri/core/workers/chunks/{692dfeb2e255fdc0ade2.js → 39288fa69561d21f04f8.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{2b9d3e60977934a6d471.js → 3bc6b5f0643364749ef8.js} +1 -1
  18. package/assets/esri/core/workers/chunks/45e5ad704d18dd0857ce.js +1 -0
  19. package/assets/esri/core/workers/chunks/4d24efa01d1accc5a5f0.js +1 -0
  20. package/assets/esri/core/workers/chunks/{6312783626bacf52df7a.js → 55486c644e8b01326a0d.js} +1 -1
  21. package/assets/esri/core/workers/chunks/5576858f56314afcb4d5.js +1 -0
  22. package/assets/esri/core/workers/chunks/{62d9d15f0d00a75da42c.js → 571dac507622948ac03e.js} +1 -1
  23. package/assets/esri/core/workers/chunks/59063d6abf70f6598425.js +1 -0
  24. package/assets/esri/core/workers/chunks/5a4c04bf4f57e74457c5.js +1 -0
  25. package/assets/esri/core/workers/chunks/5bf04c32e0ac89dcbf9f.js +1 -0
  26. package/assets/esri/core/workers/chunks/6a3d611e8842afbb50ab.js +2 -0
  27. package/assets/esri/core/workers/chunks/{55ca6ba8b40921025181.js.LICENSE.txt → 6a3d611e8842afbb50ab.js.LICENSE.txt} +1 -1
  28. package/assets/esri/core/workers/chunks/70d6e5edf05ef7079fa8.js +1 -0
  29. package/assets/esri/core/workers/chunks/71bdf8f10aee0077f681.js +1 -0
  30. package/assets/esri/core/workers/chunks/72b2c3c8e76da699690c.js +1 -0
  31. package/assets/esri/core/workers/chunks/78ce0b1af62435d8ebf4.js +1 -0
  32. package/assets/esri/core/workers/chunks/791f529e90135398b3d5.js +1 -0
  33. package/assets/esri/core/workers/chunks/8d3abfe6fdc5ac8d6cb7.js +1 -0
  34. package/assets/esri/core/workers/chunks/{1edc5c06874cb12c5478.js → 924e4a18d8403d1caea3.js} +1 -1
  35. package/assets/esri/core/workers/chunks/96d339abcd917f1f0ae1.js +1 -0
  36. package/assets/esri/core/workers/chunks/97cdbec7532cfcdf9ad2.js +1 -0
  37. package/assets/esri/core/workers/chunks/{f3f6035a17f7dcd19675.js → 9ab400a89dd701778d2c.js} +1 -1
  38. package/assets/esri/core/workers/chunks/{1488b3d48232844b8bb4.js → 9fe349f43d5ff5a4ac2d.js} +1 -1
  39. package/assets/esri/core/workers/chunks/{22396dd3717d17a5d235.js → a1c31bb8c12831539328.js} +1 -1
  40. package/assets/esri/core/workers/chunks/b0571b9e602218cdc7aa.js +1 -0
  41. package/assets/esri/core/workers/chunks/b1d88f8e528bf7092f35.js +1 -0
  42. package/assets/esri/core/workers/chunks/b4e2dc6b3d06b426e596.js +1 -0
  43. package/assets/esri/core/workers/chunks/{48abcb2d88f22e6e9fde.js → c2cb9fa18c77f0c5104e.js} +1 -1
  44. package/assets/esri/core/workers/chunks/cad7a2092ea7f51dbd8b.js +1 -0
  45. package/assets/esri/core/workers/chunks/d08800a30b1227591986.js +1 -0
  46. package/assets/esri/core/workers/chunks/d725dbbdeb05322e6d88.js +1 -0
  47. package/assets/esri/core/workers/chunks/df3e497d12ed77bae168.js +1 -0
  48. package/assets/esri/core/workers/chunks/fb080339bfaf32731ca6.js +1 -0
  49. package/assets/esri/core/workers/chunks/{56fc7924b4fb30239c19.js → fdf58386a67e54c09bfb.js} +1 -1
  50. package/assets/esri/rest/knowledgeGraph/wasmInterface/arcgis-knowledge-client-core-simd.wasm +0 -0
  51. package/assets/esri/rest/knowledgeGraph/wasmInterface/arcgis-knowledge-client-core.wasm +0 -0
  52. package/assets/esri/themes/base/_core.scss +2 -0
  53. package/assets/esri/themes/base/widgets/_BasemapGallery.scss +86 -96
  54. package/assets/esri/themes/base/widgets/_FloorFilter.scss +6 -0
  55. package/assets/esri/themes/base/widgets/_UtilityNetworkValidateTopology.scss +40 -0
  56. package/assets/esri/themes/dark/main.css +1 -1
  57. package/assets/esri/themes/light/main.css +1 -1
  58. package/assets/esri/themes/light/view.css +1 -1
  59. package/assets/esri/views/interactive/tooltip/t9n/Tooltip.json +1 -1
  60. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_en.json +1 -1
  61. package/assets/esri/widgets/Editor/t9n/Editor.json +1 -1
  62. package/assets/esri/widgets/Editor/t9n/Editor_ar.json +1 -1
  63. package/assets/esri/widgets/Editor/t9n/Editor_bg.json +1 -1
  64. package/assets/esri/widgets/Editor/t9n/Editor_bs.json +1 -1
  65. package/assets/esri/widgets/Editor/t9n/Editor_ca.json +1 -1
  66. package/assets/esri/widgets/Editor/t9n/Editor_cs.json +1 -1
  67. package/assets/esri/widgets/Editor/t9n/Editor_da.json +1 -1
  68. package/assets/esri/widgets/Editor/t9n/Editor_de.json +1 -1
  69. package/assets/esri/widgets/Editor/t9n/Editor_el.json +1 -1
  70. package/assets/esri/widgets/Editor/t9n/Editor_en.json +1 -1
  71. package/assets/esri/widgets/Editor/t9n/Editor_es.json +1 -1
  72. package/assets/esri/widgets/Editor/t9n/Editor_et.json +1 -1
  73. package/assets/esri/widgets/Editor/t9n/Editor_fi.json +1 -1
  74. package/assets/esri/widgets/Editor/t9n/Editor_fr.json +1 -1
  75. package/assets/esri/widgets/Editor/t9n/Editor_he.json +1 -1
  76. package/assets/esri/widgets/Editor/t9n/Editor_hr.json +1 -1
  77. package/assets/esri/widgets/Editor/t9n/Editor_hu.json +1 -1
  78. package/assets/esri/widgets/Editor/t9n/Editor_id.json +1 -1
  79. package/assets/esri/widgets/Editor/t9n/Editor_it.json +1 -1
  80. package/assets/esri/widgets/Editor/t9n/Editor_ja.json +1 -1
  81. package/assets/esri/widgets/Editor/t9n/Editor_ko.json +1 -1
  82. package/assets/esri/widgets/Editor/t9n/Editor_lt.json +1 -1
  83. package/assets/esri/widgets/Editor/t9n/Editor_lv.json +1 -1
  84. package/assets/esri/widgets/Editor/t9n/Editor_nb.json +1 -1
  85. package/assets/esri/widgets/Editor/t9n/Editor_nl.json +1 -1
  86. package/assets/esri/widgets/Editor/t9n/Editor_pl.json +1 -1
  87. package/assets/esri/widgets/Editor/t9n/Editor_pt-BR.json +1 -1
  88. package/assets/esri/widgets/Editor/t9n/Editor_pt-PT.json +1 -1
  89. package/assets/esri/widgets/Editor/t9n/Editor_ro.json +1 -1
  90. package/assets/esri/widgets/Editor/t9n/Editor_ru.json +1 -1
  91. package/assets/esri/widgets/Editor/t9n/Editor_sk.json +1 -1
  92. package/assets/esri/widgets/Editor/t9n/Editor_sl.json +1 -1
  93. package/assets/esri/widgets/Editor/t9n/Editor_sr.json +1 -1
  94. package/assets/esri/widgets/Editor/t9n/Editor_sv.json +1 -1
  95. package/assets/esri/widgets/Editor/t9n/Editor_th.json +1 -1
  96. package/assets/esri/widgets/Editor/t9n/Editor_tr.json +1 -1
  97. package/assets/esri/widgets/Editor/t9n/Editor_uk.json +1 -1
  98. package/assets/esri/widgets/Editor/t9n/Editor_vi.json +1 -1
  99. package/assets/esri/widgets/Editor/t9n/Editor_zh-CN.json +1 -1
  100. package/assets/esri/widgets/Editor/t9n/Editor_zh-HK.json +1 -1
  101. package/assets/esri/widgets/Editor/t9n/Editor_zh-TW.json +1 -1
  102. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology.json +1 -1
  103. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_ar.json +1 -1
  104. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_bg.json +1 -1
  105. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_bs.json +1 -1
  106. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_ca.json +1 -1
  107. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_cs.json +1 -1
  108. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_da.json +1 -1
  109. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_de.json +1 -1
  110. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_el.json +1 -1
  111. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_en.json +1 -1
  112. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_es.json +1 -1
  113. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_et.json +1 -1
  114. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_fi.json +1 -1
  115. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_fr.json +1 -1
  116. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_he.json +1 -1
  117. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_hr.json +1 -1
  118. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_hu.json +1 -1
  119. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_id.json +1 -1
  120. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_it.json +1 -1
  121. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_ja.json +1 -1
  122. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_ko.json +1 -1
  123. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_lt.json +1 -1
  124. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_lv.json +1 -1
  125. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_nb.json +1 -1
  126. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_nl.json +1 -1
  127. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_pl.json +1 -1
  128. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_pt-BR.json +1 -1
  129. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_pt-PT.json +1 -1
  130. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_ro.json +1 -1
  131. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_ru.json +1 -1
  132. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_sk.json +1 -1
  133. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_sl.json +1 -1
  134. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_sr.json +1 -1
  135. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_sv.json +1 -1
  136. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_th.json +1 -1
  137. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_tr.json +1 -1
  138. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_uk.json +1 -1
  139. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_vi.json +1 -1
  140. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_zh-CN.json +1 -1
  141. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_zh-HK.json +1 -1
  142. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_zh-TW.json +1 -1
  143. package/chunks/arcgis-knowledge-client-core-simd.js +1 -1
  144. package/chunks/arcgis-knowledge-client-core.js +1 -1
  145. package/chunks/mat4.js +1 -1
  146. package/core/accessorSupport/write.js +1 -1
  147. package/core/fontUtils.js +1 -1
  148. package/core/libs/gl-matrix-2/math/mat4.js +1 -1
  149. package/geometry/Mesh.js +1 -1
  150. package/geometry/support/MeshGeoreferencedRelativeVertexSpace.d.ts +4 -0
  151. package/geometry/support/MeshGeoreferencedRelativeVertexSpace.js +5 -0
  152. package/geometry/support/MeshGeoreferencedVertexSpace.d.ts +4 -0
  153. package/geometry/support/MeshGeoreferencedVertexSpace.js +5 -0
  154. package/geometry/support/MeshLocalVertexSpace.d.ts +4 -0
  155. package/geometry/support/MeshLocalVertexSpace.js +5 -0
  156. package/geometry/support/MeshTransform.d.ts +4 -0
  157. package/geometry/support/MeshTransform.js +1 -1
  158. package/geometry/support/meshUtils/ElevationSamplerWorker.js +1 -1
  159. package/geometry/support/meshUtils/centerAt.js +1 -1
  160. package/geometry/support/meshUtils/exporters/gltf/geometry.js +1 -1
  161. package/geometry/support/meshUtils/exporters/gltf/gltf.js +1 -1
  162. package/geometry/support/meshUtils/geographicUtils.js +1 -1
  163. package/geometry/support/meshUtils/georeference.js +1 -1
  164. package/geometry/support/meshUtils/loadGLTFMesh.js +1 -1
  165. package/geometry/support/meshUtils/merge.js +1 -1
  166. package/geometry/support/meshUtils/offset.js +1 -1
  167. package/geometry/support/meshUtils/primitives.js +1 -1
  168. package/geometry/support/meshUtils/rotate.js +1 -1
  169. package/geometry/support/meshUtils/scale.js +1 -1
  170. package/interfaces.d.ts +227 -25
  171. package/layers/LinkChartLayer.js +1 -1
  172. package/layers/VoxelWasmPerSceneView.js +1 -1
  173. package/layers/graphics/data/attributeSupport.js +1 -1
  174. package/layers/graphics/sources/FeatureLayerSource.js +1 -1
  175. package/layers/knowledgeGraph/KnowledgeGraphLayerDataManager.js +1 -1
  176. package/layers/knowledgeGraph/SessionMemoryStorage.js +1 -1
  177. package/layers/support/SubtypeSublayer.js +1 -1
  178. package/layers/support/rasterFunctions/BandArithmeticFunction.js +1 -1
  179. package/layers/support/rasterFunctions/BaseRasterFunction.js +1 -1
  180. package/layers/support/rasterFunctions/CompositeBandFunction.js +1 -1
  181. package/layers/support/rasterFunctions/ExtractBandFunction.js +1 -1
  182. package/layers/support/rasterFunctions/ExtractBandFunctionArguments.js +1 -1
  183. package/layers/support/rasterFunctions/NDVIFunction.js +1 -1
  184. package/networks/support/TopologyValidationJobInfo.js +1 -1
  185. package/package.json +2 -2
  186. package/popup/FieldInfo.js +1 -1
  187. package/portal/Portal.js +1 -1
  188. package/rest/support/FeatureSet.js +1 -1
  189. package/rest/support/meshFeatureSet.js +1 -1
  190. package/smartMapping/symbology/color.js +1 -1
  191. package/smartMapping/symbology/support/colors.js +1 -1
  192. package/support/revision.js +1 -1
  193. package/symbols/cim/cimAnalyzer.js +1 -1
  194. package/symbols/support/utils.js +1 -1
  195. package/views/2d/layers/StreamLayerView2D.js +1 -1
  196. package/views/2d/layers/features/controllers/FeatureController2D.js +1 -1
  197. package/views/2d/layers/features/support/FeatureSetReaderJSON.js +1 -1
  198. package/views/3d/environment/EnvironmentRenderer.js +1 -1
  199. package/views/3d/interactive/editingTools/draw/DrawGraphicTool3D.js +1 -1
  200. package/views/3d/interactive/editingTools/meshFastUpdateUtils.js +1 -1
  201. package/views/3d/interactive/editingTools/moveGraphic/GraphicMoveTool.js +1 -1
  202. package/views/3d/interactive/editingTools/transformGraphic/GraphicTransformTool.js +1 -1
  203. package/views/3d/interactive/editingTools/transformGraphic/ScaleRotateMeshAdapter.js +1 -1
  204. package/views/3d/interactive/editingTools/transformGraphic/undoRecords.js +1 -1
  205. package/views/3d/layers/StreamLayerView3D.js +1 -1
  206. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  207. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  208. package/views/3d/layers/graphics/Graphics3DMeshObject3DGraphicLayer.js +1 -1
  209. package/views/3d/layers/graphics/symbolComplexity.js +1 -1
  210. package/views/3d/layers/i3s/I3SClientNodeLoader.js +1 -1
  211. package/views/3d/layers/i3s/I3SOverrides.js +1 -1
  212. package/views/3d/state/utils/navigationUtils.js +1 -1
  213. package/views/3d/support/DisplayQualityProfile.js +1 -1
  214. package/views/3d/support/QualitySettings.js +1 -1
  215. package/views/3d/webgl-engine/lib/Camera.js +1 -1
  216. package/views/3d/webgl-engine/lib/RenderFeature.js +1 -1
  217. package/views/3d/webgl-engine/lib/RenderPluginManager.js +1 -1
  218. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  219. package/views/3d/webgl-engine/lib/TextRenderParameters.js +1 -1
  220. package/views/draw/DrawOperation.js +1 -1
  221. package/views/draw/support/helpMessageUtils.js +1 -1
  222. package/views/interactive/dragEventPipeline.js +1 -1
  223. package/views/layers/StreamLayerView.js +1 -1
  224. package/widgets/BasemapGallery/css.js +1 -1
  225. package/widgets/BasemapGallery/support/PortalBasemapsSource.js +1 -1
  226. package/widgets/BasemapGallery.js +1 -1
  227. package/widgets/CoordinateConversion.js +1 -1
  228. package/widgets/Editor/EditorViewModel.js +1 -1
  229. package/widgets/Editor/Edits.js +1 -1
  230. package/widgets/Editor/Upload.js +1 -1
  231. package/widgets/Editor/workflowUtils.js +1 -1
  232. package/widgets/Editor.js +1 -1
  233. package/widgets/Feature/support/featureUtils.js +1 -1
  234. package/widgets/FeatureForm/featureFormUtils.js +1 -1
  235. package/widgets/FeatureTable/FieldColumn.js +1 -1
  236. package/widgets/LayerList.js +1 -1
  237. package/widgets/Locate.js +1 -1
  238. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceViewModel.js +1 -1
  239. package/widgets/UtilityNetworkValidateTopology/UtilityNetworkValidateTopologyViewModel.js +5 -0
  240. package/widgets/UtilityNetworkValidateTopology.js +5 -0
  241. package/widgets/support/widgetUtils.js +1 -1
  242. package/assets/esri/core/workers/chunks/163bf2e13abbdd298374.js +0 -1
  243. package/assets/esri/core/workers/chunks/23f73f81aea461c0c6e6.js +0 -1
  244. package/assets/esri/core/workers/chunks/2640204c4655aa535ccb.js +0 -1
  245. package/assets/esri/core/workers/chunks/2bf42d060f877566b989.js +0 -1
  246. package/assets/esri/core/workers/chunks/34ec9623a1bece86a82b.js +0 -1
  247. package/assets/esri/core/workers/chunks/3bf52139340827794c3b.js +0 -1
  248. package/assets/esri/core/workers/chunks/3cebdd77a8401495097f.js +0 -1
  249. package/assets/esri/core/workers/chunks/48cb634255e39711a720.js +0 -1
  250. package/assets/esri/core/workers/chunks/4d5f71d84c85f45c97ea.js +0 -1
  251. package/assets/esri/core/workers/chunks/52d02021e858820bc4fa.js +0 -1
  252. package/assets/esri/core/workers/chunks/55ca6ba8b40921025181.js +0 -2
  253. package/assets/esri/core/workers/chunks/64b8f65e2ef6cbf08380.js +0 -1
  254. package/assets/esri/core/workers/chunks/662e479c370c11bcb8a7.js +0 -1
  255. package/assets/esri/core/workers/chunks/78aede1e114deefacb54.js +0 -1
  256. package/assets/esri/core/workers/chunks/7ef100158ca28631fcaf.js +0 -1
  257. package/assets/esri/core/workers/chunks/93ad67930aa7d4a4b0ac.js +0 -1
  258. package/assets/esri/core/workers/chunks/964795dfb57f0d0635d0.js +0 -1
  259. package/assets/esri/core/workers/chunks/99ce0a202dcd3d7dc290.js +0 -1
  260. package/assets/esri/core/workers/chunks/abe6c99a1a719543dbe8.js +0 -1
  261. package/assets/esri/core/workers/chunks/c3bf44146fddfe8990f7.js +0 -1
  262. package/assets/esri/core/workers/chunks/cbe817e966b57599bafd.js +0 -1
  263. package/assets/esri/core/workers/chunks/e15b5d7e46a834eacc57.js +0 -1
  264. package/assets/esri/core/workers/chunks/e1e0b3580e2c3098c9f4.js +0 -1
  265. package/assets/esri/core/workers/chunks/e305d20e4424451cab5b.js +0 -1
  266. package/assets/esri/core/workers/chunks/e6836c84470fb6bd25bf.js +0 -1
  267. package/assets/esri/core/workers/chunks/f924732902703233655e.js +0 -1
  268. package/assets/esri/core/workers/chunks/ff1c005eede0cf964332.js +0 -1
@@ -0,0 +1 @@
1
+ (self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[450,9880],{41993:e=>{function t(e){return Promise.resolve().then((()=>{var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}))}t.keys=()=>[],t.resolve=t,t.id=41993,e.exports=t},99880:(e,t,r)=>{"use strict";r.d(t,{V:()=>l});var s=r(68773),i=(r(3172),r(20102)),n=r(92604),o=r(81271);const a=n.Z.getLogger("esri.assets");function l(e){if(!s.default.assetsPath)throw a.errorOnce("The API assets location needs to be set using config.assetsPath. More information: https://arcg.is/1OzLe50"),new i.Z("assets:path-not-set","config.assetsPath is not set");return(0,o.v_)(s.default.assetsPath,e)}},32448:(e,t,r)=>{"use strict";r.d(t,{Z:()=>l});var s=r(43697),i=r(92036),n=r(50758),o=r(52011);class a{constructor(){this._emitter=new a.EventEmitter(this)}emit(e,t){return this._emitter.emit(e,t)}on(e,t){return this._emitter.on(e,t)}once(e,t){return this._emitter.once(e,t)}hasEventListener(e){return this._emitter.hasEventListener(e)}}!function(e){class t{constructor(e=null){this._target=e,this._listenersMap=null}clear(){this._listenersMap?.clear(),this._listenersMap=null}destroy(){this.clear()}emit(e,t){const r=this._listenersMap&&this._listenersMap.get(e);if(!r)return!1;const s=this._target||this;return[...r].forEach((e=>{e.call(s,t)})),r.length>0}on(e,t){if(Array.isArray(e)){const r=e.map((e=>this.on(e,t)));return(0,n.AL)(r)}if(e.includes(","))throw new TypeError("Evented.on() with a comma delimited string of event types is not supported");this._listenersMap||(this._listenersMap=new Map);const r=this._listenersMap.get(e)||[];return r.push(t),this._listenersMap.set(e,r),{remove:()=>{const r=this._listenersMap&&this._listenersMap.get(e)||[],s=r.indexOf(t);s>=0&&r.splice(s,1)}}}once(e,t){const r=this.on(e,(e=>{r.remove(),t.call(null,e)}));return r}hasEventListener(e){const t=this._listenersMap&&this._listenersMap.get(e);return null!=t&&t.length>0}}e.EventEmitter=t,e.EventedMixin=e=>{let r=class extends e{constructor(){super(...arguments),this._emitter=new t}destroy(){this._emitter.clear()}emit(e,t){return this._emitter.emit(e,t)}on(e,t){return this._emitter.on(e,t)}once(e,t){return this._emitter.once(e,t)}hasEventListener(e){return this._emitter.hasEventListener(e)}};return r=(0,s._)([(0,o.j)("esri.core.Evented")],r),r};let r=class extends i.Z{constructor(){super(...arguments),this._emitter=new a.EventEmitter(this)}destroy(){this._emitter.clear()}emit(e,t){return this._emitter.emit(e,t)}on(e,t){return this._emitter.on(e,t)}once(e,t){return this._emitter.once(e,t)}hasEventListener(e){return this._emitter.hasEventListener(e)}};r=(0,s._)([(0,o.j)("esri.core.Evented")],r),e.EventedAccessor=r}(a||(a={}));const l=a},609:(e,t,r)=>{"use strict";r.d(t,{D:()=>u,v:()=>c});var s,i,n=r(43697),o=r(92036),a=r(70586),l=r(95330),h=r(52011);(i=s||(s={}))[i.PENDING=0]="PENDING",i[i.RESOLVED=1]="RESOLVED",i[i.REJECTED=2]="REJECTED";class d{constructor(){this._resolver=(0,l.hh)(),this._status=s.PENDING,this._resolvingPromises=[],this._resolver.promise.then((()=>{this._status=s.RESOLVED,this._cleanUp()}),(()=>{this._status=s.REJECTED,this._cleanUp()})),this.promise=this._resolver.promise}destroy(){this._cleanUp()}addResolvingPromise(e){this._resolvingPromises.push(e),this._tryResolve()}isResolved(){return this._status===s.RESOLVED}isRejected(){return this._status===s.REJECTED}isFulfilled(){return this._status!==s.PENDING}abort(){this._resolver.reject((0,l.zE)())}_cleanUp(){this._allPromise=null,this._resolvingPromises=null}_tryResolve(){if(this.isFulfilled())return;const e=(0,l.hh)(),t=[...this._resolvingPromises,(0,a.j0)(e.promise)],r=this._allPromise=Promise.all(t);r.then((()=>{this.isFulfilled()||this._allPromise!==r||this._resolver.resolve()}),(e=>{this.isFulfilled()||this._allPromise!==r||(0,l.D_)(e)||this._resolver.reject(e)})),e.resolve()}}const c=e=>{let t=class extends e{constructor(...e){super(...e),this._promiseProps=new d,this.addResolvingPromise(Promise.resolve())}destroy(){this._promiseProps?.destroy()}isResolved(){return this._promiseProps.isResolved()}isRejected(){return this._promiseProps.isRejected()}isFulfilled(){return this._promiseProps.isFulfilled()}when(e,t){return this._promiseProps.promise.then((()=>this)).then(e,t)}catch(e){return this.when(null,e)}addResolvingPromise(e){e&&!this._promiseProps.isFulfilled()&&this._promiseProps.addResolvingPromise("_promiseProps"in e?e.when():e)}};return t=(0,n._)([(0,h.j)("esri.core.Promise")],t),t};let u=class extends(c(o.Z)){};u=(0,n._)([(0,h.j)("esri.core.Promise")],u)},17445:(e,t,r)=>{"use strict";r.d(t,{N1:()=>u,YP:()=>l,Z_:()=>m,gx:()=>h,nn:()=>g,on:()=>c,tX:()=>_});var s=r(91460),i=r(50758),n=r(70586),o=r(95330),a=r(26258);function l(e,t,r={}){return d(e,t,r,p)}function h(e,t,r={}){return d(e,t,r,f)}function d(e,t,r={},s){let i=null;const o=r.once?(e,r)=>{s(e)&&((0,n.hw)(i),t(e,r))}:(e,r)=>{s(e)&&t(e,r)};if(i=(0,a.aQ)(e,o,r.sync,r.equals),r.initial){const t=e();o(t,t)}return i}function c(e,t,r,o={}){let a=null,h=null,d=null;function c(){a&&h&&(h.remove(),o.onListenerRemove?.(a),a=null,h=null)}function u(e){o.once&&o.once&&(0,n.hw)(d),r(e)}const p=l(e,((e,r)=>{c(),(0,s.vT)(e)&&(a=e,h=(0,s.on)(e,t,u),o.onListenerAdd?.(e))}),{sync:o.sync,initial:!0});return d=(0,i.kB)((()=>{p.remove(),c()})),d}function u(e,t){return function(e,t,r){if((0,o.Hc)(r))return Promise.reject((0,o.zE)());const s=e();if(t?.(s))return Promise.resolve(s);let a=null;function l(){a=(0,n.hw)(a)}return new Promise(((s,n)=>{a=(0,i.AL)([(0,o.fu)(r,(()=>{l(),n((0,o.zE)())})),d(e,(e=>{l(),s(e)}),{sync:!1,once:!0},t??p)])}))}(e,f,t)}function p(e){return!0}function f(e){return!!e}r(87538);const m={sync:!0},g={initial:!0},_={sync:!0,initial:!0}},41123:(e,t,r)=>{"use strict";r.d(t,{D:()=>i,z:()=>n});const s="randomUUID"in crypto;function i(){if(s)return crypto.randomUUID();const e=crypto.getRandomValues(new Uint16Array(8));e[3]=4095&e[3]|16384,e[4]=16383&e[4]|32768;const t=t=>e[t].toString(16).padStart(4,"0");return t(0)+t(1)+"-"+t(2)+"-"+t(3)+"-"+t(4)+"-"+t(5)+t(6)+t(7)}function n(){return`{${i()}}`}},73660:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>gt});var s=r(40330),i=r(43697),n=r(68773),o=r(3172),a=r(20102),l=r(32448),h=r(91460),d=r(22974),c=r(78286),u=r(95330),p=r(17445),f=r(81271),m=r(5600),g=(r(75215),r(52011)),_=(r(67676),r(80442),r(940));r(2587),Element.prototype.closest;var v=r(61247),y=r(92604),w=r(70586),S=r(609),I=r(41123),k=r(90578),b=r(58971),A=r(38805),T=r(8728),U=r(3894),C=r(50758);const x=new Map;function P(){x.clear()}function R(e){x.delete(e)}y.Z.getLogger("esri.widgets.support.widgetUtils");function O(e){const t=U.Z.acquire();for(let e=0;e<arguments.length;e++){const r=arguments[e],s=typeof r;if("string"===s)t.push(r);else if(Array.isArray(r))t.push.apply(t,r);else if("object"===s)for(const e in r)r[e]&&t.push(e)}const r=t.join(" ");return U.Z.release(t),r}function D(e){this[e.getAttribute("data-node-ref")]=e}(()=>{const e=new Map;new ResizeObserver((t=>{P();for(const r of t)e.get(r.target)?.(r)}))})();const E=["dd","dl","dt","h1","h2","h3","h4","h5","h6","sub","sup","animate","animatetransform","circle","clippath","defs","ellipse","g","image","line","lineargradient","marker","mask","path","pattern","polygon","polyline","radialgradient","rect","stop","svg","switch","symbol","text","textpath","tspan","use"].reduce(((e,t)=>(e[t]=[],e)),{}),N=["align","alink","alt","bgcolor","border","cellpadding","cellspacing","class","color","cols","colspan","coords","d","dir","face","height","hspace","ismap","lang","marginheight","marginwidth","multiple","nohref","noresize","noshade","nowrap","ref","rel","rev","rows","rowspan","scrolling","shape","span","summary","tabindex","title","usemap","valign","value","vlink","vspace","width"],L=new T.Z({whiteList:E,onTagAttr:(e,t,r)=>{const s=`${t}="${r}"`;if(N.includes(t))return s},stripIgnoreTag:!0,stripIgnoreTagBody:["script","style"]},!0),j="http://www.w3.org/",M=`${j}2000/svg`,q=`${j}1999/xlink`;let $=[],F=(e,t)=>{let r={};return Object.keys(e).forEach((t=>{r[t]=e[t]})),t&&Object.keys(t).forEach((e=>{r[e]=t[e]})),r},B=(e,t)=>e.vnodeSelector===t.vnodeSelector&&(e.properties&&t.properties?e.properties.key===t.properties.key&&e.properties.bind===t.properties.bind:!e.properties&&!t.properties),V=e=>{if("string"!=typeof e)throw new Error("Style values must be strings")},z=(e,t,r)=>{if(""!==t.vnodeSelector)for(let s=r;s<e.length;s++)if(B(e[s],t))return s;return-1},Z=(e,t,r,s)=>{let i=e[t];if(""===i.vnodeSelector)return;let n=i.properties;if(!(n?void 0===n.key?n.bind:n.key:void 0))for(let n=0;n<e.length;n++)if(n!==t){let t=e[n];if(B(t,i))throw new Error(`${r.vnodeSelector} had a ${i.vnodeSelector} child ${"added"===s?s:"removed"}, but there is now more than one. You must add unique key properties to make them distinguishable.`)}},H=e=>{if(e.properties){let t=e.properties.enterAnimation;t&&t(e.domNode,e.properties)}},J=[],W=!1,Y=e=>{(e.children||[]).forEach(Y),e.properties&&e.properties.afterRemoved&&e.properties.afterRemoved.apply(e.properties.bind||e.properties,[e.domNode])},G=()=>{W=!1,J.forEach(Y),J.length=0},K=e=>{J.push(e),W||(W=!0,"undefined"!=typeof window&&"requestIdleCallback"in window?window.requestIdleCallback(G,{timeout:16}):setTimeout(G,16))},X=e=>{let t=e.domNode;if(e.properties){let r=e.properties.exitAnimation;if(r){t.style.pointerEvents="none";let s=()=>{t.parentNode&&(t.parentNode.removeChild(t),K(e))};return void r(t,s,e.properties)}}t.parentNode&&(t.parentNode.removeChild(t),K(e))},Q=(e,t,r)=>{if(!t)return;let s=r.eventHandlerInterceptor,i=Object.keys(t),n=i.length;for(let o=0;o<n;o++){let n=i[o],a=t[n];if("className"===n)throw new Error('Property "className" is not supported, use "class".');if("class"===n)ie(e,a,!0);else if("classes"===n){let t=Object.keys(a),r=t.length;for(let s=0;s<r;s++){let r=t[s];a[r]&&e.classList.add(r)}}else if("styles"===n){let t=Object.keys(a),s=t.length;for(let i=0;i<s;i++){let s=t[i],n=a[s];n&&(V(n),r.styleApplyer(e,s,n))}}else if("key"!==n&&null!=a){let i=typeof a;"function"===i?(0===n.lastIndexOf("on",0)&&(s&&(a=s(n,a,e,t)),"oninput"===n&&function(){let e=a;a=function(t){e.apply(this,[t]),t.target["oninput-value"]=t.target.value}}()),e[n]=a):r.namespace===M?"href"===n?e.setAttributeNS(q,n,a):e.setAttribute(n,a):"string"===i&&"value"!==n?"innerHTML"===n?e[n]=L.sanitize(a):ee(e)&&n in e?e[n]=a:e.setAttribute(n,a):e[n]=a}}};function ee(e){if(!(e instanceof Element&&e.tagName.includes("-")))return!1;const t=window.customElements.get(e.tagName.toLowerCase());return!!t&&e instanceof t}let te,re=(e,t,r)=>{((e,t,r)=>{if(t)for(let s of t)se(s,e,void 0,r)})(e,t.children,r),t.text&&(e.textContent=t.text),Q(e,t.properties,r),t.properties&&t.properties.afterCreate&&t.properties.afterCreate.apply(t.properties.bind||t.properties,[e,r,t.vnodeSelector,t.properties,t.children])},se=(e,t,r,s)=>{let i,n=0,o=e.vnodeSelector,a=t.ownerDocument;if(""===o)i=e.domNode=a.createTextNode(e.text),void 0!==r?t.insertBefore(i,r):t.appendChild(i);else{for(let l=0;l<=o.length;++l){let h=o.charAt(l);if(l===o.length||"."===h||"#"===h){let h=o.charAt(n-1),d=o.slice(n,l);"."===h?i.classList.add(d):"#"===h?i.id=d:("svg"===d&&(s=F(s,{namespace:M})),void 0!==s.namespace?i=e.domNode=a.createElementNS(s.namespace,d):(i=e.domNode=e.domNode||a.createElement(d),"input"===d&&e.properties&&void 0!==e.properties.type&&i.setAttribute("type",e.properties.type)),void 0!==r?t.insertBefore(i,r):i.parentNode!==t&&t.appendChild(i)),n=l+1}}re(i,e,s)}},ie=(e,t,r)=>{t&&t.split(" ").forEach((t=>{t&&e.classList.toggle(t,r)}))},ne=(e,t,r,s,i)=>{if(r===s)return!1;s=s||$;let n,o=(r=r||$).length,a=s.length,l=0,h=0,d=!1;for(;h<a;){let a=l<o?r[l]:void 0,c=s[h];if(void 0!==a&&B(a,c))d=te(a,c,i)||d,l++;else{let a=z(r,c,l+1);if(a>=0){for(n=l;n<a;n++)X(r[n]),Z(r,n,e,"removed");d=te(r[a],c,i)||d,l=a+1}else se(c,t,l<o?r[l].domNode:void 0,i),H(c),Z(s,h,e,"added")}h++}if(o>l)for(n=l;n<o;n++)X(r[n]),Z(r,n,e,"removed");return d};te=(e,t,r)=>{let s=e.domNode,i=!1;if(e===t)return!1;let n=!1;if(""===t.vnodeSelector){if(t.text!==e.text){let e=s.ownerDocument.createTextNode(t.text);return s.parentNode.replaceChild(e,s),t.domNode=e,i=!0,i}t.domNode=s}else 0===t.vnodeSelector.lastIndexOf("svg",0)&&(r=F(r,{namespace:M})),e.text!==t.text&&(n=!0,void 0===t.text?s.removeChild(s.firstChild):s.textContent=t.text),t.domNode=s,n=ne(t,s,e.children,t.children,r)||n,n=((e,t,r,s)=>{if(!r)return;let i=!1,n=Object.keys(r),o=n.length;for(let a=0;a<o;a++){let o=n[a],l=r[o],h=t[o];if("class"===o)h!==l&&(ie(e,h,!1),ie(e,l,!0));else if("classes"===o){let t=e.classList,r=Object.keys(l),s=r.length;for(let e=0;e<s;e++){let s=r[e],n=!!l[s];n!==!!h[s]&&(i=!0,n?t.add(s):t.remove(s))}}else if("styles"===o){let t=Object.keys(l),r=t.length;for(let n=0;n<r;n++){let r=t[n],o=l[r];o!==h[r]&&(i=!0,o?(V(o),s.styleApplyer(e,r,o)):s.styleApplyer(e,r,""))}}else if(l||"string"!=typeof h||(l=""),"value"===o){let t=e[o];t!==l&&(e["oninput-value"]?t===e["oninput-value"]:l!==h)&&(e[o]=l,e["oninput-value"]=void 0),l!==h&&(i=!0)}else if(l!==h){let t=typeof l;"function"===t&&s.eventHandlerInterceptor||(s.namespace===M?"href"===o?e.setAttributeNS(q,o,l):e.setAttribute(o,l):"string"===t?"innerHTML"===o?e[o]=L.sanitize(l):"role"===o&&""===l?e.removeAttribute(o):ee(e)&&o in e?e[o]=l:e.setAttribute(o,l):e[o]!==l&&(e[o]=l),i=!0)}}return i})(s,e.properties,t.properties,r)||n,t.properties&&t.properties.afterUpdate&&t.properties.afterUpdate.apply(t.properties.bind||t.properties,[s,r,t.vnodeSelector,t.properties,t.children]);return n&&t.properties&&t.properties.updateAnimation&&t.properties.updateAnimation(s,t.properties,e.properties),i};let oe=(e,t)=>({getLastRender:()=>e,update:r=>{if(e.vnodeSelector!==r.vnodeSelector)throw new Error("The selector for the root VNode may not be changed. (consider using dom.merge and add one extra level to the virtual DOM)");let s=e;e=r,te(s,r,t)},domNode:e.domNode});const ae={namespace:void 0,performanceLogger:()=>{},eventHandlerInterceptor:void 0,styleApplyer:(e,t,r)=>{"-"===t.charAt(0)?e.style.setProperty(t,r):e.style[t]=r}};let le,he=e=>F(ae,e),de=(e,t,r)=>(r=he(r),se(t,e,void 0,r),oe(t,r)),ce=(e,t,r)=>(r=he(r),se(t,e.parentNode,e,r),oe(t,r)),ue=(e,t,r)=>(r=he(r),t.domNode=e,re(e,t,r),oe(t,r)),pe=(e,t,r)=>(r=he(r),se(t,e.parentNode,e,r),e.parentNode.removeChild(e),oe(t,r));le=Array.prototype.find?(e,t)=>e.find(t):(e,t)=>e.filter(t)[0];const fe={handleInterceptedEvent:(e,t,r,s)=>(e.scheduleRender(),t.properties[`on${s.type}`].apply(t.properties.bind||r,[s]))},me={namespace:void 0,performanceLogger:()=>{},eventHandlerInterceptor:void 0,styleApplyer:(e,t,r)=>{e.style[t]=r}},ge=(e,t,r=!1)=>{let s=e;return t.forEach(((e,i)=>{const n=s?.children?((e,t)=>e.find(t))(s.children,(t=>t.domNode===e)):void 0;r&&!n&&i!==t.length-1||(s=n)})),s};var _e=r(65161),ve=r(99880);let ye;ye="components/assets";const we=Symbol("widget"),Se=Symbol("widget-test-data"),Ie=[],ke={},be=new WeakMap;function Ae(e,t){let r=t.children;if(r&&r.length)for(let t=0;t<r.length;++t)r[t]=Ae(e,r[t]);else r=Ie;const s=t.vnodeSelector;if(xe(s)){const i=t.properties||ke,n=i.key||s;return{vnodeSelector:"div",properties:{key:n,afterCreate:Te,afterUpdate:Ue,afterRemoved:Ce,parentWidget:e,widgetConstructor:s,widgetProperties:{...i,key:n,children:r}},children:void 0,text:void 0,domNode:null}}return t}function Te(e,t,r,{parentWidget:s,widgetConstructor:i,widgetProperties:n}){const o=new i(n);o.container=e,be.set(e,o),o.afterCreate?.(o,e),s._internalHandles.add((0,C.kB)((()=>Ce(e))))}function Ue(e,t,r,{widgetProperties:s}){const i=be.get(e);i&&(i.set(s),i.afterUpdate?.(i,e))}function Ce(e){const t=be.get(e);t&&(t.afterRemoved?.(t,e),t.destroy(),be.delete(e))}function xe(e){return"function"==typeof e&&e[we]}const Pe=new Set;var Re,Oe=r(70171),De=r(94443);let Ee=0;function Ne(e,t){for(const r in t)null!=e[r]&&("object"==typeof e[r]&&"object"==typeof t[r]?Ne(e[r],t?.[r]):e[r]=t[r]);return e}const Le=(e=>{let t;const r={...fe,...e},s=(n=r,{...me,...n}),i=s.performanceLogger;var n;let o,a=!0,l=!1;const h=[],d=[],c=(e,n,o)=>{let a;s.eventHandlerInterceptor=(e,s,n,o)=>function(e){let s;i("domEvent",e);const n=((e,t)=>{const r=[];for(;e&&e!==t;)r.push(e),e=e.parentNode;return r})(e.currentTarget,a.domNode),o=n.some((e=>customElements.get(e?.tagName?.toLowerCase())));if(e.eventPhase!==Event.CAPTURING_PHASE&&o){const t=e.composedPath(),r=t.slice(t.indexOf(e.currentTarget),t.indexOf(a.domNode)).filter((e=>e.getRootNode()===e.ownerDocument)).reverse();s=ge(a.getLastRender(),r,!0)}else n.reverse(),s=ge(a.getLastRender(),n);let l;return s&&(l=r.handleInterceptedEvent(t,s,this,e)),i("domEventProcessed",e),l},r.postProcessProjectionOptions?.(s);const l=o();a=e(n,l,s),h.push(a),d.push(o),r.afterFirstVNodeRendered&&r.afterFirstVNodeRendered(a,l)};let u=()=>{if(o=void 0,a){a=!1,i("renderStart",void 0);for(let e=0;e<h.length;e++){const t=d[e]();i("rendered",void 0),h[e].update(t),i("patched",void 0)}i("renderDone",void 0),a=!0}};return r.modifyDoRenderImplementation&&(u=r.modifyDoRenderImplementation(u,h,d)),t={renderNow:u,scheduleRender:()=>{o||l||(o=requestAnimationFrame(u))},stop:()=>{o&&(cancelAnimationFrame(o),o=void 0),l=!0},resume:()=>{l=!1,a=!0,t.scheduleRender()},append:(e,t)=>{c(de,e,t)},insertBefore:(e,t)=>{c(ce,e,t)},merge:(e,t)=>{c(ue,e,t)},replace:(e,t)=>{c(pe,e,t)},detach:e=>{for(let t=0;t<d.length;t++)if(d[t]===e)return d.splice(t,1),h.splice(t,1)[0];throw new Error("renderFunction was not found")}},t})({postProcessProjectionOptions(e){const t=e.eventHandlerInterceptor,r=/capture$/i;e.eventHandlerInterceptor=(e,s,i,n)=>{const o=t?.(e,s,i,n),a=r.test(e);if(!((e=e.replace(r,"")).toLowerCase()in i)||a){const t=e[2].toLowerCase()+e.slice(3),r=e=>o?.call(i,e);i.addEventListener(t,r,a);const s=()=>i.removeEventListener(t,r,a),l=n.afterRemoved;n.afterRemoved=e=>{l?.(e),s()}}return o}},handleInterceptedEvent(e,t,r,s){const{eventPhase:i,type:n}=s,o=i===Event.CAPTURING_PHASE;let a=`on${n}${o?"capture":""}`;const l=t.properties;(l&&a in l||(a=`on${n[0].toUpperCase()}${n.slice(1)}${o?"Capture":""}`,l&&a in l))&&(P(),e.scheduleRender(),l[a].call(l.bind||r,s))}});let je=!1,Me=class extends((0,S.v)(l.Z.EventedAccessor)){constructor(e,t){super(e,t),this._attached=!1,this._internalHandles=new v.Z,this._projector=Le,this._readyForTrueRender=!1,this.iconClass="esri-icon-checkbox-unchecked",this.icon=null,this.key=this,this._loadLocale=(0,u.Ds)((async()=>{if(this._messageBundleProps&&this._messageBundleProps.length){const e=await(0,u.as)(this._messageBundleProps.map((async({bundlePath:e,propertyName:t})=>{if(this.destroyed)return;let r=await(0,De.ME)(e);this.uiStrings&&Object.keys(this.uiStrings)&&(r=Ne((0,d.d9)(r),this.uiStrings)),this[t]=r})));if(this.destroyed)return;for(const t of e)t.error&&y.Z.getLogger(this).error("widget-intl:locale-error",this.declaredClass,t.error)}await this.loadLocale()})),function(){try{(0,_e.K3)(".")}catch{(0,_e.YY)((0,f.hF)((0,ve.V)("components/assets")))}}();const r="esri-widget-uid-"+(0,I.D)(),s=this.render.bind(this);this._trackingTarget=new A.M((()=>this.scheduleRender()));const i=()=>{if(!this._readyForTrueRender||this.destroyed)return null;if(!this.visible)return{vnodeSelector:"div",properties:{key:r,class:"",styles:{display:"none"}},domNode:null,children:void 0,text:void 0};const e=s();let{properties:t}=e;t||(e.properties=t={});let{key:i,styles:n}=t;i||(t.key=r),n||(t.styles=n={}),n.display||(n.display="");let o=0;return e.children?.forEach((e=>{if(xe(e.vnodeSelector))return;let{properties:t}=e;t||(e.properties=t={}),t.key||(t.key=`${this.id}--${o++}`)})),Ae(this,e)};var n;this.render=()=>{if(je)return i();let e=function(e){return x.get(e)}(this)??null;if(e)return e;this._trackingTarget.clear(),je=!0;try{e=(0,b.LJ)(this._trackingTarget,i)}catch(e){throw console.error(e),e}finally{je=!1}return e&&function(e,t){x.set(e,t)}(this,e),e},this.addResolvingPromise(this._resourcesFetch=this.beforeFirstRender().then((()=>{this._readyForTrueRender=!0,this._postInitialize()}))),n=this._resourcesFetch,Pe.add(n),n.finally((()=>Pe.delete(n)))}normalizeCtorArgs(e,t){const r={...e};return t&&(r.container=t),r}postInitialize(){}beforeFirstRender(){return Promise.all([this.loadDependencies(),this._loadLocale()]).then((()=>{})).catch(u.H9)}async loadDependencies(){}async loadLocale(){}destroy(){this.destroyed||((0,w.SC)(this._trackingTarget),(0,w.SC)(this.viewModel),this._detach(this.container),this._set("container",null),this._internalHandles.destroy(),this._emitter.clear(),this.render=()=>null,this._projector=null,R(this))}set container(e){this._get("container")||this._set("container",e)}castContainer(e){return function(e){return"string"==typeof e?document.getElementById(e):e??null}(e)}get domNode(){return this.container}set domNode(e){this.container=e}get id(){return this._get("id")||this.get("container.id")||Date.now().toString(16)+"-widget-"+Ee++}set id(e){e&&this._set("id",e)}get label(){return this.declaredClass.split(".").pop()}set label(e){this._overrideIfSome("label",e)}get renderable(){return this._resourcesFetch}get visible(){return this._get("visible")}set visible(e){this._set("visible",e)}get[(Re=we,Se)](){return{projector:this._projector}}render(){throw new Error("not implemented")}scheduleRender(){this.destroyed||(R(this),this._projector.scheduleRender())}classes(...e){return O.apply(this,e)}renderNow(){R(this),this._projector.renderNow()}_postInitialize(){if(this.destroyed)return;this.scheduleRender(),this._delegatedEventNames?.length&&this._internalHandles.add((0,p.YP)((()=>this.viewModel),((e,t)=>{t&&this._internalHandles.remove("delegated-events"),e&&(0,h.vT)(e)&&this._internalHandles.add(this._delegatedEventNames.map((t=>(0,h.on)(e,t,(e=>{this.emit(t,e)})))),"delegated-events")}),p.nn)),this.postInitialize();const e=async()=>{await this._loadLocale().catch(u.H9),this.scheduleRender()};this._internalHandles.add([(0,Oe.qe)(e),(0,p.YP)((()=>this.uiStrings),e),(0,p.gx)((()=>this.container),(e=>{this.destroyed||this._attach(e)}),{initial:!0,once:!0})])}_attach(e){e&&(this._projector.merge(e,this.render),this._attached=!0)}_detach(e){this._attached&&(this._projector.detach(this.render),this._attached=!1),e?.parentNode?.removeChild(e)}};Me[Re]=!0,(0,i._)([(0,m.Cb)()],Me.prototype,"_readyForTrueRender",void 0),(0,i._)([(0,m.Cb)({value:null})],Me.prototype,"container",null),(0,i._)([(0,k.p)("container")],Me.prototype,"castContainer",null),(0,i._)([(0,m.Cb)()],Me.prototype,"iconClass",void 0),(0,i._)([(0,m.Cb)()],Me.prototype,"icon",void 0),(0,i._)([(0,m.Cb)()],Me.prototype,"id",null),(0,i._)([(0,m.Cb)()],Me.prototype,"label",null),(0,i._)([(0,m.Cb)()],Me.prototype,"renderable",null),(0,i._)([(0,m.Cb)()],Me.prototype,"uiStrings",void 0),(0,i._)([(0,m.Cb)()],Me.prototype,"viewModel",void 0),(0,i._)([(0,m.Cb)({value:!0})],Me.prototype,"visible",null),(0,i._)([(0,m.Cb)()],Me.prototype,"key",void 0),(0,i._)([(0,m.Cb)()],Me.prototype,"children",void 0),(0,i._)([(0,m.Cb)()],Me.prototype,"afterCreate",void 0),(0,i._)([(0,m.Cb)()],Me.prototype,"afterUpdate",void 0),(0,i._)([(0,m.Cb)()],Me.prototype,"afterRemoved",void 0),Me=(0,i._)([(0,g.j)("esri.widgets.Widget")],Me);const qe=Me;function $e(e){return(t,r)=>{t.hasOwnProperty("_messageBundleProps")||(t._messageBundleProps=t._messageBundleProps?t._messageBundleProps.slice():[]),t._messageBundleProps.push({bundlePath:e,propertyName:r})}}var Fe=function(e){return{vnodeSelector:"",properties:void 0,children:void 0,text:e.toString(),domNode:null}},Be=function(e,t){for(var r=0,s=e.length;r<s;r++){var i=e[r];Array.isArray(i)?Be(i,t):null!=i&&!1!==i&&(i.hasOwnProperty("vnodeSelector")||(i=Fe(i)),t.push(i))}};function Ve(e,t,...r){return"function"!=typeof e||xe(e)?function(e,t){for(var r=[],s=2;s<arguments.length;s++)r[s-2]=arguments[s];if(1===r.length&&"string"==typeof r[0])return{vnodeSelector:e,properties:t||void 0,children:void 0,text:r[0],domNode:null};var i=[];return Be(r,i),{vnodeSelector:e,properties:t||void 0,children:i,text:void 0,domNode:null}}(e,t,...r):e(t,...r)}const ze="esri-identity-form",Ze={base:ze,group:`${ze}__group`,label:`${ze}__label`,footer:`${ze}__footer`,esriInput:"esri-input",esriButton:"esri-button",esriButtonSecondary:"esri-button--secondary"};let He=class extends qe{constructor(e,t){super(e,t),this._usernameInputNode=null,this._passwordInputNode=null,this.signingIn=!1,this.server=null,this.resource=null,this.error=null,this.oAuthPrompt=!1}render(){const{error:e,server:t,resource:r,signingIn:s,oAuthPrompt:i,messages:n}=this,o=Ve("div",{class:Ze.group},(0,_.n)(i?n.oAuthInfo:n.info,{server:t&&/\.arcgis\.com/i.test(t)?"ArcGIS Online":t,resource:`(${r||n.lblItem})`})),a=i?null:Ve("div",{class:Ze.group,key:"username"},Ve("label",{class:Ze.label},n.lblUser,Ve("input",{value:"",required:!0,autocomplete:"off",spellcheck:!1,type:"text",bind:this,afterCreate:D,"data-node-ref":"_usernameInputNode",class:Ze.esriInput}))),l=i?null:Ve("div",{class:Ze.group,key:"password"},Ve("label",{class:Ze.label},n.lblPwd,Ve("input",{value:"",required:!0,type:"password",bind:this,afterCreate:D,"data-node-ref":"_passwordInputNode",class:Ze.esriInput}))),h=Ve("div",{class:this.classes(Ze.group,Ze.footer)},Ve("input",{type:"submit",disabled:!!s,value:s?n.lblSigning:n.lblOk,class:Ze.esriButton}),Ve("input",{type:"button",value:n.lblCancel,bind:this,onclick:this._cancel,class:this.classes(Ze.esriButton,Ze.esriButtonSecondary)})),d=e?Ve("div",null,e.details&&e.details.httpStatus?n.invalidUser:n.noAuthService):null;return Ve("form",{class:Ze.base,bind:this,onsubmit:this._submit},o,d,a,l,h)}_cancel(){this._set("signingIn",!1),this._usernameInputNode&&(this._usernameInputNode.value=""),this._passwordInputNode&&(this._passwordInputNode.value=""),this.emit("cancel")}_submit(e){e.preventDefault(),this._set("signingIn",!0);const t=this.oAuthPrompt?{}:{username:this._usernameInputNode&&this._usernameInputNode.value,password:this._passwordInputNode&&this._passwordInputNode.value};this.emit("submit",t)}};(0,i._)([(0,m.Cb)(),$e("esri/identity/t9n/identity")],He.prototype,"messages",void 0),(0,i._)([(0,m.Cb)()],He.prototype,"signingIn",void 0),(0,i._)([(0,m.Cb)()],He.prototype,"server",void 0),(0,i._)([(0,m.Cb)()],He.prototype,"resource",void 0),(0,i._)([(0,m.Cb)()],He.prototype,"error",void 0),(0,i._)([(0,m.Cb)()],He.prototype,"oAuthPrompt",void 0),He=(0,i._)([(0,g.j)("esri.identity.IdentityForm")],He);const Je=He;var We=r(44291);const Ye="esri-identity-modal",Ge={base:Ye,open:`${Ye}--open`,closed:`${Ye}--closed`,title:`${Ye}__title`,dialog:`${Ye}__dialog`,content:`${Ye}__content`,closeButton:`${Ye}__close-button`,iconClose:"esri-icon-close"};let Ke=class extends qe{constructor(e,t){super(e,t),this.container=document.createElement("div"),this.content=null,this.open=!1,this._focusTrap=null,this._close=()=>{this.open=!1},document.body.appendChild(this.container),this.addHandles((0,p.YP)((()=>this.open),(()=>this._toggleFocusTrap())))}destroy(){this._destroyFocusTrap()}get title(){return this.messages?.auth.signIn}render(){const e=this.id,{open:t,content:r,title:s,messages:i}=this,n=t&&!!r,o={[Ge.open]:n,[Ge.closed]:!n},a=Ve("button",{class:Ge.closeButton,"aria-label":i.close,title:i.close,bind:this,onclick:this._close,type:"button"},Ve("span",{"aria-hidden":"true",class:Ge.iconClose})),l=`${e}_title`,h=`${e}_content`,d=s?Ve("h1",{id:l,class:Ge.title},s):null,c=n?Ve("div",{bind:this,class:Ge.dialog,role:"dialog","aria-labelledby":l,"aria-describedby":h,afterCreate:this._createFocusTrap},a,d,this._renderContent(h)):null;return Ve("div",{tabIndex:-1,class:this.classes(Ge.base,o)},c)}_destroyFocusTrap(){this._focusTrap?.deactivate({onDeactivate:()=>{}}),this._focusTrap=null}_toggleFocusTrap(){const{_focusTrap:e,open:t}=this;e&&(t?e.activate():e.deactivate())}_createFocusTrap(e){this._destroyFocusTrap();const t=requestAnimationFrame((()=>{this._focusTrap=(0,We.v)(e,{initialFocus:"input",onDeactivate:this._close}),this._toggleFocusTrap()}));this.addHandles((0,C.kB)((()=>cancelAnimationFrame(t))))}_renderContent(e){const t=this.content;return"string"==typeof t?Ve("div",{class:Ge.content,id:e,innerHTML:t}):function(e){return e&&"function"==typeof e.render}(t)?Ve("div",{class:Ge.content,id:e},t.render()):t instanceof HTMLElement?Ve("div",{class:Ge.content,id:e,bind:t,afterCreate:this._attachToNode}):null}_attachToNode(e){e.appendChild(this)}};(0,i._)([(0,m.Cb)({readOnly:!0})],Ke.prototype,"container",void 0),(0,i._)([(0,m.Cb)()],Ke.prototype,"content",void 0),(0,i._)([(0,m.Cb)()],Ke.prototype,"open",void 0),(0,i._)([(0,m.Cb)(),$e("esri/t9n/common")],Ke.prototype,"messages",void 0),(0,i._)([(0,m.Cb)()],Ke.prototype,"title",null),Ke=(0,i._)([(0,g.j)("esri.identity.IdentityModal")],Ke);const Xe=Ke,Qe="esriJSAPIOAuth";class et{constructor(e,t){this.oAuthInfo=null,this.storage=null,this.appId=null,this.codeVerifier=null,this.expires=null,this.refreshToken=null,this.ssl=null,this.stateUID=null,this.token=null,this.userId=null,this.oAuthInfo=e,this.storage=t,this._init()}isValid(){let e=!1;if(this.oAuthInfo&&this.userId&&(this.refreshToken||this.token))if(null==this.expires&&this.refreshToken)e=!0;else if(this.expires){const t=Date.now();this.expires>t&&(this.expires-t)/1e3>60*this.oAuthInfo.minTimeUntilExpiration&&(e=!0)}return e}save(){if(!this.storage)return!1;const e=this._load(),t=this.oAuthInfo;if(t&&t.authNamespace&&t.portalUrl){let r=e[t.authNamespace];r||(r=e[t.authNamespace]={}),this.appId||(this.appId=t.appId),r[t.portalUrl]={appId:this.appId,codeVerifier:this.codeVerifier,expires:this.expires,refreshToken:this.refreshToken,ssl:this.ssl,stateUID:this.stateUID,token:this.token,userId:this.userId};try{this.storage.setItem(Qe,JSON.stringify(e))}catch(e){return console.warn(e),!1}return!0}return!1}destroy(){const e=this._load(),t=this.oAuthInfo;if(t&&t.appId&&t.portalUrl&&(null==this.expires||this.expires>Date.now())&&(this.refreshToken||this.token)){const e=t.portalUrl.replace(/^http:/i,"https:")+"/sharing/rest/oauth2/revokeToken",r=new FormData;if(r.append("f","json"),r.append("auth_token",this.refreshToken||this.token),r.append("client_id",t.appId),r.append("token_type_hint",this.refreshToken?"refresh_token":"access_token"),"function"==typeof navigator.sendBeacon)navigator.sendBeacon(e,r);else{const t=new XMLHttpRequest;t.open("POST",e),t.send(r)}}if(t&&t.authNamespace&&t.portalUrl&&this.storage){const r=e[t.authNamespace];if(r){delete r[t.portalUrl];try{this.storage.setItem(Qe,JSON.stringify(e))}catch(e){console.log(e)}}}t&&(t._oAuthCred=null,this.oAuthInfo=null)}_init(){const e=this._load(),t=this.oAuthInfo;if(t&&t.authNamespace&&t.portalUrl){let r=e[t.authNamespace];r&&(r=r[t.portalUrl],r&&(this.appId=r.appId,this.codeVerifier=r.codeVerifier,this.expires=r.expires,this.refreshToken=r.refreshToken,this.ssl=r.ssl,this.stateUID=r.stateUID,this.token=r.token,this.userId=r.userId))}}_load(){let e={};if(this.storage){const t=this.storage.getItem(Qe);if(t)try{e=JSON.parse(t)}catch(e){console.warn(e)}}return e}}et.prototype.declaredClass="esri.identity.OAuthCredential";var tt,rt=r(96674);let st=tt=class extends rt.wq{constructor(e){super(e),this._oAuthCred=null,this.appId=null,this.authNamespace="/",this.expiration=20160,this.flowType="auto",this.forceLogin=!1,this.forceUserId=!1,this.locale=null,this.minTimeUntilExpiration=30,this.popup=!1,this.popupCallbackUrl="oauth-callback.html",this.popupWindowFeatures="height=490,width=800,resizable,scrollbars,status",this.portalUrl="https://www.arcgis.com",this.preserveUrlHash=!1,this.userId=null}clone(){return tt.fromJSON(this.toJSON())}};(0,i._)([(0,m.Cb)({json:{write:!0}})],st.prototype,"appId",void 0),(0,i._)([(0,m.Cb)({json:{write:!0}})],st.prototype,"authNamespace",void 0),(0,i._)([(0,m.Cb)({json:{write:!0}})],st.prototype,"expiration",void 0),(0,i._)([(0,m.Cb)({json:{write:!0}})],st.prototype,"flowType",void 0),(0,i._)([(0,m.Cb)({json:{write:!0}})],st.prototype,"forceLogin",void 0),(0,i._)([(0,m.Cb)({json:{write:!0}})],st.prototype,"forceUserId",void 0),(0,i._)([(0,m.Cb)({json:{write:!0}})],st.prototype,"locale",void 0),(0,i._)([(0,m.Cb)({json:{write:!0}})],st.prototype,"minTimeUntilExpiration",void 0),(0,i._)([(0,m.Cb)({json:{write:!0}})],st.prototype,"popup",void 0),(0,i._)([(0,m.Cb)({json:{write:!0}})],st.prototype,"popupCallbackUrl",void 0),(0,i._)([(0,m.Cb)({json:{write:!0}})],st.prototype,"popupWindowFeatures",void 0),(0,i._)([(0,m.Cb)({json:{write:!0}})],st.prototype,"portalUrl",void 0),(0,i._)([(0,m.Cb)({json:{write:!0}})],st.prototype,"preserveUrlHash",void 0),(0,i._)([(0,m.Cb)({json:{write:!0}})],st.prototype,"userId",void 0),st=tt=(0,i._)([(0,g.j)("esri.identity.OAuthInfo")],st);const it=st;let nt=class extends rt.wq{constructor(e){super(e),this.adminTokenServiceUrl=null,this.currentVersion=null,this.hasPortal=null,this.hasServer=null,this.owningSystemUrl=null,this.owningTenant=null,this.server=null,this.shortLivedTokenValidity=null,this.tokenServiceUrl=null,this.webTierAuth=null}};(0,i._)([(0,m.Cb)({json:{write:!0}})],nt.prototype,"adminTokenServiceUrl",void 0),(0,i._)([(0,m.Cb)({json:{write:!0}})],nt.prototype,"currentVersion",void 0),(0,i._)([(0,m.Cb)({json:{write:!0}})],nt.prototype,"hasPortal",void 0),(0,i._)([(0,m.Cb)({json:{write:!0}})],nt.prototype,"hasServer",void 0),(0,i._)([(0,m.Cb)({json:{write:!0}})],nt.prototype,"owningSystemUrl",void 0),(0,i._)([(0,m.Cb)({json:{write:!0}})],nt.prototype,"owningTenant",void 0),(0,i._)([(0,m.Cb)({json:{write:!0}})],nt.prototype,"server",void 0),(0,i._)([(0,m.Cb)({json:{write:!0}})],nt.prototype,"shortLivedTokenValidity",void 0),(0,i._)([(0,m.Cb)({json:{write:!0}})],nt.prototype,"tokenServiceUrl",void 0),(0,i._)([(0,m.Cb)({json:{write:!0}})],nt.prototype,"webTierAuth",void 0),nt=(0,i._)([(0,g.j)("esri.identity.ServerInfo")],nt);const ot=nt;var at=r(19745);const lt={},ht=e=>{const t=new f.R9(e.owningSystemUrl).host,r=new f.R9(e.server).host,s=/.+\.arcgis\.com$/i;return s.test(t)&&s.test(r)},dt=(e,t)=>!!(ht(e)&&t&&t.some((t=>t.test(e.server))));let ct=null,ut=null;try{ct=window.localStorage,ut=window.sessionStorage}catch{}class pt extends l.Z{constructor(){super(),this._portalConfig=globalThis.esriGeowConfig,this.serverInfos=[],this.oAuthInfos=[],this.credentials=[],this._soReqs=[],this._xoReqs=[],this._portals=[],this._defaultOAuthInfo=null,this._defaultTokenValidity=60,this.dialog=null,this.formConstructor=Je,this.tokenValidity=null,this.normalizeWebTierAuth=!1,this._appOrigin="null"!==window.origin?window.origin:window.location.origin,this._appUrlObj=(0,f.mN)(window.location.href),this._busy=null,this._rejectOnPersistedPageShow=!1,this._oAuthLocationParams=null,this._gwTokenUrl="/sharing/rest/generateToken",this._agsRest="/rest/services",this._agsPortal=/\/sharing(\/|$)/i,this._agsAdmin=/(https?:\/\/[^\/]+\/[^\/]+)\/admin\/?(\/.*)?$/i,this._adminSvcs=/\/rest\/admin\/services(\/|$)/i,this._gwDomains=[{regex:/^https?:\/\/www\.arcgis\.com/i,customBaseUrl:"maps.arcgis.com",tokenServiceUrl:"https://www.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/(?:dev|[a-z\d-]+\.mapsdev)\.arcgis\.com/i,customBaseUrl:"mapsdev.arcgis.com",tokenServiceUrl:"https://dev.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/(?:devext|[a-z\d-]+\.mapsdevext)\.arcgis\.com/i,customBaseUrl:"mapsdevext.arcgis.com",tokenServiceUrl:"https://devext.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/(?:qaext|[a-z\d-]+\.mapsqa)\.arcgis\.com/i,customBaseUrl:"mapsqa.arcgis.com",tokenServiceUrl:"https://qaext.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/[a-z\d-]+\.maps\.arcgis\.com/i,customBaseUrl:"maps.arcgis.com",tokenServiceUrl:"https://www.arcgis.com/sharing/rest/generateToken"}],this._legacyFed=[],this._regexSDirUrl=/http.+\/rest\/services\/?/gi,this._regexServerType=/(\/(FeatureServer|GPServer|GeoDataServer|GeocodeServer|GeoenrichmentServer|GeometryServer|GlobeServer|ImageServer|KnowledgeGraphServer|MapServer|MissionServer|MobileServer|NAServer|NetworkDiagramServer|OGCFeatureServer|ParcelFabricServer|RelationalCatalogServer|SceneServer|StreamServer|UtilityNetworkServer|ValidationServer|VectorTileServer|VersionManagementServer|VideoServer)).*/gi,this._gwUser=/http.+\/users\/([^\/]+)\/?.*/i,this._gwItem=/http.+\/items\/([^\/]+)\/?.*/i,this._gwGroup=/http.+\/groups\/([^\/]+)\/?.*/i,this._rePortalTokenSvc=/\/sharing(\/rest)?\/generatetoken/i,this._createDefaultOAuthInfo=!0,this._hasTestedIfAppIsOnPortal=!1,this._getOAuthLocationParams(),window.addEventListener("pageshow",(e=>{this._pageShowHandler(e)}))}registerServers(e){const t=this.serverInfos;t?(e=e.filter((e=>!this.findServerInfo(e.server))),this.serverInfos=t.concat(e)):this.serverInfos=e,e.forEach((e=>{e.owningSystemUrl&&this._portals.push(e.owningSystemUrl),e.hasPortal&&this._portals.push(e.server)}))}registerOAuthInfos(e){const t=this.oAuthInfos;if(t){for(const r of e){const e=this.findOAuthInfo(r.portalUrl);e&&t.splice(t.indexOf(e),1)}this.oAuthInfos=t.concat(e)}else this.oAuthInfos=e}registerToken(e){e={...e};const t=this._sanitizeUrl(e.server),r=this._isServerRsrc(t);let s,i=this.findServerInfo(t),n=!0;i||(i=new ot,i.server=this._getServerInstanceRoot(t),r?i.hasServer=!0:(i.tokenServiceUrl=this._getTokenSvcUrl(t),i.hasPortal=!0),this.registerServers([i])),s=this._findCredential(t),s?(delete e.server,Object.assign(s,e),n=!1):(s=new ft({userId:e.userId,server:i.server,token:e.token,expires:e.expires,ssl:e.ssl,scope:r?"server":"portal"}),s.resources=[t],this.credentials.push(s)),s.emitTokenChange(!1),n||s.refreshServerTokens()}toJSON(){return(0,d.yd)({serverInfos:this.serverInfos.map((e=>e.toJSON())),oAuthInfos:this.oAuthInfos.map((e=>e.toJSON())),credentials:this.credentials.map((e=>e.toJSON()))})}initialize(e){if(!e)return;"string"==typeof e&&(e=JSON.parse(e));const t=e.serverInfos,r=e.oAuthInfos,s=e.credentials;if(t){const e=[];t.forEach((t=>{t.server&&t.tokenServiceUrl&&e.push(t.declaredClass?t:new ot(t))})),e.length&&this.registerServers(e)}if(r){const e=[];r.forEach((t=>{t.appId&&e.push(t.declaredClass?t:new it(t))})),e.length&&this.registerOAuthInfos(e)}s&&s.forEach((e=>{e.server&&e.token&&e.expires&&e.expires>Date.now()&&((e=e.declaredClass?e:new ft(e)).emitTokenChange(),this.credentials.push(e))}))}findServerInfo(e){let t;e=this._sanitizeUrl(e);for(const r of this.serverInfos)if(this._hasSameServerInstance(r.server,e)){t=r;break}return t}findOAuthInfo(e){let t;e=this._sanitizeUrl(e);for(const r of this.oAuthInfos)if(this._hasSameServerInstance(r.portalUrl,e)){t=r;break}return t}findCredential(e,t){if(!e)return;let r;e=this._sanitizeUrl(e);const s=this._isServerRsrc(e)?"server":"portal";if(t){for(const i of this.credentials)if(this._hasSameServerInstance(i.server,e)&&t===i.userId&&i.scope===s){r=i;break}}else for(const t of this.credentials)if(this._hasSameServerInstance(t.server,e)&&-1!==this._getIdenticalSvcIdx(e,t)&&t.scope===s){r=t;break}return r}getCredential(e,t){let r,s,i=!0;t&&(r=!!t.token,s=t.error,i=!1!==t.prompt),t={...t},e=this._sanitizeUrl(e);const n=new AbortController,o=(0,u.hh)();if(t.signal&&(0,u.fu)(t.signal,(()=>{n.abort()})),(0,u.fu)(n,(()=>{o.reject(new a.Z("identity-manager:user-aborted","ABORTED"))})),(0,u.Hc)(n))return o.promise;t.signal=n.signal;const l=this._isAdminResource(e),h=r?this.findCredential(e):null;let d;if(h&&s&&s.details&&498===s.details.httpStatus)h.destroy();else if(h)return d=new a.Z("identity-manager:not-authorized","You are currently signed in as: '"+h.userId+"'. You do not have access to this resource: "+e,{error:s}),o.reject(d),o.promise;const c=this._findCredential(e,t);if(c)return o.resolve(c),o.promise;let p=this.findServerInfo(e);if(p)!p.hasServer&&this._isServerRsrc(e)&&(p._restInfoPms=this._getTokenSvcUrl(e),p.hasServer=!0);else{const t=this._getTokenSvcUrl(e);if(!t)return d=new a.Z("identity-manager:unknown-resource","Unknown resource - could not find token service endpoint."),o.reject(d),o.promise;p=new ot,p.server=this._getServerInstanceRoot(e),"string"==typeof t?(p.tokenServiceUrl=t,p.hasPortal=!0):(p._restInfoPms=t,p.hasServer=!0),this.registerServers([p])}return p.hasPortal&&void 0===p._selfReq&&(i||(0,f.D6)(p.tokenServiceUrl,this._appOrigin)||this._gwDomains.some((e=>e.tokenServiceUrl===p.tokenServiceUrl)))&&(p._selfReq={owningTenant:t&&t.owningTenant,selfDfd:this._getPortalSelf(p.tokenServiceUrl.replace(this._rePortalTokenSvc,"/sharing/rest/portals/self"),e)}),this._enqueue(e,p,t,o,l)}getResourceName(e){return this._isRESTService(e)?e.replace(this._regexSDirUrl,"").replace(this._regexServerType,"")||"":this._gwUser.test(e)&&e.replace(this._gwUser,"$1")||this._gwItem.test(e)&&e.replace(this._gwItem,"$1")||this._gwGroup.test(e)&&e.replace(this._gwGroup,"$1")||""}generateToken(e,t,r){const s=this._rePortalTokenSvc.test(e.tokenServiceUrl),i=new f.R9(this._appOrigin),n=e.shortLivedTokenValidity;let l,h,d,c,u,p,m,g;t&&(g=this.tokenValidity||n||this._defaultTokenValidity,g>n&&n>0&&(g=n)),r&&(l=r.isAdmin,h=r.serverUrl,d=r.token,p=r.signal,m=r.ssl,e.customParameters=r.customParameters),l?c=e.adminTokenServiceUrl:(c=e.tokenServiceUrl,u=new f.R9(c.toLowerCase()),e.webTierAuth&&r?.serverUrl&&!m&&"http"===i.scheme&&((0,f.D6)(i.uri,c,!0)||"https"===u.scheme&&i.host===u.host&&"7080"===i.port&&"7443"===u.port)&&(c=c.replace(/^https:/i,"http:").replace(/:7443/i,":7080")));const _={query:{request:"getToken",username:t?.username,password:t?.password,serverUrl:h,token:d,expiration:g,referer:l||s?this._appOrigin:null,client:l?"referer":null,f:"json",...e.customParameters},method:"post",authMode:"anonymous",useProxy:this._useProxy(e,r),signal:p,...r?.ioArgs};return s||(_.withCredentials=!1),(0,o.default)(c,_).then((r=>{const s=r.data;if(!s||!s.token)return new a.Z("identity-manager:authentication-failed","Unable to generate token");const i=e.server;return lt[i]||(lt[i]={}),t&&(lt[i][t.username]=t.password),s.validity=g,s}))}isBusy(){return!!this._busy}checkSignInStatus(e){return this.checkAppAccess(e,"").then((e=>e.credential))}checkAppAccess(e,t,r){let s=!1;return this.getCredential(e,{prompt:!1}).then((i=>{let n;const l={f:"json"};if("portal"===i.scope)if(t&&(this._doPortalSignIn(e)||r&&r.force))n=i.server+"/sharing/rest/oauth2/validateAppAccess",l.client_id=t;else{if(!i.token)return{credential:i};n=i.server+"/sharing/rest"}else{if(!i.token)return{credential:i};n=i.server+"/rest/services"}return i.token&&(l.token=i.token),(0,o.default)(n,{query:l,authMode:"anonymous"}).then((e=>{if(!1===e.data.valid)throw new a.Z("identity-manager:not-authorized",`You are currently signed in as: '${i.userId}'.`,e.data);return s=!!e.data.viewOnlyUserTypeApp,{credential:i}})).catch((e=>{if("identity-manager:not-authorized"===e.name)throw e;const t=e.details&&e.details.httpStatus;if(498===t)throw i.destroy(),new a.Z("identity-manager:not-authenticated","User is not signed in.");if(400===t)throw new a.Z("identity-manager:invalid-request");return{credential:i}}))})).then((e=>({credential:e.credential,viewOnly:s})))}setOAuthResponseHash(e){e&&("#"===e.charAt(0)&&(e=e.substring(1)),this._processOAuthPopupParams((0,f.u0)(e)))}setOAuthRedirectionHandler(e){this._oAuthRedirectFunc=e}setProtocolErrorHandler(e){this._protocolFunc=e}signIn(e,t,r={}){const s=(0,u.hh)(),i=()=>{l?.remove(),h?.remove(),d?.remove(),o?.destroy(),this.dialog?.destroy(),this.dialog=o=l=h=d=null},n=()=>{i(),this._oAuthDfd=null,s.reject(new a.Z("identity-manager:user-aborted","ABORTED"))};r.signal&&(0,u.fu)(r.signal,(()=>{n()}));let o=new this.formConstructor;o.resource=this.getResourceName(e),o.server=t.server,this.dialog=new Xe,this.dialog.content=o,this.dialog.open=!0,this.emit("dialog-create");let l=o.on("cancel",n),h=(0,p.YP)((()=>this.dialog.open),n),d=o.on("submit",(e=>{this.generateToken(t,e,{isAdmin:r.isAdmin,signal:r.signal}).then((n=>{i();const o=new ft({userId:e.username,server:t.server,token:n.token,expires:null!=n.expires?Number(n.expires):null,ssl:!!n.ssl,isAdmin:r.isAdmin,validity:n.validity});s.resolve(o)})).catch((e=>{o.error=e,o.signingIn=!1}))}));return s.promise}oAuthSignIn(e,t,r,s){this._oAuthDfd=(0,u.hh)();const i=this._oAuthDfd;let n;s?.signal&&(0,u.fu)(s.signal,(()=>{const e=this._oAuthDfd&&this._oAuthDfd.oAuthWin_;e&&!e.closed?e.close():this.dialog&&m()})),i.resUrl_=e,i.sinfo_=t,i.oinfo_=r;const o=r._oAuthCred;if(o.storage&&("authorization-code"===r.flowType||"auto"===r.flowType&&!r.popup&&t.currentVersion>=8.4)){let e=crypto.getRandomValues(new Uint8Array(32));n=(0,f.rS)(e),o.codeVerifier=n,e=crypto.getRandomValues(new Uint8Array(32)),o.stateUID=(0,f.rS)(e),o.save()||(o.codeVerifier=n=null)}else o.codeVerifier=null;let l,h,d,c;this._getCodeChallenge(n).then((i=>{const n=!s||!1!==s.oAuthPopupConfirmation;r.popup&&n?(l=new this.formConstructor,l.oAuthPrompt=!0,l.server=t.server,this.dialog=new Xe,this.dialog.content=l,this.dialog.open=!0,this.emit("dialog-create"),h=l.on("cancel",m),d=(0,p.YP)((()=>this.dialog.open),m),c=l.on("submit",(()=>{g(),this._doOAuthSignIn(e,t,r,i)}))):this._doOAuthSignIn(e,t,r,i)}));const m=()=>{g(),this._oAuthDfd=null,i.reject(new a.Z("identity-manager:user-aborted","ABORTED"))},g=()=>{h?.remove(),d?.remove(),c?.remove(),l?.destroy(),this.dialog?.destroy(),this.dialog=null};return i.promise}destroyCredentials(){this.credentials&&this.credentials.slice().forEach((e=>{e.destroy()})),this.emit("credentials-destroy")}enablePostMessageAuth(e="https://www.arcgis.com/sharing/rest"){this._postMessageAuthHandle&&this._postMessageAuthHandle.remove(),this._postMessageAuthHandle=(0,h.on)(window,"message",(t=>{if((t.origin===this._appOrigin||t.origin.endsWith(".arcgis.com"))&&"arcgis:auth:requestCredential"===t.data?.type){const r=t.source;this.getCredential(e).then((e=>{r.postMessage({type:"arcgis:auth:credential",credential:{expires:e.expires,server:e.server,ssl:e.ssl,token:e.token,userId:e.userId}},t.origin)})).catch((e=>{r.postMessage({type:"arcgis:auth:error",error:{name:e.name,message:e.message}},t.origin)}))}}))}disablePostMessageAuth(){this._postMessageAuthHandle&&(this._postMessageAuthHandle.remove(),this._postMessageAuthHandle=null)}_getOAuthLocationParams(){let e=window.location.hash;if(e){"#"===e.charAt(0)&&(e=e.substring(1));const t=(0,f.u0)(e);let r=!1;if(t.access_token&&t.expires_in&&t.state&&t.hasOwnProperty("username"))try{t.state=JSON.parse(t.state),t.state.portalUrl&&(this._oAuthLocationParams=t,r=!0)}catch{}else if(t.error&&t.error_description&&(console.log("IdentityManager OAuth Error: ",t.error," - ",t.error_description),"access_denied"===t.error&&(r=!0,t.state)))try{t.state=JSON.parse(t.state)}catch{}r&&(window.location.hash=t.state?.hash||"")}let t=window.location.search;if(t){"?"===t.charAt(0)&&(t=t.substring(1));const e=(0,f.u0)(t);let r=!1;if(e.code&&e.state)try{e.state=JSON.parse(e.state),e.state.portalUrl&&e.state.uid&&(this._oAuthLocationParams=e,r=!0)}catch{}else if(e.error&&e.error_description&&(console.log("IdentityManager OAuth Error: ",e.error," - ",e.error_description),"access_denied"===e.error&&(r=!0,e.state)))try{e.state=JSON.parse(e.state)}catch{}if(r){const t={...e};["code","error","error_description","message_code","persist","state"].forEach((e=>{delete t[e]}));const r=(0,f.B7)(t),s=window.location.pathname+(r?`?${r}`:"")+(e.state?.hash||"");window.history.replaceState(window.history.state,"",s)}}}_getOAuthToken(e,t,r,s,i){return e=e.replace(/^http:/i,"https:"),(0,o.default)(`${e}/sharing/rest/oauth2/token`,{authMode:"anonymous",method:"post",query:s&&i?{grant_type:"authorization_code",code:t,redirect_uri:s,client_id:r,code_verifier:i}:{grant_type:"refresh_token",refresh_token:t,client_id:r}}).then((e=>e.data))}_getCodeChallenge(e){if(e&&globalThis.isSecureContext){const t=(new TextEncoder).encode(e);return crypto.subtle.digest("SHA-256",t).then((e=>(0,f.rS)(new Uint8Array(e))))}return Promise.resolve(null)}_pageShowHandler(e){if(e.persisted&&this.isBusy()&&this._rejectOnPersistedPageShow){const e=new a.Z("identity-manager:user-aborted","ABORTED");this._errbackFunc(e)}}_findCredential(e,t){let r,s,i,n,o=-1;const a=t&&t.token,l=t&&t.resource,h=this._isServerRsrc(e)?"server":"portal",d=this.credentials.filter((t=>this._hasSameServerInstance(t.server,e)&&t.scope===h));if(e=l||e,d.length)if(1===d.length){if(r=d[0],i=this.findServerInfo(r.server),s=i&&i.owningSystemUrl,n=s?this.findCredential(s,r.userId):void 0,o=this._getIdenticalSvcIdx(e,r),!a)return-1===o&&r.resources.push(e),this._addResource(e,n),r;-1!==o&&(r.resources.splice(o,1),this._removeResource(e,n))}else{let t,r;if(d.some((a=>(r=this._getIdenticalSvcIdx(e,a),-1!==r&&(t=a,i=this.findServerInfo(t.server),s=i&&i.owningSystemUrl,n=s?this.findCredential(s,t.userId):void 0,o=r,!0)))),a)t&&(t.resources.splice(o,1),this._removeResource(e,n));else if(t)return this._addResource(e,n),t}}_findOAuthInfo(e){let t=this.findOAuthInfo(e);if(!t)for(const r of this.oAuthInfos)if(this._isIdProvider(r.portalUrl,e)){t=r;break}return t}_addResource(e,t){t&&-1===this._getIdenticalSvcIdx(e,t)&&t.resources.push(e)}_removeResource(e,t){let r=-1;t&&(r=this._getIdenticalSvcIdx(e,t),r>-1&&t.resources.splice(r,1))}_useProxy(e,t){return t&&t.isAdmin&&!(0,f.D6)(e.adminTokenServiceUrl,this._appOrigin)||!this._isPortalDomain(e.tokenServiceUrl)&&"10.1"===String(e.currentVersion)&&!(0,f.D6)(e.tokenServiceUrl,this._appOrigin)}_getOrigin(e){const t=new f.R9(e);return t.scheme+"://"+t.host+(null!=t.port?":"+t.port:"")}_getServerInstanceRoot(e){const t=e.toLowerCase();let r=t.indexOf(this._agsRest);return-1===r&&this._isAdminResource(e)&&(r=this._agsAdmin.test(e)?e.replace(this._agsAdmin,"$1").length:e.search(this._adminSvcs)),-1!==r||(0,at.P)(t)||(r=t.indexOf("/sharing")),-1===r&&"/"===t.substr(-1)&&(r=t.length-1),r>-1?e.substring(0,r):e}_hasSameServerInstance(e,t){return"/"===e.substr(-1)&&(e=e.slice(0,-1)),e=e.toLowerCase(),t=this._getServerInstanceRoot(t).toLowerCase(),e=this._normalizeAGOLorgDomain(e),t=this._normalizeAGOLorgDomain(t),(e=e.substr(e.indexOf(":")))===t.substr(t.indexOf(":"))}_normalizeAGOLorgDomain(e){const t=/^https?:\/\/(?:cdn|[a-z\d-]+\.maps)\.arcgis\.com/i,r=/^https?:\/\/(?:cdndev|[a-z\d-]+\.mapsdevext)\.arcgis\.com/i,s=/^https?:\/\/(?:cdnqa|[a-z\d-]+\.mapsqa)\.arcgis\.com/i;return t.test(e)?e=e.replace(t,"https://www.arcgis.com"):r.test(e)?e=e.replace(r,"https://devext.arcgis.com"):s.test(e)&&(e=e.replace(s,"https://qaext.arcgis.com")),e}_sanitizeUrl(e){const t=(n.default.request.proxyUrl||"").toLowerCase(),r=t?e.toLowerCase().indexOf(t+"?"):-1;return-1!==r&&(e=e.substring(r+t.length+1)),e=(0,f.Fv)(e),(0,f.mN)(e).path}_isRESTService(e){return e.includes(this._agsRest)}_isAdminResource(e){return this._agsAdmin.test(e)||this._adminSvcs.test(e)}_isServerRsrc(e){return this._isRESTService(e)||this._isAdminResource(e)}_isIdenticalService(e,t){let r=!1;if(this._isRESTService(e)&&this._isRESTService(t)){const s=this._getSuffix(e).toLowerCase(),i=this._getSuffix(t).toLowerCase();if(r=s===i,!r){const e=/(.*)\/(MapServer|FeatureServer|UtilityNetworkServer).*/gi;r=s.replaceAll(e,"$1")===i.replaceAll(e,"$1")}}else this._isAdminResource(e)&&this._isAdminResource(t)?r=!0:this._isServerRsrc(e)||this._isServerRsrc(t)||!this._isPortalDomain(e)||(r=!0);return r}_isPortalDomain(e){const t=new f.R9(e.toLowerCase()),r=this._portalConfig;let s=this._gwDomains.some((e=>e.regex.test(t.uri)));return!s&&r&&(s=this._hasSameServerInstance(this._getServerInstanceRoot(r.restBaseUrl),t.uri)),s||n.default.portalUrl&&(s=(0,f.D6)(t,n.default.portalUrl,!0)),s||(s=this._portals.some((e=>this._hasSameServerInstance(e,t.uri)))),s=s||this._agsPortal.test(t.path),s}_isIdProvider(e,t){let r=-1,s=-1;this._gwDomains.forEach(((i,n)=>{-1===r&&i.regex.test(e)&&(r=n),-1===s&&i.regex.test(t)&&(s=n)}));let i=!1;if(r>-1&&s>-1&&(0===r||4===r?0!==s&&4!==s||(i=!0):1===r?1!==s&&2!==s||(i=!0):2===r?2===s&&(i=!0):3===r&&3===s&&(i=!0)),!i){const r=this.findServerInfo(t),s=r&&r.owningSystemUrl;s&&ht(r)&&this._isPortalDomain(s)&&this._isIdProvider(e,s)&&(i=!0)}return i}_getIdenticalSvcIdx(e,t){let r=-1;for(let s=0;s<t.resources.length;s++){const i=t.resources[s];if(this._isIdenticalService(e,i)){r=s;break}}return r}_getSuffix(e){return e.replace(this._regexSDirUrl,"").replace(this._regexServerType,"$1")}_getTokenSvcUrl(e){let t,r,s;if(this._isRESTService(e)||this._isAdminResource(e)){const s=this._getServerInstanceRoot(e);return t=s+"/admin/generateToken",r=(0,o.default)(e=s+"/rest/info",{query:{f:"json"}}).then((e=>e.data)),{adminUrl:t,promise:r}}if(this._isPortalDomain(e)){let t="";if(this._gwDomains.some((r=>(r.regex.test(e)&&(t=r.tokenServiceUrl),!!t))),t||this._portals.some((r=>(this._hasSameServerInstance(r,e)&&(t=r+this._gwTokenUrl),!!t))),t||(s=e.toLowerCase().indexOf("/sharing"),-1!==s&&(t=e.substring(0,s)+this._gwTokenUrl)),t||(t=this._getOrigin(e)+this._gwTokenUrl),t){const r=new f.R9(e).port;/^http:\/\//i.test(e)&&"7080"===r&&(t=t.replace(/:7080/i,":7443")),t=t.replace(/http:/i,"https:")}return t}if(e.toLowerCase().includes("premium.arcgisonline.com"))return"https://premium.arcgisonline.com/server/tokens"}_processOAuthResponseParams(e,t,r){const s=t._oAuthCred;if(e.code){const i=s.codeVerifier;return s.codeVerifier=null,s.stateUID=null,s.save(),this._getOAuthToken(r.server,e.code,t.appId,this._getRedirectURI(t,!0),i).then((i=>{const n=new ft({userId:i.username,server:r.server,token:i.access_token,expires:Date.now()+1e3*i.expires_in,ssl:i.ssl,oAuthState:e.state,_oAuthCred:s});return t.userId=n.userId,s.storage=i.persist?ct:ut,s.refreshToken=i.refresh_token,s.token=null,s.expires=i.refresh_token_expires_in?Date.now()+1e3*i.refresh_token_expires_in:null,s.userId=n.userId,s.ssl=n.ssl,s.save(),n}))}const i=new ft({userId:e.username,server:r.server,token:e.access_token,expires:Date.now()+1e3*Number(e.expires_in),ssl:"true"===e.ssl,oAuthState:e.state,_oAuthCred:s});return t.userId=i.userId,s.storage=e.persist?ct:ut,s.refreshToken=null,s.token=i.token,s.expires=i.expires,s.userId=i.userId,s.ssl=i.ssl,s.save(),Promise.resolve(i)}_processOAuthPopupParams(e){const t=this._oAuthDfd;if(this._oAuthDfd=null,t)if(clearInterval(this._oAuthIntervalId),this._oAuthOnPopupHandle?.remove(),e.error){const r="access_denied"===e.error,s=new a.Z(r?"identity-manager:user-aborted":"identity-manager:authentication-failed",r?"ABORTED":"OAuth: "+e.error+" - "+e.error_description);t.reject(s)}else this._processOAuthResponseParams(e,t.oinfo_,t.sinfo_).then((e=>{t.resolve(e)})).catch((e=>{t.reject(e)}))}_setOAuthResponseQueryString(e){e&&("?"===e.charAt(0)&&(e=e.substring(1)),this._processOAuthPopupParams((0,f.u0)(e)))}_exchangeToken(e,t,r){return(0,o.default)(`${e}/sharing/rest/oauth2/exchangeToken`,{authMode:"anonymous",method:"post",query:{f:"json",client_id:t,token:r}}).then((e=>e.data.token))}_getPlatformSelf(e,t){return e=e.replace(/^http:/i,"https:"),(0,o.default)(`${e}/sharing/rest/oauth2/platformSelf`,{authMode:"anonymous",headers:{"X-Esri-Auth-Client-Id":t,"X-Esri-Auth-Redirect-Uri":window.location.href.replace(/#.*$/,"")},method:"post",query:{f:"json",expiration:30},withCredentials:!0}).then((e=>e.data))}_getPortalSelf(e,t){let r;return this._gwDomains.some((t=>(t.regex.test(e)&&(r=t.customBaseUrl),!!r))),r?Promise.resolve({allSSL:!0,currentVersion:"8.4",customBaseUrl:r,portalMode:"multitenant",supportsOAuth:!0}):(this._appOrigin.startsWith("https:")?e=e.replace(/^http:/i,"https:").replace(/:7080/i,":7443"):/^http:/i.test(t)&&(e=e.replace(/^https:/i,"http:").replace(/:7443/i,":7080")),(0,o.default)(e,{query:{f:"json"},authMode:"anonymous",withCredentials:!0}).then((e=>e.data)))}_doPortalSignIn(e){const t=this._portalConfig,r=window.location.href,s=this.findServerInfo(e);return!(!t&&!this._isPortalDomain(r)||!(s?s.hasPortal||s.owningSystemUrl&&this._isPortalDomain(s.owningSystemUrl):this._isPortalDomain(e))||!(this._isIdProvider(r,e)||t&&(this._hasSameServerInstance(this._getServerInstanceRoot(t.restBaseUrl),e)||this._isIdProvider(t.restBaseUrl,e))||(0,f.D6)(r,e,!0)))}_checkProtocol(e,t,r,s){let i=!0;const n=s?t.adminTokenServiceUrl:t.tokenServiceUrl;return n.trim().toLowerCase().startsWith("https:")&&!this._appOrigin.startsWith("https:")&&(0,f.ed)(n)&&(i=!!this._protocolFunc&&!!this._protocolFunc({resourceUrl:e,serverInfo:t}),!i)&&r(new a.Z("identity-manager:aborted","Aborted the Sign-In process to avoid sending password over insecure connection.")),i}_enqueue(e,t,r,s,i,n){return s||(s=(0,u.hh)()),s.resUrl_=e,s.sinfo_=t,s.options_=r,s.admin_=i,s.refresh_=n,this._busy?this._hasSameServerInstance(this._getServerInstanceRoot(e),this._busy.resUrl_)?(this._oAuthDfd&&this._oAuthDfd.oAuthWin_&&this._oAuthDfd.oAuthWin_.focus(),this._soReqs.push(s)):this._xoReqs.push(s):this._doSignIn(s),s.promise}_doSignIn(e){this._busy=e,this._rejectOnPersistedPageShow=!1;const t=t=>{const r=e.options_&&e.options_.resource,s=e.resUrl_,i=e.refresh_;let n=!1;this.credentials.includes(t)||(i&&this.credentials.includes(i)?(i.userId=t.userId,i.token=t.token,i.expires=t.expires,i.validity=t.validity,i.ssl=t.ssl,i.creationTime=t.creationTime,n=!0,t=i):this.credentials.push(t)),t.resources||(t.resources=[]),t.resources.includes(r||s)||t.resources.push(r||s),t.scope=this._isServerRsrc(s)?"server":"portal",t.emitTokenChange();const o=this._soReqs,a={};this._soReqs=[],o.forEach((e=>{if(!this._isIdenticalService(s,e.resUrl_)){const r=this._getSuffix(e.resUrl_);a[r]||(a[r]=!0,t.resources.push(e.resUrl_))}})),e.resolve(t),o.forEach((e=>{this._hasSameServerInstance(this._getServerInstanceRoot(s),e.resUrl_)?e.resolve(t):this._soReqs.push(e)})),this._busy=e.resUrl_=e.sinfo_=e.refresh_=null,n||this.emit("credential-create",{credential:t}),this._soReqs.length?this._doSignIn(this._soReqs.shift()):this._xoReqs.length&&this._doSignIn(this._xoReqs.shift())},r=t=>{e.reject(t),this._busy=e.resUrl_=e.sinfo_=e.refresh_=null,this._soReqs.length?this._doSignIn(this._soReqs.shift()):this._xoReqs.length&&this._doSignIn(this._xoReqs.shift())},s=(i,n,o,l)=>{const d=e.sinfo_,c=!e.options_||!1!==e.options_.prompt,p=d.hasPortal&&this._findOAuthInfo(e.resUrl_);let m,g;if(i)t(new ft({userId:i,server:d.server,token:o||null,expires:null!=l?Number(l):null,ssl:!!n}));else if(window!==window.parent&&this._appUrlObj.query?.["arcgis-auth-origin"]&&this._appUrlObj.query?.["arcgis-auth-portal"]&&this._hasSameServerInstance(this._getServerInstanceRoot(this._appUrlObj.query["arcgis-auth-portal"]),e.resUrl_)){window.parent.postMessage({type:"arcgis:auth:requestCredential"},this._appUrlObj.query["arcgis-auth-origin"]);const s=(0,h.on)(window,"message",(e=>{e.source===window.parent&&e.data&&("arcgis:auth:credential"===e.data.type?(s.remove(),e.data.credential.expires<Date.now()?r(new a.Z("identity-manager:credential-request-failed","Parent application's token has expired.")):t(new ft(e.data.credential))):"arcgis:auth:error"===e.data.type&&(s.remove(),"tokenExpiredError"===e.data.error.name?r(new a.Z("identity-manager:credential-request-failed","Parent application's token has expired.")):r(a.Z.fromJSON(e.data.error))))}));(0,u.fu)(e.options_?.signal,(()=>{s.remove()}))}else if(p){let i=p._oAuthCred;if(!i){const e=new et(p,ct),t=new et(p,ut);e.isValid()&&t.isValid()?e.expires>t.expires?(i=e,t.destroy()):(i=t,e.destroy()):i=e.isValid()?e:t,p._oAuthCred=i}if(i.isValid()){m=new ft({userId:i.userId,server:d.server,token:i.token,expires:i.expires,ssl:i.ssl,_oAuthCred:i});const r=p.appId!==i.appId&&this._doPortalSignIn(e.resUrl_);r||i.refreshToken?(e._pendingDfd=i.refreshToken?this._getOAuthToken(d.server,i.refreshToken,i.appId).then((e=>(m.expires=Date.now()+1e3*e.expires_in,m.token=e.access_token,m))):Promise.resolve(m),e._pendingDfd.then((e=>r?this._exchangeToken(e.server,p.appId,e.token).then((t=>(e.token=t,e))).catch((()=>e)):e)).then((e=>{t(e)})).catch((()=>{i?.destroy(),s()}))):t(m)}else if(this._oAuthLocationParams&&this._hasSameServerInstance(p.portalUrl,this._oAuthLocationParams.state.portalUrl)&&(this._oAuthLocationParams.access_token||this._oAuthLocationParams.code&&this._oAuthLocationParams.state.uid===i.stateUID&&i.codeVerifier)){const s=this._oAuthLocationParams;this._oAuthLocationParams=null,e._pendingDfd=this._processOAuthResponseParams(s,p,d).then((e=>{t(e)})).catch(r)}else{const s=()=>{c?e._pendingDfd=this.oAuthSignIn(e.resUrl_,d,p,e.options_).then(t,r):(g=new a.Z("identity-manager:not-authenticated","User is not signed in."),r(g))};this._doPortalSignIn(e.resUrl_)?e._pendingDfd=this._getPlatformSelf(d.server,p.appId).then((e=>{(0,f.D6)(e.portalUrl,this._appOrigin,!0)?(m=new ft({userId:e.username,server:d.server,expires:Date.now()+1e3*e.expires_in,token:e.token}),t(m)):s()})).catch(s):s()}}else if(c){if(this._checkProtocol(e.resUrl_,d,r,e.admin_)){let s=e.options_;e.admin_&&(s=s||{},s.isAdmin=!0),e._pendingDfd=this.signIn(e.resUrl_,d,s).then(t,r)}}else g=new a.Z("identity-manager:not-authenticated","User is not signed in."),r(g)},i=()=>{const s=e.sinfo_,i=s.owningSystemUrl,n=e.options_;let o,a,l,h;if(n&&(o=n.token,a=n.error,l=n.prompt),h=this._findCredential(i,{token:o,resource:e.resUrl_}),!h)for(const e of this.credentials)if(this._isIdProvider(i,e.server)){h=e;break}if(h){const i=this.findCredential(e.resUrl_,h.userId);if(i)t(i);else if(dt(s,this._legacyFed)){const e=h.toJSON();e.server=s.server,e.resources=null,t(new ft(e))}else(e._pendingDfd=this.generateToken(this.findServerInfo(h.server),null,{serverUrl:e.resUrl_,token:h.token,signal:e.options_.signal,ssl:h.ssl})).then((r=>{t(new ft({userId:h?.userId,server:s.server,token:r.token,expires:null!=r.expires?Number(r.expires):null,ssl:!!r.ssl,isAdmin:e.admin_,validity:r.validity}))}),r)}else this._busy=null,o&&(e.options_.token=null),(e._pendingDfd=this.getCredential(i.replace(/\/?$/,"/sharing"),{resource:e.resUrl_,owningTenant:s.owningTenant,signal:e.options_.signal,token:o,error:a,prompt:l})).then((()=>{this._enqueue(e.resUrl_,e.sinfo_,e.options_,e,e.admin_)}),(t=>{e.resUrl_=e.sinfo_=e.refresh_=null,e.reject(t)}))};this._errbackFunc=r;const n=e.sinfo_.owningSystemUrl,o=this._isServerRsrc(e.resUrl_),l=e.sinfo_._restInfoPms;l?l.promise.then((t=>{const r=e.sinfo_;if(r._restInfoPms){r.adminTokenServiceUrl=r._restInfoPms.adminUrl,r._restInfoPms=null,r.tokenServiceUrl=((0,c.hS)("authInfo.tokenServicesUrl",t)||(0,c.hS)("authInfo.tokenServiceUrl",t)||(0,c.hS)("tokenServiceUrl",t))??null,r.shortLivedTokenValidity=(0,c.hS)("authInfo.shortLivedTokenValidity",t)??null,r.currentVersion=t.currentVersion,r.owningTenant=t.owningTenant;const e=r.owningSystemUrl=t.owningSystemUrl;e&&this._portals.push(e)}o&&r.owningSystemUrl?i():s()}),(()=>{e.sinfo_._restInfoPms=null;const t=new a.Z("identity-manager:server-identification-failed","Unknown resource - could not find token service endpoint.");r(t)})):o&&n?i():e.sinfo_._selfReq?e.sinfo_._selfReq.selfDfd.then((t=>{const r={};let s,i,n,o;return t&&(s=t.user&&t.user.username,r.username=s,r.allSSL=t.allSSL,i=t.supportsOAuth,o=parseFloat(t.currentVersion),"multitenant"===t.portalMode&&(n=t.customBaseUrl),e.sinfo_.currentVersion=o),e.sinfo_.webTierAuth=!!s,s&&this.normalizeWebTierAuth?this.generateToken(e.sinfo_,null,{ssl:r.allSSL}).catch((()=>null)).then((e=>(r.portalToken=e&&e.token,r.tokenExpiration=e&&e.expires,r))):!s&&i&&o>=4.4&&!this._findOAuthInfo(e.resUrl_)?this._generateOAuthInfo({portalUrl:e.sinfo_.server,customBaseUrl:n,owningTenant:e.sinfo_._selfReq.owningTenant}).catch((()=>null)).then((()=>r)):r})).catch((()=>null)).then((t=>{e.sinfo_._selfReq=null,t?s(t.username,t.allSSL,t.portalToken,t.tokenExpiration):s()})):s()}_generateOAuthInfo(e){let t,r=null,s=e.portalUrl;const i=e.customBaseUrl,n=e.owningTenant,a=!this._defaultOAuthInfo&&this._createDefaultOAuthInfo&&!this._hasTestedIfAppIsOnPortal;if(a){r=window.location.href;let e=r.indexOf("?");e>-1&&(r=r.slice(0,e)),e=r.search(/\/(apps|home)\//),r=e>-1?r.slice(0,e):null}return a&&r?(this._hasTestedIfAppIsOnPortal=!0,t=(0,o.default)(r+"/sharing/rest",{query:{f:"json"}}).then((()=>{this._defaultOAuthInfo=new it({appId:"arcgisonline",popupCallbackUrl:r+"/home/oauth-callback.html"})}))):t=Promise.resolve(),t.then((()=>{if(this._defaultOAuthInfo)return s=s.replace(/^http:/i,"https:"),(0,o.default)(s+"/sharing/rest/oauth2/validateRedirectUri",{query:{accountId:n,client_id:this._defaultOAuthInfo.appId,redirect_uri:(0,f.hF)(this._defaultOAuthInfo.popupCallbackUrl),f:"json"}}).then((e=>{if(e.data.valid){const t=this._defaultOAuthInfo.clone();e.data.urlKey&&i?t.portalUrl="https://"+e.data.urlKey.toLowerCase()+"."+i:t.portalUrl=s,t.popup=window!==window.top||!((0,f.D6)(s,this._appOrigin)||this._gwDomains.some((e=>e.regex.test(s)&&e.regex.test(this._appOrigin)))),this.oAuthInfos.push(t)}}))}))}_doOAuthSignIn(e,t,r,s){const i=r._oAuthCred,n={portalUrl:r.portalUrl};!r.popup&&r.preserveUrlHash&&window.location.hash&&(n.hash=window.location.hash),i.stateUID&&(n.uid=i.stateUID);const o={client_id:r.appId,response_type:i.codeVerifier?"code":"token",state:JSON.stringify(n),expiration:r.expiration,locale:r.locale,redirect_uri:this._getRedirectURI(r,!!i.codeVerifier)};r.forceLogin&&(o.force_login=!0),r.forceUserId&&r.userId&&(o.prepopulatedusername=r.userId),!r.popup&&this._doPortalSignIn(e)&&(o.redirectToUserOrgUrl=!0),i.codeVerifier&&(o.code_challenge=s||i.codeVerifier,o.code_challenge_method=s?"S256":"plain");const l=r.portalUrl.replace(/^http:/i,"https:")+"/sharing/oauth2/authorize",d=l+"?"+(0,f.B7)(o);if(r.popup){const e=window.open(d,"esriJSAPIOAuth",r.popupWindowFeatures);if(e)e.focus(),this._oAuthDfd.oAuthWin_=e,this._oAuthIntervalId=setInterval((()=>{if(e.closed){clearInterval(this._oAuthIntervalId),this._oAuthOnPopupHandle.remove();const e=this._oAuthDfd;if(e){const t=new a.Z("identity-manager:user-aborted","ABORTED");e.reject(t)}}}),500),this._oAuthOnPopupHandle=(0,h.on)(window,["arcgis:auth:hash","arcgis:auth:location:search"],(e=>{"arcgis:auth:hash"===e.type?this.setOAuthResponseHash(e.detail):this._setOAuthResponseQueryString(e.detail)}));else{const e=new a.Z("identity-manager:popup-blocked","ABORTED");this._oAuthDfd.reject(e)}}else this._rejectOnPersistedPageShow=!0,this._oAuthRedirectFunc?this._oAuthRedirectFunc({authorizeParams:o,authorizeUrl:l,resourceUrl:e,serverInfo:t,oAuthInfo:r}):window.location.href=d}_getRedirectURI(e,t){const r=window.location.href.replace(/#.*$/,"");if(e.popup)return(0,f.hF)(e.popupCallbackUrl);if(t){const e=(0,f.mN)(r);return e.query&&["code","error","error_description","message_code","persist","state"].forEach((t=>{delete e.query[t]})),(0,f.fl)(e.path,e.query)}return r}}pt.prototype.declaredClass="esri.identity.IdentityManagerBase";let ft=class extends l.Z.EventedAccessor{constructor(e){super(e),this._oAuthCred=null,this.tokenRefreshBuffer=2,e&&e._oAuthCred&&(this._oAuthCred=e._oAuthCred)}initialize(){this.resources=this.resources||[],null==this.creationTime&&(this.creationTime=Date.now())}refreshToken(){const e=s.id.findServerInfo(this.server),t=e&&e.owningSystemUrl,r=!!t&&"server"===this.scope,i=r&&dt(e,s.id._legacyFed),n=e.webTierAuth,o=n&&s.id.normalizeWebTierAuth,a=lt[this.server],l=a&&a[this.userId];let h,d=this.resources&&this.resources[0],c=r?s.id.findServerInfo(t):null,u={username:this.userId,password:l};if(n&&!o)return;r&&!c&&s.id.serverInfos.some((e=>(s.id._isIdProvider(t,e.server)&&(c=e),!!c)));const p=c?s.id.findCredential(c.server,this.userId):null;if(!r||p){if(!i){if(r)h={serverUrl:d,token:p&&p.token,ssl:p&&p.ssl};else if(o)u=null,h={ssl:this.ssl};else{if(!l){let t;return d&&(d=s.id._sanitizeUrl(d),this._enqueued=1,t=s.id._enqueue(d,e,null,null,this.isAdmin,this),t.then((()=>{this._enqueued=0,this.refreshServerTokens()})).catch((()=>{this._enqueued=0}))),t}this.isAdmin&&(h={isAdmin:!0})}return s.id.generateToken(r?c:e,r?null:u,h).then((e=>{this.token=e.token,this.expires=null!=e.expires?Number(e.expires):null,this.creationTime=Date.now(),this.validity=e.validity,this.emitTokenChange(),this.refreshServerTokens()})).catch((()=>{}))}p?.refreshToken()}}refreshServerTokens(){"portal"===this.scope&&s.id.credentials.forEach((e=>{const t=s.id.findServerInfo(e.server),r=t&&t.owningSystemUrl;e!==this&&e.userId===this.userId&&r&&"server"===e.scope&&(s.id._hasSameServerInstance(this.server,r)||s.id._isIdProvider(r,this.server))&&(dt(t,s.id._legacyFed)?(e.token=this.token,e.expires=this.expires,e.creationTime=this.creationTime,e.validity=this.validity,e.emitTokenChange()):e.refreshToken())}))}emitTokenChange(e){clearTimeout(this._refreshTimer);const t=this.server&&s.id.findServerInfo(this.server),r=t&&t.owningSystemUrl,i=r&&s.id.findServerInfo(r);!1===e||r&&"portal"!==this.scope&&(!i||!i.webTierAuth||s.id.normalizeWebTierAuth)||null==this.expires&&null==this.validity||this._startRefreshTimer(),this.emit("token-change")}destroy(){this.userId=this.server=this.token=this.expires=this.validity=this.resources=this.creationTime=null,this._oAuthCred&&(this._oAuthCred.destroy(),this._oAuthCred=null);const e=s.id.credentials.indexOf(this);e>-1&&s.id.credentials.splice(e,1),this.emitTokenChange(),this.emit("destroy")}toJSON(){const e=(0,d.yd)({userId:this.userId,server:this.server,token:this.token,expires:this.expires,validity:this.validity,ssl:this.ssl,isAdmin:this.isAdmin,creationTime:this.creationTime,scope:this.scope}),t=this.resources;return t&&t.length>0&&(e.resources=t.slice()),e}_startRefreshTimer(){clearTimeout(this._refreshTimer);const e=6e4*this.tokenRefreshBuffer,t=2**31-1;let r=(this.validity?this.creationTime+6e4*this.validity:this.expires)-Date.now();r<0?r=0:r>t&&(r=t),this._refreshTimer=setTimeout(this.refreshToken.bind(this),r>e?r-e:r)}};(0,i._)([(0,m.Cb)()],ft.prototype,"creationTime",void 0),(0,i._)([(0,m.Cb)()],ft.prototype,"expires",void 0),(0,i._)([(0,m.Cb)()],ft.prototype,"isAdmin",void 0),(0,i._)([(0,m.Cb)()],ft.prototype,"oAuthState",void 0),(0,i._)([(0,m.Cb)()],ft.prototype,"resources",void 0),(0,i._)([(0,m.Cb)()],ft.prototype,"scope",void 0),(0,i._)([(0,m.Cb)()],ft.prototype,"server",void 0),(0,i._)([(0,m.Cb)()],ft.prototype,"ssl",void 0),(0,i._)([(0,m.Cb)()],ft.prototype,"token",void 0),(0,i._)([(0,m.Cb)()],ft.prototype,"tokenRefreshBuffer",void 0),(0,i._)([(0,m.Cb)()],ft.prototype,"userId",void 0),(0,i._)([(0,m.Cb)()],ft.prototype,"validity",void 0),ft=(0,i._)([(0,g.j)("esri.identity.Credential")],ft);class mt extends pt{}mt.prototype.declaredClass="esri.identity.IdentityManager";const gt=new mt;(0,s.qh)(gt)},2587:(e,t,r)=>{"use strict";r(90344),r(18848),r(940),r(70171);var s=r(94443),i=r(3172),n=r(20102);async function o(e){if(null!=l.fetchBundleAsset)return l.fetchBundleAsset(e);const t=await(0,i.default)(e,{responseType:"text"});return JSON.parse(t.data)}class a{constructor({base:e="",pattern:t,location:r=new URL(window.location.href)}){let s;s="string"==typeof r?e=>new URL(e,new URL(r,window.location.href)).href:r instanceof URL?e=>new URL(e,r).href:r,this.pattern="string"==typeof t?new RegExp(`^${t}`):t,this.getAssetUrl=s,e=e?e.endsWith("/")?e:e+"/":"",this.matcher=new RegExp(`^${e}(?:(.*)/)?(.*)$`)}fetchMessageBundle(e,t){return async function(e,t,r,i){const a=t.exec(r);if(!a)throw new n.Z("esri-intl:invalid-bundle",`Bundle id "${r}" is not compatible with the pattern "${t}"`);const l=a[1]?`${a[1]}/`:"",h=a[2],d=(0,s.Su)(i),c=`${l}${h}.json`,u=d?`${l}${h}_${d}.json`:c;let p;try{p=await o(e(u))}catch(t){if(u===c)throw new n.Z("intl:unknown-bundle",`Bundle "${r}" cannot be loaded`,{error:t});try{p=await o(e(c))}catch(e){throw new n.Z("intl:unknown-bundle",`Bundle "${r}" cannot be loaded`,{error:e})}}return p}(this.getAssetUrl,this.matcher,e,t)}}const l={};var h,d=r(99880);(0,s.tz)((h={pattern:"esri/",location:d.V},new a(h)))},90344:(e,t,r)=>{"use strict";r.d(t,{LJ:()=>b,Xr:()=>_,Ze:()=>S,cZ:()=>h,i$:()=>A,o5:()=>l,o8:()=>k,p6:()=>I});var s=r(35454),i=r(70171),n=r(17126);const o={year:void 0,month:void 0,day:void 0,weekday:void 0},a={hour:void 0,minute:void 0,second:void 0},l={timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone},h={timeZone:"Etc/UTC"},d={year:"numeric",month:"numeric",day:"numeric"},c={year:"numeric",month:"long",day:"numeric"},u={year:"numeric",month:"short",day:"numeric"},p={year:"numeric",month:"long",weekday:"long",day:"numeric"},f={hour:"numeric",minute:"numeric"},m={...f,second:"numeric"},g={"short-date":d,"short-date-short-time":{...d,...f},"short-date-short-time-24":{...d,...f,hour12:!1},"short-date-long-time":{...d,...m},"short-date-long-time-24":{...d,...m,hour12:!1},"short-date-le":d,"short-date-le-short-time":{...d,...f},"short-date-le-short-time-24":{...d,...f,hour12:!1},"short-date-le-long-time":{...d,...m},"short-date-le-long-time-24":{...d,...m,hour12:!1},"long-month-day-year":c,"long-month-day-year-short-time":{...c,...f},"long-month-day-year-short-time-24":{...c,...f,hour12:!1},"long-month-day-year-long-time":{...c,...m},"long-month-day-year-long-time-24":{...c,...m,hour12:!1},"day-short-month-year":u,"day-short-month-year-short-time":{...u,...f},"day-short-month-year-short-time-24":{...u,...f,hour12:!1},"day-short-month-year-long-time":{...u,...m},"day-short-month-year-long-time-24":{...u,...m,hour12:!1},"long-date":p,"long-date-short-time":{...p,...f},"long-date-short-time-24":{...p,...f,hour12:!1},"long-date-long-time":{...p,...m},"long-date-long-time-24":{...p,...m,hour12:!1},"long-month-year":{month:"long",year:"numeric"},"short-month-year":{month:"short",year:"numeric"},year:{year:"numeric"},"short-time":f,"long-time":m},_=(0,s.w)()({shortDate:"short-date",shortDateShortTime:"short-date-short-time",shortDateShortTime24:"short-date-short-time-24",shortDateLongTime:"short-date-long-time",shortDateLongTime24:"short-date-long-time-24",shortDateLE:"short-date-le",shortDateLEShortTime:"short-date-le-short-time",shortDateLEShortTime24:"short-date-le-short-time-24",shortDateLELongTime:"short-date-le-long-time",shortDateLELongTime24:"short-date-le-long-time-24",longMonthDayYear:"long-month-day-year",longMonthDayYearShortTime:"long-month-day-year-short-time",longMonthDayYearShortTime24:"long-month-day-year-short-time-24",longMonthDayYearLongTime:"long-month-day-year-long-time",longMonthDayYearLongTime24:"long-month-day-year-long-time-24",dayShortMonthYear:"day-short-month-year",dayShortMonthYearShortTime:"day-short-month-year-short-time",dayShortMonthYearShortTime24:"day-short-month-year-short-time-24",dayShortMonthYearLongTime:"day-short-month-year-long-time",dayShortMonthYearLongTime24:"day-short-month-year-long-time-24",longDate:"long-date",longDateShortTime:"long-date-short-time",longDateShortTime24:"long-date-short-time-24",longDateLongTime:"long-date-long-time",longDateLongTime24:"long-date-long-time-24",longMonthYear:"long-month-year",shortMonthYear:"short-month-year",year:"year"}),v={ar:"ar-u-nu-latn-ca-gregory"};let y=new WeakMap,w=g["short-date-short-time"];function S(e){return g[e]}function I(e,t){return function(e){const t=e||w;let r=y.get(t);if(!r){const e=(0,i.Kd)(),s=v[e]||e;r=new Intl.DateTimeFormat(s,t),y.set(t,r)}return r}(t).format(e)}function k(e,t=g["short-date"]){return I(new Date(e),{...t,...h,...a})}function b(e,t=g["short-time"]){return I(new Date(`1970-01-01T${e}Z`),{...t,...h,...o})}function A(e,t=g["short-date-short-time"]){const r=n.ou.fromISO(e,{setZone:!0}),s=(0,i.Kd)(),o=v[s]??s;return r.toLocaleString(t,{locale:o})}(0,i.Ze)((()=>{y=new WeakMap,w=g["short-date-short-time"]}))},70171:(e,t,r)=>{"use strict";let s;r.d(t,{Kd:()=>o,Ze:()=>d,qe:()=>l});const i=globalThis.esriConfig?.locale??globalThis.dojoConfig?.locale;function n(){return i??globalThis.navigator?.language??"en"}function o(){return void 0===s&&(s=n()),s}const a=[];function l(e){return a.push(e),{remove(){a.splice(a.indexOf(e),1)}}}const h=[];function d(e){return h.push(e),{remove(){a.splice(h.indexOf(e),1)}}}globalThis.addEventListener?.("languagechange",(function(){const e=n();s!==e&&(s=e,[...h].forEach((t=>{t.call(null,e)})),[...a].forEach((t=>{t.call(null,e)})))}))},94443:(e,t,r)=>{"use strict";r.d(t,{ME:()=>p,Su:()=>f,tz:()=>u});var s=r(20102),i=r(95330),n=r(70171);const o=/^([a-z]{2})(?:[-_]([A-Za-z]{2}))?$/,a={ar:!0,bg:!0,bs:!0,ca:!0,cs:!0,da:!0,de:!0,el:!0,en:!0,es:!0,et:!0,fi:!0,fr:!0,he:!0,hr:!0,hu:!0,id:!0,it:!0,ja:!0,ko:!0,lt:!0,lv:!0,nb:!0,nl:!0,pl:!0,"pt-BR":!0,"pt-PT":!0,ro:!0,ru:!0,sk:!0,sl:!0,sr:!0,sv:!0,th:!0,tr:!0,uk:!0,vi:!0,"zh-CN":!0,"zh-HK":!0,"zh-TW":!0};function l(e){return e in a}const h=[],d=new Map;function c(e){for(const t of d.keys())m(e.pattern,t)&&d.delete(t)}function u(e){return h.includes(e)||(c(e),h.unshift(e)),{remove(){const t=h.indexOf(e);t>-1&&(h.splice(t,1),c(e))}}}async function p(e){const t=(0,n.Kd)();d.has(e)||d.set(e,async function(e,t){const r=[];for(const s of h)if(m(s.pattern,e))try{return await s.fetchMessageBundle(e,t)}catch(e){r.push(e)}if(r.length)throw new s.Z("intl:message-bundle-error",`Errors occurred while loading "${e}"`,{errors:r});throw new s.Z("intl:no-message-bundle-loader",`No loader found for message bundle "${e}"`)}(e,t));const r=d.get(e);return r&&await g.add(r),r}function f(e){if(!o.test(e))return null;const t=o.exec(e);if(null===t)return null;const[,r,s]=t,i=r+(s?"-"+s.toUpperCase():"");return l(i)?i:l(r)?r:null}function m(e,t){return"string"==typeof e?t.startsWith(e):e.test(t)}(0,n.Ze)((()=>{d.clear()}));const g=new class{constructor(){this._numLoading=0,this._dfd=null}async waitForAll(){this._dfd&&await this._dfd.promise}add(e){return this._increase(),e.then((()=>this._decrease()),(()=>this._decrease())),this.waitForAll()}_increase(){this._numLoading++,this._dfd||(this._dfd=(0,i.hh)())}_decrease(){this._numLoading=Math.max(this._numLoading-1,0),this._dfd&&0===this._numLoading&&(this._dfd.resolve(),this._dfd=null)}}},18848:(e,t,r)=>{"use strict";r.d(t,{sh:()=>l,uf:()=>h});var s=r(70586),i=r(70171);const n={ar:"ar-u-nu-latn"};let o=new WeakMap,a={};function l(e={}){const t={};return null!=e.digitSeparator&&(t.useGrouping=e.digitSeparator),null!=e.places&&(t.minimumFractionDigits=t.maximumFractionDigits=e.places),t}function h(e,t){return Object.is(e,-0)&&(e=0),function(e){const t=e||a;if(!o.has(t)){const r=(0,i.Kd)(),s=n[(0,i.Kd)()]||r;o.set(t,new Intl.NumberFormat(s,e))}return(0,s.j0)(o.get(t))}(t).format(e)}(0,i.Ze)((()=>{o=new WeakMap,a={}}))},940:(e,t,r)=>{"use strict";r.d(t,{n:()=>h});var s=r(92604),i=r(78286),n=r(19153),o=r(90344),a=r(18848);const l=s.Z.getLogger("esri.intl.substitute");function h(e,t,r={}){const{format:s={}}=r;return(0,n.gx)(e,(e=>function(e,t,r){let s,n;const o=e.indexOf(":");if(-1===o?s=e.trim():(s=e.slice(0,o).trim(),n=e.slice(o+1).trim()),!s)return"";const a=(0,i.hS)(s,t);if(null==a)return"";const l=(n?r?.[n]:null)??r?.[s];return l?d(a,l):n?c(a,n):u(a)}(e,t,s)))}function d(e,t){switch(t.type){case"date":return(0,o.p6)(e,t.intlOptions);case"number":return(0,a.uf)(e,t.intlOptions);default:return l.warn("missing format descriptor for key {key}"),u(e)}}function c(e,t){switch(t.toLowerCase()){case"dateformat":return(0,o.p6)(e);case"numberformat":return(0,a.uf)(e);default:return l.warn(`inline format is unsupported since 4.12: ${t}`),/^(dateformat|datestring)/i.test(t)?(0,o.p6)(e):/^numberformat/i.test(t)?(0,a.uf)(e):u(e)}}function u(e){switch(typeof e){case"string":return e;case"number":return(0,a.uf)(e);case"boolean":return""+e;default:return e instanceof Date?(0,o.p6)(e):""}}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[7655],{28924:(e,t,i)=>{i.d(t,{Z:()=>r});class r{constructor(){this.declaredRootClass="esri.arcade.featureSetCollection",this._layerById={},this._layerByName={}}add(e,t,i){this._layerById[t]=i,this._layerByName[e]=i}async featureSetByName(e,t=!0,i=["*"]){return void 0===this._layerByName[e]?null:this._layerByName[e]}async featureSetById(e,t=!0,i=["*"]){return void 0===this._layerById[e]?null:this._layerById[e]}castToText(e=!1){return"object, FeatureSetCollection"}}},67651:(e,t,i)=>{i.r(t),i.d(t,{constructAssociationMetaDataFeatureSetFromUrl:()=>se,constructFeatureSet:()=>ie,constructFeatureSetFromPortalItem:()=>ce,constructFeatureSetFromRelationship:()=>ae,constructFeatureSetFromUrl:()=>te,convertToFeatureSet:()=>de,createFeatureSetCollectionFromMap:()=>oe,createFeatureSetCollectionFromService:()=>ue,initialiseMetaDataCache:()=>Y});var r=i(3172),s=i(28924),a=i(84328),n=i(38171),l=i(61363),o=i(70409),u=i(85065),d=i(91136),c=i(90961),h=i(3823),f=i(90658),p=i(36515),_=i(95002),y=i(59987),g=i(41534);class m{constructor(){this.field="",this.tofieldname="",this.typeofstat="MIN",this.workingexpr=null}clone(){const e=new m;return e.field=this.field,e.tofieldname=this.tofieldname,e.typeofstat=this.typeofstat,e.workingexpr=this.workingexpr,e}static parseStatField(e,t,i){const r=new m;r.field=e;const s=g.WhereClause.create(t,i),a=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 y.eS(y.f.MissingStatisticParameters);const t=g.WhereClause.create((0,p.XF)(e.parseTree.args.value[0],f.Bj.Standardised,e.parameters),e.fieldsIndex);return{name:e.parseTree.name,expr:t}}return null}(s);if(null===a)throw new y.eS(y.f.UnsupportedSqlFunction,{function:""});const n=a.name.toUpperCase().trim();if("MIN"===n){if(r.typeofstat="MIN",r.workingexpr=a.expr,null===s)throw new y.eS(y.f.InvalidFunctionParameters,{function:"min"})}else if("MAX"===n){if(r.typeofstat="MAX",r.workingexpr=a.expr,null===s)throw new y.eS(y.f.InvalidFunctionParameters,{function:"max"})}else if("COUNT"===n)r.typeofstat="COUNT",r.workingexpr=a.expr;else if("STDEV"===n){if(r.typeofstat="STDDEV",r.workingexpr=a.expr,null===s)throw new y.eS(y.f.InvalidFunctionParameters,{function:"stdev"})}else if("SUM"===n){if(r.typeofstat="SUM",r.workingexpr=a.expr,null===s)throw new y.eS(y.f.InvalidFunctionParameters,{function:"sum"})}else if("MEAN"===n){if(r.typeofstat="AVG",r.workingexpr=a.expr,null===s)throw new y.eS(y.f.InvalidFunctionParameters,{function:n})}else if("AVG"===n){if(r.typeofstat="AVG",r.workingexpr=a.expr,null===s)throw new y.eS(y.f.InvalidFunctionParameters,{function:"avg"})}else{if("VAR"!==n)throw new y.eS(y.f.UnsupportedSqlFunction,{function:n});if(r.typeofstat="VAR",r.workingexpr=a.expr,null===s)throw new y.eS(y.f.InvalidFunctionParameters,{function:"var"})}return r}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 w=i(44543),S=i(82971),F=i(1231),b=i(99514);function I(e){if(!e)return"COUNT";switch(e.toLowerCase()){case"max":return"MAX";case"var":case"variance":return"VAR";case"avg":case"average":case"mean":return"AVG";case"min":return"MIN";case"sum":return"SUM";case"stdev":case"stddev":return"STDDEV";case"count":return"COUNT"}return"COUNT"}class C extends d.Z{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}async _getSet(e){if(null===this._wset){const t=await this._getFilteredSet("",null,null,null,e);return this._wset=t,this._wset}return this._wset}_isInFeatureSet(){return f.dj.InFeatureSet}_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,i=1;const r=this._parent?this._parent.getFieldsIndex():new b.Z([]);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"+i.toString(),i++)}for(const e of this._config.statsfields){const t=new m;t.field=e.name,t.tofieldname=e.name,t.workingexpr=e.expression instanceof g.WhereClause?e.expression:g.WhereClause.create(e.expression,r),t.typeofstat=I(e.statistic),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 g.WhereClause?e.expression:g.WhereClause.create(e.expression,r)};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}else this.geometryType=f.Qk.point,this.typeIdField="",this.types=null,this.spatialReference=new S.Z({wkid:4326});this.fields=[];const s=new m;s.field=this._nextUniqueName(e),s.tofieldname=this.objectIdField,s.workingexpr=g.WhereClause.create(this._parent.objectIdField,this._parent.getFieldsIndex()),s.typeofstat="MIN",this._decodedStatsfield.push(s);for(const t of this._decodedGroupbyfield){const i=new F.Z;if(t.name=this._nextUniqueName(e),i.name=t.tofieldname,i.alias=i.name,(0,p.y5)(t.expression)){const e=this._parent.getField((0,p.zR)(t.expression,f.Bj.Standardised));if(!e)throw new y.EN(y.H9.AggregationFieldNotFound);t.name=e.name,t.singlefield=e.name,this.phsyicalgroupbyfields.push(e.name),i.type=e.type}else{i.type=this._convertToEsriFieldType((0,p.DT)(t.expression,this._parent.fields));const e=new F.Z;e.name=t.name,e.alias=e.name,this.phsyicalgroupbyfields.push(t.name),this._adaptedFields.push(new o.yN(e,t.expression)),this._candosimplegroupby=!1}this.fields.push(i)}if(this._adaptedFields.length>0)for(const e of this._parent.fields)this._adaptedFields.push(new o.$X(e));for(let t=0;t<this._decodedStatsfield.length;t++){const i=new F.Z;let r=null;const s=this._decodedStatsfield[t];s.field=this._nextUniqueName(e),s.tofieldname===this.objectIdField&&(this._internalObjectIdField=s.field),i.name=s.tofieldname,i.alias=i.name;const a=null!==s.workingexpr&&(0,p.y5)(s.workingexpr)?(0,p.zR)(s.workingexpr,f.Bj.Standardised):"";switch(this._decodedStatsfield[t].typeofstat){case"SUM":if(""!==a){if(r=this._parent.getField(a),!r)throw new y.EN(y.H9.AggregationFieldNotFound);i.type=r.type}else i.type="double";break;case"MIN":case"MAX":if(""!==a){if(r=this._parent.getField(a),!r)throw new y.EN(y.H9.AggregationFieldNotFound);i.type=r.type}else i.type="double";break;case"COUNT":i.type="integer";break;case"STDDEV":case"VAR":case"AVG":if(""!==a&&(r=this._parent.getField(a),!r))throw new y.EN(y.H9.AggregationFieldNotFound);i.type="double"}this.fields.push(i)}}async _canDoAggregates(){return!1}async _getFeatures(e,t,i,r){-1!==t&&this._featureCache[t];const s=this._maxQuery;return!0===this._checkIfNeedToExpandKnownPage(e,s)?(await this._expandPagedSet(e,s,0,0,r),this._getFeatures(e,t,i,r)):"success"}async _getFilteredSet(e,t,i,r,s){if(""!==e)return new c.Z([],[],!0,null);let n=null;const l={ordered:!1,nowhereclause:!1};if(await this._ensureLoaded(),null!==i)for(let e=0;e<this._decodedStatsfield.length;e++)if(!0===(0,p.hq)(i,this._decodedStatsfield[e].tofieldname)){l.nowhereclause=!0,i=null;break}if(null!==r){l.ordered=!0;for(let e=0;e<this._decodedStatsfield.length;e++)if(!0===r.scanForField(this._decodedStatsfield[e].tofieldname)){r=null,l.ordered=!1;break}if(null!==r)for(const e of this._decodedGroupbyfield)if(null===e.singlefield&&!0===r.scanForField(e.tofieldname)){r=null,l.ordered=!1;break}}if(!1!==this._candosimplegroupby&&await this._parent._canDoAggregates(this.phsyicalgroupbyfields,this._decodedStatsfield,"",null,null)){let e=null;i&&(e=this._reformulateWhereClauseWithoutGroupByFields(i));let t=null;r&&(t=this._reformulateOrderClauseWithoutGroupByFields(r));const a=await this._parent._getAggregatePagesDataSourceDefinition(this.phsyicalgroupbyfields,this._decodedStatsfield,"",null,e,t,this._internalObjectIdField);return this._checkCancelled(s),n=!0===l.nowhereclause?new c.Z(a._candidates.slice(0).concat(a._known.slice(0)),[],!0===l.ordered&&a._ordered,this._clonePageDefinition(a.pagesDefinition)):new c.Z(a._candidates.slice(0),a._known.slice(0),!0===l.ordered&&a._ordered,this._clonePageDefinition(a.pagesDefinition)),n}let d=this._parent;if(this._adaptedFields.length>0&&(d=new o.Xx({parentfeatureset:this._parent,adaptedFields:this._adaptedFields,extraFilter:null})),!0===l.nowhereclause)n=new c.Z(["GETPAGES"],[],!1,{aggregatefeaturesetpagedefinition:!0,resultOffset:0,resultRecordCount:this._maxQuery,internal:{fullyResolved:!1,workingItem:null,type:"manual",iterator:null,set:[],subfeatureset:new u.Z({parentfeatureset:d,orderbyclause:new h.Z(this.phsyicalgroupbyfields.join(",")+","+this._parent.objectIdField+" ASC")})}});else{let e=d;if(null!==i){let t=null;i&&(t=this._reformulateWhereClauseWithoutGroupByFields(i)),e=new a.Z({parentfeatureset:e,whereclause:t})}n=new c.Z(["GETPAGES"],[],!1,{aggregatefeaturesetpagedefinition:!0,resultOffset:0,resultRecordCount:this._maxQuery,internal:{fullyResolved:!1,workingItem:null,type:"manual",iterator:null,set:[],subfeatureset:new u.Z({parentfeatureset:e,orderbyclause:new h.Z(this.phsyicalgroupbyfields.join(",")+","+this._parent.objectIdField+" ASC")})}})}return n}_reformulateWhereClauseWithoutStatsFields(e){for(const t of this._decodedStatsfield)e=(0,p.bB)(e,t.tofieldname,(0,p.zR)(t.workingexpr,f.Bj.Standardised),this._parent.getFieldsIndex());return e}_reformulateWhereClauseWithoutGroupByFields(e){for(const t of this._decodedGroupbyfield)t.tofieldname!==t.name&&(e=(0,p.bB)(e,t.tofieldname,(0,p.zR)(t.expression,f.Bj.Standardised),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}_clonePageDefinition(e){return null===e?null:!0===e.aggregatefeaturesetpagedefinition?{aggregatefeaturesetpagedefinition:!0,resultRecordCount:e.resultRecordCount,resultOffset:e.resultOffset,internal:e.internal}:this._parent._clonePageDefinition(e)}async _refineSetBlock(e,t,i){return!0===this._checkIfNeedToExpandCandidatePage(e,this._maxQuery)?(await this._expandPagedSet(e,this._maxQuery,0,0,i),this._refineSetBlock(e,t,i)):(this._checkCancelled(i),e._candidates.length,this._refineKnowns(e,t),e._candidates.length,e._candidates.length,e)}_expandPagedSet(e,t,i,r,s){return this._expandPagedSetFeatureSet(e,t,i,r,s)}async _getPhysicalPage(e,t,i){if(!0===e.pagesDefinition.aggregatefeaturesetpagedefinition)return this._sequentialGetPhysicalItem(e,e.pagesDefinition.resultRecordCount,i,[]);const r=await this._getAgregagtePhysicalPage(e,t,i);for(const e of r){const t={geometry:e.geometry,attributes:{}},i={};for(const t in e.attributes)i[t.toLowerCase()]=e.attributes[t];for(const e of this._decodedGroupbyfield)t.attributes[e.tofieldname]=i[e.name.toLowerCase()];for(const e of this._decodedStatsfield)t.attributes[e.tofieldname]=i[e.field.toLowerCase()];this._featureCache[t.attributes[this.objectIdField]]=new n.Z(t)}return r.length}_sequentialGetPhysicalItem(e,t,i,r){return new Promise(((s,a)=>{null===e.pagesDefinition.internal.iterator&&(e.pagesDefinition.internal.iterator=e.pagesDefinition.internal.subfeatureset.iterator(i)),!0===e.pagesDefinition.internal.fullyResolved||0===t?s(r.length):this._nextAggregateItem(e,t,i,r,(a=>{null===a?s(r.length):(t-=1,s(this._sequentialGetPhysicalItem(e,t,i,r)))}),a)}))}_nextAggregateItem(e,t,i,r,s,a){try{(0,l.Z)(e.pagesDefinition.internal.iterator.next()).then((n=>{if(null===n)if(null!==e.pagesDefinition.internal.workingItem){const t=this._calculateAndAppendAggregateItem(e.pagesDefinition.internal.workingItem);r.push(t),e.pagesDefinition.internal.workingItem=null,e.pagesDefinition.internal.set.push(t.attributes[this.objectIdField]),e.pagesDefinition.internal.fullyResolved=!0,s(null)}else e.pagesDefinition.internal.fullyResolved=!0,s(null);else{const l=this._generateAggregateHash(n);if(null===e.pagesDefinition.internal.workingItem)e.pagesDefinition.internal.workingItem={features:[n],id:l};else{if(l!==e.pagesDefinition.internal.workingItem.id){const i=this._calculateAndAppendAggregateItem(e.pagesDefinition.internal.workingItem);return r.push(i),e.pagesDefinition.internal.workingItem=null,e.pagesDefinition.internal.set.push(i.attributes[this.objectIdField]),t-=1,e.pagesDefinition.internal.workingItem={features:[n],id:l},void s(i)}e.pagesDefinition.internal.workingItem.features.push(n)}this._nextAggregateItem(e,t,i,r,s,a)}}),a)}catch(e){a(e)}}_calculateFieldStat(e,t,i){const r=[];for(let i=0;i<e.features.length;i++)if(null!==t.workingexpr){const s=t.workingexpr.calculateValue(e.features[i]);null!==s&&r.push(s)}else r.push(null);switch(t.typeofstat){case"MIN":i.attributes[t.tofieldname]=(0,_.tj)("min",r,-1);break;case"MAX":i.attributes[t.tofieldname]=(0,_.tj)("max",r,-1);break;case"SUM":i.attributes[t.tofieldname]=(0,_.tj)("sum",r,-1);break;case"COUNT":i.attributes[t.tofieldname]=r.length;break;case"VAR":i.attributes[t.tofieldname]=(0,_.tj)("var",r,-1);break;case"STDDEV":i.attributes[t.tofieldname]=(0,_.tj)("stddev",r,-1);break;case"AVG":i.attributes[t.tofieldname]=(0,_.tj)("avg",r,-1)}return!0}_calculateAndAppendAggregateItem(e){const t={attributes:{},geometry:null};for(const i of this._decodedGroupbyfield){const r=i.singlefield?e.features[0].attributes[i.singlefield]:i.expression.calculateValue(e.features[0]);t.attributes[i.tofieldname]=r}for(const i of this._decodedStatsfield)this._calculateFieldStat(e,i,t);const i=[];for(let r=0;r<this._decodedStatsfield.length;r++)i.push(this._calculateFieldStat(e,this._decodedStatsfield[r],t));return this._featureCache[t.attributes[this.objectIdField]]=new n.Z({attributes:t.attributes,geometry:t.geometry}),t}_generateAggregateHash(e){let t="";for(const i of this._decodedGroupbyfield){const r=i.singlefield?e.attributes[i.singlefield]:i.expression.calculateValue(e);t+=null==r?":":":"+r.toString()}return(0,w.F)(t,w.M.String)}async _stat(){return{calculated:!1}}async getFeatureByObjectId(){return null}static registerAction(){d.Z._featuresetFunctions.groupby=function(e,t){return new C({parentfeatureset:this,groupbyfields:e,statsfields:t})}}}var v=i(53073),D=i(63991),R=i(80692),T=i(40330),k=i(33955),x=i(19238),N=i(20102),A=i(80442),E=i(95330),L=i(2981),O=i(10158),P=i(4967),Z=i(53261),j=i(74889),G=i(14165);function B(e,t){return null!=t&&!0===e.returnGeometry&&"xyFootprint"!==e.multipatchOption&&!e.outStatistics}i(68773),i(67676),i(81271),i(98326),i(56545);var q=i(41818),U=(i(66577),i(16306),i(45091),i(67900),i(8744),i(5396)),M=(i(98732),i(75935)),W=(i(28141),i(58539)),V=i(33586),Q=i(4632);class z extends d.Z{constructor(e){super(e),this.declaredClass="esri.arcade.featureset.sources.FeatureLayerDynamic",this._removeGeometry=!1,this._overrideFields=null,this.formulaCredential=null,this._pageJustIds=!1,this._requestStandardised=!1,this._useDefinitionExpression=!0,this._cachedDateMetaData={},e.spatialReference&&(this.spatialReference=e.spatialReference),this._transparent=!0,this._maxProcessing=1e3,this._layer=e.layer,this._wset=null,void 0!==e.outFields&&(this._overrideFields=e.outFields),void 0!==e.includeGeometry&&(this._removeGeometry=!1===e.includeGeometry)}_maxQueryRate(){return f.tI}end(){return this._layer}optimisePagingFeatureQueries(e){this._pageJustIds=e}get urlQueryPath(){return this._layer.parsedUrl.path||""}convertQueryToLruCacheKey(e){const t=this.urlQueryPath+","+(0,f.hd)(e.toJSON());return(0,w.F)(t,w.M.String)}async loadImpl(){return!0===this._layer.loaded?(this._initialiseFeatureSet(),this):(await this._layer.load(),this._initialiseFeatureSet(),this)}_initialiseFeatureSet(){if(null==this.spatialReference&&(this.spatialReference=this._layer.spatialReference),this.geometryType=this._layer.geometryType,this.fields=this._layer.fields.slice(0),this.hasZ=!0===this._layer?.capabilities?.data?.supportsZ,this.hasM=!0===this._layer?.capabilities?.data?.supportsM,null!==this._overrideFields)if(1===this._overrideFields.length&&"*"===this._overrideFields[0])this._overrideFields=null;else{const e=[],t=[];for(const i of this.fields)if("oid"===i.type)e.push(i),t.push(i.name);else for(const r of this._overrideFields)if(r.toLowerCase()===i.name.toLowerCase()){e.push(i),t.push(i.name);break}this.fields=e,this._overrideFields=t}if(this._layer.source&&this._layer.source.sourceJSON){const e=this._layer.source.sourceJSON.currentVersion;!0===this._layer.source.sourceJSON.useStandardizedQueries?(this._databaseType=f.Bj.StandardisedNoInterval,null!=e&&e>=10.61&&(this._databaseType=f.Bj.Standardised)):null!=e&&(e>=10.5&&(this._databaseType=f.Bj.StandardisedNoInterval,this._requestStandardised=!0),e>=10.61&&(this._databaseType=f.Bj.Standardised))}this.objectIdField=this._layer.objectIdField;for(const e of this.fields)"global-id"===e.type&&(this.globalIdField=e.name);this._layer instanceof Q.default?(this.typeIdField=this._layer.subtypeField??"",this.types=this._layer.subtypes):(this.typeIdField=this._layer.typeIdField??"",this.types=this._layer.types)}_isInFeatureSet(){return f.dj.InFeatureSet}async _refineSetBlock(e){return e}_candidateIdTransform(e){return e}async _getSet(e){if(null===this._wset){await this._ensureLoaded();const t=await this._getFilteredSet("",null,null,null,e);return this._wset=t,t}return this._wset}async _runDatabaseProbe(e){await this._ensureLoaded();const t=new G.Z;this.datesInUnknownTimezone&&(t.timeReferenceUnknownClient=!0),t.where=e.replace("OBJECTID",this._layer.objectIdField);try{return await this._layer.queryObjectIds(t),!0}catch(e){return!1}}_canUsePagination(){return!(!this._layer.capabilities||!this._layer.capabilities.query||!0!==this._layer.capabilities.query.supportsPagination)}_cacheableFeatureSetSourceKey(){return this._layer.url}pbfSupportedForQuery(e){const t=this._layer?.capabilities?.query;return!e.outStatistics&&!0===t?.supportsFormatPBF&&!0===t?.supportsQuantizationEditMode}async queryPBF(e){return e.quantizationParameters={mode:"edit"},(await async function(e,t,r,s){return async function(e,t,r,s){const a=r?.infoFor3D;if(!(B(e,a)&&null!=a&&t.assetMaps&&t.features&&t.features.length))return j.Z.fromJSON(t);const{meshFeatureSetFromJSON:n}=await(0,E.Hl)(Promise.all([i.e(6481),i.e(6459),i.e(7697)]).then(i.bind(i,87697)),s);return n(e,a,t)}(t,await async function(e,t,i,r){const s={...r},a=function(e,t){let i=G.Z.from(e);i.sourceSpatialReference=i.sourceSpatialReference??t?.sourceSpatialReference??null,(t?.gdbVersion||t?.dynamicDataSource)&&(i=i===e?i.clone():i,i.gdbVersion=e.gdbVersion||t.gdbVersion,i.dynamicDataSource=e.dynamicDataSource?O.n.from(e.dynamicDataSource):t.dynamicDataSource);const r=t?.infoFor3D;if(null!=r&&B(e,r)){i=i===e?i.clone():i,i.formatOf3DObjects=null;const{supportedFormats:t,queryFormats:s}=r,a=(0,L.S0)("model/gltf-binary",t)??(0,L.Ow)("glb",t),n=(0,L.S0)("model/gltf+json",t)??(0,L.Ow)("gtlf",t);for(const e of s){if(e===a){i.formatOf3DObjects=e;break}e!==n||i.formatOf3DObjects||(i.formatOf3DObjects=e)}if(!i.formatOf3DObjects)throw new N.Z("query:unsupported-3d-query-formats","Could not find any supported 3D object query format. Only supported formats are 3D_glb and 3D_gltf");if(null==i.outFields||!i.outFields.includes("*")){i=i===e?i.clone():i,null==i.outFields&&(i.outFields=[]);const{originX:t,originY:s,originZ:a,translationX:n,translationY:l,translationZ:o,scaleX:u,scaleY:d,scaleZ:c,rotationX:h,rotationY:f,rotationZ:p,rotationDeg:_}=r.transformFieldRoles;i.outFields.push(t,s,a,n,l,o,u,d,c,h,f,p,_)}}return i}(t,i),n=null!=t.outStatistics?.[0],l=(0,A.Z)("featurelayer-pbf-statistics"),o=!n||l;let u;if("pbf"===i?.format&&o)try{u=await(0,Z.t)(e,a,s)}catch(e){if("query:parsing-pbf"!==e.name)throw e;i.format="json"}return"json"!==i?.format&&o||(u=await(0,P.F)(e,a,s)),function(e,t){if(null!=e&&null!=t)for(const i of t){const t=e.get(i.name);t&&Object.assign(i,t.toJSON())}}(i?.fieldsIndex,u.fields),u}(e,t,r,s),r,s)}(this._layer.parsedUrl,e,{format:"pbf"},{})).unquantize()}get gdbVersion(){return this._layer&&this._layer.capabilities&&this._layer.capabilities.data&&this._layer.capabilities.data.isVersioned?this._layer.gdbVersion||"SDE.DEFAULT":""}nativeCapabilities(){return{title:this._layer.title??"",source:this,canQueryRelated:!0,capabilities:this._layer.capabilities,databaseType:this._databaseType,requestStandardised:this._requestStandardised}}executeQuery(e,t){e.returnZ=this.hasZ,e.returnM=this.hasM;const i="execute"===t?P.e:"executeForCount"===t?q.P:U.G,r="execute"===t&&this.pbfSupportedForQuery(e);let s=null;if(this.recentlyUsedQueries){const t=this.convertQueryToLruCacheKey(e);s=this.recentlyUsedQueries.getFromCache(t),null===s&&(s=!0!==r?i(this._layer.parsedUrl.path,e):this.queryPBF(e),this.recentlyUsedQueries.addToCache(t,s),s=s.catch((e=>{throw this.recentlyUsedQueries?.removeFromCache(t),e})))}return this.featureSetQueryInterceptor&&this.featureSetQueryInterceptor.preLayerQueryCallback({layer:this._layer,query:e,method:t}),null===s&&(s=!0!==r?i(this._layer.parsedUrl.path,e):this.queryPBF(e)),s}async _getFilteredSet(e,t,i,r,s){const a=await this.databaseType();if(this.isTable()&&t&&null!==e&&""!==e)return new c.Z([],[],!0,null);if(this._canUsePagination())return this._getFilteredSetUsingPaging(e,t,i,r,s);let n="",l=!1;null!==r&&this._layer.capabilities&&this._layer.capabilities.query&&!0===this._layer.capabilities.query.supportsOrderBy&&(n=r.constructClause(),l=!0);const o=new G.Z;this.datesInUnknownTimezone&&(o.timeReferenceUnknownClient=!0),o.where=null===i?null===t?"1=1":"":(0,p.zR)(i,a),this._requestStandardised&&(o.sqlFormat="standard"),o.spatialRelationship=this._makeRelationshipEnum(e),o.outSpatialReference=this.spatialReference,o.orderByFields=""!==n?n.split(","):null,o.geometry=null===t?null:t,o.relationParameter=this._makeRelationshipParam(e);let u=await this.executeQuery(o,"executeForIds");return null===u&&(u=[]),this._checkCancelled(s),new c.Z([],u,l,null)}_expandPagedSet(e,t,i,r,s){return this._expandPagedSetFeatureSet(e,t,i,r,s)}async _getFilteredSetUsingPaging(e,t,i,r,s){let a="",n=!1;null!==r&&this._layer.capabilities&&this._layer.capabilities.query&&!0===this._layer.capabilities.query.supportsOrderBy&&(a=r.constructClause(),n=!0);const l=await this.databaseType();let o=null===i?null===t?"1=1":"":(0,p.zR)(i,l);this._layer.definitionExpression&&this._useDefinitionExpression&&(o=""!==o?"(("+this._layer.definitionExpression+") AND ("+o+"))":this._layer.definitionExpression);let u=this._maxQueryRate();const d=this._layer.capabilities?.query.maxRecordCount;null!=d&&d<u&&(u=d);let h=null;if(!0===this._pageJustIds)h=new c.Z([],["GETPAGES"],n,{spatialRel:this._makeRelationshipEnum(e),relationParam:this._makeRelationshipParam(e),outFields:this._layer.objectIdField,resultRecordCount:u,resultOffset:0,geometry:null===t?null:t,where:o,orderByFields:a,returnGeometry:!1,returnIdsOnly:"false",internal:{set:[],lastRetrieved:0,lastPage:0,fullyResolved:!1}});else{let i=!0;!0===this._removeGeometry&&(i=!1);const r=this._overrideFields??this._fieldsIncludingObjectId(["*"]);h=new c.Z([],["GETPAGES"],n,{spatialRel:this._makeRelationshipEnum(e),relationParam:this._makeRelationshipParam(e),outFields:r.join(","),resultRecordCount:u,resultOffset:0,geometry:null===t?null:t,where:o,orderByFields:a,returnGeometry:i,returnIdsOnly:"false",internal:{set:[],lastRetrieved:0,lastPage:0,fullyResolved:!1}})}return await this._expandPagedSet(h,u,0,1,s),h}_clonePageDefinition(e){return null===e?null:!0!==e.groupbypage?{groupbypage:!1,spatialRel:e.spatialRel,relationParam:e.relationParam,outFields:e.outFields,resultRecordCount:e.resultRecordCount,resultOffset:e.resultOffset,geometry:e.geometry,where:e.where,orderByFields:e.orderByFields,returnGeometry:e.returnGeometry,returnIdsOnly:e.returnIdsOnly,internal:e.internal}:{groupbypage:!0,spatialRel:e.spatialRel,relationParam:e.relationParam,outFields:e.outFields,resultRecordCount:e.resultRecordCount,useOIDpagination:e.useOIDpagination,generatedOid:e.generatedOid,groupByFieldsForStatistics:e.groupByFieldsForStatistics,resultOffset:e.resultOffset,outStatistics:e.outStatistics,geometry:e.geometry,where:e.where,orderByFields:e.orderByFields,returnGeometry:e.returnGeometry,returnIdsOnly:e.returnIdsOnly,internal:e.internal}}async _getPhysicalPage(e,t,i){const r=e.pagesDefinition.internal.lastRetrieved,s=r,a=e.pagesDefinition.internal.lastPage,n=new G.Z;this._requestStandardised&&(n.sqlFormat="standard"),this.datesInUnknownTimezone&&(n.timeReferenceUnknownClient=!0),n.spatialRelationship=e.pagesDefinition.spatialRel,n.relationParameter=e.pagesDefinition.relationParam,n.outFields=e.pagesDefinition.outFields.split(","),n.num=e.pagesDefinition.resultRecordCount,n.start=e.pagesDefinition.internal.lastPage,n.geometry=e.pagesDefinition.geometry,n.where=e.pagesDefinition.where,n.orderByFields=""!==e.pagesDefinition.orderByFields?e.pagesDefinition.orderByFields.split(","):null,n.returnGeometry=e.pagesDefinition.returnGeometry,n.outSpatialReference=this.spatialReference;const l=await this.executeQuery(n,"execute");if(this._checkCancelled(i),e.pagesDefinition.internal.lastPage!==a)return"done";const o=this._layer.objectIdField;for(let t=0;t<l.features.length;t++)e.pagesDefinition.internal.set[s+t]=l.features[t].attributes[o];if(!1===this._pageJustIds)for(let e=0;e<l.features.length;e++)this._featureCache[l.features[e].attributes[o]]=l.features[e];return(void 0===l.exceededTransferLimit&&l.features.length!==e.pagesDefinition.resultRecordCount||!1===l.exceededTransferLimit)&&(e.pagesDefinition.internal.fullyResolved=!0),e.pagesDefinition.internal.lastRetrieved=r+l.features.length,e.pagesDefinition.internal.lastPage+=e.pagesDefinition.resultRecordCount,"done"}_fieldsIncludingObjectId(e){if(null===e)return[this.objectIdField];const t=e.slice(0);if(t.includes("*"))return t;let i=!1;for(const e of t)if(e.toUpperCase()===this.objectIdField.toUpperCase()){i=!0;break}return!1===i&&t.push(this.objectIdField),t}async _getFeatures(e,t,i,r){const s=[];if(-1!==t&&void 0===this._featureCache[t]&&s.push(t),!0===this._checkIfNeedToExpandKnownPage(e,this._maxProcessingRate()))return await this._expandPagedSet(e,this._maxProcessingRate(),0,0,r),this._getFeatures(e,t,i,r);let a=0;for(let r=e._lastFetchedIndex;r<e._known.length;r++){if(e._lastFetchedIndex+=1,a++,void 0===this._featureCache[e._known[r]]){let i=!1;if(null!==this._layer._mode&&void 0!==this._layer._mode){const t=this._layer._mode;if(void 0!==t._featureMap[e._known[r]]){const s=t._featureMap[e._known[r]];null!==s&&(i=!0,this._featureCache[e._known[r]]=s)}}if(!1===i&&(e._known[r]!==t&&s.push(e._known[r]),s.length>=this._maxProcessingRate()-1))break}if(a>=i&&0===s.length)break}if(0===s.length)return"success";const n=new G.Z;this._requestStandardised&&(n.sqlFormat="standard"),this.datesInUnknownTimezone&&(n.timeReferenceUnknownClient=!0),n.objectIds=s,n.outFields=this._overrideFields??this._fieldsIncludingObjectId(["*"]),n.returnGeometry=!0,!0===this._removeGeometry&&(n.returnGeometry=!1),n.outSpatialReference=this.spatialReference;const l=await this.executeQuery(n,"execute");if(this._checkCancelled(r),void 0!==l.error)throw new y.EN(y.H9.RequestFailed,{reason:l.error});const o=this._layer.objectIdField;for(let e=0;e<l.features.length;e++)this._featureCache[l.features[e].attributes[o]]=l.features[e];return"success"}async _getDistinctPages(e,t,i,r,s,a,n,l,o){await this._ensureLoaded();const u=await this.databaseType();let d=i.parseTree.column;const c=this._layer.fields??[];for(let e=0;e<c.length;e++)if(c[e].name.toLowerCase()===d.toLowerCase()){d=c[e].name;break}const h=new G.Z;this._requestStandardised&&(h.sqlFormat="standard"),this.datesInUnknownTimezone&&(h.timeReferenceUnknownClient=!0);let f=null===a?null===s?"1=1":"":(0,p.zR)(a,u);this._layer.definitionExpression&&this._useDefinitionExpression&&(f=""!==f?"(("+this._layer.definitionExpression+") AND ("+f+"))":this._layer.definitionExpression),h.where=f,h.spatialRelationship=this._makeRelationshipEnum(r),h.relationParameter=this._makeRelationshipParam(r),h.geometry=null===s?null:s,h.returnDistinctValues=!0,h.returnGeometry=!1,h.outFields=[d];const _=await this.executeQuery(h,"execute");if(this._checkCancelled(o),!_.hasOwnProperty("features"))throw new y.EN(y.H9.InvalidStatResponse);let g=!1;for(let e=0;e<c.length;e++)if(c[e].name===d){"date"===c[e].type&&(g=!0);break}for(let e=0;e<_.features.length;e++){if(g){const t=_.features[e].attributes[d];null!==t?l.push(new Date(t)):l.push(t)}else l.push(_.features[e].attributes[d]);if(l.length>=n)break}return 0===_.features.length?l:_.features.length===this._layer.capabilities?.query.maxRecordCount&&l.length<n?{calculated:!0,result:await this._getDistinctPages(e+_.features.length,t,i,r,s,a,n,l,o)}:l}async _distinctStat(e,t,i,r,s,a,n){return{calculated:!0,result:await this._getDistinctPages(0,e,t,i,r,s,a,[],n)}}isTable(){return this._layer.isTable||null===this._layer.geometryType||"table"===this._layer.type||""===this._layer.geometryType||"esriGeometryNull"===this._layer.geometryType}async _countstat(e,t,i,r){const s=await this.databaseType(),a=new G.Z;if(this._requestStandardised&&(a.sqlFormat="standard"),this.isTable()&&i&&null!==t&&""!==t)return{calculated:!0,result:0};let n=null===r?null===i?"1=1":"":(0,p.zR)(r,s);return this._layer.definitionExpression&&this._useDefinitionExpression&&(n=""!==n?"(("+this._layer.definitionExpression+") AND ("+n+"))":this._layer.definitionExpression),a.where=n,this.datesInUnknownTimezone&&(a.timeReferenceUnknownClient=!0),a.where=n,a.spatialRelationship=this._makeRelationshipEnum(t),a.relationParameter=this._makeRelationshipParam(t),a.geometry=null===i?null:i,a.returnGeometry=!1,{calculated:!0,result:await this.executeQuery(a,"executeForCount")}}async _stats(e,t,i,r,s,a,n){await this._ensureLoaded();const l=this._layer.capabilities&&this._layer.capabilities.query&&!0===this._layer.capabilities.query.supportsSqlExpression,o=this._layer.capabilities&&this._layer.capabilities.query&&!0===this._layer.capabilities.query.supportsStatistics,u=this._layer.capabilities&&this._layer.capabilities.query&&!0===this._layer.capabilities.query.supportsDistinct;if("count"===e)return u?this._countstat(e,i,r,s):{calculated:!1};if(!1===o||!1===(0,p.y5)(t)&&!1===l||!1===t.isStandardized)return""!==i||null!==s?{calculated:!1}:this._manualStat(e,t,a,n);if("distinct"===e)return!1===u?""!==i||null!==s?{calculated:!1}:this._manualStat(e,t,a,n):this._distinctStat(e,t,i,r,s,a,n);const d=await this.databaseType();if(this.isTable()&&r&&null!==i&&""!==i)return{calculated:!0,result:null};const c=new G.Z;this._requestStandardised&&(c.sqlFormat="standard");let h=null===s?null===r?"1=1":"":(0,p.zR)(s,d);this._layer.definitionExpression&&this._useDefinitionExpression&&(h=""!==h?"(("+this._layer.definitionExpression+") AND ("+h+"))":this._layer.definitionExpression),c.where=h,c.spatialRelationship=this._makeRelationshipEnum(i),c.relationParameter=this._makeRelationshipParam(i),c.geometry=null===r?null:r,this.datesInUnknownTimezone&&(c.timeReferenceUnknownClient=!0);const f=new W.Z;f.statisticType=(0,_.g3)(e),f.onStatisticField=(0,p.zR)(t,d),f.outStatisticFieldName="ARCADE_STAT_RESULT",c.returnGeometry=!1;let g="ARCADE_STAT_RESULT";c.outStatistics=[f];const m=await this.executeQuery(c,"execute");if(!m.hasOwnProperty("features")||0===m.features.length)throw new y.EN(y.H9.InvalidStatResponse);let w=!1;const S=m.fields??[];for(let e=0;e<S.length;e++)if("ARCADE_STAT_RESULT"===S[e].name.toUpperCase()){g=S[e].name,"date"===S[e].type&&(w=!0);break}if(w){let e=m.features[0].attributes[g];return null!==e&&(e=new Date(m.features[0].attributes[g])),{calculated:!0,result:e}}return{calculated:!0,result:m.features[0].attributes[g]}}_stat(e,t,i,r,s,a,n){return this._stats(e,t,i,r,s,a,n)}async _canDoAggregates(e,t){await this._ensureLoaded();let i=!1;const r=this._layer.capabilities?.query,s=!0===r?.supportsSqlExpression;if(null!=r&&!0===r.supportsStatistics&&!0===r.supportsOrderBy&&(i=!0),i)for(let e=0;e<t.length-1;e++)(!1===t[e].workingexpr?.isStandardized||!1===(0,p.y5)(t[e].workingexpr)&&!1===s)&&(i=!1);return!1!==i}_makeRelationshipEnum(e){if(e.includes("esriSpatialRelRelation"))return"relation";switch(e){case"esriSpatialRelRelation":return"relation";case"esriSpatialRelIntersects":return"intersects";case"esriSpatialRelContains":return"contains";case"esriSpatialRelOverlaps":return"overlaps";case"esriSpatialRelWithin":return"within";case"esriSpatialRelTouches":return"touches";case"esriSpatialRelCrosses":return"crosses";case"esriSpatialRelEnvelopeIntersects":return"envelope-intersects"}return e}_makeRelationshipParam(e){return e.includes("esriSpatialRelRelation")?e.split(":")[1]:""}async _getAggregatePagesDataSourceDefinition(e,t,i,r,s,a,n){await this._ensureLoaded();const l=await this.databaseType();let o="",u=!1,d=!1;null!==a&&this._layer.capabilities&&this._layer.capabilities.query&&!0===this._layer.capabilities.query.supportsOrderBy&&(o=a.constructClause(),d=!0),this._layer.capabilities&&this._layer.capabilities.query&&!1===this._layer.capabilities.query.supportsPagination&&(d=!1,u=!0,o=this._layer.objectIdField);const h=[];for(let e=0;e<t.length;e++){const i=new W.Z;i.onStatisticField=null!==t[e].workingexpr?(0,p.zR)(t[e].workingexpr,l):"",i.outStatisticFieldName=t[e].field,i.statisticType=t[e].toStatisticsName(),h.push(i)}""===o&&(o=e.join(","));let f=this._maxQueryRate();const _=this._layer.capabilities?.query.maxRecordCount;null!=_&&_<f&&(f=_);let y=null===s?null===r?"1=1":"":(0,p.zR)(s,l);return this._layer.definitionExpression&&this._useDefinitionExpression&&(y=""!==y?"(("+this._layer.definitionExpression+") AND ("+y+"))":this._layer.definitionExpression),new c.Z([],["GETPAGES"],d,{groupbypage:!0,spatialRel:this._makeRelationshipEnum(i),relationParam:this._makeRelationshipParam(i),outFields:["*"],useOIDpagination:u,generatedOid:n,resultRecordCount:f,resultOffset:0,groupByFieldsForStatistics:e,outStatistics:h,geometry:null===r?null:r,where:y,orderByFields:o,returnGeometry:!1,returnIdsOnly:!1,internal:{lastMaxId:-1,set:[],lastRetrieved:0,lastPage:0,fullyResolved:!1}})}async _getAgregagtePhysicalPage(e,t,i){let r=e.pagesDefinition.where;!0===e.pagesDefinition.useOIDpagination&&(r=""!==r?"("+r+") AND ("+e.pagesDefinition.generatedOid+">"+e.pagesDefinition.internal.lastMaxId.toString()+")":e.pagesDefinition.generatedOid+">"+e.pagesDefinition.internal.lastMaxId.toString());const s=e.pagesDefinition.internal.lastRetrieved,a=s,l=e.pagesDefinition.internal.lastPage,o=new G.Z;if(this._requestStandardised&&(o.sqlFormat="standard"),o.where=r,o.spatialRelationship=e.pagesDefinition.spatialRel,o.relationParameter=e.pagesDefinition.relationParam,o.outFields=e.pagesDefinition.outFields,o.outStatistics=e.pagesDefinition.outStatistics,o.geometry=e.pagesDefinition.geometry,o.groupByFieldsForStatistics=e.pagesDefinition.groupByFieldsForStatistics,o.num=e.pagesDefinition.resultRecordCount,o.start=e.pagesDefinition.internal.lastPage,o.returnGeometry=e.pagesDefinition.returnGeometry,this.datesInUnknownTimezone&&(o.timeReferenceUnknownClient=!0),o.orderByFields=""!==e.pagesDefinition.orderByFields?e.pagesDefinition.orderByFields.split(","):null,this.isTable()&&o.geometry&&o.spatialRelationship)return[];const u=await this.executeQuery(o,"execute");if(this._checkCancelled(i),!u.hasOwnProperty("features"))throw new y.EN(y.H9.InvalidStatResponse);const d=[];if(e.pagesDefinition.internal.lastPage!==l)return[];u.features.length>0&&void 0===u.features[0].attributes[e.pagesDefinition.generatedOid]&&(e.pagesDefinition.generatedOid=e.pagesDefinition.generatedOid.toLowerCase());for(let t=0;t<u.features.length;t++)e.pagesDefinition.internal.set[a+t]=u.features[t].attributes[e.pagesDefinition.generatedOid];for(let e=0;e<u.features.length;e++)d.push(new n.Z({attributes:u.features[e].attributes,geometry:null}));return!0===e.pagesDefinition.useOIDpagination?0===u.features.length?e.pagesDefinition.internal.fullyResolved=!0:e.pagesDefinition.internal.lastMaxId=u.features[u.features.length-1].attributes[e.pagesDefinition.generatedOid]:(void 0===u.exceededTransferLimit&&u.features.length!==e.pagesDefinition.resultRecordCount||!1===u.exceededTransferLimit)&&(e.pagesDefinition.internal.fullyResolved=!0),e.pagesDefinition.internal.lastRetrieved=s+u.features.length,e.pagesDefinition.internal.lastPage+=e.pagesDefinition.resultRecordCount,d}static create(e,t,i,r,s){const a=new x.default({url:e,outFields:null===t?["*"]:t});return new z({layer:a,spatialReference:i,lrucache:r,interceptor:s})}relationshipMetaData(){return this._layer&&this._layer.source&&this._layer.source.sourceJSON&&this._layer.source.sourceJSON.relationships?this._layer.source.sourceJSON.relationships:[]}serviceUrl(){return(0,f.US)(this._layer.parsedUrl.path)}async queryAttachments(e,t,i,r,s){const a=this._layer.capabilities;if(a?.data.supportsAttachment&&a?.operations.supportsQueryAttachments){const a={objectIds:[e],returnMetadata:s};(t&&t>0||i&&i>0)&&(a.size=[t&&t>0?t:0,i&&i>0?i:t+1]),r&&r.length>0&&(a.attachmentTypes=r),this.featureSetQueryInterceptor&&this.featureSetQueryInterceptor.preLayerQueryCallback({layer:this._layer,query:a,method:"attachments"});const n=await this._layer.queryAttachments(a),l=[];return n&&n[e]&&n[e].forEach((t=>{const i=this._layer.parsedUrl.path+"/"+e.toString()+"/attachments/"+t.id.toString();let r=null;s&&t.exifInfo&&(r=V.Z.convertJsonToArcade(t.exifInfo,"system",!0)),l.push(new R.Z(t.id,t.name,t.contentType,t.size,i,r,t.keywords??null))})),l}return[]}async queryRelatedFeatures(e){const t={f:"json",relationshipId:e.relationshipId.toString(),definitionExpression:e.where,outFields:e.outFields?.join(","),returnGeometry:e.returnGeometry.toString()};void 0!==e.resultOffset&&null!==e.resultOffset&&(t.resultOffset=e.resultOffset.toString()),void 0!==e.resultRecordCount&&null!==e.resultRecordCount&&(t.resultRecordCount=e.resultRecordCount.toString()),e.orderByFields&&(t.orderByFields=e.orderByFields.join(",")),e.objectIds&&e.objectIds.length>0&&(t.objectIds=e.objectIds.join(",")),e.outSpatialReference&&(t.outSR=JSON.stringify(e.outSpatialReference.toJSON())),this.featureSetQueryInterceptor&&this.featureSetQueryInterceptor.preRequestCallback({layer:this._layer,queryPayload:t,method:"relatedrecords",url:this._layer.parsedUrl.path+"/queryRelatedRecords"});const i=await(0,r.default)(this._layer.parsedUrl.path+"/queryRelatedRecords",{responseType:"json",query:t});if(i.data){const e={},t=i.data;if(t&&t.relatedRecordGroups){const i=t.spatialReference;for(const r of t.relatedRecordGroups){const s=r.objectId,a=[];for(const e of r.relatedRecords){e.geometry&&(e.geometry.spatialReference=i);const t=new n.Z({geometry:e.geometry?(0,k.im)(e.geometry):null,attributes:e.attributes});a.push(t)}e[s]={features:a,exceededTransferLimit:!0===t.exceededTransferLimit}}}return e}throw new y.EN(y.H9.InvalidRequest)}async getFeatureByObjectId(e,t){const i=new G.Z;i.outFields=t,i.returnGeometry=!1,i.outSpatialReference=this.spatialReference,i.where=this.objectIdField+"="+e.toString(),this.datesInUnknownTimezone&&(i.timeReferenceUnknownClient=!0),this.featureSetQueryInterceptor&&this.featureSetQueryInterceptor.preLayerQueryCallback({layer:this._layer,query:i,method:"execute"});const r=await(0,P.e)(this._layer.parsedUrl.path,i);return 1===r.features.length?r.features[0]:null}async getIdentityUser(){await this.load();const e=T.id?.findCredential(this._layer.url);return e?e.userId:null}async getOwningSystemUrl(){await this.load();const e=T.id?.findServerInfo(this._layer.url);if(e)return e.owningSystemUrl;let t=this._layer.url;const i=t.toLowerCase().indexOf("/rest/services");if(t=i>-1?t.substring(0,i):t,t){t+="/rest/info";try{const e=await(0,r.default)(t,{query:{f:"json"}});let i="";return e.data&&e.data.owningSystemUrl&&(i=e.data.owningSystemUrl),i}catch(e){return""}}return""}getDataSourceFeatureSet(){const e=new z({layer:this._layer,spatialReference:this.spatialReference??void 0,outFields:this._overrideFields??void 0,includeGeometry:!this._removeGeometry,lrucache:this.recentlyUsedQueries??void 0,interceptor:this.featureSetQueryInterceptor??void 0});return e._useDefinitionExpression=!1,e}get preferredTimeReference(){return void 0===this._cachedDateMetaData.preferredTimeReference&&(this._cachedDateMetaData.preferredTimeReference=this._layer?.preferredTimeReference?.toJSON()??null),this._cachedDateMetaData.preferredTimeReference}get dateFieldsTimeReference(){return void 0===this._cachedDateMetaData.dateFieldsTimeReference&&(this._cachedDateMetaData.dateFieldsTimeReference=this._layer?.dateFieldsTimeReference?.toJSON()??null),this._cachedDateMetaData.dateFieldsTimeReference}get datesInUnknownTimezone(){return this._layer.datesInUnknownTimezone}get editFieldsInfo(){return void 0===this._cachedDateMetaData.editFieldsInfo&&(this._cachedDateMetaData.editFieldsInfo=this._layer?.editFieldsInfo?.toJSON()??null),this._cachedDateMetaData.editFieldsInfo}get timeInfo(){return void 0===this._cachedDateMetaData.timeInfo&&(this._cachedDateMetaData.timeInfo=this._layer?.timeInfo?.toJSON()??null),this._cachedDateMetaData.timeInfo}}var J=i(17805);class H extends d.Z{constructor(e){super(e),this.declaredClass="esri.arcade.featureset.sources.FeatureLayerRelated",this._findObjectId=-1,this._requestStandardised=!1,this._removeGeometry=!1,this._overrideFields=null,this.featureObjectId=null,e.spatialReference&&(this.spatialReference=e.spatialReference),this._transparent=!0,this._maxProcessing=1e3,this._layer=e.layer,this._wset=null,this._findObjectId=e.objectId,this.featureObjectId=e.objectId,this.relationship=e.relationship,this._relatedLayer=e.relatedLayer,void 0!==e.outFields&&(this._overrideFields=e.outFields),void 0!==e.includeGeometry&&(this._removeGeometry=!1===e.includeGeometry)}_maxQueryRate(){return f.tI}end(){return this._layer}optimisePagingFeatureQueries(){}async loadImpl(){return await Promise.all([this._layer.load(),this._relatedLayer?.load()]),this._initialiseFeatureSet(),this}nativeCapabilities(){return this._relatedLayer.nativeCapabilities()}_initialiseFeatureSet(){if(null==this.spatialReference&&(this.spatialReference=this._layer.spatialReference),this.geometryType=this._relatedLayer.geometryType,this.fields=this._relatedLayer.fields.slice(0),this.hasZ=this._relatedLayer.hasZ,this.hasM=this._relatedLayer.hasM,null!==this._overrideFields)if(1===this._overrideFields.length&&"*"===this._overrideFields[0])this._overrideFields=null;else{const e=[],t=[];for(const i of this.fields)if("oid"===i.type)e.push(i),t.push(i.name);else for(const r of this._overrideFields)if(r.toLowerCase()===i.name.toLowerCase()){e.push(i),t.push(i.name);break}this.fields=e,this._overrideFields=t}const e=this._layer.nativeCapabilities();e&&(this._databaseType=e.databaseType,this._requestStandardised=e.requestStandardised),this.objectIdField=this._relatedLayer.objectIdField,this.globalIdField=this._relatedLayer.globalIdField,this.hasM=this._relatedLayer.supportsM,this.hasZ=this._relatedLayer.supportsZ,this.typeIdField=this._relatedLayer.typeIdField,this.types=this._relatedLayer.types}async databaseType(){return await this._relatedLayer.databaseType(),this._databaseType=this._relatedLayer._databaseType,this._databaseType}isTable(){return this._relatedLayer.isTable()}_isInFeatureSet(){return f.dj.InFeatureSet}_candidateIdTransform(e){return e}async _getSet(e){if(null===this._wset){await this._ensureLoaded();const t=await this._getFilteredSet("",null,null,null,e);return this._wset=t,t}return this._wset}_changeFeature(e){const t={};for(const i of this.fields)t[i.name]=e.attributes[i.name];return new n.Z({geometry:!0===this._removeGeometry?null:e.geometry,attributes:t})}async _getFilteredSet(e,t,i,r,s){if(await this.databaseType(),this.isTable()&&t&&null!==e&&""!==e)return new c.Z([],[],!0,null);const a=this._layer.nativeCapabilities();if(!1===a.canQueryRelated)return new c.Z([],[],!0,null);if(a.capabilities?.queryRelated&&a.capabilities.queryRelated.supportsPagination)return this._getFilteredSetUsingPaging(e,t,i,r,s);let n="",l=!1;null!==r&&a.capabilities&&a.capabilities.queryRelated&&!0===a.capabilities.queryRelated.supportsOrderBy&&(n=r.constructClause(),l=!0);const o=new M.default;o.objectIds=[this._findObjectId];const u=null!==this._overrideFields?this._overrideFields:this._fieldsIncludingObjectId(this._relatedLayer.fields?this._relatedLayer.fields.map((e=>e.name)):["*"]);o.outFields=u,o.relationshipId=this.relationship.id,o.where="1=1";let d=!0;!0===this._removeGeometry&&(d=!1),o.returnGeometry=d,this._requestStandardised&&(o.sqlFormat="standard"),o.outSpatialReference=this.spatialReference,o.orderByFields=""!==n?n.split(","):null;const h=await a.source.queryRelatedFeatures(o);this._checkCancelled(s);const f=h[this._findObjectId]?h[this._findObjectId].features:[],p=[];for(let e=0;e<f.length;e++)this._featureCache[f[e].attributes[this._relatedLayer.objectIdField]]=f[e],p.push(f[e].attributes[this._relatedLayer.objectIdField]);const _=t&&null!==e&&""!==e,y=null!=i;return new c.Z(_||y?p:[],_||y?[]:p,l,null)}_fieldsIncludingObjectId(e){if(null===e)return[this.objectIdField];const t=e.slice(0);if(t.includes("*"))return t;let i=!1;for(const e of t)if(e.toUpperCase()===this.objectIdField.toUpperCase()){i=!0;break}return!1===i&&t.push(this.objectIdField),t}async _getFilteredSetUsingPaging(e,t,i,r,s){let a="",n=!1;const l=this._layer.nativeCapabilities();null!==r&&l&&l.capabilities?.queryRelated&&!0===l.capabilities.queryRelated.supportsOrderBy&&(a=r.constructClause(),n=!0),await this.databaseType();let o=this._maxQueryRate();const u=l.capabilities?.query.maxRecordCount;null!=u&&u<o&&(o=u);const d=t&&null!==e&&""!==e,h=null!=i;let f=null,p=!0;!0===this._removeGeometry&&(p=!1);const _=null!==this._overrideFields?this._overrideFields:this._fieldsIncludingObjectId(this._relatedLayer.fields?this._relatedLayer.fields.map((e=>e.name)):["*"]);return f=new c.Z(d||h?["GETPAGES"]:[],d||h?[]:["GETPAGES"],n,{outFields:_.join(","),resultRecordCount:o,resultOffset:0,objectIds:[this._findObjectId],where:"1=1",orderByFields:a,returnGeometry:p,returnIdsOnly:"false",internal:{set:[],lastRetrieved:0,lastPage:0,fullyResolved:!1}}),await this._expandPagedSet(f,o,0,0,s),f}_expandPagedSet(e,t,i,r,s){return this._expandPagedSetFeatureSet(e,t,i,r,s)}_clonePageDefinition(e){return null===e?null:!0!==e.groupbypage?{groupbypage:!1,outFields:e.outFields,resultRecordCount:e.resultRecordCount,resultOffset:e.resultOffset,where:e.where,objectIds:e.objectIds,orderByFields:e.orderByFields,returnGeometry:e.returnGeometry,returnIdsOnly:e.returnIdsOnly,internal:e.internal}:{groupbypage:!0,outFields:e.outFields,resultRecordCount:e.resultRecordCount,useOIDpagination:e.useOIDpagination,generatedOid:e.generatedOid,groupByFieldsForStatistics:e.groupByFieldsForStatistics,resultOffset:e.resultOffset,outStatistics:e.outStatistics,geometry:e.geometry,where:e.where,objectIds:e.objectIds,orderByFields:e.orderByFields,returnGeometry:e.returnGeometry,returnIdsOnly:e.returnIdsOnly,internal:e.internal}}async _getPhysicalPage(e,t,i){const r=e.pagesDefinition.internal.lastRetrieved,s=r,a=e.pagesDefinition.internal.lastPage,n=this._layer.nativeCapabilities(),l=new M.default;!0===this._requestStandardised&&(l.sqlFormat="standard"),l.relationshipId=this.relationship.id,l.objectIds=e.pagesDefinition.objectIds,l.resultOffset=e.pagesDefinition.internal.lastPage,l.resultRecordCount=e.pagesDefinition.resultRecordCount,l.outFields=e.pagesDefinition.outFields.split(","),l.where=e.pagesDefinition.where,l.orderByFields=""!==e.pagesDefinition.orderByFields?e.pagesDefinition.orderByFields.split(","):null,l.returnGeometry=e.pagesDefinition.returnGeometry,l.outSpatialReference=this.spatialReference;const o=await n.source.queryRelatedFeatures(l);if(this._checkCancelled(i),e.pagesDefinition.internal.lastPage!==a)return 0;const u=o[this._findObjectId]?o[this._findObjectId].features:[];for(let t=0;t<u.length;t++)e.pagesDefinition.internal.set[s+t]=u[t].attributes[this._relatedLayer.objectIdField];for(let e=0;e<u.length;e++)this._featureCache[u[e].attributes[this._relatedLayer.objectIdField]]=u[e];const d=!o[this._findObjectId]||!1===o[this._findObjectId].exceededTransferLimit;return u.length!==e.pagesDefinition.resultRecordCount&&d&&(e.pagesDefinition.internal.fullyResolved=!0),e.pagesDefinition.internal.lastRetrieved=r+u.length,e.pagesDefinition.internal.lastPage+=e.pagesDefinition.resultRecordCount,u.length}async _getFeatures(e,t,i,r){const s=[];-1!==t&&void 0===this._featureCache[t]&&s.push(t);const a=this._maxQueryRate();if(!0===this._checkIfNeedToExpandKnownPage(e,a))return await this._expandPagedSet(e,a,0,0,r),this._getFeatures(e,t,i,r);let n=0;for(let r=e._lastFetchedIndex;r<e._known.length&&(n++,n<=i&&(e._lastFetchedIndex+=1),!("GETPAGES"!==e._known[r]&&void 0===this._featureCache[e._known[r]]&&(e._known[r]!==t&&s.push(e._known[r]),s.length>i)))&&!(n>=i&&0===s.length);r++);if(0===s.length)return"success";throw new y.EN(y.H9.MissingFeatures)}async _refineSetBlock(e,t,i){return e}async _stat(e,t,i,r,s,a,n){return{calculated:!1}}get gdbVersion(){return this._relatedLayer.gdbVersion}async _canDoAggregates(e,t,i,r,s){return!1}relationshipMetaData(){return this._relatedLayer.relationshipMetaData()}serviceUrl(){return this._relatedLayer.serviceUrl()}queryAttachments(e,t,i,r,s){return this._relatedLayer.queryAttachments(e,t,i,r,s)}getFeatureByObjectId(e,t){return this._relatedLayer.getFeatureByObjectId(e,t)}getOwningSystemUrl(){return this._relatedLayer.getOwningSystemUrl()}getIdentityUser(){return this._relatedLayer.getIdentityUser()}getDataSourceFeatureSet(){return this._relatedLayer}get preferredTimeReference(){return this._relatedLayer?.preferredTimeReference??null}get dateFieldsTimeReference(){return this._relatedLayer?.dateFieldsTimeReference??null}get datesInUnknownTimezone(){return this._relatedLayer?.datesInUnknownTimezone}get editFieldsInfo(){return this._relatedLayer?.editFieldsInfo??null}get timeInfo(){return this._relatedLayer?.timeInfo??null}}var K=i(48039),X=i(65791),$=i(15235);function Y(){null===K.Z.applicationCache&&(K.Z.applicationCache=new K.Z)}async function ee(e,t){if(K.Z.applicationCache){const i=K.Z.applicationCache.getLayerInfo(e);if(i){const r=await i;return new x.default({url:e,outFields:t,sourceJSON:r})}const r=new x.default({url:e,outFields:t}),s=(async()=>(await r.load(),r.sourceJSON))();if(K.Z.applicationCache){K.Z.applicationCache.setLayerInfo(e,s);try{return await s,r}catch(t){throw K.Z.applicationCache.clearLayerInfo(e),t}}return await s,r}return new x.default({url:e,outFields:t})}async function te(e,t,i,r,s,a=null){return ie(await ee(e,["*"]),t,i,r,s,a)}function ie(e,t=null,i=null,r=!0,s=null,a=null){if(e instanceof x.default||e instanceof Q.default){const n={layer:e,spatialReference:t,outFields:i,includeGeometry:r,lrucache:s,interceptor:a};return 1==!(e.url||!e.source)?new J.Z(n):new z(n)}return ie(e.parent,t,i,r,s,a).filter(g.WhereClause.create(e.parent.subtypeField+"="+e.subtypeCode.toString(),e.parent?.fieldsIndex))}async function re(e){if(null!==K.Z.applicationCache){const t=K.Z.applicationCache.getLayerInfo(e);if(null!==t)return t}const t=(async()=>{const t=await(0,r.default)(e,{responseType:"json",query:{f:"json"}});if(t.data){const e=t.data;return e.layers||(e.layers=[]),e.tables||(e.tables=[]),e}return{layers:[],tables:[]}})();if(null!==K.Z.applicationCache){K.Z.applicationCache.setLayerInfo(e,t);try{return await t}catch(t){throw K.Z.applicationCache.clearLayerInfo(e),t}}return t}async function se(e,t){const i={metadata:null,networkId:-1,unVersion:3,terminals:[],queryelem:null,layerNameLkp:{},lkp:null},s=await re(e);if(i.metadata=s,s.controllerDatasetLayers&&void 0!==s.controllerDatasetLayers.utilityNetworkLayerId&&null!==s.controllerDatasetLayers.utilityNetworkLayerId){if(s.layers)for(const e of s.layers)i.layerNameLkp[e.id]=e.name;if(s.tables)for(const e of s.tables)i.layerNameLkp[e.id]=e.name;const a=s.controllerDatasetLayers.utilityNetworkLayerId;i.networkId=a;const n=await async function(e,t){const i="QUERYDATAELEMTS:"+t.toString()+":"+e;if(null!==K.Z.applicationCache){const e=K.Z.applicationCache.getLayerInfo(i);if(null!==e)return e}const s=(async()=>{const i=await(0,r.default)(e+"/queryDataElements",{method:"post",responseType:"json",query:{layers:JSON.stringify([t.toString()]),f:"json"}});if(i.data){const e=i.data;if(e.layerDataElements&&e.layerDataElements[0])return e.layerDataElements[0]}throw new y.EN(y.H9.DataElementsNotFound)})();if(null!==K.Z.applicationCache){K.Z.applicationCache.setLayerInfo(i,s);try{return await s}catch(e){throw K.Z.applicationCache.clearLayerInfo(i),e}}return s}(e,a);if(n){i.queryelem=n,i.queryelem&&i.queryelem.dataElement&&void 0!==i.queryelem.dataElement.schemaGeneration&&(i.unVersion=i.queryelem.dataElement.schemaGeneration),i.lkp={},i.queryelem.dataElement.domainNetworks||(i.queryelem.dataElement.domainNetworks=[]);for(const e of i.queryelem.dataElement.domainNetworks){for(const t of e.edgeSources??[]){const e={layerId:t.layerId,sourceId:t.sourceId,className:i.layerNameLkp[t.layerId]??null};e.className&&(i.lkp[e.className]=e)}for(const t of e.junctionSources??[]){const e={layerId:t.layerId,sourceId:t.sourceId,className:i.layerNameLkp[t.layerId]??null};e.className&&(i.lkp[e.className]=e)}}if(i.queryelem.dataElement.terminalConfigurations)for(const e of i.queryelem.dataElement.terminalConfigurations)for(const t of e.terminals)i.terminals.push({terminalId:t.terminalId,terminalName:t.terminalName});const s=await async function(e){if(null!==K.Z.applicationCache){const t=K.Z.applicationCache.getLayerInfo(e);if(null!==t)return t}const t=(async()=>{const t=await(0,r.default)(e,{responseType:"json",query:{f:"json"}});return t.data?t.data:null})();if(null!==K.Z.applicationCache){K.Z.applicationCache.setLayerInfo(e,t);try{return await t}catch(t){throw K.Z.applicationCache.clearLayerInfo(e),t}}return t}(e+"/"+a);if(s.systemLayers&&void 0!==s.systemLayers.associationsTableId&&null!==s.systemLayers.associationsTableId){const r=[];i.unVersion>=4&&(r.push("STATUS"),r.push("PERCENTALONG"));let a=await te(e+"/"+s.systemLayers.associationsTableId.toString(),t,["OBJECTID","FROMNETWORKSOURCEID","TONETWORKSOURCEID","FROMGLOBALID","TOGLOBALID","TOTERMINALID","FROMTERMINALID","ASSOCIATIONTYPE","ISCONTENTVISIBLE","GLOBALID",...r],!1,null,null);return await a.load(),i.unVersion>=4&&(a=a.filter(g.WhereClause.create("STATUS NOT IN (1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21, 22, 23, 25, 26, 27, 28, 29, 30, 31, 33, 34, 35, 36, 37, 38, 39, 41, 42, 43, 44, 45, 46, 47, 49, 50, 51, 52, 53, 54, 55, 57, 58, 59, 60, 61, 62,63)",a.getFieldsIndex())),await a.load()),{lkp:i.lkp,associations:a,unVersion:i.unVersion,terminals:i.terminals}}return{associations:null,unVersion:i.unVersion,lkp:null,terminals:[]}}return{associations:null,unVersion:i.unVersion,lkp:null,terminals:[]}}return{associations:null,unVersion:i.unVersion,lkp:null,terminals:[]}}async function ae(e,t,i,r=null,s=null,a=!0,n=null,l=null){let o=e.serviceUrl();if(!o)return null;o="/"===o.charAt(o.length-1)?o+t.relatedTableId.toString():o+"/"+t.relatedTableId.toString();const u=await te(o,r,s,a,n,l);return new H({layer:e,relatedLayer:u,relationship:t,objectId:i,spatialReference:r,outFields:s,includeGeometry:a,lrucache:n,interceptor:l})}a.Z.registerAction(),C.registerAction(),u.Z.registerAction(),v.Z.registerAction(),D.Z.registerAction();class ne extends s.Z{constructor(e,t=null,i=null,r=null){super(),this._map=e,this._overridespref=t,this._lrucache=i,this._interceptor=r,this._instantLayers=[]}_makeAndAddFeatureSet(e,t=!0,i=null){const r=ie(e,this._overridespref,null===i?["*"]:i,t,this._lrucache,this._interceptor);return this._instantLayers.push({featureset:r,opitem:e,includeGeometry:t,outFields:JSON.stringify(i)}),r}async featureSetByName(e,t=!0,i=null){if(void 0!==this._map.loaded&&void 0!==this._map.load&&!1===this._map.loaded)return await this._map.load(),this.featureSetByName(e,t,i);null===i&&(i=["*"]),i=(i=i.slice(0)).sort();const r=JSON.stringify(i);for(let i=0;i<this._instantLayers.length;i++){const s=this._instantLayers[i];if(s.opitem.title===e&&s.includeGeometry===t&&s.outFields===r)return this._instantLayers[i].featureset}const s=[],a=this._map.allLayers.find((t=>{if(t instanceof x.default){if(t.title===e)return!0}else if(t instanceof Q.default){if(t.title===e)return!0;s.push(t)}return!1}));if(a)return this._makeAndAddFeatureSet(a,t,i);if(this._map.tables){const r=this._map.tables.find((t=>!!(t.title&&t.title===e||t.title&&t.title===e)));if(r){if(r instanceof x.default)return this._makeAndAddFeatureSet(r,t,i);if(r._materializedTable);else{const e=r.outFields?r:{...r,outFields:["*"]};r._materializedTable=new x.default(e)}return await r._materializedTable.load(),this._makeAndAddFeatureSet(r._materializedTable,t,i)}}for(const r of s){if("not-loaded"===r.loadStatus||"loading"===r.loadStatus)try{await r.load()}catch(e){}const s=r.sublayers.find((t=>t.title===e));if(s)return this._makeAndAddFeatureSet(s,t,i)}return null}async featureSetById(e,t=!0,i=["*"]){if(void 0!==this._map.loaded&&void 0!==this._map.load&&!1===this._map.loaded)return await this._map.load(),this.featureSetById(e,t,i);null===i&&(i=["*"]),i=(i=i.slice(0)).sort();const r=JSON.stringify(i);for(let i=0;i<this._instantLayers.length;i++){const s=this._instantLayers[i];if(s.opitem.id===e&&s.includeGeometry===t&&s.outFields===r)return this._instantLayers[i].featureset}const s=[],a=this._map.allLayers.find((t=>{if(t instanceof x.default){if(t.id===e)return!0}else if(t instanceof Q.default){if(t.id===e)return!0;s.push(t)}return!1}));if(a)return this._makeAndAddFeatureSet(a,t,i);if(this._map.tables){const r=this._map.tables.find((t=>t.id===e));if(r){if(r instanceof x.default)return this._makeAndAddFeatureSet(r,t,i);if(r._materializedTable);else{const e={...r,outFields:["*"]};r._materializedTable=new x.default(e)}return await r._materializedTable.load(),this._makeAndAddFeatureSet(r._materializedTable,t,i)}}for(const r of s){if("not-loaded"===r.loadStatus||"loading"===r.loadStatus)try{await r.load()}catch(e){}const s=r.sublayers.find((t=>t.id===e));if(s)return this._makeAndAddFeatureSet(s,t,i)}return null}}class le extends s.Z{constructor(e,t=null,i=null,r=null){super(),this._url=e,this._overridespref=t,this._lrucache=i,this._interceptor=r,this.metadata=null,this._instantLayers=[]}get url(){return this._url}_makeAndAddFeatureSet(e,t=!0,i=null){const r=ie(e,this._overridespref,null===i?["*"]:i,t,this._lrucache);return this._instantLayers.push({featureset:r,opitem:e,includeGeometry:t,outFields:JSON.stringify(i)}),r}async _loadMetaData(){const e=await re(this._url);return this.metadata=e,e}load(){return this._loadMetaData()}clone(){return new le(this._url,this._overridespref,this._lrucache,this._interceptor)}async featureSetByName(e,t=!0,i=null){null===i&&(i=["*"]),i=(i=i.slice(0)).sort();const r=JSON.stringify(i);for(let i=0;i<this._instantLayers.length;i++){const s=this._instantLayers[i];if(s.opitem.title===e&&s.includeGeometry===t&&s.outFields===r)return this._instantLayers[i].featureset}const s=await this._loadMetaData();let a=null;for(const t of s.layers??[])t.name===e&&(a=t);if(!a)for(const t of s.tables??[])t.name===e&&(a=t);if(a){const e=await ee(this._url+"/"+a.id,["*"]);return this._makeAndAddFeatureSet(e,t,i)}return null}async featureSetById(e,t=!0,i=["*"]){null===i&&(i=["*"]),i=(i=i.slice(0)).sort();const r=JSON.stringify(i);e=null!=e?e.toString():"";for(let i=0;i<this._instantLayers.length;i++){const s=this._instantLayers[i];if(s.opitem.id===e&&s.includeGeometry===t&&s.outFields===r)return this._instantLayers[i].featureset}const s=await this._loadMetaData();let a=null;for(const t of s.layers??[])null!==t.id&&void 0!==t.id&&t.id.toString()===e&&(a=t);if(!a)for(const t of s.tables??[])null!==t.id&&void 0!==t.id&&t.id.toString()===e&&(a=t);if(a){const e=await ee(this._url+"/"+a.id,["*"]);return this._makeAndAddFeatureSet(e,t,i)}return null}}function oe(e,t,i=null,r=null){return new ne(e,t,i,r)}function ue(e,t,i=null,r=null){return new le(e,t,i,r)}function de(e,t,i,r,s){if(null===e)return null;if(e instanceof x.default){switch(t){case"datasource":return ie(e,s,e.outFields,!0,i,r).getDataSourceFeatureSet();case"parent":case"root":return ie(e,s,e.outFields,!0,i,r)}return null}if(e instanceof Q.default){switch(t){case"datasource":return ie(e,s,e.outFields,!0,i,r).getDataSourceFeatureSet();case"parent":case"root":return ie(e,s,e.outFields,!0,i,r)}return null}if(e instanceof X.Z){switch(t){case"datasource":return ie(e.parent,s,e.parent.outFields,!0,i,r).getDataSourceFeatureSet();case"parent":case"root":return ie(e,s,e.parent.outFields,!0,i,r)}return null}if(e instanceof d.Z)switch(t){case"datasource":return e.getDataSourceFeatureSet();case"parent":return e;case"root":return e.getRootFeatureSet()}return null}async function ce(e,t,i,r,s,a,n,l=null){if(K.Z.applicationCache){const o=K.Z.applicationCache.getLayerInfo(e+":"+a.url);if(o){const e=await o;return ie(new x.default({url:(0,f.US)(e.url)+"/"+t,outFields:["*"]}),i,r,s,n,l)}}const o=new $.default({id:e,portal:a}).load();K.Z.applicationCache&&K.Z.applicationCache.setLayerInfo(e+":"+a.url,o);try{const e=await o;return ie(new x.default({url:(0,f.US)(e.url??"")+"/"+t,outFields:["*"]}),i,r,s,n,l)}catch(t){throw K.Z.applicationCache&&K.Z.applicationCache.clearLayerInfo(e+":"+a.url),t}}},70409:(e,t,i)=>{i.d(t,{$X:()=>_,QP:()=>y,TO:()=>g,Xx:()=>w,yN:()=>m});var r=i(38171),s=i(48853),a=i(77286),n=i(59987),l=i(91136),o=i(90961),u=i(90658),d=i(36515),c=i(70586),h=i(41534),f=i(82971);class p{constructor(e){this.field=e,this.sqlRewritable=!1}postInitialization(e,t){}}class _ extends p{constructor(e){super(e),this.sqlRewritable=!0}extractValue(e){return e.attributes[this.field.name]}rewriteSql(e){return{rewritten:this.sqlRewritable,where:e}}}class y extends p{constructor(e,t,i){super((0,u.JW)(e)),this.originalField=e,this.sqlRewritable=!0,this.field.name=t,this.field.alias=i}rewriteSql(e,t){return{rewritten:this.sqlRewritable,where:(0,d.bB)(e,this.field.name,this.originalField.name,t.getFieldsIndex())}}extractValue(e){return e.attributes[this.originalField.name]}}class g extends p{constructor(e,t,i){super(e),this.codefield=t,this.lkp=i,this.reverseLkp={};for(const e in i)this.reverseLkp[i[e]]=e;this.sqlRewritable=!0}rewriteSql(e,t){const i=this.evaluateNodeToWhereClause(e.parseTree,u.Bj.Standardised,this.field.name,this.codefield instanceof h.WhereClause?(0,d.zR)(this.codefield,u.Bj.Standardised):this.codefield,e.parameters);return i.includes(g.BADNESS)?{rewritten:!1,where:e}:{rewritten:this.sqlRewritable,where:h.WhereClause.create(i,(0,c.s3)(t._parent).getFieldsIndex())}}evaluateNodeToWhereClause(e,t,i=null,r=null,a){let l,o,u,c;switch(e.type){case"interval":return(0,d.TE)(this.evaluateNodeToWhereClause(e.value,t,i,r,a),e.qualifier,e.op);case"case-expression":{let r=" CASE ";"simple"===e.format&&(r+=this.evaluateNodeToWhereClause(e.operand,t,i,g.BADNESS,a));for(let s=0;s<e.clauses.length;s++)r+=" WHEN "+this.evaluateNodeToWhereClause(e.clauses[s].operand,t,i,g.BADNESS,a)+" THEN "+this.evaluateNodeToWhereClause(e.clauses[s].value,t,i,g.BADNESS,a);return null!==e.else&&(r+=" ELSE "+this.evaluateNodeToWhereClause(e.else,t,i,g.BADNESS,a)),r+=" END ",r}case"parameter":{const i=a[e.value.toLowerCase()];if("string"==typeof i)return"'"+i.toString().replaceAll("'","''")+"'";if(i instanceof Date)return(0,d.oX)(i,t,null);if(i instanceof s.iG)return(0,d.mA)(i,t,null);if(i instanceof Array){const e=[];for(let r=0;r<i.length;r++)"string"==typeof i[r]?e.push("'"+i[r].toString().replaceAll("'","''")+"'"):i[r]instanceof Date?e.push((0,d.oX)(i[r],t,null)):i[r]instanceof s.iG?e.push((0,d.mA)(i[r],t,null)):e.push(i[r].toString());return e}return i.toString()}case"expression-list":o=[];for(const s of e.value)o.push(this.evaluateNodeToWhereClause(s,t,i,r,a));return o;case"unary-expression":return" ( NOT "+this.evaluateNodeToWhereClause(e.expr,t,i,g.BADNESS,a)+" ) ";case"binary-expression":switch(e.operator){case"AND":return" ("+this.evaluateNodeToWhereClause(e.left,t,i,r,a)+" AND "+this.evaluateNodeToWhereClause(e.right,t,i,r,a)+") ";case"OR":return" ("+this.evaluateNodeToWhereClause(e.left,t,i,r,a)+" OR "+this.evaluateNodeToWhereClause(e.right,t,i,r,a)+") ";case"IS":if("null"!==e.right.type)throw new n.eS(n.f.UnsupportedIsRhs);return" ("+this.evaluateNodeToWhereClause(e.left,t,i,r,a)+" IS NULL )";case"ISNOT":if("null"!==e.right.type)throw new n.eS(n.f.UnsupportedIsRhs);return" ("+this.evaluateNodeToWhereClause(e.left,t,i,r,a)+" IS NOT NULL )";case"IN":if(l=[],"expression-list"===e.right.type){if("column-reference"===e.left.type&&e.left.column.toUpperCase()===this.field.name.toUpperCase()){const s=[];let n=!0;for(const t of e.right.value){if("string"!==t.type){n=!1;break}if(void 0===this.lkp[t.value]){n=!1;break}s.push(this.lkp[t.value].toString())}if(n)return" ("+this.evaluateNodeToWhereClause(e.left,t,i,r,a)+" IN ("+s.join(",")+")) "}return l=this.evaluateNodeToWhereClause(e.right,t,i,r,a)," ("+this.evaluateNodeToWhereClause(e.left,t,i,r,a)+" IN ("+l.join(",")+")) "}return c=this.evaluateNodeToWhereClause(e.right,t,i,r,a),c instanceof Array?" ("+this.evaluateNodeToWhereClause(e.left,t,i,r,a)+" IN ("+c.join(",")+")) ":" ("+this.evaluateNodeToWhereClause(e.left,t,i,r,a)+" IN ("+c+")) ";case"NOT IN":if(l=[],"expression-list"===e.right.type){if("column-reference"===e.left.type&&e.left.column.toUpperCase()===this.field.name.toUpperCase()){const s=[];let n=!0;for(const t of e.right.value){if("string"!==t.type){n=!1;break}if(void 0===this.lkp[t.value]){n=!1;break}s.push(this.lkp[t.value].toString())}if(n)return" ("+this.evaluateNodeToWhereClause(e.left,t,i,r,a)+" NOT IN ("+s.join(",")+")) "}return l=this.evaluateNodeToWhereClause(e.right,t,i,r,a)," ("+this.evaluateNodeToWhereClause(e.left,t,i,r,a)+" NOT IN ("+l.join(",")+")) "}return c=this.evaluateNodeToWhereClause(e.right,t,i,r,a),c instanceof Array?" ("+this.evaluateNodeToWhereClause(e.left,t,i,r,a)+" NOT IN ("+c.join(",")+")) ":" ("+this.evaluateNodeToWhereClause(e.left,t,i,r,a)+" NOT IN ("+c+")) ";case"BETWEEN":return u=this.evaluateNodeToWhereClause(e.right,t,i,g.BADNESS,a)," ("+this.evaluateNodeToWhereClause(e.left,t,i,g.BADNESS,a)+" BETWEEN "+u[0]+" AND "+u[1]+" ) ";case"NOTBETWEEN":return u=this.evaluateNodeToWhereClause(e.right,t,i,g.BADNESS,a)," ("+this.evaluateNodeToWhereClause(e.left,t,i,g.BADNESS,a)+" NOT BETWEEN "+u[0]+" AND "+u[1]+" ) ";case"LIKE":return""!==e.escape?" ("+this.evaluateNodeToWhereClause(e.left,t,i,g.BADNESS,a)+" LIKE "+this.evaluateNodeToWhereClause(e.right,t,i,g.BADNESS,a)+" ESCAPE '"+e.escape+"') ":" ("+this.evaluateNodeToWhereClause(e.left,t,i,g.BADNESS,a)+" LIKE "+this.evaluateNodeToWhereClause(e.right,t,i,g.BADNESS,a)+") ";case"NOT LIKE":return""!==e.escape?" ("+this.evaluateNodeToWhereClause(e.left,t,i,g.BADNESS,a)+" NOT LIKE "+this.evaluateNodeToWhereClause(e.right,t,i,g.BADNESS,a)+" ESCAPE '"+e.escape+"') ":" ("+this.evaluateNodeToWhereClause(e.left,t,i,g.BADNESS,a)+" NOT LIKE "+this.evaluateNodeToWhereClause(e.right,t,i,g.BADNESS,a)+") ";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,i,g.BADNESS,a)+" "+e.operator+" "+this.evaluateNodeToWhereClause(e.right,t,i,g.BADNESS,a)+") ";case"<":case">":case">=":case"<=":case"*":case"-":case"+":case"/":case"||":return" ("+this.evaluateNodeToWhereClause(e.left,t,i,g.BADNESS,a)+" "+e.operator+" "+this.evaluateNodeToWhereClause(e.right,t,i,g.BADNESS,a)+") "}case"null":return"null";case"boolean":return!0===e.value?"1":"0";case"string":return"'"+e.value.toString().replaceAll("'","''")+"'";case"timestamp":case"date":return(0,d.oX)(e.value,t,null);case"number":return e.value.toString();case"current-time":return(0,d.vR)("date"===e.mode,t);case"column-reference":return i&&i.toLowerCase()===e.column.toLowerCase()?"("+r+")":e.column;case"data-type":return e.value;case"function":{const r=this.evaluateNodeToWhereClause(e.args,t,i,g.BADNESS,a);return(0,d.fz)(e.name,r,t)}}throw new n.eS(n.f.UnsupportedSyntax,{node:e.type})}extractValue(e){return this.codefield instanceof h.WhereClause?this.reverseLkp[this.codefield.calculateValueCompiled(e)]:this.reverseLkp[e.attributes[this.codefield]]}}g.BADNESS="_!!!_BAD_LKP_!!!!";class m extends p{constructor(e,t){super(e),this._sql=t}rewriteSql(e,t){return{rewritten:!0,where:(0,d.bB)(e,this.field.name,(0,d.zR)(this._sql,u.Bj.Standardised),t.getFieldsIndex())}}extractValue(e){return this._sql.calculateValueCompiled(e)}}class w extends l.Z{static findField(e,t){for(const i of e)if(i.name.toLowerCase()===t.toString().toLowerCase())return i;return null}constructor(e){super(e),this._calcFunc=null,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 f.Z({wkid:4326}),this.objectIdField="",this.globalIdField="",this.geometryType=u.Qk.point,this.typeIdField="",this.types=null),this.fields=[];for(const e of this.adaptedFields)e.postInitialization(this,this._parent),this.fields.push(e.field)}async _getSet(e){if(null===this._wset){await this._ensureLoaded();let t=null;return t=this._extraFilter?await this._getFilteredSet("",null,null,null,e):await(this._parent?._getSet(e)),this._checkCancelled(e),(0,c.O3)(t),this._wset=new o.Z(t._candidates.slice(0),t._known.slice(0),t._ordered,this._clonePageDefinition(t.pagesDefinition)),this._wset}return this._wset}_isInFeatureSet(e){return(0,c.s3)(this._parent)._isInFeatureSet(e)}async _getFeatures(e,t,i,s){const n=[];-1!==t&&void 0===this._featureCache[t]&&n.push(t);const l=this._maxQueryRate();if(!0===this._checkIfNeedToExpandKnownPage(e,l))return await this._expandPagedSet(e,l,0,0,s),this._getFeatures(e,t,i,s);let u=0;for(let r=e._lastFetchedIndex;r<e._known.length&&(u++,u<=i&&(e._lastFetchedIndex+=1),!(void 0===this._featureCache[e._known[r]]&&(e._known[r]!==t&&n.push(e._known[r]),n.length>=l)));r++);if(0===n.length)return"success";e=new o.Z([],n,e._ordered,null);const d=Math.min(n.length,i);await(this._parent?._getFeatures(e,-1,d,s)),this._checkCancelled(s);const c=[];for(let e=0;e<d;e++){const t=this._parent?._featureFromCache(n[e]);void 0!==t&&c.push({geometry:t.geometry,attributes:t.attributes,id:n[e]})}for(const e of c){const t=[];for(const i of this.adaptedFields)t[i.field.name]=i.extractValue(e);this._featureCache[e.id]=new r.Z({attributes:t,geometry:(0,a.r1)(e.geometry)})}return"success"}async _fetchAndRefineFeatures(){throw new n.EN(n.H9.NeverReach)}async _getFilteredSet(e,t,i,r,s){let a=!1;const n=this._reformulateWithoutAdaptions(i);a=n.cannot,i=n.where;let l=!1;if(null!==r){l=!0;const e=[];for(const t of this.adaptedFields)if(!(t instanceof _)&&!0===r.scanForField(t.field.name)){if(!(t instanceof y)){r=null,l=!1;break}e.push({field:t.field.name,newfield:t.originalField.name})}r&&e.length>0&&(r=r.replaceFields(e))}null!==i?null!==this._extraFilter&&(i=(0,d.$e)(this._extraFilter,i)):i=this._extraFilter,await this._ensureLoaded();const u=await(0,c.s3)(this._parent)._getFilteredSet(e,t,i,r,s);let h;return this._checkCancelled(s),h=!0===a?new o.Z(u._candidates.slice(0).concat(u._known.slice(0)),[],!0===l&&u._ordered,this._clonePageDefinition(u.pagesDefinition)):new o.Z(u._candidates.slice(0),u._known.slice(0),!0===l&&u._ordered,this._clonePageDefinition(u.pagesDefinition)),h}_reformulateWithoutAdaptions(e){const t={cannot:!1,where:e};if(null!==e)for(const i of this.adaptedFields)if(!0===(0,d.hq)(e,i.field.name)){const r=i.rewriteSql(e,this);if(!0!==r.rewritten){t.cannot=!0,t.where=null;break}t.where=r.where}return t}async _stat(e,t,i,r,s,a,n){let l=!1,o=this._reformulateWithoutAdaptions(t);if(l=o.cannot,t=o.where,o=this._reformulateWithoutAdaptions(s),l=l||o.cannot,null!==(s=o.where)?null!==this._extraFilter&&(s=(0,d.$e)(this._extraFilter,s)):s=this._extraFilter,!0===l)return null===s&&""===i&&null===r?this._manualStat(e,t,a,n):{calculated:!1};const u=await(0,c.s3)(this._parent)._stat(e,t,i,r,s,a,n);return!1===u.calculated?null===s&&""===i&&null===r?this._manualStat(e,t,a,n):{calculated:!1}:u}async _canDoAggregates(e,t,i,r,s){if(null===this._parent)return!1;for(let t=0;t<e.length;t++)for(const i of this.adaptedFields)if(e[t].toLowerCase()===i.field.name.toLowerCase()&&!(i instanceof _))return!1;const a=[];for(let e=0;e<t.length;e++){const i=t[e];if(null!==i.workingexpr){const e=this._reformulateWithoutAdaptions(i.workingexpr);if(e.cannot)return!1;const t=i.clone();t.workingexpr=e.where,a.push(t)}else a.push(i)}const n=this._reformulateWithoutAdaptions(s);return!n.cannot&&(null!==(s=n.where)?null!==this._extraFilter&&(s=(0,d.$e)(this._extraFilter,s)):s=this._extraFilter,this._parent._canDoAggregates(e,a,i,r,s))}async _getAggregatePagesDataSourceDefinition(e,t,i,r,s,a,l){if(null===this._parent)throw new n.EN(n.H9.NeverReach);const o=[];for(let e=0;e<t.length;e++){const i=t[e];if(null!==i.workingexpr){const e=this._reformulateWithoutAdaptions(i.workingexpr);if(e.cannot)throw new n.EN(n.H9.NeverReach);const t=i.clone();t.workingexpr=e.where,o.push(t)}else o.push(i)}const u=this._reformulateWithoutAdaptions(s);if(u.cannot)throw new n.EN(n.H9.NeverReach);return null!==(s=u.where)?null!==this._extraFilter&&(s=(0,d.$e)(this._extraFilter,s)):s=this._extraFilter,this._parent._getAggregatePagesDataSourceDefinition(e,o,i,r,s,a,l)}}},84328:(e,t,i)=>{i.d(t,{Z:()=>c});var r=i(59987),s=i(91136),a=i(90961),n=i(90658),l=i(36515),o=i(95330),u=i(41534),d=i(82971);class c extends s.Z{constructor(e){super(e),this.declaredClass="esri.arcade.featureset.actions.AttributeFilter",this._maxProcessing=1e3,this._parent=e.parentfeatureset,e.whereclause instanceof u.WhereClause?(this._whereclause=e.whereclause,this._whereClauseFunction=null):(this._whereClauseFunction=e.whereclause,this._whereclause=null)}_initialiseFeatureSet(){null!==this._parent?(this.fields=this._parent.fields.slice(0),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.fields=[],this.typeIdField="",this.objectIdField="",this.globalIdField="",this.spatialReference=new d.Z({wkid:4326}),this.geometryType=n.Qk.point)}async _getSet(e){if(null===this._wset){await this._ensureLoaded();const t=await this._parent._getFilteredSet("",null,this._whereclause,null,e);return this._checkCancelled(e),null!==this._whereClauseFunction?this._wset=new a.Z(t._candidates.slice(0).concat(t._known.slice(0)),[],t._ordered,this._clonePageDefinition(t.pagesDefinition)):this._wset=new a.Z(t._candidates.slice(0),t._known.slice(0),t._ordered,this._clonePageDefinition(t.pagesDefinition)),this._wset}return this._wset}_isInFeatureSet(e){let t=this._parent?._isInFeatureSet(e);return t===n.dj.NotInFeatureSet?t:(t=this._idstates[e],void 0===t?n.dj.Unknown:t)}_getFeature(e,t,i){return this._parent._getFeature(e,t,i)}_getFeatures(e,t,i,r){return this._parent._getFeatures(e,t,i,r)}_featureFromCache(e){return this._parent._featureFromCache(e)}executeWhereClause(e){return this._whereclause?.testFeature(e)??!1}async executeWhereClauseDeferred(e){if(null!==this._whereClauseFunction){const t=this._whereClauseFunction(e);return(0,o.y8)(t),t}return this.executeWhereClause(e)}async _fetchAndRefineFeatures(e,t,i){const r=new a.Z([],e,!1,null),s=Math.min(t,e.length);if(await(this._parent?._getFeatures(r,-1,s,i)),this._checkCancelled(i),null==this._whereClauseFunction){for(let t=0;t<s;t++){const i=this._parent?._featureFromCache(e[t]);!0===this.executeWhereClause(i)?this._idstates[e[t]]=n.dj.InFeatureSet:this._idstates[e[t]]=n.dj.NotInFeatureSet}return"success"}const l=[];for(let t=0;t<s;t++){const i=this._parent?._featureFromCache(e[t]);l.push(await this.executeWhereClauseDeferred(i))}for(let i=0;i<t;i++)!0===l[i]?this._idstates[e[i]]=n.dj.InFeatureSet:this._idstates[e[i]]=n.dj.NotInFeatureSet;return"success"}async _getFilteredSet(e,t,i,r,s){null!==this._whereClauseFunction||(null!==i?null!==this._whereclause&&(i=(0,l.$e)(this._whereclause,i)):i=this._whereclause),await this._ensureLoaded();const n=await this._parent._getFilteredSet(e,t,i,r,s);let o;return this._checkCancelled(s),o=null!==this._whereClauseFunction?new a.Z(n._candidates.slice(0).concat(n._known.slice(0)),[],n._ordered,this._clonePageDefinition(n.pagesDefinition)):new a.Z(n._candidates.slice(0),n._known.slice(0),n._ordered,this._clonePageDefinition(n.pagesDefinition)),o}async _stat(e,t,i,r,s,a,n){if(null!==this._whereClauseFunction)return null===s&&""===i&&null===r?this._manualStat(e,t,a,n):{calculated:!1};let o=this._whereclause;null!==s&&null!==this._whereclause&&(o=(0,l.$e)(this._whereclause,s));const u=await this._parent._stat(e,t,i,r,o,a,n);return!1===u.calculated?null===s&&""===i&&null===r?this._manualStat(e,t,a,n):{calculated:!1}:u}async _canDoAggregates(e,t,i,r,s){return null===this._whereClauseFunction&&(null!==s?null!==this._whereclause&&(s=(0,l.$e)(this._whereclause,s)):s=this._whereclause,null!==this._parent&&this._parent._canDoAggregates(e,t,i,r,s))}async _getAggregatePagesDataSourceDefinition(e,t,i,s,a,n,o){if(null===this._parent)throw new r.EN(r.H9.NeverReach);return null!==a?null!==this._whereclause&&(a=(0,l.$e)(this._whereclause,a)):a=this._whereclause,this._parent._getAggregatePagesDataSourceDefinition(e,t,i,s,a,n,o)}static registerAction(){s.Z._featuresetFunctions.filter=function(e){if("function"==typeof e)return new c({parentfeatureset:this,whereclause:e});let t=null;return e instanceof u.WhereClause&&(t=e),new c({parentfeatureset:this,whereclause:t})}}}},85065:(e,t,i)=>{i.d(t,{Z:()=>o});var r=i(61363),s=i(59987),a=i(91136),n=i(90961),l=i(3823);class o extends a.Z{constructor(e){super(e),this._orderbyclause=null,this.declaredClass="esri.arcade.featureset.actions.OrderBy",this._maxProcessing=100,this._orderbyclause=e.orderbyclause,this._parent=e.parentfeatureset}async _getSet(e){if(null===this._wset){await this._ensureLoaded();const t=await this._getFilteredSet("",null,null,this._orderbyclause,e);return this._checkCancelled(e),this._wset=t,this._wset}return this._wset}async manualOrderSet(e,t){const i=await this.getIdColumnDictionary(e,[],-1,t);this._orderbyclause?.order(i);const r=new n.Z([],[],!0,null);for(let e=0;e<i.length;e++)r._known.push(i[e].id);return r}async getIdColumnDictionary(e,t,i,s){if(i<e._known.length-1){const a=this._maxQueryRate();if("GETPAGES"===e._known[i+1])return await(0,r.Z)(this._parent._expandPagedSet(e,a,0,0,s)),this.getIdColumnDictionary(e,t,i,s);let n=i+1;const l=[];for(;n<e._known.length&&"GETPAGES"!==e._known[n];)l.push(e._known[n]),n++;i+=l.length;const o=await(0,r.Z)(this._parent._getFeatureBatch(l,s));this._checkCancelled(s);for(const e of o)t.push({id:e.attributes[this.objectIdField],feature:e});return this.getIdColumnDictionary(e,t,i,s)}return e._candidates.length>0?(await(0,r.Z)(this._refineSetBlock(e,this._maxProcessingRate(),s)),this._checkCancelled(s),this.getIdColumnDictionary(e,t,i,s)):t}_isInFeatureSet(e){return this._parent._isInFeatureSet(e)}_getFeatures(e,t,i,r){return this._parent._getFeatures(e,t,i,r)}_featureFromCache(e){if(void 0===this._featureCache[e]){const t=this._parent._featureFromCache(e);if(void 0===t)return;return null===t?null:(this._featureCache[e]=t,t)}return this._featureCache[e]}async _fetchAndRefineFeatures(){throw new s.EN(s.H9.NeverReach)}async _getFilteredSet(e,t,i,r,s){await this._ensureLoaded();const a=await this._parent._getFilteredSet(e,t,i,null===r?this._orderbyclause:r,s);this._checkCancelled(s);const l=new n.Z(a._candidates.slice(0),a._known.slice(0),a._ordered,this._clonePageDefinition(a.pagesDefinition));let o=!0;if(a._candidates.length>0&&(o=!1),!1===l._ordered){let e=await this.manualOrderSet(l,s);return!1===o&&(null===t&&null===i||(e=new n.Z(e._candidates.slice(0).concat(e._known.slice(0)),[],e._ordered,this._clonePageDefinition(e.pagesDefinition)))),e}return l}static registerAction(){a.Z._featuresetFunctions.orderBy=function(e){return""===e?this:new o({parentfeatureset:this,orderbyclause:new l.Z(e)})}}}},63991:(e,t,i)=>{i.d(t,{Z:()=>l});var r=i(59987),s=i(91136),a=i(90961),n=i(90658);class l extends s.Z{constructor(e){super(e),this._topnum=0,this.declaredClass="esri.arcade.featureset.actions.Top",this._countedin=0,this._maxProcessing=100,this._topnum=e.topnum,this._parent=e.parentfeatureset}async _getSet(e){if(null===this._wset){await this._ensureLoaded();const t=await this._parent._getSet(e);return this._wset=new a.Z(t._candidates.slice(0),t._known.slice(0),!1,this._clonePageDefinition(t.pagesDefinition)),this._setKnownLength(this._wset)>this._topnum&&(this._wset._known=this._wset._known.slice(0,this._topnum)),this._setKnownLength(this._wset)>=this._topnum&&(this._wset._candidates=[]),this._wset}return this._wset}_setKnownLength(e){return e._known.length>0&&"GETPAGES"===e._known[e._known.length-1]?e._known.length-1:e._known.length}_isInFeatureSet(e){const t=this._parent._isInFeatureSet(e);if(t===n.dj.NotInFeatureSet)return t;const i=this._idstates[e];return i===n.dj.InFeatureSet||i===n.dj.NotInFeatureSet?i:t===n.dj.InFeatureSet&&void 0===i?this._countedin<this._topnum?(this._idstates[e]=n.dj.InFeatureSet,this._countedin++,n.dj.InFeatureSet):(this._idstates[e]=n.dj.NotInFeatureSet,n.dj.NotInFeatureSet):n.dj.Unknown}async _expandPagedSet(e,t,i,s,a){if(null===this._parent)throw new r.EN(r.H9.NotImplemented);if(t>this._topnum&&(t=this._topnum),this._countedin>=this._topnum&&e.pagesDefinition.internal.set.length<=e.pagesDefinition.resultOffset){let t=e._known.length;return t>0&&"GETPAGES"===e._known[t-1]&&(e._known.length=t-1),t=e._candidates.length,t>0&&"GETPAGES"===e._candidates[t-1]&&(e._candidates.length=t-1),"success"}const n=await this._parent._expandPagedSet(e,t,i,s,a);return this._setKnownLength(e)>this._topnum&&(e._known.length=this._topnum),this._setKnownLength(e)>=this._topnum&&(e._candidates.length=0),n}async _getFeatures(e,t,i,r){const s=[],n=this._maxQueryRate();if(!0===this._checkIfNeedToExpandKnownPage(e,n))return await this._expandPagedSet(e,n,0,0,r),this._getFeatures(e,t,i,r);-1!==t&&void 0===this._featureCache[t]&&s.push(t);let l=0;for(let r=e._lastFetchedIndex;r<e._known.length&&(l++,l<=i&&(e._lastFetchedIndex+=1),!(void 0===this._featureCache[e._known[r]]&&(e._known[r]!==t&&s.push(e._known[r]),s.length>n)));r++);if(0===s.length)return"success";const o=new a.Z([],s,!1,null),u=Math.min(s.length,i);await this._parent._getFeatures(o,-1,u,r);for(let e=0;e<u;e++){const t=this._parent._featureFromCache(s[e]);void 0!==t&&(this._featureCache[s[e]]=t)}return"success"}async _getFilteredSet(e,t,i,r,s){await this._ensureLoaded();const n=await this._getSet(s);return new a.Z(n._candidates.slice(0).concat(n._known.slice(0)),[],!1,this._clonePageDefinition(n.pagesDefinition))}_refineKnowns(e,t){let i=0,r=null;const s=[];for(let a=0;a<e._candidates.length;a++){const l=this._isInFeatureSet(e._candidates[a]);if(l===n.dj.InFeatureSet){if(e._known.push(e._candidates[a]),i+=1,null===r?r={start:a,end:a}:r.end===a-1?r.end=a:(s.push(r),r={start:a,end:a}),e._known.length>=this._topnum)break}else if(l===n.dj.NotInFeatureSet)null===r?r={start:a,end:a}:r.end===a-1?r.end=a:(s.push(r),r={start:a,end:a}),i+=1;else if(l===n.dj.Unknown)break;if(i>=t)break}null!==r&&s.push(r);for(let t=s.length-1;t>=0;t--)e._candidates.splice(s[t].start,s[t].end-s[t].start+1);this._setKnownLength(e)>this._topnum&&(e._known=e._known.slice(0,this._topnum)),this._setKnownLength(e)>=this._topnum&&(e._candidates=[])}async _stat(){return{calculated:!1}}async _canDoAggregates(){return!1}static registerAction(){s.Z._featuresetFunctions.top=function(e){return new l({parentfeatureset:this,topnum:e})}}}},17805:(e,t,i)=>{i.d(t,{Z:()=>_});var r=i(38171),s=i(59987),a=i(91136),n=i(90961),l=i(90658),o=i(36515),u=i(9361),d=i(19238),c=i(4632),h=i(16451),f=i(1231),p=i(14165);class _ extends a.Z{constructor(e){super(e),this.declaredClass="esri.arcade.featureset.sources.FeatureLayerMemory",this._removeGeometry=!1,this._overrideFields=null,this._forceIsTable=!1,e.spatialReference&&(this.spatialReference=e.spatialReference),this._transparent=!0,this._maxProcessing=1e3,this._layer=e.layer,this._wset=null,!0===e.isTable&&(this._forceIsTable=!0),void 0!==e.outFields&&(this._overrideFields=e.outFields),void 0!==e.includeGeometry&&(this._removeGeometry=!1===e.includeGeometry)}_maxQueryRate(){return l.tI}end(){return this._layer}optimisePagingFeatureQueries(){}async loadImpl(){return!0===this._layer.loaded?(this._initialiseFeatureSet(),this):(await this._layer.load(),this._initialiseFeatureSet(),this)}get gdbVersion(){return""}_initialiseFeatureSet(){if(null==this.spatialReference&&(this.spatialReference=this._layer.spatialReference),this.geometryType=this._layer.geometryType,this.fields=this._layer.fields.slice(0),null!==this._overrideFields)if(1===this._overrideFields.length&&"*"===this._overrideFields[0])this._overrideFields=null;else{const e=[],t=[];for(const i of this.fields)if("oid"===i.type)e.push(i),t.push(i.name);else for(const r of this._overrideFields)if(r.toLowerCase()===i.name.toLowerCase()){e.push(i),t.push(i.name);break}this.fields=e,this._overrideFields=t}this.objectIdField=this._layer.objectIdField;for(const e of this.fields)"global-id"===e.type&&(this.globalIdField=e.name);this._databaseType=l.Bj.Standardised,this.hasZ=!0===this._layer?.capabilities?.data?.supportsZ,this.hasM=!0===this._layer?.capabilities?.data?.supportsM,this._layer instanceof c.default?(this.typeIdField=this._layer.subtypeField??"",this.types=this._layer.subtypes):(this.typeIdField=this._layer.typeIdField??"",this.types=this._layer.types)}isTable(){return this._forceIsTable||this._layer.isTable||"table"===this._layer.type||!this._layer.geometryType}_isInFeatureSet(){return l.dj.InFeatureSet}_candidateIdTransform(e){return e}async _getSet(e){if(null===this._wset){await this._ensureLoaded();const t=await this._getFilteredSet("",null,null,null,e);return this._wset=t,t}return this._wset}_changeFeature(e){const t={};for(const i of this.fields)t[i.name]=e.attributes[i.name];return new r.Z({geometry:!0===this._removeGeometry?null:e.geometry,attributes:t})}async _getFilteredSet(e,t,i,r,s){let a="",u=!1;if(null!==r&&(a=r.constructClause(),u=!0),this.isTable()&&t&&null!==e&&""!==e)return new n.Z([],[],!0,null);const d=new p.Z;d.returnZ=this.hasZ,d.returnM=this.hasM,d.where=null===i?null===t?"1=1":"":(0,o.zR)(i,l.Bj.Standardised),d.spatialRelationship=this._makeRelationshipEnum(e),d.outSpatialReference=this.spatialReference,d.orderByFields=""!==a?a.split(","):null,d.geometry=null===t?null:t,d.returnGeometry=!0,d.relationParameter=this._makeRelationshipParam(e);const c=await this._layer.queryFeatures(d);if(null===c)return new n.Z([],[],u,null);this._checkCancelled(s);const h=[];return c.features.forEach((e=>{const t=e.attributes[this._layer.objectIdField];h.push(t),this._featureCache[t]=this._changeFeature(e)})),new n.Z([],h,u,null)}_makeRelationshipEnum(e){if(e.includes("esriSpatialRelRelation"))return"relation";switch(e){case"esriSpatialRelRelation":return"relation";case"esriSpatialRelIntersects":return"intersects";case"esriSpatialRelContains":return"contains";case"esriSpatialRelOverlaps":return"overlaps";case"esriSpatialRelWithin":return"within";case"esriSpatialRelTouches":return"touches";case"esriSpatialRelCrosses":return"crosses";case"esriSpatialRelEnvelopeIntersects":return"envelope-intersects"}return e}_makeRelationshipParam(e){return e.includes("esriSpatialRelRelation")?e.split(":")[1]:""}async _queryAllFeatures(){if(this._wset)return this._wset;const e=new p.Z;if(e.where="1=1",await this._ensureLoaded(),this._layer.source&&this._layer.source.items){const e=[];return this._layer.source.items.forEach((t=>{const i=t.attributes[this._layer.objectIdField];e.push(i),this._featureCache[i]=this._changeFeature(t)})),this._wset=new n.Z([],e,!1,null),this._wset}e.returnZ=this.hasZ,e.returnM=this.hasM;const t=await this._layer.queryFeatures(e),i=[];return t.features.forEach((e=>{const t=e.attributes[this._layer.objectIdField];i.push(t),this._featureCache[t]=this._changeFeature(e)})),this._wset=new n.Z([],i,!1,null),this._wset}async _getFeatures(e,t,i){const r=[];-1!==t&&void 0===this._featureCache[t]&&r.push(t);for(let s=e._lastFetchedIndex;s<e._known.length&&(e._lastFetchedIndex+=1,!(void 0===this._featureCache[e._known[s]]&&(e._known[s]!==t&&r.push(e._known[s]),r.length>i)));s++);if(0===r.length)return"success";throw new s.EN(s.H9.MissingFeatures)}async _refineSetBlock(e){return e}async _stat(){return{calculated:!1}}async _canDoAggregates(){return!1}relationshipMetaData(){return[]}static _cloneAttr(e){const t={};for(const i in e)t[i]=e[i];return t}nativeCapabilities(){return{title:this._layer.title??"",canQueryRelated:!1,source:this,capabilities:this._layer.capabilities,databaseType:this._databaseType,requestStandardised:!0}}static create(e,t){let i=e.layerDefinition.objectIdField;const r=e.layerDefinition.typeIdField??"",s=[];if(e.layerDefinition.types)for(const t of e.layerDefinition.types)s.push(h.Z.fromJSON(t));let a=e.layerDefinition.geometryType;void 0===a&&(a=e.featureSet.geometryType||"");let n=e.featureSet.features;const l=t.toJSON();if(!i){let t=!1;for(const r of e.layerDefinition.fields)if("oid"===r.type||"esriFieldTypeOID"===r.type){i=r.name,t=!0;break}if(!1===t){let t="FID",r=!0,s=0;for(;r;){let i=!0;for(const r of e.layerDefinition.fields)if(r.name===t){i=!1;break}!0===i?r=!1:(s++,t="FID"+s.toString())}e.layerDefinition.fields.push({type:"esriFieldTypeOID",name:t,alias:t});const a=[];for(let i=0;i<n.length;i++)a.push({geometry:e.featureSet.features[i].geometry,attributes:e.featureSet.features[i].attributes?this._cloneAttr(e.featureSet.features[i].attributes):{}}),a[i].attributes[t]=i;n=a,i=t}}const o=[];for(const t of e.layerDefinition.fields)t instanceof f.Z?o.push(t):o.push(f.Z.fromJSON(t));let c=a;switch(c||(c=""),c){case"esriGeometryPoint":c="point";break;case"esriGeometryPolyline":c="polyline";break;case"esriGeometryPolygon":c="polygon";break;case"esriGeometryEnvelope":c="extent";break;case"esriGeometryMultipoint":c="multipoint";break;case"":case"esriGeometryNull":c="esriGeometryNull"}if("esriGeometryNull"!==c)for(const e of n)e.geometry&&e.geometry instanceof u.Z==0&&(e.geometry.type=c,void 0===e.geometry.spatialReference&&(e.geometry.spatialReference=l));else for(const e of n)e.geometry&&(e.geometry=null);const p={outFields:["*"],source:n,fields:o,hasZ:!0===e?.layerDefinition?.hasZ||!0===e?.featureSet?.hasZ,hasM:!0===e?.layerDefinition?.hasM||!0===e?.featureSet?.hasM,types:s,typeIdField:r,objectIdField:i,spatialReference:t},y="esriGeometryNull"===c||null===c;y||(p.geometryType=c);const g=new d.default(p);return new _({layer:g,spatialReference:t,isTable:y})}async queryAttachments(){return[]}async getFeatureByObjectId(e){const t=new p.Z;t.where=this.objectIdField+"="+e.toString(),t.returnZ=this.hasZ,t.returnM=this.hasM;const i=await this._layer.queryFeatures(t);return 1===i.features.length?i.features[0]:null}async getOwningSystemUrl(){return""}async getIdentityUser(){return""}get preferredTimeReference(){return this._layer?.preferredTimeReference?.toJSON()??null}get dateFieldsTimeReference(){return this._layer?.dateFieldsTimeReference?.toJSON()??null}get datesInUnknownTimezone(){return this._layer?.datesInUnknownTimezone}get editFieldsInfo(){return this._layer?.editFieldsInfo?.toJSON()??null}get timeInfo(){return this._layer?.timeInfo?.toJSON()??null}}},3823:(e,t,i)=>{function r(e,t){return e===t?0:null===e?-1:null===t?1:e<t?-1:1}i.d(t,{Z:()=>s});class s{constructor(e){const t=e.split(",");this._fields=[],this._directions=[];for(let e=0;e<t.length;e++){const i=t[e].match(/\S+/g);this._fields.push(i[0]),2===i.length?"asc"===i[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 i=0;i<this._fields.length;i++){const s=this.featureValue(e.feature,this._fields[i],i),a=this.featureValue(t.feature,this._fields[i],i);let n=0;if(n=1===this._directions[i]?r(s,a):-1*r(s,a),0!==n)return n}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 i=0;i<this._fields.length;i++){0!==i&&(t+=",");let r=this._fields[i];for(const t of e)if(r.toLowerCase()===t.field.toLowerCase()){r=t.newfield;break}t+=r,1===this._directions[i]?t+=" ASC":t+=" DESC"}return new s(t)}featureValue(e,t,i){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[i]=r,e.attributes[r];return null}}},66643:(e,t,i)=>{i.d(t,{Ed:()=>u,UI:()=>d,mt:()=>p,q6:()=>f,vr:()=>_});var r=i(43697),s=i(92036),a=i(70586),n=i(95330),l=i(5600),o=i(52011);function u(e,t,i){return(0,n.as)(e.map(((e,r)=>t.apply(i,[e,r]))))}async function d(e,t,i){return(await(0,n.as)(e.map(((e,r)=>t.apply(i,[e,r]))))).map((e=>e.value))}function c(e){return{ok:!0,value:e}}function h(e){return{ok:!1,error:e}}async function f(e){if(null==e)return{ok:!1,error:new Error("no promise provided")};try{return c(await e)}catch(e){return h(e)}}async function p(e){try{return c(await e)}catch(e){return(0,n.r9)(e),h(e)}}function _(e,t){return new y(e,t)}let y=class extends s.Z{get value(){return null!=(e=this._result)&&!0===e.ok?e.value:null;var e}get error(){return null!=(e=this._result)&&!1===e.ok?e.error:null;var e}get finished(){return null!=this._result}constructor(e,t){super({}),this._result=null,this._abortHandle=null,this.abort=()=>{this._abortController=(0,a.IM)(this._abortController)},this.remove=this.abort,this._abortController=new AbortController;const{signal:i}=this._abortController;this.promise=e(i),this.promise.then((e=>{this._result=c(e),this._cleanup()}),(e=>{this._result=h(e),this._cleanup()})),this._abortHandle=(0,n.fu)(t,this.abort)}normalizeCtorArgs(){return{}}destroy(){this.abort()}_cleanup(){this._abortHandle=(0,a.hw)(this._abortHandle),this._abortController=null}};(0,r._)([(0,l.Cb)()],y.prototype,"value",null),(0,r._)([(0,l.Cb)()],y.prototype,"error",null),(0,r._)([(0,l.Cb)()],y.prototype,"finished",null),(0,r._)([(0,l.Cb)()],y.prototype,"promise",void 0),(0,r._)([(0,l.Cb)()],y.prototype,"_result",void 0),y=(0,r._)([(0,o.j)("esri.core.asyncUtils.ReactiveTask")],y)},87085:(e,t,i)=>{i.d(t,{Z:()=>w});var r=i(43697),s=(i(66577),i(3172)),a=i(20102),n=i(32448),l=i(10699),o=i(83379),u=i(92604),d=i(95330),c=i(81271),h=i(5600),f=(i(75215),i(67676),i(80442),i(52011)),p=i(68773),_=i(6570),y=i(82971);let g=0,m=class extends(n.Z.EventedMixin((0,l.IG)(o.Z))){constructor(){super(...arguments),this.attributionDataUrl=null,this.fullExtent=new _.Z(-180,-90,180,90,y.Z.WGS84),this.id=Date.now().toString(16)+"-layer-"+g++,this.legendEnabled=!0,this.listMode="show",this.opacity=1,this.parent=null,this.popupEnabled=!0,this.attributionVisible=!0,this.spatialReference=y.Z.WGS84,this.title=null,this.type=null,this.url=null,this.visible=!0}static async fromArcGISServerUrl(e){const t="string"==typeof e?{url:e}:e;return(await i.e(3529).then(i.bind(i,63529))).fromUrl(t)}static fromPortalItem(e){return async function(e){const t="portalItem"in e?e:{portalItem:e},{fromItem:r}=await i.e(8008).then(i.bind(i,28008));try{return await r(t)}catch(e){const i=t&&t.portalItem,r=i&&i.id||"unset",s=i&&i.portal&&i.portal.url||p.default.portalUrl;throw u.Z.getLogger("esri.layers.support.fromPortalItem").error("#fromPortalItem()","Failed to create layer from portal item (portal: '"+s+"', id: '"+r+"')",e),e}}(e)}initialize(){this.when().catch((e=>{(0,d.D_)(e)||u.Z.getLogger(this).error("#load()",`Failed to load layer (title: '${this.title??"no title"}', id: '${this.id??"no id"}')`,{error:e})}))}destroy(){if(this.parent){const e=this,t=this.parent;"layers"in t&&t.layers.includes(e)?t.layers.remove(e):"tables"in t&&t.tables.includes(e)?t.tables.remove(e):"baseLayers"in t&&t.baseLayers.includes(e)?t.baseLayers.remove(e):"baseLayers"in t&&t.referenceLayers.includes(e)&&t.referenceLayers.remove(e)}}get hasAttributionData(){return null!=this.attributionDataUrl}get parsedUrl(){return(0,c.mN)(this.url)}async fetchAttributionData(){const e=this.attributionDataUrl;if(this.hasAttributionData&&e)return(await(0,s.default)(e,{query:{f:"json"},responseType:"json"})).data;throw new a.Z("layer:no-attribution-data","Layer does not have attribution data")}};(0,r._)([(0,h.Cb)({type:String})],m.prototype,"attributionDataUrl",void 0),(0,r._)([(0,h.Cb)({type:_.Z})],m.prototype,"fullExtent",void 0),(0,r._)([(0,h.Cb)({readOnly:!0})],m.prototype,"hasAttributionData",null),(0,r._)([(0,h.Cb)({type:String,clonable:!1})],m.prototype,"id",void 0),(0,r._)([(0,h.Cb)({type:Boolean,nonNullable:!0})],m.prototype,"legendEnabled",void 0),(0,r._)([(0,h.Cb)({type:["show","hide","hide-children"]})],m.prototype,"listMode",void 0),(0,r._)([(0,h.Cb)({type:Number,range:{min:0,max:1},nonNullable:!0})],m.prototype,"opacity",void 0),(0,r._)([(0,h.Cb)({clonable:!1})],m.prototype,"parent",void 0),(0,r._)([(0,h.Cb)({readOnly:!0})],m.prototype,"parsedUrl",null),(0,r._)([(0,h.Cb)({type:Boolean})],m.prototype,"popupEnabled",void 0),(0,r._)([(0,h.Cb)({type:Boolean})],m.prototype,"attributionVisible",void 0),(0,r._)([(0,h.Cb)({type:y.Z})],m.prototype,"spatialReference",void 0),(0,r._)([(0,h.Cb)({type:String})],m.prototype,"title",void 0),(0,r._)([(0,h.Cb)({readOnly:!0,json:{read:!1}})],m.prototype,"type",void 0),(0,r._)([(0,h.Cb)()],m.prototype,"url",void 0),(0,r._)([(0,h.Cb)({type:Boolean,nonNullable:!0})],m.prototype,"visible",void 0),m=(0,r._)([(0,f.j)("esri.layers.Layer")],m);const w=m},66677:(e,t,i)=>{i.d(t,{B5:()=>d,DR:()=>h,G:()=>w,M8:()=>_,Nm:()=>y,Qc:()=>c,XG:()=>g,a7:()=>p,ld:()=>f,wH:()=>m});var r=i(81271),s=i(25929);const a={mapserver:"MapServer",imageserver:"ImageServer",featureserver:"FeatureServer",sceneserver:"SceneServer",streamserver:"StreamServer",vectortileserver:"VectorTileServer"},n=Object.values(a),l=new RegExp(`^((?:https?:)?\\/\\/\\S+?\\/rest\\/services\\/(.+?)\\/(${n.join("|")}))(?:\\/(?:layers\\/)?(\\d+))?`,"i"),o=new RegExp(`^((?:https?:)?\\/\\/\\S+?\\/([^\\/\\n]+)\\/(${n.join("|")}))(?:\\/(?:layers\\/)?(\\d+))?`,"i"),u=/(.*?)\/(?:layers\/)?(\d+)\/?$/i;function d(e){return!!l.test(e)}function c(e){if(null==e)return null;const t=(0,r.mN)(e),i=t.path.match(l)||t.path.match(o);if(!i)return null;const[,s,n,u,d]=i,c=n.indexOf("/");return{title:f(-1!==c?n.slice(c+1):n),serverType:a[u.toLowerCase()],sublayer:null!=d&&""!==d?parseInt(d,10):null,url:{path:s}}}function h(e){const t=(0,r.mN)(e).path.match(u);return t?{serviceUrl:t[1],sublayerId:Number(t[2])}:null}function f(e){return(e=e.replaceAll(/\s*[/_]+\s*/g," "))[0].toUpperCase()+e.slice(1)}function p(e,t){const i=[];if(e){const t=c(e);null!=t&&t.title&&i.push(t.title)}if(t){const e=f(t);i.push(e)}if(2===i.length){if(i[0].toLowerCase().includes(i[1].toLowerCase()))return i[0];if(i[1].toLowerCase().includes(i[0].toLowerCase()))return i[1]}return i.join(" - ")}function _(e){if(!e)return!1;const t=(e=e.toLowerCase()).includes(".arcgis.com/"),i=e.includes("//services")||e.includes("//tiles")||e.includes("//features");return t&&i}function y(e,t){return e?(0,r.Qj)((0,r.Hu)(e,t)):e}function g(e){let{url:t}=e;if(!t)return{url:t};t=(0,r.Hu)(t,e.logger);const i=(0,r.mN)(t),s=c(i.path);let a;if(null!=s)null!=s.sublayer&&null==e.layer.layerId&&(a=s.sublayer),t=s.url.path;else if(e.nonStandardUrlAllowed){const e=h(i.path);null!=e&&(t=e.serviceUrl,a=e.sublayerId)}return{url:(0,r.Qj)(t),layerId:a}}function m(e,t,i,a,n){(0,s.w)(t,a,"url",n),a.url&&null!=e.layerId&&(a.url=(0,r.v_)(a.url,i,e.layerId.toString()))}function w(e){if(!e)return!1;const t=e.toLowerCase(),i=t.includes("/services/"),r=t.includes("/mapserver/wmsserver"),s=t.includes("/imageserver/wmsserver"),a=t.includes("/wmsserver");return i&&(r||s||a)}},2981:(e,t,i)=>{i.d(t,{$6:()=>d,Ow:()=>a,S0:()=>s,d1:()=>n});const r=[["binary","application/octet-stream","bin",""]];function s(e,t){return o(function(e,t){return l(t).find((t=>u(t)===e))}(e,t))}function a(e,t){return o(function(e,t){const i=e.toLowerCase();return l(t).find((e=>function(e){return e?.[2].split(",")??[]}(e).some((e=>i.endsWith(e)))))}(e,t))}function n(e,t){return u(function(e,t){return l(t).find((t=>o(t)===e))}(e,t))}function l(e){return[...r,...e]}function o(e){return e?.[0]}function u(e){return e?.[1]}function d(e){return e.tables?.find((e=>"assetMaps"===e.role))}},14661:(e,t,i)=>{i.d(t,{$o:()=>d,Fj:()=>o,Kz:()=>c,Ss:()=>h,_$:()=>l,ck:()=>u,qj:()=>n});var r=i(44547),s=i(82971),a=i(40488);function n(e,t){if(!l(e,t)){const i=e.typeKeywords;i?i.push(t):e.typeKeywords=[t]}}function l(e,t){return!!e.typeKeywords?.includes(t)}function o(e){return l(e,c.HOSTED_SERVICE)}function u(e,t){const i=e.typeKeywords;if(i){const e=i.indexOf(t);e>-1&&i.splice(e,1)}}async function d(e){const t=e.clone().normalize();let i;if(t.length>1)for(const e of t)i?e.width>i.width&&(i=e):i=e;else i=t[0];return async function(e){const t=e.spatialReference;if(t.isWGS84)return e.clone();if(t.isWebMercator)return(0,a.Sx)(e);const i=s.Z.WGS84;return await(0,r.iQ)(t,i),(0,r.iV)(e,i)}(i)}const c={DEVELOPER_BASEMAP:"DeveloperBasemap",JSAPI:"ArcGIS API for JavaScript",METADATA:"Metadata",MULTI_LAYER:"Multilayer",SINGLE_LAYER:"Singlelayer",TABLE:"Table",HOSTED_SERVICE:"Hosted Service"};function h(e){const{portal:t,isOrgItem:i,itemControl:r}=e,s=t.user?.privileges;let a=!s||s.includes("features:user:edit"),n=!!i&&!!s?.includes("features:user:fullEdit");const l="update"===r||"admin"===r;return l?n=a=!0:n&&(a=!0),{features:{edit:a,fullEdit:n},content:{updateItem:l}}}},41818:(e,t,i)=>{i.d(t,{P:()=>n});var r=i(11282),s=i(34599),a=i(14165);async function n(e,t,i){const n=(0,r.en)(e);return(0,s.hH)(n,a.Z.from(t),{...i}).then((e=>e.data.count))}},5396:(e,t,i)=>{i.d(t,{G:()=>n});var r=i(11282),s=i(34599),a=i(14165);async function n(e,t,i){const n=(0,r.en)(e);return(0,s.Ev)(n,a.Z.from(t),{...i}).then((e=>e.data.objectIds))}},4967:(e,t,i)=>{i.d(t,{F:()=>o,e:()=>l});var r=i(11282),s=i(34599),a=i(74889),n=i(14165);async function l(e,t,i){const r=await o(e,t,i);return a.Z.fromJSON(r)}async function o(e,t,i){const a=(0,r.en)(e),l={...i},o=n.Z.from(t),{data:u}=await(0,s.JT)(a,o,o.sourceSpatialReference,l);return u}},53261:(e,t,i)=>{i.d(t,{t:()=>y});var r=i(11282),s=i(70586),a=i(69285),n=i(98732);function l(e,t){return t}function o(e,t,i,r){switch(i){case 0:return h(e,t+r,0);case 1:return"lowerLeft"===e.originPosition?h(e,t+r,1):function({translate:e,scale:t},i,r){return e[r]-i*t[r]}(e,t+r,1)}}function u(e,t,i,r){return 2===i?h(e,t,2):o(e,t,i,r)}function d(e,t,i,r){return 2===i?h(e,t,3):o(e,t,i,r)}function c(e,t,i,r){return 3===i?h(e,t,3):u(e,t,i,r)}function h({translate:e,scale:t},i,r){return e[r]+i*t[r]}class f{constructor(e){this._options=e,this.geometryTypes=["esriGeometryPoint","esriGeometryMultipoint","esriGeometryPolyline","esriGeometryPolygon"],this._previousCoordinate=[0,0],this._transform=null,this._applyTransform=l,this._lengths=[],this._currentLengthIndex=0,this._toAddInCurrentPath=0,this._vertexDimension=0,this._coordinateBuffer=null,this._coordinateBufferPtr=0,this._attributesConstructor=class{}}createFeatureResult(){return{fields:[],features:[]}}finishFeatureResult(e){if(this._options.applyTransform&&(e.transform=null),this._attributesConstructor=class{},this._coordinateBuffer=null,this._lengths.length=0,!e.hasZ)return;const t=(0,a.k)(e.geometryType,this._options.sourceSpatialReference,e.spatialReference);if(null!=t)for(const i of e.features)t(i.geometry)}createSpatialReference(){return{}}addField(e,t){const i=e.fields;(0,s.O3)(i),i.push(t);const r=i.map((e=>e.name));this._attributesConstructor=function(){for(const e of r)this[e]=null}}addFeature(e,t){e.features.push(t)}prepareFeatures(e){switch(this._transform=e.transform,this._options.applyTransform&&e.transform&&(this._applyTransform=this._deriveApplyTransform(e)),this._vertexDimension=2,e.hasZ&&this._vertexDimension++,e.hasM&&this._vertexDimension++,e.geometryType){case"esriGeometryPoint":this.addCoordinate=(e,t,i)=>this.addCoordinatePoint(e,t,i),this.createGeometry=e=>this.createPointGeometry(e);break;case"esriGeometryPolygon":this.addCoordinate=(e,t,i)=>this._addCoordinatePolygon(e,t,i),this.createGeometry=e=>this._createPolygonGeometry(e);break;case"esriGeometryPolyline":this.addCoordinate=(e,t,i)=>this._addCoordinatePolyline(e,t,i),this.createGeometry=e=>this._createPolylineGeometry(e);break;case"esriGeometryMultipoint":this.addCoordinate=(e,t,i)=>this._addCoordinateMultipoint(e,t,i),this.createGeometry=e=>this._createMultipointGeometry(e)}}createFeature(){return this._lengths.length=0,this._currentLengthIndex=0,this._previousCoordinate[0]=0,this._previousCoordinate[1]=0,this._coordinateBuffer=null,this._coordinateBufferPtr=0,{attributes:new this._attributesConstructor}}allocateCoordinates(){}addLength(e,t,i){0===this._lengths.length&&(this._toAddInCurrentPath=t),this._lengths.push(t)}addQueryGeometry(e,t){const{queryGeometry:i,queryGeometryType:r}=t,s=(0,n.$g)(i.clone(),i,!1,!1,this._transform),a=(0,n.di)(s,r,!1,!1);e.queryGeometryType=r,e.queryGeometry={...a}}createPointGeometry(e){const t={x:0,y:0,spatialReference:e.spatialReference};return e.hasZ&&(t.z=0),e.hasM&&(t.m=0),t}addCoordinatePoint(e,t,i){const r=(0,s.s3)(this._transform,"transform");switch(t=this._applyTransform(r,t,i,0),i){case 0:e.x=t;break;case 1:e.y=t;break;case 2:"z"in e?e.z=t:e.m=t;break;case 3:e.m=t}}_transformPathLikeValue(e,t){let i=0;t<=1&&(i=this._previousCoordinate[t],this._previousCoordinate[t]+=e);const r=(0,s.s3)(this._transform,"transform");return this._applyTransform(r,e,t,i)}_addCoordinatePolyline(e,t,i){this._dehydratedAddPointsCoordinate(e.paths,t,i)}_addCoordinatePolygon(e,t,i){this._dehydratedAddPointsCoordinate(e.rings,t,i)}_addCoordinateMultipoint(e,t,i){0===i&&e.points.push([]);const r=this._transformPathLikeValue(t,i);e.points[e.points.length-1].push(r)}_createPolygonGeometry(e){return{rings:[[]],spatialReference:e.spatialReference,hasZ:!!e.hasZ,hasM:!!e.hasM}}_createPolylineGeometry(e){return{paths:[[]],spatialReference:e.spatialReference,hasZ:!!e.hasZ,hasM:!!e.hasM}}_createMultipointGeometry(e){return{points:[],spatialReference:e.spatialReference,hasZ:!!e.hasZ,hasM:!!e.hasM}}_dehydratedAddPointsCoordinate(e,t,i){0===i&&0==this._toAddInCurrentPath--&&(e.push([]),this._toAddInCurrentPath=this._lengths[++this._currentLengthIndex]-1,this._previousCoordinate[0]=0,this._previousCoordinate[1]=0);const r=this._transformPathLikeValue(t,i),s=e[e.length-1];0===i&&(this._coordinateBufferPtr=0,this._coordinateBuffer=new Array(this._vertexDimension),s.push(this._coordinateBuffer)),this._coordinateBuffer[this._coordinateBufferPtr++]=r}_deriveApplyTransform(e){const{hasZ:t,hasM:i}=e;return t&&i?c:t?u:i?d:o}}var p=i(34599),_=(i(74889),i(14165));async function y(e,t,i){const s=(0,r.en)(e),a={...i},n=_.Z.from(t),l=!n.quantizationParameters,{data:o}=await(0,p.qp)(s,n,new f({sourceSpatialReference:n.sourceSpatialReference,applyTransform:l}),a);return o}},28694:(e,t,i)=>{i.d(t,{p:()=>s});var r=i(69285);function s(e,t,i){if(!i||!i.features||!i.hasZ)return;const s=(0,r.k)(i.geometryType,t,e.outSpatialReference);if(null!=s)for(const e of i.features)s(e.geometry)}},98326:(e,t,i)=>{i.d(t,{Z:()=>c});var r,s=i(43697),a=i(96674),n=i(5600),l=i(75215),o=(i(67676),i(80442),i(52011));const u={1:{id:1,rotation:0,mirrored:!1},2:{id:2,rotation:0,mirrored:!0},3:{id:3,rotation:180,mirrored:!1},4:{id:4,rotation:180,mirrored:!0},5:{id:5,rotation:-90,mirrored:!0},6:{id:6,rotation:90,mirrored:!1},7:{id:7,rotation:90,mirrored:!0},8:{id:8,rotation:-90,mirrored:!1}};let d=r=class extends a.wq{constructor(e){super(e),this.contentType=null,this.exifInfo=null,this.id=null,this.globalId=null,this.keywords=null,this.name=null,this.parentGlobalId=null,this.parentObjectId=null,this.size=null,this.url=null}get orientationInfo(){const{exifInfo:e}=this,t=function(e){const{exifInfo:t,exifName:i,tagName:r}=e;if(!t||!i||!r)return null;const s=t.find((e=>e.name===i));return s?function(e){const{tagName:t,tags:i}=e;if(!i||!t)return null;const r=i.find((e=>e.name===t));return r&&r.value||null}({tagName:r,tags:s.tags}):null}({exifName:"Exif IFD0",tagName:"Orientation",exifInfo:e});return u[t]||null}clone(){return new r({contentType:this.contentType,exifInfo:this.exifInfo,id:this.id,globalId:this.globalId,keywords:this.keywords,name:this.name,parentGlobalId:this.parentGlobalId,parentObjectId:this.parentObjectId,size:this.size,url:this.url})}};(0,s._)([(0,n.Cb)({type:String})],d.prototype,"contentType",void 0),(0,s._)([(0,n.Cb)()],d.prototype,"exifInfo",void 0),(0,s._)([(0,n.Cb)({readOnly:!0})],d.prototype,"orientationInfo",null),(0,s._)([(0,n.Cb)({type:l.z8})],d.prototype,"id",void 0),(0,s._)([(0,n.Cb)({type:String})],d.prototype,"globalId",void 0),(0,s._)([(0,n.Cb)({type:String})],d.prototype,"keywords",void 0),(0,s._)([(0,n.Cb)({type:String})],d.prototype,"name",void 0),(0,s._)([(0,n.Cb)({json:{read:!1}})],d.prototype,"parentGlobalId",void 0),(0,s._)([(0,n.Cb)({json:{read:!1}})],d.prototype,"parentObjectId",void 0),(0,s._)([(0,n.Cb)({type:l.z8})],d.prototype,"size",void 0),(0,s._)([(0,n.Cb)({json:{read:!1}})],d.prototype,"url",void 0),d=r=(0,s._)([(0,o.j)("esri.layers.support.AttachmentInfo")],d);const c=d}}]);