@vertigis/arcgis-extensions 49.8.1 → 50.0.0

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 (368) hide show
  1. package/AppConfig.schema.json +23 -6
  2. package/Hyperlink.d.ts +3 -1
  3. package/Hyperlink.js +1 -1
  4. package/data/ArcGISServiceTableExtension.js +1 -1
  5. package/data/Feature.d.ts +1 -3
  6. package/data/Feature.js +1 -1
  7. package/data/FeatureSet.d.ts +40 -2
  8. package/data/FeatureSet.js +1 -1
  9. package/data/FeatureSettings.js +1 -1
  10. package/data/FeatureSourceBase.d.ts +22 -27
  11. package/data/FeatureSourceBase.js +1 -1
  12. package/data/FieldExtension.d.ts +0 -3
  13. package/data/FieldExtension.js +1 -1
  14. package/data/PopupContentExtension.js +1 -1
  15. package/data/Schema.js +1 -1
  16. package/data/_Relationship.d.ts +1 -2
  17. package/data/_TableExtension.d.ts +1 -1
  18. package/data/_TableExtension.js +1 -1
  19. package/docs/html/assets/highlight.css +38 -10
  20. package/docs/html/assets/navigation.js +1 -1
  21. package/docs/html/assets/search.js +1 -1
  22. package/docs/html/classes/Entity.EntityBase.html +12 -74
  23. package/docs/html/classes/Hyperlink.Hyperlink.html +10 -72
  24. package/docs/html/classes/LanguageResources.LanguageResources.html +36 -30
  25. package/docs/html/classes/data_ArcGISServiceTableExtension.ArcGISServiceTableExtension.html +35 -97
  26. package/docs/html/classes/data_Attachment.Attachment.html +12 -74
  27. package/docs/html/classes/data_Feature.Feature.html +16 -76
  28. package/docs/html/classes/data_FeatureList.FeatureList.html +73 -17
  29. package/docs/html/classes/data_FeatureSet.FeatureSet.html +39 -33
  30. package/docs/html/classes/data_FeatureSettings.FeatureSettings.html +11 -71
  31. package/docs/html/classes/data_FeatureSourceBase.FeatureSourceBase.html +35 -98
  32. package/docs/html/classes/data_FeatureSourceBase.RelationshipCollection.html +72 -16
  33. package/docs/html/classes/data_FeatureStream.FeatureStream.html +13 -75
  34. package/docs/html/classes/data_FieldExtension.FieldExtension.html +13 -75
  35. package/docs/html/classes/data_PopupContentExtension.PopupContentExtension.html +13 -75
  36. package/docs/html/classes/data_RelationshipBase.RelationshipBase.html +37 -31
  37. package/docs/html/classes/data_Schema.Schema.html +13 -73
  38. package/docs/html/classes/data_TaskSettings.TaskSettings.html +12 -72
  39. package/docs/html/classes/data__TableExtension.TableExtension.html +34 -96
  40. package/docs/html/classes/data__TableExtension.TableFeatureSettings.html +11 -71
  41. package/docs/html/classes/data__TableExtension.TableSchema.html +15 -75
  42. package/docs/html/classes/layer_preset_LayerPreset.LayerPreset.html +14 -76
  43. package/docs/html/classes/layer_preset_LayerPresetSettings.LayerPresetSetting.html +36 -30
  44. package/docs/html/classes/mapping_ArcGISSublayerExtension.ArcGISSublayerExtension.html +35 -97
  45. package/docs/html/classes/mapping_ArcGISSublayerExtension.ArcGISSublayerRelationshipCollection.html +72 -16
  46. package/docs/html/classes/mapping_BasemapExtension.BasemapExtension.html +14 -76
  47. package/docs/html/classes/mapping_Bookmark.Bookmark.html +12 -74
  48. package/docs/html/classes/mapping_BuildingComponentSublayerExtension.BuildingComponentSublayerExtension.html +35 -97
  49. package/docs/html/classes/mapping_BuildingComponentSublayerExtension.BuildingComponentSublayerSchema.html +13 -73
  50. package/docs/html/classes/mapping_BuildingGroupSublayerExtension.BuildingGroupSublayerExtension.html +35 -97
  51. package/docs/html/classes/mapping_BuildingGroupSublayerExtension.BuildingGroupSublayerSchema.html +13 -73
  52. package/docs/html/classes/mapping_BuildingSceneLayerExtension.BuildingSceneLayerExtension.html +35 -97
  53. package/docs/html/classes/mapping_BuildingSceneLayerExtension.BuildingSceneLayerReadOnlySchema.html +13 -73
  54. package/docs/html/classes/mapping_BuildingSublayerExtension.BuildingSublayerExtension.html +35 -97
  55. package/docs/html/classes/mapping_BuildingSublayerExtension.BuildingSublayerFeatureSettings.html +11 -53
  56. package/docs/html/classes/mapping_BuildingSublayerExtension.BuildingSublayerSchema.html +13 -73
  57. package/docs/html/classes/mapping_CSVLayerExtension.CSVLayerExtension.html +35 -97
  58. package/docs/html/classes/mapping_ElevationLayerExtension.ElevationLayerExtension.html +35 -97
  59. package/docs/html/classes/mapping_FeatureCollectionLayerExtension.FeatureCollectionLayerExtension.html +35 -97
  60. package/docs/html/classes/mapping_FeatureLayerExtension.FeatureLayerExtension.html +35 -97
  61. package/docs/html/classes/mapping_FeatureLayerExtensionBase.FeatureLayerExtensionBase.html +35 -97
  62. package/docs/html/classes/mapping_FeatureLayerExtensionBase.FeatureLayerReadOnlySchema.html +13 -73
  63. package/docs/html/classes/mapping_FeatureLayerExtensionBase.FeatureLayerSchema.html +13 -73
  64. package/docs/html/classes/mapping_GeoJSONLayerExtension.GeoJSONLayerExtension.html +35 -97
  65. package/docs/html/classes/mapping_GeoRSSLayerExtension.GeoRSSLayerExtension.html +35 -97
  66. package/docs/html/classes/mapping_GraphicsLayerExtension.GraphicsLayerExtension.html +35 -97
  67. package/docs/html/classes/mapping_GroundExtension.GroundExtension.html +13 -75
  68. package/docs/html/classes/mapping_GroupLayerExtension.GroupLayerExtension.html +35 -97
  69. package/docs/html/classes/mapping_GroupLayerExtension.GroupLayerExtensionCollection.html +74 -23
  70. package/docs/html/classes/mapping_ImageryLayerExtension.ImageryLayerExtension.html +35 -97
  71. package/docs/html/classes/mapping_ImageryTileLayerExtension.ImageryTileLayerExtension.html +35 -97
  72. package/docs/html/classes/mapping_IntegratedMeshLayerExtension.IntegratedMeshLayerExtension.html +35 -97
  73. package/docs/html/classes/mapping_KMLLayerExtension.KMLLayerExtension.html +35 -97
  74. package/docs/html/classes/mapping_KMLSublayerExtension.KMLSublayerExtension.html +35 -97
  75. package/docs/html/classes/mapping_MapConstraints.MapConstraints.html +12 -72
  76. package/docs/html/classes/mapping_MapExtension.MapExtension.html +13 -75
  77. package/docs/html/classes/mapping_MapImageLayerExtension.MapImageLayerExtension.html +35 -97
  78. package/docs/html/classes/mapping_MapImageSublayerExtension.MapImageSublayerExtension.html +35 -97
  79. package/docs/html/classes/mapping_MapNotesLayerExtension.MapNotesLayerExtension.html +35 -97
  80. package/docs/html/classes/mapping_MapNotesSublayerExtension.MapNotesSublayerExtension.html +35 -97
  81. package/docs/html/classes/mapping_MapNotesSublayerExtension.MapNotesSublayerExtensionSchema.html +13 -73
  82. package/docs/html/classes/mapping_MediaLayerExtension.MediaLayerExtension.html +35 -97
  83. package/docs/html/classes/mapping_OpenStreetMapLayerExtension.OpenStreetMapLayerExtension.html +35 -97
  84. package/docs/html/classes/mapping_PointCloudLayerExtension.PointCloudLayerExtension.html +35 -97
  85. package/docs/html/classes/mapping_RouteLayerExtension.RouteLayerExtension.html +35 -97
  86. package/docs/html/classes/mapping_RouteLayerExtension.RouteLayerExtensionSchema.html +13 -73
  87. package/docs/html/classes/mapping_SceneLayerExtension.SceneLayerExtension.html +35 -97
  88. package/docs/html/classes/mapping_StreamLayerExtension.StreamLayerExtension.html +35 -97
  89. package/docs/html/classes/mapping_StreamLayerExtension.StreamLayerSchema.html +13 -73
  90. package/docs/html/classes/mapping_SubtypeGroupLayerExtension.SubtypeGroupLayerExtension.html +35 -97
  91. package/docs/html/classes/mapping_SubtypeGroupLayerExtension.SubtypeGroupLayerRelationshipCollection.html +72 -16
  92. package/docs/html/classes/mapping_SubtypeGroupLayerExtension.SubtypeGroupLayerSchema.html +13 -73
  93. package/docs/html/classes/mapping_SubtypeSublayerExtension.SubtypeSublayerExtension.html +35 -97
  94. package/docs/html/classes/mapping_SubtypeSublayerExtension.SubtypeSublayerRelationshipCollection.html +72 -16
  95. package/docs/html/classes/mapping_SubtypeSublayerExtension.SubtypeSublayerSchema.html +13 -73
  96. package/docs/html/classes/mapping_TileLayerExtension.TileLayerExtension.html +35 -97
  97. package/docs/html/classes/mapping_TileSublayerExtension.TileSublayerExtension.html +35 -97
  98. package/docs/html/classes/mapping_UnsupportedLayerExtension.UnsupportedLayerExtension.html +35 -97
  99. package/docs/html/classes/mapping_VectorTileLayerExtension.VectorTileLayerExtension.html +35 -97
  100. package/docs/html/classes/mapping_WFSLayerExtension.WFSLayerExtension.html +35 -97
  101. package/docs/html/classes/mapping_WMSLayerExtension.WMSLayerExtension.html +35 -97
  102. package/docs/html/classes/mapping_WMSSublayerExtension.WMSSublayerExtension.html +35 -97
  103. package/docs/html/classes/mapping_WMTSLayerExtension.WMTSLayerExtension.html +35 -97
  104. package/docs/html/classes/mapping_WebTileLayerExtension.WebTileLayerExtension.html +35 -97
  105. package/docs/html/classes/mapping__LayerExtension.LayerExtension.html +35 -97
  106. package/docs/html/classes/mapping__LayerExtension.LayerExtensionReadOnlySchema.html +13 -73
  107. package/docs/html/classes/mapping__LayerExtension.LayerExtensionSchema.html +13 -73
  108. package/docs/html/classes/mapping__LayerExtensionCollectionImpl.LayerExtensionCollectionImpl.html +74 -23
  109. package/docs/html/classes/mapping__SublayerExtension.SubSublayerExtensionCollection.html +74 -23
  110. package/docs/html/classes/mapping__SublayerExtension.SublayerExtension.html +35 -97
  111. package/docs/html/classes/mapping__SublayerExtension.SublayerSchema.html +13 -73
  112. package/docs/html/classes/mapping_support_ArrayWrappedCollection.ArrayWrappedCollection.html +72 -16
  113. package/docs/html/classes/mapping_support_LayerListSettings.ExtensionBaseLayerListSettings.html +9 -71
  114. package/docs/html/classes/mapping_support_LayerListSettings.LayerListSettings.html +10 -72
  115. package/docs/html/classes/mapping_support__LayerExtensionCollection.LayerExtensionCollectionBase.html +77 -26
  116. package/docs/html/classes/mapping_support__SublayerExtensionCollection.SublayerExtensionCollectionBase.html +77 -26
  117. package/docs/html/classes/menus_Menu.Menu.html +13 -75
  118. package/docs/html/classes/menus_MenuItem.MenuItem.html +13 -75
  119. package/docs/html/classes/support_FormatSettings.FormatSettings.html +12 -72
  120. package/docs/html/classes/support_InitializableBase.InitializableBase.html +21 -83
  121. package/docs/html/classes/support_InitializableCollectionProxy.InitializableCollectionProxy.html +73 -17
  122. package/docs/html/classes/support_Observable.Observable.html +27 -26
  123. package/docs/html/classes/support_ReadOnlyInitializableCollection.ReadOnlyInitializableCollection.html +73 -17
  124. package/docs/html/classes/support_Serializable.SerializableBase.html +38 -32
  125. package/docs/html/classes/support_Settings.Settings.html +15 -75
  126. package/docs/html/classes/support__ArcGISRelationshipCollection.ArcGISRelationshipCollection.html +72 -16
  127. package/docs/html/classes/support_observableUtils.ObservableMixin.html +3 -0
  128. package/docs/html/classes/tasks_geocoding_ArcGISGeocoder.ArcGISGeocoder.html +35 -97
  129. package/docs/html/classes/tasks_geocoding_Geocoder.Geocoder.html +33 -95
  130. package/docs/html/classes/tasks_identify_IdentifyService.IdentifyService.html +11 -73
  131. package/docs/html/classes/tasks_query_ArcGISRelationship.ArcGISRelationship.html +36 -30
  132. package/docs/html/classes/tasks_query_QueryBasedRelationship.QueryBasedRelationship.html +36 -30
  133. package/docs/html/classes/tasks_query_QueryService.QueryService.html +11 -73
  134. package/docs/html/classes/tasks_search_SearchService.SearchService.html +12 -74
  135. package/docs/html/classes/utilities_CaseInsensitiveObservableMap.CaseInsensitiveObservableMap.html +24 -27
  136. package/docs/html/classes/utilities_CollectionProxy.CollectionProxy.html +73 -17
  137. package/docs/html/classes/utilities_CopyOnWriteCollection.CopyOnWriteCollection.html +72 -16
  138. package/docs/html/classes/utilities_MapTransformCollection.MapTransformCollection.html +72 -16
  139. package/docs/html/classes/utilities_ObservableMap.ObservableMap.html +26 -32
  140. package/docs/html/classes/utilities_ObservableSet.ObservableSet.html +38 -32
  141. package/docs/html/classes/utilities_ObservableWeakSet.ObservableWeakSet.html +44 -42
  142. package/docs/html/classes/utilities_ReadOnlyCollection.ReadOnlyCollection.html +72 -16
  143. package/docs/html/classes/utilities_ReadOnlyMap.ReadOnlyMap.html +23 -29
  144. package/docs/html/classes/utilities_format_date.DateFormatter.html +37 -31
  145. package/docs/html/classes/utilities_format_number.NumberFormatter.html +37 -31
  146. package/docs/html/classes/utilities_format_time.TimeFormatter.html +37 -31
  147. package/docs/html/functions/support_Observable.deprecatedGetPropertyPath.html +7 -0
  148. package/docs/html/functions/support_Observable.deprecatedNotifyChange.html +5 -0
  149. package/docs/html/functions/support_Observable.deprecatedSet.html +9 -0
  150. package/docs/html/functions/support_Observable.deprecatedWatch.html +9 -0
  151. package/docs/html/functions/support_Observable.deprecatedWatchProperty.html +14 -0
  152. package/docs/html/functions/support_Observable.getPropertyByPath.html +3 -2
  153. package/docs/html/functions/support_observableUtils.createIHandle.html +8 -0
  154. package/docs/html/functions/support_observableUtils.notifyChange.html +8 -0
  155. package/docs/html/functions/support_observableUtils.observable-1.html +31 -0
  156. package/docs/html/functions/support_observableUtils.onWatch.html +14 -0
  157. package/docs/html/functions/support_observableUtils.once.html +11 -0
  158. package/docs/html/functions/support_observableUtils.watch.html +24 -0
  159. package/docs/html/functions/support_observableUtils.watchEach.html +33 -0
  160. package/docs/html/functions/support_observableUtils.watchEvent.html +12 -0
  161. package/docs/html/functions/support_observableUtils.when.html +9 -0
  162. package/docs/html/functions/support_observableUtils.whenOnce.html +9 -0
  163. package/docs/html/functions/utilities__layer_preset.createFlattenedLayerXList.html +5 -0
  164. package/docs/html/functions/utilities__layer_preset.createRef.html +5 -0
  165. package/docs/html/functions/utilities__layer_preset.getBackingLayer.html +6 -0
  166. package/docs/html/functions/utilities__layer_preset.isIterable.html +4 -0
  167. package/docs/html/functions/utilities__layer_preset.isLayerRefEqual.html +5 -0
  168. package/docs/html/functions/utilities__layer_preset.isSublayerRefEqual.html +7 -0
  169. package/docs/html/functions/utilities__layer_preset.toMapExtension.html +4 -0
  170. package/docs/html/functions/utilities_checkArg.checkArg.html +1 -1
  171. package/docs/html/functions/utilities_watch.onCollectionPropertyChange.html +6 -1
  172. package/docs/html/functions/utilities_watch.watchCollectionPropertyEach.html +5 -4
  173. package/docs/html/functions/utilities_watch.watchEach.html +8 -6
  174. package/docs/html/hierarchy.html +1 -1
  175. package/docs/html/interfaces/data_ArcGISServiceTableExtension.ArcGISServiceTableExtensionProperties.html +1 -1
  176. package/docs/html/interfaces/data_Feature.PresentableAttributes.html +24 -30
  177. package/docs/html/interfaces/data_Schema.SchemaProperties.html +2 -2
  178. package/docs/html/interfaces/data__Relationship.Relationship-1.html +35 -29
  179. package/docs/html/interfaces/data__TableExtension.TableExtensionProperties.html +1 -1
  180. package/docs/html/interfaces/json_AnnotationLayerJson.AnnotationLayerJson.html +2 -2
  181. package/docs/html/interfaces/json_BasemapLayerJson.BasemapLayerJsonBase.html +2 -2
  182. package/docs/html/interfaces/json_BingLayerJson.BingLayerJson.html +2 -2
  183. package/docs/html/interfaces/json_BuildingSceneLayerJson.BuildingSceneLayerJson.html +2 -2
  184. package/docs/html/interfaces/json_CSVLayerJson.CSVLayerJson.html +2 -2
  185. package/docs/html/interfaces/json_FeatureLayerJson.FeatureLayerJson.html +2 -2
  186. package/docs/html/interfaces/json_GeoJSONLayerJson.GeoJSONLayerJson.html +2 -2
  187. package/docs/html/interfaces/json_GeoRSSLayerJson.GeoRSSLayerJson.html +2 -2
  188. package/docs/html/interfaces/json_GroupLayerJson.GroupLayerJson.html +2 -2
  189. package/docs/html/interfaces/json_ImageServiceLayerJson.ImageServiceLayerJson.html +2 -2
  190. package/docs/html/interfaces/json_ImageServiceVectorLayerJson.ImageServiceVectorLayerJson.html +2 -2
  191. package/docs/html/interfaces/json_IntegratedMeshLayerJson.IntegratedMeshLayerJson.html +2 -2
  192. package/docs/html/interfaces/json_ItemJson.ItemJson.html +2 -2
  193. package/docs/html/interfaces/json_KMLLayerJson.KMLLayerJson.html +2 -2
  194. package/docs/html/interfaces/json_LayerJson.LayerJsonBase.html +2 -2
  195. package/docs/html/interfaces/json_MapServiceLayerJson.MapServiceLayerJson.html +2 -2
  196. package/docs/html/interfaces/json_MediaLayerJson.MediaLayerJson.html +2 -2
  197. package/docs/html/interfaces/json_OpenStreetMapLayerJson.OpenStreetMapLayerJson.html +2 -2
  198. package/docs/html/interfaces/json_OperationalLayerJson.OperationalLayerJsonBase.html +2 -2
  199. package/docs/html/interfaces/json_PointCloudLayerJson.PointCloudLayerJson.html +2 -2
  200. package/docs/html/interfaces/json_RasterDataElevationLayerJson.RasterDataElevationLayerJson.html +2 -2
  201. package/docs/html/interfaces/json_SceneLayerJson.SceneLayerJson.html +2 -2
  202. package/docs/html/interfaces/json_StreamLayerJson.StreamLayerJson.html +2 -2
  203. package/docs/html/interfaces/json_SubtypeGroupLayerJson.SubtypeGroupLayerJson.html +2 -2
  204. package/docs/html/interfaces/json_SubtypeGroupLayerJson.SubtypeSubtypeGroupLayerJson.html +2 -2
  205. package/docs/html/interfaces/json_SubtypeSublayerJson.SubtypeSublayerJson.html +2 -2
  206. package/docs/html/interfaces/json_TiledElevationServiceLayerJson.TiledElevationServiceLayerJson.html +2 -2
  207. package/docs/html/interfaces/json_TiledImageServiceLayerJson.TiledImageServiceLayerJson.html +2 -2
  208. package/docs/html/interfaces/json_TiledMapServiceLayerJson.TiledMapServiceLayerJson.html +2 -2
  209. package/docs/html/interfaces/json_VectorTileLayerJson.VectorTileLayerJson.html +2 -2
  210. package/docs/html/interfaces/json_WFSLayerJson.WFSLayerJson.html +2 -2
  211. package/docs/html/interfaces/json_WMSLayerJson.WMSLayerJson.html +2 -2
  212. package/docs/html/interfaces/json_WebTileLayerJson.WebTileLayerJson.html +2 -2
  213. package/docs/html/interfaces/mapping_ArcGISSublayerExtension.ArcGISSublayerExtensionProperties.html +1 -1
  214. package/docs/html/interfaces/mapping_BuildingComponentSublayerExtension.BuildingComponentSublayerExtensionProperties.html +1 -1
  215. package/docs/html/interfaces/mapping_BuildingGroupSublayerExtension.BuildingGroupSublayerExtensionProperties.html +1 -1
  216. package/docs/html/interfaces/mapping_BuildingSceneLayerExtension.BuildingSceneLayerExtensionProperties.html +1 -1
  217. package/docs/html/interfaces/mapping_BuildingSceneLayerExtension.BuildingSceneLayerProperties.html +2 -2
  218. package/docs/html/interfaces/mapping_BuildingSublayerExtension.BuildingSublayerExtensionProperties.html +1 -1
  219. package/docs/html/interfaces/mapping_CSVLayerExtension.CSVLayerExtensionProperties.html +1 -1
  220. package/docs/html/interfaces/mapping_ElevationLayerExtension.ElevationLayerExtensionProperties.html +1 -1
  221. package/docs/html/interfaces/mapping_FeatureLayerExtension.FeatureLayerExtensionProperties.html +1 -1
  222. package/docs/html/interfaces/mapping_FeatureLayerExtension.FeatureLayerProperties.html +2 -2
  223. package/docs/html/interfaces/mapping_FeatureLayerExtensionBase.FeatureLayerBaseProperties.html +2 -2
  224. package/docs/html/interfaces/mapping_FeatureLayerExtensionBase.FeatureLayerExtensionBaseProperties.html +1 -1
  225. package/docs/html/interfaces/mapping_GeoJSONLayerExtension.GeoJSONLayerExtensionProperties.html +1 -1
  226. package/docs/html/interfaces/mapping_GeoRSSLayerExtension.GeoRSSLayerExtensionProperties.html +1 -1
  227. package/docs/html/interfaces/mapping_GraphicsLayerExtension.GraphicsLayerExtensionProperties.html +1 -1
  228. package/docs/html/interfaces/mapping_GroupLayerExtension.GroupLayerExtensionProperties.html +1 -1
  229. package/docs/html/interfaces/mapping_ImageryLayerExtension.ImageryLayerExtensionProperties.html +1 -1
  230. package/docs/html/interfaces/mapping_ImageryTileLayerExtension.ImageryTileLayerExtensionProperties.html +1 -1
  231. package/docs/html/interfaces/mapping_IntegratedMeshLayerExtension.IntegratedMeshLayerExtensionProperties.html +1 -1
  232. package/docs/html/interfaces/mapping_KMLLayerExtension.KMLLayerExtensionProperties.html +1 -1
  233. package/docs/html/interfaces/mapping_KMLSublayerExtension.KMLSublayerExtensionProperties.html +1 -1
  234. package/docs/html/interfaces/mapping_MapExtension.MapExtensionProperties.html +3 -3
  235. package/docs/html/interfaces/mapping_MapImageLayerExtension.MapImageLayerExtensionProperties.html +4 -4
  236. package/docs/html/interfaces/mapping_MapImageSublayerExtension.MapImageSublayerExtensionProperties.html +1 -1
  237. package/docs/html/interfaces/mapping_MapNotesLayerExtension.MapNotesLayerExtensionProperties.html +1 -1
  238. package/docs/html/interfaces/mapping_MapNotesSublayerExtension.MapNotesSublayerExtensionProperties.html +1 -1
  239. package/docs/html/interfaces/mapping_MediaLayerExtension.MediaLayerExtensionProperties.html +1 -1
  240. package/docs/html/interfaces/mapping_OpenStreetMapLayerExtension.OpenStreetMapLayerExtensionProperties.html +1 -1
  241. package/docs/html/interfaces/mapping_PointCloudLayerExtension.PointCloudLayerExtensionProperties.html +1 -1
  242. package/docs/html/interfaces/mapping_PointCloudLayerExtension.PointCloudLayerProperties.html +2 -2
  243. package/docs/html/interfaces/mapping_RouteLayerExtension.RouteLayerExtensionProperties.html +1 -1
  244. package/docs/html/interfaces/mapping_SceneLayerExtension.SceneLayerExtensionProperties.html +1 -1
  245. package/docs/html/interfaces/mapping_StreamLayerExtension.StreamLayerExtensionProperties.html +1 -1
  246. package/docs/html/interfaces/mapping_SubtypeGroupLayerExtension.SubtypeGroupLayerExtensionProperties.html +1 -1
  247. package/docs/html/interfaces/mapping_SubtypeSublayerExtension.SubtypeSublayerExtensionProperties.html +1 -1
  248. package/docs/html/interfaces/mapping_TileLayerExtension.TileLayerExtensionProperties.html +1 -1
  249. package/docs/html/interfaces/mapping_TileSublayerExtension.TileSublayerExtensionProperties.html +1 -1
  250. package/docs/html/interfaces/mapping_VectorTileLayerExtension.VectorTileLayerExtensionProperties.html +1 -1
  251. package/docs/html/interfaces/mapping_WFSLayerExtension.WFSLayerExtensionProperties.html +1 -1
  252. package/docs/html/interfaces/mapping_WMSLayerExtension.WMSLayerExtensionProperties.html +1 -1
  253. package/docs/html/interfaces/mapping_WMSSublayerExtension.WMSSublayerExtensionProperties.html +1 -1
  254. package/docs/html/interfaces/mapping_WMTSLayerExtension.WMTSLayerExtensionProperties.html +1 -1
  255. package/docs/html/interfaces/mapping_WebTileLayerExtension.WebTileLayerExtensionProperties.html +1 -1
  256. package/docs/html/interfaces/mapping__LayerExtension.LayerExtensionProperties.html +1 -1
  257. package/docs/html/interfaces/mapping__SublayerExtension.SublayerExtensionProperties.html +1 -1
  258. package/docs/html/interfaces/mapping_support_ArrayWrappedCollection.ArrayWrappedCollectionProperties.html +3 -3
  259. package/docs/html/interfaces/support_InitializableBase.Initializable.html +1 -1
  260. package/docs/html/interfaces/support_Observable.IDeprecatedObservable.html +57 -0
  261. package/docs/html/interfaces/support_Serializable.Serializable.html +60 -5
  262. package/docs/html/interfaces/support_esri.SublayerLike.html +2 -29
  263. package/docs/html/interfaces/support_observableUtils.IHandle.html +9 -0
  264. package/docs/html/interfaces/support_observableUtils.WatchEachOptions.html +29 -0
  265. package/docs/html/interfaces/support_observableUtils.WatchOptions.html +26 -0
  266. package/docs/html/interfaces/utilities_collection.AfterItemChangeEvent.html +4 -0
  267. package/docs/html/modules/support_Observable.html +8 -2
  268. package/docs/html/modules/support_esri.html +4 -3
  269. package/docs/html/modules/support_observableUtils.html +20 -0
  270. package/docs/html/modules/utilities_ObservableWeakSet.html +1 -1
  271. package/docs/html/modules/utilities__layer_preset.html +8 -0
  272. package/docs/html/modules/utilities_collection.html +1 -0
  273. package/docs/html/modules/utilities_layer_preset.html +7 -0
  274. package/docs/html/modules/utilities_layers.html +3 -2
  275. package/docs/html/modules/utilities_watch.html +4 -4
  276. package/docs/html/modules.html +3 -0
  277. package/docs/html/types/support_esri.CollectionAfterEvent.html +1 -0
  278. package/docs/html/types/support_esri.CollectionAfterItemEvent.html +1 -1
  279. package/docs/html/types/support_esri.CollectionEvent.html +1 -0
  280. package/docs/html/types/support_esri.CollectionItemEvent.html +1 -0
  281. package/docs/html/types/support_observableUtils.Observable.html +5 -0
  282. package/docs/html/types/support_observableUtils.ObservablePropertyPath.html +9 -0
  283. package/docs/html/types/support_observableUtils.TargetTypeFromPath.html +14 -0
  284. package/docs/html/types/support_observableUtils.ValueTypeFromPath.html +14 -0
  285. package/docs/html/types/support_observableUtils.WhenOptions.html +7 -0
  286. package/docs/html/types/utilities_watch.WatchCallback.html +3 -0
  287. package/docs/html/variables/version.version.html +1 -1
  288. package/layer-preset/LayerPreset.d.ts +1 -1
  289. package/layer-preset/LayerPreset.js +1 -1
  290. package/mapping/ArcGISSublayerExtension.js +1 -1
  291. package/mapping/BasemapExtension.d.ts +1 -1
  292. package/mapping/BasemapExtension.js +1 -1
  293. package/mapping/BuildingComponentSublayerExtension.js +1 -1
  294. package/mapping/CSVLayerExtension.js +1 -1
  295. package/mapping/FeatureLayerExtension.js +1 -1
  296. package/mapping/FeatureLayerExtensionBase.js +1 -1
  297. package/mapping/GeoJSONLayerExtension.js +1 -1
  298. package/mapping/GeoRSSLayerExtension.js +1 -1
  299. package/mapping/GraphicsLayerExtension.js +1 -1
  300. package/mapping/GroundExtension.js +1 -1
  301. package/mapping/GroupLayerExtension.js +1 -1
  302. package/mapping/ImageryLayerExtension.js +1 -1
  303. package/mapping/KMLLayerExtension.js +1 -1
  304. package/mapping/MapExtension.d.ts +1 -1
  305. package/mapping/MapExtension.js +1 -1
  306. package/mapping/MapNotesSublayerExtension.js +1 -1
  307. package/mapping/PointCloudLayerExtension.js +1 -1
  308. package/mapping/RouteLayerExtension.js +1 -1
  309. package/mapping/SceneLayerExtension.js +1 -1
  310. package/mapping/StreamLayerExtension.js +1 -1
  311. package/mapping/SubtypeGroupLayerExtension.js +1 -1
  312. package/mapping/SubtypeSublayerExtension.js +1 -1
  313. package/mapping/WFSLayerExtension.js +1 -1
  314. package/mapping/WMTSLayerExtension.js +1 -1
  315. package/mapping/_LayerExtension.js +1 -1
  316. package/mapping/_SublayerExtension.d.ts +1 -1
  317. package/mapping/_SublayerExtension.js +1 -1
  318. package/mapping/support/ArrayWrappedCollection.d.ts +3 -3
  319. package/mapping/support/ArrayWrappedCollection.js +1 -1
  320. package/mapping/support/LayerListSettings.d.ts +3 -1
  321. package/mapping/support/LayerListSettings.js +1 -1
  322. package/mapping/support/PopupTemplateFeatureSettings.js +1 -1
  323. package/mapping/support/_LayerExtensionCollection.d.ts +19 -4
  324. package/mapping/support/_LayerExtensionCollection.js +1 -1
  325. package/mapping/support/_SublayerExtensionCollection.d.ts +19 -4
  326. package/mapping/support/_SublayerExtensionCollection.js +1 -1
  327. package/package.json +1 -1
  328. package/portal/BuildingSceneLayer.js +1 -1
  329. package/portal/SubtypeGroupLayer.js +1 -1
  330. package/portal/WMSLayer.js +1 -1
  331. package/support/InitializableBase.d.ts +12 -3
  332. package/support/InitializableBase.js +1 -1
  333. package/support/InitializeError.js +1 -1
  334. package/support/Observable.d.ts +164 -14
  335. package/support/Observable.js +1 -1
  336. package/support/Serializable.d.ts +40 -3
  337. package/support/Serializable.js +1 -1
  338. package/support/Settings.d.ts +6 -7
  339. package/support/Settings.js +1 -1
  340. package/support/esri.d.ts +6 -52
  341. package/support/observableUtils.d.ts +560 -0
  342. package/support/observableUtils.js +1 -0
  343. package/tasks/geocoding/ArcGISGeocoder.js +1 -1
  344. package/tasks/query/ClientSideQueryProvider.js +1 -1
  345. package/utilities/CollectionProxy.d.ts +54 -23
  346. package/utilities/CollectionProxy.js +1 -1
  347. package/utilities/MapTransformCollection.js +1 -1
  348. package/utilities/ObservableMap.d.ts +35 -4
  349. package/utilities/ObservableMap.js +1 -1
  350. package/utilities/ObservableSet.d.ts +44 -3
  351. package/utilities/ObservableSet.js +1 -1
  352. package/utilities/ObservableWeakSet.d.ts +3 -0
  353. package/utilities/ReadOnlyMap.d.ts +15 -2
  354. package/utilities/ReadOnlyMap.js +1 -1
  355. package/utilities/_layer-preset.d.ts +65 -0
  356. package/utilities/_layer-preset.js +1 -0
  357. package/utilities/collection.d.ts +9 -0
  358. package/utilities/collection.js +1 -1
  359. package/utilities/layer-preset.d.ts +1 -0
  360. package/utilities/layer-preset.js +1 -0
  361. package/utilities/layers.d.ts +1 -1
  362. package/utilities/layers.js +1 -1
  363. package/utilities/watch.d.ts +25 -7
  364. package/utilities/watch.js +1 -1
  365. package/version.d.ts +1 -1
  366. package/version.js +1 -1
  367. package/docs/html/interfaces/support_esri.AccessorLike.html +0 -29
  368. package/docs/html/types/support_esri.WatchCallback.html +0 -3
@@ -1 +1 @@
1
- import{__decorate as e}from"tslib";import{InvalidOperationError as t}from"../InvalidOperationError.js";import{isSublayerExtension as i,ItemType as s}from"../ItemType.js";import{FeatureSourceBase as r}from"../data/FeatureSourceBase.js";import{Schema as a}from"../data/Schema.js";import{serializable as n}from"../support/Serializable.js";import{isBuildingComponentSublayer as l,isBuildingGroupSublayer as o,isKMLSublayer as u,isMapImageSublayer as y,isMapNotesSublayer as h,isSubtypeSublayer as b,isTileLayer as f,isWMSSublayer as p,isWMTSSublayer as S}from"../utilities/_layers.js";import{checkArg as d}from"../utilities/checkArg.js";import{compare as c}from"../utilities/collection.js";import{load as _}from"../utilities/esri.js";import{parse as g}from"../utilities/format/number.js";import{getLogger as x}from"../utilities/log.js";import{deepClone as E,objectKeys as v}from"../utilities/object.js";import{onCollectionPropertyChange as m,watchCollectionPropertyEach as w}from"../utilities/watch.js";import{fromLayerListMode as M,LayerListSettings as C}from"./support/LayerListSettings.js";import{SublayerExtensionCollectionBase as P}from"./support/_SublayerExtensionCollection.js";const V=x("SublayerExtension"),z="Invalid type of sublayer for this type of sublayer extension.",$="This type of layer does not have features.",A="This type of sublayer extension cannot have child sublayer extensions.",F=Object.freeze({supportsAdd:!1,supportsUpdate:!1,supportsDelete:!1,supportsEditing:!1,supportsQuery:!1,supportsAttachmentEditing:!1,supportsStandardizedQueries:!1});export function getSublayerType(e){if(y(e))return f(e?.layer)?"ArcGISTiledSublayer":"ArcGISMapServiceSublayer";if(u(e))return"KMLSublayer";if(S(e))return"WMTSSublayer";if(p(e))return"WMSSublayer";if(l(e))return"BuildingComponentSublayer";if(o(e))return"BuildingGroupSublayer";if(b(e))return"SubtypeSublayer";if(h(e))return"MapNotesSublayer";throw new Error(`Unknown sublayer type for sublayer: "${e?.title}"`)}export class SublayerExtension extends r{static factory;get sublayer(){return this._sublayer}get layerExtension(){return this._layerExtension}get parentSublayerExtension(){return this._parentSublayerExtension}get hasFeatures(){return!1}get sublayerExtensions(){return this._sublayerExtensions}get renderer(){}layerListSettings;get visibilityMode(){return this.canToggleVisibility?this._visibilityMode:"inherited"}set visibilityMode(e){d("visibilityMode",e).satisfies((e=>this.canToggleVisibility||"inherited"===e),'Sublayers of this type only support a visibility mode of "inherited".'),this._visibilityMode=e,"exclusive"===e&&this._ensureAtMostOneChildSublayerVisible()}get capabilities(){return this._capabilities()}get effectiveMinScale(){const e=this.sublayer?this.sublayer.minScale:0;if(this.parentSublayerExtension){const t=this.parentSublayerExtension.effectiveMinScale||1/0;if(t<(e||1/0))return t}if(this.layerExtension){const t=this.layerExtension.effectiveMinScale||1/0;if(t<(e||1/0))return t}return e}get effectiveMaxScale(){const e=this.sublayer?this.sublayer.maxScale:0;return this.parentSublayerExtension&&this.parentSublayerExtension.effectiveMaxScale>e?this.parentSublayerExtension.effectiveMaxScale:this.layerExtension&&this.layerExtension.effectiveMaxScale>e?this.layerExtension.effectiveMaxScale:e}get isEffectivelyVisible(){const e=!!this.sublayer&&this.sublayer.visible;return this.parentSublayerExtension?this.parentSublayerExtension.isEffectivelyVisible&&e:this.layerExtension?this.layerExtension.isEffectivelyVisible&&e:e}get title(){return this.sublayer?.title??("string"==typeof this._deferredSublayerProperties?.$ref||"number"==typeof this._deferredSublayerProperties?.$ref?this._deferredSublayerProperties?.$ref.toString():this._deferredSublayerProperties?.$ref?.title??this._deferredSublayerProperties?.$ref?.id.toString())??"Sublayer"}get supportsSublayers(){return!1}get canToggleVisibility(){return!0}get canChangeOpacity(){return!0}get canChangeScale(){return!0}get canChangeRenderer(){return!1}get canChangeLabels(){return!1}get canChangeDefinitionExpression(){return!1}get _layerSupportsHideChildren(){return!1}get _sublayerId(){return this.sublayer?.id??("number"==typeof this._deferredSublayerProperties?.$ref?this._deferredSublayerProperties?.$ref:this._deferredSublayerProperties?.$ref?.id)}get _sublayers(){if(this.supportsSublayers)return this.sublayer?.sublayers}get effectiveFullExtent(){return this._effectiveFullExtent?this._effectiveFullExtent:this.parentSublayerExtension?this.parentSublayerExtension.effectiveFullExtent:this.layerExtension?this.layerExtension.effectiveFullExtent:void 0}get initialDefinitionExpression(){return this._initialDefinitionExpression}get initialRenderer(){return this._initialRenderer}get initialVisibility(){return this._initialVisibility??this.sublayer?.visible??!1}_effectiveFullExtent;_itemType=s.SUBLAYER_EXTENSION;_watchHandles=[];_sublayerExtensions;_layerExtension;_parentSublayerExtension;_initialDefinitionExpression;_initialRenderer;_initialVisibility;_sublayer;_visibilityMode;_deferredSublayerProperties;_originalRef;constructor(e){super(e);const t=e||{};this._visibilityMode=this.canToggleVisibility?"independent":"inherited",this._sublayerExtensions=this._createSublayerExtensionCollection();const i=t.sublayer;let s;i?.hasOwnProperty("listMode")&&(s=M(i.listMode)),this.layerListSettings=this._createLayerListSettings({...s,...t.layerListSettings}),T(i)?(d("properties.sublayer",i).satisfies((e=>this._isSupportedSublayer(e)),z),this._setSublayer(i)):i&&(this._deferredSublayerProperties=i),this.watch("parentSublayerExtension.isEffectivelyVisible",(()=>this.notifyChange("isEffectivelyVisible")))}static create(e){if(!SublayerExtension.factory)throw new t("Cannot create sublayer extension: no sublayer extension factory has been registered.");return SublayerExtension.factory.create(e)}static _matchesRef(e,t,i){if(!e||!t)return!1;let s=t.$ref;if("string"==typeof s){const e=g(s);s={id:isNaN(e)?s:e,title:s}}else"number"==typeof s&&(s={id:s});const r=b(e)?e.subtypeCode:e.id;return"both"===i?r===s.id&&e.title===s.title:"by-id"===i?r===s.id:"by-title"===i&&e.title===s.title}getFeatures(e,i){if(!this.hasFeatures)throw new t($);return super.getFeatures(e,i)}getFullExtent(){return this.effectiveFullExtent}async addFeatures(e,i){if(d("features",e).isNotMissing(),!this.hasFeatures)throw new t($);await super.addFeatures(e,i)}async updateFeatures(e,i){if(d("features",e).isNotMissing(),!this.hasFeatures)throw new t($);await super.updateFeatures(e,i)}async deleteFeatures(e,i){if(d("features",e).isNotMissing(),!this.hasFeatures)throw new t($);await super.deleteFeatures(e,i)}_resolveSublayer(){if(this._sublayer||!this._deferredSublayerProperties||!this.layerExtension?.layer||!this.layerExtension.layer.sublayers)return;const e=e=>t=>SublayerExtension._matchesRef(t,this._deferredSublayerProperties,e),t=this.layerExtension.layer.sublayers.flatten((e=>e.sublayers));let i=t.find(e("both"));if(i||(i=t.find(e("by-title"))),i||(i=t.find(e("by-id"))),i&&this._isSupportedSublayer(i)){this._setSublayer(i);const e={sublayer:{title:this.title,...this._deferredSublayerProperties}};this.assignProperties(e),this._originalRef=this._deferredSublayerProperties.$ref,this._deferredSublayerProperties=void 0}}_setLayerExtension(e){const t=this.layerExtension;this._layerExtension=e,this.layerExtension&&(this.layerExtension.watch("effectiveMinScale",(()=>this.notifyChange("effectiveMinScale"))),this.layerExtension.watch("effectiveMaxScale",(()=>this.notifyChange("effectiveMaxScale"))),this.layerExtension.watch("isEffectivelyVisible",(()=>this.notifyChange("isEffectivelyVisible")))),this._parentSublayerExtension||(t&&(this.featureSettings.formatSettings.parent===t.featureSettings.formatSettings&&(this.featureSettings.formatSettings.parent=void 0),this.taskSettings.parent===t.taskSettings&&(this.taskSettings.parent=void 0)),e&&(this.featureSettings.formatSettings.parent||(this.featureSettings.formatSettings.parent=e.featureSettings.formatSettings),this.taskSettings.parent||(this.taskSettings.parent=e.taskSettings))),this._resolveSublayer(),this.notifyChange("layerExtension"),this.supportsSublayers&&this._sublayerExtensions.onLayerExtensionChanged()}_setParentSublayerExtension(e){const t=this._parentSublayerExtension;this._parentSublayerExtension=e,this.parentSublayerExtension&&(this.parentSublayerExtension.watch("effectiveMinScale",(()=>this.notifyChange("effectiveMinScale"))),this.parentSublayerExtension.watch("effectiveMaxScale",(()=>this.notifyChange("effectiveMaxScale")))),t&&(this.featureSettings.formatSettings.parent===t.featureSettings.formatSettings&&(this.featureSettings.formatSettings.parent=this.layerExtension?this.layerExtension.featureSettings.formatSettings:void 0),this.taskSettings.parent===t.taskSettings&&(this.taskSettings.parent=this.layerExtension?this.layerExtension.taskSettings:void 0)),e&&((!this.featureSettings.formatSettings.parent||this.layerExtension&&this.featureSettings.formatSettings.parent===this.layerExtension.featureSettings.formatSettings)&&(this.featureSettings.formatSettings.parent=e.featureSettings.formatSettings),(!this.taskSettings.parent||this.layerExtension&&this.taskSettings.parent===this.layerExtension.taskSettings)&&(this.taskSettings.parent=e.taskSettings)),this._resolveSublayer(),this.notifyChange("parentSublayerExtension")}async _switchSublayer(e){if(e===this.sublayer)return;d("newSublayer",e).isNotMissing().satisfies((e=>e.id===this.sublayer.id),"Sublayer ID must match existing sublayer.").satisfies((e=>this._isSupportedSublayer(e)),z),this.isInitialized&&await _(e);const t=new Map;if(this.sublayer?.sublayers)for(const e of this.sublayer.sublayers.toArray())t.set(e.id,this.sublayerExtensions.forSublayer(e));this.canToggleVisibility&&(e.visible=this.sublayer.visible),this.canChangeOpacity&&(e.opacity=this.sublayer.opacity),this._setSublayer(e);const i=[];if(this.supportsSublayers&&this.sublayer.sublayers){const e=this.sublayer.sublayers.filter((e=>t.has(e.id))).toArray();i.push(...e.map((async e=>{const i=t.get(e.id);await i._switchSublayer(e),this._sublayerExtensions._register(i)})))}this.isInitialized&&i.push(this._initializeChildren()),await Promise.all(i)}async _postInitialize(){await super._postInitialize(),this.supportsSublayers&&this._watchHandles.push(m(this,"sublayer.sublayers",(async e=>{const t=(e.added??[]).map((e=>this.sublayerExtensions.forSublayer(e)));await Promise.all(t.map(this._onSublayerAddedPostInitialize))})))}_onSublayerAddedPostInitialize=async e=>{try{await e.initialize()}catch(t){V.error({message:`Error occurred while initializing sublayer extension for sublayer '${e.title??e.sublayer.id??e.id}'.`,error:t})}};async _onDestroy(){this._watchHandles.forEach((e=>e?.remove())),await Promise.all(this.sublayerExtensions.toArray().map((e=>e.destroy()))),await super._onDestroy()}_getSerializableProperties(){return{...super._getSerializableProperties(),visibilityMode:{serializeModes:["initial"],default:this.canToggleVisibility?"independent":"inherited"},layerListSettings:"initial",sublayerExtensions:{serializeModes:["initial","project"],serialize:()=>this.sublayerExtensions.map((e=>e.toItemUri())).toArray(),deserialize:e=>{_assignSublayerExtensions(this.sublayerExtensions,e,(e=>this._createSublayerExtension(e)))}},sublayer:{serializeModes:["initial","project"],serialize:()=>{if(this.sublayer){if(!this._layerExtension)return this._serializeSublayer(this._sublayer);{const e=getSublayerType(this._sublayer);if(this._originalRef)return{$ref:this._originalRef,$sublayerType:e};if(this._sublayer.title||this._sublayer.id)return{...this._createSublayerRef(),$sublayerType:e}}}else if(this._deferredSublayerProperties)return E(this._deferredSublayerProperties)},deserialize:e=>{if(T(e)){if(e!==this.sublayer)throw new Error("Property 'sublayer' is read-only.")}else{if(this._sublayer)return this._applySublayerProperties(e,this._sublayer);this._deferredSublayerProperties&&(this._deferredSublayerProperties={...this._deferredSublayerProperties,...e})}}},requestHelper:{serialize:!1}}}_createSublayerExtension(e){throw new t(A)}_createSchema(){return new R(this)}_createLayerListSettings(e){return new C(e)}_capabilities(){return F}async _onInitialize(){if(await super._onInitialize(),this._sublayer||this._deferredSublayerProperties?.$ref||(this._setSublayer(await this._createSublayer(this._deferredSublayerProperties)),this._deferredSublayerProperties=void 0),this._resolveSublayer(),!this._sublayer){const e=this._deferredSublayerProperties?.$ref;if(!this._layerExtension)throw new t("Cannot resolve sublayer reference: missing parent layer extension.");throw new t(`No sublayer found matching reference "${"string"==typeof e?e:JSON.stringify(e)}".`)}this._initialDefinitionExpression="definitionExpression"in this.sublayer?this.sublayer.definitionExpression:void 0,this._initialRenderer=this.renderer?.clone(),this._initialVisibility=this.sublayer.visible,this.supportsSublayers&&this._sublayerExtensions.onParentInitialized()}*_initializableChildCollections(){yield*super._initializableChildCollections(),yield this.sublayerExtensions}_createSublayerRef(){return{$ref:{id:b(this._sublayer)?this._sublayer.subtypeCode:this._sublayer.id,title:this._sublayer.title}}}_createSublayerExtensionCollection(){return new SubSublayerExtensionCollection(this)}_watchSublayerProperties(){this._watchHandles.push(this.sublayer.watch("minScale",(()=>this.notifyChange("effectiveMinScale")),!0),this.sublayer.watch("maxScale",(()=>this.notifyChange("effectiveMaxScale")),!0))}_setSublayer(e){this._sublayer=e,this._watchHandles.push(e.watch("visible",(()=>{this._onSetSublayerVisible(e.visible),this.layerExtension?.mapExtension?.emit("layer-visibility-change",e)}),!0)),this.supportsSublayers&&this._watchHandles.push(m(e,"sublayers",this._onSublayersChange,!0),w(e,"sublayers","visible",this._onSetSublayersSublayerVisible,!0)),this._onSetSublayerVisible(this.sublayer.visible),"exclusive"===this.visibilityMode&&this._ensureAtMostOneChildSublayerVisible(),this._watchSublayerProperties(),this.notifyChange("sublayer"),this.notifyChange("title"),this.notifyChange("effectiveMinScale"),this.notifyChange("effectiveMaxScale"),this.notifyChange("isEffectivelyVisible")}_onSetSublayerVisible=e=>{if("inherited"===this.visibilityMode&&this.supportsSublayers&&this.sublayerExtensions)for(const t of this.sublayerExtensions.toArray())t.sublayer&&t.canToggleVisibility&&(t.sublayer.visible=e);this.notifyChange("isEffectivelyVisible")};_onSetSublayersSublayerVisible=(e,t,i,s)=>{e&&"exclusive"===this.visibilityMode&&this._ensureAChildSublayerVisible(s)};_onSublayersChange=e=>{e.added?.length&&"exclusive"===this.visibilityMode&&this._ensureAChildSublayerVisible(e.added[e.added.length-1])};_ensureAChildSublayerVisible(e){for(const t of this._sublayers.toArray())t!==e&&(t.visible=!1)}_ensureAtMostOneChildSublayerVisible(){this.sublayer&&this._sublayers&&this._ensureAChildSublayerVisible(this._sublayers.find((e=>e.visible)))}}let R=class extends a{_sublayerExtension;_sublayerBindings=new Map;constructor(e){super(),this._sublayerExtension=e,this._bindSettingsToSublayerProperties()}get spatialReference(){if(this._sublayerExtension.layerExtension)return this._sublayerExtension.layerExtension.schema.spatialReference}set spatialReference(e){throw new t("Cannot set sublayer schema spatial reference.")}_getPropertyBindings(){return{}}_bindSettingsToSublayerProperties(){const e=this._getPropertyBindings();for(const t of v(e)){let i=e[t];"string"==typeof i&&(i={property:i}),this._sublayerBindings.set(t,i),i.hasOwnProperty("value")||this._sublayerExtension.watch(`sublayer.${i.property}`,(()=>this.notifyChange(t)),!i.hasOwnProperty("sync")||i.sync)}}};R=e([n],R);export{R as SublayerSchema};export class SubSublayerExtensionCollection extends P{get _layerExtension(){return this._parent.layerExtension}constructor(e,t){super(e,t??"sublayer.sublayers")}add(e,i){if(d("sublayerX",e).isNotMissing(),!this._parent.supportsSublayers)throw new t(A);return e.sublayer&&this._parent.sublayer&&!this._parent.sublayer.sublayers&&(this._parent.sublayer.sublayers=[]),e.parentSublayerExtension&&e.parentSublayerExtension.sublayerExtensions.remove(e),super.add(e,i)}_onAdded(e){super._onAdded(e),e._setParentSublayerExtension(this._parent)}_onRemoved(e){super._onRemoved(e),e._setParentSublayerExtension(void 0)}}export function _assignSublayerExtensions(e,t,s){c(e,t,{onNew:(t,r)=>{try{e.add(i(t)?t:s(t),j(t)?void 0:r)}catch(e){V.warn({message:`Error occurred while adding sublayer extension for sublayer '${t.title??t.sublayer?.id??t.id}'.`,error:e})}},onMatch:(t,s,r,a)=>{try{i(s)||t.assignProperties(s),r===a||j(s)||e.reorder(t,a)}catch(e){V.warn({message:`Error occurred while assigning sublayer extension properties for sublayer '${t.title??t.sublayer?.id??t.id}'.`,error:e})}},equals:(e,t)=>{const s=SublayerExtension._matchesRef(e.sublayer,t.sublayer,"both");return i(t)?e===t||s:s||e.id===t.id}})}function T(e){return e&&"function"==typeof e.set}function j(e){return i(e)?!!e._deferredSublayerProperties?.$ref:!T(e.sublayer)&&!!e.sublayer?.$ref}
1
+ import{__decorate as e}from"tslib";import t from"@arcgis/core/core/Collection";import{InvalidOperationError as i}from"../InvalidOperationError.js";import{isSublayerExtension as s,ItemType as r}from"../ItemType.js";import{FeatureSourceBase as a}from"../data/FeatureSourceBase.js";import{Schema as n}from"../data/Schema.js";import{serializable as l}from"../support/Serializable.js";import{notifyChange as o,onWatch as u,watch as y,watchEach as h}from"../support/observableUtils.js";import{isBuildingComponentSublayer as b,isBuildingGroupSublayer as f,isKMLSublayer as p,isMapImageSublayer as c,isMapNotesSublayer as S,isSubtypeSublayer as d,isTileLayer as _,isWMSSublayer as g,isWMTSSublayer as x}from"../utilities/_layers.js";import{checkArg as E}from"../utilities/checkArg.js";import{compare as v}from"../utilities/collection.js";import{load as m}from"../utilities/esri.js";import{parse as w}from"../utilities/format/number.js";import{getLogger as M}from"../utilities/log.js";import{deepClone as P,objectKeys as C}from"../utilities/object.js";import{onCollectionPropertyChange as V}from"../utilities/watch.js";import{fromLayerListMode as z,LayerListSettings as $}from"./support/LayerListSettings.js";import{SublayerExtensionCollectionBase as A}from"./support/_SublayerExtensionCollection.js";const F=M("SublayerExtension"),j="Invalid type of sublayer for this type of sublayer extension.",R="This type of layer does not have features.",T="This type of sublayer extension cannot have child sublayer extensions.",I=Object.freeze({supportsAdd:!1,supportsUpdate:!1,supportsDelete:!1,supportsEditing:!1,supportsQuery:!1,supportsAttachmentEditing:!1,supportsStandardizedQueries:!1});export function getSublayerType(e){if(c(e))return _(e?.layer)?"ArcGISTiledSublayer":"ArcGISMapServiceSublayer";if(p(e))return"KMLSublayer";if(x(e))return"WMTSSublayer";if(g(e))return"WMSSublayer";if(b(e))return"BuildingComponentSublayer";if(f(e))return"BuildingGroupSublayer";if(d(e))return"SubtypeSublayer";if(S(e))return"MapNotesSublayer";throw new Error(`Unknown sublayer type for sublayer: "${e?.title}"`)}export class SublayerExtension extends a{static factory;get sublayer(){return this._sublayer}get layerExtension(){return this._layerExtension}get parentSublayerExtension(){return this._parentSublayerExtension}get hasFeatures(){return!1}get sublayerExtensions(){return this._sublayerExtensions}get renderer(){}layerListSettings;get visibilityMode(){return this.canToggleVisibility?this._visibilityMode:"inherited"}set visibilityMode(e){E("visibilityMode",e).satisfies((e=>this.canToggleVisibility||"inherited"===e),'Sublayers of this type only support a visibility mode of "inherited".'),this._visibilityMode=e,"exclusive"===e&&this._ensureAtMostOneChildSublayerVisible()}get capabilities(){return this._capabilities()}get effectiveMinScale(){const e=this.sublayer?this.sublayer.minScale:0;if(this.parentSublayerExtension){const t=this.parentSublayerExtension.effectiveMinScale||1/0;if(t<(e||1/0))return t}if(this.layerExtension){const t=this.layerExtension.effectiveMinScale||1/0;if(t<(e||1/0))return t}return e}get effectiveMaxScale(){const e=this.sublayer?this.sublayer.maxScale:0;return this.parentSublayerExtension&&this.parentSublayerExtension.effectiveMaxScale>e?this.parentSublayerExtension.effectiveMaxScale:this.layerExtension&&this.layerExtension.effectiveMaxScale>e?this.layerExtension.effectiveMaxScale:e}get isEffectivelyVisible(){const e=!!this.sublayer&&this.sublayer.visible;return this.parentSublayerExtension?this.parentSublayerExtension.isEffectivelyVisible&&e:this.layerExtension?this.layerExtension.isEffectivelyVisible&&e:e}get title(){return this.sublayer?.title??("string"==typeof this._deferredSublayerProperties?.$ref||"number"==typeof this._deferredSublayerProperties?.$ref?this._deferredSublayerProperties?.$ref.toString():this._deferredSublayerProperties?.$ref?.title??this._deferredSublayerProperties?.$ref?.id.toString())??"Sublayer"}get supportsSublayers(){return!1}get canToggleVisibility(){return!0}get canChangeOpacity(){return!0}get canChangeScale(){return!0}get canChangeRenderer(){return!1}get canChangeLabels(){return!1}get canChangeDefinitionExpression(){return!1}get _layerSupportsHideChildren(){return!1}get _sublayerId(){return this.sublayer?.id??("number"==typeof this._deferredSublayerProperties?.$ref?this._deferredSublayerProperties?.$ref:this._deferredSublayerProperties?.$ref?.id)}get _sublayers(){if(this.supportsSublayers)return this.sublayer?.sublayers}get effectiveFullExtent(){return this._effectiveFullExtent?this._effectiveFullExtent:this.parentSublayerExtension?this.parentSublayerExtension.effectiveFullExtent:this.layerExtension?this.layerExtension.effectiveFullExtent:void 0}get initialDefinitionExpression(){return this._initialDefinitionExpression}get initialRenderer(){return this._initialRenderer}get initialVisibility(){return this._initialVisibility??this.sublayer?.visible??!1}_effectiveFullExtent;_itemType=r.SUBLAYER_EXTENSION;_watchHandles=[];_sublayerExtensions;_layerExtension;_parentSublayerExtension;_initialDefinitionExpression;_initialRenderer;_initialVisibility;_sublayer;_visibilityMode;_deferredSublayerProperties;_originalRef;constructor(e){super(e);const t=e||{};this._visibilityMode=this.canToggleVisibility?"independent":"inherited",this._sublayerExtensions=this._createSublayerExtensionCollection();const i=t.sublayer;let s;i?.hasOwnProperty("listMode")&&(s=z(i.listMode)),this.layerListSettings=this._createLayerListSettings({...s,...t.layerListSettings}),L(i)?(E("properties.sublayer",i).satisfies((e=>this._isSupportedSublayer(e)),j),this._setSublayer(i)):i&&(this._deferredSublayerProperties=i),u(this,"isEffectivelyVisible",(()=>y(this,"parentSublayerExtension.isEffectivelyVisible",(()=>o(this,"isEffectivelyVisible")),{sync:!0})))}static create(e){if(!SublayerExtension.factory)throw new i("Cannot create sublayer extension: no sublayer extension factory has been registered.");return SublayerExtension.factory.create(e)}static _matchesRef(e,t,i){if(!e||!t)return!1;let s=t.$ref;if("string"==typeof s){const e=w(s);s={id:isNaN(e)?s:e,title:s}}else"number"==typeof s&&(s={id:s});const r=d(e)?e.subtypeCode:e.id;return"both"===i?r===s.id&&e.title===s.title:"by-id"===i?r===s.id:"by-title"===i&&e.title===s.title}getFeatures(e,t){if(!this.hasFeatures)throw new i(R);return super.getFeatures(e,t)}getFullExtent(){return this.effectiveFullExtent}async addFeatures(e,t){if(E("features",e).isNotMissing(),!this.hasFeatures)throw new i(R);await super.addFeatures(e,t)}async updateFeatures(e,t){if(E("features",e).isNotMissing(),!this.hasFeatures)throw new i(R);await super.updateFeatures(e,t)}async deleteFeatures(e,t){if(E("features",e).isNotMissing(),!this.hasFeatures)throw new i(R);await super.deleteFeatures(e,t)}_resolveSublayer(){if(this._sublayer||!this._deferredSublayerProperties||!this.layerExtension?.layer||!this.layerExtension.layer.sublayers)return;const e=e=>t=>SublayerExtension._matchesRef(t,this._deferredSublayerProperties,e),t=this.layerExtension.layer.sublayers.flatten((e=>e.sublayers));let i=t.find(e("both"));if(i||(i=t.find(e("by-title"))),i||(i=t.find(e("by-id"))),i&&this._isSupportedSublayer(i)){this._setSublayer(i);const e={sublayer:{title:this.title,...this._deferredSublayerProperties}};this.assignProperties(e),this._originalRef=this._deferredSublayerProperties.$ref,this._deferredSublayerProperties=void 0}}_setLayerExtension(e){const t=this.layerExtension;this._layerExtension=e,this.layerExtension&&(u(this,"effectiveMinScale",(()=>y(this.layerExtension,"effectiveMinScale",(()=>o(this,"effectiveMinScale")),{sync:!0}))),u(this,"effectiveMaxScale",(()=>y(this.layerExtension,"effectiveMaxScale",(()=>o(this,"effectiveMaxScale")),{sync:!0}))),u(this,"isEffectivelyVisible",(()=>y(this.layerExtension,"isEffectivelyVisible",(()=>o(this,"isEffectivelyVisible")),{sync:!0})))),this._parentSublayerExtension||(t&&(this.featureSettings.formatSettings.parent===t.featureSettings.formatSettings&&(this.featureSettings.formatSettings.parent=void 0),this.taskSettings.parent===t.taskSettings&&(this.taskSettings.parent=void 0)),e&&(this.featureSettings.formatSettings.parent||(this.featureSettings.formatSettings.parent=e.featureSettings.formatSettings),this.taskSettings.parent||(this.taskSettings.parent=e.taskSettings))),this._resolveSublayer(),o(this,"layerExtension"),this.supportsSublayers&&this._sublayerExtensions.onLayerExtensionChanged()}_setParentSublayerExtension(e){if(this._parentSublayerExtension===e)return;const t=this._parentSublayerExtension;this._parentSublayerExtension=e,this.parentSublayerExtension&&(u(this,"effectiveMinScale",(()=>y(this.parentSublayerExtension,"effectiveMinScale",(()=>o(this,"effectiveMinScale")),{sync:!0}))),u(this,"effectiveMaxScale",(()=>y(this.parentSublayerExtension,"effectiveMaxScale",(()=>o(this,"effectiveMaxScale")),{sync:!0})))),t&&(this.featureSettings.formatSettings.parent===t.featureSettings.formatSettings&&(this.featureSettings.formatSettings.parent=this.layerExtension?this.layerExtension.featureSettings.formatSettings:void 0),this.taskSettings.parent===t.taskSettings&&(this.taskSettings.parent=this.layerExtension?this.layerExtension.taskSettings:void 0)),e&&((!this.featureSettings.formatSettings.parent||this.layerExtension&&this.featureSettings.formatSettings.parent===this.layerExtension.featureSettings.formatSettings)&&(this.featureSettings.formatSettings.parent=e.featureSettings.formatSettings),(!this.taskSettings.parent||this.layerExtension&&this.taskSettings.parent===this.layerExtension.taskSettings)&&(this.taskSettings.parent=e.taskSettings)),this._resolveSublayer(),o(this,"parentSublayerExtension")}async _switchSublayer(e){if(e===this.sublayer)return;E("newSublayer",e).isNotMissing().satisfies((e=>e.id===this.sublayer.id),"Sublayer ID must match existing sublayer.").satisfies((e=>this._isSupportedSublayer(e)),j),this.isInitialized&&await m(e);const t=new Map;if(this.sublayer?.sublayers)for(const e of this.sublayer.sublayers.toArray())t.set(e.id,this.sublayerExtensions.forSublayer(e));this.canToggleVisibility&&(e.visible=this.sublayer.visible),this.canChangeOpacity&&(e.opacity=this.sublayer.opacity),this._setSublayer(e);const i=[];if(this.supportsSublayers&&this.sublayer.sublayers){const e=this.sublayer.sublayers.filter((e=>t.has(e.id))).toArray();i.push(...e.map((async e=>{const i=t.get(e.id);await i._switchSublayer(e),this._sublayerExtensions._register(i)})))}this.isInitialized&&i.push(this._initializeChildren()),await Promise.all(i)}async _postInitialize(){await super._postInitialize(),this.supportsSublayers&&this._watchHandles.push(V(this,"sublayer.sublayers",(async e=>{const t=(e.added??[]).map((e=>this.sublayerExtensions.forSublayer(e)));await Promise.all(t.map(this._onSublayerAddedPostInitialize))})))}_onSublayerAddedPostInitialize=async e=>{try{await e.initialize()}catch(t){F.error({message:`Error occurred while initializing sublayer extension for sublayer '${e.title??e.sublayer.id??e.id}'.`,error:t})}};async _onDestroy(){this._watchHandles.forEach((e=>e?.remove())),await Promise.all(this.sublayerExtensions.toArray().map((e=>e.destroy()))),await super._onDestroy()}_getSerializableProperties(){return{...super._getSerializableProperties(),visibilityMode:{serializeModes:["initial"],default:this.canToggleVisibility?"independent":"inherited"},layerListSettings:"initial",sublayerExtensions:{serializeModes:["initial","project"],serialize:()=>this.sublayerExtensions.map((e=>e.toItemUri())).toArray(),deserialize:e=>{_assignSublayerExtensions(this.sublayerExtensions,e,(e=>this._createSublayerExtension(e)))}},sublayer:{serializeModes:["initial","project"],serialize:()=>{if(this.sublayer){if(!this._layerExtension)return this._serializeSublayer(this._sublayer);{const e=getSublayerType(this._sublayer);if(this._originalRef)return{$ref:this._originalRef,$sublayerType:e};if(this._sublayer.title||this._sublayer.id)return{...this._createSublayerRef(),$sublayerType:e}}}else if(this._deferredSublayerProperties)return P(this._deferredSublayerProperties)},deserialize:e=>{if(L(e)){if(e!==this.sublayer)throw new Error("Property 'sublayer' is read-only.")}else{if(this._sublayer)return this._applySublayerProperties(e,this._sublayer);this._deferredSublayerProperties&&(this._deferredSublayerProperties={...this._deferredSublayerProperties,...e})}}},requestHelper:{serialize:!1}}}_createSublayerExtension(e){throw new i(T)}_createSchema(){return new k(this)}_createLayerListSettings(e){return new $(e)}_capabilities(){return I}async _onInitialize(){if(await super._onInitialize(),this._sublayer||this._deferredSublayerProperties?.$ref||(this._setSublayer(await this._createSublayer(this._deferredSublayerProperties)),this._deferredSublayerProperties=void 0),this._resolveSublayer(),!this._sublayer){const e=this._deferredSublayerProperties?.$ref;if(!this._layerExtension)throw new i("Cannot resolve sublayer reference: missing parent layer extension.");throw new i(`No sublayer found matching reference "${"string"==typeof e?e:JSON.stringify(e)}".`)}this._initialDefinitionExpression="definitionExpression"in this.sublayer?this.sublayer.definitionExpression:void 0,this._initialRenderer=this.renderer?.clone(),this._initialVisibility=this.sublayer.visible,this.supportsSublayers&&this._sublayerExtensions.onParentInitialized()}*_initializableChildCollections(){yield*super._initializableChildCollections(),yield this.sublayerExtensions}_createSublayerRef(){return{$ref:{id:d(this._sublayer)?this._sublayer.subtypeCode:this._sublayer.id,title:this._sublayer.title}}}_createSublayerExtensionCollection(){return new SubSublayerExtensionCollection(this)}_watchSublayerProperties(){this._watchHandles.push(u(this,"effectiveMinScale",(()=>y(this.sublayer,"minScale",(()=>o(this,"effectiveMinScale")),{sync:!0}))),u(this,"effectiveMaxScale",(()=>y(this.sublayer,"maxScale",(()=>o(this,"effectiveMaxScale")),{sync:!0}))))}_setSublayer(e){this._sublayer=e,this._watchHandles.push(y(e,"visible",((e,t,i)=>{this._onSetSublayerVisible(e),this.layerExtension?.mapExtension?.emit("layer-visibility-change",i)}),{sync:!0})),this.supportsSublayers&&this._watchHandles.push(V(e,"sublayers",this._onSublayersChange,!0),h(e,"sublayers.[].visible",this._onSetSublayersSublayerVisible,{sync:!0})),this._onSetSublayerVisible(this.sublayer.visible),"exclusive"===this.visibilityMode&&this._ensureAtMostOneChildSublayerVisible(),this._watchSublayerProperties(),o(this,"sublayer"),o(this,"title"),o(this,"effectiveMinScale"),o(this,"effectiveMaxScale"),o(this,"isEffectivelyVisible")}_onSetSublayerVisible=e=>{if("inherited"===this.visibilityMode&&this.supportsSublayers&&this.sublayerExtensions)for(const t of this.sublayerExtensions.toArray())t.sublayer&&t.canToggleVisibility&&(t.sublayer.visible=e);o(this,"isEffectivelyVisible")};_onSetSublayersSublayerVisible=(e,t,i)=>{e&&"exclusive"===this.visibilityMode&&this._ensureAChildSublayerVisible(i)};_onSublayersChange=e=>{e.added?.length&&"exclusive"===this.visibilityMode&&this._ensureAChildSublayerVisible(e.added[e.added.length-1])};_ensureAChildSublayerVisible(e){for(const t of this._sublayers.toArray())t!==e&&(t.visible=!1)}_ensureAtMostOneChildSublayerVisible(){this.sublayer&&this._sublayers&&this._ensureAChildSublayerVisible(this._sublayers.find((e=>e.visible)))}}let k=class extends n{_sublayerExtension;_sublayerBindings=new Map;constructor(e){super(),this._sublayerExtension=e,this._bindSettingsToSublayerProperties()}get spatialReference(){if(this._sublayerExtension.layerExtension)return this._sublayerExtension.layerExtension.schema.spatialReference}set spatialReference(e){throw new i("Cannot set sublayer schema spatial reference.")}_getPropertyBindings(){return{}}_bindSettingsToSublayerProperties(){const e=this._getPropertyBindings();for(const t of C(e)){let i=e[t];"string"==typeof i&&(i={property:i}),this._sublayerBindings.set(t,i),i.hasOwnProperty("value")||u(this,t,(()=>y(this._sublayerExtension,`sublayer.${String(i.property)}`,(()=>o(this,t)),{sync:!i.hasOwnProperty("sync")||i.sync})))}}};k=e([l],k);export{k as SublayerSchema};export class SubSublayerExtensionCollection extends A{get _layerExtension(){return this._parent.layerExtension}constructor(e,t){super(e,t??"sublayer.sublayers")}add(e,s){if(E("sublayerX",e).isNotMissing(),!this._parent.supportsSublayers)throw new i(T);return e.sublayer&&this._parent.sublayer&&!this._parent.sublayer.sublayers&&(this._parent.sublayer.sublayers=new t),e.parentSublayerExtension&&e.parentSublayerExtension.sublayerExtensions.remove(e),super.add(e,s)}_onAdded(e){super._onAdded(e),e._setParentSublayerExtension(this._parent)}_onRemoved(e){super._onRemoved(e),e._setParentSublayerExtension(void 0)}}export function _assignSublayerExtensions(e,t,i){v(e,t,{onNew:(t,r)=>{try{e.add(s(t)?t:i(t),N(t)?void 0:r)}catch(e){F.warn({message:`Error occurred while adding sublayer extension for sublayer '${t.title??t.sublayer?.id??t.id}'.`,error:e})}},onMatch:(t,i,r,a)=>{try{s(i)||t.assignProperties(i),r===a||N(i)||e.reorder(t,a)}catch(e){F.warn({message:`Error occurred while assigning sublayer extension properties for sublayer '${t.title??t.sublayer?.id??t.id}'.`,error:e})}},equals:(e,t)=>{const i=SublayerExtension._matchesRef(e.sublayer,t.sublayer,"both");return s(t)?e===t||i:i||e.id===t.id}})}function L(e){return e&&"function"==typeof e.set}function N(e){return s(e)?!!e._deferredSublayerProperties?.$ref:!L(e.sublayer)&&!!e.sublayer?.$ref}
@@ -1,4 +1,4 @@
1
- import type { AccessorLike } from "../../support/esri";
1
+ import { type Observable } from "../../support/observableUtils.js";
2
2
  import { CollectionProxy } from "../../utilities/CollectionProxy.js";
3
3
  import type { LayerExtension } from "../_LayerExtension";
4
4
  import type { SublayerExtension } from "../_SublayerExtension";
@@ -11,7 +11,7 @@ export interface ArrayWrappedCollectionProperties {
11
11
  * specified, then the arrayProperty is accessed/watched directly off the
12
12
  * parent.
13
13
  */
14
- parent: AccessorLike;
14
+ parent: Observable;
15
15
  /**
16
16
  * An optional path to another Accessor, relative to the parent, that owns
17
17
  * the array being wrapped.
@@ -20,7 +20,7 @@ export interface ArrayWrappedCollectionProperties {
20
20
  /**
21
21
  * The path to the array to be wrapped by the collection. If targetProperty
22
22
  * is not specified, the path is relative to the parent; otherwise, the path
23
- * is relative to the parent.get(targetProperty).
23
+ * is relative to the parent[targetProperty].
24
24
  */
25
25
  arrayProperty: string;
26
26
  }
@@ -1 +1 @@
1
- import t from"@arcgis/core/core/Collection";import{getPropertyByPath as r}from"../../support/Observable.js";import{CollectionProxy as e}from"../../utilities/CollectionProxy.js";export class ArrayWrappedCollection extends e{_parent;_targetProperty;_arrayProperty;get _target(){return this._targetProperty?r(this._parent,this._targetProperty):this._parent}constructor(r,e){if(super(),e)this._parent=r,this._targetProperty=r.hasOwnProperty("sublayer")?"sublayer":"layer",this._arrayProperty=e;else{const{parent:t,targetProperty:e,arrayProperty:a}=r;this._parent=t,this._targetProperty=e,this._arrayProperty=a}if(this._target)this._onTargetResolved(this._target);else{this._collection=new t;const r=this._parent.watch(this._targetProperty,(()=>{const t=this._target;t&&(this.length&&t.set({[this._arrayProperty]:this.toArray()}),this._onTargetResolved(t),r.remove())}),!0)}}add(t,e){const s=this._target;return s&&!r(s,this._arrayProperty)&&(s.set({[this._arrayProperty]:[]}),this._collection=a(r(s,this._arrayProperty))),super.add(t,e)}_onTargetResolved(t){this._collection=a(r(t,this._arrayProperty)??[]),this._parent.watch(this._targetProperty?`${this._targetProperty}.${this._arrayProperty}`:this._arrayProperty,(()=>{this._target&&(this._collection=a(r(this._target,this._arrayProperty)??[]))}),!0)}}function a(r){const e=Array.isArray(r)?r:[],a=new t;return Object.defineProperty(a,"_items",{get:()=>e}),Object.defineProperty(a,"length",{get:()=>e.length,set:t=>e.length=t}),a}
1
+ import t from"@arcgis/core/core/Collection";import{deprecatedGetPropertyPath as r,deprecatedSet as e}from"../../support/Observable.js";import{watch as s}from"../../support/observableUtils.js";import{CollectionProxy as o}from"../../utilities/CollectionProxy.js";export class ArrayWrappedCollection extends o{_parent;_targetProperty;_arrayProperty;get _target(){return this._targetProperty?r(this._parent,this._targetProperty):this._parent}constructor(r,o){if(super(),o)this._parent=r,this._targetProperty=r.hasOwnProperty("sublayer")?"sublayer":"layer",this._arrayProperty=o;else{const{parent:t,targetProperty:e,arrayProperty:s}=r;this._parent=t,this._targetProperty=e,this._arrayProperty=s}if(this._target)this._onTargetResolved(this._target);else{this._collection=new t;const r=s(this._parent,this._targetProperty,(()=>{const t=this._target;t&&(this.length&&e(t,this._arrayProperty,this.toArray()),this._onTargetResolved(t),r.remove())}),{sync:!0})}}add(t,s){const o=this._target;return o&&!r(o,this._arrayProperty)&&(e(o,this._arrayProperty,[]),this._collection=a(r(o,this._arrayProperty)??[])),super.add(t,s)}_onTargetResolved(t){this._collection=a(t[this._arrayProperty]),s(this._parent,this._targetProperty?`${this._targetProperty}.${this._arrayProperty}`:this._arrayProperty,(()=>{this._target&&(this._collection=a(r(this._target,this._arrayProperty)??[]))}),{sync:!0})}}function a(r){const e=Array.isArray(r)?r:[],s=new t;return Object.defineProperty(s,"_items",{get:()=>e}),Object.defineProperty(s,"length",{get:()=>e.length,set:t=>e.length=t}),s}
@@ -31,11 +31,12 @@ export declare class LayerListSettingsProperties {
31
31
  */
32
32
  childrenIncluded?: boolean;
33
33
  }
34
+ declare const LayerListSettings_base: (abstract new (_properties?: LayerListSettingsProperties) => SerializableBase<LayerListSettingsProperties>) & (abstract new (...args: any[]) => import("../../support/observableUtils.js").ObservableMixin);
34
35
  /**
35
36
  * Settings that affect the behavior and presentation of a layer in the layer
36
37
  * list.
37
38
  */
38
- export declare class LayerListSettings extends SerializableBase<LayerListSettingsProperties> {
39
+ export declare class LayerListSettings extends LayerListSettings_base {
39
40
  /**
40
41
  * Whether this node is initially expanded to show children. No effect if
41
42
  * {@link included} is false. This value may not be set to true, if the
@@ -137,3 +138,4 @@ export declare abstract class ExtensionBaseLayerListSettings extends LayerListSe
137
138
  * @param listMode A layer's listMode.
138
139
  */
139
140
  export declare function fromLayerListMode(listMode: ListMode): LayerListSettingsProperties;
141
+ export {};
@@ -1 +1 @@
1
- import{__decorate as e}from"tslib";import{whenOnce as i}from"@arcgis/core/core/reactiveUtils";import{InvalidOperationError as t}from"../../InvalidOperationError.js";import{isLayerExtension as d,isSublayerExtension as n}from"../../ItemType.js";import{serializable as s,SerializableBase as l}from"../../support/Serializable.js";import{checkArg as r}from"../../utilities/checkArg.js";export class LayerListSettingsProperties{expanded;included;childrenIncluded}let a=class extends l{get expanded(){return this._expanded}set expanded(e){this._expanded=e}get included(){return this._included}set included(e){this._included=e}get effectivelyIncluded(){return this.included}get initialExpanded(){return this._initialExpanded}get initialChildrenIncluded(){return this._initialChildrenIncluded}get initialIncluded(){return this._initialIncluded}get childrenIncluded(){return this._childrenIncluded}set childrenIncluded(e){this._childrenIncluded=e}_initialExpanded;_initialIncluded;_initialChildrenIncluded;_childrenIncluded;_expanded;_included;_getSerializableProperties(){return{expanded:{serializeModes:["initial"],default:!1},included:{serializeModes:["initial"],default:!0},childrenIncluded:{serializeModes:["initial"],default:!0}}}};a=e([s],a);export{a as LayerListSettings};export class ExtensionBaseLayerListSettings extends a{_extension;_defaultChildrenIncluded;_initialEsriLayerListMode;constructor(e,t,n){r("extension",t).isNotMissing().isDefined(),super(e),this._extension=t,this._defaultChildrenIncluded=n;const s=()=>d(t)?t.layer:t.sublayer,l=s();"included"in e?(this._initialIncluded=e.included,this.notifyChange("initialIncluded")):(l?this._initialIncluded=this.included:(async()=>{await i(s),this._initialIncluded=this.included,this.notifyChange("initialIncluded")})(),void 0===this._initialIncluded&&(this._initialIncluded=!0,this.notifyChange("initialIncluded"))),"childrenIncluded"in e?(this._initialChildrenIncluded=e.childrenIncluded,this.notifyChange("initialChildrenIncluded")):(l?this._initialChildrenIncluded=this.childrenIncluded:(async()=>{await i(s),this._initialChildrenIncluded=this.childrenIncluded,this.notifyChange("initialChildrenIncluded")})(),void 0===this._initialChildrenIncluded&&(this._initialChildrenIncluded=!0,this.notifyChange("initialChildrenIncluded"))),l?this._initialEsriLayerListMode=l.listMode:(async()=>{await i(s),void 0===this._initialEsriLayerListMode&&(this._initialEsriLayerListMode=this._esriLayer.listMode)})(),this._initialExpanded=e.expanded??!1}get included(){return void 0!==super.included?super.included:!this._esriLayer||"hide"!==this._esriLayer.listMode}set included(e){r("value",e).satisfies((e=>"boolean"==typeof e),"LayerListSettings must be set to boolean values"),super.included=e,this._setListMode()}get effectivelyIncluded(){const e=i=>{if(d(i)){const t=i.parentLayerExtension;return t?t.layerListSettings.childrenIncluded&&e(t):i.layerListSettings.included}if(n(i)){const t=i.parentSublayerExtension??i.layerExtension;return t.layerListSettings.childrenIncluded&&e(t)}return!1};return e(this._extension)}get childrenIncluded(){return void 0!==super.childrenIncluded?super.childrenIncluded:this._esriLayer?this._supportsChildren&&"show"===this._esriLayer.listMode:this._defaultChildrenIncluded??this._supportsChildren}set childrenIncluded(e){if(r("value",e).satisfies((e=>"boolean"==typeof e),"LayerListSettings must be set to boolean values"),!this._supportsChildren&&e)throw new t("Cannot set 'childrenIncluded' to true on a layer that does not support sublayers.");super.childrenIncluded=e,this._setListMode()}get expanded(){return super.expanded}set expanded(e){if(r("value",e).satisfies((e=>"boolean"==typeof e),"LayerListSettings must be set to boolean values"),!this._supportsChildren&&e)throw new t("Cannot set 'expanded' to true on a layer that does not support sublayers.");super.expanded=e}onLayerExtensionInitialized(){this._setListMode(),this._extension.watch(this._listModePath,((e,i)=>{e!==i&&(super.childrenIncluded=void 0,super.included=void 0)}),!0)}_getSerializableProperties(){return{...super._getSerializableProperties(),included:{serializeModes:["initial"],isDefault:e=>!!e},childrenIncluded:{serializeModes:["initial"],isDefault:e=>e===this._childrenIncludedSerializationDefault()}}}_childrenIncludedSerializationDefault(){return this._esriLayer?"show"===this._initialEsriLayerListMode:this._defaultChildrenIncluded??this._supportsChildren}_setListMode(){const e=this._esriLayer;e&&(void 0===this._initialEsriLayerListMode&&(this._initialEsriLayerListMode=e.listMode),!this.childrenIncluded&&this._extension._layerSupportsHideChildren&&this.included?e.listMode="hide-children":this.childrenIncluded||this.included?e.listMode="show":e.listMode="hide")}}export function fromLayerListMode(e){const i={};return"hide"===e?i.included=!1:"show"===e?i.included=!0:"hide-children"===e&&(i.childrenIncluded=!1),i}
1
+ import{__decorate as e}from"tslib";import{InvalidOperationError as i}from"../../InvalidOperationError.js";import{isLayerExtension as t,isSublayerExtension as d}from"../../ItemType.js";import{serializable as n,SerializableBase as s}from"../../support/Serializable.js";import{notifyChange as l,observable as r,watch as a}from"../../support/observableUtils.js";import{checkArg as u}from"../../utilities/checkArg.js";export class LayerListSettingsProperties{expanded;included;childrenIncluded}let h=class extends(r(s)){get expanded(){return this._expanded}set expanded(e){this._expanded=e}get included(){return this._included}set included(e){this._included=e}get effectivelyIncluded(){return this.included}get initialExpanded(){return this._initialExpanded}get initialChildrenIncluded(){return this._initialChildrenIncluded}get initialIncluded(){return this._initialIncluded}get childrenIncluded(){return this._childrenIncluded}set childrenIncluded(e){this._childrenIncluded=e}_initialExpanded;_initialIncluded;_initialChildrenIncluded;_childrenIncluded;_expanded;_included;_getSerializableProperties(){return{expanded:{serializeModes:["initial"],default:!1},included:{serializeModes:["initial"],default:!0},childrenIncluded:{serializeModes:["initial"],default:!0}}}};h=e([n],h);export{h as LayerListSettings};export class ExtensionBaseLayerListSettings extends h{_extension;_defaultChildrenIncluded;_initialEsriLayerListMode;constructor(e,i,d){u("extension",i).isNotMissing().isDefined(),super(e),this._extension=i,this._defaultChildrenIncluded=d;const n=t(i)?i.layer:i.sublayer,s=e=>{t(i)?a(i,"layer",e,{once:!0}):a(i,"sublayer",e,{once:!0})};"included"in e?(this._initialIncluded=e.included,l(this,"initialIncluded")):(n?this._initialIncluded=this.included:s((()=>{this._initialIncluded=this.included,l(this,"initialIncluded")})),void 0===this._initialIncluded&&(this._initialIncluded=!0,l(this,"initialIncluded"))),"childrenIncluded"in e?(this._initialChildrenIncluded=e.childrenIncluded,l(this,"initialChildrenIncluded")):(n?this._initialChildrenIncluded=this.childrenIncluded:s((()=>{this._initialChildrenIncluded=this.childrenIncluded,l(this,"initialChildrenIncluded")})),void 0===this._initialChildrenIncluded&&(this._initialChildrenIncluded=!0,l(this,"initialChildrenIncluded"))),n?this._initialEsriLayerListMode=n.listMode:s((()=>{void 0===this._initialEsriLayerListMode&&(this._initialEsriLayerListMode=this._esriLayer.listMode)})),this._initialExpanded=e.expanded??!1}get included(){return void 0!==super.included?super.included:!this._esriLayer||"hide"!==this._esriLayer.listMode}set included(e){u("value",e).satisfies((e=>"boolean"==typeof e),"LayerListSettings must be set to boolean values"),super.included=e,this._setListMode()}get effectivelyIncluded(){const e=i=>{if(t(i)){const t=i.parentLayerExtension;return t?t.layerListSettings.childrenIncluded&&e(t):i.layerListSettings.included}if(d(i)){const t=i.parentSublayerExtension??i.layerExtension;return t.layerListSettings.childrenIncluded&&e(t)}return!1};return e(this._extension)}get childrenIncluded(){return void 0!==super.childrenIncluded?super.childrenIncluded:this._esriLayer?this._supportsChildren&&"show"===this._esriLayer.listMode:this._defaultChildrenIncluded??this._supportsChildren}set childrenIncluded(e){if(u("value",e).satisfies((e=>"boolean"==typeof e),"LayerListSettings must be set to boolean values"),!this._supportsChildren&&e)throw new i("Cannot set 'childrenIncluded' to true on a layer that does not support sublayers.");super.childrenIncluded=e,this._setListMode()}get expanded(){return super.expanded}set expanded(e){if(u("value",e).satisfies((e=>"boolean"==typeof e),"LayerListSettings must be set to boolean values"),!this._supportsChildren&&e)throw new i("Cannot set 'expanded' to true on a layer that does not support sublayers.");super.expanded=e}onLayerExtensionInitialized(){this._setListMode(),a(this._extension,this._listModePath,(()=>{super.childrenIncluded=void 0,super.included=void 0}),{sync:!0})}_getSerializableProperties(){return{...super._getSerializableProperties(),included:{serializeModes:["initial"],isDefault:e=>!!e},childrenIncluded:{serializeModes:["initial"],isDefault:e=>e===this._childrenIncludedSerializationDefault()}}}_childrenIncludedSerializationDefault(){return this._esriLayer?"show"===this._initialEsriLayerListMode:this._defaultChildrenIncluded??this._supportsChildren}_setListMode(){const e=this._esriLayer;e&&(void 0===this._initialEsriLayerListMode&&(this._initialEsriLayerListMode=e.listMode),!this.childrenIncluded&&this._extension._layerSupportsHideChildren&&this.included?e.listMode="hide-children":this.childrenIncluded||this.included?e.listMode="show":e.listMode="hide")}}export function fromLayerListMode(e){const i={};return"hide"===e?i.included=!1:"show"===e?i.included=!0:"hide-children"===e&&(i.childrenIncluded=!1),i}
@@ -1 +1 @@
1
- import{__decorate as e}from"tslib";import{FeatureSettings as t}from"../../data/FeatureSettings.js";import{TableExtension as i}from"../../data/_TableExtension.js";import{getPropertyByPath as s}from"../../support/Observable.js";import{serializable as n}from"../../support/Serializable.js";import{LayerExtension as r}from"../_LayerExtension.js";import{SublayerExtension as o}from"../_SublayerExtension.js";let a=class extends t{_layerExtension;get _bindings(){return this._propertyBindings||(this._propertyBindings=new Map),this._propertyBindings}_propertyBindings;constructor(e){super(),this._layerExtension=e,this._bindSettingToLayerProperty("popupTemplate");const t=this._getLayerLike(),i=this._getLayerLikeType();if(t)this._onLayerResolved(t);else if(i){const t=e.watch(i,(e=>{this._onLayerResolved(e),t.remove()}),!0)}}_getSerializableProperties(){return{...super._getSerializableProperties(),popupTemplate:{serialize:!1}}}_getSetting(e,t){const i=this._getLayerLike();return this._bindings.has(e)&&i?s(i,this._bindings.get(e)):super._getSetting(e,t)}_setSetting(e,t){const i=this._getLayerLike();this._bindings.has(e)&&i?i.set({[this._bindings.get(e)]:t}):super._setSetting(e,t)}_bindSettingToLayerProperty(e,t){const i=this._getLayerLikeType();if(!i)return;const s=t||e;this._bindings.set(e,s),this._layerExtension.watch(`${i}.${s}`,(()=>this.notifyChange(e)),!0)}_onLayerResolved(e){for(const t of this._bindings.keys())this.isModified(t)&&(e.set({[t]:this.get(t)}),this.reset(t))}_getLayerLike(){return this._layerExtension instanceof r?this._layerExtension.layer:this._layerExtension instanceof i?this._layerExtension.table:this._layerExtension instanceof o?this._layerExtension.sublayer:void 0}_getLayerLikeType(){return this._layerExtension instanceof r?"layer":this._layerExtension instanceof i?"table":this._layerExtension instanceof o?"sublayer":void 0}};a=e([n],a);export{a as PopupTemplateFeatureSettings};
1
+ import{__decorate as e}from"tslib";import{isSublayerExtension as t,isTableExtension as s}from"../../ItemType.js";import{FeatureSettings as i}from"../../data/FeatureSettings.js";import{TableExtension as n}from"../../data/_TableExtension.js";import{getPropertyByPath as r}from"../../support/Observable.js";import{serializable as o}from"../../support/Serializable.js";import{notifyChange as a,onWatch as y,watch as p}from"../../support/observableUtils.js";import{LayerExtension as _}from"../_LayerExtension.js";import{SublayerExtension as l}from"../_SublayerExtension.js";let h=class extends i{_layerExtension;get _bindings(){return this._propertyBindings||(this._propertyBindings=new Map),this._propertyBindings}_propertyBindings;constructor(e){super(),this._layerExtension=e,this._bindSettingToLayerProperty("popupTemplate");const i=this._getLayerLike();if(i)this._onLayerResolved(i);else{const i=e=>this._onLayerResolved(e);t(e)?p(e,"sublayer",i,{sync:!0,once:!0}):s(e)?p(e,"table",i,{sync:!0,once:!0}):p(e,"layer",i,{sync:!0,once:!0})}}_getSerializableProperties(){return{...super._getSerializableProperties(),popupTemplate:{serialize:!1}}}_getSetting(e,t){const s=this._getLayerLike();return this._bindings.has(e)&&s?r(s,this._bindings.get(e)):super._getSetting(e,t)}_setSetting(e,t){const s=this._getLayerLike();this._bindings.has(e)&&s?s.set({[this._bindings.get(e)]:t}):super._setSetting(e,t)}_bindSettingToLayerProperty(e,t){const s=this._getLayerLikeType();if(!s)return;const i=t||e;this._bindings.set(e,i),y(this,e,(()=>p(this._layerExtension,`${s}.${i}`,(()=>a(this,e)),{sync:!0})))}_onLayerResolved(e){for(const t of this._bindings.keys())this.isModified(t)&&(e.set({[t]:this.get(t)}),this.reset(t))}_getLayerLike(){return this._layerExtension instanceof _?this._layerExtension.layer:this._layerExtension instanceof n?this._layerExtension.table:this._layerExtension instanceof l?this._layerExtension.sublayer:void 0}_getLayerLikeType(){return this._layerExtension instanceof _?"layer":this._layerExtension instanceof n?"table":this._layerExtension instanceof l?"sublayer":void 0}};h=e([o],h);export{h as PopupTemplateFeatureSettings};
@@ -2,7 +2,8 @@ import Collection from "@arcgis/core/core/Collection";
2
2
  import type Layer from "@arcgis/core/layers/Layer";
3
3
  import type { InitializableCollection } from "../../support/InitializableCollectionProxy.js";
4
4
  import { InitializableCollectionProxy } from "../../support/InitializableCollectionProxy.js";
5
- import type { AccessorLike } from "../../support/esri.js";
5
+ import type { CollectionAfterAddEventHandler, CollectionAfterChangesEventHandler, CollectionAfterRemoveEventHandler, CollectionBeforeAddEventHandler, CollectionBeforeChangesEventHandler, CollectionBeforeRemoveEventHandler, CollectionChangeEventHandler, EventHandler } from "../../support/esri.js";
6
+ import { type Observable } from "../../support/observableUtils.js";
6
7
  import type { MapExtension } from "../MapExtension.js";
7
8
  import type { LayerExtensionProperties } from "../_LayerExtension.js";
8
9
  import { LayerExtension } from "../_LayerExtension.js";
@@ -44,7 +45,7 @@ export declare abstract class LayerExtensionCollectionBase extends Initializable
44
45
  /**
45
46
  * The parent that owns this collection.
46
47
  */
47
- protected readonly _parent: AccessorLike;
48
+ protected readonly _parent: Observable;
48
49
  protected get _collection(): Collection<LayerExtension>;
49
50
  /**
50
51
  * The backing collection of layers that this collection is based on.
@@ -65,6 +66,13 @@ export declare abstract class LayerExtensionCollectionBase extends Initializable
65
66
  * Used when the backing collection of layers isn't available yet.
66
67
  */
67
68
  private _tempLayers;
69
+ private readonly _onChangeLayersHandle;
70
+ private readonly _onBeforeAddLayersHandle;
71
+ private readonly _onBeforeRemoveLayersHandle;
72
+ private readonly _onBeforeChangesLayersHandle;
73
+ private readonly _onAfterAddLayersHandle;
74
+ private readonly _onAfterRemoveLayersHandle;
75
+ private readonly _onAfterChangesLayersHandle;
68
76
  /**
69
77
  * Creates a new instance of LayerExtensionCollectionBase.
70
78
  *
@@ -72,8 +80,15 @@ export declare abstract class LayerExtensionCollectionBase extends Initializable
72
80
  * @param layersProperty The name of a property (or property path) on the
73
81
  * parent corresponding to the underlying collection of layers.
74
82
  */
75
- constructor(parent: AccessorLike, layersProperty: string);
76
- emit(type: string, event: unknown): boolean;
83
+ constructor(parent: Observable, layersProperty: string);
84
+ on(type: "after-add", listener: CollectionAfterAddEventHandler<LayerExtension>): IHandle;
85
+ on(type: "after-changes", listener: CollectionAfterChangesEventHandler): IHandle;
86
+ on(type: "after-remove", listener: CollectionAfterRemoveEventHandler<LayerExtension>): IHandle;
87
+ on(type: "before-add", listener: CollectionBeforeAddEventHandler<LayerExtension>): IHandle;
88
+ on(type: "before-changes", listener: CollectionBeforeChangesEventHandler): IHandle;
89
+ on(type: "before-remove", listener: CollectionBeforeRemoveEventHandler<LayerExtension>): IHandle;
90
+ on(type: "change", listener: CollectionChangeEventHandler<LayerExtension>): IHandle;
91
+ on(type: string, listener: EventHandler): IHandle;
77
92
  clone(): LayerExtensionCollectionBase;
78
93
  /**
79
94
  * @inheritDoc
@@ -1 +1 @@
1
- import e from"@arcgis/core/core/Collection";import{InvalidOperationError as i}from"../../InvalidOperationError.js";import{InitializableCollectionProxy as t}from"../../support/InitializableCollectionProxy.js";import{checkArg as s}from"../../utilities/checkArg.js";import{layersAreEquivalent as r}from"../../utilities/layers.js";import{getLogger as n}from"../../utilities/log.js";import{onCollectionPropertyChange as a}from"../../utilities/watch.js";import{UnsupportedLayerExtension as o}from"../UnsupportedLayerExtension.js";import{LayerExtension as l}from"../_LayerExtension.js";export class LayerExtensionCollectionBase extends t{_parent;get _collection(){return this._layers.map((e=>this._forLayer(e))).concat(this._uninitializedLayerExtensions).filter((e=>!(e instanceof o)))}get _layers(){let i=this._parent.get(this._layersProperty);return i||(this._tempLayers||(this._tempLayers=new e),i=this._tempLayers),i}_layerExtensionMap=new WeakMap;_uninitializedLayerExtensions=new e;_layersProperty;_tempLayers;constructor(e,i){super(),this._parent=e,this._layersProperty=i,a(this._parent,this._layersProperty,(e=>{try{const i={added:(e.added||[]).map((e=>this._forLayer(e))),moved:(e.moved||[]).map((e=>this._forLayer(e))),removed:(e.removed||[]).map((e=>this._forLayer(e)))};this.emit("change",i)}catch(e){e instanceof Error&&n("geocortex.api.support.LayerExtensionCollection").error(e.message)}})),this._parent.watch(`${this._layersProperty}.length`,(()=>this.notifyChange("length")))}emit(e,i){const t=super.emit(e,i);return"change"===e&&this._mapExtension&&this._mapExtension.allLayerExtensions.emit(e,i),t}clone(){const e=super.clone();return e._layerExtensionMap=this._layerExtensionMap,e}findById(e){return s("id",e).isNotMissing(),this.find((i=>i.id===e))}findByLayerId(e){return s("id",e).isNotMissing(),this.find((i=>i.layer.id===e))}forLayer(e){if(s("layer",e).isNotMissing(),this._layers.includes(e))return this._forLayer(e)}add(e,i){if(s("layerX",e).isNotMissing(),this._register(e),e.layer)this._layers.includes(e.layer)?void 0!==i&&this._layers.reorder(e.layer,i):this._layers.add(e.layer,i);else if(!e.isInitialized){const t=e.watch("layer",(()=>{e.layer&&(this._forLayer(e.layer),this._layers.includes(e.layer)||this._layers.add(e.layer,i)),t.remove()}),!0)}return this}removeAt(e){const i=this.getItemAt(e);if(void 0!==i){if(this._uninitializedLayerExtensions.includes(i)){this._uninitializedLayerExtensions.remove(i);const e={added:[],moved:[],removed:[i],target:this};this.emit("change",e)}else this._layers.remove(i.layer);return this._onRemoved(i),i}}reorder(e,t){if(this._uninitializedLayerExtensions.includes(e)){if(this._uninitializedLayerExtensions.some((e=>e.isInitialized)))throw new i("Unable to reorder a mix of initialized / uninitialized layers.");this._uninitializedLayerExtensions.reorder(e,t)}if(e?.layer&&this._layers.includes(e.layer))return this._layers.reorder(e.layer,t),e}sort(e){return this._layers.sort(((i,t)=>e(this._forLayer(i),this._forLayer(t)))),this}onParentInitialized(){this._tempLayers?.length&&(this.addMany(this._tempLayers.map((e=>this._forLayer(e)))),this._tempLayers=void 0)}onMapExtensionChanged(){for(const e of this.toArray())e._setMapExtension(this._mapExtension)}_forLayer(e){for(const e of this._uninitializedLayerExtensions)e.layer||e._resolveLayer(this._layers),e.layer&&(this._layerExtensionMap.set(e.layer,e),this._uninitializedLayerExtensions.remove(e),this._mapExtension&&!e.mapExtension&&e._setMapExtension(this._mapExtension));if(!this._layerExtensionMap.has(e)){const i=this._uninitializedLayerExtensions.find((i=>r(e,i._deferredLayerProperties)));if(i)return i;const t=("map"===this._mapExtension?.viewMode?this._mapExtension?._scene:this._mapExtension?._map)?.allLayers.find((i=>r(i,e))),s=this._layerExtensionMap.get(t),n={layer:e};s&&(n.layerListSettings=s.layerListSettings.toJSON());const a=l.create(n);this._register(a)}return this._layerExtensionMap.get(e)}_register(e){if(s("layerX",e).isNotMissing(),e._setMapExtension(this._mapExtension),e.layer||e._resolveLayer(this._layers),e.layer){const i=this._layerExtensionMap.get(e.layer);if(e===i)return;if(this._layerExtensionMap.set(e.layer,e),i&&(this._onRemoved(i),this._layers.includes(e.layer))){const t={added:[e],moved:[],removed:[i],target:this};this.emit("change",t)}}else{this._uninitializedLayerExtensions.add(e);const i={added:[e],moved:[],removed:[],target:this};this.emit("change",i)}this._onAdded(e)}_itemIsInitialized(e){return super._itemIsInitialized(e)&&!!e.layer}_onAdded(e){}_onRemoved(e){e._setMapExtension(void 0)}}
1
+ import e from"@arcgis/core/core/Collection";import{InvalidOperationError as t}from"../../InvalidOperationError.js";import{InitializableCollectionProxy as i}from"../../support/InitializableCollectionProxy.js";import{createIHandle as r,notifyChange as s,onWatch as a,watch as n,watchEvent as o}from"../../support/observableUtils.js";import h from"../../utilities/_ReferenceCountedHandle.js";import{checkArg as d}from"../../utilities/checkArg.js";import{layersAreEquivalent as l}from"../../utilities/layers.js";import{getLogger as y}from"../../utilities/log.js";import{onCollectionPropertyChange as _}from"../../utilities/watch.js";import{UnsupportedLayerExtension as m}from"../UnsupportedLayerExtension.js";import{LayerExtension as f}from"../_LayerExtension.js";export class LayerExtensionCollectionBase extends i{_parent;get _collection(){return this._layers.map((e=>this._forLayer(e))).concat(this._uninitializedLayerExtensions).filter((e=>!(e instanceof m)))}get _layers(){const t=this._layersProperty.split(".");let i=this._parent;for(const e of t){if(null==i){i=void 0;break}i=i[e]}return i||(this._tempLayers||(this._tempLayers=new e),i=this._tempLayers),i}_layerExtensionMap=new WeakMap;_uninitializedLayerExtensions=new e;_layersProperty;_tempLayers;_onChangeLayersHandle=new h((()=>_(this._parent,this._layersProperty,(e=>{try{const t={added:(e.added||[]).map((e=>this._forLayer(e))),moved:(e.moved||[]).map((e=>this._forLayer(e))),removed:(e.removed||[]).map((e=>this._forLayer(e)))};this.emit("change",t)}catch(e){e instanceof Error&&y("geocortex.api.support.LayerExtensionCollection").error(e.message)}}))));_onBeforeAddLayersHandle=new h((()=>o(this._parent,this._layersProperty,["before-add",e=>this.emit("before-add",{...e,item:this._forLayer(e.item),target:this})])));_onBeforeRemoveLayersHandle=new h((()=>o(this._parent,this._layersProperty,["before-remove",e=>this.emit("before-remove",{...e,item:this._forLayer(e.item),target:this})])));_onBeforeChangesLayersHandle=new h((()=>o(this._parent,this._layersProperty,["before-changes",e=>this.emit("before-changes",{...e,target:this})])));_onAfterAddLayersHandle=new h((()=>o(this._parent,this._layersProperty,["after-add",e=>this.emit("after-add",{...e,item:this._forLayer(e.item),target:this})],(e=>{if(null!=e)for(const t of e)this.emit("after-add",{item:this._forLayer(t),target:this})}))));_onAfterRemoveLayersHandle=new h((()=>o(this._parent,this._layersProperty,["after-remove",e=>this.emit("after-remove",{...e,item:this._forLayer(e.item),target:this})],((e,t)=>{if(null!=t)for(const e of t)this.emit("after-remove",{item:this._forLayer(e),target:this})}))));_onAfterChangesLayersHandle=new h((()=>o(this._parent,this._layersProperty,["after-changes",e=>this.emit("after-changes",{...e,target:this})],(()=>{this.emit("after-changes",{target:this})}))));constructor(e,t){super(),this._parent=e,this._layersProperty=t,a(this,"length",(()=>n(this._parent,`${this._layersProperty}.length`,(()=>s(this,"length")),{sync:!0})))}on(e,t){const i=[];return"change"===e?i.push(this._onChangeLayersHandle.add()):"before-add"===e?i.push(this._onBeforeAddLayersHandle.add()):"before-remove"===e?i.push(this._onBeforeRemoveLayersHandle.add()):"before-changes"===e?i.push(this._onBeforeChangesLayersHandle.add()):"after-add"===e?i.push(this._onAfterAddLayersHandle.add()):"after-remove"===e?i.push(this._onAfterRemoveLayersHandle.add()):"after-changes"===e&&i.push(this._onAfterChangesLayersHandle.add()),i.push(super.on(e,t)),r(i)}clone(){const e=super.clone();return e._layerExtensionMap=this._layerExtensionMap,e}findById(e){return d("id",e).isNotMissing(),this.find((t=>t.id===e))}findByLayerId(e){return d("id",e).isNotMissing(),this.find((t=>t.layer.id===e))}forLayer(e){if(d("layer",e).isNotMissing(),this._layers.includes(e))return this._forLayer(e)}add(e,t){return d("layerX",e).isNotMissing(),this._register(e),e.layer?this._layers.includes(e.layer)?void 0!==t&&this._layers.reorder(e.layer,t):this._layers.add(e.layer,t):e.isInitialized||n(e,"layer",(e=>{e&&(this._forLayer(e),this._layers.includes(e)||this._layers.add(e,t))}),{sync:!0,once:!0}),this}removeAt(e){const t=this.getItemAt(e);if(void 0!==t){if(this._uninitializedLayerExtensions.includes(t)){this._uninitializedLayerExtensions.remove(t);const e={added:[],moved:[],removed:[t],target:this};this.emit("after-remove",{item:t,target:this}),this.emit("after-changes"),this.emit("change",e)}else this._layers.remove(t.layer);return this._onRemoved(t),t}}reorder(e,i){if(this._uninitializedLayerExtensions.includes(e)){if(this._uninitializedLayerExtensions.some((e=>e.isInitialized)))throw new t("Unable to reorder a mix of initialized / uninitialized layers.");this._uninitializedLayerExtensions.reorder(e,i)}if(e?.layer&&this._layers.includes(e.layer))return this._layers.reorder(e.layer,i),e}sort(e){return this._layers.sort(((t,i)=>e(this._forLayer(t),this._forLayer(i)))),this}onParentInitialized(){this._tempLayers?.length&&(this.addMany(this._tempLayers.map((e=>this._forLayer(e)))),this._tempLayers=void 0)}onMapExtensionChanged(){for(const e of this.toArray())e._setMapExtension(this._mapExtension)}_forLayer(e){for(const e of this._uninitializedLayerExtensions)e.layer||e._resolveLayer(this._layers),e.layer&&(this._layerExtensionMap.set(e.layer,e),this._uninitializedLayerExtensions.remove(e),this._mapExtension&&!e.mapExtension&&e._setMapExtension(this._mapExtension));if(!this._layerExtensionMap.has(e)){const t=this._uninitializedLayerExtensions.find((t=>l(e,t._deferredLayerProperties)));if(t)return t;const i=("map"===this._mapExtension?.viewMode?this._mapExtension?._scene:this._mapExtension?._map)?.allLayers.find((t=>l(t,e))),r=this._layerExtensionMap.get(i),s={layer:e};r&&(s.layerListSettings=r.layerListSettings.toJSON());const a=f.create(s);this._register(a)}return this._layerExtensionMap.get(e)}_register(e){if(d("layerX",e).isNotMissing(),e._setMapExtension(this._mapExtension),e.layer||e._resolveLayer(this._layers),e.layer){const t=this._layerExtensionMap.get(e.layer);if(e===t)return;if(this._layerExtensionMap.set(e.layer,e),t&&(this._onRemoved(t),this._layers.includes(e.layer))){const i={added:[e],moved:[],removed:[t],target:this};this.emit("after-add",{item:e,target:this}),null!=t&&this.emit("after-remove",{item:t,target:this}),this.emit("after-changes"),this.emit("change",i)}}else{this._uninitializedLayerExtensions.add(e);const t={added:[e],moved:[],removed:[],target:this};this.emit("after-add",{item:e,target:this}),this.emit("after-changes"),this.emit("change",t)}this._onAdded(e)}_itemIsInitialized(e){return super._itemIsInitialized(e)&&!!e.layer}_onAdded(e){}_onRemoved(e){e._setMapExtension(void 0)}}
@@ -1,7 +1,8 @@
1
1
  import Collection from "@arcgis/core/core/Collection";
2
2
  import type { InitializableCollection } from "../../support/InitializableCollectionProxy.js";
3
3
  import { InitializableCollectionProxy } from "../../support/InitializableCollectionProxy.js";
4
- import type { AccessorLike, SublayerLike } from "../../support/esri.js";
4
+ import type { CollectionAfterAddEventHandler, CollectionAfterChangesEventHandler, CollectionAfterRemoveEventHandler, CollectionBeforeAddEventHandler, CollectionBeforeChangesEventHandler, CollectionBeforeRemoveEventHandler, CollectionChangeEventHandler, EventHandler, SublayerLike } from "../../support/esri.js";
5
+ import { type Observable } from "../../support/observableUtils.js";
5
6
  import type { LayerExtension } from "../_LayerExtension.js";
6
7
  import type { SublayerExtensionProperties } from "../_SublayerExtension.js";
7
8
  import { SublayerExtension } from "../_SublayerExtension.js";
@@ -45,7 +46,7 @@ export declare abstract class SublayerExtensionCollectionBase extends Initializa
45
46
  /**
46
47
  * The parent that owns this collection.
47
48
  */
48
- protected readonly _parent: AccessorLike;
49
+ protected readonly _parent: Observable;
49
50
  protected get _collection(): Collection<SublayerExtension>;
50
51
  private get _sublayers();
51
52
  private readonly _sublayersProperty;
@@ -64,6 +65,13 @@ export declare abstract class SublayerExtensionCollectionBase extends Initializa
64
65
  * when the sublayer extension is initialized.
65
66
  */
66
67
  private readonly _uninitializedSublayerExtensions;
68
+ private readonly _onChangeSublayersHandle;
69
+ private readonly _onBeforeAddSublayersHandle;
70
+ private readonly _onBeforeRemoveSublayersHandle;
71
+ private readonly _onBeforeChangesSublayersHandle;
72
+ private readonly _onAfterAddSublayersHandle;
73
+ private readonly _onAfterRemoveSublayersHandle;
74
+ private readonly _onAfterChangesSublayersHandle;
67
75
  /**
68
76
  * Creates a new instance of SublayerExtensionCollectionBase.
69
77
  *
@@ -71,7 +79,15 @@ export declare abstract class SublayerExtensionCollectionBase extends Initializa
71
79
  * @param sublayersProperty The name of a property (or property path) on the
72
80
  * parent corresponding to the underlying collection of sublayers.
73
81
  */
74
- constructor(parent: AccessorLike, sublayersProperty: string);
82
+ constructor(parent: Observable, sublayersProperty: string);
83
+ on(type: "after-add", listener: CollectionAfterAddEventHandler<LayerExtension>): IHandle;
84
+ on(type: "after-changes", listener: CollectionAfterChangesEventHandler): IHandle;
85
+ on(type: "after-remove", listener: CollectionAfterRemoveEventHandler<LayerExtension>): IHandle;
86
+ on(type: "before-add", listener: CollectionBeforeAddEventHandler<LayerExtension>): IHandle;
87
+ on(type: "before-changes", listener: CollectionBeforeChangesEventHandler): IHandle;
88
+ on(type: "before-remove", listener: CollectionBeforeRemoveEventHandler<LayerExtension>): IHandle;
89
+ on(type: "change", listener: CollectionChangeEventHandler<LayerExtension>): IHandle;
90
+ on(type: string, listener: EventHandler): IHandle;
75
91
  clone(): SublayerExtensionCollectionBase;
76
92
  /**
77
93
  * @inheritDoc
@@ -89,7 +105,6 @@ export declare abstract class SublayerExtensionCollectionBase extends Initializa
89
105
  removeAt(index: number): SublayerExtension;
90
106
  reorder(sublayerX: SublayerExtension, index: number): SublayerExtension;
91
107
  sort(compareFunction?: (a: SublayerExtension, b: SublayerExtension) => number): this;
92
- emit(type: string, event: unknown): boolean;
93
108
  /**
94
109
  * Invoked by the parent object when it is initialized.
95
110
  */
@@ -1 +1 @@
1
- import e from"@arcgis/core/core/Collection";import{InitializableCollectionProxy as s}from"../../support/InitializableCollectionProxy.js";import{checkArg as t}from"../../utilities/checkArg.js";import{onCollectionPropertyChange as i}from"../../utilities/watch.js";import{SublayerExtension as r}from"../_SublayerExtension.js";export class SublayerExtensionCollectionBase extends s{_parent;get _collection(){return this._sublayers.map((e=>this._forSublayer(e))).concat(Array.from(this._uninitializedSublayerExtensions))}get _sublayers(){let s=this._parent.get(this._sublayersProperty);return s||(this._tempSublayers||(this._tempSublayers=new e),s=this._tempSublayers),s}_sublayersProperty;_tempSublayers;_sublayerExtensionMap=new WeakMap;_uninitializedSublayerExtensions=new Set;constructor(e,s){super(),this._parent=e,this._sublayersProperty=s,i(this._parent,this._sublayersProperty,(e=>{const s={added:(e.added||[]).map((e=>this._forSublayer(e))),moved:(e.moved||[]).map((e=>this._forSublayer(e))),removed:(e.removed||[]).map((e=>this._forSublayer(e)))};this.emit("change",s)})),this._parent.watch(`${this._sublayersProperty}.length`,(()=>this.notifyChange("length")))}clone(){const e=super.clone();return e._sublayerExtensionMap=this._sublayerExtensionMap,e}findById(e){return t("id",e).isNotMissing(),this.find((s=>s.id===e))}findBySublayerId(e){return t("id",e).isNotMissing(),this.find((s=>s._sublayerId===e))}forSublayer(e){if(t("sublayer",e).isNotMissing(),!(this._sublayers.indexOf(e)<0))return this._forSublayer(e)}add(e,s){return t("sublayerX",e).isNotMissing(),this._register(e),e.sublayer&&(this._sublayers.includes(e.sublayer)?void 0!==s&&this.reorder(e,s):this._sublayers.add(e.sublayer,s)),this}removeAt(e){const s=this.getItemAt(e);if(void 0!==s){if(this._uninitializedSublayerExtensions.has(s)){this._uninitializedSublayerExtensions.delete(s);const e={added:[],moved:[],removed:[s],target:this};this.emit("change",e)}else this._sublayers.removeAt(e);return this._onRemoved(s),s}}reorder(e,s){if(!e)return;const t=this._sublayers.indexOf(e.sublayer);return t<0?void 0:(t!==s&&this._sublayers.reorder(e.sublayer,s),e)}sort(e){return this._sublayers.sort(((s,t)=>e(this._forSublayer(s),this._forSublayer(t)))),this}emit(e,s){const t=super.emit(e,s);return"change"===e&&this._layerExtension&&this._layerExtension.allSublayerExtensions.emit(e,s),t}onParentInitialized(){this._tempSublayers?.length&&(this.addMany(this._tempSublayers.map((e=>this._forSublayer(e)))),this._tempSublayers=void 0)}onLayerExtensionChanged(){for(const e of this.toArray())e._setLayerExtension(this._layerExtension)}_register(e){if(t("sublayerX",e).isNotMissing(),e._setLayerExtension(this._layerExtension),e.sublayer||e._resolveSublayer(),e.sublayer){const s=this._sublayerExtensionMap.get(e.sublayer);if(e===s)return;if(this._sublayerExtensionMap.set(e.sublayer,e),s&&(this._onRemoved(s),this._sublayers.includes(e.sublayer))){const t={added:[e],moved:[],removed:[s],target:this};this.emit("change",t)}}else{this._uninitializedSublayerExtensions.add(e);const s={added:[e],moved:[],removed:[],target:this};this.emit("change",s)}this._onAdded(e)}_itemIsInitialized(e){return super._itemIsInitialized(e)&&!!e.sublayer}_onAdded(e){}_onRemoved(e){e._setLayerExtension(void 0)}_forSublayer(e){for(const e of this._uninitializedSublayerExtensions)e._resolveSublayer(),e.sublayer&&(this._sublayerExtensionMap.set(e.sublayer,e),this._uninitializedSublayerExtensions.delete(e));if(!this._sublayerExtensionMap.has(e)){const s=r.create({sublayer:e});this._register(s)}return this._sublayerExtensionMap.get(e)}}
1
+ import e from"@arcgis/core/core/Collection";import{InitializableCollectionProxy as t}from"../../support/InitializableCollectionProxy.js";import{createIHandle as s,notifyChange as r,onWatch as i,watch as a,watchEvent as n}from"../../support/observableUtils.js";import o from"../../utilities/_ReferenceCountedHandle.js";import{checkArg as l}from"../../utilities/checkArg.js";import{onCollectionPropertyChange as h}from"../../utilities/watch.js";import{SublayerExtension as u}from"../_SublayerExtension.js";export class SublayerExtensionCollectionBase extends t{_parent;get _collection(){return this._sublayers.map((e=>this._forSublayer(e))).concat(Array.from(this._uninitializedSublayerExtensions))}get _sublayers(){const t=this._sublayersProperty.split(".");let s=this._parent;for(const e of t){if(null==s){s=void 0;break}s=s[e]}return s||(this._tempSublayers||(this._tempSublayers=new e),s=this._tempSublayers),s}_sublayersProperty;_tempSublayers;_sublayerExtensionMap=new WeakMap;_uninitializedSublayerExtensions=new Set;_onChangeSublayersHandle=new o((()=>h(this._parent,this._sublayersProperty,(e=>{const t={added:(e.added||[]).map((e=>this._forSublayer(e))),moved:(e.moved||[]).map((e=>this._forSublayer(e))),removed:(e.removed||[]).map((e=>this._forSublayer(e)))};this.emit("change",t)}))));_onBeforeAddSublayersHandle=new o((()=>n(this._parent,this._sublayersProperty,["before-add",e=>this.emit("before-add",{...e,item:this._forSublayer(e.item),target:this})])));_onBeforeRemoveSublayersHandle=new o((()=>n(this._parent,this._sublayersProperty,["before-remove",e=>this.emit("before-remove",{...e,item:this._forSublayer(e.item),target:this})])));_onBeforeChangesSublayersHandle=new o((()=>n(this._parent,this._sublayersProperty,["before-changes",e=>this.emit("before-changes",{...e,target:this})])));_onAfterAddSublayersHandle=new o((()=>n(this._parent,this._sublayersProperty,["after-add",e=>this.emit("after-add",{...e,item:this._forSublayer(e.item),target:this})],(e=>{if(null!=e)for(const t of e)this.emit("after-add",{item:this._forSublayer(t),target:this})}))));_onAfterRemoveSublayersHandle=new o((()=>n(this._parent,this._sublayersProperty,["after-remove",e=>this.emit("after-remove",{...e,item:this._forSublayer(e.item),target:this})],((e,t)=>{if(null!=t)for(const e of t)this.emit("after-remove",{item:this._forSublayer(e),target:this})}))));_onAfterChangesSublayersHandle=new o((()=>n(this._parent,this._sublayersProperty,["after-changes",e=>this.emit("after-changes",{...e,target:this})],(()=>{this.emit("after-changes",{target:this})}))));constructor(e,t){super(),this._parent=e,this._sublayersProperty=t,i(this,"length",(()=>a(this._parent,`${this._sublayersProperty}.length`,(()=>r(this,"length")),{sync:!0})))}on(e,t){const r=[];return"change"===e?r.push(this._onChangeSublayersHandle.add()):"before-add"===e?r.push(this._onBeforeAddSublayersHandle.add()):"before-remove"===e?r.push(this._onBeforeRemoveSublayersHandle.add()):"before-changes"===e?r.push(this._onBeforeChangesSublayersHandle.add()):"after-add"===e?r.push(this._onAfterAddSublayersHandle.add()):"after-remove"===e?r.push(this._onAfterRemoveSublayersHandle.add()):"after-changes"===e&&r.push(this._onAfterChangesSublayersHandle.add()),r.push(super.on(e,t)),s(r)}clone(){const e=super.clone();return e._sublayerExtensionMap=this._sublayerExtensionMap,e}findById(e){return l("id",e).isNotMissing(),this.find((t=>t.id===e))}findBySublayerId(e){return l("id",e).isNotMissing(),this.find((t=>t._sublayerId===e))}forSublayer(e){if(l("sublayer",e).isNotMissing(),!(this._sublayers.indexOf(e)<0))return this._forSublayer(e)}add(e,t){return l("sublayerX",e).isNotMissing(),this._register(e),e.sublayer&&(this._sublayers.includes(e.sublayer)?void 0!==t&&this.reorder(e,t):this._sublayers.add(e.sublayer,t)),this}removeAt(e){const t=this.getItemAt(e);if(void 0!==t){if(this._uninitializedSublayerExtensions.has(t)){this._uninitializedSublayerExtensions.delete(t);const e={added:[],moved:[],removed:[t],target:this};this.emit("after-remove",{item:t,target:this}),this.emit("after-changes",{target:this}),this.emit("change",e)}else this._sublayers.removeAt(e);return this._onRemoved(t),t}}reorder(e,t){if(!e)return;const s=this._sublayers.indexOf(e.sublayer);return s<0?void 0:(s!==t&&this._sublayers.reorder(e.sublayer,t),e)}sort(e){return this._sublayers.sort(((t,s)=>e(this._forSublayer(t),this._forSublayer(s)))),this}onParentInitialized(){this._tempSublayers?.length&&(this.addMany(this._tempSublayers.map((e=>this._forSublayer(e)))),this._tempSublayers=void 0)}onLayerExtensionChanged(){for(const e of this.toArray())e._setLayerExtension(this._layerExtension)}_register(e){if(l("sublayerX",e).isNotMissing(),e._setLayerExtension(this._layerExtension),e.sublayer||e._resolveSublayer(),e.sublayer){const t=this._sublayerExtensionMap.get(e.sublayer);if(e===t)return;if(this._sublayerExtensionMap.set(e.sublayer,e),t&&(this._onRemoved(t),this._sublayers.includes(e.sublayer))){const s={added:[e],moved:[],removed:[t],target:this};this.emit("after-add",{item:e,target:this}),null!=t&&this.emit("after-remove",{item:t,target:this}),this.emit("after-changes",{target:this}),this.emit("change",s)}}else{this._uninitializedSublayerExtensions.add(e);const t={added:[e],moved:[],removed:[],target:this};this.emit("after-add",{item:e,target:this}),this.emit("after-changes",{target:this}),this.emit("change",t)}this._onAdded(e)}_itemIsInitialized(e){return super._itemIsInitialized(e)&&!!e.sublayer}_onAdded(e){}_onRemoved(e){e._setLayerExtension(void 0)}_forSublayer(e){for(const e of this._uninitializedSublayerExtensions)e._resolveSublayer(),e.sublayer&&(this._sublayerExtensionMap.set(e.sublayer,e),this._uninitializedSublayerExtensions.delete(e));if(!this._sublayerExtensionMap.has(e)){const t=u.create({sublayer:e});this._register(t)}return this._sublayerExtensionMap.get(e)}}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vertigis/arcgis-extensions",
3
3
  "license": "SEE LICENSE IN LICENSE",
4
- "version": "49.8.1",
4
+ "version": "50.0.0",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://dev.azure.com/vertigis/Studio/_git/arcgis-extensions-ts"
@@ -1 +1 @@
1
- import e from"@arcgis/core/portal/Portal";import i from"@arcgis/core/portal/PortalItem";import{isBuildingSceneLayer as r}from"../utilities/_layers.js";import{checkArg as a}from"../utilities/checkArg.js";import{isNumeric as t}from"../utilities/number.js";import{parallelEach as l}from"../utilities/promise.js";import{BuildingSceneSublayer as s}from"./BuildingSceneSublayer.js";import{LayerDefinition as o}from"./LayerDefinition.js";import{ERR_LAYER_TYPE_MISMATCH as n,applyLayerBaseToEsriApiLayer as y,applyOperationalLayerToEsriApiLayer as p,fromEsriApiLayerToLayerBase as u,fromEsriApiLayerToOperationalLayer as c}from"./_layerHelper.js";const d=new WeakMap;export var BuildingSceneLayer;async function f(e,i){e.sublayers&&await l(e.sublayers,(async e=>{const r=i.allSublayers.find((i=>i.id===e.id));r&&await s.applyToEsriApiBuildingSublayer(e,r)}))}!function(l){async function m(t,l,s){if(a("layerJson",t).isNotMissing(),a("layerJson.layerType",t.layerType).satisfies((e=>!e||"BuildingSceneLayer"===e),n),a("layer",l).isNotMissing().satisfies(r,n),y(t,l),p(t,l),t.hasOwnProperty("url")&&(l.url=t.url),t.hasOwnProperty("itemId")&&(l.portalItem?l.portalItem.id=t.itemId:l.portalItem=new i({id:t.itemId,portal:s||e.getDefault()})),t.hasOwnProperty("activeFilterId")&&(l.activeFilterId=t.activeFilterId),t.hasOwnProperty("filters")){const e=(await import("@arcgis/core/layers/support/BuildingFilter")).default;l.filters.addMany(t.filters.map((i=>e.fromJSON(i))).filter((e=>!l.filters.find((i=>i.id===e.id)))))}if(t.hasOwnProperty("layerDefinition")&&await o.applyToEsriApiLayer(t.layerDefinition,l),l.loaded)await f(t,l);else if(d.has(l))d.set(l,{...d.get(l),...t});else{d.set(l,t);const e=l.watch("loaded",(async()=>{await f(d.get(l),l),d.delete(l),e.remove()}),!0)}}l.esriBuildingSceneLayerDefaults={elevationInfo:{mode:"absolute-height",offset:0,unit:"meters"},listMode:"show",maxScale:0,minScale:0,opacity:1,visible:!0},l.toEsriApiLayer=async function(e,i){a("layerJson",e).isNotMissing(),a("layerJson.layerType",e.layerType).satisfies((e=>!e||"BuildingSceneLayer"===e),n);const r=new((await import("@arcgis/core/layers/BuildingSceneLayer")).default);return await m(e,r,i),r},l.applyToEsriApiLayer=m,l.fromEsriApiBuildingSceneLayer=function(e){a("layer",e).isNotMissing();const i={...u(e,l.esriBuildingSceneLayerDefaults),...c(e),layerType:"BuildingSceneLayer",url:t(e.layerId)?`${e.url}/layers/${e.layerId}`:e.url};return e.portalItem&&(i.itemId=e.portalItem.id),i.layerDefinition=o.fromEsriApiLayer(e,l.esriBuildingSceneLayerDefaults),e.activeFilterId&&(i.activeFilterId=e.activeFilterId),e.filters&&(i.filters=e.filters.toArray().map((e=>e.toJSON()))),e.allSublayers&&(i.sublayers=e.allSublayers.toArray().map((e=>s.fromEsriApiBuildingSublayer(e)))),i}}(BuildingSceneLayer||(BuildingSceneLayer={}));
1
+ import e from"@arcgis/core/portal/Portal";import i from"@arcgis/core/portal/PortalItem";import{watch as r}from"../support/observableUtils.js";import{isBuildingSceneLayer as a}from"../utilities/_layers.js";import{checkArg as t}from"../utilities/checkArg.js";import{isNumeric as l}from"../utilities/number.js";import{parallelEach as s}from"../utilities/promise.js";import{BuildingSceneSublayer as o}from"./BuildingSceneSublayer.js";import{LayerDefinition as n}from"./LayerDefinition.js";import{ERR_LAYER_TYPE_MISMATCH as y,applyLayerBaseToEsriApiLayer as p,applyOperationalLayerToEsriApiLayer as u,fromEsriApiLayerToLayerBase as c,fromEsriApiLayerToOperationalLayer as d}from"./_layerHelper.js";const f=new WeakMap;export var BuildingSceneLayer;async function m(e,i){e.sublayers&&await s(e.sublayers,(async e=>{const r=i.allSublayers.find((i=>i.id===e.id));r&&await o.applyToEsriApiBuildingSublayer(e,r)}))}!function(s){async function g(l,s,o){if(t("layerJson",l).isNotMissing(),t("layerJson.layerType",l.layerType).satisfies((e=>!e||"BuildingSceneLayer"===e),y),t("layer",s).isNotMissing().satisfies(a,y),p(l,s),u(l,s),l.hasOwnProperty("url")&&(s.url=l.url),l.hasOwnProperty("itemId")&&(s.portalItem?s.portalItem.id=l.itemId:s.portalItem=new i({id:l.itemId,portal:o||e.getDefault()})),l.hasOwnProperty("activeFilterId")&&(s.activeFilterId=l.activeFilterId),l.hasOwnProperty("filters")){const e=(await import("@arcgis/core/layers/support/BuildingFilter")).default;s.filters.addMany(l.filters.map((i=>e.fromJSON(i))).filter((e=>!s.filters.find((i=>i.id===e.id)))))}l.hasOwnProperty("layerDefinition")&&await n.applyToEsriApiLayer(l.layerDefinition,s),s.loaded?await m(l,s):f.has(s)?f.set(s,{...f.get(s),...l}):(f.set(s,l),r(s,"loaded",(async()=>{await m(f.get(s),s),f.delete(s)}),{once:!0}))}s.esriBuildingSceneLayerDefaults={elevationInfo:{mode:"absolute-height",offset:0,unit:"meters"},listMode:"show",maxScale:0,minScale:0,opacity:1,visible:!0},s.toEsriApiLayer=async function(e,i){t("layerJson",e).isNotMissing(),t("layerJson.layerType",e.layerType).satisfies((e=>!e||"BuildingSceneLayer"===e),y);const r=new((await import("@arcgis/core/layers/BuildingSceneLayer")).default);return await g(e,r,i),r},s.applyToEsriApiLayer=g,s.fromEsriApiBuildingSceneLayer=function(e){t("layer",e).isNotMissing();const i={...c(e,s.esriBuildingSceneLayerDefaults),...d(e),layerType:"BuildingSceneLayer",url:l(e.layerId)?`${e.url}/layers/${e.layerId}`:e.url};return e.portalItem&&(i.itemId=e.portalItem.id),i.layerDefinition=n.fromEsriApiLayer(e,s.esriBuildingSceneLayerDefaults),e.activeFilterId&&(i.activeFilterId=e.activeFilterId),e.filters&&(i.filters=e.filters.toArray().map((e=>e.toJSON()))),e.allSublayers&&(i.sublayers=e.allSublayers.toArray().map((e=>o.fromEsriApiBuildingSublayer(e)))),i}}(BuildingSceneLayer||(BuildingSceneLayer={}));
@@ -1 +1 @@
1
- import{whenOnce as e}from"@arcgis/core/core/reactiveUtils.js";import{isSubtypeGroupLayer as r}from"../utilities/_layers.js";import{checkArg as s}from"../utilities/checkArg.js";import{LayerDefinition as a}from"./LayerDefinition.js";import{SubtypeSublayer as t}from"./SubtypeSublayer.js";import{ERR_LAYER_TYPE_MISMATCH as o,applyLayerBaseToEsriApiLayer as i,applyOperationalLayerToEsriApiLayer as y,fromEsriApiLayerToLayerBase as p,fromEsriApiLayerToOperationalLayer as u}from"./_layerHelper.js";export var SubtypeGroupLayer;!function(n){async function l(p,u){s("layerJson",p).isNotMissing();const n=p.layerType||p.type;if(s("layerJson.layerType",n).satisfies((e=>!e||"SubtypeGroupLayer"===e),o),s("layer",u).isNotMissing().satisfies(r,o),i(p,u),y(p,u),p.hasOwnProperty("url")&&(u.url=p.url),p.hasOwnProperty("customParameters")&&(u.customParameters={...p.customParameters},p.customParameters.hasOwnProperty("gdbVersion")&&(u.gdbVersion=p.customParameters.gdbVersion)),p.hasOwnProperty("layerDefinition")&&await a.applyToEsriApiLayer(p.layerDefinition,u),p.hasOwnProperty("layers")){const r=async()=>{p.layers.length>0&&p.layers.some((e=>u.sublayers.map((e=>e.subtypeCode)).includes(+e.subtypeCode)))&&(u.sublayers=u.sublayers.filter((e=>p.layers.some((r=>+r.subtypeCode===e.subtypeCode))))),await Promise.all(u.sublayers.map((e=>{const r=p.layers.find((r=>+r.subtypeCode===e.subtypeCode));if(r)return t.applyToEsriApiLayer(r,e)})))};u.loaded?await r():(async()=>{await e((()=>u.loaded)),await r()})()}}n.toEsriApiLayer=async function(e){s("layerJson",e).isNotMissing();const r=e.layerType||e.type;s("layerJson.layerType",r).satisfies((e=>!e||"SubtypeGroupLayer"===e),o);const a=new((await import("@arcgis/core/layers/SubtypeGroupLayer")).default);return await l(e,a),a},n.applyToEsriApiLayer=l,n.fromEsriApiSubtypeGroupLayer=function(e){s("subtypeGroupLayer",e).isNotMissing();const r={...p(e),...u(e),layerType:"SubtypeGroupLayer",url:e.url,customParameters:{...e.customParameters,gdbVersion:e.gdbVersion},layerDefinition:a.fromEsriApiLayer(e),layers:[]};return e.sublayers.forEach((e=>{r.layers.push(t.fromEsriApiSubtypeSublayer(e))})),r}}(SubtypeGroupLayer||(SubtypeGroupLayer={}));
1
+ import{watch as e}from"../support/observableUtils.js";import{isSubtypeGroupLayer as r}from"../utilities/_layers.js";import{checkArg as s}from"../utilities/checkArg.js";import{LayerDefinition as a}from"./LayerDefinition.js";import{SubtypeSublayer as o}from"./SubtypeSublayer.js";import{ERR_LAYER_TYPE_MISMATCH as t,applyLayerBaseToEsriApiLayer as y,applyOperationalLayerToEsriApiLayer as i,fromEsriApiLayerToLayerBase as p,fromEsriApiLayerToOperationalLayer as u}from"./_layerHelper.js";export var SubtypeGroupLayer;!function(l){async function n(p,u){s("layerJson",p).isNotMissing();const l=p.layerType||p.type;if(s("layerJson.layerType",l).satisfies((e=>!e||"SubtypeGroupLayer"===e),t),s("layer",u).isNotMissing().satisfies(r,t),y(p,u),i(p,u),p.hasOwnProperty("url")&&(u.url=p.url),p.hasOwnProperty("customParameters")&&(u.customParameters={...p.customParameters},p.customParameters.hasOwnProperty("gdbVersion")&&(u.gdbVersion=p.customParameters.gdbVersion)),p.hasOwnProperty("layerDefinition")&&await a.applyToEsriApiLayer(p.layerDefinition,u),p.hasOwnProperty("layers")){const r=async()=>{p.layers.length>0&&p.layers.some((e=>u.sublayers.map((e=>e.subtypeCode)).includes(+e.subtypeCode)))&&(u.sublayers=u.sublayers.filter((e=>p.layers.some((r=>+r.subtypeCode===e.subtypeCode))))),await Promise.all(u.sublayers.map((e=>{const r=p.layers.find((r=>+r.subtypeCode===e.subtypeCode));if(r)return o.applyToEsriApiLayer(r,e)})))};u.loaded?await r():e(u,"loaded",r,{once:!0})}}l.toEsriApiLayer=async function(e){s("layerJson",e).isNotMissing();const r=e.layerType||e.type;s("layerJson.layerType",r).satisfies((e=>!e||"SubtypeGroupLayer"===e),t);const a=new((await import("@arcgis/core/layers/SubtypeGroupLayer")).default);return await n(e,a),a},l.applyToEsriApiLayer=n,l.fromEsriApiSubtypeGroupLayer=function(e){s("subtypeGroupLayer",e).isNotMissing();const r={...p(e),...u(e),layerType:"SubtypeGroupLayer",url:e.url,customParameters:{...e.customParameters,gdbVersion:e.gdbVersion},layerDefinition:a.fromEsriApiLayer(e),layers:[]};return e.sublayers.forEach((e=>{r.layers.push(o.fromEsriApiSubtypeSublayer(e))})),r}}(SubtypeGroupLayer||(SubtypeGroupLayer={}));
@@ -1 +1 @@
1
- import{whenOnce as e}from"@arcgis/core/core/reactiveUtils.js";import r from"@arcgis/core/geometry/Extent";import a from"@arcgis/core/geometry/SpatialReference";import{geographicToWebMercator as t,webMercatorToGeographic as s}from"@arcgis/core/geometry/support/webMercatorUtils";import i from"@arcgis/core/portal/Portal";import o from"@arcgis/core/portal/PortalItem";import{isWMSLayer as n}from"../utilities/_layers.js";import{checkArg as m}from"../utilities/checkArg.js";import{parallelEach as l}from"../utilities/promise.js";import{SpatialReference as p}from"./SpatialReference.js";import{WMSSublayer as y}from"./WMSSublayer.js";import{applyLayerBaseToEsriApiLayer as c,applyBasemapLayerToEsriApiLayer as f,applyOperationalLayerToEsriApiLayer as u,fromEsriApiLayerToLayerBase as g,fromEsriApiLayerToOperationalLayer as h}from"./_layerHelper.js";export var WMSLayer;!function(x){async function P(s,g,h){if(m("layerJson",s).isNotMissing(),m("layer",g).isNotMissing().satisfies(n),m("layerJson.layerType",s.layerType).satisfies((e=>!e||"WMS"===e)),c(s,g),f(s,g),u(s,g),s.hasOwnProperty("copyright")&&(g.copyright=s.copyright),s.hasOwnProperty("customLayerParameters")&&(g.customLayerParameters={...s.customLayerParameters}),s.hasOwnProperty("customParameters")&&(g.customParameters={...s.customParameters}),s.hasOwnProperty("featureInfoFormat")&&(g.featureInfoFormat=s.featureInfoFormat),s.hasOwnProperty("featureInfoUrl")&&(g.featureInfoUrl=s.featureInfoUrl),g.imageFormat=s.hasOwnProperty("format")?s.format:"image/png",s.hasOwnProperty("itemId")&&(g.portalItem?g.portalItem.id=s.itemId:g.portalItem=new o({id:s.itemId,portal:h||i.getDefault()})),s.hasOwnProperty("layers")){const r=async()=>{await l(s.layers,(async e=>{const r=g.sublayers.find((r=>r.name===e.name));r&&await y.applyToEsriApiWMSSublayer(e,r)})),g.sublayers.removeMany(g.sublayers.filter((e=>!s.layers.some((r=>r.name===e.name)))))};g.sublayers?await r():(async()=>{await e((()=>g.sublayers)),await r()})()}if(s.hasOwnProperty("visibleLayers")){const r=()=>g.sublayers.forEach((e=>{e.visible=s.visibleLayers.includes(e.name)}));g.sublayers?r():(async()=>{await e((()=>g.sublayers)),r()})()}if(s.hasOwnProperty("mapUrl")&&(g.mapUrl=s.mapUrl),s.hasOwnProperty("maxHeight")&&(g.imageMaxHeight=s.maxHeight),s.hasOwnProperty("maxWidth")&&(g.imageMaxWidth=s.maxWidth),s.hasOwnProperty("spatialReferences")&&s.spatialReferences.length&&(g.spatialReferences=s.spatialReferences.slice(),g.spatialReference||(g.spatialReference=p.toEsriApiSpatialReference({wkid:s.spatialReferences[0]}))),s.hasOwnProperty("extent")){const e=new r({xmin:s.extent[0][0],ymin:s.extent[0][1],xmax:s.extent[1][0],ymax:s.extent[1][1],spatialReference:a.WGS84});(g.spatialReference?.isWGS84||g.spatialReference?.isWebMercator)&&(g.fullExtent=g.spatialReference.isWGS84?e:t(e))}s.hasOwnProperty("url")&&(g.url=s.url),s.hasOwnProperty("version")&&(g.version=s.version)}x.toEsriApiLayer=async function(e){m("layerJson",e).isNotMissing(),m("layerJson.layerType",e.layerType).satisfies((e=>!e||"WMS"===e));const r=new((await import("@arcgis/core/layers/WMSLayer")).default);return await P(e,r),r},x.applyToEsriApiLayer=P,x.fromEsriApiLayer=function(e){m("layer",e).isNotMissing();const r={...g(e),...h(e),layerType:"WMS",visibleLayers:[]};if(e.copyright&&(r.copyright=e.copyright),e.customLayerParameters&&(r.customLayerParameters={...e.customLayerParameters}),e.customParameters&&(r.customParameters={...e.customParameters}),e.fullExtent&&(e.spatialReference.isWGS84||e.spatialReference.isWebMercator)){const a=e.spatialReference.isWGS84?e.fullExtent:s(e.fullExtent,!1);r.extent=[[],[]],r.extent[0][0]=a.xmin,r.extent[0][1]=a.ymin,r.extent[1][0]=a.xmax,r.extent[1][1]=a.ymax}return e.featureInfoFormat&&(r.featureInfoFormat=e.featureInfoFormat),e.featureInfoUrl&&(r.featureInfoUrl=e.featureInfoUrl),e.imageFormat&&(r.format=e.imageFormat),e.portalItem&&(r.itemId=e.portalItem.id),e.sublayers&&(r.layers=[],e.sublayers.forEach((e=>{const a=y.fromEsriApiWMSSublayer(e);r.layers.push(a),e.visible&&r.visibleLayers.push(e.name)}))),e.imageMaxHeight&&(r.maxHeight=e.imageMaxHeight),e.imageMaxWidth&&(r.maxWidth=e.imageMaxWidth),e.mapUrl&&(r.mapUrl=e.mapUrl),e.spatialReferences&&(r.spatialReferences=e.spatialReferences.slice()),e.url&&(r.url=e.url),e.version&&(r.version=e.version),r}}(WMSLayer||(WMSLayer={}));
1
+ import e from"@arcgis/core/geometry/Extent";import r from"@arcgis/core/geometry/SpatialReference";import{geographicToWebMercator as a,webMercatorToGeographic as t}from"@arcgis/core/geometry/support/webMercatorUtils";import s from"@arcgis/core/portal/Portal";import i from"@arcgis/core/portal/PortalItem";import{watch as o}from"../support/observableUtils.js";import{isWMSLayer as n}from"../utilities/_layers.js";import{checkArg as m}from"../utilities/checkArg.js";import{parallelEach as l}from"../utilities/promise.js";import{SpatialReference as p}from"./SpatialReference.js";import{WMSSublayer as y}from"./WMSSublayer.js";import{applyLayerBaseToEsriApiLayer as f,applyBasemapLayerToEsriApiLayer as c,applyOperationalLayerToEsriApiLayer as u,fromEsriApiLayerToLayerBase as h,fromEsriApiLayerToOperationalLayer as g}from"./_layerHelper.js";export var WMSLayer;!function(x){async function P(t,h,g){if(m("layerJson",t).isNotMissing(),m("layer",h).isNotMissing().satisfies(n),m("layerJson.layerType",t.layerType).satisfies((e=>!e||"WMS"===e)),f(t,h),c(t,h),u(t,h),t.hasOwnProperty("copyright")&&(h.copyright=t.copyright),t.hasOwnProperty("customLayerParameters")&&(h.customLayerParameters={...t.customLayerParameters}),t.hasOwnProperty("customParameters")&&(h.customParameters={...t.customParameters}),t.hasOwnProperty("featureInfoFormat")&&(h.featureInfoFormat=t.featureInfoFormat),t.hasOwnProperty("featureInfoUrl")&&(h.featureInfoUrl=t.featureInfoUrl),h.imageFormat=t.hasOwnProperty("format")?t.format:"image/png",t.hasOwnProperty("itemId")&&(h.portalItem?h.portalItem.id=t.itemId:h.portalItem=new i({id:t.itemId,portal:g||s.getDefault()})),t.hasOwnProperty("layers")){const e=async()=>{await l(t.layers,(async e=>{const r=h.sublayers.find((r=>r.name===e.name));r&&await y.applyToEsriApiWMSSublayer(e,r)})),h.sublayers.removeMany(h.sublayers.filter((e=>!t.layers.some((r=>r.name===e.name)))))};h.sublayers?await e():o(h,"sublayers",e,{once:!0})}if(t.hasOwnProperty("visibleLayers")){const e=()=>h.sublayers.forEach((e=>{e.visible=t.visibleLayers.includes(e.name)}));h.sublayers?e():o(h,"sublayers",e,{once:!0})}if(t.hasOwnProperty("mapUrl")&&(h.mapUrl=t.mapUrl),t.hasOwnProperty("maxHeight")&&(h.imageMaxHeight=t.maxHeight),t.hasOwnProperty("maxWidth")&&(h.imageMaxWidth=t.maxWidth),t.hasOwnProperty("spatialReferences")&&t.spatialReferences.length&&(h.spatialReferences=t.spatialReferences.slice(),h.spatialReference||(h.spatialReference=p.toEsriApiSpatialReference({wkid:t.spatialReferences[0]}))),t.hasOwnProperty("extent")){const s=new e({xmin:t.extent[0][0],ymin:t.extent[0][1],xmax:t.extent[1][0],ymax:t.extent[1][1],spatialReference:r.WGS84});(h.spatialReference?.isWGS84||h.spatialReference?.isWebMercator)&&(h.fullExtent=h.spatialReference.isWGS84?s:a(s))}t.hasOwnProperty("url")&&(h.url=t.url),t.hasOwnProperty("version")&&(h.version=t.version)}x.toEsriApiLayer=async function(e){m("layerJson",e).isNotMissing(),m("layerJson.layerType",e.layerType).satisfies((e=>!e||"WMS"===e));const r=new((await import("@arcgis/core/layers/WMSLayer")).default);return await P(e,r),r},x.applyToEsriApiLayer=P,x.fromEsriApiLayer=function(e){m("layer",e).isNotMissing();const r={...h(e),...g(e),layerType:"WMS",visibleLayers:[]};if(e.copyright&&(r.copyright=e.copyright),e.customLayerParameters&&(r.customLayerParameters={...e.customLayerParameters}),e.customParameters&&(r.customParameters={...e.customParameters}),e.fullExtent&&(e.spatialReference.isWGS84||e.spatialReference.isWebMercator)){const a=e.spatialReference.isWGS84?e.fullExtent:t(e.fullExtent,!1);r.extent=[[],[]],r.extent[0][0]=a.xmin,r.extent[0][1]=a.ymin,r.extent[1][0]=a.xmax,r.extent[1][1]=a.ymax}return e.featureInfoFormat&&(r.featureInfoFormat=e.featureInfoFormat),e.featureInfoUrl&&(r.featureInfoUrl=e.featureInfoUrl),e.imageFormat&&(r.format=e.imageFormat),e.portalItem&&(r.itemId=e.portalItem.id),e.sublayers&&(r.layers=[],e.sublayers.forEach((e=>{const a=y.fromEsriApiWMSSublayer(e);r.layers.push(a),e.visible&&r.visibleLayers.push(e.name)}))),e.imageMaxHeight&&(r.maxHeight=e.imageMaxHeight),e.imageMaxWidth&&(r.maxWidth=e.imageMaxWidth),e.mapUrl&&(r.mapUrl=e.mapUrl),e.spatialReferences&&(r.spatialReferences=e.spatialReferences.slice()),e.url&&(r.url=e.url),e.version&&(r.version=e.version),r}}(WMSLayer||(WMSLayer={}));
@@ -2,12 +2,13 @@ import type Collection from "@arcgis/core/core/Collection";
2
2
  import type { FailureMode } from "../FailureMode.js";
3
3
  import type { EventCallback } from "../support/esri.js";
4
4
  import { InitializeError } from "./InitializeError.js";
5
- import type { PropertyDefs } from "./Serializable.js";
5
+ import type { PropertyDefs, SerializeMode } from "./Serializable.js";
6
6
  import { SerializableBase } from "./Serializable.js";
7
+ import type { ObservableMixin } from "./observableUtils.js";
7
8
  /**
8
9
  * Represents an item that can be initialized.
9
10
  */
10
- export interface Initializable {
11
+ export interface Initializable extends ObservableMixin {
11
12
  /**
12
13
  * Indicates if the item has been initialized.
13
14
  */
@@ -57,10 +58,11 @@ export interface InitializableBaseProperties {
57
58
  */
58
59
  failureMode?: FailureMode;
59
60
  }
61
+ declare const InitializableBase_base: (abstract new (_properties?: InitializableBaseProperties) => SerializableBase<InitializableBaseProperties>) & (abstract new (...args: any[]) => ObservableMixin);
60
62
  /**
61
63
  * A base class that contains logic for initializing items.
62
64
  */
63
- export declare abstract class InitializableBase<TProperties extends InitializableBaseProperties = InitializableBaseProperties> extends SerializableBase<TProperties> implements Initializable {
65
+ export declare abstract class InitializableBase<TProperties extends InitializableBaseProperties = InitializableBaseProperties> extends InitializableBase_base implements Initializable {
64
66
  /**
65
67
  * See {@link support/InitializableBase!Initializable.isInitialized}.
66
68
  */
@@ -96,6 +98,12 @@ export declare abstract class InitializableBase<TProperties extends Initializabl
96
98
  destroy(): Promise<void>;
97
99
  on(name: string | string[], callback: EventCallback<any>): IHandle;
98
100
  emit(name: string, event: unknown): boolean;
101
+ toJSON(serializeMode?: SerializeMode): TProperties;
102
+ assignProperties(properties: Partial<TProperties>): void;
103
+ assignPropertiesAsync(properties: Partial<TProperties>): Promise<void>;
104
+ getDefaults(): TProperties;
105
+ getDefault<K extends keyof TProperties>(key: K): TProperties[K];
106
+ getSerializableProperties(serializeMode?: SerializeMode): PropertyDefs<TProperties>;
99
107
  protected _getSerializableProperties(): PropertyDefs<TProperties>;
100
108
  /**
101
109
  * Called to perform initialization of the
@@ -146,3 +154,4 @@ export interface InitializeCollectionOptions {
146
154
  * thrown by collection items with failureMode "warn".
147
155
  */
148
156
  export declare function initializeCollection<T extends InitializableBase = InitializableBase>(collection: Collection<T>, options?: InitializeCollectionOptions): Promise<void>;
157
+ export {};
@@ -1 +1 @@
1
- import{getLogger as i}from"../utilities/log.js";import{parallelEach as e}from"../utilities/promise.js";import{InitializeError as t}from"./InitializeError.js";import{SerializableBase as r}from"./Serializable.js";export class InitializableBase extends r{get isInitialized(){return this._isInitialized}get isDestroyed(){return this._isDestroyed}get failureMode(){return this._failureMode}set failureMode(i){this._failureMode=i}_isInitialized=!1;_isDestroyed=!1;_initializePromise;_destroyPromise;_failureMode="warn";async initialize(){return void 0===this._initializePromise&&(this._initializePromise=(async()=>{try{await this.finishAssignProperties(),await this._onInitialize(),await this._initializeChildren(),await this._postInitialize()}catch(i){throw i instanceof Error?(this._initializePromise=void 0,new t(this.failureMode,i,this)):i}this._isInitialized=!0,this.notifyChange("isInitialized")})()),this._initializePromise}async destroy(){return void 0===this._destroyPromise&&(this._destroyPromise=(async()=>{try{await this._onDestroy()}catch(i){throw this._destroyPromise=void 0,i}this._isDestroyed=!0,this.notifyChange("isDestroyed")})()),this._destroyPromise}on(i,e){return super.on(i,e)}emit(i,e){return super.emit(i,e)}_getSerializableProperties(){return{...super._getSerializableProperties(),failureMode:{serializeModes:["initial"],default:"warn"}}}async _onInitialize(){}async _postInitialize(){}async _onDestroy(){}async _initializeChildren(){await e(this._initializableChildCollections(),(i=>initializeCollection(i,{target:this,onInitializeWarning:i=>this.emit("initializeWarning",i)})))}*_initializableChildCollections(){}}const s={onInitializeWarning:()=>{}};export async function initializeCollection(r,a=s){const{onInitializeWarning:n,target:o}=a;await e(r.toArray(),(async e=>{const r=e.on("initializeWarning",n);try{await e.initialize()}catch(r){const s=r instanceof t?r:new t(e.failureMode,r,e);if("error"===s.failureMode)throw s;"warn"===s.failureMode&&i("geocortex.api.support.InitializeBase").warn({message:"Error attempting to initialize child item: {0}.",error:s},s.error.message);n({error:s,target:o})}finally{r.remove()}}))}
1
+ import{getLogger as i}from"../utilities/log.js";import{parallelEach as e}from"../utilities/promise.js";import{InitializeError as t}from"./InitializeError.js";import{SerializableBase as r}from"./Serializable.js";import{notifyChange as s,observable as a}from"./observableUtils.js";export class InitializableBase extends(a(r)){get isInitialized(){return this._isInitialized}get isDestroyed(){return this._isDestroyed}get failureMode(){return this._failureMode}set failureMode(i){this._failureMode=i}_isInitialized=!1;_isDestroyed=!1;_initializePromise;_destroyPromise;_failureMode="warn";async initialize(){return void 0===this._initializePromise&&(this._initializePromise=(async()=>{try{await this.finishAssignProperties(),await this._onInitialize(),await this._initializeChildren(),await this._postInitialize()}catch(i){throw i instanceof Error?(this._initializePromise=void 0,new t(this.failureMode,i,this)):i}this._isInitialized=!0,s(this,"isInitialized")})()),this._initializePromise}async destroy(){return void 0===this._destroyPromise&&(this._destroyPromise=(async()=>{try{await this._onDestroy()}catch(i){throw this._destroyPromise=void 0,i}this._isDestroyed=!0,s(this,"isDestroyed")})()),this._destroyPromise}on(i,e){return super.on(i,e)}emit(i,e){return super.emit(i,e)}toJSON(i="all"){return super.toJSON(i)}assignProperties(i){super.assignProperties(i)}assignPropertiesAsync(i){return super.assignPropertiesAsync(i)}getDefaults(){return super.getDefaults()}getDefault(i){return super.getDefault(i)}getSerializableProperties(i){return super.getSerializableProperties(i)}_getSerializableProperties(){return{...super._getSerializableProperties(),failureMode:{serializeModes:["initial"],default:"warn"}}}async _onInitialize(){}async _postInitialize(){}async _onDestroy(){}async _initializeChildren(){await e(this._initializableChildCollections(),(i=>initializeCollection(i,{target:this,onInitializeWarning:i=>this.emit("initializeWarning",i)})))}*_initializableChildCollections(){}}const n={onInitializeWarning:()=>{}};export async function initializeCollection(r,s=n){const{onInitializeWarning:a,target:o}=s;await e(r.toArray(),(async e=>{const r=e.on("initializeWarning",a);try{await e.initialize()}catch(r){const s=r instanceof t?r:new t(e.failureMode,r,e);if("error"===s.failureMode)throw s;"warn"===s.failureMode&&i("geocortex.api.support.InitializeBase").warn({message:"Error attempting to initialize child item: {0}.",error:s},s.error.message);a({error:s,target:o})}finally{r.remove()}}))}
@@ -1 +1 @@
1
- import{format as r}from"../utilities/format/string.js";export class InitializeError extends Error{failureMode;error;target;constructor(i,t,e,o,...s){super(r(o||"Failed to initialize item: {0}.",...o?s:[t])),this.name="InitializeError",this.failureMode=i,this.error=t,this.target=e}}
1
+ import{format as r}from"../utilities/format/string.js";export class InitializeError extends Error{failureMode;error;target;constructor(i,t,e,o,...s){super(r(o||"Failed to initialize item: {0}.",...o?s:[t])),this.name="InitializeError",this.failureMode=i,this.error=t,this.cause=t,this.target=e}}