@arcgis/core 4.28.0-next.20230921 → 4.28.0-next.20230922

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 (313) hide show
  1. package/Graphic.js +1 -1
  2. package/arcade/ArcadeDate.js +1 -1
  3. package/arcade/Feature.js +1 -1
  4. package/arcade/featureSetUtils.js +1 -1
  5. package/arcade/featureset/actions/Adapted.js +1 -1
  6. package/arcade/featureset/actions/GroupBy.js +1 -1
  7. package/arcade/featureset/support/FeatureSet.js +1 -1
  8. package/arcade/featureset/support/FeatureSetIterator.js +1 -1
  9. package/arcade/featureset/support/StatsField.js +1 -1
  10. package/arcade/featureset/support/sqlUtils.js +1 -1
  11. package/arcade/functions/date.js +1 -1
  12. package/arcade/functions/featuresetbase.js +1 -1
  13. package/arcade/functions/featuresetstats.js +1 -1
  14. package/arcade.js +1 -1
  15. package/assets/esri/core/workers/RemoteClient.js +1 -1
  16. package/assets/esri/core/workers/chunks/{2cb36f9686693234991a.js → 07a2dab2f645dcd7d8d6.js} +1 -1
  17. package/assets/esri/core/workers/chunks/07f6175b52366b2c28bd.js +1 -0
  18. package/assets/esri/core/workers/chunks/098073c3b2849f56dad8.js +1 -0
  19. package/assets/esri/core/workers/chunks/{580039dd491854ca325c.js → 21fc02f0d5716c4a7acd.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{072b4e041b8630c513a0.js → 243b1f9b2fba02946481.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{dff1c3c38dda2bd1a9d6.js → 246a954347fe9318190e.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{314c307e30f308a40a28.js → 25b09e9c0511c8e1cf8a.js} +1 -1
  23. package/assets/esri/core/workers/chunks/28a5ef2e2daa4207dd8b.js +1 -0
  24. package/assets/esri/core/workers/chunks/2b017e1aa1be71974c2e.js +1 -0
  25. package/assets/esri/core/workers/chunks/425b5733bb88e6efe242.js +1 -0
  26. package/assets/esri/core/workers/chunks/{c9dfb145f0c1d93e0fbd.js → 4bcca5fffb1fcc2d4353.js} +1 -1
  27. package/assets/esri/core/workers/chunks/4bf1a7e82a68ccee0ee1.js +1 -0
  28. package/assets/esri/core/workers/chunks/4c110c7f4f940ec58010.js +1 -0
  29. package/assets/esri/core/workers/chunks/{bde89b2684b6185992ef.js → 4ed77097e69fa3096ce4.js} +1 -1
  30. package/assets/esri/core/workers/chunks/{1cbaba30f55f00f7498b.js → 51324d042f469f3b8914.js} +1 -1
  31. package/assets/esri/core/workers/chunks/{3f4e9b1663ec521bfe00.js → 542ce10e1872399790b4.js} +1 -1
  32. package/assets/esri/core/workers/chunks/54d2b7e2ac4ba883bee8.js +1 -0
  33. package/assets/esri/core/workers/chunks/54ecb6cae310818d1aa2.js +1 -0
  34. package/assets/esri/core/workers/chunks/57c932e289d89d97da4b.js +1 -0
  35. package/assets/esri/core/workers/chunks/{6403de6fc067cf8f7436.js → 592c1fb531f2be928e8a.js} +1 -1
  36. package/assets/esri/core/workers/chunks/609a475ab395f2ce63e2.js +1 -0
  37. package/assets/esri/core/workers/chunks/{332689bf60d246485993.js → 65186e168dd112ac6221.js} +1 -1
  38. package/assets/esri/core/workers/chunks/6b9248fb2d6aadbce7bb.js +1 -0
  39. package/assets/esri/core/workers/chunks/709465832d306e02df52.js +1 -0
  40. package/assets/esri/core/workers/chunks/{bbc0dcd316c5598bc9ad.js → 74368a5213def6c200a2.js} +1 -1
  41. package/assets/esri/core/workers/chunks/78e7af899d9d50aa7e74.js +1 -0
  42. package/assets/esri/core/workers/chunks/7fe641cf1467496e670a.js +1 -0
  43. package/assets/esri/core/workers/chunks/{df8f62beb36fb9d2ac81.js → 810c8d6ff19976fd1366.js} +1 -1
  44. package/assets/esri/core/workers/chunks/83a15aa4b1c5252c651b.js +1 -0
  45. package/assets/esri/core/workers/chunks/85e436decdd693f240ee.js +1 -0
  46. package/assets/esri/core/workers/chunks/{243a4eed107d363dfad8.js → 887652bbdb3b71d0a089.js} +1 -1
  47. package/assets/esri/core/workers/chunks/896bfda379cf620b63ec.js +1 -0
  48. package/assets/esri/core/workers/chunks/{1f7e041140088f8ac489.js → 97073a60f0ea2a397165.js} +1 -1
  49. package/assets/esri/core/workers/chunks/{101f776316a85b708927.js → a99070ec4c06c435b744.js} +1 -1
  50. package/assets/esri/core/workers/chunks/{21a9c8aa2a9e9990df41.js → b499b4fa771e8c422b43.js} +1 -1
  51. package/assets/esri/core/workers/chunks/bffad8aec92f982cc75a.js +1 -0
  52. package/assets/esri/core/workers/chunks/d414dba3179bcf75bc6b.js +1 -0
  53. package/assets/esri/core/workers/chunks/{b449d6bd5851187d419f.js → d6e5408f9fa6b4bcd118.js} +1 -1
  54. package/assets/esri/core/workers/chunks/{3ca759f72d3bb29e9ea9.js → e14da83329f7771135bc.js} +2 -2
  55. package/assets/esri/core/workers/chunks/{f508ccfde6425dabe9ac.js → ee0bf611d191103a7046.js} +1 -1
  56. package/assets/esri/core/workers/chunks/{ed1fbc1bc8d50453e2f5.js → f793cd41fcd022baeea2.js} +1 -1
  57. package/assets/esri/core/workers/chunks/fb87fd64411b78afea23.js +1 -0
  58. package/assets/esri/themes/base/widgets/_OrientedImageryViewer.scss +2 -0
  59. package/assets/esri/themes/dark/main.css +1 -1
  60. package/assets/esri/themes/light/main.css +1 -1
  61. package/assets/esri/themes/light/view.css +1 -1
  62. package/config.js +1 -1
  63. package/core/Accessor.js +1 -1
  64. package/core/has.js +1 -1
  65. package/core/sql/DateOnly.js +1 -1
  66. package/core/sql/WhereClause.js +1 -1
  67. package/core/sql.js +1 -1
  68. package/identity/IdentityForm.js +1 -1
  69. package/identity/IdentityModal.js +1 -1
  70. package/interfaces.d.ts +28 -199
  71. package/layers/OrientedImageryLayer.js +1 -1
  72. package/layers/graphics/applyEditsUtils.js +5 -0
  73. package/layers/graphics/editingSupport.js +1 -1
  74. package/layers/graphics/sources/FeatureLayerSource.js +1 -1
  75. package/layers/mixins/EditBusLayer.js +1 -1
  76. package/layers/orientedImagery/core/CameraOrientationLTP.js +1 -1
  77. package/layers/orientedImagery/core/ElevationSourceDefinitions.js +5 -0
  78. package/layers/orientedImagery/core/ExposurePoint.js +1 -1
  79. package/layers/orientedImagery/core/cameraOrientationFactory.js +1 -1
  80. package/layers/orientedImagery/core/utils.js +5 -0
  81. package/layers/orientedImagery/transformations/groundToImageUtils.js +1 -1
  82. package/layers/support/fieldProperties.js +1 -1
  83. package/networks/Network.js +1 -1
  84. package/package.json +1 -1
  85. package/rest/featureService/FeatureService.js +1 -1
  86. package/support/arcadeUtils.js +1 -1
  87. package/support/revision.js +1 -1
  88. package/symbols/support/svgUtils.js +1 -1
  89. package/versionManagement/VersionManagementService.js +1 -1
  90. package/versionManagement/support/EditMomentStack.js +5 -0
  91. package/versionManagement/support/versionManagementUtils.js +1 -1
  92. package/views/2d/engine/Container.js +1 -1
  93. package/views/2d/engine/DisplayObject.js +1 -1
  94. package/views/2d/engine/ManagedCanvas.js +5 -0
  95. package/views/2d/engine/Stage.js +1 -1
  96. package/views/2d/engine/webgl/GroupContainer.js +1 -1
  97. package/views/2d/engine/webgl/Painter.js +1 -1
  98. package/views/2d/engine/webgl/WGLContainer.js +1 -1
  99. package/views/2d/engine/webgl/WorldExtentClipRenderer.js +1 -1
  100. package/views/2d/engine/webgl/effects/FeatureEffect.js +1 -1
  101. package/views/2d/engine/webgl/effects/HighlightEffect.js +1 -1
  102. package/views/2d/engine/webgl/effects/HittestEffectVTL.js +1 -1
  103. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  104. package/views/2d/layers/MediaLayerView2D.js +1 -1
  105. package/views/2d/layers/TileLayerView2D.js +1 -1
  106. package/views/2d/layers/features/tileRenderers/support/WGLFeatureView.js +1 -1
  107. package/views/2d/layers/graphics/BaseGraphicContainer.js +1 -1
  108. package/views/2d/layers/graphics/GraphicContainer.js +1 -1
  109. package/views/2d/layers/graphics/GraphicsView2D.js +1 -1
  110. package/views/2d/layers/graphics/HighlightGraphicContainer.js +1 -1
  111. package/views/2d/layers/support/DisplayGL.js +1 -1
  112. package/views/2d/webglDeps.js +1 -1
  113. package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
  114. package/views/3d/interactive/visualElements/ParallelLineVisualElement.js +1 -1
  115. package/views/3d/interactive/visualElements/PointVisualElement.js +1 -1
  116. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  117. package/views/3d/layers/SceneLayerView3D.js +1 -1
  118. package/views/3d/layers/graphics/ElevationAligners.js +1 -1
  119. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  120. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  121. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  122. package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
  123. package/views/3d/layers/graphics/Labeler.js +1 -1
  124. package/views/3d/layers/graphics/graphicUtils.js +1 -1
  125. package/views/3d/layers/i3s/featureEditing.js +1 -1
  126. package/views/3d/layers/support/StageLayerElevationProvider.js +1 -1
  127. package/views/3d/support/buffer/glUtil.js +1 -1
  128. package/views/3d/support/engineContent/line.js +1 -1
  129. package/views/3d/support/viewpointUtils.js +1 -1
  130. package/views/3d/webgl-engine/Stage.js +1 -1
  131. package/views/3d/webgl-engine/effects/RenderPluginInput.js +1 -1
  132. package/views/3d/webgl-engine/effects/highlight/Highlight.js +1 -1
  133. package/views/3d/webgl-engine/effects/highlight/ShadowHighlight.js +1 -1
  134. package/views/3d/webgl-engine/effects/smaa/SMAA.js +1 -1
  135. package/views/3d/webgl-engine/effects/ssao/SSAO.js +1 -1
  136. package/views/3d/webgl-engine/lib/Geometry.js +1 -1
  137. package/views/3d/webgl-engine/lib/ModelDirtySet.js +1 -1
  138. package/views/3d/webgl-engine/lib/Object3D.js +1 -1
  139. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  140. package/views/3d/webgl-engine/lib/TextRenderer.js +1 -1
  141. package/views/3d/webgl-engine/lib/TextTextureAtlas.js +1 -1
  142. package/views/3d/webgl-engine/lib/TextTextureFactory.js +1 -1
  143. package/views/3d/webgl-engine/lib/VertexAttribute.js +1 -1
  144. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  145. package/views/3d/webgl-engine/lib/edgeRendering/bufferLayouts.js +1 -1
  146. package/views/3d/webgl-engine/lib/edgeRendering/edgeProcessing.js +1 -1
  147. package/views/View.js +1 -1
  148. package/views/interactive/tooltip/TooltipContentWithHelpMessage.js +1 -1
  149. package/views/interactive/tooltip/TooltipEditableField.js +1 -1
  150. package/views/interactive/tooltip/constraintUtils.js +1 -1
  151. package/views/interactive/tooltip/content/Fields.js +1 -1
  152. package/views/interactive/tooltip/content/TooltipContentDrawCircle.js +1 -1
  153. package/views/interactive/tooltip/content/TooltipContentDrawMesh.js +1 -1
  154. package/views/interactive/tooltip/content/TooltipContentDrawPoint.js +1 -1
  155. package/views/interactive/tooltip/content/TooltipContentDrawPolygon.js +1 -1
  156. package/views/interactive/tooltip/content/TooltipContentDrawPolyline.js +1 -1
  157. package/views/interactive/tooltip/content/TooltipContentDrawRectangle.js +1 -1
  158. package/views/interactive/tooltip/content/TooltipContentExtentRotate.js +1 -1
  159. package/views/interactive/tooltip/content/TooltipContentExtentScale.js +1 -1
  160. package/views/interactive/tooltip/content/TooltipContentReshapeEdgeOffset.js +1 -1
  161. package/views/interactive/tooltip/content/TooltipContentTransformAbsolute.js +1 -1
  162. package/views/interactive/tooltip/content/TooltipContentTransformRotate.js +1 -1
  163. package/views/interactive/tooltip/content/TooltipContentTransformScale.js +1 -1
  164. package/views/interactive/tooltip/content/TooltipContentTranslateGraphic.js +1 -1
  165. package/views/interactive/tooltip/content/TooltipContentTranslateGraphicXY.js +1 -1
  166. package/views/interactive/tooltip/content/TooltipContentTranslateGraphicZ.js +1 -1
  167. package/views/interactive/tooltip/content/TooltipContentTranslateVertex.js +1 -1
  168. package/views/interactive/tooltip/content/TooltipContentTranslateVertexXY.js +1 -1
  169. package/views/interactive/tooltip/content/TooltipContentTranslateVertexZ.js +1 -1
  170. package/views/support/angularMeasurementUtils.js +1 -1
  171. package/views/webgl/Texture.js +1 -1
  172. package/views/webgl/contextUtils.js +1 -1
  173. package/widgets/AreaMeasurement2D.js +1 -1
  174. package/widgets/AreaMeasurement3D.js +1 -1
  175. package/widgets/Attachments.js +1 -1
  176. package/widgets/Attribution.js +1 -1
  177. package/widgets/BasemapGallery.js +1 -1
  178. package/widgets/BasemapLayerList.js +1 -1
  179. package/widgets/BasemapToggle.js +1 -1
  180. package/widgets/Bookmarks.js +1 -1
  181. package/widgets/BuildingExplorer/BuildingDisciplinesTree/BuildingDisciplinesNode.js +1 -1
  182. package/widgets/BuildingExplorer/BuildingDisciplinesTree/BuildingDisciplinesTree.js +1 -1
  183. package/widgets/BuildingExplorer/BuildingLevelPicker/BuildingLevelPicker.js +1 -1
  184. package/widgets/BuildingExplorer/BuildingLevelPicker/Label.js +1 -1
  185. package/widgets/BuildingExplorer/BuildingLevelPicker/LevelItem.js +1 -1
  186. package/widgets/BuildingExplorer/BuildingPhasePicker/BuildingPhasePicker.js +1 -1
  187. package/widgets/BuildingExplorer.js +1 -1
  188. package/widgets/Compass.js +1 -1
  189. package/widgets/CoordinateConversion.js +1 -1
  190. package/widgets/Daylight/support/SliderWithDropdown.js +1 -1
  191. package/widgets/Daylight.js +1 -1
  192. package/widgets/DirectLineMeasurement3D.js +1 -1
  193. package/widgets/DirectionalPad.js +1 -1
  194. package/widgets/Directions/components/SaveLayer.js +1 -1
  195. package/widgets/Directions.js +1 -1
  196. package/widgets/DistanceMeasurement2D.js +1 -1
  197. package/widgets/Editor/components/FooterActions.js +1 -1
  198. package/widgets/Editor/components/Notices.js +1 -1
  199. package/widgets/Editor/components/PanelContent.js +1 -1
  200. package/widgets/Editor/components/PanelToolbar.js +1 -1
  201. package/widgets/Editor/components/Prompt.js +1 -1
  202. package/widgets/Editor/components/Settings.js +1 -1
  203. package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
  204. package/widgets/Editor/components/UploadDetails.js +1 -1
  205. package/widgets/Editor.js +1 -1
  206. package/widgets/ElevationProfile/components/LegendItem.js +1 -1
  207. package/widgets/ElevationProfile/components/SettingsButton.js +1 -1
  208. package/widgets/ElevationProfile/components/Statistics.js +1 -1
  209. package/widgets/ElevationProfile.js +1 -1
  210. package/widgets/Expand.js +1 -1
  211. package/widgets/Feature/FeatureContent.js +1 -1
  212. package/widgets/Feature/FeatureExpression.js +1 -1
  213. package/widgets/Feature/FeatureFields.js +1 -1
  214. package/widgets/Feature/FeatureMedia.js +1 -1
  215. package/widgets/Feature/FeatureRelationship.js +1 -1
  216. package/widgets/Feature/support/FeatureContentMixin.js +1 -1
  217. package/widgets/Feature/support/FeatureElementInfo.js +1 -1
  218. package/widgets/Feature.js +1 -1
  219. package/widgets/FeatureForm.js +1 -1
  220. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  221. package/widgets/FeatureTable/Grid/Grid.js +1 -1
  222. package/widgets/FeatureTable/Grid/support/ButtonMenu.js +1 -1
  223. package/widgets/FeatureTable.js +1 -1
  224. package/widgets/FeatureTemplates/ItemList.js +1 -1
  225. package/widgets/FeatureTemplates.js +1 -1
  226. package/widgets/Features/FeaturesRelatedRecords.js +1 -1
  227. package/widgets/Features.js +1 -1
  228. package/widgets/FloorFilter.js +1 -1
  229. package/widgets/Fullscreen.js +1 -1
  230. package/widgets/Histogram.js +1 -1
  231. package/widgets/HistogramRangeSlider.js +1 -1
  232. package/widgets/Home.js +1 -1
  233. package/widgets/LayerList/ListItemPanel.js +1 -1
  234. package/widgets/LayerList.js +1 -1
  235. package/widgets/Legend/styles/Card.js +1 -1
  236. package/widgets/Legend/styles/Classic.js +1 -1
  237. package/widgets/Legend/styles/support/relationshipUtils.js +1 -1
  238. package/widgets/Legend/styles/support/univariateUtils.js +1 -1
  239. package/widgets/LineOfSight.js +1 -1
  240. package/widgets/Locate.js +1 -1
  241. package/widgets/NavigationToggle.js +1 -1
  242. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  243. package/widgets/OrientedImageryViewer.js +1 -1
  244. package/widgets/Popup.js +1 -1
  245. package/widgets/Print.js +1 -1
  246. package/widgets/ScaleRangeSlider.js +1 -1
  247. package/widgets/Search/SearchResultRenderer.js +1 -1
  248. package/widgets/Search.js +1 -1
  249. package/widgets/ShadowCast/components/DiscreteConfigurator.js +1 -1
  250. package/widgets/ShadowCast/components/DurationConfigurator.js +1 -1
  251. package/widgets/ShadowCast/components/ShadowTooltipContent.js +1 -1
  252. package/widgets/ShadowCast/components/ThresholdConfigurator.js +1 -1
  253. package/widgets/ShadowCast.js +1 -1
  254. package/widgets/Sketch.js +1 -1
  255. package/widgets/Slice.js +1 -1
  256. package/widgets/Slider.js +1 -1
  257. package/widgets/Swipe.js +1 -1
  258. package/widgets/TableList.js +1 -1
  259. package/widgets/TimeSlider.js +1 -1
  260. package/widgets/Track.js +1 -1
  261. package/widgets/UtilityNetworkAssociations/UtilityNetworkAssociationsLineSymbolPicker.js +1 -1
  262. package/widgets/UtilityNetworkAssociations.js +1 -1
  263. package/widgets/UtilityNetworkTrace.js +1 -1
  264. package/widgets/UtilityNetworkValidateTopology.js +1 -1
  265. package/widgets/ValuePicker.js +1 -1
  266. package/widgets/VideoPlayer/components/PlayerControlsGroup.js +1 -1
  267. package/widgets/VideoPlayer/components/SettingsButton.js +1 -1
  268. package/widgets/VideoPlayer.js +1 -1
  269. package/widgets/Weather/LabeledSlider.js +1 -1
  270. package/widgets/Weather.js +1 -1
  271. package/widgets/Zoom/IconButton.js +1 -1
  272. package/widgets/smartMapping/BinaryColorSizeSlider.js +1 -1
  273. package/widgets/smartMapping/ClassedColorSlider.js +1 -1
  274. package/widgets/smartMapping/ClassedSizeSlider.js +1 -1
  275. package/widgets/smartMapping/ColorSizeSlider.js +1 -1
  276. package/widgets/smartMapping/ColorSlider.js +1 -1
  277. package/widgets/smartMapping/HeatmapSlider.js +1 -1
  278. package/widgets/smartMapping/OpacitySlider.js +1 -1
  279. package/widgets/smartMapping/SizeSlider.js +1 -1
  280. package/widgets/smartMapping/SmartMappingSliderBase.js +1 -1
  281. package/widgets/support/ColorPicker.js +1 -1
  282. package/widgets/support/DatePicker.js +1 -1
  283. package/widgets/support/Heading.js +1 -1
  284. package/widgets/support/LabeledSwitch.js +1 -1
  285. package/widgets/support/MeasurementWidgetContent.js +1 -1
  286. package/widgets/support/Popover.js +1 -1
  287. package/widgets/support/SelectionToolbar.js +1 -1
  288. package/widgets/support/SketchTooltipControls.js +1 -1
  289. package/widgets/support/SnappingControls.js +1 -1
  290. package/widgets/support/TimePicker.js +1 -1
  291. package/widgets/support/TimezonePicker.js +1 -1
  292. package/widgets/support/UnitSelect.js +1 -1
  293. package/assets/esri/core/workers/chunks/092920c25cac89c038ee.js +0 -1
  294. package/assets/esri/core/workers/chunks/1b3655f5bf5d90fa8730.js +0 -1
  295. package/assets/esri/core/workers/chunks/1cf7bb514e7eefc3e9c6.js +0 -1
  296. package/assets/esri/core/workers/chunks/24629402c647ef6b5f6b.js +0 -1
  297. package/assets/esri/core/workers/chunks/2d0d03cbea83c868edba.js +0 -1
  298. package/assets/esri/core/workers/chunks/2e130cb2f1038055c07b.js +0 -1
  299. package/assets/esri/core/workers/chunks/4369a6c1e0a82ab4db6a.js +0 -1
  300. package/assets/esri/core/workers/chunks/4f4a424d1747d04501df.js +0 -1
  301. package/assets/esri/core/workers/chunks/59c00d6fba0fd1c03d01.js +0 -1
  302. package/assets/esri/core/workers/chunks/650a317b6dc245a7060f.js +0 -1
  303. package/assets/esri/core/workers/chunks/7a358b1fd0c0cce59e9b.js +0 -1
  304. package/assets/esri/core/workers/chunks/83d1a1b3d371c991cc4c.js +0 -1
  305. package/assets/esri/core/workers/chunks/c4bb67150ccd01ea6014.js +0 -1
  306. package/assets/esri/core/workers/chunks/c60cf62f374e71e562fc.js +0 -1
  307. package/assets/esri/core/workers/chunks/c8f239c25fe864f0e47a.js +0 -1
  308. package/assets/esri/core/workers/chunks/cad260881653567bc8f9.js +0 -1
  309. package/assets/esri/core/workers/chunks/e55f7fc7eff0074ce0fc.js +0 -1
  310. package/assets/esri/core/workers/chunks/eef27d305023034084a4.js +0 -1
  311. package/assets/esri/core/workers/chunks/f38c54ada9e7012a2960.js +0 -1
  312. package/core/watchUtils.d.ts +0 -4
  313. package/core/watchUtils.js +0 -5
@@ -1 +1 @@
1
- (self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[6571,661,5234],{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},46791:(e,t,r)=>{"use strict";r.d(t,{Z:()=>O});var s,i=r(43697),n=r(3894),o=r(32448),a=r(50758),l=r(22974),h=r(71143);!function(e){e[e.ADD=1]="ADD",e[e.REMOVE=2]="REMOVE",e[e.MOVE=4]="MOVE"}(s||(s={}));var c,d=r(1654),u=r(75215),p=r(58971),f=r(5600),_=r(52421),m=r(52011),g=r(10661);class v{constructor(e,t,r,s,i){this.target=e,this.added=t,this.removed=r,this.start=s,this.deleteCount=i}}const y=new h.Z(class{constructor(){this.target=null,this.cancellable=!1,this.defaultPrevented=!1,this.item=void 0,this.type=void 0}preventDefault(){this.cancellable&&(this.defaultPrevented=!0)}reset(e){this.defaultPrevented=!1,this.item=e}},void 0,(e=>{e.item=null,e.target=null,e.defaultPrevented=!1,e.cancellable=!1}));function w(e){return e?e instanceof x?e.toArray():e.length?Array.prototype.slice.apply(e):[]:[]}function b(e){if(e&&e.length)return e[0]}function S(e,t,r,s){const i=Math.min(e.length-r,t.length-s);let n=0;for(;n<i&&e[r+n]===t[s+n];)n++;return n}function I(e,t,r,s){t&&t.forEach(((t,i,n)=>{e.push(t),I(e,r.call(s,t,i,n),r,s)}))}const A=new Set,k=new Set,C=new Set,T=new Map;let U=0,x=c=class extends o.Z.EventedAccessor{static isCollection(e){return null!=e&&e instanceof c}constructor(e){super(e),this._chgListeners=[],this._notifications=null,this._timer=null,this._observable=new g.s,this.length=0,this._items=[],Object.defineProperty(this,"uid",{value:U++})}normalizeCtorArgs(e){return e?Array.isArray(e)||e instanceof c?{items:e}:e:{}}destroy(){this._removeAllRaw()}*[Symbol.iterator](){yield*this.items}get items(){return(0,p.it)(this._observable),this._items}set items(e){this._emitBeforeChanges(s.ADD)||(this._splice(0,this.length,w(e)),this._emitAfterChanges(s.ADD))}hasEventListener(e){return"change"===e?this._chgListeners.length>0:this._emitter.hasEventListener(e)}on(e,t){if("change"===e){const e=this._chgListeners,r={removed:!1,callback:t};return e.push(r),this._notifications&&this._notifications.push({listeners:e.slice(),items:this._items.slice(),changes:[]}),(0,a.kB)((()=>{r.removed=!0,e.splice(e.indexOf(r),1)}))}return this._emitter.on(e,t)}once(e,t){const r="deref"in t?()=>t.deref():()=>t,s=this.on(e,(e=>{r()?.call(null,e),s.remove()}));return s}add(e,t){if((0,p.it)(this._observable),this._emitBeforeChanges(s.ADD))return this;const r=this.getNextIndex(t??null);return this._splice(r,0,[e]),this._emitAfterChanges(s.ADD),this}addMany(e,t=this._items.length){if((0,p.it)(this._observable),!e||!e.length)return this;if(this._emitBeforeChanges(s.ADD))return this;const r=this.getNextIndex(t);return this._splice(r,0,w(e)),this._emitAfterChanges(s.ADD),this}at(e){if((0,p.it)(this._observable),(e=Math.trunc(e)||0)<0&&(e+=this.length),!(e<0||e>=this.length))return this._items[e]}removeAll(){if((0,p.it)(this._observable),!this.length||this._emitBeforeChanges(s.REMOVE))return[];const e=this._removeAllRaw();return this._emitAfterChanges(s.REMOVE),e}_removeAllRaw(){return 0===this.length?[]:this._splice(0,this.length)||[]}clone(){return(0,p.it)(this._observable),this._createNewInstance({items:this._items.map(l.d9)})}concat(...e){(0,p.it)(this._observable);const t=e.map(w);return this._createNewInstance({items:this._items.concat(...t)})}drain(e,t){if((0,p.it)(this._observable),!this.length||this._emitBeforeChanges(s.REMOVE))return;const r=this._splice(0,this.length),i=r.length;for(let s=0;s<i;s++)e.call(t,r[s],s,r);this._emitAfterChanges(s.REMOVE)}every(e,t){return(0,p.it)(this._observable),this._items.every(e,t)}filter(e,t){let r;return(0,p.it)(this._observable),r=2===arguments.length?this._items.filter(e,t):this._items.filter(e),this._createNewInstance({items:r})}find(e,t){return(0,p.it)(this._observable),this._items.find(e,t)}findIndex(e,t){return(0,p.it)(this._observable),this._items.findIndex(e,t)}flatten(e,t){(0,p.it)(this._observable);const r=[];return I(r,this,e,t),new c(r)}forEach(e,t){return(0,p.it)(this._observable),this._items.forEach(e,t)}getItemAt(e){return(0,p.it)(this._observable),this._items[e]}getNextIndex(e){(0,p.it)(this._observable);const t=this.length;return(e=e??t)<0?e=0:e>t&&(e=t),e}includes(e,t=0){return(0,p.it)(this._observable),this._items.includes(e,t)}indexOf(e,t=0){return(0,p.it)(this._observable),this._items.indexOf(e,t)}join(e=","){return(0,p.it)(this._observable),this._items.join(e)}lastIndexOf(e,t=this.length-1){return(0,p.it)(this._observable),this._items.lastIndexOf(e,t)}map(e,t){(0,p.it)(this._observable);const r=this._items.map(e,t);return new c({items:r})}reorder(e,t=this.length-1){(0,p.it)(this._observable);const r=this.indexOf(e);if(-1!==r){if(t<0?t=0:t>=this.length&&(t=this.length-1),r!==t){if(this._emitBeforeChanges(s.MOVE))return e;this._splice(r,1),this._splice(t,0,[e]),this._emitAfterChanges(s.MOVE)}return e}}pop(){if((0,p.it)(this._observable),!this.length||this._emitBeforeChanges(s.REMOVE))return;const e=b(this._splice(this.length-1,1));return this._emitAfterChanges(s.REMOVE),e}push(...e){return(0,p.it)(this._observable),this._emitBeforeChanges(s.ADD)||(this._splice(this.length,0,e),this._emitAfterChanges(s.ADD)),this.length}reduce(e,t){(0,p.it)(this._observable);const r=this._items;return 2===arguments.length?r.reduce(e,t):r.reduce(e)}reduceRight(e,t){(0,p.it)(this._observable);const r=this._items;return 2===arguments.length?r.reduceRight(e,t):r.reduceRight(e)}remove(e){return(0,p.it)(this._observable),this.removeAt(this.indexOf(e))}removeAt(e){if((0,p.it)(this._observable),e<0||e>=this.length||this._emitBeforeChanges(s.REMOVE))return;const t=b(this._splice(e,1));return this._emitAfterChanges(s.REMOVE),t}removeMany(e){if((0,p.it)(this._observable),!e||!e.length||this._emitBeforeChanges(s.REMOVE))return[];const t=e instanceof c?e.toArray():e,r=this._items,i=[],n=t.length;for(let e=0;e<n;e++){const s=t[e],n=r.indexOf(s);if(n>-1){const s=1+S(t,r,e+1,n+1),o=this._splice(n,s);o&&o.length>0&&i.push.apply(i,o),e+=s-1}}return this._emitAfterChanges(s.REMOVE),i}reverse(){if((0,p.it)(this._observable),this._emitBeforeChanges(s.MOVE))return this;const e=this._splice(0,this.length);return e&&(e.reverse(),this._splice(0,0,e)),this._emitAfterChanges(s.MOVE),this}shift(){if((0,p.it)(this._observable),!this.length||this._emitBeforeChanges(s.REMOVE))return;const e=b(this._splice(0,1));return this._emitAfterChanges(s.REMOVE),e}slice(e=0,t=this.length){return(0,p.it)(this._observable),this._createNewInstance({items:this._items.slice(e,t)})}some(e,t){return(0,p.it)(this._observable),this._items.some(e,t)}sort(e){if((0,p.it)(this._observable),!this.length||this._emitBeforeChanges(s.MOVE))return this;const t=this._splice(0,this.length);return arguments.length?t.sort(e):t.sort(),this._splice(0,0,t),this._emitAfterChanges(s.MOVE),this}splice(e,t,...r){(0,p.it)(this._observable);const i=(t?s.REMOVE:0)|(r.length?s.ADD:0);if(this._emitBeforeChanges(i))return[];const n=this._splice(e,t,r)||[];return this._emitAfterChanges(i),n}toArray(){return(0,p.it)(this._observable),this._items.slice()}toJSON(){return(0,p.it)(this._observable),this.toArray()}toLocaleString(){return(0,p.it)(this._observable),this._items.toLocaleString()}toString(){return(0,p.it)(this._observable),this._items.toString()}unshift(...e){return(0,p.it)(this._observable),!e.length||this._emitBeforeChanges(s.ADD)||(this._splice(0,0,e),this._emitAfterChanges(s.ADD)),this.length}_createNewInstance(e){return new this.constructor(e)}_splice(e,t,r){const s=this._items,i=this.itemType;let n,o;if(!this._notifications&&this.hasEventListener("change")&&(this._notifications=[{listeners:this._chgListeners.slice(),items:this._items.slice(),changes:[]}],this._timer&&this._timer.remove(),this._timer=(0,d.Os)((()=>this._dispatchChange()))),e<0&&(e+=this.length),t){if(o=s.splice(e,t),this.hasEventListener("before-remove")){const t=y.acquire();t.target=this,t.cancellable=!0;for(let r=0,i=o.length;r<i;r++)n=o[r],t.reset(n),this.emit("before-remove",t),t.defaultPrevented&&(o.splice(r,1),s.splice(e,0,n),e+=1,r-=1,i-=1);y.release(t)}if(this.length=this._items.length,this.hasEventListener("after-remove")){const e=y.acquire();e.target=this,e.cancellable=!1;const t=o.length;for(let r=0;r<t;r++)e.reset(o[r]),this.emit("after-remove",e);y.release(e)}}if(r&&r.length){if(i){const e=[];for(const t of r){const r=i.ensureType(t);null==r&&null!=t||e.push(r)}r=e}const t=this.hasEventListener("before-add"),n=this.hasEventListener("after-add"),o=e===this.length;if(t||n){const i=y.acquire();i.target=this,i.cancellable=!0;const a=y.acquire();a.target=this,a.cancellable=!1;for(const l of r)t?(i.reset(l),this.emit("before-add",i),i.defaultPrevented||(o?s.push(l):s.splice(e++,0,l),this._set("length",s.length),n&&(a.reset(l),this.emit("after-add",a)))):(o?s.push(l):s.splice(e++,0,l),this._set("length",s.length),a.reset(l),this.emit("after-add",a));y.release(a),y.release(i)}else{if(o)for(const e of r)s.push(e);else s.splice(e,0,...r);this._set("length",s.length)}}if((r&&r.length||o&&o.length)&&this._notifyChangeEvent(r,o),this.hasEventListener("after-splice")){const s=new v(this,r,o,e,t);this.emit("after-splice",s)}return o}_emitBeforeChanges(e){let t=!1;if(this.hasEventListener("before-changes")){const r=y.acquire();r.target=this,r.cancellable=!0,r.type=e,this.emit("before-changes",r),t=r.defaultPrevented,y.release(r)}return t}_emitAfterChanges(e){if(this.hasEventListener("after-changes")){const t=y.acquire();t.target=this,t.cancellable=!1,t.type=e,this.emit("after-changes",t),y.release(t)}this._observable.notify()}_notifyChangeEvent(e,t){this.hasEventListener("change")&&this._notifications&&this._notifications[this._notifications.length-1].changes.push({added:e,removed:t})}_dispatchChange(){if(this._timer&&(this._timer.remove(),this._timer=null),!this._notifications)return;const e=this._notifications;this._notifications=null;for(const t of e){const e=t.changes;A.clear(),k.clear(),C.clear();for(const{added:t,removed:r}of e){if(t)if(0===C.size&&0===k.size)for(const e of t)A.add(e);else for(const e of t)k.has(e)?(C.add(e),k.delete(e)):C.has(e)||A.add(e);if(r)if(0===C.size&&0===A.size)for(const e of r)k.add(e);else for(const e of r)A.has(e)?A.delete(e):(C.delete(e),k.add(e))}const r=n.Z.acquire();A.forEach((e=>{r.push(e)}));const s=n.Z.acquire();k.forEach((e=>{s.push(e)}));const i=this._items,o=t.items,a=n.Z.acquire();if(C.forEach((e=>{o.indexOf(e)!==i.indexOf(e)&&a.push(e)})),t.listeners&&(r.length||s.length||a.length)){const e={target:this,added:r,removed:s,moved:a},i=t.listeners.length;for(let r=0;r<i;r++){const s=t.listeners[r];s.removed||s.callback.call(this,e)}}n.Z.release(r),n.Z.release(s),n.Z.release(a)}A.clear(),k.clear(),C.clear()}};x.ofType=e=>{if(!e)return c;if(T.has(e))return T.get(e);let t=null;if("function"==typeof e)t=e.prototype.declaredClass;else if(e.base)t=e.base.prototype.declaredClass;else for(const r in e.typeMap){const s=e.typeMap[r].prototype.declaredClass;t?t+=` | ${s}`:t=s}let r=class extends c{};return(0,i._)([(0,_.c)({Type:e,ensureType:"function"==typeof e?(0,u.se)(e):(0,u.N7)(e)})],r.prototype,"itemType",void 0),r=(0,i._)([(0,m.j)(`esri.core.Collection<${t}>`)],r),T.set(e,r),r},(0,i._)([(0,f.Cb)()],x.prototype,"length",void 0),(0,i._)([(0,f.Cb)()],x.prototype,"items",null),x=c=(0,i._)([(0,m.j)("esri.core.Collection")],x);const O=x},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){let r=this._listenersMap?.get(e);if(!r)return!1;const s=this._target||this;let i=!1;for(const e of r.slice()){const r="deref"in e?e.deref():e;r?r?.call(s,t):i=!0}return i&&(r=r.filter((e=>!("deref"in e)||null!=e.deref())),this._listenersMap.set(e,r)),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??=new Map;const r=this._listenersMap.get(e)||[];return r.push(t),this._listenersMap.set(e,r),(0,n.kB)((()=>{const r=this._listenersMap?.get(e),s=r?.indexOf(t)??-1;s>=0&&r.splice(s,1)}))}once(e,t){const r=this.on(e,(e=>{r.remove();const s="deref"in t?t.deref():t;s?.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:()=>d,v:()=>c});var s,i,n=r(43697),o=r(92036),a=r(95330),l=r(52011);(i=s||(s={}))[i.PENDING=0]="PENDING",i[i.RESOLVED=1]="RESOLVED",i[i.REJECTED=2]="REJECTED";class h{constructor(){this._resolver=(0,a.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,a.zE)())}_cleanUp(){this._allPromise=null,this._resolvingPromises=null}_tryResolve(){if(this.isFulfilled())return;const e=(0,a.hh)(),t=[...this._resolvingPromises,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,a.D_)(e)||this._resolver.reject(e)})),e.resolve()}}const c=e=>{let t=class extends e{constructor(...e){super(...e),this._promiseProps=new h,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,l.j)("esri.core.Promise")],t),t};let d=class extends(c(o.Z)){};d=(0,n._)([(0,l.j)("esri.core.Promise")],d)},90578:(e,t,r)=>{"use strict";r.d(t,{p:()=>l});var s=r(75215),i=r(7628);const n=Object.prototype.toString;function o(e){const t="__accessorMetadata__"in e?(0,s.se)(e):e;return function(...e){if(e.push(t),"number"==typeof e[2])throw new Error("Using @cast has parameter decorator is not supported since 4.16");return a.apply(this,e)}}function a(e,t,r,s){(0,i.Oe)(e,t).cast=s}function l(...e){if(3!==e.length||"string"!=typeof e[1])return 1===e.length&&"[object Function]"===n.call(e[0])?o(e[0]):1===e.length&&"string"==typeof e[0]?function(e){return(t,r)=>{(0,i.Oe)(t,e).cast=t[r]}}(e[0]):void 0}},52421:(e,t,r)=>{"use strict";function s(e){return(t,r)=>{t[r]=e}}r.d(t,{c:()=>s})},10661:(e,t,r)=>{"use strict";r.d(t,{s:()=>i});var s=r(42100);class i extends s.s{notify(){const e=this._observers;if(e&&e.length>0){const t=e.slice();for(const e of t)e.onInvalidated(),e.onCommitted()}}}},66643:(e,t,r)=>{"use strict";r.d(t,{Ed:()=>h,UI:()=>c,mt:()=>f,q6:()=>p,vr:()=>_});var s=r(43697),i=r(92036),n=r(70586),o=r(95330),a=r(5600),l=r(52011);function h(e,t,r){return(0,o.as)(e.map(((e,s)=>t.apply(r,[e,s]))))}async function c(e,t,r){return(await(0,o.as)(e.map(((e,s)=>t.apply(r,[e,s]))))).map((e=>e.value))}function d(e){return{ok:!0,value:e}}function u(e){return{ok:!1,error:e}}async function p(e){if(null==e)return{ok:!1,error:new Error("no promise provided")};try{return d(await e)}catch(e){return u(e)}}async function f(e){try{return d(await e)}catch(e){return(0,o.r9)(e),u(e)}}function _(e,t){return new m(e,t)}let m=class extends i.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,n.IM)(this._abortController)},this.remove=this.abort,this._abortController=new AbortController;const{signal:r}=this._abortController;this.promise=e(r),this.promise.then((e=>{this._result=d(e),this._cleanup()}),(e=>{this._result=u(e),this._cleanup()})),this._abortHandle=(0,o.fu)(t,this.abort)}normalizeCtorArgs(){return{}}destroy(){this.abort()}_cleanup(){this._abortHandle=(0,n.hw)(this._abortHandle),this._abortController=null}};(0,s._)([(0,a.Cb)()],m.prototype,"value",null),(0,s._)([(0,a.Cb)()],m.prototype,"error",null),(0,s._)([(0,a.Cb)()],m.prototype,"finished",null),(0,s._)([(0,a.Cb)()],m.prototype,"promise",void 0),(0,s._)([(0,a.Cb)()],m.prototype,"_result",void 0),m=(0,s._)([(0,l.j)("esri.core.asyncUtils.ReactiveTask")],m)},35454:(e,t,r)=>{"use strict";r.d(t,{X:()=>i,w:()=>n});var s=r(78286);class i{constructor(e,t={ignoreUnknown:!1,useNumericKeys:!1}){this._jsonToAPI=e,this._options=t,this.apiValues=[],this.jsonValues=[],this._apiToJSON=this._invertMap(e),this.apiValues=this._getKeysSorted(this._apiToJSON),this.jsonValues=this._getKeysSorted(this._jsonToAPI),this.read=e=>this.fromJSON(e),this.write=(e,t,r)=>{const i=this.toJSON(e);void 0!==i&&(0,s.RB)(r,i,t)},this.write.isJSONMapWriter=!0}toJSON(e){if(null==e)return null;if(this._apiToJSON.hasOwnProperty(e)){const t=this._apiToJSON[e];return this._options.useNumericKeys?+t:t}return this._options.ignoreUnknown?void 0:e}fromJSON(e){return null!=e&&this._jsonToAPI.hasOwnProperty(e)?this._jsonToAPI[e]:this._options.ignoreUnknown?void 0:e}_invertMap(e){const t={};for(const r in e)t[e[r]]=r;return t}_getKeysSorted(e){const t=[];for(const r in e)t.push(r);return t.sort(),t}}function n(){return function(e,t){return new i(e,{ignoreUnknown:!0,...t})}}},17445:(e,t,r)=>{"use strict";r.d(t,{N1:()=>u,YP:()=>l,Z_:()=>_,gx:()=>h,nn:()=>m,on:()=>d,tX:()=>g}),r(66643),r(46791);var s=r(91460),i=r(50758),n=r(70586),o=r(95330),a=r(26258);function l(e,t,r={}){return c(e,t,r,p)}function h(e,t,r={}){return c(e,t,r,f)}function c(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 d(e,t,r,o={}){let a=null,h=null,c=null;function d(){a&&h&&(h.remove(),o.onListenerRemove?.(a),a=null,h=null)}function u(e){o.once&&o.once&&(0,n.hw)(c),r(e)}const p=l(e,((e,r)=>{d(),(0,s.vT)(e)&&(a=e,h=(0,s.on)(e,t,u),o.onListenerAdd?.(e))}),{sync:o.sync,initial:!0});return c=(0,i.kB)((()=>{p.remove(),d()})),c}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)())})),c(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 _={sync:!0},m={initial:!0},g={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()}}`}},53865:(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),c=r(22974),d=r(78286),u=r(95330),p=r(17445),f=r(17452),_=r(5600),m=(r(75215),r(52011)),g=(r(67676),r(80442),r(940)),v=(r(2587),r(60235));Element.prototype.closest;var y=r(92604),w=r(70586),b=r(609),S=r(41123),I=r(90578),A=r(58971),k=r(38805),C=r(8728),T=r(3894),U=r(50758);const x=new Map;function O(){x.clear()}function P(e){x.delete(e)}y.Z.getLogger("esri.widgets.support.widgetUtils");function E(e){const t=T.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 T.Z.release(t),r}function R(e){this[e.getAttribute("data-node-ref")]=e}(()=>{const e=new Map;new ResizeObserver((t=>{O();for(const r of t)e.get(r.target)?.(r)}))})();const D=["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 C.Z({whiteList:D,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`,B=`${j}1999/xlink`;let q=[],V=(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},Z=(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),$=e=>{if("string"!=typeof e)throw new Error("Style values must be strings")},F=(e,t,r)=>{if(""!==t.vnodeSelector)for(let s=r;s<e.length;s++)if(Z(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(Z(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&&($(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(B,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),c=o.slice(n,l);"."===h?i.classList.add(c):"#"===h?i.id=c:("svg"===c&&(s=V(s,{namespace:M})),void 0!==s.namespace?i=e.domNode=a.createElementNS(s.namespace,c):(i=e.domNode=e.domNode||a.createElement(c),"input"===c&&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||q;let n,o=(r=r||q).length,a=s.length,l=0,h=0,c=!1;for(;h<a;){let a=l<o?r[l]:void 0,d=s[h];if(void 0!==a&&Z(a,d))c=te(a,d,i)||c,l++;else{let a=F(r,d,l+1);if(a>=0){for(n=l;n<a;n++)X(r[n]),z(r,n,e,"removed");c=te(r[a],d,i)||c,l=a+1}else se(d,t,l<o?r[l].domNode:void 0,i),H(d),z(s,h,e,"added")}h++}if(o>l)for(n=l;n<o;n++)X(r[n]),z(r,n,e,"removed");return c};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=V(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?($(o),s.styleApplyer(e,r,o)):s.styleApplyer(e,r,""))}}else if(l||"string"!=typeof h||(l=""),"value"!==o||ee(e)){if(l!==h){let t=typeof l;"function"===t&&s.eventHandlerInterceptor||(s.namespace===M?"href"===o?e.setAttributeNS(B,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)}}else{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)}}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=>V(ae,e),ce=(e,t,r)=>(r=he(r),se(t,e,void 0,r),oe(t,r)),de=(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]))},_e={namespace:void 0,performanceLogger:()=>{},eventHandlerInterceptor:void 0,styleApplyer:(e,t,r)=>{"-"===t.charAt(0)?e.style.setProperty(t,r):e.style[t]=r}},me=(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 ge=r(65161),ve=r(99880);let ye;ye="components/assets";const we=Symbol("widget"),be=Symbol("widget-test-data"),Se=[],Ie={},Ae=new WeakMap;function ke(e,t){let r=t.children;if(r&&r.length)for(let t=0;t<r.length;++t)r[t]=ke(e,r[t]);else r=Se;const s=t.vnodeSelector;if(xe(s)){const i=t.properties||Ie,n=i.key||s;return{vnodeSelector:"div",properties:{key:n,afterCreate:Ce,afterUpdate:Te,afterRemoved:Ue,parentWidget:e,widgetConstructor:s,widgetProperties:{...i,key:n,children:r}},children:void 0,text:void 0,domNode:null}}return t}function Ce(e,t,r,{parentWidget:s,widgetConstructor:i,widgetProperties:n}){const o=new i(n);o.container=e,Ae.set(e,o),o.afterCreate?.(o,e),s.addHandles((0,U.kB)((()=>Ue(e)))),queueMicrotask((()=>{o[be].projector.renderNow()}))}function Te(e,t,r,{widgetProperties:s}){const i=Ae.get(e);i&&(i.set(s),i.afterUpdate?.(i,e))}function Ue(e){const t=Ae.get(e);t&&(t.afterRemoved?.(t,e),t.destroy(),Ae.delete(e))}function xe(e){return"function"==typeof e&&e[we]}const Oe=new Set;var Pe,Ee=r(70171),Re=r(94443);let De=0;const Ne="esri-icon-checkbox-unchecked";function Le(e,t){for(const r in t)null!=e[r]&&("object"==typeof e[r]&&"object"==typeof t[r]?Le(e[r],t?.[r]):e[r]=t[r]);return e}const je=(e=>{let t;const r={...fe,...e},s=(n=r,{..._e,...n}),i=s.performanceLogger;var n;let o,a=!0,l=!1;const h=[],c=[],d=(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=me(a.getLastRender(),r,!0)}else n.reverse(),s=me(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),s.eventHandlerInterceptor=void 0,h.push(a),c.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=c[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,c)),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)=>{d(ce,e,t)},insertBefore:(e,t)=>{d(de,e,t)},merge:(e,t)=>{d(ue,e,t)},replace:(e,t)=>{d(pe,e,t)},detach:e=>{for(let t=0;t<c.length;t++)if(c[t]===e)return c.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))&&(O(),e.scheduleRender(),l[a].call(l.bind||r,s))}});let Me=!1,Be=class extends((0,b.v)(l.Z.EventedAccessor)){constructor(e,t){super(e,t),this._attached=!1,this._projector=je,this._readyForTrueRender=!1,this.iconClass=Ne,this.icon=null,this.key=this,this._loadLocale=(0,u.Ds)((async()=>{if(this._messageBundleProps?.length){const e=await Promise.allSettled(this._messageBundleProps.map((async({bundlePath:e,propertyName:t})=>{if(this.destroyed)return;let r=await(0,Re.ME)(e);this.uiStrings&&Object.keys(this.uiStrings)&&(r=Le((0,c.d9)(r),this.uiStrings)),this[t]=r})));if(this.destroyed)return;for(const t of e)"rejected"===t.status&&y.Z.getLogger(this).error("widget-intl:locale-error",this.declaredClass,t.reason)}await this.loadLocale()})),function(){try{(0,ge.K3)(".")}catch{(0,ge.YY)((0,f.hF)((0,ve.V)("components/assets")))}}();const r="esri-widget-uid-"+(0,S.D)(),s=this.render.bind(this);this._trackingTarget=new k.M((()=>this.scheduleRender()));const i=()=>{if(!this._readyForTrueRender||this.destroyed)return null;const e=s();let{properties:t}=e;t||(e.properties=t={});const{key:i}=t;if(i||(t.key=r),xe(e.vnodeSelector)){if(!this.visible)return{vnodeSelector:"div",properties:{key:`${r}-hidden`,class:"",styles:{display:"none"}},domNode:null,children:void 0,text:void 0}}else this.visible?t.styles||(t.styles={}):(t.class="",t.styles={display:"none"}),t.styles.display||(t.styles.display="");let n=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}--${n++}`)})),ke(this,e)};this.render=()=>{if(Me)return i();let e=function(e){return x.get(e)}(this)??null;if(e)return e;this._trackingTarget.clear(),Me=!0;try{e=(0,A.LJ)(this._trackingTarget,i)}catch(e){throw console.error(e),e}finally{Me=!1}return e&&function(e,t){x.set(e,t)}(this,e),e};const n=this.beforeFirstRender();var o;n?this._resourcesFetch=n.then((()=>{this._readyForTrueRender=!0,this._postInitialize()})):(this._resourcesFetch=Promise.resolve().then((()=>{this._postInitialize()})),this._readyForTrueRender=!0),this.addResolvingPromise(this._resourcesFetch),o=this._resourcesFetch,Oe.add(o),o.finally((()=>Oe.delete(o)))}normalizeCtorArgs(e,t){const r={...e};return t&&(r.container=t),r}postInitialize(){}beforeFirstRender(){const e=this.loadDependencies();return this._messageBundleProps?.length||e?Promise.all([e,this._loadLocale()]).then((()=>{})).catch(u.H9):null}loadDependencies(){return null}loadLocale(){return null}destroy(){this.destroyed||((0,w.SC)(this._trackingTarget),(0,w.SC)(this.viewModel),this._detach(this.container),this._set("container",null),this._emitter.clear(),this.render=()=>null,this._projector=null,P(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.container?.id||Date.now().toString(16)+"-widget-"+De++}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[(Pe=we,be)](){return{projector:this._projector}}render(){throw new Error("not implemented")}scheduleRender(){this.destroyed||(P(this),this._projector.scheduleRender())}own(e){(0,v.XV)(y.Z.getLogger(this.declaredClass),"`Widget.own()` is deprecated in favor of Widget.addHandles()'",{replacement:"Widget.addHandles()",version:"4.28"}),this.addHandles(e)}classes(...e){return E.apply(this,e)}renderNow(){P(this),this._projector.renderNow()}_postInitialize(){if(this.destroyed)return;this.scheduleRender(),this._delegatedEventNames?.length&&this.addHandles((0,p.YP)((()=>this.viewModel),((e,t)=>{t&&this.removeHandles("delegated-events"),e&&(0,h.vT)(e)&&this.addHandles(this._delegatedEventNames.map((t=>(0,h.on)(e,t,(e=>{this.emit(t,e)})))),"delegated-events")}),p.tX)),this.postInitialize();const e=async()=>{await this._loadLocale().catch(u.H9),this.scheduleRender()};this.addHandles([(0,Ee.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)}};Be[Pe]=!0,(0,i._)([(0,_.Cb)()],Be.prototype,"_readyForTrueRender",void 0),(0,i._)([(0,_.Cb)({value:null})],Be.prototype,"container",null),(0,i._)([(0,I.p)("container")],Be.prototype,"castContainer",null),(0,i._)([(0,_.Cb)()],Be.prototype,"iconClass",void 0),(0,i._)([(0,_.Cb)()],Be.prototype,"icon",void 0),(0,i._)([(0,_.Cb)()],Be.prototype,"id",null),(0,i._)([(0,_.Cb)()],Be.prototype,"label",null),(0,i._)([(0,_.Cb)()],Be.prototype,"renderable",null),(0,i._)([(0,_.Cb)()],Be.prototype,"uiStrings",void 0),(0,i._)([(0,_.Cb)()],Be.prototype,"viewModel",void 0),(0,i._)([(0,_.Cb)({value:!0})],Be.prototype,"visible",null),(0,i._)([(0,_.Cb)()],Be.prototype,"key",void 0),(0,i._)([(0,_.Cb)()],Be.prototype,"children",void 0),(0,i._)([(0,_.Cb)()],Be.prototype,"afterCreate",void 0),(0,i._)([(0,_.Cb)()],Be.prototype,"afterUpdate",void 0),(0,i._)([(0,_.Cb)()],Be.prototype,"afterRemoved",void 0),Be=(0,i._)([(0,m.j)("esri.widgets.Widget")],Be);const qe=Be;function Ve(e){return(t,r)=>{t.hasOwnProperty("_messageBundleProps")||(t._messageBundleProps=t._messageBundleProps?t._messageBundleProps.slice():[]),t._messageBundleProps.push({bundlePath:e,propertyName:r})}}var Ze=function(e){return{vnodeSelector:"",properties:void 0,children:void 0,text:e.toString(),domNode:null}},$e=function(e,t){for(var r=0,s=e.length;r<s;r++){var i=e[r];Array.isArray(i)?$e(i,t):null!=i&&!1!==i&&(i.hasOwnProperty("vnodeSelector")||(i=Ze(i)),t.push(i))}};function Fe(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 $e(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",He={base:ze,group:`${ze}__group`,label:`${ze}__label`,footer:`${ze}__footer`,esriInput:"esri-input",esriButton:"esri-button",esriButtonSecondary:"esri-button--secondary"};let Je=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=Fe("div",{class:He.group},(0,g.n)(i?n.oAuthInfo:n.info,{server:t&&/\.arcgis\.com/i.test(t)?"ArcGIS Online":t,resource:`(${r||n.lblItem})`})),a=i?null:Fe("div",{class:He.group,key:"username"},Fe("label",{class:He.label},n.lblUser,Fe("input",{value:"",required:!0,autocomplete:"off",spellcheck:!1,type:"text",bind:this,afterCreate:R,"data-node-ref":"_usernameInputNode",class:He.esriInput}))),l=i?null:Fe("div",{class:He.group,key:"password"},Fe("label",{class:He.label},n.lblPwd,Fe("input",{value:"",required:!0,type:"password",bind:this,afterCreate:R,"data-node-ref":"_passwordInputNode",class:He.esriInput}))),h=Fe("div",{class:this.classes(He.group,He.footer)},Fe("input",{type:"submit",disabled:!!s,value:s?n.lblSigning:n.lblOk,class:He.esriButton}),Fe("input",{type:"button",value:n.lblCancel,bind:this,onclick:this._cancel,class:this.classes(He.esriButton,He.esriButtonSecondary)})),c=e?Fe("div",null,e.details&&e.details.httpStatus?n.invalidUser:n.noAuthService):null;return Fe("form",{class:He.base,bind:this,onsubmit:this._submit},o,c,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,_.Cb)(),Ve("esri/identity/t9n/identity")],Je.prototype,"messages",void 0),(0,i._)([(0,_.Cb)()],Je.prototype,"signingIn",void 0),(0,i._)([(0,_.Cb)()],Je.prototype,"server",void 0),(0,i._)([(0,_.Cb)()],Je.prototype,"resource",void 0),(0,i._)([(0,_.Cb)()],Je.prototype,"error",void 0),(0,i._)([(0,_.Cb)()],Je.prototype,"oAuthPrompt",void 0),Je=(0,i._)([(0,m.j)("esri.identity.IdentityForm")],Je);const We=Je;var Ye=r(44291);const Ge="esri-identity-modal",Ke={base:Ge,open:`${Ge}--open`,closed:`${Ge}--closed`,title:`${Ge}__title`,dialog:`${Ge}__dialog`,content:`${Ge}__content`,closeButton:`${Ge}__close-button`,iconClose:"esri-icon-close"};let Xe=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={[Ke.open]:n,[Ke.closed]:!n},a=Fe("button",{class:Ke.closeButton,"aria-label":i.close,title:i.close,bind:this,onclick:this._close,type:"button"},Fe("span",{"aria-hidden":"true",class:Ke.iconClose})),l=`${e}_title`,h=`${e}_content`,c=s?Fe("h1",{id:l,class:Ke.title},s):null,d=n?Fe("div",{bind:this,class:Ke.dialog,role:"dialog","aria-labelledby":l,"aria-describedby":h,afterCreate:this._createFocusTrap},a,c,this._renderContent(h)):null;return Fe("div",{tabIndex:-1,class:this.classes(Ke.base,o)},d)}_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,Ye.v)(e,{initialFocus:"input",onDeactivate:this._close}),this._toggleFocusTrap()}));this.addHandles((0,U.kB)((()=>cancelAnimationFrame(t))))}_renderContent(e){const t=this.content;return"string"==typeof t?Fe("div",{class:Ke.content,id:e,innerHTML:t}):function(e){return e&&"function"==typeof e.render}(t)?Fe("div",{class:Ke.content,id:e},t.render()):t instanceof HTMLElement?Fe("div",{class:Ke.content,id:e,bind:t,afterCreate:this._attachToNode}):null}_attachToNode(e){e.appendChild(this)}};(0,i._)([(0,_.Cb)({readOnly:!0})],Xe.prototype,"container",void 0),(0,i._)([(0,_.Cb)()],Xe.prototype,"content",void 0),(0,i._)([(0,_.Cb)()],Xe.prototype,"open",void 0),(0,i._)([(0,_.Cb)(),Ve("esri/t9n/common")],Xe.prototype,"messages",void 0),(0,i._)([(0,_.Cb)()],Xe.prototype,"title",null),Xe=(0,i._)([(0,m.j)("esri.identity.IdentityModal")],Xe);const Qe=Xe,et="esriJSAPIOAuth";class tt{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(et,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(et,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(et);if(t)try{e=JSON.parse(t)}catch(e){console.warn(e)}}return e}}tt.prototype.declaredClass="esri.identity.OAuthCredential";var rt,st=r(96674);let it=rt=class extends st.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 rt.fromJSON(this.toJSON())}};(0,i._)([(0,_.Cb)({json:{write:!0}})],it.prototype,"appId",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],it.prototype,"authNamespace",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],it.prototype,"expiration",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],it.prototype,"flowType",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],it.prototype,"forceLogin",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],it.prototype,"forceUserId",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],it.prototype,"locale",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],it.prototype,"minTimeUntilExpiration",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],it.prototype,"popup",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],it.prototype,"popupCallbackUrl",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],it.prototype,"popupWindowFeatures",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],it.prototype,"portalUrl",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],it.prototype,"preserveUrlHash",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],it.prototype,"userId",void 0),it=rt=(0,i._)([(0,m.j)("esri.identity.OAuthInfo")],it);const nt=it;let ot=class extends st.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,_.Cb)({json:{write:!0}})],ot.prototype,"adminTokenServiceUrl",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],ot.prototype,"currentVersion",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],ot.prototype,"hasPortal",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],ot.prototype,"hasServer",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],ot.prototype,"owningSystemUrl",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],ot.prototype,"owningTenant",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],ot.prototype,"server",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],ot.prototype,"shortLivedTokenValidity",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],ot.prototype,"tokenServiceUrl",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],ot.prototype,"webTierAuth",void 0),ot=(0,i._)([(0,m.j)("esri.identity.ServerInfo")],ot);const at=ot;var lt=r(19745);const ht={},ct=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)=>!!(ct(e)&&t&&t.some((t=>t.test(e.server))));let ut=null,pt=null;try{ut=window.localStorage,pt=window.sessionStorage}catch{}class ft 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=We,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 at,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 _t({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,c.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 at(t))})),e.length&&this.registerServers(e)}if(r){const e=[];r.forEach((t=>{t.appId&&e.push(t.declaredClass?t:new nt(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 _t(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 c;if(h&&s&&s.details&&498===s.details.httpStatus)h.destroy();else if(h)return c=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(c),o.promise;const d=this._findCredential(e,t);if(d)return o.resolve(d),o.promise;let p=this.findServerInfo(e);if(p)!p.hasPortal&&p.server&&p.owningSystemUrl&&this._hasSameServerInstance(p.server,p.owningSystemUrl)&&(p.hasPortal=!0),!p.hasServer&&this._isServerRsrc(e)&&(p._restInfoPms=this._getTokenSvcUrl(e),p.hasServer=!0);else{const t=this._getTokenSvcUrl(e);if(!t)return c=new a.Z("identity-manager:unknown-resource","Unknown resource - could not find token service endpoint."),o.reject(c),o.promise;p=new at,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,c,d,u,p,_,m;t&&(m=this.tokenValidity||n||this._defaultTokenValidity,m>n&&n>0&&(m=n)),r&&(l=r.isAdmin,h=r.serverUrl,c=r.token,p=r.signal,_=r.ssl,e.customParameters=r.customParameters),l?d=e.adminTokenServiceUrl:(d=e.tokenServiceUrl,u=new f.R9(d.toLowerCase()),e.webTierAuth&&r?.serverUrl&&!_&&"http"===i.scheme&&((0,f.D6)(i.uri,d,!0)||"https"===u.scheme&&i.host===u.host&&"7080"===i.port&&"7443"===u.port)&&(d=d.replace(/^https:/i,"http:").replace(/:7443/i,":7080")));const g={query:{request:"getToken",username:t?.username,password:t?.password,serverUrl:h,token:c,expiration:m,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||(g.withCredentials=!1),(0,o.Z)(d,g).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 ht[i]||(ht[i]={}),t&&(ht[i][t.username]=t.password),s.validity=m,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.Z)(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(),c?.remove(),o?.destroy(),this.dialog?.destroy(),this.dialog=o=l=h=c=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 Qe,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),c=o.on("submit",(e=>{this.generateToken(t,e,{isAdmin:r.isAdmin,signal:r.signal}).then((n=>{i();const o=new _t({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&&_()})),i.resUrl_=e,i.sinfo_=t,i.oinfo_=r;const o=r._oAuthCred;if(o.storage&&("authorization-code"===r.flowType||"auto"===r.flowType&&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,c,d;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 Qe,this.dialog.content=l,this.dialog.open=!0,this.emit("dialog-create"),h=l.on("cancel",_),c=(0,p.YP)((()=>this.dialog.open),_),d=l.on("submit",(()=>{m(),this._doOAuthSignIn(e,t,r,i)}))):this._doOAuthSignIn(e,t,r,i)}));const _=()=>{m(),this._oAuthDfd=null,i.reject(new a.Z("identity-manager:user-aborted","ABORTED"))},m=()=>{h?.remove(),c?.remove(),d?.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.Z)(`${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",c=this.credentials.filter((t=>this._hasSameServerInstance(t.server,e)&&t.scope===h));if(e=l||e,c.length)if(1===c.length){if(r=c[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(c.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,lt.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?.owningSystemUrl;s&&ct(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.Z)(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 _t({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?ut:pt,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 _t({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?ut:pt,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.Z)(`${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.Z)(`${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.Z)(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 c=e.sinfo_,d=!e.options_||!1!==e.options_.prompt,p=c.hasPortal&&this._findOAuthInfo(e.resUrl_);let _,m;if(i)t(new _t({userId:i,server:c.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 _t(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 tt(p,ut),t=new tt(p,pt);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()){_=new _t({userId:i.userId,server:c.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(c.server,i.refreshToken,i.appId).then((e=>(_.expires=Date.now()+1e3*e.expires_in,_.token=e.access_token,_))):Promise.resolve(_),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(_)}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,c).then((e=>{t(e)})).catch(r)}else{const s=()=>{d?e._pendingDfd=this.oAuthSignIn(e.resUrl_,c,p,e.options_).then(t,r):(m=new a.Z("identity-manager:not-authenticated","User is not signed in."),r(m))};this._doPortalSignIn(e.resUrl_)?e._pendingDfd=this._getPlatformSelf(c.server,p.appId).then((e=>{(0,f.D6)(e.portalUrl,this._appOrigin,!0)?(_=new _t({userId:e.username,server:c.server,expires:Date.now()+1e3*e.expires_in,token:e.token}),t(_)):s()})).catch(s):s()}}else if(d){if(this._checkProtocol(e.resUrl_,c,r,e.admin_)){let s=e.options_;e.admin_&&(s=s||{},s.isAdmin=!0),e._pendingDfd=this.signIn(e.resUrl_,c,s).then(t,r)}}else m=new a.Z("identity-manager:not-authenticated","User is not signed in."),r(m)},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 _t(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 _t({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,d.hS)("authInfo.tokenServicesUrl",t)||(0,d.hS)("authInfo.tokenServiceUrl",t)||(0,d.hS)("tokenServiceUrl",t))??null,r.shortLivedTokenValidity=(0,d.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.Z)(r+"/sharing/rest",{query:{f:"json"}}).then((()=>{this._defaultOAuthInfo=new nt({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.Z)(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",c=l+"?"+(0,f.B7)(o);if(r.popup){const e=window.open(c,"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=c}_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}}ft.prototype.declaredClass="esri.identity.IdentityManagerBase";let _t=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?.owningSystemUrl,r=!!t&&"server"===this.scope,i=r&&dt(e,s.id._legacyFed),n=e.webTierAuth,o=n&&s.id.normalizeWebTierAuth,a=ht[this.server],l=a&&a[this.userId];let h,c=this.resources&&this.resources[0],d=r?s.id.findServerInfo(t):null,u={username:this.userId,password:l};if(n&&!o)return;r&&!d&&s.id.serverInfos.some((e=>(s.id._isIdProvider(t,e.server)&&(d=e),!!d)));const p=d?s.id.findCredential(d.server,this.userId):null;if(!r||p){if(!i){if(r)h={serverUrl:c,token:p&&p.token,ssl:p&&p.ssl};else if(o)u=null,h={ssl:this.ssl};else{if(!l){let t;return c&&(c=s.id._sanitizeUrl(c),this._enqueued=1,t=s.id._enqueue(c,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?d: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?.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):null,r=t?.owningSystemUrl,i=r?s.id.findServerInfo(r):null;!1===e||r&&"portal"!==this.scope&&(!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,c.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,_.Cb)()],_t.prototype,"creationTime",void 0),(0,i._)([(0,_.Cb)()],_t.prototype,"expires",void 0),(0,i._)([(0,_.Cb)()],_t.prototype,"isAdmin",void 0),(0,i._)([(0,_.Cb)()],_t.prototype,"oAuthState",void 0),(0,i._)([(0,_.Cb)()],_t.prototype,"resources",void 0),(0,i._)([(0,_.Cb)()],_t.prototype,"scope",void 0),(0,i._)([(0,_.Cb)()],_t.prototype,"server",void 0),(0,i._)([(0,_.Cb)()],_t.prototype,"ssl",void 0),(0,i._)([(0,_.Cb)()],_t.prototype,"token",void 0),(0,i._)([(0,_.Cb)()],_t.prototype,"tokenRefreshBuffer",void 0),(0,i._)([(0,_.Cb)()],_t.prototype,"userId",void 0),(0,i._)([(0,_.Cb)()],_t.prototype,"validity",void 0),_t=(0,i._)([(0,m.j)("esri.identity.Credential")],_t);class mt extends ft{}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.Z)(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],c=(0,s.Su)(i),d=`${l}${h}.json`,u=c?`${l}${h}_${c}.json`:d;let p;try{p=await o(e(u))}catch(t){if(u===d)throw new n.Z("intl:unknown-bundle",`Bundle "${r}" cannot be loaded`,{error:t});try{p=await o(e(d))}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,c=r(99880);(0,s.tz)((h={pattern:"esri/",location:c.V},new a(h)))},90344:(e,t,r)=>{"use strict";r.d(t,{Xr:()=>f,Ze:()=>v,f1:()=>w,p6:()=>y});var s=r(35454),i=r(70171),n=r(15512);r(17126);const o=Intl.DateTimeFormat().resolvedOptions().timeZone,a=(n.pt,{year:"numeric",month:"numeric",day:"numeric"}),l={year:"numeric",month:"long",day:"numeric"},h={year:"numeric",month:"short",day:"numeric"},c={year:"numeric",month:"long",weekday:"long",day:"numeric"},d={hour:"numeric",minute:"numeric"},u={...d,second:"numeric"},p={"short-date":a,"short-date-short-time":{...a,...d},"short-date-short-time-24":{...a,...d,hour12:!1},"short-date-long-time":{...a,...u},"short-date-long-time-24":{...a,...u,hour12:!1},"short-date-le":a,"short-date-le-short-time":{...a,...d},"short-date-le-short-time-24":{...a,...d,hour12:!1},"short-date-le-long-time":{...a,...u},"short-date-le-long-time-24":{...a,...u,hour12:!1},"long-month-day-year":l,"long-month-day-year-short-time":{...l,...d},"long-month-day-year-short-time-24":{...l,...d,hour12:!1},"long-month-day-year-long-time":{...l,...u},"long-month-day-year-long-time-24":{...l,...u,hour12:!1},"day-short-month-year":h,"day-short-month-year-short-time":{...h,...d},"day-short-month-year-short-time-24":{...h,...d,hour12:!1},"day-short-month-year-long-time":{...h,...u},"day-short-month-year-long-time-24":{...h,...u,hour12:!1},"long-date":c,"long-date-short-time":{...c,...d},"long-date-short-time-24":{...c,...d,hour12:!1},"long-date-long-time":{...c,...u},"long-date-long-time-24":{...c,...u,hour12:!1},"long-month-year":{month:"long",year:"numeric"},"short-month-year":{month:"short",year:"numeric"},year:{year:"numeric"},"short-time":d,"long-time":u},f=(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"}),_={ar:"ar-u-nu-latn-ca-gregory"};let m=new WeakMap;const g=p["short-date-short-time"];function v(e){return p[e]}function y(e,t=g){return function(e){let t=m.get(e);if(!t){const r=(0,i.Kd)(),s=_[r]||r,o=w(e.timeZone??n.By),a={...e,timeZone:o};t=new Intl.DateTimeFormat(s,a),m.set(e,t)}return t}(t).format(e)}function w(e){switch(e){case n.By:return o;case n._4:return n.pt;default:return e}}(0,i.Ze)((()=>{m=new WeakMap}))},70171:(e,t,r)=>{"use strict";r.d(t,{G3:()=>l,Kd:()=>a,Ze:()=>u,qe:()=>c});var s=r(50758);let i;const n=globalThis.esriConfig?.locale??globalThis.dojoConfig?.locale;function o(){return n??globalThis.navigator?.language??"en"}function a(){return void 0===i&&(i=o()),i}function l(e=a()){const t=/^([a-zA-Z]{2,3})(?:[_\-]\w+)*$/.exec(e);return t?.[1].toLowerCase()}const h=[];function c(e){return h.push(e),(0,s.kB)((()=>h.splice(h.indexOf(e),1)))}const d=[];function u(e){return d.push(e),(0,s.kB)((()=>h.splice(d.indexOf(e),1)))}globalThis.addEventListener?.("languagechange",(function(){const e=o();i!==e&&(i=e,[...d].forEach((t=>{t.call(null,e)})),[...h].forEach((t=>{t.call(null,e)})))}))},94443:(e,t,r)=>{"use strict";r.d(t,{ME:()=>f,Su:()=>_,tz:()=>p});var s=r(20102),i=r(50758),n=r(95330),o=r(70171);const a=/^([a-z]{2})(?:[-_]([A-Za-z]{2}))?$/,l={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 h(e){return e in l}Object.keys(l);const c=[],d=new Map;function u(e){for(const t of d.keys())m(e.pattern,t)&&d.delete(t)}function p(e){return c.includes(e)||(u(e),c.unshift(e)),(0,i.kB)((()=>{const t=c.indexOf(e);t>-1&&(c.splice(t,1),u(e))}))}async function f(e){const t=(0,o.Kd)();d.has(e)||d.set(e,async function(e,t){const r=[];for(const s of c)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 _(e){if(!a.test(e))return null;const t=a.exec(e);if(null===t)return null;const[,r,s]=t,i=r+(s?"-"+s.toUpperCase():"");return h(i)?i:h(r)?r:null}function m(e,t){return"string"==typeof e?t.startsWith(e):e.test(t)}(0,o.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,n.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,{uf:()=>a});var s=r(70171);const i={ar:"ar-u-nu-latn"};let n=new WeakMap,o={};function a(e,t){return Object.is(e,-0)&&(e=0),function(e){const t=e||o;if(!n.has(t)){const r=(0,s.Kd)(),o=i[(0,s.Kd)()]||r;n.set(t,new Intl.NumberFormat(o,e))}return n.get(t)}(t).format(e)}(0,s.Ze)((()=>{n=new WeakMap,o={}}))},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?c(a,l):n?d(a,n):u(a)}(e,t,s)))}function c(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 d(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):""}}},15512:(e,t,r)=>{"use strict";r.d(t,{By:()=>s,_4:()=>i,pt:()=>n});const s="system",i="unknown",n="UTC"}}]);
1
+ (self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[6571,661,5234],{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},46791:(e,t,r)=>{"use strict";r.d(t,{Z:()=>O});var s,i=r(43697),n=r(3894),o=r(32448),a=r(50758),l=r(22974),h=r(71143);!function(e){e[e.ADD=1]="ADD",e[e.REMOVE=2]="REMOVE",e[e.MOVE=4]="MOVE"}(s||(s={}));var c,d=r(1654),u=r(75215),p=r(58971),f=r(5600),_=r(52421),m=r(52011),g=r(10661);class v{constructor(e,t,r,s,i){this.target=e,this.added=t,this.removed=r,this.start=s,this.deleteCount=i}}const y=new h.Z(class{constructor(){this.target=null,this.cancellable=!1,this.defaultPrevented=!1,this.item=void 0,this.type=void 0}preventDefault(){this.cancellable&&(this.defaultPrevented=!0)}reset(e){this.defaultPrevented=!1,this.item=e}},void 0,(e=>{e.item=null,e.target=null,e.defaultPrevented=!1,e.cancellable=!1}));function w(e){return e?e instanceof x?e.toArray():e.length?Array.prototype.slice.apply(e):[]:[]}function b(e){if(e&&e.length)return e[0]}function S(e,t,r,s){const i=Math.min(e.length-r,t.length-s);let n=0;for(;n<i&&e[r+n]===t[s+n];)n++;return n}function I(e,t,r,s){t&&t.forEach(((t,i,n)=>{e.push(t),I(e,r.call(s,t,i,n),r,s)}))}const A=new Set,k=new Set,C=new Set,T=new Map;let U=0,x=c=class extends o.Z.EventedAccessor{static isCollection(e){return null!=e&&e instanceof c}constructor(e){super(e),this._chgListeners=[],this._notifications=null,this._timer=null,this._observable=new g.s,this.length=0,this._items=[],Object.defineProperty(this,"uid",{value:U++})}normalizeCtorArgs(e){return e?Array.isArray(e)||e instanceof c?{items:e}:e:{}}destroy(){this._removeAllRaw()}*[Symbol.iterator](){yield*this.items}get items(){return(0,p.it)(this._observable),this._items}set items(e){this._emitBeforeChanges(s.ADD)||(this._splice(0,this.length,w(e)),this._emitAfterChanges(s.ADD))}hasEventListener(e){return"change"===e?this._chgListeners.length>0:this._emitter.hasEventListener(e)}on(e,t){if("change"===e){const e=this._chgListeners,r={removed:!1,callback:t};return e.push(r),this._notifications&&this._notifications.push({listeners:e.slice(),items:this._items.slice(),changes:[]}),(0,a.kB)((()=>{r.removed=!0,e.splice(e.indexOf(r),1)}))}return this._emitter.on(e,t)}once(e,t){const r="deref"in t?()=>t.deref():()=>t,s=this.on(e,(e=>{r()?.call(null,e),s.remove()}));return s}add(e,t){if((0,p.it)(this._observable),this._emitBeforeChanges(s.ADD))return this;const r=this.getNextIndex(t??null);return this._splice(r,0,[e]),this._emitAfterChanges(s.ADD),this}addMany(e,t=this._items.length){if((0,p.it)(this._observable),!e||!e.length)return this;if(this._emitBeforeChanges(s.ADD))return this;const r=this.getNextIndex(t);return this._splice(r,0,w(e)),this._emitAfterChanges(s.ADD),this}at(e){if((0,p.it)(this._observable),(e=Math.trunc(e)||0)<0&&(e+=this.length),!(e<0||e>=this.length))return this._items[e]}removeAll(){if((0,p.it)(this._observable),!this.length||this._emitBeforeChanges(s.REMOVE))return[];const e=this._removeAllRaw();return this._emitAfterChanges(s.REMOVE),e}_removeAllRaw(){return 0===this.length?[]:this._splice(0,this.length)||[]}clone(){return(0,p.it)(this._observable),this._createNewInstance({items:this._items.map(l.d9)})}concat(...e){(0,p.it)(this._observable);const t=e.map(w);return this._createNewInstance({items:this._items.concat(...t)})}drain(e,t){if((0,p.it)(this._observable),!this.length||this._emitBeforeChanges(s.REMOVE))return;const r=this._splice(0,this.length),i=r.length;for(let s=0;s<i;s++)e.call(t,r[s],s,r);this._emitAfterChanges(s.REMOVE)}every(e,t){return(0,p.it)(this._observable),this._items.every(e,t)}filter(e,t){let r;return(0,p.it)(this._observable),r=2===arguments.length?this._items.filter(e,t):this._items.filter(e),this._createNewInstance({items:r})}find(e,t){return(0,p.it)(this._observable),this._items.find(e,t)}findIndex(e,t){return(0,p.it)(this._observable),this._items.findIndex(e,t)}flatten(e,t){(0,p.it)(this._observable);const r=[];return I(r,this,e,t),new c(r)}forEach(e,t){return(0,p.it)(this._observable),this._items.forEach(e,t)}getItemAt(e){return(0,p.it)(this._observable),this._items[e]}getNextIndex(e){(0,p.it)(this._observable);const t=this.length;return(e=e??t)<0?e=0:e>t&&(e=t),e}includes(e,t=0){return(0,p.it)(this._observable),this._items.includes(e,t)}indexOf(e,t=0){return(0,p.it)(this._observable),this._items.indexOf(e,t)}join(e=","){return(0,p.it)(this._observable),this._items.join(e)}lastIndexOf(e,t=this.length-1){return(0,p.it)(this._observable),this._items.lastIndexOf(e,t)}map(e,t){(0,p.it)(this._observable);const r=this._items.map(e,t);return new c({items:r})}reorder(e,t=this.length-1){(0,p.it)(this._observable);const r=this.indexOf(e);if(-1!==r){if(t<0?t=0:t>=this.length&&(t=this.length-1),r!==t){if(this._emitBeforeChanges(s.MOVE))return e;this._splice(r,1),this._splice(t,0,[e]),this._emitAfterChanges(s.MOVE)}return e}}pop(){if((0,p.it)(this._observable),!this.length||this._emitBeforeChanges(s.REMOVE))return;const e=b(this._splice(this.length-1,1));return this._emitAfterChanges(s.REMOVE),e}push(...e){return(0,p.it)(this._observable),this._emitBeforeChanges(s.ADD)||(this._splice(this.length,0,e),this._emitAfterChanges(s.ADD)),this.length}reduce(e,t){(0,p.it)(this._observable);const r=this._items;return 2===arguments.length?r.reduce(e,t):r.reduce(e)}reduceRight(e,t){(0,p.it)(this._observable);const r=this._items;return 2===arguments.length?r.reduceRight(e,t):r.reduceRight(e)}remove(e){return(0,p.it)(this._observable),this.removeAt(this.indexOf(e))}removeAt(e){if((0,p.it)(this._observable),e<0||e>=this.length||this._emitBeforeChanges(s.REMOVE))return;const t=b(this._splice(e,1));return this._emitAfterChanges(s.REMOVE),t}removeMany(e){if((0,p.it)(this._observable),!e||!e.length||this._emitBeforeChanges(s.REMOVE))return[];const t=e instanceof c?e.toArray():e,r=this._items,i=[],n=t.length;for(let e=0;e<n;e++){const s=t[e],n=r.indexOf(s);if(n>-1){const s=1+S(t,r,e+1,n+1),o=this._splice(n,s);o&&o.length>0&&i.push.apply(i,o),e+=s-1}}return this._emitAfterChanges(s.REMOVE),i}reverse(){if((0,p.it)(this._observable),this._emitBeforeChanges(s.MOVE))return this;const e=this._splice(0,this.length);return e&&(e.reverse(),this._splice(0,0,e)),this._emitAfterChanges(s.MOVE),this}shift(){if((0,p.it)(this._observable),!this.length||this._emitBeforeChanges(s.REMOVE))return;const e=b(this._splice(0,1));return this._emitAfterChanges(s.REMOVE),e}slice(e=0,t=this.length){return(0,p.it)(this._observable),this._createNewInstance({items:this._items.slice(e,t)})}some(e,t){return(0,p.it)(this._observable),this._items.some(e,t)}sort(e){if((0,p.it)(this._observable),!this.length||this._emitBeforeChanges(s.MOVE))return this;const t=this._splice(0,this.length);return arguments.length?t.sort(e):t.sort(),this._splice(0,0,t),this._emitAfterChanges(s.MOVE),this}splice(e,t,...r){(0,p.it)(this._observable);const i=(t?s.REMOVE:0)|(r.length?s.ADD:0);if(this._emitBeforeChanges(i))return[];const n=this._splice(e,t,r)||[];return this._emitAfterChanges(i),n}toArray(){return(0,p.it)(this._observable),this._items.slice()}toJSON(){return(0,p.it)(this._observable),this.toArray()}toLocaleString(){return(0,p.it)(this._observable),this._items.toLocaleString()}toString(){return(0,p.it)(this._observable),this._items.toString()}unshift(...e){return(0,p.it)(this._observable),!e.length||this._emitBeforeChanges(s.ADD)||(this._splice(0,0,e),this._emitAfterChanges(s.ADD)),this.length}_createNewInstance(e){return new this.constructor(e)}_splice(e,t,r){const s=this._items,i=this.itemType;let n,o;if(!this._notifications&&this.hasEventListener("change")&&(this._notifications=[{listeners:this._chgListeners.slice(),items:this._items.slice(),changes:[]}],this._timer&&this._timer.remove(),this._timer=(0,d.Os)((()=>this._dispatchChange()))),e<0&&(e+=this.length),t){if(o=s.splice(e,t),this.hasEventListener("before-remove")){const t=y.acquire();t.target=this,t.cancellable=!0;for(let r=0,i=o.length;r<i;r++)n=o[r],t.reset(n),this.emit("before-remove",t),t.defaultPrevented&&(o.splice(r,1),s.splice(e,0,n),e+=1,r-=1,i-=1);y.release(t)}if(this.length=this._items.length,this.hasEventListener("after-remove")){const e=y.acquire();e.target=this,e.cancellable=!1;const t=o.length;for(let r=0;r<t;r++)e.reset(o[r]),this.emit("after-remove",e);y.release(e)}}if(r&&r.length){if(i){const e=[];for(const t of r){const r=i.ensureType(t);null==r&&null!=t||e.push(r)}r=e}const t=this.hasEventListener("before-add"),n=this.hasEventListener("after-add"),o=e===this.length;if(t||n){const i=y.acquire();i.target=this,i.cancellable=!0;const a=y.acquire();a.target=this,a.cancellable=!1;for(const l of r)t?(i.reset(l),this.emit("before-add",i),i.defaultPrevented||(o?s.push(l):s.splice(e++,0,l),this._set("length",s.length),n&&(a.reset(l),this.emit("after-add",a)))):(o?s.push(l):s.splice(e++,0,l),this._set("length",s.length),a.reset(l),this.emit("after-add",a));y.release(a),y.release(i)}else{if(o)for(const e of r)s.push(e);else s.splice(e,0,...r);this._set("length",s.length)}}if((r&&r.length||o&&o.length)&&this._notifyChangeEvent(r,o),this.hasEventListener("after-splice")){const s=new v(this,r,o,e,t);this.emit("after-splice",s)}return o}_emitBeforeChanges(e){let t=!1;if(this.hasEventListener("before-changes")){const r=y.acquire();r.target=this,r.cancellable=!0,r.type=e,this.emit("before-changes",r),t=r.defaultPrevented,y.release(r)}return t}_emitAfterChanges(e){if(this.hasEventListener("after-changes")){const t=y.acquire();t.target=this,t.cancellable=!1,t.type=e,this.emit("after-changes",t),y.release(t)}this._observable.notify()}_notifyChangeEvent(e,t){this.hasEventListener("change")&&this._notifications&&this._notifications[this._notifications.length-1].changes.push({added:e,removed:t})}_dispatchChange(){if(this._timer&&(this._timer.remove(),this._timer=null),!this._notifications)return;const e=this._notifications;this._notifications=null;for(const t of e){const e=t.changes;A.clear(),k.clear(),C.clear();for(const{added:t,removed:r}of e){if(t)if(0===C.size&&0===k.size)for(const e of t)A.add(e);else for(const e of t)k.has(e)?(C.add(e),k.delete(e)):C.has(e)||A.add(e);if(r)if(0===C.size&&0===A.size)for(const e of r)k.add(e);else for(const e of r)A.has(e)?A.delete(e):(C.delete(e),k.add(e))}const r=n.Z.acquire();A.forEach((e=>{r.push(e)}));const s=n.Z.acquire();k.forEach((e=>{s.push(e)}));const i=this._items,o=t.items,a=n.Z.acquire();if(C.forEach((e=>{o.indexOf(e)!==i.indexOf(e)&&a.push(e)})),t.listeners&&(r.length||s.length||a.length)){const e={target:this,added:r,removed:s,moved:a},i=t.listeners.length;for(let r=0;r<i;r++){const s=t.listeners[r];s.removed||s.callback.call(this,e)}}n.Z.release(r),n.Z.release(s),n.Z.release(a)}A.clear(),k.clear(),C.clear()}};x.ofType=e=>{if(!e)return c;if(T.has(e))return T.get(e);let t=null;if("function"==typeof e)t=e.prototype.declaredClass;else if(e.base)t=e.base.prototype.declaredClass;else for(const r in e.typeMap){const s=e.typeMap[r].prototype.declaredClass;t?t+=` | ${s}`:t=s}let r=class extends c{};return(0,i._)([(0,_.c)({Type:e,ensureType:"function"==typeof e?(0,u.se)(e):(0,u.N7)(e)})],r.prototype,"itemType",void 0),r=(0,i._)([(0,m.j)(`esri.core.Collection<${t}>`)],r),T.set(e,r),r},(0,i._)([(0,f.Cb)()],x.prototype,"length",void 0),(0,i._)([(0,f.Cb)()],x.prototype,"items",null),x=c=(0,i._)([(0,m.j)("esri.core.Collection")],x);const O=x},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){let r=this._listenersMap?.get(e);if(!r)return!1;const s=this._target||this;let i=!1;for(const e of r.slice()){const r="deref"in e?e.deref():e;r?r?.call(s,t):i=!0}return i&&(r=r.filter((e=>!("deref"in e)||null!=e.deref())),this._listenersMap.set(e,r)),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??=new Map;const r=this._listenersMap.get(e)||[];return r.push(t),this._listenersMap.set(e,r),(0,n.kB)((()=>{const r=this._listenersMap?.get(e),s=r?.indexOf(t)??-1;s>=0&&r.splice(s,1)}))}once(e,t){const r=this.on(e,(e=>{r.remove();const s="deref"in t?t.deref():t;s?.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:()=>d,v:()=>c});var s,i,n=r(43697),o=r(92036),a=r(95330),l=r(52011);(i=s||(s={}))[i.PENDING=0]="PENDING",i[i.RESOLVED=1]="RESOLVED",i[i.REJECTED=2]="REJECTED";class h{constructor(){this._resolver=(0,a.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,a.zE)())}_cleanUp(){this._allPromise=null,this._resolvingPromises=null}_tryResolve(){if(this.isFulfilled())return;const e=(0,a.hh)(),t=[...this._resolvingPromises,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,a.D_)(e)||this._resolver.reject(e)})),e.resolve()}}const c=e=>{let t=class extends e{constructor(...e){super(...e),this._promiseProps=new h,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,l.j)("esri.core.Promise")],t),t};let d=class extends(c(o.Z)){};d=(0,n._)([(0,l.j)("esri.core.Promise")],d)},90578:(e,t,r)=>{"use strict";r.d(t,{p:()=>l});var s=r(75215),i=r(7628);const n=Object.prototype.toString;function o(e){const t="__accessorMetadata__"in e?(0,s.se)(e):e;return function(...e){if(e.push(t),"number"==typeof e[2])throw new Error("Using @cast has parameter decorator is not supported since 4.16");return a.apply(this,e)}}function a(e,t,r,s){(0,i.Oe)(e,t).cast=s}function l(...e){if(3!==e.length||"string"!=typeof e[1])return 1===e.length&&"[object Function]"===n.call(e[0])?o(e[0]):1===e.length&&"string"==typeof e[0]?function(e){return(t,r)=>{(0,i.Oe)(t,e).cast=t[r]}}(e[0]):void 0}},52421:(e,t,r)=>{"use strict";function s(e){return(t,r)=>{t[r]=e}}r.d(t,{c:()=>s})},10661:(e,t,r)=>{"use strict";r.d(t,{s:()=>i});var s=r(42100);class i extends s.s{notify(){const e=this._observers;if(e&&e.length>0){const t=e.slice();for(const e of t)e.onInvalidated(),e.onCommitted()}}}},66643:(e,t,r)=>{"use strict";r.d(t,{Ed:()=>h,UI:()=>c,mt:()=>f,q6:()=>p,vr:()=>_});var s=r(43697),i=r(92036),n=r(70586),o=r(95330),a=r(5600),l=r(52011);function h(e,t,r){return(0,o.as)(e.map(((e,s)=>t.apply(r,[e,s]))))}async function c(e,t,r){return(await(0,o.as)(e.map(((e,s)=>t.apply(r,[e,s]))))).map((e=>e.value))}function d(e){return{ok:!0,value:e}}function u(e){return{ok:!1,error:e}}async function p(e){if(null==e)return{ok:!1,error:new Error("no promise provided")};try{return d(await e)}catch(e){return u(e)}}async function f(e){try{return d(await e)}catch(e){return(0,o.r9)(e),u(e)}}function _(e,t){return new m(e,t)}let m=class extends i.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,n.IM)(this._abortController)},this.remove=this.abort,this._abortController=new AbortController;const{signal:r}=this._abortController;this.promise=e(r),this.promise.then((e=>{this._result=d(e),this._cleanup()}),(e=>{this._result=u(e),this._cleanup()})),this._abortHandle=(0,o.fu)(t,this.abort)}normalizeCtorArgs(){return{}}destroy(){this.abort()}_cleanup(){this._abortHandle=(0,n.hw)(this._abortHandle),this._abortController=null}};(0,s._)([(0,a.Cb)()],m.prototype,"value",null),(0,s._)([(0,a.Cb)()],m.prototype,"error",null),(0,s._)([(0,a.Cb)()],m.prototype,"finished",null),(0,s._)([(0,a.Cb)()],m.prototype,"promise",void 0),(0,s._)([(0,a.Cb)()],m.prototype,"_result",void 0),m=(0,s._)([(0,l.j)("esri.core.asyncUtils.ReactiveTask")],m)},35454:(e,t,r)=>{"use strict";r.d(t,{X:()=>i,w:()=>n});var s=r(78286);class i{constructor(e,t={ignoreUnknown:!1,useNumericKeys:!1}){this._jsonToAPI=e,this._options=t,this.apiValues=[],this.jsonValues=[],this._apiToJSON=this._invertMap(e),this.apiValues=this._getKeysSorted(this._apiToJSON),this.jsonValues=this._getKeysSorted(this._jsonToAPI),this.read=e=>this.fromJSON(e),this.write=(e,t,r)=>{const i=this.toJSON(e);void 0!==i&&(0,s.RB)(r,i,t)},this.write.isJSONMapWriter=!0}toJSON(e){if(null==e)return null;if(this._apiToJSON.hasOwnProperty(e)){const t=this._apiToJSON[e];return this._options.useNumericKeys?+t:t}return this._options.ignoreUnknown?void 0:e}fromJSON(e){return null!=e&&this._jsonToAPI.hasOwnProperty(e)?this._jsonToAPI[e]:this._options.ignoreUnknown?void 0:e}_invertMap(e){const t={};for(const r in e)t[e[r]]=r;return t}_getKeysSorted(e){const t=[];for(const r in e)t.push(r);return t.sort(),t}}function n(){return function(e,t){return new i(e,{ignoreUnknown:!0,...t})}}},17445:(e,t,r)=>{"use strict";r.d(t,{N1:()=>u,YP:()=>l,Z_:()=>_,gx:()=>h,nn:()=>m,on:()=>d,tX:()=>g}),r(66643),r(46791);var s=r(91460),i=r(50758),n=r(70586),o=r(95330),a=r(26258);function l(e,t,r={}){return c(e,t,r,p)}function h(e,t,r={}){return c(e,t,r,f)}function c(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 d(e,t,r,o={}){let a=null,h=null,c=null;function d(){a&&h&&(h.remove(),o.onListenerRemove?.(a),a=null,h=null)}function u(e){o.once&&o.once&&(0,n.hw)(c),r(e)}const p=l(e,((e,r)=>{d(),(0,s.vT)(e)&&(a=e,h=(0,s.on)(e,t,u),o.onListenerAdd?.(e))}),{sync:o.sync,initial:!0});return c=(0,i.kB)((()=>{p.remove(),d()})),c}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)())})),c(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 _={sync:!0},m={initial:!0},g={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()}}`}},53865:(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),c=r(22974),d=r(78286),u=r(95330),p=r(17445),f=r(17452),_=r(5600),m=(r(75215),r(52011)),g=(r(67676),r(80442),r(940)),v=(r(2587),r(60235));Element.prototype.closest;var y=r(92604),w=r(70586),b=r(609),S=r(41123),I=r(90578),A=r(58971),k=r(38805),C=r(8728),T=r(3894),U=r(50758);const x=new Map;function O(){x.clear()}function P(e){x.delete(e)}y.Z.getLogger("esri.widgets.support.widgetUtils");function E(e){const t=T.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 T.Z.release(t),r}function R(e){this[e.getAttribute("data-node-ref")]=e}(()=>{const e=new Map;new ResizeObserver((t=>{O();for(const r of t)e.get(r.target)?.(r)}))})();const D=["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 C.Z({whiteList:D,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`,B=`${j}1999/xlink`;let q=[],V=(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},Z=(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),$=e=>{if("string"!=typeof e)throw new Error("Style values must be strings")},F=(e,t,r)=>{if(""!==t.vnodeSelector)for(let s=r;s<e.length;s++)if(Z(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(Z(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&&($(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(B,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),c=o.slice(n,l);"."===h?i.classList.add(c):"#"===h?i.id=c:("svg"===c&&(s=V(s,{namespace:M})),void 0!==s.namespace?i=e.domNode=a.createElementNS(s.namespace,c):(i=e.domNode=e.domNode||a.createElement(c),"input"===c&&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||q;let n,o=(r=r||q).length,a=s.length,l=0,h=0,c=!1;for(;h<a;){let a=l<o?r[l]:void 0,d=s[h];if(void 0!==a&&Z(a,d))c=te(a,d,i)||c,l++;else{let a=F(r,d,l+1);if(a>=0){for(n=l;n<a;n++)X(r[n]),z(r,n,e,"removed");c=te(r[a],d,i)||c,l=a+1}else se(d,t,l<o?r[l].domNode:void 0,i),H(d),z(s,h,e,"added")}h++}if(o>l)for(n=l;n<o;n++)X(r[n]),z(r,n,e,"removed");return c};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=V(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?($(o),s.styleApplyer(e,r,o)):s.styleApplyer(e,r,""))}}else if(l||"string"!=typeof h||(l=""),"value"!==o||ee(e)){if(l!==h){let t=typeof l;"function"===t&&s.eventHandlerInterceptor||(s.namespace===M?"href"===o?e.setAttributeNS(B,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)}}else{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)}}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=>V(ae,e),ce=(e,t,r)=>(r=he(r),se(t,e,void 0,r),oe(t,r)),de=(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]))},_e={namespace:void 0,performanceLogger:()=>{},eventHandlerInterceptor:void 0,styleApplyer:(e,t,r)=>{"-"===t.charAt(0)?e.style.setProperty(t,r):e.style[t]=r}},me=(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 ge=r(65161),ve=r(99880);let ye;ye="components/assets";const we=Symbol("widget"),be=Symbol("widget-test-data"),Se=[],Ie={},Ae=new WeakMap;function ke(e,t){let r=t.children;if(r&&r.length)for(let t=0;t<r.length;++t)r[t]=ke(e,r[t]);else r=Se;const s=t.vnodeSelector;if(xe(s)){const i=t.properties||Ie,n=i.key||s;return{vnodeSelector:"div",properties:{key:n,afterCreate:Ce,afterUpdate:Te,afterRemoved:Ue,parentWidget:e,widgetConstructor:s,widgetProperties:{...i,key:n,children:r}},children:void 0,text:void 0,domNode:null}}return t}function Ce(e,t,r,{parentWidget:s,widgetConstructor:i,widgetProperties:n}){const o=new i(n);o.container=e,Ae.set(e,o),o.afterCreate?.(o,e),s.addHandles((0,U.kB)((()=>Ue(e)))),queueMicrotask((()=>{o[be].projector.renderNow()}))}function Te(e,t,r,{widgetProperties:s}){const i=Ae.get(e);i&&(i.set(s),i.afterUpdate?.(i,e))}function Ue(e){const t=Ae.get(e);t&&(t.afterRemoved?.(t,e),t.destroy(),Ae.delete(e))}function xe(e){return"function"==typeof e&&e[we]}const Oe=new Set;var Pe,Ee=r(70171),Re=r(94443);let De=0;const Ne="esri-icon-checkbox-unchecked";function Le(e,t){for(const r in t)null!=e[r]&&("object"==typeof e[r]&&"object"==typeof t[r]?Le(e[r],t?.[r]):e[r]=t[r]);return e}const je=(e=>{let t;const r={...fe,...e},s=(n=r,{..._e,...n}),i=s.performanceLogger;var n;let o,a=!0,l=!1;const h=[],c=[],d=(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=me(a.getLastRender(),r,!0)}else n.reverse(),s=me(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),s.eventHandlerInterceptor=void 0,h.push(a),c.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=c[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,c)),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)=>{d(ce,e,t)},insertBefore:(e,t)=>{d(de,e,t)},merge:(e,t)=>{d(ue,e,t)},replace:(e,t)=>{d(pe,e,t)},detach:e=>{for(let t=0;t<c.length;t++)if(c[t]===e)return c.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))&&(O(),e.scheduleRender(),l[a].call(l.bind||r,s))}});let Me=!1,Be=class extends((0,b.v)(l.Z.EventedAccessor)){constructor(e,t){super(e,t),this._attached=!1,this._projector=je,this._readyForTrueRender=!1,this.iconClass=Ne,this.icon=null,this.key=this,this._loadLocale=(0,u.Ds)((async()=>{if(this._messageBundleProps?.length){const e=await Promise.allSettled(this._messageBundleProps.map((async({bundlePath:e,propertyName:t})=>{if(this.destroyed)return;let r=await(0,Re.ME)(e);this.uiStrings&&Object.keys(this.uiStrings)&&(r=Le((0,c.d9)(r),this.uiStrings)),this[t]=r})));if(this.destroyed)return;for(const t of e)"rejected"===t.status&&y.Z.getLogger(this).error("widget-intl:locale-error",this.declaredClass,t.reason)}await this.loadLocale()})),function(){try{(0,ge.K3)(".")}catch{(0,ge.YY)((0,f.hF)((0,ve.V)("components/assets")))}}();const r="esri-widget-uid-"+(0,S.D)(),s=this.render.bind(this);this._trackingTarget=new k.M((()=>this.scheduleRender()));const i=()=>{if(!this._readyForTrueRender||this.destroyed)return null;const e=s();let{properties:t}=e;t||(e.properties=t={});const{key:i}=t;if(i||(t.key=r),xe(e.vnodeSelector)){if(!this.visible)return{vnodeSelector:"div",properties:{key:`${r}-hidden`,class:"",styles:{display:"none"}},domNode:null,children:void 0,text:void 0}}else this.visible?t.styles||(t.styles={}):(t.class="",t.styles={display:"none"}),t.styles.display||(t.styles.display="");let n=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}--${n++}`)})),ke(this,e)};this.render=()=>{if(Me)return i();let e=function(e){return x.get(e)}(this)??null;if(e)return e;this._trackingTarget.clear(),Me=!0;try{e=(0,A.LJ)(this._trackingTarget,i)}catch(e){throw console.error(e),e}finally{Me=!1}return e&&function(e,t){x.set(e,t)}(this,e),e};const n=this.beforeFirstRender();var o;n?this._resourcesFetch=n.then((()=>{this._readyForTrueRender=!0,this._postInitialize()})):(this._resourcesFetch=Promise.resolve().then((()=>{this._postInitialize()})),this._readyForTrueRender=!0),this.addResolvingPromise(this._resourcesFetch),o=this._resourcesFetch,Oe.add(o),o.finally((()=>Oe.delete(o)))}normalizeCtorArgs(e,t){const r={...e};return t&&(r.container=t),r}postInitialize(){}beforeFirstRender(){const e=this.loadDependencies();return this._messageBundleProps?.length||e?Promise.all([e,this._loadLocale()]).then((()=>{})).catch(u.H9):null}loadDependencies(){return null}loadLocale(){return null}destroy(){this.destroyed||((0,w.SC)(this._trackingTarget),(0,w.SC)(this.viewModel),this._detach(this.container),this._set("container",null),this._emitter.clear(),this.render=()=>null,this._projector=null,P(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.container?.id||Date.now().toString(16)+"-widget-"+De++}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[(Pe=we,be)](){return{projector:this._projector}}render(){throw new Error("not implemented")}scheduleRender(){this.destroyed||(P(this),this._projector.scheduleRender())}own(e){(0,v.XV)(y.Z.getLogger(this.declaredClass),"`Widget.own()` is deprecated in favor of Widget.addHandles()'",{replacement:"Widget.addHandles()",version:"4.28"}),this.addHandles(e)}classes(...e){return E.apply(this,e)}renderNow(){P(this),this._projector.renderNow()}_postInitialize(){if(this.destroyed)return;this.scheduleRender(),this._delegatedEventNames?.length&&this.addHandles((0,p.YP)((()=>this.viewModel),((e,t)=>{t&&this.removeHandles("delegated-events"),e&&(0,h.vT)(e)&&this.addHandles(this._delegatedEventNames.map((t=>(0,h.on)(e,t,(e=>{this.emit(t,e)})))),"delegated-events")}),p.tX)),this.postInitialize();const e=async()=>{await this._loadLocale().catch(u.H9),this.scheduleRender()};this.addHandles([(0,Ee.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)}};Be[Pe]=!0,(0,i._)([(0,_.Cb)()],Be.prototype,"_readyForTrueRender",void 0),(0,i._)([(0,_.Cb)({value:null})],Be.prototype,"container",null),(0,i._)([(0,I.p)("container")],Be.prototype,"castContainer",null),(0,i._)([(0,_.Cb)()],Be.prototype,"iconClass",void 0),(0,i._)([(0,_.Cb)()],Be.prototype,"icon",void 0),(0,i._)([(0,_.Cb)()],Be.prototype,"id",null),(0,i._)([(0,_.Cb)()],Be.prototype,"label",null),(0,i._)([(0,_.Cb)()],Be.prototype,"renderable",null),(0,i._)([(0,_.Cb)()],Be.prototype,"uiStrings",void 0),(0,i._)([(0,_.Cb)()],Be.prototype,"viewModel",void 0),(0,i._)([(0,_.Cb)({value:!0})],Be.prototype,"visible",null),(0,i._)([(0,_.Cb)()],Be.prototype,"key",void 0),(0,i._)([(0,_.Cb)()],Be.prototype,"children",void 0),(0,i._)([(0,_.Cb)()],Be.prototype,"afterCreate",void 0),(0,i._)([(0,_.Cb)()],Be.prototype,"afterUpdate",void 0),(0,i._)([(0,_.Cb)()],Be.prototype,"afterRemoved",void 0),Be=(0,i._)([(0,m.j)("esri.widgets.Widget")],Be);const qe=Be;function Ve(e){return(t,r)=>{t.hasOwnProperty("_messageBundleProps")||(t._messageBundleProps=t._messageBundleProps?t._messageBundleProps.slice():[]),t._messageBundleProps.push({bundlePath:e,propertyName:r})}}var Ze=function(e){return{vnodeSelector:"",properties:void 0,children:void 0,text:e.toString(),domNode:null}},$e=function(e,t){for(var r=0,s=e.length;r<s;r++){var i=e[r];Array.isArray(i)?$e(i,t):null!=i&&!1!==i&&(i.hasOwnProperty("vnodeSelector")||(i=Ze(i)),t.push(i))}};function Fe(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 $e(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",He={base:ze,group:`${ze}__group`,label:`${ze}__label`,footer:`${ze}__footer`,esriInput:"esri-input",esriButton:"esri-button",esriButtonSecondary:"esri-button--secondary"};let Je=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=Fe("div",{class:He.group},(0,g.n)(i?n.oAuthInfo:n.info,{server:t&&/\.arcgis\.com/i.test(t)?"ArcGIS Online":t,resource:`(${r||n.lblItem})`})),a=i?null:Fe("div",{class:He.group,key:"username"},Fe("label",{class:He.label},n.lblUser,Fe("input",{afterCreate:R,autocomplete:"off",bind:this,class:He.esriInput,"data-node-ref":"_usernameInputNode",required:!0,spellcheck:!1,type:"text",value:""}))),l=i?null:Fe("div",{class:He.group,key:"password"},Fe("label",{class:He.label},n.lblPwd,Fe("input",{afterCreate:R,bind:this,class:He.esriInput,"data-node-ref":"_passwordInputNode",required:!0,type:"password",value:""}))),h=Fe("div",{class:this.classes(He.group,He.footer)},Fe("input",{class:He.esriButton,disabled:!!s,type:"submit",value:s?n.lblSigning:n.lblOk}),Fe("input",{bind:this,class:this.classes(He.esriButton,He.esriButtonSecondary),onclick:this._cancel,type:"button",value:n.lblCancel})),c=e?Fe("div",null,e.details&&e.details.httpStatus?n.invalidUser:n.noAuthService):null;return Fe("form",{bind:this,class:He.base,onsubmit:this._submit},o,c,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,_.Cb)(),Ve("esri/identity/t9n/identity")],Je.prototype,"messages",void 0),(0,i._)([(0,_.Cb)()],Je.prototype,"signingIn",void 0),(0,i._)([(0,_.Cb)()],Je.prototype,"server",void 0),(0,i._)([(0,_.Cb)()],Je.prototype,"resource",void 0),(0,i._)([(0,_.Cb)()],Je.prototype,"error",void 0),(0,i._)([(0,_.Cb)()],Je.prototype,"oAuthPrompt",void 0),Je=(0,i._)([(0,m.j)("esri.identity.IdentityForm")],Je);const We=Je;var Ye=r(44291);const Ge="esri-identity-modal",Ke={base:Ge,open:`${Ge}--open`,closed:`${Ge}--closed`,title:`${Ge}__title`,dialog:`${Ge}__dialog`,content:`${Ge}__content`,closeButton:`${Ge}__close-button`,iconClose:"esri-icon-close"};let Xe=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={[Ke.open]:n,[Ke.closed]:!n},a=Fe("button",{"aria-label":i.close,bind:this,class:Ke.closeButton,onclick:this._close,title:i.close,type:"button"},Fe("span",{"aria-hidden":"true",class:Ke.iconClose})),l=`${e}_title`,h=`${e}_content`,c=s?Fe("h1",{class:Ke.title,id:l},s):null,d=n?Fe("div",{afterCreate:this._createFocusTrap,"aria-describedby":h,"aria-labelledby":l,bind:this,class:Ke.dialog,role:"dialog"},a,c,this._renderContent(h)):null;return Fe("div",{class:this.classes(Ke.base,o),tabIndex:-1},d)}_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,Ye.v)(e,{initialFocus:"input",onDeactivate:this._close}),this._toggleFocusTrap()}));this.addHandles((0,U.kB)((()=>cancelAnimationFrame(t))))}_renderContent(e){const t=this.content;return"string"==typeof t?Fe("div",{class:Ke.content,id:e,innerHTML:t}):function(e){return e&&"function"==typeof e.render}(t)?Fe("div",{class:Ke.content,id:e},t.render()):t instanceof HTMLElement?Fe("div",{afterCreate:this._attachToNode,bind:t,class:Ke.content,id:e}):null}_attachToNode(e){e.appendChild(this)}};(0,i._)([(0,_.Cb)({readOnly:!0})],Xe.prototype,"container",void 0),(0,i._)([(0,_.Cb)()],Xe.prototype,"content",void 0),(0,i._)([(0,_.Cb)()],Xe.prototype,"open",void 0),(0,i._)([(0,_.Cb)(),Ve("esri/t9n/common")],Xe.prototype,"messages",void 0),(0,i._)([(0,_.Cb)()],Xe.prototype,"title",null),Xe=(0,i._)([(0,m.j)("esri.identity.IdentityModal")],Xe);const Qe=Xe,et="esriJSAPIOAuth";class tt{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(et,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(et,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(et);if(t)try{e=JSON.parse(t)}catch(e){console.warn(e)}}return e}}tt.prototype.declaredClass="esri.identity.OAuthCredential";var rt,st=r(96674);let it=rt=class extends st.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 rt.fromJSON(this.toJSON())}};(0,i._)([(0,_.Cb)({json:{write:!0}})],it.prototype,"appId",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],it.prototype,"authNamespace",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],it.prototype,"expiration",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],it.prototype,"flowType",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],it.prototype,"forceLogin",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],it.prototype,"forceUserId",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],it.prototype,"locale",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],it.prototype,"minTimeUntilExpiration",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],it.prototype,"popup",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],it.prototype,"popupCallbackUrl",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],it.prototype,"popupWindowFeatures",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],it.prototype,"portalUrl",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],it.prototype,"preserveUrlHash",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],it.prototype,"userId",void 0),it=rt=(0,i._)([(0,m.j)("esri.identity.OAuthInfo")],it);const nt=it;let ot=class extends st.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,_.Cb)({json:{write:!0}})],ot.prototype,"adminTokenServiceUrl",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],ot.prototype,"currentVersion",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],ot.prototype,"hasPortal",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],ot.prototype,"hasServer",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],ot.prototype,"owningSystemUrl",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],ot.prototype,"owningTenant",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],ot.prototype,"server",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],ot.prototype,"shortLivedTokenValidity",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],ot.prototype,"tokenServiceUrl",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],ot.prototype,"webTierAuth",void 0),ot=(0,i._)([(0,m.j)("esri.identity.ServerInfo")],ot);const at=ot;var lt=r(19745);const ht={},ct=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)=>!!(ct(e)&&t&&t.some((t=>t.test(e.server))));let ut=null,pt=null;try{ut=window.localStorage,pt=window.sessionStorage}catch{}class ft 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=We,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 at,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 _t({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,c.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 at(t))})),e.length&&this.registerServers(e)}if(r){const e=[];r.forEach((t=>{t.appId&&e.push(t.declaredClass?t:new nt(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 _t(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 c;if(h&&s&&s.details&&498===s.details.httpStatus)h.destroy();else if(h)return c=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(c),o.promise;const d=this._findCredential(e,t);if(d)return o.resolve(d),o.promise;let p=this.findServerInfo(e);if(p)!p.hasPortal&&p.server&&p.owningSystemUrl&&this._hasSameServerInstance(p.server,p.owningSystemUrl)&&(p.hasPortal=!0),!p.hasServer&&this._isServerRsrc(e)&&(p._restInfoPms=this._getTokenSvcUrl(e),p.hasServer=!0);else{const t=this._getTokenSvcUrl(e);if(!t)return c=new a.Z("identity-manager:unknown-resource","Unknown resource - could not find token service endpoint."),o.reject(c),o.promise;p=new at,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,c,d,u,p,_,m;t&&(m=this.tokenValidity||n||this._defaultTokenValidity,m>n&&n>0&&(m=n)),r&&(l=r.isAdmin,h=r.serverUrl,c=r.token,p=r.signal,_=r.ssl,e.customParameters=r.customParameters),l?d=e.adminTokenServiceUrl:(d=e.tokenServiceUrl,u=new f.R9(d.toLowerCase()),e.webTierAuth&&r?.serverUrl&&!_&&"http"===i.scheme&&((0,f.D6)(i.uri,d,!0)||"https"===u.scheme&&i.host===u.host&&"7080"===i.port&&"7443"===u.port)&&(d=d.replace(/^https:/i,"http:").replace(/:7443/i,":7080")));const g={query:{request:"getToken",username:t?.username,password:t?.password,serverUrl:h,token:c,expiration:m,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||(g.withCredentials=!1),(0,o.Z)(d,g).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 ht[i]||(ht[i]={}),t&&(ht[i][t.username]=t.password),s.validity=m,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.Z)(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(),c?.remove(),o?.destroy(),this.dialog?.destroy(),this.dialog=o=l=h=c=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 Qe,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),c=o.on("submit",(e=>{this.generateToken(t,e,{isAdmin:r.isAdmin,signal:r.signal}).then((n=>{i();const o=new _t({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&&_()})),i.resUrl_=e,i.sinfo_=t,i.oinfo_=r;const o=r._oAuthCred;if(o.storage&&("authorization-code"===r.flowType||"auto"===r.flowType&&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,c,d;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 Qe,this.dialog.content=l,this.dialog.open=!0,this.emit("dialog-create"),h=l.on("cancel",_),c=(0,p.YP)((()=>this.dialog.open),_),d=l.on("submit",(()=>{m(),this._doOAuthSignIn(e,t,r,i)}))):this._doOAuthSignIn(e,t,r,i)}));const _=()=>{m(),this._oAuthDfd=null,i.reject(new a.Z("identity-manager:user-aborted","ABORTED"))},m=()=>{h?.remove(),c?.remove(),d?.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.Z)(`${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",c=this.credentials.filter((t=>this._hasSameServerInstance(t.server,e)&&t.scope===h));if(e=l||e,c.length)if(1===c.length){if(r=c[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(c.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,lt.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?.owningSystemUrl;s&&ct(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.Z)(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 _t({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?ut:pt,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 _t({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?ut:pt,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.Z)(`${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.Z)(`${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.Z)(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 c=e.sinfo_,d=!e.options_||!1!==e.options_.prompt,p=c.hasPortal&&this._findOAuthInfo(e.resUrl_);let _,m;if(i)t(new _t({userId:i,server:c.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 _t(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 tt(p,ut),t=new tt(p,pt);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()){_=new _t({userId:i.userId,server:c.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(c.server,i.refreshToken,i.appId).then((e=>(_.expires=Date.now()+1e3*e.expires_in,_.token=e.access_token,_))):Promise.resolve(_),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(_)}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,c).then((e=>{t(e)})).catch(r)}else{const s=()=>{d?e._pendingDfd=this.oAuthSignIn(e.resUrl_,c,p,e.options_).then(t,r):(m=new a.Z("identity-manager:not-authenticated","User is not signed in."),r(m))};this._doPortalSignIn(e.resUrl_)?e._pendingDfd=this._getPlatformSelf(c.server,p.appId).then((e=>{(0,f.D6)(e.portalUrl,this._appOrigin,!0)?(_=new _t({userId:e.username,server:c.server,expires:Date.now()+1e3*e.expires_in,token:e.token}),t(_)):s()})).catch(s):s()}}else if(d){if(this._checkProtocol(e.resUrl_,c,r,e.admin_)){let s=e.options_;e.admin_&&(s=s||{},s.isAdmin=!0),e._pendingDfd=this.signIn(e.resUrl_,c,s).then(t,r)}}else m=new a.Z("identity-manager:not-authenticated","User is not signed in."),r(m)},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 _t(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 _t({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,d.hS)("authInfo.tokenServicesUrl",t)||(0,d.hS)("authInfo.tokenServiceUrl",t)||(0,d.hS)("tokenServiceUrl",t))??null,r.shortLivedTokenValidity=(0,d.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.Z)(r+"/sharing/rest",{query:{f:"json"}}).then((()=>{this._defaultOAuthInfo=new nt({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.Z)(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",c=l+"?"+(0,f.B7)(o);if(r.popup){const e=window.open(c,"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=c}_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}}ft.prototype.declaredClass="esri.identity.IdentityManagerBase";let _t=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?.owningSystemUrl,r=!!t&&"server"===this.scope,i=r&&dt(e,s.id._legacyFed),n=e.webTierAuth,o=n&&s.id.normalizeWebTierAuth,a=ht[this.server],l=a&&a[this.userId];let h,c=this.resources&&this.resources[0],d=r?s.id.findServerInfo(t):null,u={username:this.userId,password:l};if(n&&!o)return;r&&!d&&s.id.serverInfos.some((e=>(s.id._isIdProvider(t,e.server)&&(d=e),!!d)));const p=d?s.id.findCredential(d.server,this.userId):null;if(!r||p){if(!i){if(r)h={serverUrl:c,token:p&&p.token,ssl:p&&p.ssl};else if(o)u=null,h={ssl:this.ssl};else{if(!l){let t;return c&&(c=s.id._sanitizeUrl(c),this._enqueued=1,t=s.id._enqueue(c,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?d: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?.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):null,r=t?.owningSystemUrl,i=r?s.id.findServerInfo(r):null;!1===e||r&&"portal"!==this.scope&&(!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,c.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,_.Cb)()],_t.prototype,"creationTime",void 0),(0,i._)([(0,_.Cb)()],_t.prototype,"expires",void 0),(0,i._)([(0,_.Cb)()],_t.prototype,"isAdmin",void 0),(0,i._)([(0,_.Cb)()],_t.prototype,"oAuthState",void 0),(0,i._)([(0,_.Cb)()],_t.prototype,"resources",void 0),(0,i._)([(0,_.Cb)()],_t.prototype,"scope",void 0),(0,i._)([(0,_.Cb)()],_t.prototype,"server",void 0),(0,i._)([(0,_.Cb)()],_t.prototype,"ssl",void 0),(0,i._)([(0,_.Cb)()],_t.prototype,"token",void 0),(0,i._)([(0,_.Cb)()],_t.prototype,"tokenRefreshBuffer",void 0),(0,i._)([(0,_.Cb)()],_t.prototype,"userId",void 0),(0,i._)([(0,_.Cb)()],_t.prototype,"validity",void 0),_t=(0,i._)([(0,m.j)("esri.identity.Credential")],_t);class mt extends ft{}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.Z)(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],c=(0,s.Su)(i),d=`${l}${h}.json`,u=c?`${l}${h}_${c}.json`:d;let p;try{p=await o(e(u))}catch(t){if(u===d)throw new n.Z("intl:unknown-bundle",`Bundle "${r}" cannot be loaded`,{error:t});try{p=await o(e(d))}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,c=r(99880);(0,s.tz)((h={pattern:"esri/",location:c.V},new a(h)))},90344:(e,t,r)=>{"use strict";r.d(t,{Xr:()=>f,Ze:()=>v,f1:()=>w,p6:()=>y});var s=r(35454),i=r(70171),n=r(15512);r(17126);const o=Intl.DateTimeFormat().resolvedOptions().timeZone,a=(n.pt,{year:"numeric",month:"numeric",day:"numeric"}),l={year:"numeric",month:"long",day:"numeric"},h={year:"numeric",month:"short",day:"numeric"},c={year:"numeric",month:"long",weekday:"long",day:"numeric"},d={hour:"numeric",minute:"numeric"},u={...d,second:"numeric"},p={"short-date":a,"short-date-short-time":{...a,...d},"short-date-short-time-24":{...a,...d,hour12:!1},"short-date-long-time":{...a,...u},"short-date-long-time-24":{...a,...u,hour12:!1},"short-date-le":a,"short-date-le-short-time":{...a,...d},"short-date-le-short-time-24":{...a,...d,hour12:!1},"short-date-le-long-time":{...a,...u},"short-date-le-long-time-24":{...a,...u,hour12:!1},"long-month-day-year":l,"long-month-day-year-short-time":{...l,...d},"long-month-day-year-short-time-24":{...l,...d,hour12:!1},"long-month-day-year-long-time":{...l,...u},"long-month-day-year-long-time-24":{...l,...u,hour12:!1},"day-short-month-year":h,"day-short-month-year-short-time":{...h,...d},"day-short-month-year-short-time-24":{...h,...d,hour12:!1},"day-short-month-year-long-time":{...h,...u},"day-short-month-year-long-time-24":{...h,...u,hour12:!1},"long-date":c,"long-date-short-time":{...c,...d},"long-date-short-time-24":{...c,...d,hour12:!1},"long-date-long-time":{...c,...u},"long-date-long-time-24":{...c,...u,hour12:!1},"long-month-year":{month:"long",year:"numeric"},"short-month-year":{month:"short",year:"numeric"},year:{year:"numeric"},"short-time":d,"long-time":u},f=(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"}),_={ar:"ar-u-nu-latn-ca-gregory"};let m=new WeakMap;const g=p["short-date-short-time"];function v(e){return p[e]}function y(e,t=g){return function(e){let t=m.get(e);if(!t){const r=(0,i.Kd)(),s=_[r]||r,o=w(e.timeZone??n.By),a={...e,timeZone:o};t=new Intl.DateTimeFormat(s,a),m.set(e,t)}return t}(t).format(e)}function w(e){switch(e){case n.By:return o;case n._4:return n.pt;default:return e}}(0,i.Ze)((()=>{m=new WeakMap}))},70171:(e,t,r)=>{"use strict";r.d(t,{G3:()=>l,Kd:()=>a,Ze:()=>u,qe:()=>c});var s=r(50758);let i;const n=globalThis.esriConfig?.locale??globalThis.dojoConfig?.locale;function o(){return n??globalThis.navigator?.language??"en"}function a(){return void 0===i&&(i=o()),i}function l(e=a()){const t=/^([a-zA-Z]{2,3})(?:[_\-]\w+)*$/.exec(e);return t?.[1].toLowerCase()}const h=[];function c(e){return h.push(e),(0,s.kB)((()=>h.splice(h.indexOf(e),1)))}const d=[];function u(e){return d.push(e),(0,s.kB)((()=>h.splice(d.indexOf(e),1)))}globalThis.addEventListener?.("languagechange",(function(){const e=o();i!==e&&(i=e,[...d].forEach((t=>{t.call(null,e)})),[...h].forEach((t=>{t.call(null,e)})))}))},94443:(e,t,r)=>{"use strict";r.d(t,{ME:()=>f,Su:()=>_,tz:()=>p});var s=r(20102),i=r(50758),n=r(95330),o=r(70171);const a=/^([a-z]{2})(?:[-_]([A-Za-z]{2}))?$/,l={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 h(e){return e in l}Object.keys(l);const c=[],d=new Map;function u(e){for(const t of d.keys())m(e.pattern,t)&&d.delete(t)}function p(e){return c.includes(e)||(u(e),c.unshift(e)),(0,i.kB)((()=>{const t=c.indexOf(e);t>-1&&(c.splice(t,1),u(e))}))}async function f(e){const t=(0,o.Kd)();d.has(e)||d.set(e,async function(e,t){const r=[];for(const s of c)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 _(e){if(!a.test(e))return null;const t=a.exec(e);if(null===t)return null;const[,r,s]=t,i=r+(s?"-"+s.toUpperCase():"");return h(i)?i:h(r)?r:null}function m(e,t){return"string"==typeof e?t.startsWith(e):e.test(t)}(0,o.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,n.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,{uf:()=>a});var s=r(70171);const i={ar:"ar-u-nu-latn"};let n=new WeakMap,o={};function a(e,t){return Object.is(e,-0)&&(e=0),function(e){const t=e||o;if(!n.has(t)){const r=(0,s.Kd)(),o=i[(0,s.Kd)()]||r;n.set(t,new Intl.NumberFormat(o,e))}return n.get(t)}(t).format(e)}(0,s.Ze)((()=>{n=new WeakMap,o={}}))},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?c(a,l):n?d(a,n):u(a)}(e,t,s)))}function c(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 d(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):""}}},15512:(e,t,r)=>{"use strict";r.d(t,{By:()=>s,_4:()=>i,pt:()=>n});const s="system",i="unknown",n="UTC"}}]);