@arcgis/core 5.2.0-next.113 → 5.2.0-next.115

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 (233) hide show
  1. package/Graphic.d.ts +5 -3
  2. package/Ground.d.ts +5 -4
  3. package/applications/Urban/LineImagePattern3D.js +1 -1
  4. package/arcgisGlobal.d.ts +2 -0
  5. package/assets/esri/core/workers/RemoteClient.js +1 -1
  6. package/assets/esri/core/workers/chunks/02f94f9d704f03ddb5c6.js +1 -0
  7. package/assets/esri/core/workers/chunks/{c517e732cab41093b2e0.js → 0312c40d94b248ad71e3.js} +1 -1
  8. package/assets/esri/core/workers/chunks/0463c807b37f01bbc35c.js +1 -0
  9. package/assets/esri/core/workers/chunks/0ff13f7a18b0123d253e.js +1 -0
  10. package/assets/esri/core/workers/chunks/2e0fd0536408053ac6f5.js +1 -0
  11. package/assets/esri/core/workers/chunks/{6b264006b96cbf93d8ed.js → 48d3da636be15581fd7d.js} +1 -1
  12. package/assets/esri/core/workers/chunks/515fe302743c0b46f7e0.js +1 -0
  13. package/assets/esri/core/workers/chunks/{982a396bd4fffa62e911.js → 526cc64ae46dec3fbeda.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{d13cf2e8b24e978ea77c.js → 7243d5721bb6a7329055.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{785206da3962ba23de16.js → 84b89c523d3e16a5ee46.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{484b3e2a220c440ccbb4.js → 9b92c41907e2da80c288.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{4d2553219ffd223b0e90.js → a774006be107e449bc29.js} +1 -1
  18. package/assets/esri/core/workers/chunks/b45ebb1b64ee7314375e.js +1 -0
  19. package/assets/esri/core/workers/chunks/{e0f417992889a6c41095.js → baa8bce361a2677533ec.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{96ebf76661b12128ddd5.js → be4de7111bc21bc69de1.js} +1 -1
  21. package/assets/esri/core/workers/chunks/f18ee2eaa96d103627a6.js +1 -0
  22. package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.ar.json +1 -1
  23. package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.bg.json +1 -1
  24. package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.bs.json +1 -1
  25. package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.ca.json +1 -1
  26. package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.cs.json +1 -1
  27. package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.da.json +1 -1
  28. package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.de.json +1 -1
  29. package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.el.json +1 -1
  30. package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.es.json +1 -1
  31. package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.et.json +1 -1
  32. package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.fi.json +1 -1
  33. package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.fr.json +1 -1
  34. package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.he.json +1 -1
  35. package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.hr.json +1 -1
  36. package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.hu.json +1 -1
  37. package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.id.json +1 -1
  38. package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.it.json +1 -1
  39. package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.ja.json +1 -1
  40. package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.ko.json +1 -1
  41. package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.lt.json +1 -1
  42. package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.lv.json +1 -1
  43. package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.nl.json +1 -1
  44. package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.no.json +1 -1
  45. package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.pl.json +1 -1
  46. package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.pt-BR.json +1 -1
  47. package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.pt-PT.json +1 -1
  48. package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.ro.json +1 -1
  49. package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.ru.json +1 -1
  50. package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.sk.json +1 -1
  51. package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.sl.json +1 -1
  52. package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.sr.json +1 -1
  53. package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.sv.json +1 -1
  54. package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.th.json +1 -1
  55. package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.tr.json +1 -1
  56. package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.uk.json +1 -1
  57. package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.vi.json +1 -1
  58. package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.zh-CN.json +1 -1
  59. package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.zh-HK.json +1 -1
  60. package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.zh-TW.json +1 -1
  61. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/messages.ja.json +1 -1
  62. package/assets/esri/views/3d/environment/resources/milkyway-band.ktx2 +0 -0
  63. package/assets/esri/widgets/DistanceMeasurement2D/t9n/messages.de.json +1 -1
  64. package/assets/esri/widgets/DistanceMeasurement2D/t9n/messages.ro.json +1 -1
  65. package/assets/esri/widgets/Expand/t9n/messages.id.json +1 -1
  66. package/assets/esri/widgets/Features/t9n/messages.he.json +1 -1
  67. package/assets/esri/widgets/Features/t9n/messages.uk.json +1 -1
  68. package/assets/esri/widgets/Home/t9n/messages.bs.json +1 -1
  69. package/assets/esri/widgets/Home/t9n/messages.de.json +1 -1
  70. package/assets/esri/widgets/Home/t9n/messages.et.json +1 -1
  71. package/assets/esri/widgets/Home/t9n/messages.fi.json +1 -1
  72. package/assets/esri/widgets/Home/t9n/messages.hr.json +1 -1
  73. package/assets/esri/widgets/Home/t9n/messages.hu.json +1 -1
  74. package/assets/esri/widgets/Home/t9n/messages.id.json +1 -1
  75. package/assets/esri/widgets/Home/t9n/messages.lv.json +1 -1
  76. package/assets/esri/widgets/Home/t9n/messages.nl.json +1 -1
  77. package/assets/esri/widgets/Home/t9n/messages.pt-PT.json +1 -1
  78. package/assets/esri/widgets/Home/t9n/messages.th.json +1 -1
  79. package/assets/esri/widgets/Home/t9n/messages.tr.json +1 -1
  80. package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.de.json +1 -1
  81. package/assets/esri/widgets/Print/t9n/messages.es.json +1 -1
  82. package/assets/esri/widgets/Print/t9n/messages.it.json +1 -1
  83. package/assets/esri/widgets/Print/t9n/messages.lt.json +1 -1
  84. package/assets/esri/widgets/Print/t9n/messages.pt-PT.json +1 -1
  85. package/assets/esri/widgets/Print/t9n/messages.sl.json +1 -1
  86. package/assets/esri/widgets/Print/t9n/messages.sr.json +1 -1
  87. package/assets/esri/widgets/Search/t9n/messages.bs.json +1 -1
  88. package/assets/esri/widgets/Search/t9n/messages.de.json +1 -1
  89. package/assets/esri/widgets/Search/t9n/messages.es.json +1 -1
  90. package/assets/esri/widgets/Search/t9n/messages.et.json +1 -1
  91. package/assets/esri/widgets/Search/t9n/messages.fi.json +1 -1
  92. package/assets/esri/widgets/Search/t9n/messages.he.json +1 -1
  93. package/assets/esri/widgets/Search/t9n/messages.hr.json +1 -1
  94. package/assets/esri/widgets/Search/t9n/messages.it.json +1 -1
  95. package/assets/esri/widgets/Search/t9n/messages.lv.json +1 -1
  96. package/assets/esri/widgets/smartMapping/HeatmapSlider/t9n/messages.ar.json +1 -1
  97. package/assets/esri/widgets/smartMapping/HeatmapSlider/t9n/messages.ca.json +1 -1
  98. package/assets/esri/widgets/smartMapping/HeatmapSlider/t9n/messages.cs.json +1 -1
  99. package/assets/esri/widgets/smartMapping/HeatmapSlider/t9n/messages.el.json +1 -1
  100. package/assets/esri/widgets/smartMapping/HeatmapSlider/t9n/messages.es.json +1 -1
  101. package/assets/esri/widgets/smartMapping/HeatmapSlider/t9n/messages.fi.json +1 -1
  102. package/assets/esri/widgets/smartMapping/HeatmapSlider/t9n/messages.he.json +1 -1
  103. package/assets/esri/widgets/smartMapping/HeatmapSlider/t9n/messages.it.json +1 -1
  104. package/assets/esri/widgets/smartMapping/HeatmapSlider/t9n/messages.lt.json +1 -1
  105. package/assets/esri/widgets/smartMapping/HeatmapSlider/t9n/messages.lv.json +1 -1
  106. package/assets/esri/widgets/smartMapping/HeatmapSlider/t9n/messages.pl.json +1 -1
  107. package/assets/esri/widgets/smartMapping/HeatmapSlider/t9n/messages.ro.json +1 -1
  108. package/assets/esri/widgets/smartMapping/HeatmapSlider/t9n/messages.ru.json +1 -1
  109. package/assets/esri/widgets/smartMapping/HeatmapSlider/t9n/messages.sl.json +1 -1
  110. package/assets/esri/widgets/smartMapping/HeatmapSlider/t9n/messages.uk.json +1 -1
  111. package/assets/esri/widgets/support/GridControls/t9n/messages.pt-BR.json +1 -1
  112. package/chunks/DeepSky.glsl.js +1 -1
  113. package/chunks/RibbonLine.glsl.js +63 -58
  114. package/config.js +1 -1
  115. package/core/Evented.d.ts +1 -1
  116. package/core/screenUtils.js +1 -1
  117. package/core/units.js +1 -1
  118. package/form/elements/AttachmentElement.d.ts +5 -5
  119. package/form/elements/inputs/attachments/AttachmentInput.d.ts +1 -1
  120. package/graphic/getGraphicOriginTitle.d.ts +10 -0
  121. package/graphic/getGraphicOriginTitle.js +2 -0
  122. package/kernel.js +1 -1
  123. package/layers/FeatureLayer.d.ts +2 -2
  124. package/layers/MapNotesLayer.js +1 -1
  125. package/layers/raster/functions/rasterProjectionHelper.js +1 -1
  126. package/layers/support/FeatureReductionBinning.d.ts +2 -2
  127. package/layers/support/FeatureReductionCluster.d.ts +2 -2
  128. package/layers/support/Field.js +1 -1
  129. package/layers/support/SubtypeSublayer.d.ts +1 -1
  130. package/layers/support/TimeSeriesInfo.d.ts +1 -1
  131. package/layers/support/featurePopupQueryUtils.js +1 -1
  132. package/layers/support/timeSeriesUtils.js +1 -1
  133. package/layers/support/types.d.ts +1 -1
  134. package/layers/types.d.ts +1 -2
  135. package/package.json +3 -3
  136. package/popup/FeatureContent.d.ts +7 -7
  137. package/portal/schemas/definitions.js +1 -1
  138. package/portal/types.d.ts +1 -1
  139. package/renderers/DotDensityRenderer.d.ts +2 -2
  140. package/rest/knowledgeGraph/ReplicaDefinition.d.ts +1 -1
  141. package/rest/knowledgeGraphService.d.ts +2 -2
  142. package/rest/support/OutDistance.d.ts +19 -18
  143. package/rest/support/Query.d.ts +49 -21
  144. package/rest/support/RelationshipQuery.d.ts +1 -1
  145. package/smartMapping/renderers/support/utils.js +1 -1
  146. package/support/revision.js +1 -1
  147. package/symbols/LineSymbol3D.js +1 -1
  148. package/symbols/cim/types.d.ts +32 -0
  149. package/symbols/patterns/LinePattern3D.js +1 -1
  150. package/symbols/patterns/LineStylePattern3D.js +1 -1
  151. package/symbols/patterns/LineTemplatePattern3D.js +1 -1
  152. package/symbols/patterns/utils.js +1 -1
  153. package/views/2d/engine/webgl/util/DimensionMatcher.js +1 -1
  154. package/views/2d/layers/graphics/GraphicStore.js +1 -1
  155. package/views/2d/layers/support/annodime/DimensionInfo.js +1 -1
  156. package/views/2d/support/clippingUtils.js +1 -1
  157. package/views/2d/support/hitTestUtils.js +1 -1
  158. package/views/3d/analysis/ShadowCastAnalysisView3D.d.ts +1 -1
  159. package/views/3d/analysis/Viewshed/ViewshedEditTool.js +1 -1
  160. package/views/3d/analysis/Viewshed/ViewshedPlacementController.js +1 -1
  161. package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
  162. package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
  163. package/views/3d/analysis/Viewshed/placementUtils.js +1 -1
  164. package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
  165. package/views/3d/support/buffer/InterleavedLayout.js +1 -1
  166. package/views/3d/webgl-engine/effects/glow/BlurEmission.js +1 -1
  167. package/views/3d/webgl-engine/effects/stars/Stars.js +1 -1
  168. package/views/3d/webgl-engine/lib/AttributeView.js +2 -0
  169. package/views/3d/webgl-engine/lib/attributeViewUtils.js +2 -0
  170. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  171. package/views/3d/webgl-engine/materials/HUDMaterialBaseInstance.js +1 -1
  172. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  173. package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
  174. package/views/3d/webgl-engine/shaders/RibbonLineTechniqueConfiguration.js +1 -1
  175. package/views/BreakpointsOwner.d.ts +2 -2
  176. package/views/PopupView.d.ts +64 -2
  177. package/views/SceneView.js +1 -1
  178. package/views/SelectionManager.d.ts +24 -24
  179. package/views/View.js +1 -1
  180. package/views/View2D.js +1 -1
  181. package/views/interactive/support/types.d.ts +0 -1
  182. package/views/layers/FeatureLikeLayerView.js +1 -1
  183. package/views/layers/support/MapServiceLayerViewHelper.js +1 -1
  184. package/views/support/DefaultsFromMap.js +1 -1
  185. package/widgets/Attachments/support/attachmentUtils.d.ts +8 -0
  186. package/widgets/BasemapLayerList/BasemapLayerListViewModel.d.ts +1 -0
  187. package/widgets/BasemapLayerList/BasemapLayerListViewModel.js +1 -1
  188. package/widgets/BasemapLayerList/BasemapLayerListVisibleElements.d.ts +5 -1
  189. package/widgets/BasemapLayerList/types.d.ts +15 -2
  190. package/widgets/BasemapLayerList.d.ts +1 -1
  191. package/widgets/BasemapLayerList.js +1 -1
  192. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
  193. package/widgets/BatchAttributeForm/batchAttributeFormUtils.js +1 -1
  194. package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.d.ts +14 -0
  195. package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.js +1 -1
  196. package/widgets/BatchAttributeForm/inputs/BatchFormInputs.js +1 -1
  197. package/widgets/BatchAttributeForm/inputs/FieldInput.d.ts +29 -2
  198. package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
  199. package/widgets/BatchAttributeForm/inputs/support/MultipleChoiceController.d.ts +1 -5
  200. package/widgets/BatchAttributeForm/inputs/support/inputUtils.js +1 -1
  201. package/widgets/BatchAttributeForm/inputs/types.d.ts +8 -1
  202. package/widgets/BatchAttributeForm.js +1 -1
  203. package/widgets/CatalogLayerList/CatalogLayerListViewModel.d.ts +2 -1
  204. package/widgets/CatalogLayerList/CatalogLayerListViewModel.js +1 -1
  205. package/widgets/CatalogLayerList/CatalogLayerListVisibleElements.d.ts +5 -1
  206. package/widgets/CatalogLayerList/types.d.ts +12 -1
  207. package/widgets/CatalogLayerList.d.ts +2 -1
  208. package/widgets/CatalogLayerList.js +1 -1
  209. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  210. package/widgets/Editor/EditorViewModel.d.ts +2 -2
  211. package/widgets/Editor.d.ts +2 -2
  212. package/widgets/FeatureTable/FeatureTableViewModel.d.ts +6 -6
  213. package/widgets/FeatureTable/support/FeatureStore.d.ts +2 -2
  214. package/widgets/FeatureTable.d.ts +5 -5
  215. package/widgets/LayerList/LayerListVisibleElements.d.ts +4 -1
  216. package/widgets/LayerList.js +1 -1
  217. package/widgets/TableList/ListItem.d.ts +2 -0
  218. package/widgets/TableList/ListItemPanel.d.ts +4 -0
  219. package/widgets/TableList/TableListViewModel.d.ts +4 -0
  220. package/widgets/TableList/TableListViewModel.js +1 -1
  221. package/widgets/TableList/TableListVisibleElements.d.ts +6 -1
  222. package/widgets/TableList/types.d.ts +12 -1
  223. package/widgets/TableList.d.ts +3 -0
  224. package/widgets/TableList.js +1 -1
  225. package/widgets/support/SelectionList/SelectionListViewModel.d.ts +1 -1
  226. package/assets/esri/core/workers/chunks/078ed48eb055dd213ee6.js +0 -1
  227. package/assets/esri/core/workers/chunks/1004e77593dfa506cd5d.js +0 -1
  228. package/assets/esri/core/workers/chunks/510a190a6f0a60ae38c3.js +0 -1
  229. package/assets/esri/core/workers/chunks/cd0f5cd0fefe7f49e3d8.js +0 -1
  230. package/assets/esri/core/workers/chunks/e6fb7b93cf73b05b1079.js +0 -1
  231. package/assets/esri/core/workers/chunks/f86ea5cf4814b458d50b.js +0 -1
  232. package/assets/esri/core/workers/chunks/f9b29d2ce1cd31c0fce1.js +0 -1
  233. package/graphic/graphicOrigins.js +0 -2
package/views/View.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../Map.js";import{createTask as i}from"../core/asyncUtils.js";import r from"../core/Collection.js";import s from"../core/CollectionFlattener.js";import{referenceSetter as a}from"../core/collectionUtils.js";import o from"../core/Error.js";import{EventedMixin as n}from"../core/Evented.js";import l from"../core/Handles.js";import{makeHandle as p}from"../core/handleUtils.js";import has from"../core/has.js";import{isLoadable as h}from"../core/Loadable.js";import d from"../core/Logger.js";import{destroyMaybe as y,abortMaybe as u}from"../core/maybe.js";import{EsriPromise as m}from"../core/Promise.js";import{after as c}from"../core/promiseUtils.js";import g from"../core/ReactiveSet.js";import{watch as f,sync as w,whenOnce as v,when as _,syncAndInitial as M}from"../core/reactiveUtils.js";import{property as V,subclass as b}from"../core/accessorSupport/decorators.js";import{owningCollectionProperty as R}from"../core/support/OwningCollection.js";import{UpdatingHandles as S}from"../core/support/UpdatingHandles.js";import T from"../geometry/Extent.js";import j from"../geometry/HeightModelInfo.js";import E from"../geometry/SpatialReference.js";import{equals as L}from"../geometry/support/spatialReferenceUtils.js";import{AnalysesCollection as x}from"../support/AnalysesCollection.js";import{GraphicsCollection as C}from"../support/GraphicsCollection.js";import{system as F}from"../time/constants.js";import O from"../time/TimeExtent.js";import{isTimeZoneValid as k}from"../time/timeZoneUtils.js";import H from"./BasemapView.js";import I from"./Magnifier.js";import Z from"./SelectionManager.js";import q from"./Theme.js";import{ToolViewManager as A}from"./ToolViewManager.js";import{GlyphMosaic as P}from"./2d/engine/webgl/GlyphMosaic.js";import{makeDefaultHighlightOptions as W}from"./3d/support/DefaultHighlights.js";import D from"./input/Input.js";import{ViewEvents as U}from"./input/ViewEvents.js";import z from"./navigation/Navigation.js";import{deduplicateAttributionItems as G}from"./support/attributionUtils.js";import{DefaultsFromMap as N}from"./support/DefaultsFromMap.js";import{defaultHighlightName as $}from"./support/HighlightDefaults.js";import B from"./support/HighlightOptions.js";import J from"./support/LayerViewManager.js";import K from"./support/RequiredFieldsOptions.js";import{checkWebAssemblyRequirements as Q}from"./support/WebAssemblyRequirements.js";import{checkWebGLRequirements as X}from"./support/WebGLRequirements.js";var Y;let ee=class extends(n(m)){static{Y=this}constructor(e){super(e),this._userSpatialReference=null,this.handles=new l,this.updatingHandles=new S,this.allLayerViews=new s({getCollections:()=>this.layerviewCollections,getChildrenFunction:ie}),this.animationsEnabled=!0,this.attributionVisible=!0,this.basemapView=null,this.dependencies={popup:void 0},this.displayFilterEnabled=!0,this.fatalError=null,this.graphics=new C,this.typeSpecificPreconditionsReady=!0,this.layerViews=new r,this.magnifier=new I,this.padding={left:0,top:0,right:0,bottom:0},this.ready=!1,this._readyStateWaitingTask=null,this.type=null,this.scale=null,this.updating=!1,this.initialExtentRequired=!0,this._lowPriorityCursorHandles=new r,this._highPriorityCursorHandles=new r,this.input=new D,this.navigation=new z,this.layerViewManager=null,this.analysisViewManager=null,this.isHeightModelInfoRequired=!1,this.width=null,this.height=null,this.resizing=!1,this.suspended=!1,this.viewEvents=new U(this),this.requiredFieldsOptions=new K,this._isValid=!1,this._readyCycleForced=!1,this._lockedSpatialReference=null,this._userTimeZone=null,this._lockedTimeZone=null,this._userTimeExtent=null,this._lockedTimeExtent=null,this._glyphMosaic=null,this.theme=null,this.registeredComponents=new g,this.handles.add(f(()=>this.preconditionsReady,e=>{const t=this.ready;if(e?(this._lockedSpatialReference=this.spatialReference,this._lockedTimeZone=this.timeZone,this._lockedTimeExtent=this.timeExtent,Y.views.add(this)):(this._lockedSpatialReference=null,Y.views.remove(this)),this.notifyChange("spatialReference"),!e&&t)this.toolViewManager?.detach(),this.analysisViewManager?.detach(),this.layerViewManager?.clear(),this._glyphMosaic?.dispose(),this._teardown();else if(e&&!t){try{this._startup()}catch(i){return void queueMicrotask(()=>{this.fatalError=new o("view:startup-error","View._startup failed",i)})}this._glyphMosaic=new P(1024,1024,!0),this.analysisViewManager?.attach(),this.toolViewManager.attach()}},w)),this.analyses=new x}initialize(){this.addResolvingPromise(Promise.all([this.loadAsyncDependencies(),this.validate()]).then(()=>(this._isValid=!0,v(()=>this.ready)))),this.basemapView=new H({view:this}),this.layerViewManager=new J({view:this,layerViewFilter:e=>this.layerViewFilter?.(e)??!0,layerViewImporter:{importLayerView:e=>this.importLayerView(e),hasLayerViewModule:e=>this.hasLayerViewModule(e)},layerviewMapping:this._layerToLayerviewMapping}),this.toolViewManager=new A({view:this}),this.selectionManager=new Z({view:this}),this.addHandles([_(()=>"map-content-error"===this.readyState&&!this.spatialReference,()=>{d.getLogger(this).warn("#spatialReference","no spatial reference could be derived from the currently added map layers")}),f(()=>this.initialExtentRequired,e=>this.defaultsFromMap.required={...this.defaultsFromMap.required,extent:e},M),f(()=>this.ready,e=>{this.defaultsFromMap&&(this.defaultsFromMap.viewReady=e,this.defaultsFromMap.userSpatialReference=e?this.spatialReference:this._userSpatialReference)},w),f(()=>this._userSpatialReference,e=>{this.defaultsFromMap&&(this.defaultsFromMap.userSpatialReference=e)},M)])}get _layerToLayerviewMapping(){return Y._layerToLayerview}static{this._layerToLayerview=[["view.map.basemap.baseLayers","view.basemapView.baseLayerViews"],["view.map.basemap.groundLayers","view.basemapView.groundLayerViews"],["view.map.basemap.referenceLayers","view.basemapView.referenceLayerViews"],["view.map.layers","view.layerViews"]]}destroy(){this.destroyed||(Y.views.remove(this),this.viewEvents.destroy(),this.allLayerViews.destroy(),this.navigation&&(this.navigation.destroy(),this._set("navigation",null)),this.graphics=y(this.graphics),this.analyses=y(this.analyses),this.defaultsFromMap.destroy(),this._set("defaultsFromMap",null),this.analysisViewManager=y(this.analysisViewManager),this.toolViewManager=y(this.toolViewManager),this.layerViewManager=y(this.layerViewManager),this.selectionManager=y(this.selectionManager),this.basemapView=y(this.basemapView),this.layerViews.destroyAll(),this.invalidate(),this.handles.destroy(),this.map=y(this.map),this.updatingHandles.destroy())}_startup(){this._set("ready",!0)}_teardown(){this._set("ready",!1)}whenReady(){return Promise.resolve(this)}toMap(){return d.getLogger(this).error("#toMap()","Not implemented on this instance of View"),null}get activeTool(){return this.toolViewManager?.activeTool}set activeTool(e){this.toolViewManager&&(this.toolViewManager.activeTool=e)}get layerviewCollections(){return[this.basemapView?.baseLayerViews,this.basemapView?.groundLayerViews,this.layerViews,this.basemapView?.referenceLayerViews]}get analyses(){return this._get("analyses")}set analyses(e){this._set("analyses",e)}get animation(){return this._get("animation")}set animation(e){this._set("animation",e)}get attributionItems(){return this.suspended?[]:G(this._get("attributionItems"),this.getAttributionItems())}get center(){return null}get defaultsFromMapSettings(){return{}}get defaultsFromMap(){return new N({required:{tileInfo:!1,heightModelInfo:!1,extent:!1},map:()=>this.map,getSpatialReferenceSupport:(e,t)=>this.getSpatialReferenceSupport(e,t),...this.defaultsFromMapSettings})}get extent(){return this._get("extent")}set extent(e){this._set("extent",e)}get heightModelInfo(){return this.getDefaultHeightModelInfo()}glyphMosaic(){return this._glyphMosaic}get highlights(){return this._get("highlights")??W()}set highlights(e){this._set("highlights",a(e,this._get("highlights"),r.ofType(B)))}get defaultHighlight(){return this.highlights.find(({name:e})=>e===$)}get interacting(){return this.navigating}get navigating(){return!1}get preconditionsReady(){if(this.destroying||this.destroyed)return!1;const{map:e,spatialReference:t}=this;return!(this.fatalError||!this._isValid||this._readyCycleForced||!e||h(e)&&!e.loaded||0===this.width||0===this.height||!t||!this._validateSpatialReference(t)||!this._lockedSpatialReference&&!this.defaultsFromMap?.ready||!this.typeSpecificPreconditionsReady)}get resolution(){return 0}set map(e){e!==this._get("map")&&(e?.destroyed&&(d.getLogger(this).warn("#map","The provided map is already destroyed",{map:e}),e=null),h(e)&&e.load().catch(()=>{}),this.constructed&&!this.destroyed&&(this.forceReadyCycle(),this._lockedSpatialReference=null),this._set("map",e))}get canZoomIn(){return!!this.ready}get canZoomOut(){return!!this.ready}get readyState(){if(this.destroyed)return this._get("readyState");if(!this.map)return"missing-map";if("container"in this&&!this.container)return"missing-container";if(this.fatalError)return"rendering-error";if((this.defaultsFromMap?.ready??!1)&&!this.spatialReference){const e=!("loaded"in this.map)||this.map.loaded,t=this.map.ground.loaded,r=this.map.basemap?.loaded??!0;return e&&r&&t&&!this.map?.allLayers.length?"empty-map":(this._readyStateWaitingTask||(this._readyStateWaitingTask=i(e=>c(has("view-readyState-waiting-delay"),null,e)),this.addHandles(this._readyStateWaitingTask),this.addHandles(this._readyStateWaitingTask,"ready-state-task")),this._readyStateWaitingTask?.finished?"map-content-error":"loading")}return this._readyStateWaitingTask=u(this._readyStateWaitingTask),this.removeHandles("ready-state-task"),this.ready?"ready":"loading"}get spatialReference(){const{_userSpatialReference:e}=this;if(e&&null!==e.vcsWkid)return e;const t=e||this._lockedSpatialReference||this.getDefaultSpatialReference()||null,i=this.defaultsFromMap?.combinedHorizontalAndVerticalSpatialReference;return i?.equals(t)?i:t}set spatialReference(e){const t=!L(e,this._get("spatialReference"));this._set("_userSpatialReference",e),t&&(this._set("spatialReference",e),this._spatialReferenceChanged(this.spatialReference))}_spatialReferenceChanged(e){}get stationary(){return!this.animation&&!this.navigating&&!this.resizing}get timeExtent(){return this._userTimeExtent??this._lockedTimeExtent??this.getDefaultTimeExtent()??null}set timeExtent(e){this._userTimeExtent=e}get timeZone(){return this._userTimeZone??this._lockedTimeZone??this.getDefaultTimeZone()??F}set timeZone(e){this._userTimeZone=e,k(e)||d.getLogger(this).warn("#timeZone",`the parsed value '${e}' may not be a valid IANA time zone`)}get tools(){return this.toolViewManager?.tools}get initialExtent(){return this.defaultsFromMap?.extent}get cursor(){return this.toolViewManager?.cursor??this._highPriorityCursorHandles.at(-1)?.cursor??this._lowPriorityCursorHandles.at(-1)?.cursor??"default"}acquireCursor(e,t="low"){const i="high"===t?this._highPriorityCursorHandles:this._lowPriorityCursorHandles,r={cursor:e},s=p(()=>i.remove(r));return i.add(r),this.addHandles(s),s}get size(){return[this.width,this.height]}get effectiveTheme(){return this.theme??new q}registerComponent(e){this.registeredComponents.add(e)}unregisterComponent(e){this.registeredComponents.delete(e)}whenLayerView(e){return this.layerViewManager?.whenLayerView(e)??Promise.reject()}getAttributionItems(){return this.allLayerViews.items.flatMap(e=>e.attributionItems)}getDefaultSpatialReference(){return this.defaultsFromMap?.spatialReference}getDefaultHeightModelInfo(){return(this.map&&"heightModelInfo"in this.map?this.map.heightModelInfo:void 0)??this.defaultsFromMap?.heightModelInfo??null}getDefaultTimeZone(){return null}getDefaultTimeExtent(){return null}getSurface(){return null}importLayerView(e){throw new o("view:importLayerView-missing","importLayerView() not implemented")}hasLayerViewModule(e){return!1}async validate(){const e=X(this.type);if(e)throw this._displayWebGLError(),d.getLogger(this).warn("#validate()",e.message),e;const t=await Q();if(t)throw d.getLogger(this).warn("#validate()",t.message),t}async loadAsyncDependencies(){}invalidate(){this._isValid=!1}getSpatialReferenceSupport(){return{constraints:null}}_validateSpatialReference(e){return null!=this.getSpatialReferenceSupport(e)}when(e,t){return this.isResolved()&&!this.ready&&d.getLogger(this).warn("#when()","Calling view.when() while the view is no longer ready but was already resolved once will resolve immediately. Use reactiveUtils.whenOnce(() => view.ready).then(...) instead."),super.when(e,t)}forceReadyCycle(){this.ready&&(_(()=>this.destroyed||!1===this.preconditionsReady,()=>this._readyCycleForced=!1,{once:!0}),this._readyCycleForced=!0)}on(e,t){return super.on(e,t)}addAndActivateTool(e){this.toolViewManager.tools.add(e),this.activeTool=e}tryFatalErrorRecovery(){this.fatalError=null}static{this.views=new r}_displayWebGLError(){const e=document.createElement("div");e.setAttribute("style","display: flex; flex-direction: column; gap: 8px; padding: 20px; height: 100%; justify-content: center; color: black; background: white; font-family: sans-serif;");const t=document.createElement("div");t.innerHTML="Unable to display map. WebGL2 support is required.",t.setAttribute("style","font-size: 24px; font-weight: bold;");const i=document.createElement("div");i.innerHTML="Ensure that your browser and hardware meet the minimum requirements.",i.setAttribute("style","font-size: 18px;");const r=document.createElement("a");r.innerHTML="https://esriurl.com/webgl-faq",r.target="_blank",r.setAttribute("style","font-size: 18px;"),r.href="https://esriurl.com/webgl-faq",e.appendChild(t),e.appendChild(i),e.appendChild(r);const s=this.getSurface();s&&s.appendChild(e)}};e([V()],ee.prototype,"_userSpatialReference",void 0),e([V()],ee.prototype,"activeTool",null),e([V({readOnly:!0})],ee.prototype,"allLayerViews",void 0),e([V({readOnly:!0})],ee.prototype,"layerviewCollections",null),e([V(R(x,"analyses"))],ee.prototype,"analyses",null),e([V()],ee.prototype,"animation",null),e([V()],ee.prototype,"animationsEnabled",void 0),e([V({readOnly:!0})],ee.prototype,"attributionItems",null),e([V()],ee.prototype,"attributionVisible",void 0),e([V()],ee.prototype,"basemapView",void 0),e([V()],ee.prototype,"center",null),e([V()],ee.prototype,"defaultsFromMapSettings",null),e([V()],ee.prototype,"defaultsFromMap",null),e([V()],ee.prototype,"dependencies",void 0),e([V()],ee.prototype,"displayFilterEnabled",void 0),e([V({type:T})],ee.prototype,"extent",null),e([V()],ee.prototype,"fatalError",void 0),e([V(R(C,"graphics"))],ee.prototype,"graphics",void 0),e([V({readOnly:!0,type:j})],ee.prototype,"heightModelInfo",null),e([V({type:r.ofType(B)})],ee.prototype,"highlights",null),e([V({readOnly:!0})],ee.prototype,"interacting",null),e([V({constructOnly:!0})],ee.prototype,"layerViewFilter",void 0),e([V({readOnly:!0})],ee.prototype,"navigating",null),e([V({readOnly:!0})],ee.prototype,"preconditionsReady",null),e([V({readOnly:!0})],ee.prototype,"typeSpecificPreconditionsReady",void 0),e([V({type:r,readOnly:!0})],ee.prototype,"layerViews",void 0),e([V()],ee.prototype,"resolution",null),e([V({type:I})],ee.prototype,"magnifier",void 0),e([V({value:null,type:t})],ee.prototype,"map",null),e([V()],ee.prototype,"padding",void 0),e([V({readOnly:!0})],ee.prototype,"ready",void 0),e([V({readOnly:!0})],ee.prototype,"canZoomIn",null),e([V({readOnly:!0})],ee.prototype,"canZoomOut",null),e([V()],ee.prototype,"_readyStateWaitingTask",void 0),e([V({readOnly:!0})],ee.prototype,"readyState",null),e([V({type:E})],ee.prototype,"spatialReference",null),e([V()],ee.prototype,"stationary",null),e([V({type:O})],ee.prototype,"timeExtent",null),e([V({type:String,nonNullable:!0})],ee.prototype,"timeZone",null),e([V()],ee.prototype,"tools",null),e([V()],ee.prototype,"toolViewManager",void 0),e([V({readOnly:!0})],ee.prototype,"type",void 0),e([V({type:Number})],ee.prototype,"scale",void 0),e([V({readOnly:!0})],ee.prototype,"updating",void 0),e([V({readOnly:!0})],ee.prototype,"initialExtentRequired",void 0),e([V({readOnly:!0})],ee.prototype,"initialExtent",null),e([V()],ee.prototype,"cursor",null),e([V({readOnly:!0})],ee.prototype,"input",void 0),e([V({type:z,nonNullable:!0})],ee.prototype,"navigation",void 0),e([V()],ee.prototype,"layerViewManager",void 0),e([V()],ee.prototype,"analysisViewManager",void 0),e([V()],ee.prototype,"selectionManager",void 0),e([V()],ee.prototype,"width",void 0),e([V()],ee.prototype,"height",void 0),e([V({readOnly:!0})],ee.prototype,"resizing",void 0),e([V({value:null,readOnly:!0})],ee.prototype,"size",null),e([V({readOnly:!0})],ee.prototype,"suspended",void 0),e([V({readOnly:!0})],ee.prototype,"viewEvents",void 0),e([V()],ee.prototype,"_isValid",void 0),e([V()],ee.prototype,"_readyCycleForced",void 0),e([V()],ee.prototype,"_lockedSpatialReference",void 0),e([V()],ee.prototype,"_userTimeZone",void 0),e([V()],ee.prototype,"_lockedTimeZone",void 0),e([V()],ee.prototype,"_userTimeExtent",void 0),e([V()],ee.prototype,"_lockedTimeExtent",void 0),e([V({type:q})],ee.prototype,"theme",void 0),e([V({readOnly:!0,type:q})],ee.prototype,"effectiveTheme",null),e([V({readOnly:!0})],ee.prototype,"registeredComponents",void 0),ee=Y=e([b("esri.views.View")],ee);const te=globalThis.$arcgis;function ie(e){return e.layerViews}te&&!te.views&&Object.defineProperty(te,"views",{configurable:!1,enumerable:!0,writable:!1,value:ee.views});export{ee as default};
2
+ import{__decorate as e}from"tslib";import t from"../Map.js";import{createTask as i}from"../core/asyncUtils.js";import r from"../core/Collection.js";import a from"../core/CollectionFlattener.js";import{referenceSetter as s}from"../core/collectionUtils.js";import o from"../core/Error.js";import{EventedMixin as n}from"../core/Evented.js";import l from"../core/Handles.js";import{makeHandle as p}from"../core/handleUtils.js";import has from"../core/has.js";import{isLoadable as h}from"../core/Loadable.js";import d from"../core/Logger.js";import{destroyMaybe as y,abortMaybe as u}from"../core/maybe.js";import{EsriPromise as m}from"../core/Promise.js";import{after as c}from"../core/promiseUtils.js";import g from"../core/ReactiveSet.js";import{watch as f,sync as w,whenOnce as v,when as _,syncAndInitial as M}from"../core/reactiveUtils.js";import{property as V,subclass as b}from"../core/accessorSupport/decorators.js";import{owningCollectionProperty as R}from"../core/support/OwningCollection.js";import{UpdatingHandles as S}from"../core/support/UpdatingHandles.js";import T from"../geometry/Extent.js";import j from"../geometry/HeightModelInfo.js";import E from"../geometry/SpatialReference.js";import{equals as L}from"../geometry/support/spatialReferenceUtils.js";import{AnalysesCollection as x}from"../support/AnalysesCollection.js";import{GraphicsCollection as C}from"../support/GraphicsCollection.js";import{system as F}from"../time/constants.js";import O from"../time/TimeExtent.js";import{isTimeZoneValid as k}from"../time/timeZoneUtils.js";import H from"./BasemapView.js";import I from"./Magnifier.js";import Z from"./SelectionManager.js";import q from"./Theme.js";import{ToolViewManager as W}from"./ToolViewManager.js";import{GlyphMosaic as A}from"./2d/engine/webgl/GlyphMosaic.js";import{makeDefaultHighlightOptions as P}from"./3d/support/DefaultHighlights.js";import D from"./input/Input.js";import{ViewEvents as U}from"./input/ViewEvents.js";import z from"./navigation/Navigation.js";import{deduplicateAttributionItems as G}from"./support/attributionUtils.js";import{DefaultsFromMap as N}from"./support/DefaultsFromMap.js";import{defaultHighlightName as $}from"./support/HighlightDefaults.js";import B from"./support/HighlightOptions.js";import J from"./support/LayerViewManager.js";import K from"./support/RequiredFieldsOptions.js";import{checkWebAssemblyRequirements as Q}from"./support/WebAssemblyRequirements.js";import{checkWebGLRequirements as X}from"./support/WebGLRequirements.js";var Y;let ee=class extends(n(m)){static{Y=this}constructor(e){super(e),this._userSpatialReference=null,this.handles=new l,this.updatingHandles=new S,this.allLayerViews=new a({getCollections:()=>this.layerviewCollections,getChildrenFunction:ie}),this.animationsEnabled=!0,this.attributionVisible=!0,this.basemapView=null,this.dependencies={popup:void 0},this.displayFilterEnabled=!0,this.fatalError=null,this.graphics=new C,this.typeSpecificPreconditionsReady=!0,this.layerViews=new r,this.magnifier=new I,this.padding={left:0,top:0,right:0,bottom:0},this.ready=!1,this._readyStateWaitingTask=null,this.type=null,this.scale=null,this.updating=!1,this.initialExtentRequired=!0,this._lowPriorityCursorHandles=new r,this._highPriorityCursorHandles=new r,this.input=new D,this.navigation=new z,this.layerViewManager=null,this.analysisViewManager=null,this.isHeightModelInfoRequired=!1,this.width=null,this.height=null,this.resizing=!1,this.suspended=!1,this.viewEvents=new U(this),this.requiredFieldsOptions=new K,this._isValid=!1,this._readyCycleForced=!1,this._lockedSpatialReference=null,this._userTimeZone=null,this._lockedTimeZone=null,this._userTimeExtent=null,this._lockedTimeExtent=null,this._glyphMosaic=null,this.theme=null,this.registeredComponents=new g,this.handles.add(f(()=>this.preconditionsReady,e=>{const t=this.ready;if(e?(this._lockedSpatialReference=this.spatialReference,this._lockedTimeZone=this.timeZone,this._lockedTimeExtent=this.timeExtent,Y.views.add(this)):(this._lockedSpatialReference=null,Y.views.remove(this)),this.notifyChange("spatialReference"),!e&&t)this.toolViewManager?.detach(),this.analysisViewManager?.detach(),this.layerViewManager?.clear(),this._glyphMosaic?.dispose(),this._teardown();else if(e&&!t){try{this._startup()}catch(i){return void queueMicrotask(()=>{this.fatalError=new o("view:startup-error","View._startup failed",i)})}this._glyphMosaic=new A(1024,1024,!0),this.analysisViewManager?.attach(),this.toolViewManager.attach()}},w)),this.analyses=new x}initialize(){this.addResolvingPromise(Promise.all([this.loadAsyncDependencies(),this.validate()]).then(()=>(this._isValid=!0,v(()=>this.ready)))),this.basemapView=new H({view:this}),this.layerViewManager=new J({view:this,layerViewFilter:e=>this.layerViewFilter?.(e)??!0,layerViewImporter:{importLayerView:e=>this.importLayerView(e),hasLayerViewModule:e=>this.hasLayerViewModule(e)},layerviewMapping:this._layerToLayerviewMapping}),this.toolViewManager=new W({view:this}),this.selectionManager=new Z({view:this}),this.addHandles([_(()=>"map-content-error"===this.readyState&&!this.spatialReference,()=>{d.getLogger(this).warn("#spatialReference","no spatial reference could be derived from the currently added map layers")}),f(()=>this.initialExtentRequired,e=>this.defaultsFromMap.required={...this.defaultsFromMap.required,extent:e},M),f(()=>this.ready,e=>{this.defaultsFromMap&&(this.defaultsFromMap.viewReady=e)},w),f(()=>this.defaultsFromMapInputSpatialReference(),e=>{this.defaultsFromMap&&(this.defaultsFromMap.inputSpatialReference=e)},M)])}get _layerToLayerviewMapping(){return Y._layerToLayerview}static{this._layerToLayerview=[["view.map.basemap.baseLayers","view.basemapView.baseLayerViews"],["view.map.basemap.groundLayers","view.basemapView.groundLayerViews"],["view.map.basemap.referenceLayers","view.basemapView.referenceLayerViews"],["view.map.layers","view.layerViews"]]}destroy(){this.destroyed||(Y.views.remove(this),this.viewEvents.destroy(),this.allLayerViews.destroy(),this.navigation&&(this.navigation.destroy(),this._set("navigation",null)),this.graphics=y(this.graphics),this.analyses=y(this.analyses),this.defaultsFromMap.destroy(),this._set("defaultsFromMap",null),this.analysisViewManager=y(this.analysisViewManager),this.toolViewManager=y(this.toolViewManager),this.layerViewManager=y(this.layerViewManager),this.selectionManager=y(this.selectionManager),this.basemapView=y(this.basemapView),this.layerViews.destroyAll(),this.invalidate(),this.handles.destroy(),this.map=y(this.map),this.updatingHandles.destroy())}_startup(){this._set("ready",!0)}_teardown(){this._set("ready",!1)}whenReady(){return Promise.resolve(this)}toMap(){return d.getLogger(this).error("#toMap()","Not implemented on this instance of View"),null}get activeTool(){return this.toolViewManager?.activeTool}set activeTool(e){this.toolViewManager&&(this.toolViewManager.activeTool=e)}get layerviewCollections(){return[this.basemapView?.baseLayerViews,this.basemapView?.groundLayerViews,this.layerViews,this.basemapView?.referenceLayerViews]}get analyses(){return this._get("analyses")}set analyses(e){this._set("analyses",e)}get animation(){return this._get("animation")}set animation(e){this._set("animation",e)}get attributionItems(){return this.suspended?[]:G(this._get("attributionItems"),this.getAttributionItems())}get center(){return null}get defaultsFromMapSettings(){return{}}get defaultsFromMap(){return new N({required:{tileInfo:!1,heightModelInfo:!1,extent:!1},map:()=>this.map,getSpatialReferenceSupport:(e,t)=>this.getSpatialReferenceSupport(e,t),...this.defaultsFromMapSettings})}get extent(){return this._get("extent")}set extent(e){this._set("extent",e)}get heightModelInfo(){return this.getDefaultHeightModelInfo()}glyphMosaic(){return this._glyphMosaic}get highlights(){return this._get("highlights")??P()}set highlights(e){this._set("highlights",s(e,this._get("highlights"),r.ofType(B)))}get defaultHighlight(){return this.highlights.find(({name:e})=>e===$)}get interacting(){return this.navigating}get navigating(){return!1}get preconditionsReady(){if(this.destroying||this.destroyed)return!1;const{map:e,spatialReference:t}=this;return!(this.fatalError||!this._isValid||this._readyCycleForced||!e||h(e)&&!e.loaded||0===this.width||0===this.height||!t||!this._validateSpatialReference(t)||!this._lockedSpatialReference&&!this.defaultsFromMap?.ready||!this.typeSpecificPreconditionsReady)}get resolution(){return 0}set map(e){e!==this._get("map")&&(e?.destroyed&&(d.getLogger(this).warn("#map","The provided map is already destroyed",{map:e}),e=null),h(e)&&e.load().catch(()=>{}),this.constructed&&!this.destroyed&&(this.forceReadyCycle(),this._lockedSpatialReference=null),this._set("map",e))}get canZoomIn(){return!!this.ready}get canZoomOut(){return!!this.ready}get readyState(){if(this.destroyed)return this._get("readyState");if(!this.map)return"missing-map";if("container"in this&&!this.container)return"missing-container";if(this.fatalError)return"rendering-error";if((this.defaultsFromMap?.ready??!1)&&!this.spatialReference){const e=!("loaded"in this.map)||this.map.loaded,t=this.map.ground.loaded,r=this.map.basemap?.loaded??!0;return e&&r&&t&&!this.map?.allLayers.length?"empty-map":(this._readyStateWaitingTask||(this._readyStateWaitingTask=i(e=>c(has("view-readyState-waiting-delay"),null,e)),this.addHandles(this._readyStateWaitingTask),this.addHandles(this._readyStateWaitingTask,"ready-state-task")),this._readyStateWaitingTask?.finished?"map-content-error":"loading")}return this._readyStateWaitingTask=u(this._readyStateWaitingTask),this.removeHandles("ready-state-task"),this.ready?"ready":"loading"}get spatialReference(){const{_userSpatialReference:e}=this;if(e&&null!==e.vcsWkid)return e;const t=e??this._lockedSpatialReference??this.getWebDocumentSpatialReference()??this.defaultsFromMap?.spatialReference??null,i=this.defaultsFromMap?.combinedHorizontalAndVerticalSpatialReference;return i?.equals(t)?i:t}set spatialReference(e){const t=!L(e,this._get("spatialReference"));this._set("_userSpatialReference",e),t&&(this._set("spatialReference",e),this._spatialReferenceChanged(this.spatialReference))}_spatialReferenceChanged(e){}getWebDocumentSpatialReference(){return null}defaultsFromMapInputSpatialReference(){return this._userSpatialReference??(this.ready?this._lockedSpatialReference:null)}get stationary(){return!this.animation&&!this.navigating&&!this.resizing}get timeExtent(){return this._userTimeExtent??this._lockedTimeExtent??this.getDefaultTimeExtent()??null}set timeExtent(e){this._userTimeExtent=e}get timeZone(){return this._userTimeZone??this._lockedTimeZone??this.getDefaultTimeZone()??F}set timeZone(e){this._userTimeZone=e,k(e)||d.getLogger(this).warn("#timeZone",`the parsed value '${e}' may not be a valid IANA time zone`)}get tools(){return this.toolViewManager?.tools}get initialExtent(){return this.defaultsFromMap?.extent}get cursor(){return this.toolViewManager?.cursor??this._highPriorityCursorHandles.at(-1)?.cursor??this._lowPriorityCursorHandles.at(-1)?.cursor??"default"}acquireCursor(e,t="low"){const i="high"===t?this._highPriorityCursorHandles:this._lowPriorityCursorHandles,r={cursor:e},a=p(()=>i.remove(r));return i.add(r),this.addHandles(a),a}get size(){return[this.width,this.height]}get effectiveTheme(){return this.theme??new q}registerComponent(e){this.registeredComponents.add(e)}unregisterComponent(e){this.registeredComponents.delete(e)}whenLayerView(e){return this.layerViewManager?.whenLayerView(e)??Promise.reject()}getAttributionItems(){return this.allLayerViews.items.flatMap(e=>e.attributionItems)}getDefaultHeightModelInfo(){return(this.map&&"heightModelInfo"in this.map?this.map.heightModelInfo:void 0)??this.defaultsFromMap?.heightModelInfo??null}getDefaultTimeZone(){return null}getDefaultTimeExtent(){return null}getSurface(){return null}importLayerView(e){throw new o("view:importLayerView-missing","importLayerView() not implemented")}hasLayerViewModule(e){return!1}async validate(){const e=X(this.type);if(e)throw this._displayWebGLError(),d.getLogger(this).warn("#validate()",e.message),e;const t=await Q();if(t)throw d.getLogger(this).warn("#validate()",t.message),t}async loadAsyncDependencies(){}invalidate(){this._isValid=!1}getSpatialReferenceSupport(){return{constraints:null}}_validateSpatialReference(e){return null!=this.getSpatialReferenceSupport(e)}when(e,t){return this.isResolved()&&!this.ready&&d.getLogger(this).warn("#when()","Calling view.when() while the view is no longer ready but was already resolved once will resolve immediately. Use reactiveUtils.whenOnce(() => view.ready).then(...) instead."),super.when(e,t)}forceReadyCycle(){this.ready&&(_(()=>this.destroyed||!1===this.preconditionsReady,()=>this._readyCycleForced=!1,{once:!0}),this._readyCycleForced=!0)}on(e,t){return super.on(e,t)}addAndActivateTool(e){this.toolViewManager.tools.add(e),this.activeTool=e}tryFatalErrorRecovery(){this.fatalError=null}static{this.views=new r}_displayWebGLError(){const e=document.createElement("div");e.setAttribute("style","display: flex; flex-direction: column; gap: 8px; padding: 20px; height: 100%; justify-content: center; color: black; background: white; font-family: sans-serif;");const t=document.createElement("div");t.innerHTML="Unable to display map. WebGL2 support is required.",t.setAttribute("style","font-size: 24px; font-weight: bold;");const i=document.createElement("div");i.innerHTML="Ensure that your browser and hardware meet the minimum requirements.",i.setAttribute("style","font-size: 18px;");const r=document.createElement("a");r.innerHTML="https://esriurl.com/webgl-faq",r.target="_blank",r.setAttribute("style","font-size: 18px;"),r.href="https://esriurl.com/webgl-faq",e.appendChild(t),e.appendChild(i),e.appendChild(r);const a=this.getSurface();a&&a.appendChild(e)}};e([V()],ee.prototype,"_userSpatialReference",void 0),e([V()],ee.prototype,"activeTool",null),e([V({readOnly:!0})],ee.prototype,"allLayerViews",void 0),e([V({readOnly:!0})],ee.prototype,"layerviewCollections",null),e([V(R(x,"analyses"))],ee.prototype,"analyses",null),e([V()],ee.prototype,"animation",null),e([V()],ee.prototype,"animationsEnabled",void 0),e([V({readOnly:!0})],ee.prototype,"attributionItems",null),e([V()],ee.prototype,"attributionVisible",void 0),e([V()],ee.prototype,"basemapView",void 0),e([V()],ee.prototype,"center",null),e([V()],ee.prototype,"defaultsFromMapSettings",null),e([V()],ee.prototype,"defaultsFromMap",null),e([V()],ee.prototype,"dependencies",void 0),e([V()],ee.prototype,"displayFilterEnabled",void 0),e([V({type:T})],ee.prototype,"extent",null),e([V()],ee.prototype,"fatalError",void 0),e([V(R(C,"graphics"))],ee.prototype,"graphics",void 0),e([V({readOnly:!0,type:j})],ee.prototype,"heightModelInfo",null),e([V({type:r.ofType(B)})],ee.prototype,"highlights",null),e([V({readOnly:!0})],ee.prototype,"interacting",null),e([V({constructOnly:!0})],ee.prototype,"layerViewFilter",void 0),e([V({readOnly:!0})],ee.prototype,"navigating",null),e([V({readOnly:!0})],ee.prototype,"preconditionsReady",null),e([V({readOnly:!0})],ee.prototype,"typeSpecificPreconditionsReady",void 0),e([V({type:r,readOnly:!0})],ee.prototype,"layerViews",void 0),e([V()],ee.prototype,"resolution",null),e([V({type:I})],ee.prototype,"magnifier",void 0),e([V({value:null,type:t})],ee.prototype,"map",null),e([V()],ee.prototype,"padding",void 0),e([V({readOnly:!0})],ee.prototype,"ready",void 0),e([V({readOnly:!0})],ee.prototype,"canZoomIn",null),e([V({readOnly:!0})],ee.prototype,"canZoomOut",null),e([V()],ee.prototype,"_readyStateWaitingTask",void 0),e([V({readOnly:!0})],ee.prototype,"readyState",null),e([V({type:E})],ee.prototype,"spatialReference",null),e([V()],ee.prototype,"stationary",null),e([V({type:O})],ee.prototype,"timeExtent",null),e([V({type:String,nonNullable:!0})],ee.prototype,"timeZone",null),e([V()],ee.prototype,"tools",null),e([V()],ee.prototype,"toolViewManager",void 0),e([V({readOnly:!0})],ee.prototype,"type",void 0),e([V({type:Number})],ee.prototype,"scale",void 0),e([V({readOnly:!0})],ee.prototype,"updating",void 0),e([V({readOnly:!0})],ee.prototype,"initialExtentRequired",void 0),e([V({readOnly:!0})],ee.prototype,"initialExtent",null),e([V()],ee.prototype,"cursor",null),e([V({readOnly:!0})],ee.prototype,"input",void 0),e([V({type:z,nonNullable:!0})],ee.prototype,"navigation",void 0),e([V()],ee.prototype,"layerViewManager",void 0),e([V()],ee.prototype,"analysisViewManager",void 0),e([V()],ee.prototype,"selectionManager",void 0),e([V()],ee.prototype,"width",void 0),e([V()],ee.prototype,"height",void 0),e([V({readOnly:!0})],ee.prototype,"resizing",void 0),e([V({value:null,readOnly:!0})],ee.prototype,"size",null),e([V({readOnly:!0})],ee.prototype,"suspended",void 0),e([V({readOnly:!0})],ee.prototype,"viewEvents",void 0),e([V()],ee.prototype,"_isValid",void 0),e([V()],ee.prototype,"_readyCycleForced",void 0),e([V()],ee.prototype,"_lockedSpatialReference",void 0),e([V()],ee.prototype,"_userTimeZone",void 0),e([V()],ee.prototype,"_lockedTimeZone",void 0),e([V()],ee.prototype,"_userTimeExtent",void 0),e([V()],ee.prototype,"_lockedTimeExtent",void 0),e([V({type:q})],ee.prototype,"theme",void 0),e([V({readOnly:!0,type:q})],ee.prototype,"effectiveTheme",null),e([V({readOnly:!0})],ee.prototype,"registeredComponents",void 0),ee=Y=e([b("esri.views.View")],ee);const te=globalThis.$arcgis;function ie(e){return e.layerViews}te&&!te.views&&Object.defineProperty(te,"views",{configurable:!1,enumerable:!0,writable:!1,value:ee.views});export{ee as default};
package/views/View2D.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../Viewpoint.js";import i from"../core/Collection.js";import r from"../core/CollectionFlattener.js";import s from"../core/Error.js";import"../core/has.js";import a from"../core/Logger.js";import{destroyMaybe as n}from"../core/maybe.js";import{watch as o,syncAndInitial as l}from"../core/reactiveUtils.js";import{isScreenPoint as p,screenRectToPolygon as h,createScreenPoint as g}from"../core/screenUtils.js";import{property as d,cast as u,subclass as c}from"../core/accessorSupport/decorators.js";import{ensureClass as m}from"../core/accessorSupport/ensureType.js";import{initialize as y}from"../core/workers/workers.js";import f from"../geometry/Point.js";import w from"../geometry/Polygon.js";import{isLoadedOrLoadFor as V}from"../geometry/projectionUtils.js";import v from"../layers/support/TileInfo.js";import{BreakpointsOwner as M}from"./BreakpointsOwner.js";import{DOMContainer as _}from"./DOMContainer.js";import{PopupView as b}from"./PopupView.js";import S from"./View.js";import{Viewport2DBaseMixin as R}from"./Viewport2DBaseMixin.js";import{Viewport2DMixin as j}from"./Viewport2DMixin.js";import T from"./2d/AnimationManager.js";import{layerView2DImporter as O}from"./2d/layerViewModuleImportUtils.js";import k from"./2d/tiling/TileInfoView.js";import"./2d/tiling/TileKey.js";import"./2d/tiling/TileQueue.js";import"./2d/tiling/TileStrategy.js";import{extentToScale as L}from"./2d/viewpointUtils.js";import{importAnalysisViewModule as C}from"./2d/analysis/analysisViewModuleImportUtils.js";import x from"./2d/layers/features/support/TileStore.js";import{createOrReuseHighlightGradient as D}from"./2d/layers/support/util.js";import{hitTest as P,getHitTestLayerViews as z}from"./2d/support/hitTestUtils.js";import{takeRawScreenshot as A,takeScreenshot as E}from"./2d/support/screenshotUtils.js";import{Timeline as I}from"./2d/support/Timeline.js";import U from"./navigation/Navigation.js";import G from"./navigation/NavigationActionMap.js";import F from"./support/AnalysisViewManager.js";import q from"./ui/DefaultUI.js";import W from"./ui/2d/DefaultUI2D.js";import{RenderingContextOptions as N}from"./webgl/RenderingContextOptions.js";import{isWebMap as B}from"../webmap/utils.js";import H from"../webmap/background/ColorBackground.js";let Z,K,Q,J,X,Y;async function $(){const[,{GraphicsView2D:e,GraphicContainer:t,MapViewNavigation:i,MagnifierView2D:r,GridView2D:s,Stage:a}]=await Promise.all([import("./2d/webglDeps.js"),import("./2d/mapViewDeps.js")]);K=e,Q=t,J=i,X=r,Y=s,Z=a}let ee=class extends(j(R(M(b(_(S)))))){get timeZone(){return super.timeZone}set timeZone(e){super.timeZone=e}constructor(e){super(e),this._magnifierView=null,this._gridView=null,this.stage=null,this._resolveWhenReady=[],this.rootLayerViews=new r({getCollections:()=>[this.basemapView?.baseLayerViews,this.layerViews,this.basemapView?.referenceLayerViews],getChildrenFunction:()=>null}),this.featuresTilingScheme=null,this.graphicsView=null,this.navigation=new U({actionMap:new G({dragTertiary:"none"})}),this.renderingOptions={samplingMode:"dynamic",edgeLabelsVisible:!0,labelsAnimationTime:125,labelCollisionsEnabled:!0},this.supersampleScreenshotsEnabled=!0,this.analysisViewManager=new F({importAnalysisViewModule:e=>C(e),view:this}),this.floors=new i,this.grid=null,this.map=null,this.timeline=new I,this.type="2d",this.view2dType=null,this.ui=new W,this.test={takeScreenshot:async e=>A(this._getScreenshotView(e),e)},this.padding={top:0,right:0,bottom:0,left:0},y()}destroy(){this.layerViewManager.clear(),this._set("preconditionsReady",!1),this.frameTask=n(this.frameTask),this.goToManager.destroy(),this.rootLayerViews.destroy(),this.inputManager.destroy(),this._set("inputManager",null)}get graphicsTileStore(){return new x(this.featuresTilingScheme)}get constraintsInfo(){const e=this.defaultsFromMap?.tileInfo,t=this.spatialReference;return{lods:e?.spatialReference?.equals(t)?e.lods:null,spatialReference:t}}get initialExtentRequired(){if(!this.stateManager)return!1;const{scale:e,constraints:t,center:i,viewpoint:r,extent:s}=this;let a=this.zoom;return!(this.map&&"initialViewProperties"in this.map&&this.map.initialViewProperties?.viewpoint)&&(!s&&(t?.effectiveLODs||(a=-1),(!i||0===e&&-1===a)&&(null==r?.targetGeometry||"extent"!==r.targetGeometry.type&&!r.scale)))}get defaultsFromMapSettings(){return{required:{extent:!1,heightModelInfo:!1,tileInfo:!0},requiresExtentInSpatialReference:this.spatialReferenceLocked}}get scheduler(){return this.frameTask.scheduler}get typeSpecificPreconditionsReady(){const e=this._getDefaultViewpoint();if(!e)return!1;const t=e.targetGeometry,i=this.spatialReference;return V(t.spatialReference,i)}get analyses(){return super.analyses}set analyses(e){super.analyses=e}get background(){return B(this.map)?this.map.initialViewProperties.background:null}set background(e){this._override("background",e)}get center(){return this.stateManager?.center??null}set center(e){this.stateManager.center=e}get constraints(){return super.constraints}set constraints(e){super.constraints=e}get extent(){return super.extent}set extent(e){super.extent=e}get padding(){return this.stateManager?.padding}set padding(e){this.stateManager&&(this.stateManager.padding=e)}get rendering(){return this.stage?.renderRequested??!1}get resizeAlign(){return super.resizeAlign}set resizeAlign(e){super.resizeAlign=e}get resolution(){return this.stateManager.resolution??0}get rotation(){return super.rotation}set rotation(e){super.rotation=e}get scale(){return this.stateManager?.scale??0}set scale(e){this.stateManager&&(this.stateManager.scale=e)}get spatialReference(){return super.spatialReference}set spatialReference(e){super.spatialReference=e}get spatialReferenceLocked(){return this._get("spatialReferenceLocked")}set spatialReferenceLocked(e){this.stage&&a.getLogger(this).warn("spatialReferenceLocked cannot be changed after the view has become ready"),this._set("spatialReferenceLocked",e)}get tileInfo(){return this.featuresTilingScheme?.tileInfo}get updating(){if(this.destroying||this.destroyed)return!1;const{analysisViewManager:e,allLayerViews:t,frameTask:i,graphicsView:r,inputManager:s,layerViewManager:a,magnifier:n,map:o,ready:l,rendering:p,selectionManager:h,stationary:g,toolViewManager:d,updatingHandles:u,stage:c}=this,m=o?.basemap,y=o?.ground,f="loading"===m?.loadStatus||"loading"===y?.loadStatus||!!o?.allLayers?.some(e=>e.parent!==y&&!e.isFulfilled()),w=!c||c.updating,V=!u||u.updating,v=!e||e.updating,M=!d||d.updating,_=!s||s.updating,b=!r||r.updating,S=!i||i.updating,R=!a||a.updating,j=!h||h.updating,T=!(!n.visible||null===n.position||!this._magnifierView?.updatingHandles.updating),O=t.some(e=>e.updating&&!e.destroyed);return!l||!g||p||f||O||T||V||v||S||M||_||R||b||j||w}get viewpoint(){return super.viewpoint}set viewpoint(e){super.viewpoint=e}get visibleArea(){const e=this.stateManager.visibleArea;return e?new w({rings:[e.map(e=>[e[0],e[1]])],spatialReference:this.spatialReference}):e}get zoom(){return this.stateManager.zoom??-1}set zoom(e){this.stateManager.zoom=e}get navigating(){return this.mapViewNavigation?.interacting??!1}async hitTest(e,t){return P(this,e,t)}async takeScreenshot(e){return E(this._getScreenshotView(e),e)}addUpdatingPromise(e){return this.updatingHandles.addPromise(e)}toScreen(e,t){return this.stateManager.toScreen(e,t)}async whenAnalysisView(e){if(null==e.parent)throw new s("view:no-analysisview-for-analysis","The analysis does not exist in view.analyses",{analysis:e});return this.analysisViewManager.whenAnalysisView(e)}whenLayerView(e){return super.whenLayerView(e)}graphicChanged(e){if(this.graphicsView){this.graphicsView.graphicUpdateHandler(e)}}whenReady(){return new Promise(e=>{this.ready?e(this):this._resolveWhenReady.push(e)})}zoomIn(){return super.zoomIn()}zoomOut(){return super.zoomOut()}forceDOMReadyCycle(){this.forceReadyCycle()}getDefaultSpatialReference(){return this.map&&"initialViewProperties"in this.map&&this.map.initialViewProperties.spatialReference||this.defaultsFromMap?.spatialReference||null}getDefaultTimeZone(){return B(this.map)?this.map.initialViewProperties.timeZone:null}getDefaultTimeExtent(){return B(this.map)?this.map.initialViewProperties.timeExtent:null}getSurface(){return this.surface}hasLayerViewModule(e){return O.hasLayerViewModule(e)}importLayerView(e){return O.importLayerView(e)}pixelSizeAt(){return this.ready?this.resolution:(a.getLogger(this).error("#pixelSizeAt()","Map view cannot be used before it is ready"),null)}async popupHitTest(e){const t=p(e)?this.toMap(e):h(this,e),i=p(e)?e:g(e.x+e.width/2,e.y+e.height/2),r=this.toMap(i),s=await this.hitTest(e),a=z(this,e),n=new globalThis.Map(a.map(e=>[e.layer.uid,e])),o=[];let l=0,d=0;for(;l<s.results.length||d<a.length;){const e=s.results.at(l);if(e&&"graphic"!==e.type){++l;continue}const i=n.get((e?.layer??e?.graphic.layer)?.uid);if((!e||i)&&d<a.length&&a.at(d)!==i){const e=a.at(d);"fetchPopupFeaturesAtTarget"in e&&o.push({geometry:t,layerView:e}),++d}else e&&(o.push({graphic:e.graphic,layerView:i}),++l)}return{hits:o,location:r}}requestUpdate(){this.ready&&this.frameTask.requestUpdate()}loadAsyncDependencies(){return $()}_getDefaultViewpoint(){const{constraints:e,initialExtent:i,map:r,padding:s,size:a}=this;if(!e)return null;const n=r&&"initialViewProperties"in r?r.initialViewProperties:void 0,o=this.stateManager.getUserStartupOptions(this.size),l=n?.viewpoint,p=l?.targetGeometry?.extent??i,h=p?.center,g=l?.rotation??0,d=l?.scale||p&&L(p,[a[0]-s.left-s.right,a[1]-s.top-s.bottom]),u=o.center??h,c=o.rotation??g,m=o.scale??d;return u&&m?new t({targetGeometry:u,scale:m,rotation:c}):null}_startup(){this.timeline.begin("MapView Startup");const e=this._getDefaultViewpoint();this.stateManager.startup(e,this.size,this.spatialReference,this.defaultsFromMap.extent?.center),this.graphics.owner=this;const t=this._createFeaturesTilingScheme(),i=new Z(this._getOrCreateRenderCanvas(),{contextOptions:new N(this.deactivatedWebGLExtensions,this.debugWebGLExtensions),featuresTilingScheme:t,renderingOptions:this.renderingOptions,timeline:this.timeline});this.stage=i,this._magnifierView=new X,this._magnifierView.magnifier=this.magnifier,this._gridView=new Y;const r=new T({view:this});this._set("animationManager",r);const s=new J({view:this,animationManager:r});this._set("mapViewNavigation",s),this._setupSpatialReferenceDependentProperties(t),this.addHandles([this.rootLayerViews.on("change",()=>this._updateStageChildren()),i.on("webgl-error",e=>this.fatalError=e.error),o(()=>this.stationary,e=>i.stationary=e,l),o(()=>this.background,e=>{i.backgroundColor=e?.color,this._magnifierView.backgroundColor=e?.color},l),o(()=>this.magnifier,e=>this._magnifierView.magnifier=e,l),o(()=>this.grid,e=>this._gridView.grid=e,l),o(()=>this.renderingOptions,e=>i.renderingOptions=e,l),o(()=>this.highlights.items.map(e=>({name:e.name,options:{fillColor:e.color,haloColor:e.haloColor,fillOpacity:e.fillOpacity,haloOpacity:e.haloOpacity,haloWidth:e.haloWidth,haloBlur:e.haloBlur}})),()=>{i.highlightGradient=D(i.highlightGradient,this.highlights.items)},l),o(()=>this.state.id,()=>i.state=this.state,l),o(()=>this.animationsEnabled,e=>this.stage.animationsEnabled=e,l)],"map-view"),this._updateStageChildren();const a=this._resolveWhenReady;this._resolveWhenReady=[],a.forEach(e=>e(this)),this.timeline.end("MapView Startup"),this.frameTask.start(),this._set("ready",!0)}_teardown(){this._destroySpatialReferenceDependentProperties(),this.removeHandles("map-view"),this.mapViewNavigation.destroy(),this._set("mapViewNavigation",null),this.animation=null,this.animationManager.destroy(),this._set("animationManager",null),this.layerViewManager.clear(),this._magnifierView.destroy(),this._gridView.destroy(),this.stage.destroy(),this.stage=null,this._set("graphicsView",null),this._magnifierView=null,this._gridView=null,this._set("mapViewNavigation",null),this.graphics.owner=null,this.frameTask.stop(),this.stationaryManager.clear(),this._set("ready",!1),this.stateManager.teardown()}_updateStageChildren(){this.stage.removeAllChildren(),this.rootLayerViews.forEach(e=>{this.stage.addChild(e.container)});const e=this.graphicsView;this.stage.addChild(e.container),this.stage.addChild(this._magnifierView),this.stage.addChild(this._gridView)}_setupSpatialReferenceDependentProperties(e=this._createFeaturesTilingScheme()){this._set("featuresTilingScheme",e),this.stage.labelManager.featuresTilingScheme=e;const t=new K({view:this,graphics:this.graphics,requestUpdateCallback:()=>this.requestUpdate(),container:new Q(e,!0)});this._set("graphicsView",t)}_createFeaturesTilingScheme(){return new k(v.create({spatialReference:this.spatialReference,size:512,numLODs:36}))}_destroySpatialReferenceDependentProperties(){const e=this.graphicsView;this._set("graphicsView",null),e.destroy(),this._set("featuresTilingScheme",null)}_getScreenshotView(e){const{allLayerViews:t,padding:i,size:r,stage:s}=this;return{allLayerViews:t,backgroundColor:e?.ignoreBackground?null:this.background?.color,padding:i,size:r,stage:s}}_spatialReferenceChanged(e){if(this.ready){this.frameTask.stop();for(const e of this.allLayerViews)e.processDetach();this._destroySpatialReferenceDependentProperties(),this.stateManager.changeSpatialReference(e),this.stage.state=this.state,this._setupSpatialReferenceDependentProperties();for(const e of this.allLayerViews)e.processAttach();this.frameTask.requestFrame(),this.frameTask.start(),this._updateStageChildren()}}static{this.type="2d"}};e([d()],ee.prototype,"_magnifierView",void 0),e([d()],ee.prototype,"_gridView",void 0),e([d({constructOnly:!0})],ee.prototype,"deactivatedWebGLExtensions",void 0),e([d({constructOnly:!0})],ee.prototype,"debugWebGLExtensions",void 0),e([d({readOnly:!0})],ee.prototype,"featuresTilingScheme",void 0),e([d({readOnly:!0})],ee.prototype,"graphicsTileStore",null),e([d()],ee.prototype,"graphicsView",void 0),e([d()],ee.prototype,"constraintsInfo",null),e([d()],ee.prototype,"initialExtentRequired",null),e([d({type:U,nonNullable:!0})],ee.prototype,"navigation",void 0),e([d()],ee.prototype,"renderingOptions",void 0),e([d({constructOnly:!0})],ee.prototype,"supersampleScreenshotsEnabled",void 0),e([d()],ee.prototype,"defaultsFromMapSettings",null),e([d({readOnly:!0})],ee.prototype,"typeSpecificPreconditionsReady",null),e([d()],ee.prototype,"analysisViewManager",void 0),e([d({type:H})],ee.prototype,"background",null),e([d({type:f})],ee.prototype,"center",null),e([d({type:i})],ee.prototype,"floors",void 0),e([d()],ee.prototype,"grid",void 0),e([d()],ee.prototype,"map",void 0),e([d()],ee.prototype,"padding",null),e([d({readOnly:!0})],ee.prototype,"rendering",null),e([d({readOnly:!0})],ee.prototype,"resolution",null),e([d()],ee.prototype,"scale",null),e([d({type:Boolean,value:!1})],ee.prototype,"spatialReferenceLocked",null),e([d({readOnly:!0})],ee.prototype,"tileInfo",null),e([d({type:I,readOnly:!0})],ee.prototype,"timeline",void 0),e([d({readOnly:!0})],ee.prototype,"type",void 0),e([d({type:Boolean,readOnly:!0})],ee.prototype,"updating",null),e([d({readOnly:!0})],ee.prototype,"view2dType",void 0),e([d({readOnly:!0})],ee.prototype,"visibleArea",null),e([d()],ee.prototype,"zoom",null),e([d({readOnly:!0})],ee.prototype,"navigating",null),e([d(),u(e=>e instanceof q?e:m(W,e))],ee.prototype,"ui",void 0),ee=e([c("esri.views.View2D")],ee);const te=ee;export{te as default};
2
+ import{__decorate as e}from"tslib";import t from"../Viewpoint.js";import i from"../core/Collection.js";import r from"../core/CollectionFlattener.js";import s from"../core/Error.js";import"../core/has.js";import a from"../core/Logger.js";import{destroyMaybe as n}from"../core/maybe.js";import{watch as o,syncAndInitial as l}from"../core/reactiveUtils.js";import{isScreenPoint as p,screenRectToPolygon as h,createScreenPoint as g}from"../core/screenUtils.js";import{property as d,cast as u,subclass as c}from"../core/accessorSupport/decorators.js";import{ensureClass as m}from"../core/accessorSupport/ensureType.js";import{initialize as y}from"../core/workers/workers.js";import f from"../geometry/Point.js";import w from"../geometry/Polygon.js";import{isLoadedOrLoadFor as V}from"../geometry/projectionUtils.js";import v from"../layers/support/TileInfo.js";import{BreakpointsOwner as M}from"./BreakpointsOwner.js";import{DOMContainer as _}from"./DOMContainer.js";import{PopupView as b}from"./PopupView.js";import S from"./View.js";import{Viewport2DBaseMixin as R}from"./Viewport2DBaseMixin.js";import{Viewport2DMixin as j}from"./Viewport2DMixin.js";import T from"./2d/AnimationManager.js";import{layerView2DImporter as L}from"./2d/layerViewModuleImportUtils.js";import O from"./2d/tiling/TileInfoView.js";import"./2d/tiling/TileKey.js";import"./2d/tiling/TileQueue.js";import"./2d/tiling/TileStrategy.js";import{extentToScale as k}from"./2d/viewpointUtils.js";import{importAnalysisViewModule as C}from"./2d/analysis/analysisViewModuleImportUtils.js";import x from"./2d/layers/features/support/TileStore.js";import{createOrReuseHighlightGradient as D}from"./2d/layers/support/util.js";import{hitTest as P}from"./2d/support/hitTestUtils.js";import{takeRawScreenshot as z,takeScreenshot as A}from"./2d/support/screenshotUtils.js";import{Timeline as E}from"./2d/support/Timeline.js";import I from"./navigation/Navigation.js";import U from"./navigation/NavigationActionMap.js";import G from"./support/AnalysisViewManager.js";import F from"./ui/DefaultUI.js";import q from"./ui/2d/DefaultUI2D.js";import{RenderingContextOptions as W}from"./webgl/RenderingContextOptions.js";import{isWebMap as N}from"../webmap/utils.js";import B from"../webmap/background/ColorBackground.js";let H,Z,K,Q,J,X;async function Y(){const[,{GraphicsView2D:e,GraphicContainer:t,MapViewNavigation:i,MagnifierView2D:r,GridView2D:s,Stage:a}]=await Promise.all([import("./2d/webglDeps.js"),import("./2d/mapViewDeps.js")]);Z=e,K=t,Q=i,J=r,X=s,H=a}let $=class extends(j(R(M(b(_(S)))))){get timeZone(){return super.timeZone}set timeZone(e){super.timeZone=e}constructor(e){super(e),this._magnifierView=null,this._gridView=null,this.stage=null,this._resolveWhenReady=[],this.rootLayerViews=new r({getCollections:()=>[this.basemapView?.baseLayerViews,this.layerViews,this.basemapView?.referenceLayerViews],getChildrenFunction:()=>null}),this.featuresTilingScheme=null,this.graphicsView=null,this.navigation=new I({actionMap:new U({dragTertiary:"none"})}),this.renderingOptions={samplingMode:"dynamic",edgeLabelsVisible:!0,labelsAnimationTime:125,labelCollisionsEnabled:!0},this.supersampleScreenshotsEnabled=!0,this.analysisViewManager=new G({importAnalysisViewModule:e=>C(e),view:this}),this.floors=new i,this.grid=null,this.map=null,this.timeline=new E,this.type="2d",this.view2dType=null,this.ui=new q,this.test={takeScreenshot:async e=>z(this._getScreenshotView(e),e)},this.padding={top:0,right:0,bottom:0,left:0},y()}destroy(){this.layerViewManager.clear(),this._set("preconditionsReady",!1),this.frameTask=n(this.frameTask),this.goToManager.destroy(),this.rootLayerViews.destroy(),this.inputManager.destroy(),this._set("inputManager",null)}get graphicsTileStore(){return new x(this.featuresTilingScheme)}get constraintsInfo(){const e=this.defaultsFromMap?.tileInfo,t=this.spatialReference;return{lods:e?.spatialReference?.equals(t)?e.lods:null,spatialReference:t}}get initialExtentRequired(){if(!this.stateManager)return!1;const{scale:e,constraints:t,center:i,viewpoint:r,extent:s}=this;let a=this.zoom;return!(this.map&&"initialViewProperties"in this.map&&this.map.initialViewProperties?.viewpoint)&&(!s&&(t?.effectiveLODs||(a=-1),(!i||0===e&&-1===a)&&(null==r?.targetGeometry||"extent"!==r.targetGeometry.type&&!r.scale)))}get defaultsFromMapSettings(){return{required:{extent:!1,heightModelInfo:!1,tileInfo:!0},requiresExtentInSpatialReference:this.spatialReferenceLocked}}get scheduler(){return this.frameTask.scheduler}get typeSpecificPreconditionsReady(){const e=this._getDefaultViewpoint();if(!e)return!1;const t=e.targetGeometry,i=this.spatialReference;return V(t.spatialReference,i)}get analyses(){return super.analyses}set analyses(e){super.analyses=e}get background(){return N(this.map)?this.map.initialViewProperties.background:null}set background(e){this._override("background",e)}get center(){return this.stateManager?.center??null}set center(e){this.stateManager.center=e}get constraints(){return super.constraints}set constraints(e){super.constraints=e}get extent(){return super.extent}set extent(e){super.extent=e}get padding(){return this.stateManager?.padding}set padding(e){this.stateManager&&(this.stateManager.padding=e)}get rendering(){return this.stage?.renderRequested??!1}get resizeAlign(){return super.resizeAlign}set resizeAlign(e){super.resizeAlign=e}get resolution(){return this.stateManager.resolution??0}get rotation(){return super.rotation}set rotation(e){super.rotation=e}get scale(){return this.stateManager?.scale??0}set scale(e){this.stateManager&&(this.stateManager.scale=e)}get spatialReference(){return super.spatialReference}set spatialReference(e){super.spatialReference=e}get spatialReferenceLocked(){return this._get("spatialReferenceLocked")}set spatialReferenceLocked(e){this.stage&&a.getLogger(this).warn("spatialReferenceLocked cannot be changed after the view has become ready"),this._set("spatialReferenceLocked",e)}get tileInfo(){return this.featuresTilingScheme?.tileInfo}get updating(){if(this.destroying||this.destroyed)return!1;const{analysisViewManager:e,allLayerViews:t,frameTask:i,graphicsView:r,inputManager:s,layerViewManager:a,magnifier:n,map:o,ready:l,rendering:p,selectionManager:h,stationary:g,toolViewManager:d,updatingHandles:u,stage:c}=this,m=o?.basemap,y=o?.ground,f="loading"===m?.loadStatus||"loading"===y?.loadStatus||!!o?.allLayers?.some(e=>e.parent!==y&&!e.isFulfilled()),w=!c||c.updating,V=!u||u.updating,v=!e||e.updating,M=!d||d.updating,_=!s||s.updating,b=!r||r.updating,S=!i||i.updating,R=!a||a.updating,j=!h||h.updating,T=!(!n.visible||null===n.position||!this._magnifierView?.updatingHandles.updating),L=t.some(e=>e.updating&&!e.destroyed);return!l||!g||p||f||L||T||V||v||S||M||_||R||b||j||w}get viewpoint(){return super.viewpoint}set viewpoint(e){super.viewpoint=e}get visibleArea(){const e=this.stateManager.visibleArea;return e?new w({rings:[e.map(e=>[e[0],e[1]])],spatialReference:this.spatialReference}):e}get zoom(){return this.stateManager.zoom??-1}set zoom(e){this.stateManager.zoom=e}get navigating(){return this.mapViewNavigation?.interacting??!1}async hitTest(e,t){return P(this,e,t)}async takeScreenshot(e){return A(this._getScreenshotView(e),e)}addUpdatingPromise(e){return this.updatingHandles.addPromise(e)}toScreen(e,t){return this.stateManager.toScreen(e,t)}async whenAnalysisView(e){if(null==e.parent)throw new s("view:no-analysisview-for-analysis","The analysis does not exist in view.analyses",{analysis:e});return this.analysisViewManager.whenAnalysisView(e)}whenLayerView(e){return super.whenLayerView(e)}graphicChanged(e){if(this.graphicsView){this.graphicsView.graphicUpdateHandler(e)}}whenReady(){return new Promise(e=>{this.ready?e(this):this._resolveWhenReady.push(e)})}zoomIn(){return super.zoomIn()}zoomOut(){return super.zoomOut()}forceDOMReadyCycle(){this.forceReadyCycle()}getWebDocumentSpatialReference(){return this.map&&"initialViewProperties"in this.map?this.map.initialViewProperties.spatialReference:null}getDefaultTimeZone(){return N(this.map)?this.map.initialViewProperties.timeZone:null}getDefaultTimeExtent(){return N(this.map)?this.map.initialViewProperties.timeExtent:null}getSurface(){return this.surface}hasLayerViewModule(e){return L.hasLayerViewModule(e)}importLayerView(e){return L.importLayerView(e)}pixelSizeAt(){return this.ready?this.resolution:(a.getLogger(this).error("#pixelSizeAt()","Map view cannot be used before it is ready"),null)}async popupHitTest(e){const t=p(e)?this.toMap(e):h(this,e),i=p(e)?e:g(e.x+e.width/2,e.y+e.height/2),r=this.toMap(i),s=await this.hitTest(e),a=new Set(this.allLayerViews),n=this.allLayerViews.filter(e=>!e.suspended&&a.has(e)).reverse(),o=new globalThis.Map(n.map(e=>[e.layer.uid,e])),l=[];let d=0,u=0;for(;d<s.results.length||u<n.length;){const e=s.results.at(d);if(e&&"graphic"!==e.type){++d;continue}const i=o.get((e?.layer??e?.graphic.layer)?.uid);if((!e||i)&&u<n.length&&n.at(u)!==i){const e=n.at(u);"fetchPopupFeaturesAtTarget"in e&&l.push({geometry:t,layerView:e}),++u}else e&&(l.push({graphic:e.graphic,layerView:i}),++d)}return{hits:l,location:r}}requestUpdate(){this.ready&&this.frameTask.requestUpdate()}loadAsyncDependencies(){return Y()}_getDefaultViewpoint(){const{constraints:e,initialExtent:i,map:r,padding:s,size:a}=this;if(!e)return null;const n=r&&"initialViewProperties"in r?r.initialViewProperties:void 0,o=this.stateManager.getUserStartupOptions(this.size),l=n?.viewpoint,p=l?.targetGeometry?.extent??i,h=p?.center,g=l?.rotation??0,d=l?.scale||p&&k(p,[a[0]-s.left-s.right,a[1]-s.top-s.bottom]),u=o.center??h,c=o.rotation??g,m=o.scale??d;return u&&m?new t({targetGeometry:u,scale:m,rotation:c}):null}_startup(){this.timeline.begin("MapView Startup");const e=this._getDefaultViewpoint();this.stateManager.startup(e,this.size,this.spatialReference,this.defaultsFromMap.extent?.center),this.graphics.owner=this;const t=this._createFeaturesTilingScheme(),i=new H(this._getOrCreateRenderCanvas(),{contextOptions:new W(this.deactivatedWebGLExtensions,this.debugWebGLExtensions),featuresTilingScheme:t,renderingOptions:this.renderingOptions,timeline:this.timeline});this.stage=i,this._magnifierView=new J,this._magnifierView.magnifier=this.magnifier,this._gridView=new X;const r=new T({view:this});this._set("animationManager",r);const s=new Q({view:this,animationManager:r});this._set("mapViewNavigation",s),this._setupSpatialReferenceDependentProperties(t),this.addHandles([this.rootLayerViews.on("change",()=>this._updateStageChildren()),i.on("webgl-error",e=>this.fatalError=e.error),o(()=>this.stationary,e=>i.stationary=e,l),o(()=>this.background,e=>{i.backgroundColor=e?.color,this._magnifierView.backgroundColor=e?.color},l),o(()=>this.magnifier,e=>this._magnifierView.magnifier=e,l),o(()=>this.grid,e=>this._gridView.grid=e,l),o(()=>this.renderingOptions,e=>i.renderingOptions=e,l),o(()=>this.highlights.items.map(e=>({name:e.name,options:{fillColor:e.color,haloColor:e.haloColor,fillOpacity:e.fillOpacity,haloOpacity:e.haloOpacity,haloWidth:e.haloWidth,haloBlur:e.haloBlur}})),()=>{i.highlightGradient=D(i.highlightGradient,this.highlights.items)},l),o(()=>this.state.id,()=>i.state=this.state,l),o(()=>this.animationsEnabled,e=>this.stage.animationsEnabled=e,l)],"map-view"),this._updateStageChildren();const a=this._resolveWhenReady;this._resolveWhenReady=[],a.forEach(e=>e(this)),this.timeline.end("MapView Startup"),this.frameTask.start(),this._set("ready",!0)}_teardown(){this._destroySpatialReferenceDependentProperties(),this.removeHandles("map-view"),this.mapViewNavigation.destroy(),this._set("mapViewNavigation",null),this.animation=null,this.animationManager.destroy(),this._set("animationManager",null),this.layerViewManager.clear(),this._magnifierView.destroy(),this._gridView.destroy(),this.stage.destroy(),this.stage=null,this._set("graphicsView",null),this._magnifierView=null,this._gridView=null,this._set("mapViewNavigation",null),this.graphics.owner=null,this.frameTask.stop(),this.stationaryManager.clear(),this._set("ready",!1),this.stateManager.teardown()}_updateStageChildren(){this.stage.removeAllChildren(),this.rootLayerViews.forEach(e=>{this.stage.addChild(e.container)});const e=this.graphicsView;this.stage.addChild(e.container),this.stage.addChild(this._magnifierView),this.stage.addChild(this._gridView)}_setupSpatialReferenceDependentProperties(e=this._createFeaturesTilingScheme()){this._set("featuresTilingScheme",e),this.stage.labelManager.featuresTilingScheme=e;const t=new Z({view:this,graphics:this.graphics,requestUpdateCallback:()=>this.requestUpdate(),container:new K(e,!0)});this._set("graphicsView",t)}_createFeaturesTilingScheme(){return new O(v.create({spatialReference:this.spatialReference,size:512,numLODs:36}))}_destroySpatialReferenceDependentProperties(){const e=this.graphicsView;this._set("graphicsView",null),e.destroy(),this._set("featuresTilingScheme",null)}_getScreenshotView(e){const{allLayerViews:t,padding:i,size:r,stage:s}=this;return{allLayerViews:t,backgroundColor:e?.ignoreBackground?null:this.background?.color,padding:i,size:r,stage:s}}_spatialReferenceChanged(e){if(this.ready){this.frameTask.stop();for(const e of this.allLayerViews)e.processDetach();this._destroySpatialReferenceDependentProperties(),this.stateManager.changeSpatialReference(e),this.stage.state=this.state,this._setupSpatialReferenceDependentProperties();for(const e of this.allLayerViews)e.processAttach();this.frameTask.requestFrame(),this.frameTask.start(),this._updateStageChildren()}}static{this.type="2d"}};e([d()],$.prototype,"_magnifierView",void 0),e([d()],$.prototype,"_gridView",void 0),e([d({constructOnly:!0})],$.prototype,"deactivatedWebGLExtensions",void 0),e([d({constructOnly:!0})],$.prototype,"debugWebGLExtensions",void 0),e([d({readOnly:!0})],$.prototype,"featuresTilingScheme",void 0),e([d({readOnly:!0})],$.prototype,"graphicsTileStore",null),e([d()],$.prototype,"graphicsView",void 0),e([d()],$.prototype,"constraintsInfo",null),e([d()],$.prototype,"initialExtentRequired",null),e([d({type:I,nonNullable:!0})],$.prototype,"navigation",void 0),e([d()],$.prototype,"renderingOptions",void 0),e([d({constructOnly:!0})],$.prototype,"supersampleScreenshotsEnabled",void 0),e([d()],$.prototype,"defaultsFromMapSettings",null),e([d({readOnly:!0})],$.prototype,"typeSpecificPreconditionsReady",null),e([d()],$.prototype,"analysisViewManager",void 0),e([d({type:B})],$.prototype,"background",null),e([d({type:f})],$.prototype,"center",null),e([d({type:i})],$.prototype,"floors",void 0),e([d()],$.prototype,"grid",void 0),e([d()],$.prototype,"map",void 0),e([d()],$.prototype,"padding",null),e([d({readOnly:!0})],$.prototype,"rendering",null),e([d({readOnly:!0})],$.prototype,"resolution",null),e([d()],$.prototype,"scale",null),e([d({type:Boolean,value:!1})],$.prototype,"spatialReferenceLocked",null),e([d({readOnly:!0})],$.prototype,"tileInfo",null),e([d({type:E,readOnly:!0})],$.prototype,"timeline",void 0),e([d({readOnly:!0})],$.prototype,"type",void 0),e([d({type:Boolean,readOnly:!0})],$.prototype,"updating",null),e([d({readOnly:!0})],$.prototype,"view2dType",void 0),e([d({readOnly:!0})],$.prototype,"visibleArea",null),e([d()],$.prototype,"zoom",null),e([d({readOnly:!0})],$.prototype,"navigating",null),e([d(),u(e=>e instanceof F?e:m(q,e))],$.prototype,"ui",void 0),$=e([c("esri.views.View2D")],$);const ee=$;export{ee as default};
@@ -7,7 +7,6 @@
7
7
  *
8
8
  * The direction mode can be toggled in the [tooltip's](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/TooltipOptions/) UI, provided the input mode is active.
9
9
  *
10
- * @internal
11
10
  * @since 5.2
12
11
  */
13
12
  export type DirectionMode = "relative" | "absolute";
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import"../../core/has.js";import t from"../../core/Logger.js";import{getOrCreateMapValue as i}from"../../core/MapUtils.js";import{throwIfAborted as r}from"../../core/promiseUtils.js";import{watch as s,syncAndInitial as l,on as n,whenOnce as a}from"../../core/reactiveUtils.js";import{sqlOr as o,sqlIn as u,sqlAnd as d}from"../../core/sql.js";import{property as p,subclass as f}from"../../core/accessorSupport/decorators.js";import{getPopupProvider as h}from"../../graphic/getPopupProvider.js";import{getFeatureIdInfoFieldNames as y}from"../../layers/graphics/data/FeatureIdInfo.js";import{systemIsSpatialFieldName as c}from"../../layers/knowledgeGraph/constants.js";import{getEffectiveDisplayFilter as m}from"../../layers/support/displayFilterUtils.js";import F from"../../layers/support/FeatureEffect.js";import g from"../../layers/support/FeatureFilter.js";import{getSignedInUser as I,layerRequiresGeometryZM as b}from"../../layers/support/featureLayerUtils.js";import{fetchFeaturePopupFeatures as v,loadFeaturePopupArcadeModules as w}from"../../layers/support/featurePopupQueryUtils.js";import{fixFields as x,unpackFieldNames as E,collectLabelingFields as R,collectElevationFields as _,collectFilterFields as q,collectFeatureReductionFields as j,collectOrderByInfos as O,collectFields as C,collectTrackInfoFields as k,collectDisplayFilterFields as Z,collectField as M,featureHasFields as U}from"../../layers/support/fieldUtils.js";import{getFloorFilterClause as P}from"../../layers/support/floorFilterUtils.js";import{collectRelativeTimeFields as T}from"../../layers/support/relativeTimeQueryUtils.js";import{getUtilityNetworkFields as L}from"../../networks/support/networkFieldUtils.js";import S from"../../rest/support/Query.js";import{createFeatureIdInfo as D}from"../2d/layers/features/layerAdapters/featureServiceUtils.js";import H from"./LayerView.js";import{getFetchPopupTemplate as N,getRequiredFields as Q}from"./support/popupUtils.js";import{WhereClauseVisitor as G}from"./support/WhereClauseVisitor.js";let V=class extends H{constructor(){super(...arguments),this._updatingRequiredPromise=null,this._defaultReturnZ=!1,this.hasZ=!1,this.hasM=!1,this.filter=null,this.layer=null,this.requiresCurrentUser=!1,this.requiredFields=[],this.view=null}initialize(){this.addHandles([s(()=>{const e=this.layer,t=this.view;return[e&&"elevationInfo"in e?e.elevationInfo?.featureExpressionInfo:null,e&&"displayField"in e?e.displayField:null,e&&"timeInfo"in e&&e.timeInfo,e&&"renderer"in e&&e.renderer,e&&"returnZ"in e&&e.returnZ,e&&"returnM"in e&&e.returnM,e&&"capabilities"in e&&e.capabilities,e&&"labelingInfo"in e&&e.labelingInfo,e&&"floorInfo"in e&&e.floorInfo,t?.requiredFieldsOptions?.featureTitleFields&&e&&"featureTitleFields"in e&&e.featureTitleFields,t?.requiredFieldsOptions?.utilityNetworkFields&&L(t,e),e&&"displayFilterInfo"in e&&e.displayFilterInfo,this.displayFilterEnabled,this.filter,this.featureEffect,this.timeExtent,this._getHighlightFilterGroups(),"knowledge-graph-sublayer"===e?.type&&"link-chart"===e.parentCompositeLayer?.type&&e.parentCompositeLayer.linkChart?.linkChartProperties.nonspatialDataDisplay?.mode]},()=>this._handleChange(),l),n(()=>this.view?.floors,"change",()=>this._handleChange()),n(()=>(this.layer&&"displayFilterInfo"in this.layer?this.layer.displayFilterInfo:null)?.filters,"change",()=>this._handleChange()),n(()=>this.layer&&"sublayers"in this.layer?this.layer.sublayers:null,"change",()=>this._handleChange())])}get availableFields(){if(!this.layer)return[];const{layer:e,layer:{fieldsIndex:t},requiredFields:i}=this;return"outFields"in e&&e.outFields?x(t,[...E(t,e.outFields),...i]):x(t,i)}get displayFilterEnabled(){return(this.view?.displayFilterEnabled??!0)&&(!("displayFilterEnabled"in this.layer)||(this.layer?.displayFilterEnabled??!0))}get effectiveDisplayFilter(){const e=this.layer;return"displayFilterInfo"in e&&this.displayFilterEnabled&&e.displayFilterInfo?m(e.displayFilterInfo,this.view):null}get effectiveDisplayFilterClause(){const e=this.effectiveDisplayFilter?.where??null;return e&&this.hasHighlight?o(e,u(this.layer.objectIdField,this.highlightIds)):e}get featureEffect(){return this.layer&&"featureEffect"in this.layer?this.layer.featureEffect:null}set featureEffect(e){this._override("featureEffect",e)}get highlightOptions(){}set highlightOptions(e){}get maximumNumberOfFeatures(){return 0}set maximumNumberOfFeatures(e){t.getLogger(this).error("#maximumNumberOfFeatures=","Setting maximum number of features is not supported")}get maximumNumberOfFeaturesExceeded(){return!1}get signedInUser(){return this.layer?.url?I(this.layer.url):Promise.resolve(null)}createQuery(){const e={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference},t=null!=this.filter?this.filter.createQuery(e):new S(e);if("floorInfo"in this.layer&&this.layer.floorInfo&&(t.where=d(t.where,P(this))),this.displayFilterEnabled&&(t.where=d(t.where,this.effectiveDisplayFilter?.where)),null!=this.timeExtent&&(t.timeExtent=null!=t.timeExtent?t.timeExtent.intersection(this.timeExtent):this.timeExtent.clone()),"capabilities"in this.layer){const e=this.layer.capabilities?.data;"returnZ"in this.layer&&e?.supportsZ&&null!=this.layer.returnZ&&(t.returnZ=this.layer.returnZ),"returnM"in this.layer&&e?.supportsM&&null!=this.layer.returnM&&(t.returnM=this.layer.returnM)}return"unplacedAnnotationsVisible"in this.layer&&!this.layer.unplacedAnnotationsVisible&&(t.where=d(t.where,`${this.layer.statusField} = 0`)),t}createAggregateQuery(){const e={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference};return new S(e)}async patchFeaturesForPopup(e,t){const r=[],s=new Set,l=new Map;for(const a of e){const e=i(l,a.origin,()=>{const e=h(a.origin);return N(e,{...t,checkPopupEnabled:!0})});e&&(r.push(a),s.add(e))}if(0===r.length||0===s.size)return[];const n=await this._createPopupQuery(s,t);return await v(this.layer,r,n,{hasRequiredFields:(e,t)=>this._popupFeatureHasRequiredFields(e,t),...t})}_handleChange(){const e=Promise.all([a(()=>!("reloading"in this.layer&&this.layer.reloading)),this._updateRequiredFields(),this._updateClientWhereClauseRequirements(),this._updateHasZM()]).then(()=>{});return this._updatingRequiredPromise=e,e.then(()=>{this._updatingRequiredPromise===e&&(this._updatingRequiredPromise=null)}),e}async _updateClientWhereClauseRequirements(){if(!this.layer||!this.view)return;const{layer:e}=this,i=new G(e.fieldsIndex);if(i.visitFilter(this.filter),"featureReduction"in e&&i.visitFeatureReduction(e.featureReduction),"labelingInfo"in e&&i.visitLabelingInfo(e.labelsVisible,e.labelingInfo),"trackInfo"in e&&i.visitTrackInfo(e.trackInfo),"2d"===this.view.type){i.visitFilter(this.featureEffect?.filter),"featureReduction"in e&&i.visitFeatureReduction(e.featureReduction),"displayFilterInfo"in e&&i.visitDisplayFilter(this.displayFilterEnabled,e.displayFilterInfo);for(const e of this._getHighlightFilterGroups())for(const t of e.filters)i.visitFilter(t)}if("subtype-group"===e.type)for(const t of e.sublayers)i.visitLabelingInfo(t.labelsVisible,t.labelingInfo);"definitionExpression"in e&&"capabilities"in e&&e.capabilities?.query.relativeTimeBinWindow&&i.visitRelativeTimeQuery(e.definitionExpression);try{const e=await i.finish();this._set("requiresCurrentUser",e.requiresCurrentUser)}catch(r){t.getLogger(this).error(r)}}async _updateRequiredFields(){if(!this.layer||!this.view)return;const e="3d"===this.view.type,{layer:i,layer:{fieldsIndex:r}}=this,s="renderer"in i&&i.renderer,l="orderBy"in i&&i.orderBy,n="featureReduction"in i?i.featureReduction:null,a=new Set,o=[s?s.collectRequiredFields(a,r):null,R(a,i),e&&"elevationInfo"in i?_(a,i):null,null!=this.filter?q(a,i,this.filter):null,e||null==this.featureEffect?null:q(a,i,this.featureEffect.filter),!e&&n?j(a,i,n):null,e&&"catalog-footprint"!==i.type||!l?null:O(a,i,l),"definitionExpression"in i&&"capabilities"in i&&i.capabilities?.query.relativeTimeBinWindow?T(a,i.fieldsIndex,i.definitionExpression):null];if(!e)for(const t of this._getHighlightFilterGroups())for(const e of t.filters)o.push(q(a,i,e));if("timeInfo"in i&&i.timeInfo&&this.timeExtent&&C(a,i.fieldsIndex,[i.timeInfo.startField,i.timeInfo.endField]),"timeInfo"in i&&i.timeInfo&&"trackInfo"in i&&i.trackInfo){const{trackInfo:e}=i;C(a,i.fieldsIndex,[i.timeInfo.trackIdField]),"feature"!==i.type&&"startTimeField"!==e.timeField||C(a,i.fieldsIndex,[i.timeInfo.startField]),"endTimeField"===e.timeField&&C(a,i.fieldsIndex,[i.timeInfo.endField]),await k(a,i)}if("floorInfo"in i&&i.floorInfo&&C(a,i.fieldsIndex,[i.floorInfo.floorField]),"featureTitleFields"in i&&this.view?.requiredFieldsOptions?.featureTitleFields&&i.featureTitleFields&&C(a,i.fieldsIndex,i.featureTitleFields),"feature"===i.type&&i.globalIdField&&this.view?.requiredFieldsOptions?.globalIdField&&C(a,i.fieldsIndex,[i.globalIdField]),"feature"!==i.type&&"subtype-group"!==i.type||!this.view?.requiredFieldsOptions?.utilityNetworkFields||C(a,i.fieldsIndex,L(this.view,i)),this.displayFilterEnabled&&"displayFilterInfo"in i&&o.push(Z(a,i,i.displayFilterInfo)),"feature"===i.type&&e&&null!=i.infoFor3D&&(null==i.globalIdField&&t.getLogger(this).error("globalIdField missing on 3DObjectFeatureLayer"),C(a,i.fieldsIndex,[i.globalIdField])),"subtype-group"===i.type){M(a,r,i.subtypeField);const e=i.sublayers.map(e=>Promise.all([e.renderer?.collectRequiredFields(a,r),R(a,e)]));o.push(Promise.all(e))}if("annotation-feature"===i.type&&C(a,r,[i.subtypeField,i.elementField,i.statusField]),"dimension-feature"===i.type&&C(a,r,i.symbolFields),"catalog-footprint"===i.type&&i.parent){const e=i.parent;C(a,r,[e.itemNameField,e.itemSourceField,e.itemTypeField,e.maxScaleField,e.minScaleField])}"knowledge-graph-sublayer"===i.type&&"link-chart"===i.parentCompositeLayer?.type&&M(a,r,c);const u=await Promise.allSettled(o);if(e)M(a,r,i.objectIdField);else for(const t of y(D(i)))M(a,r,t);e&&"displayField"in i&&i.displayField&&M(a,r,i.displayField);for(const p of u)"rejected"===p.status&&t.getLogger(this).error(p.reason);const d=Array.from(a).sort();this._set("requiredFields",d)}async _updateHasZM(){const{layer:e}=this;if(!e||!this.view)return;let t=!1,i=!1;if("capabilities"in e&&e.capabilities){const{data:r}=e.capabilities;t=r.supportsZ,i=r.supportsM}this._set("hasZ",t),this._set("hasM",i);const{returnZ:r,returnM:s}=await b(e);t&&=r??this._defaultReturnZ,i&&=s??!1,this.hasZ!==t&&this._set("hasZ",t),this.hasM!==i&&this._set("hasM",i)}_popupFeatureHasRequiredFields(e,t){return U(e,t)}async _createPopupQuery(e,t){const i=this.layer.createQuery(),s=new Set;let l="point"===this.layer.geometryType;for(const n of e){if(!l){const e=await w(n);r(t),l=(e&&e.arcadeUtils.hasGeometryOperations(n))??!1}const e=await Q(this.layer,n);r(t);for(const t of e)s.add(t)}return i.where="1=1",i.returnGeometry=l,i.returnZ=l,i.returnM=l,i.outFields=Array.from(s),i.outSpatialReference=this.view.spatialReference,"floorInfo"in this.layer&&this.layer.floorInfo&&(i.where=d(i.where,P(this))),i}canResume(){return!!super.canResume()&&(null==this.timeExtent||!this.timeExtent.isEmpty)}_getHighlightFilterGroups(){return[]}getTest(){}get test(){}};e([p()],V.prototype,"_updatingRequiredPromise",void 0),e([p()],V.prototype,"_defaultReturnZ",void 0),e([p({readOnly:!0})],V.prototype,"availableFields",null),e([p({readOnly:!0})],V.prototype,"hasZ",void 0),e([p({readOnly:!0})],V.prototype,"hasM",void 0),e([p({readOnly:!0})],V.prototype,"displayFilterEnabled",null),e([p({readOnly:!0})],V.prototype,"effectiveDisplayFilter",null),e([p({readOnly:!0})],V.prototype,"effectiveDisplayFilterClause",null),e([p({type:F})],V.prototype,"featureEffect",null),e([p({type:g})],V.prototype,"filter",void 0),e([p()],V.prototype,"layer",void 0),e([p({type:Number})],V.prototype,"maximumNumberOfFeatures",null),e([p({readOnly:!0,type:Boolean})],V.prototype,"maximumNumberOfFeaturesExceeded",null),e([p()],V.prototype,"requiresCurrentUser",void 0),e([p({readOnly:!0})],V.prototype,"requiredFields",void 0),e([p({readOnly:!0})],V.prototype,"signedInUser",null),e([p()],V.prototype,"view",void 0),V=e([f("esri.views.layers.FeatureLikeLayerView")],V);const A=V;export{A as default};
2
+ import{__decorate as e}from"tslib";import"../../core/has.js";import t from"../../core/Logger.js";import{getOrCreateMapValue as i}from"../../core/MapUtils.js";import{throwIfAborted as r}from"../../core/promiseUtils.js";import{watch as s,syncAndInitial as l,on as n,whenOnce as a}from"../../core/reactiveUtils.js";import{sqlOr as o,sqlIn as u,sqlAnd as d}from"../../core/sql.js";import{property as p,subclass as f}from"../../core/accessorSupport/decorators.js";import{getPopupProvider as h}from"../../graphic/getPopupProvider.js";import{getFeatureIdInfoFieldNames as y}from"../../layers/graphics/data/FeatureIdInfo.js";import{systemIsSpatialFieldName as c}from"../../layers/knowledgeGraph/constants.js";import{getEffectiveDisplayFilter as m}from"../../layers/support/displayFilterUtils.js";import F from"../../layers/support/FeatureEffect.js";import g from"../../layers/support/FeatureFilter.js";import{getSignedInUser as I,layerRequiresGeometryZM as b}from"../../layers/support/featureLayerUtils.js";import{fetchFeaturePopupFeatures as v,loadFeaturePopupArcadeModules as w}from"../../layers/support/featurePopupQueryUtils.js";import{fixFields as x,unpackFieldNames as E,collectLabelingFields as R,collectElevationFields as _,collectFilterFields as q,collectFeatureReductionFields as j,collectOrderByInfos as O,collectFields as C,collectTrackInfoFields as k,collectDisplayFilterFields as Z,collectField as M,featureHasFields as U}from"../../layers/support/fieldUtils.js";import{getFloorFilterClause as L}from"../../layers/support/floorFilterUtils.js";import{collectRelativeTimeFields as P}from"../../layers/support/relativeTimeQueryUtils.js";import{getUtilityNetworkFields as T}from"../../networks/support/networkFieldUtils.js";import S from"../../rest/support/Query.js";import{createFeatureIdInfo as D}from"../2d/layers/features/layerAdapters/featureServiceUtils.js";import H from"./LayerView.js";import{getFetchPopupTemplate as N,getRequiredFields as Q}from"./support/popupUtils.js";import{WhereClauseVisitor as G}from"./support/WhereClauseVisitor.js";let V=class extends H{constructor(){super(...arguments),this._updatingRequiredPromise=null,this._defaultReturnZ=!1,this.hasZ=!1,this.hasM=!1,this.filter=null,this.layer=null,this.requiresCurrentUser=!1,this.requiredFields=[],this.view=null}initialize(){this.addHandles([s(()=>{const e=this.layer,t=this.view;return[e&&"elevationInfo"in e?e.elevationInfo?.featureExpressionInfo:null,e&&"displayField"in e?e.displayField:null,e&&"timeInfo"in e&&e.timeInfo,e&&"renderer"in e&&e.renderer,e&&"returnZ"in e&&e.returnZ,e&&"returnM"in e&&e.returnM,e&&"capabilities"in e&&e.capabilities,e&&"labelingInfo"in e&&e.labelingInfo,e&&"floorInfo"in e&&e.floorInfo,t?.requiredFieldsOptions?.featureTitleFields&&e&&"featureTitleFields"in e&&e.featureTitleFields,t?.requiredFieldsOptions?.utilityNetworkFields&&T(t,e),e&&"displayFilterInfo"in e&&e.displayFilterInfo,this.displayFilterEnabled,this.filter,this.featureEffect,this.timeExtent,this._getHighlightFilterGroups(),"knowledge-graph-sublayer"===e?.type&&"link-chart"===e.parentCompositeLayer?.type&&e.parentCompositeLayer.linkChart?.linkChartProperties.nonspatialDataDisplay?.mode]},()=>this._handleChange(),l),n(()=>this.view?.floors,"change",()=>this._handleChange()),n(()=>(this.layer&&"displayFilterInfo"in this.layer?this.layer.displayFilterInfo:null)?.filters,"change",()=>this._handleChange()),n(()=>this.layer&&"sublayers"in this.layer?this.layer.sublayers:null,"change",()=>this._handleChange())])}get availableFields(){if(!this.layer)return[];const{layer:e,layer:{fieldsIndex:t},requiredFields:i}=this;return"outFields"in e&&e.outFields?x(t,[...E(t,e.outFields),...i]):x(t,i)}get displayFilterEnabled(){return(this.view?.displayFilterEnabled??!0)&&(!("displayFilterEnabled"in this.layer)||(this.layer?.displayFilterEnabled??!0))}get effectiveDisplayFilter(){const e=this.layer;return"displayFilterInfo"in e&&this.displayFilterEnabled&&e.displayFilterInfo?m(e.displayFilterInfo,this.view):null}get effectiveDisplayFilterClause(){const e=this.effectiveDisplayFilter?.where??null;return e&&this.hasHighlight?o(e,u(this.layer.objectIdField,this.highlightIds)):e}get featureEffect(){return this.layer&&"featureEffect"in this.layer?this.layer.featureEffect:null}set featureEffect(e){this._override("featureEffect",e)}get highlightOptions(){}set highlightOptions(e){}get maximumNumberOfFeatures(){return 0}set maximumNumberOfFeatures(e){t.getLogger(this).error("#maximumNumberOfFeatures=","Setting maximum number of features is not supported")}get maximumNumberOfFeaturesExceeded(){return!1}get signedInUser(){return this.layer?.url?I(this.layer.url):Promise.resolve(null)}createQuery(){const e={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference},t=null!=this.filter?this.filter.createQuery(e):new S(e);if("floorInfo"in this.layer&&this.layer.floorInfo&&(t.where=d(t.where,L(this))),this.displayFilterEnabled&&(t.where=d(t.where,this.effectiveDisplayFilter?.where)),null!=this.timeExtent&&(t.timeExtent=null!=t.timeExtent?t.timeExtent.intersection(this.timeExtent):this.timeExtent.clone()),"capabilities"in this.layer){const e=this.layer.capabilities?.data;"returnZ"in this.layer&&e?.supportsZ&&null!=this.layer.returnZ&&(t.returnZ=this.layer.returnZ),"returnM"in this.layer&&e?.supportsM&&null!=this.layer.returnM&&(t.returnM=this.layer.returnM)}return"unplacedAnnotationsVisible"in this.layer&&!this.layer.unplacedAnnotationsVisible&&(t.where=d(t.where,`${this.layer.statusField} = 0`)),t}createAggregateQuery(){const e={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference};return new S(e)}async patchFeaturesForPopup(e,t){const r=[],s=new Set,l=new Map;for(const a of e){const e=i(l,a.origin,()=>{const e=h(a.origin);return N(e,{...t,checkPopupEnabled:!0})});e&&(r.push(a),s.add(e))}if(0===r.length||0===s.size)return[];const n=await this._createPopupQuery(s,t);return await v(this.layer,r,n,{hasRequiredFields:(e,t)=>this._popupFeatureHasRequiredFields(e,t),onExceededTransferLimit:e=>{const i=t?.diagnostics;if(i&&e.length){i.layerLimitExceeded??=new Set;for(const t of e)t.origin&&i.layerLimitExceeded.add(t.origin)}},...t})}_handleChange(){const e=Promise.all([a(()=>!("reloading"in this.layer&&this.layer.reloading)),this._updateRequiredFields(),this._updateClientWhereClauseRequirements(),this._updateHasZM()]).then(()=>{});return this._updatingRequiredPromise=e,e.then(()=>{this._updatingRequiredPromise===e&&(this._updatingRequiredPromise=null)}),e}async _updateClientWhereClauseRequirements(){if(!this.layer||!this.view)return;const{layer:e}=this,i=new G(e.fieldsIndex);if(i.visitFilter(this.filter),"featureReduction"in e&&i.visitFeatureReduction(e.featureReduction),"labelingInfo"in e&&i.visitLabelingInfo(e.labelsVisible,e.labelingInfo),"trackInfo"in e&&i.visitTrackInfo(e.trackInfo),"2d"===this.view.type){i.visitFilter(this.featureEffect?.filter),"featureReduction"in e&&i.visitFeatureReduction(e.featureReduction),"displayFilterInfo"in e&&i.visitDisplayFilter(this.displayFilterEnabled,e.displayFilterInfo);for(const e of this._getHighlightFilterGroups())for(const t of e.filters)i.visitFilter(t)}if("subtype-group"===e.type)for(const t of e.sublayers)i.visitLabelingInfo(t.labelsVisible,t.labelingInfo);"definitionExpression"in e&&"capabilities"in e&&e.capabilities?.query.relativeTimeBinWindow&&i.visitRelativeTimeQuery(e.definitionExpression);try{const e=await i.finish();this._set("requiresCurrentUser",e.requiresCurrentUser)}catch(r){t.getLogger(this).error(r)}}async _updateRequiredFields(){if(!this.layer||!this.view)return;const e="3d"===this.view.type,{layer:i,layer:{fieldsIndex:r}}=this,s="renderer"in i&&i.renderer,l="orderBy"in i&&i.orderBy,n="featureReduction"in i?i.featureReduction:null,a=new Set,o=[s?s.collectRequiredFields(a,r):null,R(a,i),e&&"elevationInfo"in i?_(a,i):null,null!=this.filter?q(a,i,this.filter):null,e||null==this.featureEffect?null:q(a,i,this.featureEffect.filter),!e&&n?j(a,i,n):null,e&&"catalog-footprint"!==i.type||!l?null:O(a,i,l),"definitionExpression"in i&&"capabilities"in i&&i.capabilities?.query.relativeTimeBinWindow?P(a,i.fieldsIndex,i.definitionExpression):null];if(!e)for(const t of this._getHighlightFilterGroups())for(const e of t.filters)o.push(q(a,i,e));if("timeInfo"in i&&i.timeInfo&&this.timeExtent&&C(a,i.fieldsIndex,[i.timeInfo.startField,i.timeInfo.endField]),"timeInfo"in i&&i.timeInfo&&"trackInfo"in i&&i.trackInfo){const{trackInfo:e}=i;C(a,i.fieldsIndex,[i.timeInfo.trackIdField]),"feature"!==i.type&&"startTimeField"!==e.timeField||C(a,i.fieldsIndex,[i.timeInfo.startField]),"endTimeField"===e.timeField&&C(a,i.fieldsIndex,[i.timeInfo.endField]),await k(a,i)}if("floorInfo"in i&&i.floorInfo&&C(a,i.fieldsIndex,[i.floorInfo.floorField]),"featureTitleFields"in i&&this.view?.requiredFieldsOptions?.featureTitleFields&&i.featureTitleFields&&C(a,i.fieldsIndex,i.featureTitleFields),"feature"===i.type&&i.globalIdField&&this.view?.requiredFieldsOptions?.globalIdField&&C(a,i.fieldsIndex,[i.globalIdField]),"feature"!==i.type&&"subtype-group"!==i.type||!this.view?.requiredFieldsOptions?.utilityNetworkFields||C(a,i.fieldsIndex,T(this.view,i)),this.displayFilterEnabled&&"displayFilterInfo"in i&&o.push(Z(a,i,i.displayFilterInfo)),"feature"===i.type&&e&&null!=i.infoFor3D&&(null==i.globalIdField&&t.getLogger(this).error("globalIdField missing on 3DObjectFeatureLayer"),C(a,i.fieldsIndex,[i.globalIdField])),"subtype-group"===i.type){M(a,r,i.subtypeField);const e=i.sublayers.map(e=>Promise.all([e.renderer?.collectRequiredFields(a,r),R(a,e)]));o.push(Promise.all(e))}if("annotation-feature"===i.type&&C(a,r,[i.subtypeField,i.elementField,i.statusField]),"dimension-feature"===i.type&&C(a,r,i.symbolFields),"catalog-footprint"===i.type&&i.parent){const e=i.parent;C(a,r,[e.itemNameField,e.itemSourceField,e.itemTypeField,e.maxScaleField,e.minScaleField])}"knowledge-graph-sublayer"===i.type&&"link-chart"===i.parentCompositeLayer?.type&&M(a,r,c);const u=await Promise.allSettled(o);if(e)M(a,r,i.objectIdField);else for(const t of y(D(i)))M(a,r,t);e&&"displayField"in i&&i.displayField&&M(a,r,i.displayField);for(const p of u)"rejected"===p.status&&t.getLogger(this).error(p.reason);const d=Array.from(a).sort();this._set("requiredFields",d)}async _updateHasZM(){const{layer:e}=this;if(!e||!this.view)return;let t=!1,i=!1;if("capabilities"in e&&e.capabilities){const{data:r}=e.capabilities;t=r.supportsZ,i=r.supportsM}this._set("hasZ",t),this._set("hasM",i);const{returnZ:r,returnM:s}=await b(e);t&&=r??this._defaultReturnZ,i&&=s??!1,this.hasZ!==t&&this._set("hasZ",t),this.hasM!==i&&this._set("hasM",i)}_popupFeatureHasRequiredFields(e,t){return U(e,t)}async _createPopupQuery(e,t){const i=this.layer.createQuery(),s=new Set;let l="point"===this.layer.geometryType;for(const n of e){if(!l){const e=await w(n);r(t),l=(e&&e.arcadeUtils.hasGeometryOperations(n))??!1}const e=await Q(this.layer,n);r(t);for(const t of e)s.add(t)}return i.where="1=1",i.returnGeometry=l,i.returnZ=l,i.returnM=l,i.outFields=Array.from(s),i.outSpatialReference=this.view.spatialReference,"floorInfo"in this.layer&&this.layer.floorInfo&&(i.where=d(i.where,L(this))),i}canResume(){return!!super.canResume()&&(null==this.timeExtent||!this.timeExtent.isEmpty)}_getHighlightFilterGroups(){return[]}getTest(){}get test(){}};e([p()],V.prototype,"_updatingRequiredPromise",void 0),e([p()],V.prototype,"_defaultReturnZ",void 0),e([p({readOnly:!0})],V.prototype,"availableFields",null),e([p({readOnly:!0})],V.prototype,"hasZ",void 0),e([p({readOnly:!0})],V.prototype,"hasM",void 0),e([p({readOnly:!0})],V.prototype,"displayFilterEnabled",null),e([p({readOnly:!0})],V.prototype,"effectiveDisplayFilter",null),e([p({readOnly:!0})],V.prototype,"effectiveDisplayFilterClause",null),e([p({type:F})],V.prototype,"featureEffect",null),e([p({type:g})],V.prototype,"filter",void 0),e([p()],V.prototype,"layer",void 0),e([p({type:Number})],V.prototype,"maximumNumberOfFeatures",null),e([p({readOnly:!0,type:Boolean})],V.prototype,"maximumNumberOfFeaturesExceeded",null),e([p()],V.prototype,"requiresCurrentUser",void 0),e([p({readOnly:!0})],V.prototype,"requiredFields",void 0),e([p({readOnly:!0})],V.prototype,"signedInUser",null),e([p()],V.prototype,"view",void 0),V=e([f("esri.views.layers.FeatureLikeLayerView")],V);const A=V;export{A as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../Color.js";import r from"../../../core/Accessor.js";import{isSome as i}from"../../../core/arrayUtils.js";import s from"../../../core/Error.js";import has from"../../../core/has.js";import{getOrCreateMapValue as o}from"../../../core/MapUtils.js";import{debounce as a,throwIfAborted as l,ignoreAbortErrors as n}from"../../../core/promiseUtils.js";import{on as p}from"../../../core/reactiveUtils.js";import{sqlAnd as u}from"../../../core/sql.js";import{getMetersPerUnitForSR as c}from"../../../core/units.js";import{property as h,subclass as y}from"../../../core/accessorSupport/decorators.js";import d from"../../../geometry/Extent.js";import{getResolutionForScale as m}from"../../../geometry/support/scaleUtils.js";import{collectFields as f}from"../../../layers/support/fieldUtils.js";import{getLayerFloorFilterClause as g}from"../../../layers/support/floorFilterUtils.js";import{calculateTolerance as b}from"../../../renderers/support/clickToleranceUtils.js";import{identify as w}from"../../../rest/identify.js";import v from"../../../rest/support/IdentifyParameters.js";import{loadArcade as x}from"../../../support/loadArcade.js";import _ from"../../../symbols/SimpleMarkerSymbol.js";import{getRequiredFields as G,getFetchPopupTemplate as S}from"./popupUtils.js";let F=null;function j(e,t){return"tile"===t.type||"map-image"===t.type}let V=class extends r{constructor(e){super(e),this._featuresResolutions=new WeakMap,this.highlightGraphics=null,this.highlightGraphicUpdated=null,this.updateHighlightedFeatures=a(async e=>{this.destroyed||await this.updatingHandles.consumePromise(this._updateHighlightedFeaturesGeometries(e))})}initialize(){const e=e=>{for(const t of e){const{sourceLayer:e}=t;null!=e&&"geometryType"in e&&"point"===e.geometryType&&t.visible&&(t.visible=!1,this.highlightGraphicUpdated?.({graphic:t,property:"visible",oldValue:!0,newValue:!1}))}this.updatingHandles.consumePromise(this._updateHighlightedFeaturesSymbols(e)),n(this.updateHighlightedFeatures(this._highlightGeometriesResolution))};this.addHandles([p(()=>this.highlightGraphics,"change",t=>e(t.added),{onListenerAdd:t=>e(t)})])}async fetchPopupFeaturesAtTarget(e,t){const{layerView:{layer:r,view:{scale:i}}}=this,o=P(r.sublayers,i,t);if(!o.length)return[];if(await R(o))return this._fetchPopupFeaturesUsingQueries(e,o,t);if((r.capabilities?.operations?.supportsIdentify&&r.version>=10.5)??!0)return this._fetchPopupFeaturesUsingIdentify(e,o,t);throw new s("fetchPopupFeatures:not-supported","query operation is disabled for this service",{layer:r})}clearHighlights(){this.highlightGraphics?.removeAll()}async _updateHighlightedFeaturesSymbols(e){for(const t of e)this._updateSymbology(t)}_updateSymbology(e){if("point"===e.geometry?.type)return this._updatePointSymbology(e)}_setGraphicSymbol(e,t){if(!t)return;const r=e.symbol;e.symbol=t,this.highlightGraphicUpdated?.({graphic:e,property:"symbol",oldValue:r,newValue:t})}_updatePointSymbology(e){const r=e.sourceLayer&&"renderer"in e.sourceLayer&&e.sourceLayer.renderer,{highlightGraphicUpdated:i,highlightGraphics:s,layerView:{view:o}}=this,a=e=>{e.visible||(e.visible=!0,i?.({graphic:e,property:"visible",oldValue:!1,newValue:!0}))};r&&"getSymbolAsync"in r?r.getSymbolAsync(e).then(async i=>{i||=new _;let l=null;const n="visualVariables"in r?r.visualVariables?.find(e=>"size"===e.type):void 0;n&&(F||(F=(await(import("../../../renderers/visualVariables/support/visualVariableUtils.js"))).getSize),l=F(n,e,{view:o.type,scale:o.scale,shape:"simple-marker"===i.type?i.style:null})),l||="width"in i&&"height"in i&&null!=i.width&&null!=i.height?Math.max(i.width,i.height):"size"in i?i.size:16,s?.includes(e)&&(this._setGraphicSymbol(e,new _({style:"square",size:l,color:new t([255,255,255,1/255]),xoffset:"xoffset"in i?i.xoffset:0,yoffset:"yoffset"in i?i.yoffset:0})),a(e))}):a(e)}get _updateContext(){const{layerView:{layer:e},highlightGraphics:t,highlightGraphicUpdated:r}=this;return r&&t?.length&&e.capabilities.operations.supportsQuery?{highlightGraphicUpdated:r,highlightGraphics:t}:null}get highlightFeaturesActive(){return!!this._updateContext}async _updateHighlightedFeaturesGeometries(e){this._highlightGeometriesResolution=e;const t=this._updateContext;if(!t)return;const r=this._getTargetResolution(e),i=new Map,{highlightGraphics:s,highlightGraphicUpdated:a}=t;for(const u of s)if(!this._featuresResolutions.has(u)||this._featuresResolutions.get(u)>r){const e=u.sourceLayer;o(i,e,()=>new Map).set(u.getObjectId(),u)}const{layerView:{view:l}}=this,n=Array.from(i,([e,t])=>{const i=e.createQuery();return i.objectIds=[...t.keys()],i.outFields=[e.objectIdField],i.returnGeometry=!0,i.maxAllowableOffset=r,i.outSpatialReference=l.spatialReference,e.queryFeatures(i)}),p=await Promise.all(n);if(!this.destroyed)for(const{features:o}of p)for(const e of o){const t=e.sourceLayer,o=i.get(t).get(e.getObjectId());if(o&&s.includes(o)){const t=o.geometry;o.geometry=e.geometry,a({graphic:o,property:"geometry",oldValue:t,newValue:o.geometry}),this._featuresResolutions.set(o,r)}}}_getTargetResolution(e){const t=e*c(this.layerView.view.spatialReference),r=t/16;return r<=10?0:e/t*r}async _fetchPopupFeaturesUsingIdentify(e,t,r){const i=await this._createIdentifyParameters(e,t,r);if(null==i)return[];const{results:s}=await w(this.layerView.layer.parsedUrl,i,r);return s.map(e=>e.feature)}async _createIdentifyParameters(e,t,r){const{floors:i,layer:s,timeExtent:o,view:{spatialReference:a,scale:l}}=this.layerView;if(!t.length)return null;let n,p;await Promise.all(t.map(({sublayer:e})=>e.load(r).catch(()=>{}))),"point"===e.type?(n=Math.min(has("mapservice-popup-identify-max-tolerance"),s.allSublayers.reduce((e,t)=>t.renderer?b({renderer:t.renderer,pointerType:r?.pointerType}):e,2)),p=this.createFetchPopupFeaturesQueryGeometry(e,n)):(n=2,p=e.extent);const u=m(l,a),c=Math.ceil(p.width/u),h=new d({xmin:p.center.x-u*c,ymin:p.center.y-u*c,xmax:p.center.x+u*c,ymax:p.center.y+u*c,spatialReference:p.spatialReference});return new v({floors:i,gdbVersion:"gdbVersion"in s?s.gdbVersion:void 0,geometry:e,height:c,layerOption:"popup",mapExtent:h,returnGeometry:!0,spatialReference:a,sublayers:s.sublayers,timeExtent:o,tolerance:n,width:c})}async _fetchPopupFeaturesUsingQueries(e,t,r){const{layerView:{floors:s,timeExtent:o,view:{scale:a,spatialReference:n}}}=this,p=t.map(async({sublayer:t,popupTemplate:i})=>{if(await t.load(r).catch(()=>{}),t.capabilities&&!t.capabilities.operations.supportsQuery)return[];const p=t.createQuery();let c;if("point"===e.type){const i=b({renderer:t.renderer,pointerType:r?.pointerType});c=this.createFetchPopupFeaturesQueryGeometry(e,i)}else c=e;const h=new Set,[y]=await Promise.all([G(t,i),t.renderer?.collectRequiredFields(h,t.fieldsIndex)]);l(r),f(h,t.fieldsIndex,y);const d=Array.from(h).sort();p.geometry=c,p.outFields=d,p.timeExtent=o;const w=g(s,t);if(p.where=u(p.where,w),t.capabilities?.query.supportsOrderBy&&t.orderBy?.[0]){const e=t.orderBy[0],r=!e.valueExpression&&e.field,i="ascending"===e.order?"asc":"desc";r&&(p.orderByFields=[`${r} ${i}`])}const v=await U(i);l(r);const x="point"===t.geometryType||v?.arcadeUtils.hasGeometryOperations(i)?0:this._getTargetResolution(m(a,n));x&&(p.maxAllowableOffset=x);let{features:_}=await t.queryFeatures(p,r);_=await A(t,_,r);for(const e of _)this._featuresResolutions.set(e,x);return _});return(await Promise.allSettled(p)).reduce((e,t)=>"fulfilled"===t.status?[...e,...t.value]:e,[]).filter(i)}};function P(e,t,r){const i=[];if(!e)return i;const s=e=>{const o=0===e.minScale||t<=e.minScale,a=0===e.maxScale||t>=e.maxScale;if(e.visible&&o&&a)if(e.sublayers)e.sublayers.forEach(s);else if(e.popupEnabled){const t=S(e,{...r,defaultPopupTemplateEnabled:!1});null!=t&&i.unshift({sublayer:e,popupTemplate:t})}};return e.map(s),i}function U(e){return e.expressionInfos?.length||Array.isArray(e.content)&&e.content.some(e=>"expression"===e.type)?x():Promise.resolve()}async function R(e){return(await Promise.allSettled(e.map(({sublayer:e})=>e.load().catch(()=>{}).then(()=>e.capabilities?.operations?.supportsQuery??!1)))).every(e=>"fulfilled"===e.status&&e.value)}async function A(e,t,r){const i=e.renderer;return i&&"defaultSymbol"in i&&!i.defaultSymbol&&(t=i.valueExpression?await Promise.all(t.map(e=>i.getSymbolAsync(e,r).then(t=>t?e:null))).then(e=>e.filter(e=>null!=e)):t.filter(e=>null!=i.getSymbol(e))),t}e([h({constructOnly:!0})],V.prototype,"createFetchPopupFeaturesQueryGeometry",void 0),e([h({constructOnly:!0})],V.prototype,"layerView",void 0),e([h({constructOnly:!0})],V.prototype,"highlightGraphics",void 0),e([h({constructOnly:!0})],V.prototype,"highlightGraphicUpdated",void 0),e([h({constructOnly:!0})],V.prototype,"updatingHandles",void 0),e([h()],V.prototype,"_updateContext",null),V=e([y("esri.views.layers.support.MapServiceLayerViewHelper")],V);export{V as MapServiceLayerViewHelper,P as collectPopupProviders,j as isMapServiceLayerView};
2
+ import{__decorate as e}from"tslib";import t from"../../../Color.js";import r from"../../../core/Accessor.js";import{isSome as i}from"../../../core/arrayUtils.js";import s from"../../../core/Error.js";import has from"../../../core/has.js";import{getOrCreateMapValue as o}from"../../../core/MapUtils.js";import{debounce as a,throwIfAborted as l,ignoreAbortErrors as n}from"../../../core/promiseUtils.js";import{on as p}from"../../../core/reactiveUtils.js";import{sqlAnd as c}from"../../../core/sql.js";import{getMetersPerUnitForSR as u}from"../../../core/units.js";import{property as h,subclass as y}from"../../../core/accessorSupport/decorators.js";import d from"../../../geometry/Extent.js";import{getResolutionForScale as m}from"../../../geometry/support/scaleUtils.js";import{collectFields as f}from"../../../layers/support/fieldUtils.js";import{getLayerFloorFilterClause as g}from"../../../layers/support/floorFilterUtils.js";import{calculateTolerance as b}from"../../../renderers/support/clickToleranceUtils.js";import{identify as w}from"../../../rest/identify.js";import v from"../../../rest/support/IdentifyParameters.js";import{loadArcade as x}from"../../../support/loadArcade.js";import S from"../../../symbols/SimpleMarkerSymbol.js";import{getRequiredFields as _,getFetchPopupTemplate as G}from"./popupUtils.js";let F=null;function j(e,t){return"tile"===t.type||"map-image"===t.type}let V=class extends r{constructor(e){super(e),this._featuresResolutions=new WeakMap,this.highlightGraphics=null,this.highlightGraphicUpdated=null,this.updateHighlightedFeatures=a(async e=>{this.destroyed||await this.updatingHandles.consumePromise(this._updateHighlightedFeaturesGeometries(e))})}initialize(){const e=e=>{for(const t of e){const{sourceLayer:e}=t;null!=e&&"geometryType"in e&&"point"===e.geometryType&&t.visible&&(t.visible=!1,this.highlightGraphicUpdated?.({graphic:t,property:"visible",oldValue:!0,newValue:!1}))}this.updatingHandles.consumePromise(this._updateHighlightedFeaturesSymbols(e)),n(this.updateHighlightedFeatures(this._highlightGeometriesResolution))};this.addHandles([p(()=>this.highlightGraphics,"change",t=>e(t.added),{onListenerAdd:t=>e(t)})])}async fetchPopupFeaturesAtTarget(e,t){const{layerView:{layer:r,view:{scale:i}}}=this,o=P(r.sublayers,i,t);if(!o.length)return[];if(await R(o))return this._fetchPopupFeaturesUsingQueries(e,o,t);if((r.capabilities?.operations?.supportsIdentify&&r.version>=10.5)??!0)return this._fetchPopupFeaturesUsingIdentify(e,o,t);throw new s("fetchPopupFeatures:not-supported","query operation is disabled for this service",{layer:r})}clearHighlights(){this.highlightGraphics?.removeAll()}async _updateHighlightedFeaturesSymbols(e){for(const t of e)this._updateSymbology(t)}_updateSymbology(e){if("point"===e.geometry?.type)return this._updatePointSymbology(e)}_setGraphicSymbol(e,t){if(!t)return;const r=e.symbol;e.symbol=t,this.highlightGraphicUpdated?.({graphic:e,property:"symbol",oldValue:r,newValue:t})}_updatePointSymbology(e){const r=e.sourceLayer&&"renderer"in e.sourceLayer&&e.sourceLayer.renderer,{highlightGraphicUpdated:i,highlightGraphics:s,layerView:{view:o}}=this,a=e=>{e.visible||(e.visible=!0,i?.({graphic:e,property:"visible",oldValue:!1,newValue:!0}))};r&&"getSymbolAsync"in r?r.getSymbolAsync(e).then(async i=>{i||=new S;let l=null;const n="visualVariables"in r?r.visualVariables?.find(e=>"size"===e.type):void 0;n&&(F||(F=(await(import("../../../renderers/visualVariables/support/visualVariableUtils.js"))).getSize),l=F(n,e,{view:o.type,scale:o.scale,shape:"simple-marker"===i.type?i.style:null})),l||="width"in i&&"height"in i&&null!=i.width&&null!=i.height?Math.max(i.width,i.height):"size"in i?i.size:16,s?.includes(e)&&(this._setGraphicSymbol(e,new S({style:"square",size:l,color:new t([255,255,255,1/255]),xoffset:"xoffset"in i?i.xoffset:0,yoffset:"yoffset"in i?i.yoffset:0})),a(e))}):a(e)}get _updateContext(){const{layerView:{layer:e},highlightGraphics:t,highlightGraphicUpdated:r}=this;return r&&t?.length&&e.capabilities.operations.supportsQuery?{highlightGraphicUpdated:r,highlightGraphics:t}:null}get highlightFeaturesActive(){return!!this._updateContext}async _updateHighlightedFeaturesGeometries(e){this._highlightGeometriesResolution=e;const t=this._updateContext;if(!t)return;const r=this._getTargetResolution(e),i=new Map,{highlightGraphics:s,highlightGraphicUpdated:a}=t;for(const c of s)if(!this._featuresResolutions.has(c)||this._featuresResolutions.get(c)>r){const e=c.sourceLayer;o(i,e,()=>new Map).set(c.getObjectId(),c)}const{layerView:{view:l}}=this,n=Array.from(i,([e,t])=>{const i=e.createQuery();return i.objectIds=[...t.keys()],i.outFields=[e.objectIdField],i.returnGeometry=!0,i.maxAllowableOffset=r,i.outSpatialReference=l.spatialReference,e.queryFeatures(i)}),p=await Promise.all(n);if(!this.destroyed)for(const{features:o}of p)for(const e of o){const t=e.sourceLayer,o=i.get(t).get(e.getObjectId());if(o&&s.includes(o)){const t=o.geometry;o.geometry=e.geometry,a({graphic:o,property:"geometry",oldValue:t,newValue:o.geometry}),this._featuresResolutions.set(o,r)}}}_getTargetResolution(e){const t=e*u(this.layerView.view.spatialReference),r=t/16;return r<=10?0:e/t*r}async _fetchPopupFeaturesUsingIdentify(e,t,r){const i=await this._createIdentifyParameters(e,t,r);if(null==i)return[];const{results:s,exceededTransferLimit:o}=await w(this.layerView.layer.parsedUrl,i,r);if(o)for(const{sublayer:a}of t){const e=a.graphicOrigin;e&&r?.diagnostics&&(r.diagnostics.layerLimitExceeded??=new Set).add(e)}return s.map(e=>e.feature)}async _createIdentifyParameters(e,t,r){const{floors:i,layer:s,timeExtent:o,view:{spatialReference:a,scale:l}}=this.layerView;if(!t.length)return null;let n,p;await Promise.all(t.map(({sublayer:e})=>e.load(r).catch(()=>{}))),"point"===e.type?(n=Math.min(has("mapservice-popup-identify-max-tolerance"),s.allSublayers.reduce((e,t)=>t.renderer?b({renderer:t.renderer,pointerType:r?.pointerType}):e,2)),p=this.createFetchPopupFeaturesQueryGeometry(e,n)):(n=2,p=e.extent);const c=m(l,a),u=Math.ceil(p.width/c),h=new d({xmin:p.center.x-c*u,ymin:p.center.y-c*u,xmax:p.center.x+c*u,ymax:p.center.y+c*u,spatialReference:p.spatialReference});return new v({floors:i,gdbVersion:"gdbVersion"in s?s.gdbVersion:void 0,geometry:e,height:u,layerOption:"popup",mapExtent:h,returnGeometry:!0,spatialReference:a,sublayers:s.sublayers,timeExtent:o,tolerance:n,width:u})}async _fetchPopupFeaturesUsingQueries(e,t,r){const{layerView:{floors:s,timeExtent:o,view:{scale:a,spatialReference:n}}}=this,p=t.map(async({sublayer:t,popupTemplate:i})=>{if(await t.load(r).catch(()=>{}),t.capabilities&&!t.capabilities.operations.supportsQuery)return[];const p=t.createQuery();let u;if("point"===e.type){const i=b({renderer:t.renderer,pointerType:r?.pointerType});u=this.createFetchPopupFeaturesQueryGeometry(e,i)}else u=e;const h=new Set,[y]=await Promise.all([_(t,i),t.renderer?.collectRequiredFields(h,t.fieldsIndex)]);l(r),f(h,t.fieldsIndex,y);const d=Array.from(h).sort();p.geometry=u,p.outFields=d,p.timeExtent=o;const w=g(s,t);if(p.where=c(p.where,w),t.capabilities?.query.supportsOrderBy&&t.orderBy?.[0]){const e=t.orderBy[0],r=!e.valueExpression&&e.field,i="ascending"===e.order?"asc":"desc";r&&(p.orderByFields=[`${r} ${i}`])}const v=await U(i);l(r);const x="point"===t.geometryType||v?.arcadeUtils.hasGeometryOperations(i)?0:this._getTargetResolution(m(a,n));x&&(p.maxAllowableOffset=x);const S=await t.queryFeatures(p,r);let{features:G}=S;if(S.exceededTransferLimit){const e=t.graphicOrigin;e&&r?.diagnostics&&(r.diagnostics.layerLimitExceeded??=new Set).add(e)}G=await T(t,G,r);for(const e of G)this._featuresResolutions.set(e,x);return G});return(await Promise.allSettled(p)).reduce((e,t)=>"fulfilled"===t.status?[...e,...t.value]:e,[]).filter(i)}};function P(e,t,r){const i=[];if(!e)return i;const s=e=>{const o=0===e.minScale||t<=e.minScale,a=0===e.maxScale||t>=e.maxScale;if(e.visible&&o&&a)if(e.sublayers)e.sublayers.forEach(s);else if(e.popupEnabled){const t=G(e,{...r,defaultPopupTemplateEnabled:!1});null!=t&&i.unshift({sublayer:e,popupTemplate:t})}};return e.map(s),i}function U(e){return e.expressionInfos?.length||Array.isArray(e.content)&&e.content.some(e=>"expression"===e.type)?x():Promise.resolve()}async function R(e){return(await Promise.allSettled(e.map(({sublayer:e})=>e.load().catch(()=>{}).then(()=>e.capabilities?.operations?.supportsQuery??!1)))).every(e=>"fulfilled"===e.status&&e.value)}async function T(e,t,r){const i=e.renderer;return i&&"defaultSymbol"in i&&!i.defaultSymbol&&(t=i.valueExpression?await Promise.all(t.map(e=>i.getSymbolAsync(e,r).then(t=>t?e:null))).then(e=>e.filter(e=>null!=e)):t.filter(e=>null!=i.getSymbol(e))),t}e([h({constructOnly:!0})],V.prototype,"createFetchPopupFeaturesQueryGeometry",void 0),e([h({constructOnly:!0})],V.prototype,"layerView",void 0),e([h({constructOnly:!0})],V.prototype,"highlightGraphics",void 0),e([h({constructOnly:!0})],V.prototype,"highlightGraphicUpdated",void 0),e([h({constructOnly:!0})],V.prototype,"updatingHandles",void 0),e([h()],V.prototype,"_updateContext",null),V=e([y("esri.views.layers.support.MapServiceLayerViewHelper")],V);export{V as MapServiceLayerViewHelper,P as collectPopupProviders,j as isMapServiceLayerView};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../core/Accessor.js";import{createTask as n}from"../../core/asyncUtils.js";import{abortMaybe as a}from"../../core/maybe.js";import{isAborted as i,isAbortError as r}from"../../core/promiseUtils.js";import{property as s,subclass as l}from"../../core/accessorSupport/decorators.js";import{supportsHeightModelInfo as o,getLayerHeightModelInfo as p,deriveHeightModelInfoFromLayer as u}from"../../geometry/support/heightModelInfoUtils.js";import{projectWithEngineOrService as c}from"./projectionUtils.js";let d=class extends t{constructor(e){super(e),this.required={extent:!1,heightModelInfo:!1,tileInfo:!1},this.defaultSpatialReference=null,this.userSpatialReference=null,this.sourcePreloadCount=10,this.priorityCollection=null,this.requiresExtentInSpatialReference=!0,this.viewReady=!1,this._projectExtentTask={task:null,input:null,output:null,spatialReference:null}}destroy(){this._projectExtentTask.task&&(this._projectExtentTask.task=a(this._projectExtentTask.task)),this._set("map",null)}get ready(){return!this._spatialReferenceTask.updating&&!this._tileInfoTask.updating&&!this._extentTask.updating}get heightModelInfoReady(){return!this._heightModelInfoTask.updating}get spatialReference(){return this.userSpatialReference??this._spatialReferenceTask.spatialReference}get extent(){return this._extentTask.extent}get heightModelInfo(){return this._heightModelInfoTask.heightModelInfo}get combinedHorizontalAndVerticalSpatialReference(){return this.heightModelInfoReady?this._heightModelInfoTask.spatialReference:null}get viewingMode(){return null==this.userSpatialReference||this.userSpatialReference.equals(this._spatialReferenceTask.spatialReference)?this._spatialReferenceTask.viewingMode??null:null}get tileInfo(){return this._tileInfoTask.tileInfo}get mapCollections(){const e=this.map?.(),t=[];return null!=this.priorityCollection&&t.push(this.priorityCollection),t.push({parent:e?.basemap,layers:e?.basemap?.baseLayers},{parent:e?.basemap,layers:e?.basemap?.groundLayers},{layers:e?.layers},{parent:e?.ground,layers:e?.ground?.layers},{parent:e?.basemap,layers:e?.basemap?.referenceLayers}),t}get _spatialReferenceTask(){if(this.viewReady)return this._get("_spatialReferenceTask")??{updating:!1};const{spatialReference:e,viewingMode:t,updating:n}=this._combinedSpatialReferenceTask(null,!1);return{spatialReference:e,viewingMode:t,updating:n}}get _heightModelInfoTask(){if(!this.required.heightModelInfo)return{updating:!1};const e=this.viewReady?this._get("_heightModelInfoTask"):null;return e&&!e.updating&&e.heightModelInfo?e:this._combinedSpatialReferenceTask(this.userSpatialReference,!0)}_combinedSpatialReferenceTask(e,t){let n=e?[new f(e,null,null)]:null;const a=()=>1===n?.length&&(!t||null!=n[0].heightModelInfo);if(this._collectLayers(this.mapCollections,e=>{const t=this._getSupportedSpatialReferences(e);if(t.length>0){const e=this._narrowDownSpatialReferenceCandidates(n,t);null!=e&&(n=e)}return!!a()})&&!a())return{updating:!0};const i=this._pickSpatialReferenceCandidate(n);return{heightModelInfo:i?.heightModelInfo??null,spatialReference:i?.spatialReference??null,viewingMode:i?.viewingMode??null,updating:!1}}get _tileInfoTask(){if(!this.required.tileInfo)return this._get("_tileInfoTask")??{updating:!1};const e=this.map?.(),t=this.spatialReference;if(!t)return{updating:this._spatialReferenceTask.updating};let n;const a=this._collectLayers([{parent:e?.basemap,layers:e?.basemap?.baseLayers},{parent:e?.basemap,layers:e?.basemap?.groundLayers},{layers:e?.layers}],e=>!(!("tileInfo"in e)||!e.tileInfo?.spatialReference.equals(t))&&(n=e,!0),e=>"tileInfo"in e);if(n){return{tileInfo:n.tileInfo,updating:!1}}return{updating:a}}get _extentCandidatesTask(){if(this.viewReady||!this.required.extent)return this._get("_extentCandidatesTask")??{updating:!1};if(!this.spatialReference)return{updating:this._spatialReferenceTask.updating};const e=[],t=this._collectLayers(this.mapCollections,t=>{const n="fullExtents"in t&&t.fullExtents||(null!=t.fullExtent?[t.fullExtent]:[]),a=this.requiresExtentInSpatialReference?null:n[0],i=n.find(e=>e.spatialReference.equals(this.spatialReference))??a;if(i)return e.push({extent:i,layer:t}),!0;if(this._getSupportedSpatialReferences(t).length>0)for(const r of n)e.push({extent:r,layer:t});return!1});return{candidates:e,updating:t}}get _extentTask(){const{candidates:e,updating:t}=this._extentCandidatesTask;if(t)return{updating:t};if(null==e||0===e.length)return{updating:!1};if(!this.spatialReference)return{updating:this._spatialReferenceTask.updating};const r=this._pickExtentCandidate(e),s=this.spatialReference;return r.extent.equals(this._projectExtentTask.input)&&s.equals(this._projectExtentTask.spatialReference)?{extent:this._projectExtentTask.output,updating:null!=this._projectExtentTask.task&&!this._projectExtentTask.task.finished}:(null!=this._projectExtentTask.task&&(this._projectExtentTask.task=a(this._projectExtentTask.task)),this._projectExtentTask={input:r.extent.clone(),output:null,spatialReference:s.clone(),task:n(async e=>{try{const t=await c(r.extent,s,"portalItem"in r.layer?r.layer.portalItem:void 0,e);this._projectExtentTask={...this._projectExtentTask,task:null,output:t}}catch(t){if(i(e))return;this._projectExtentTask={...this._projectExtentTask,task:null}}})},{updating:!0})}_narrowDownSpatialReferenceCandidates(e,t){if(null==e)return t;const n=new Array;for(const a of e)for(const e of t){if(!a.spatialReference.equals(e.spatialReference))continue;const t=g(a.viewingMode,e.viewingMode);if(!1!==t){const i=e.heightModelInfo&&!a.heightModelInfo;n.push(new f(i?e.spatialReference:a.spatialReference,i?e.heightModelInfo:a.heightModelInfo,t));break}}return n.length>0?n:null}_pickSpatialReferenceCandidate(e){const t=this.defaultSpatialReference;if(!e?.length)return t?{heightModelInfo:null,spatialReference:t,viewingMode:null}:null;return(e.length>1&&t?e.find(({spatialReference:e})=>e.equals(t)):null)??e[0]}_getSupportedSpatialReferences(e){const t="supportedSpatialReferences"in e&&e.supportedSpatialReferences||(e.spatialReference?[e.spatialReference]:[]);if(0===t.length)return[];const n=this.required.heightModelInfo&&o(e),a=p(e),i=[];for(const r of t){const t=this.getSpatialReferenceSupport(r,e);if(null!=t){const s=t.constraints??[{spatialReference:r,viewingMode:null}];for(const{spatialReference:t,viewingMode:r}of s)if(!this.requiresExtentInSpatialReference||null==this.userSpatialReference||t.equals(this.userSpatialReference)){const s=n?a??u(e,t):null;i.push(new f(t,s,r))}}}return i}_pickExtentCandidate(e){const t=this.spatialReference;return e.find(({extent:e})=>t.equals(e.spatialReference))||e[0]}_collectLayers(e,t,n=()=>!0){switch(this._loadMaybe(this.map?.())){case"loading":return!0;case"failed":return!1}const a=new h(n,t);for(const i of e)if(this._collectCollection(i,a),a.done||a.preloading===this.sourcePreloadCount)break;return a.updating}_collectCollection(e,t){if(e.layers){switch(this._loadMaybe(e.parent)){case"loading":return t.updating=!0,void++t.preloading;case"failed":return}for(const n of e.layers)if(("graphics"!==n.type||!n.internal)&&t.layerFilter(n)){switch(this._loadMaybe(n)){case"failed":continue;case"loading":t.updating=!0,++t.preloading;break;case"loaded":if(t.updating||(t.done=t.pushLayer(n)),t.done||t.preloading===this.sourcePreloadCount)break;"layers"in n&&this._collectCollection({layers:n.layers},t)}if(t.done||t.preloading===this.sourcePreloadCount)break}}}_loadMaybe(e){return e&&"loadStatus"in e&&null!=e.loadStatus?"not-loaded"===e.loadStatus?(e.load().catch(e=>{r(e)}),"loading"):e.loadStatus:"loaded"}};e([s()],d.prototype,"required",void 0),e([s({constructOnly:!0})],d.prototype,"map",void 0),e([s({constructOnly:!0})],d.prototype,"getSpatialReferenceSupport",void 0),e([s()],d.prototype,"defaultSpatialReference",void 0),e([s()],d.prototype,"userSpatialReference",void 0),e([s()],d.prototype,"sourcePreloadCount",void 0),e([s()],d.prototype,"priorityCollection",void 0),e([s()],d.prototype,"requiresExtentInSpatialReference",void 0),e([s()],d.prototype,"viewReady",void 0),e([s({readOnly:!0})],d.prototype,"ready",null),e([s({readOnly:!0})],d.prototype,"heightModelInfoReady",null),e([s({readOnly:!0})],d.prototype,"spatialReference",null),e([s({readOnly:!0})],d.prototype,"extent",null),e([s({readOnly:!0})],d.prototype,"heightModelInfo",null),e([s({readOnly:!0})],d.prototype,"combinedHorizontalAndVerticalSpatialReference",null),e([s({readOnly:!0})],d.prototype,"viewingMode",null),e([s({readOnly:!0})],d.prototype,"tileInfo",null),e([s({readOnly:!0})],d.prototype,"mapCollections",null),e([s({readOnly:!0})],d.prototype,"_spatialReferenceTask",null),e([s({readOnly:!0})],d.prototype,"_heightModelInfoTask",null),e([s({readOnly:!0})],d.prototype,"_tileInfoTask",null),e([s({readOnly:!0})],d.prototype,"_extentCandidatesTask",null),e([s()],d.prototype,"_extentTask",null),e([s()],d.prototype,"_projectExtentTask",void 0),d=e([l("esri.views.support.DefaultsFromMap")],d);class f{constructor(e,t,n){this.spatialReference=e,this.heightModelInfo=t,this.viewingMode=n}}class h{constructor(e,t){this.layerFilter=e,this.pushLayer=t,this.preloading=-1,this.updating=!1,this.done=!1}}function g(e,t){return null!=e?null!=t?e===t&&e:e:t}export{d as DefaultsFromMap};
2
+ import{__decorate as e}from"tslib";import t from"../../core/Accessor.js";import{createTask as n}from"../../core/asyncUtils.js";import{abortMaybe as a}from"../../core/maybe.js";import{isAborted as i,isAbortError as r}from"../../core/promiseUtils.js";import{property as l,subclass as s}from"../../core/accessorSupport/decorators.js";import{supportsHeightModelInfo as o,getLayerHeightModelInfo as p,deriveHeightModelInfoFromLayer as u}from"../../geometry/support/heightModelInfoUtils.js";import{projectWithEngineOrService as c}from"./projectionUtils.js";let d=class extends t{constructor(e){super(e),this.required={extent:!1,heightModelInfo:!1,tileInfo:!1},this.defaultSpatialReference=null,this.inputSpatialReference=null,this.sourcePreloadCount=10,this.priorityCollection=null,this.requiresExtentInSpatialReference=!0,this.viewReady=!1,this._projectExtentTask={task:null,input:null,output:null,spatialReference:null}}destroy(){this._projectExtentTask.task&&(this._projectExtentTask.task=a(this._projectExtentTask.task)),this._set("map",null)}get ready(){return!this._spatialReferenceTask.updating&&!this._tileInfoTask.updating&&!this._extentTask.updating}get heightModelInfoReady(){return!this._heightModelInfoTask.updating}get spatialReference(){return this.inputSpatialReference??this._spatialReferenceTask.spatialReference}get extent(){return this._extentTask.extent}get heightModelInfo(){return this._heightModelInfoTask.heightModelInfo}get combinedHorizontalAndVerticalSpatialReference(){return this.heightModelInfoReady?this._heightModelInfoTask.spatialReference:null}get viewingMode(){return null==this.inputSpatialReference||this.inputSpatialReference.equals(this._spatialReferenceTask.spatialReference)?this._spatialReferenceTask.viewingMode??null:null}get tileInfo(){return this._tileInfoTask.tileInfo}get mapCollections(){const e=this.map?.(),t=[];return null!=this.priorityCollection&&t.push(this.priorityCollection),t.push({parent:e?.basemap,layers:e?.basemap?.baseLayers},{parent:e?.basemap,layers:e?.basemap?.groundLayers},{layers:e?.layers},{parent:e?.ground,layers:e?.ground?.layers},{parent:e?.basemap,layers:e?.basemap?.referenceLayers}),t}get _spatialReferenceTask(){if(this.viewReady)return this._get("_spatialReferenceTask")??{updating:!1};const{spatialReference:e,viewingMode:t,updating:n}=this._combinedSpatialReferenceTask(null,!1);return{spatialReference:e,viewingMode:t,updating:n}}get _heightModelInfoTask(){if(!this.required.heightModelInfo)return{updating:!1};const e=this.viewReady?this._get("_heightModelInfoTask"):null;return e&&!e.updating&&e.heightModelInfo?e:this._combinedSpatialReferenceTask(this.inputSpatialReference,!0)}_combinedSpatialReferenceTask(e,t){let n=e?[new f(e,null,null)]:null;const a=()=>1===n?.length&&(!t||null!=n[0].heightModelInfo);if(this._collectLayers(this.mapCollections,e=>{const t=this._getSupportedSpatialReferences(e);if(t.length>0){const e=this._narrowDownSpatialReferenceCandidates(n,t);null!=e&&(n=e)}return!!a()})&&!a())return{updating:!0};const i=this._pickSpatialReferenceCandidate(n);return{heightModelInfo:i?.heightModelInfo??null,spatialReference:i?.spatialReference??null,viewingMode:i?.viewingMode??null,updating:!1}}get _tileInfoTask(){if(!this.required.tileInfo)return this._get("_tileInfoTask")??{updating:!1};const e=this.map?.(),t=this.spatialReference;if(!t)return{updating:this._spatialReferenceTask.updating};let n;const a=this._collectLayers([{parent:e?.basemap,layers:e?.basemap?.baseLayers},{parent:e?.basemap,layers:e?.basemap?.groundLayers},{layers:e?.layers}],e=>!(!("tileInfo"in e)||!e.tileInfo?.spatialReference.equals(t))&&(n=e,!0),e=>"tileInfo"in e);if(n){return{tileInfo:n.tileInfo,updating:!1}}return{updating:a}}get _extentCandidatesTask(){if(this.viewReady||!this.required.extent)return this._get("_extentCandidatesTask")??{updating:!1};if(!this.spatialReference)return{updating:this._spatialReferenceTask.updating};const e=[],t=this._collectLayers(this.mapCollections,t=>{const n="fullExtents"in t&&t.fullExtents||(null!=t.fullExtent?[t.fullExtent]:[]),a=this.requiresExtentInSpatialReference?null:n[0],i=n.find(e=>e.spatialReference.equals(this.spatialReference))??a;if(i)return e.push({extent:i,layer:t}),!0;if(this._getSupportedSpatialReferences(t).length>0)for(const r of n)e.push({extent:r,layer:t});return!1});return{candidates:e,updating:t}}get _extentTask(){const{candidates:e,updating:t}=this._extentCandidatesTask;if(t)return{updating:t};if(null==e||0===e.length)return{updating:!1};if(!this.spatialReference)return{updating:this._spatialReferenceTask.updating};const r=this._pickExtentCandidate(e),l=this.spatialReference;return r.extent.equals(this._projectExtentTask.input)&&l.equals(this._projectExtentTask.spatialReference)?{extent:this._projectExtentTask.output,updating:null!=this._projectExtentTask.task&&!this._projectExtentTask.task.finished}:(null!=this._projectExtentTask.task&&(this._projectExtentTask.task=a(this._projectExtentTask.task)),this._projectExtentTask={input:r.extent.clone(),output:null,spatialReference:l.clone(),task:n(async e=>{try{const t=await c(r.extent,l,"portalItem"in r.layer?r.layer.portalItem:void 0,e);this._projectExtentTask={...this._projectExtentTask,task:null,output:t}}catch(t){if(i(e))return;this._projectExtentTask={...this._projectExtentTask,task:null}}})},{updating:!0})}_narrowDownSpatialReferenceCandidates(e,t){if(null==e)return t;const n=new Array;for(const a of e)for(const e of t){if(!a.spatialReference.equals(e.spatialReference))continue;const t=g(a.viewingMode,e.viewingMode);if(!1!==t){const i=e.heightModelInfo&&!a.heightModelInfo;n.push(new f(i?e.spatialReference:a.spatialReference,i?e.heightModelInfo:a.heightModelInfo,t));break}}return n.length>0?n:null}_pickSpatialReferenceCandidate(e){const t=this.defaultSpatialReference;if(!e?.length)return t?{heightModelInfo:null,spatialReference:t,viewingMode:null}:null;return(e.length>1&&t?e.find(({spatialReference:e})=>e.equals(t)):null)??e[0]}_getSupportedSpatialReferences(e){const t="supportedSpatialReferences"in e&&e.supportedSpatialReferences||(e.spatialReference?[e.spatialReference]:[]);if(0===t.length)return[];const n=this.required.heightModelInfo&&o(e),a=p(e),i=[];for(const r of t){const t=this.getSpatialReferenceSupport(r,e);if(null!=t){const l=t.constraints??[{spatialReference:r,viewingMode:null}];for(const{spatialReference:t,viewingMode:r}of l)if(!this.requiresExtentInSpatialReference||(this.inputSpatialReference?.equals(t)??!0)){const l=n?a??u(e,t):null;i.push(new f(t,l,r))}}}return i}_pickExtentCandidate(e){const t=this.spatialReference;return e.find(({extent:e})=>t.equals(e.spatialReference))||e[0]}_collectLayers(e,t,n=()=>!0){switch(this._loadMaybe(this.map?.())){case"loading":return!0;case"failed":return!1}const a=new h(n,t);for(const i of e)if(this._collectCollection(i,a),a.done||a.preloading===this.sourcePreloadCount)break;return a.updating}_collectCollection(e,t){if(e.layers){switch(this._loadMaybe(e.parent)){case"loading":return t.updating=!0,void++t.preloading;case"failed":return}for(const n of e.layers)if(("graphics"!==n.type||!n.internal)&&t.layerFilter(n)){switch(this._loadMaybe(n)){case"failed":continue;case"loading":t.updating=!0,++t.preloading;break;case"loaded":if(t.updating||(t.done=t.pushLayer(n)),t.done||t.preloading===this.sourcePreloadCount)break;"layers"in n&&this._collectCollection({layers:n.layers},t)}if(t.done||t.preloading===this.sourcePreloadCount)break}}}_loadMaybe(e){return e&&"loadStatus"in e&&null!=e.loadStatus?"not-loaded"===e.loadStatus?(e.load().catch(e=>{r(e)}),"loading"):e.loadStatus:"loaded"}};e([l()],d.prototype,"required",void 0),e([l({constructOnly:!0})],d.prototype,"map",void 0),e([l({constructOnly:!0})],d.prototype,"getSpatialReferenceSupport",void 0),e([l()],d.prototype,"defaultSpatialReference",void 0),e([l()],d.prototype,"inputSpatialReference",void 0),e([l()],d.prototype,"sourcePreloadCount",void 0),e([l()],d.prototype,"priorityCollection",void 0),e([l()],d.prototype,"requiresExtentInSpatialReference",void 0),e([l()],d.prototype,"viewReady",void 0),e([l({readOnly:!0})],d.prototype,"ready",null),e([l({readOnly:!0})],d.prototype,"heightModelInfoReady",null),e([l({readOnly:!0})],d.prototype,"spatialReference",null),e([l({readOnly:!0})],d.prototype,"extent",null),e([l({readOnly:!0})],d.prototype,"heightModelInfo",null),e([l({readOnly:!0})],d.prototype,"combinedHorizontalAndVerticalSpatialReference",null),e([l({readOnly:!0})],d.prototype,"viewingMode",null),e([l({readOnly:!0})],d.prototype,"tileInfo",null),e([l({readOnly:!0})],d.prototype,"mapCollections",null),e([l({readOnly:!0})],d.prototype,"_spatialReferenceTask",null),e([l({readOnly:!0})],d.prototype,"_heightModelInfoTask",null),e([l({readOnly:!0})],d.prototype,"_tileInfoTask",null),e([l({readOnly:!0})],d.prototype,"_extentCandidatesTask",null),e([l()],d.prototype,"_extentTask",null),e([l()],d.prototype,"_projectExtentTask",void 0),d=e([s("esri.views.support.DefaultsFromMap")],d);class f{constructor(e,t,n){this.spatialReference=e,this.heightModelInfo=t,this.viewingMode=n}}class h{constructor(e,t){this.layerFilter=e,this.pushLayer=t,this.preloading=-1,this.updating=!1,this.done=!1}}function g(e,t){return null!=e?null!=t?e===t&&e:e:t}export{d as DefaultsFromMap};
@@ -0,0 +1,8 @@
1
+ import type { AttachmentTypeCategory } from "../../BatchAttributeForm/inputs/types.js";
2
+
3
+ /**
4
+ * @param contentType - Content type of the attachment to test
5
+ * @returns Category of the attachment
6
+ * @internal
7
+ */
8
+ export function getAttachmentTypeCategory(contentType: string | null | undefined): AttachmentTypeCategory;
@@ -13,6 +13,7 @@ export interface BasemapLayerListViewModelEvents extends LayerListViewModelEvent
13
13
  /**
14
14
  * Provides logic for the [BasemapLayerList](https://developers.arcgis.com/javascript/latest/references/core/widgets/BasemapLayerList/) widget and [component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-basemap-layer-list/).
15
15
  *
16
+ * @deprecated since 5.2. Use the [Basemap Layer List (Next)](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-basemap-layer-list-next/) component instead.
16
17
  * @since 4.13
17
18
  * @see [BasemapLayerList](https://developers.arcgis.com/javascript/latest/references/core/widgets/BasemapLayerList/) widget
18
19
  * @see [Basemap Layer List component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-basemap-layer-list/)
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../core/Collection.js";import{EventedAccessor as s}from"../../core/Evented.js";import{watch as i,initial as a}from"../../core/reactiveUtils.js";import{property as r,subclass as l}from"../../core/accessorSupport/decorators.js";import n from"../LayerList/ListItem.js";import{getItemLayers as o,findLayerListMode as m}from"../LayerList/support/layerListUtils.js";const c={view:"view",basemap:"basemap",baseLayers:"base-layers",referenceLayers:"reference-layers",baseLayersListMode:"reference-layers-list-mode",referenceLayersListMode:"base-layers-list-mode",baseLayerViews:"base-layer-views",referenceLayerViews:"reference-layer-views",children:"children"},h="hide",d=t.ofType(n);let y=class extends s{constructor(e){super(e),this.baseItems=new d,this.baseListItemCreatedFunction=null,this.checkPublishStatusEnabled=!1,this.listModeDisabled=!1,this.referenceListItemCreatedFunction=null,this.referenceItems=new d,this.view=null,this._compileBaseList=this._compileBaseList.bind(this),this._compileReferenceList=this._compileReferenceList.bind(this)}initialize(){this.addHandles([i(()=>[this.view?.map?.basemap,!0===this.view?.ready,this.view?.basemapView],()=>this._watchBasemapLayers(),a),i(()=>[this.baseListItemCreatedFunction,this.checkPublishStatusEnabled,this.listModeDisabled],()=>this._baseListItemCreatedFunctionChanged()),i(()=>[this.referenceListItemCreatedFunction,this.checkPublishStatusEnabled,this.listModeDisabled],()=>this._referenceListItemCreatedFunctionChanged())],c.view)}destroy(){this.view=null,this._removeAllBaseItems(),this._removeAllReferenceItems()}get basemapTitle(){return this.view?.map?.basemap?.title??null}set basemapTitle(e){this._override("basemapTitle",e)}get state(){return this.view?.ready?"ready":this.view?"loading":"disabled"}get totalBaseItems(){return this.baseItems.flatten(e=>e.children).length}get totalReferenceItems(){return this.referenceItems.flatten(e=>e.children).length}triggerAction(e,t){e&&!e.disabled&&this.emit("trigger-action",{action:e,item:t})}moveListItem({targetItem:e,fromParentItem:t,toParentItem:s,from:i,to:a,newIndex:r}){const l=e?.layer;if(!l||"subtype-sublayer"===l.type||"sublayer"===l.type)return;const n=this.view?.map?.basemap,m=n?.baseLayers,c=n?.referenceLayers,h=t?o(t):"base"===i?m:c,d=s?o(s):"base"===a?m:c;if(!h||!d)return;const{baseItems:y,referenceItems:p}=this,b="base"===i?y:p,L="base"===a?y:p,f=t?.children||b,I=s?.children||L,u=d.length-r;e.parent=s||null,f.remove(e),h.remove(l),I.includes(e)||I.add(e,u),d.includes(l)||d.add(l,u),this._compileLists()}_createItemChangeHandles({items:e,key:t,callback:s}){this.removeHandles(t),s(),e&&this.addHandles(e.on("change",()=>s()),t)}_createListItem({layer:e,type:t}){const{view:s,baseListItemCreatedFunction:i,referenceListItemCreatedFunction:a,checkPublishStatusEnabled:r,listModeDisabled:l}=this;return new n({layer:e,checkPublishStatusEnabled:r,listItemCreatedFunction:"base"===t?i:a,listModeDisabled:l,view:s})}_watchLayersListMode({layers:e,key:t,callback:s}){this.removeHandles(t),e&&!this.listModeDisabled&&this.addHandles(i(()=>e.filter(e=>"listMode"in e).map(e=>e.listMode).toArray(),()=>s()),t)}_getViewableLayers(e){return e?this.listModeDisabled?e:e.filter(e=>m(e)!==h):void 0}_compileListItems({layers:e,items:t,key:s,type:i,callback:a}){this._watchLayersListMode({layers:e,key:s,callback:a});const r=this._getViewableLayers(e);r?.length?(this._createNewItems({type:i,items:t,layers:r}),this._removeItems({items:t,layers:r}),this._sortItems(t,r)):"base"===i?this._removeAllBaseItems():this._removeAllReferenceItems()}_compileReferenceList(){const{referenceItems:e}=this,t=this.view?.map?.basemap?.referenceLayers;this._compileListItems({type:"reference",layers:t,items:e,key:c.referenceLayersListMode,callback:this._compileReferenceList})}_compileBaseList(){const{baseItems:e}=this,t=this.view?.map?.basemap?.baseLayers;this._compileListItems({type:"base",layers:t,items:e,key:c.baseLayersListMode,callback:this._compileBaseList})}_compileLists(){this._compileReferenceList(),this._compileBaseList()}_createNewItems({items:e,layers:t,type:s}){t?.forEach(t=>{e.some(e=>e.layer===t)||e.add(this._createListItem({type:s,layer:t}))})}_removeItems({items:e,layers:t}){e&&e.forEach(s=>{if(!s)return;const i=t?.some(e=>s.layer===e);i||(this.removeHandles(`${c.children}-${s.uid}`),e.remove(s),s.destroy())})}_sortItems(e,t){e&&t&&e.sort((e,s)=>{const i=t.indexOf(e.layer),a=t.indexOf(s.layer);return i>a?-1:i<a?1:0})}_removeAllBaseItems(){this.baseItems.drain(e=>{this.removeHandles(`${c.children}-${e.uid}`),e.destroy()})}_removeAllReferenceItems(){this.referenceItems.drain(e=>{this.removeHandles(`${c.children}-${e.uid}`),e.destroy()})}_baseListItemCreatedFunctionChanged(){this._removeAllBaseItems(),this._compileLists()}_referenceListItemCreatedFunctionChanged(){this._removeAllReferenceItems(),this._compileLists()}_watchBasemapLayers(){const{view:e}=this;if(this.removeHandles([c.baseLayers,c.referenceLayers,c.basemap,c.baseLayerViews,c.referenceLayerViews]),!e?.ready)return this._removeAllBaseItems(),void this._removeAllReferenceItems();this._compileLists(),this.addHandles([i(()=>this.view?.map?.basemap?.baseLayers,e=>this._createItemChangeHandles({items:e,key:c.baseLayers,callback:this._compileBaseList}),a),i(()=>this.view?.map?.basemap?.referenceLayers,e=>this._createItemChangeHandles({items:e,key:c.referenceLayers,callback:this._compileReferenceList}),a),i(()=>this.view?.basemapView?.baseLayerViews,e=>this._createItemChangeHandles({items:e,key:c.baseLayerViews,callback:this._compileBaseList}),a),i(()=>this.view?.basemapView?.referenceLayerViews,e=>this._createItemChangeHandles({items:e,key:c.referenceLayerViews,callback:this._compileReferenceList}),a)],c.basemap)}};e([r({type:d,readOnly:!0})],y.prototype,"baseItems",void 0),e([r()],y.prototype,"basemapTitle",null),e([r()],y.prototype,"baseListItemCreatedFunction",void 0),e([r()],y.prototype,"checkPublishStatusEnabled",void 0),e([r({nonNullable:!0})],y.prototype,"listModeDisabled",void 0),e([r()],y.prototype,"referenceListItemCreatedFunction",void 0),e([r({type:d,readOnly:!0})],y.prototype,"referenceItems",void 0),e([r({readOnly:!0})],y.prototype,"state",null),e([r()],y.prototype,"totalBaseItems",null),e([r()],y.prototype,"totalReferenceItems",null),e([r()],y.prototype,"view",void 0),y=e([l("esri.widgets.BasemapLayerList.BasemapLayerListViewModel")],y);const p=y;export{p as default};
2
+ import{__decorate as e}from"tslib";import t from"../../core/Collection.js";import{deprecateUnnecessaryViewModel as s}from"../../core/deprecate.js";import{EventedAccessor as i}from"../../core/Evented.js";import a from"../../core/Logger.js";import{watch as r,initial as l}from"../../core/reactiveUtils.js";import{property as n,subclass as o}from"../../core/accessorSupport/decorators.js";import m from"../LayerList/ListItem.js";import{getItemLayers as c,findLayerListMode as h}from"../LayerList/support/layerListUtils.js";const d={view:"view",basemap:"basemap",baseLayers:"base-layers",referenceLayers:"reference-layers",baseLayersListMode:"reference-layers-list-mode",referenceLayersListMode:"base-layers-list-mode",baseLayerViews:"base-layer-views",referenceLayerViews:"reference-layer-views",children:"children"},p="hide",y=t.ofType(m);let b=class extends i{constructor(e){super(e),this.baseItems=new y,this.baseListItemCreatedFunction=null,this.checkPublishStatusEnabled=!1,this.listModeDisabled=!1,this.referenceListItemCreatedFunction=null,this.referenceItems=new y,this.view=null,e?.suppressDeprecationWarning||s(a.getLogger(this),"Basemap Layer List (Next)","arcgis-basemap-layer-list-next",{version:"5.2"}),this._compileBaseList=this._compileBaseList.bind(this),this._compileReferenceList=this._compileReferenceList.bind(this)}normalizeCtorArgs(e){const{suppressDeprecationWarning:t,...s}=e??{};return s}initialize(){this.addHandles([r(()=>[this.view?.map?.basemap,!0===this.view?.ready,this.view?.basemapView],()=>this._watchBasemapLayers(),l),r(()=>[this.baseListItemCreatedFunction,this.checkPublishStatusEnabled,this.listModeDisabled],()=>this._baseListItemCreatedFunctionChanged()),r(()=>[this.referenceListItemCreatedFunction,this.checkPublishStatusEnabled,this.listModeDisabled],()=>this._referenceListItemCreatedFunctionChanged())],d.view)}destroy(){this.view=null,this._removeAllBaseItems(),this._removeAllReferenceItems()}get basemapTitle(){return this.view?.map?.basemap?.title??null}set basemapTitle(e){this._override("basemapTitle",e)}get state(){return this.view?.ready?"ready":this.view?"loading":"disabled"}get totalBaseItems(){return this.baseItems.flatten(e=>e.children).length}get totalReferenceItems(){return this.referenceItems.flatten(e=>e.children).length}triggerAction(e,t){e&&!e.disabled&&this.emit("trigger-action",{action:e,item:t})}moveListItem({targetItem:e,fromParentItem:t,toParentItem:s,from:i,to:a,newIndex:r}){const l=e?.layer;if(!l||"subtype-sublayer"===l.type||"sublayer"===l.type)return;const n=this.view?.map?.basemap,o=n?.baseLayers,m=n?.referenceLayers,h=t?c(t):"base"===i?o:m,d=s?c(s):"base"===a?o:m;if(!h||!d)return;const{baseItems:p,referenceItems:y}=this,b="base"===i?p:y,L="base"===a?p:y,f=t?.children||b,u=s?.children||L,I=d.length-r;e.parent=s||null,f.remove(e),h.remove(l),u.includes(e)||u.add(e,I),d.includes(l)||d.add(l,I),this._compileLists()}_createItemChangeHandles({items:e,key:t,callback:s}){this.removeHandles(t),s(),e&&this.addHandles(e.on("change",()=>s()),t)}_createListItem({layer:e,type:t}){const{view:s,baseListItemCreatedFunction:i,referenceListItemCreatedFunction:a,checkPublishStatusEnabled:r,listModeDisabled:l}=this;return new m({layer:e,checkPublishStatusEnabled:r,listItemCreatedFunction:"base"===t?i:a,listModeDisabled:l,view:s})}_watchLayersListMode({layers:e,key:t,callback:s}){this.removeHandles(t),e&&!this.listModeDisabled&&this.addHandles(r(()=>e.filter(e=>"listMode"in e).map(e=>e.listMode).toArray(),()=>s()),t)}_getViewableLayers(e){return e?this.listModeDisabled?e:e.filter(e=>h(e)!==p):void 0}_compileListItems({layers:e,items:t,key:s,type:i,callback:a}){this._watchLayersListMode({layers:e,key:s,callback:a});const r=this._getViewableLayers(e);r?.length?(this._createNewItems({type:i,items:t,layers:r}),this._removeItems({items:t,layers:r}),this._sortItems(t,r)):"base"===i?this._removeAllBaseItems():this._removeAllReferenceItems()}_compileReferenceList(){const{referenceItems:e}=this,t=this.view?.map?.basemap?.referenceLayers;this._compileListItems({type:"reference",layers:t,items:e,key:d.referenceLayersListMode,callback:this._compileReferenceList})}_compileBaseList(){const{baseItems:e}=this,t=this.view?.map?.basemap?.baseLayers;this._compileListItems({type:"base",layers:t,items:e,key:d.baseLayersListMode,callback:this._compileBaseList})}_compileLists(){this._compileReferenceList(),this._compileBaseList()}_createNewItems({items:e,layers:t,type:s}){t?.forEach(t=>{e.some(e=>e.layer===t)||e.add(this._createListItem({type:s,layer:t}))})}_removeItems({items:e,layers:t}){e&&e.forEach(s=>{if(!s)return;const i=t?.some(e=>s.layer===e);i||(this.removeHandles(`${d.children}-${s.uid}`),e.remove(s),s.destroy())})}_sortItems(e,t){e&&t&&e.sort((e,s)=>{const i=t.indexOf(e.layer),a=t.indexOf(s.layer);return i>a?-1:i<a?1:0})}_removeAllBaseItems(){this.baseItems.drain(e=>{this.removeHandles(`${d.children}-${e.uid}`),e.destroy()})}_removeAllReferenceItems(){this.referenceItems.drain(e=>{this.removeHandles(`${d.children}-${e.uid}`),e.destroy()})}_baseListItemCreatedFunctionChanged(){this._removeAllBaseItems(),this._compileLists()}_referenceListItemCreatedFunctionChanged(){this._removeAllReferenceItems(),this._compileLists()}_watchBasemapLayers(){const{view:e}=this;if(this.removeHandles([d.baseLayers,d.referenceLayers,d.basemap,d.baseLayerViews,d.referenceLayerViews]),!e?.ready)return this._removeAllBaseItems(),void this._removeAllReferenceItems();this._compileLists(),this.addHandles([r(()=>this.view?.map?.basemap?.baseLayers,e=>this._createItemChangeHandles({items:e,key:d.baseLayers,callback:this._compileBaseList}),l),r(()=>this.view?.map?.basemap?.referenceLayers,e=>this._createItemChangeHandles({items:e,key:d.referenceLayers,callback:this._compileReferenceList}),l),r(()=>this.view?.basemapView?.baseLayerViews,e=>this._createItemChangeHandles({items:e,key:d.baseLayerViews,callback:this._compileBaseList}),l),r(()=>this.view?.basemapView?.referenceLayerViews,e=>this._createItemChangeHandles({items:e,key:d.referenceLayerViews,callback:this._compileReferenceList}),l)],d.basemap)}};e([n({type:y,readOnly:!0})],b.prototype,"baseItems",void 0),e([n()],b.prototype,"basemapTitle",null),e([n()],b.prototype,"baseListItemCreatedFunction",void 0),e([n()],b.prototype,"checkPublishStatusEnabled",void 0),e([n({nonNullable:!0})],b.prototype,"listModeDisabled",void 0),e([n()],b.prototype,"referenceListItemCreatedFunction",void 0),e([n({type:y,readOnly:!0})],b.prototype,"referenceItems",void 0),e([n({readOnly:!0})],b.prototype,"state",null),e([n()],b.prototype,"totalBaseItems",null),e([n()],b.prototype,"totalReferenceItems",null),e([n()],b.prototype,"view",void 0),b=e([o("esri.widgets.BasemapLayerList.BasemapLayerListViewModel")],b);const L=b;export{L as default};
@@ -1,12 +1,16 @@
1
1
  import type Accessor from "../../core/Accessor.js";
2
2
 
3
- /** @since 5.0 */
3
+ /**
4
+ * @deprecated since 5.2. Use the [Basemap Layer List (Next)](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-basemap-layer-list-next/) component instead.
5
+ * @since 5.0
6
+ */
4
7
  export interface BasemapLayerListVisibleElementsProperties extends Partial<Pick<BasemapLayerListVisibleElements, "baseLayers" | "closeButton" | "collapseButton" | "editTitleButton" | "errors" | "filter" | "flow" | "heading" | "referenceLayers" | "statusIndicators" | "temporaryLayerIndicators">> {}
5
8
 
6
9
  /**
7
10
  * The visible elements that are displayed within the basemap layer list.
8
11
  * This provides the ability to turn on/off individual elements of the basemap layer list.
9
12
  *
13
+ * @deprecated since 5.2. Use the [Basemap Layer List (Next)](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-basemap-layer-list-next/) component instead.
10
14
  * @since 5.0
11
15
  */
12
16
  export default class BasemapLayerListVisibleElements extends Accessor {
@@ -1,7 +1,20 @@
1
+ /**
2
+ * Types for the BasemapLayerList widget.
3
+ *
4
+ * @deprecated since 5.2. Use the [Basemap Layer List (Next)](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-basemap-layer-list-next/) component instead.
5
+ */
6
+
1
7
  /**
2
8
  * Describes the current state of the list items in the [BasemapLayerListViewModel](https://developers.arcgis.com/javascript/latest/references/core/widgets/BasemapLayerList/BasemapLayerListViewModel/).
3
9
  *
10
+ * @deprecated since 5.2. Use the [Basemap Layer List (Next)](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-basemap-layer-list-next/) component instead.
4
11
  * @since 5.0
5
- * @see [BasemapLayerListViewModel.state](https://developers.arcgis.com/javascript/latest/references/core/widgets/BasemapLayerList/BasemapLayerListViewModel/#state)
6
12
  */
7
- export type BasemapLayerListState = "ready" | "loading" | "disabled";
13
+ export type BasemapLayerListState = "ready" | "loading" | "disabled";
14
+
15
+ /**
16
+ * Defines whether an item is a base layer or a reference layer in the basemap.
17
+ *
18
+ * @deprecated since 5.2. Use the [Basemap Layer List (Next)](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-basemap-layer-list-next/) component instead.
19
+ */
20
+ export type BasemapItemType = "reference" | "base";
@@ -80,7 +80,7 @@ export interface BasemapLayerListEvents extends BasemapLayerListViewModelEvents
80
80
  * [Sample - LayerList widget](https://developers.arcgis.com/javascript/latest/sample-code/widgets-layerlist/)\
81
81
  * [Sample - LayerList widget with actions](https://developers.arcgis.com/javascript/latest/sample-code/widgets-layerlist-actions/)
82
82
  *
83
- * @deprecated since version 5.0. Use the [Basemap Layer List](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-basemap-layer-list/) component instead. For information on widget deprecation, read about [Esri's move to web components](https://developers.arcgis.com/javascript/latest/components-transition-plan/).
83
+ * @deprecated since version 5.0. Use the [Basemap Layer List (Next)](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-basemap-layer-list-next/) component instead. For information on widget deprecation, read about [Esri's move to web components](https://developers.arcgis.com/javascript/latest/components-transition-plan/).
84
84
  * @since 4.13
85
85
  * @see [BasemapLayerListViewModel](https://developers.arcgis.com/javascript/latest/references/core/widgets/BasemapLayerList/BasemapLayerListViewModel/)
86
86
  * @example