@vertigis/arcgis-extensions 38.0.4 → 38.1.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 (748) hide show
  1. package/AccessDeniedError.js +1 -1
  2. package/AppConfig.schema.json +35 -39
  3. package/ArgumentMissingError.js +1 -1
  4. package/ArgumentOutOfRangeError.js +1 -1
  5. package/Entity.js +1 -1
  6. package/FailureMode.d.ts +1 -1
  7. package/Hyperlink.js +1 -1
  8. package/LanguageResources.d.ts +1 -3
  9. package/LanguageResources.js +1 -1
  10. package/NotFoundError.js +1 -1
  11. package/PortalUri.js +1 -1
  12. package/data/ArcGISServiceTableExtension.js +1 -1
  13. package/data/Attachment.js +1 -1
  14. package/data/Feature.js +1 -1
  15. package/data/FeatureList.d.ts +3 -3
  16. package/data/FeatureList.js +1 -1
  17. package/data/FeatureSaveError.js +1 -1
  18. package/data/FeatureSet.js +1 -1
  19. package/data/FeatureSettings.js +1 -1
  20. package/data/FeatureSourceBase.js +1 -1
  21. package/data/FeatureStream.js +1 -1
  22. package/data/FieldExtension.js +1 -1
  23. package/data/PopupContentExtension.js +1 -1
  24. package/data/Relationship.js +1 -1
  25. package/data/RelationshipBase.js +1 -1
  26. package/data/Schema.js +1 -1
  27. package/data/Table.js +1 -1
  28. package/data/TableExtension.js +1 -1
  29. package/data/TaskSettings.js +1 -1
  30. package/data/_Relationship.d.ts +3 -3
  31. package/data/_Relationship.js +1 -1
  32. package/data/_TableExtension.js +1 -1
  33. package/data/convert.js +1 -1
  34. package/data/support/DefaultRelationshipFactory.js +1 -1
  35. package/data/support/DefaultTableExtensionFactory.js +1 -1
  36. package/data/support/attachments.js +1 -1
  37. package/docs/html/assets/main.js +56 -52
  38. package/docs/html/assets/search.js +1 -1
  39. package/docs/html/assets/style.css +23 -0
  40. package/docs/html/classes/data_FeatureSet.FeatureSet.html +2 -2
  41. package/docs/html/classes/data_FeatureStream.FeatureStream.html +1 -1
  42. package/docs/html/classes/utilities_ObservableMap.ObservableMap.html +2 -2
  43. package/docs/html/classes/utilities_ObservableSet.ObservableSet.html +2 -2
  44. package/docs/html/classes/utilities_ObservableWeakSet.ObservableWeakSet.html +1 -1
  45. package/docs/html/classes/utilities_asyncIterable.AsyncQueue.html +1 -1
  46. package/docs/html/classes/utilities_date.DateFormatter.html +1 -1
  47. package/docs/html/classes/utilities_string.StringFormatter.html +6 -24
  48. package/docs/html/functions/utilities_string.format.html +2 -18
  49. package/docs/html/interfaces/LanguageResources.LanguageResourcesProperties.html +2 -7
  50. package/docs/html/interfaces/data_support_attachments.AttachmentEnabledLayer.html +4 -6
  51. package/docs/html/interfaces/mapping_BuildingSceneLayerExtension.BuildingSceneLayerProperties.html +1 -1
  52. package/docs/html/interfaces/mapping_FeatureLayerExtension.FeatureLayerProperties.html +1 -1
  53. package/docs/html/interfaces/mapping_FeatureLayerExtensionBase.FeatureLayerBaseProperties.html +1 -1
  54. package/docs/html/interfaces/mapping_PointCloudLayerExtension.PointCloudLayerProperties.html +1 -1
  55. package/docs/html/interfaces/portal_ApplicationProperties.ApplicationProperties.html +15 -12
  56. package/docs/html/interfaces/portal_Background.ColorBackground.html +3 -2
  57. package/docs/html/interfaces/portal_BaseMap.BaseMap-1.html +2 -1
  58. package/docs/html/interfaces/portal_BaseMapLayer.BaseMapLayerBase.html +2 -1
  59. package/docs/html/interfaces/portal_BingLayer.BingLayer.html +2 -1
  60. package/docs/html/interfaces/portal_Bookmark.Bookmark.html +2 -1
  61. package/docs/html/interfaces/portal_BuildingSceneLayer.BuildingSceneLayer-1.html +1 -1
  62. package/docs/html/interfaces/portal_CIMSymbol.CIMSymbol.html +2 -1
  63. package/docs/html/interfaces/portal_CSVLayer.CSVLayer-1.html +3 -2
  64. package/docs/html/interfaces/portal_Camera.Camera-1.html +2 -1
  65. package/docs/html/interfaces/portal_ClassBreaksRenderer.ClassBreakInfo.html +2 -1
  66. package/docs/html/interfaces/portal_ClassBreaksRenderer.ClassBreaksRenderer.html +2 -1
  67. package/docs/html/interfaces/portal_CodedValueDomain.CodedValue.html +1 -1
  68. package/docs/html/interfaces/portal_CodedValueDomain.CodedValueDomain-1.html +1 -1
  69. package/docs/html/interfaces/portal_ColorClassBreakInfo.ColorClassBreakInfo.html +2 -1
  70. package/docs/html/interfaces/portal_ColorUniqueValueInfos.ColorUniqueValueInfos.html +2 -1
  71. package/docs/html/interfaces/portal_DataSource.DataSourceBase.html +2 -2
  72. package/docs/html/interfaces/portal_DefinitionEditor.DefinitionEditor.html +2 -1
  73. package/docs/html/interfaces/portal_DefinitionEditor.Input.html +1 -1
  74. package/docs/html/interfaces/portal_DefinitionEditor.Parameter.html +1 -1
  75. package/docs/html/interfaces/portal_DrawingInfo.DrawingInfo-1.html +2 -1
  76. package/docs/html/interfaces/portal_DynamicDataLayer.DynamicDataLayer.html +2 -2
  77. package/docs/html/interfaces/portal_DynamicMapLayer.DynamicMapLayer.html +1 -1
  78. package/docs/html/interfaces/portal_ElevationInfo.ElevationInfo-1.html +1 -1
  79. package/docs/html/interfaces/portal_ElevationLayer.ElevationLayer-1.html +3 -2
  80. package/docs/html/interfaces/portal_Environment.Environment-1.html +2 -1
  81. package/docs/html/interfaces/portal_Extent.Extent.html +1 -1
  82. package/docs/html/interfaces/portal_ExtrudeSymbol3DLayer.ExtrudeSymbol3DLayer.html +2 -1
  83. package/docs/html/interfaces/portal_Feature.Feature-1.html +2 -1
  84. package/docs/html/interfaces/portal_FeatureCollection.FeatureCollection.html +2 -1
  85. package/docs/html/interfaces/portal_FeatureLayer.FeatureLayer-1.html +3 -2
  86. package/docs/html/interfaces/portal_FeatureSet.FeatureSet.html +2 -1
  87. package/docs/html/interfaces/portal_Field.Field-1.html +1 -1
  88. package/docs/html/interfaces/portal_FieldInfo.FieldInfo.html +2 -1
  89. package/docs/html/interfaces/portal_FillSymbol3DLayer.FillSymbol3DLayer.html +2 -1
  90. package/docs/html/interfaces/portal_FormInfo.FormAttachmentElement.html +1 -1
  91. package/docs/html/interfaces/portal_FormInfo.FormBarcodeScannerInput.html +1 -1
  92. package/docs/html/interfaces/portal_FormInfo.FormComboBoxInput.html +1 -1
  93. package/docs/html/interfaces/portal_FormInfo.FormDateTimePickerInput.html +1 -1
  94. package/docs/html/interfaces/portal_FormInfo.FormExpressionInfo.html +1 -1
  95. package/docs/html/interfaces/portal_FormInfo.FormFieldElement.html +1 -1
  96. package/docs/html/interfaces/portal_FormInfo.FormGroupElement.html +1 -1
  97. package/docs/html/interfaces/portal_FormInfo.FormInfo-1.html +1 -1
  98. package/docs/html/interfaces/portal_FormInfo.FormRadioButtonsInput.html +1 -1
  99. package/docs/html/interfaces/portal_FormInfo.FormRelationshipElement.html +1 -1
  100. package/docs/html/interfaces/portal_FormInfo.FormSwitchInput.html +1 -1
  101. package/docs/html/interfaces/portal_FormInfo.FormTextAreaInput.html +1 -1
  102. package/docs/html/interfaces/portal_FormInfo.FormTextBoxInput.html +1 -1
  103. package/docs/html/interfaces/portal_Format.Format.html +2 -1
  104. package/docs/html/interfaces/portal_GeoRSSLayer.GeoRSSLayer-1.html +3 -2
  105. package/docs/html/interfaces/portal_GroupLayer.GroupLayer-1.html +3 -2
  106. package/docs/html/interfaces/portal_HeatmapRenderer.ColorStop.html +2 -1
  107. package/docs/html/interfaces/portal_HeatmapRenderer.HeatmapRenderer.html +2 -1
  108. package/docs/html/interfaces/portal_IconSymbol3DLayer.IconSymbol3DLayer.html +2 -1
  109. package/docs/html/interfaces/portal_ImageServiceLayer.ImageServiceLayer-1.html +3 -2
  110. package/docs/html/interfaces/portal_ImageServiceVectorLayer.ImageServiceVectorLayer.html +3 -2
  111. package/docs/html/interfaces/portal_InheritedDomain.InheritedDomain-1.html +1 -1
  112. package/docs/html/interfaces/portal_InitialState.InitialState-1.html +2 -1
  113. package/docs/html/interfaces/portal_IntegratedMeshLayer.IntegratedMeshLayer-1.html +3 -2
  114. package/docs/html/interfaces/portal_Item.Item-1.html +3 -2
  115. package/docs/html/interfaces/portal_JoinTableDataSource.JoinTableDataSource.html +2 -2
  116. package/docs/html/interfaces/portal_KMLLayer.KMLLayer-1.html +3 -2
  117. package/docs/html/interfaces/portal_LabelSymbol3D.LabelSymbol3D.html +2 -1
  118. package/docs/html/interfaces/portal_LabelingInfo.LabelingInfo-1.html +3 -2
  119. package/docs/html/interfaces/portal_Layer.Layer-1.html +1 -1
  120. package/docs/html/interfaces/portal_LayerDefinition.FieldOverride.html +1 -1
  121. package/docs/html/interfaces/portal_LayerDefinition.LayerDefinition-1.html +4 -3
  122. package/docs/html/interfaces/portal_LayerDefinition.LayerTimeInfo.html +2 -2
  123. package/docs/html/interfaces/portal_Lighting.SunLighting.html +2 -1
  124. package/docs/html/interfaces/portal_Lighting.VirtualLighting.html +2 -1
  125. package/docs/html/interfaces/portal_LineSymbol3D.LineSymbol3D.html +2 -1
  126. package/docs/html/interfaces/portal_LineSymbol3DLayer.LineSymbol3DLayer.html +2 -1
  127. package/docs/html/interfaces/portal_LocationInfo.LocationInfo.html +2 -1
  128. package/docs/html/interfaces/portal_MapFloorInfo.FacilityLayerInfo.html +1 -1
  129. package/docs/html/interfaces/portal_MapFloorInfo.LevelLayerInfo.html +1 -1
  130. package/docs/html/interfaces/portal_MapFloorInfo.MapFloorInfo-1.html +1 -1
  131. package/docs/html/interfaces/portal_MapFloorInfo.SiteLayerInfo.html +1 -1
  132. package/docs/html/interfaces/portal_MapRangeInfo.MapRangeInfo.html +2 -1
  133. package/docs/html/interfaces/portal_MapServiceLayer.MapServiceLayer-1.html +3 -2
  134. package/docs/html/interfaces/portal_MeshSymbol3D.MeshSymbol3D.html +2 -1
  135. package/docs/html/interfaces/portal_MosaicRule.MosaicRule-1.html +2 -1
  136. package/docs/html/interfaces/portal_Multipoint.Multipoint.html +1 -1
  137. package/docs/html/interfaces/portal_ObjectSymbol3DLayer.ObjectSymbol3DLayer.html +2 -1
  138. package/docs/html/interfaces/portal_OpenStreetMapLayer.OpenStreetMapLayer-1.html +2 -1
  139. package/docs/html/interfaces/portal_OperationalLayer.OperationalLayerBase.html +1 -1
  140. package/docs/html/interfaces/portal_PathSymbol3DLayer.PathSymbol3DLayer.html +2 -1
  141. package/docs/html/interfaces/portal_PictureFillSymbol.PictureFillSymbol.html +2 -1
  142. package/docs/html/interfaces/portal_PictureMarkerSymbol.PictureMarkerSymbol.html +2 -1
  143. package/docs/html/interfaces/portal_Point.Point.html +2 -1
  144. package/docs/html/interfaces/portal_PointCloudBitfieldFilter.PointCloudBitfieldFilter.html +2 -1
  145. package/docs/html/interfaces/portal_PointCloudClassBreaksRenderer.PointCloudClassBreaksRenderer.html +4 -2
  146. package/docs/html/interfaces/portal_PointCloudFixedSizeAlgorithm.PointCloudFixedSizeAlgorithm.html +2 -1
  147. package/docs/html/interfaces/portal_PointCloudLayer.PointCloudLayer-1.html +3 -2
  148. package/docs/html/interfaces/portal_PointCloudRGBRenderer.PointCloudRGBRenderer.html +4 -2
  149. package/docs/html/interfaces/portal_PointCloudRenderer.PointCloudRendererBase.html +4 -2
  150. package/docs/html/interfaces/portal_PointCloudReturnFilter.PointCloudReturnFilter.html +2 -1
  151. package/docs/html/interfaces/portal_PointCloudSplatAlgorithm.PointCloudSplatAlgorithm.html +2 -1
  152. package/docs/html/interfaces/portal_PointCloudStretchRenderer.PointCloudStretchRenderer.html +4 -2
  153. package/docs/html/interfaces/portal_PointCloudUniqueValueRenderer.PointCloudUniqueValueRenderer.html +4 -2
  154. package/docs/html/interfaces/portal_PointCloudValueFilter.PointCloudValueFilter.html +2 -1
  155. package/docs/html/interfaces/portal_PointSymbol3D.PointSymbol3D.html +3 -2
  156. package/docs/html/interfaces/portal_Polygon.Polygon.html +1 -1
  157. package/docs/html/interfaces/portal_PolygonSymbol3D.PolygonSymbol3D.html +2 -1
  158. package/docs/html/interfaces/portal_Polyline.Polyline.html +1 -1
  159. package/docs/html/interfaces/portal_PopupExpressionInfo.PopupExpressionInfo.html +2 -1
  160. package/docs/html/interfaces/portal_PopupInfo.OrderByFields.html +2 -1
  161. package/docs/html/interfaces/portal_PopupInfo.RelatedRecordsInfo.html +2 -1
  162. package/docs/html/interfaces/portal_PredominanceRenderer.PredominanceRenderer.html +2 -1
  163. package/docs/html/interfaces/portal_Presentation.Presentation-1.html +2 -1
  164. package/docs/html/interfaces/portal_QueryTableDataSource.QueryTableDataSource.html +2 -2
  165. package/docs/html/interfaces/portal_RangeDomain.RangeDomain-1.html +1 -1
  166. package/docs/html/interfaces/portal_RangeInfo.RangeInfo.html +2 -1
  167. package/docs/html/interfaces/portal_RasterDataSource.RasterDataSource.html +2 -2
  168. package/docs/html/interfaces/portal_Renderer.AuthoringInfo.html +2 -1
  169. package/docs/html/interfaces/portal_Renderer.ColorRamp.html +1 -1
  170. package/docs/html/interfaces/portal_Renderer.RendererBase.html +2 -1
  171. package/docs/html/interfaces/portal_RenderingRule.RenderingRule-1.html +3 -2
  172. package/docs/html/interfaces/portal_SceneLayer.SceneLayer-1.html +3 -2
  173. package/docs/html/interfaces/portal_SimpleFillSymbol.SimpleFillSymbol.html +2 -1
  174. package/docs/html/interfaces/portal_SimpleLineSymbol.SimpleLineSymbol.html +2 -1
  175. package/docs/html/interfaces/portal_SimpleMarkerSymbol.SimpleMarkerSymbol.html +2 -1
  176. package/docs/html/interfaces/portal_SimpleRenderer.SimpleRenderer.html +2 -1
  177. package/docs/html/interfaces/portal_Slide.Slide-1.html +4 -4
  178. package/docs/html/interfaces/portal_SpatialReference.SpatialReference-1.html +2 -1
  179. package/docs/html/interfaces/portal_StreamLayer.StreamLayer-1.html +2 -2
  180. package/docs/html/interfaces/portal_StyleSymbolReference.StyleSymbolReference.html +2 -1
  181. package/docs/html/interfaces/portal_SubtypeGroupLayer.SubtypeGroupLayer-1.html +3 -2
  182. package/docs/html/interfaces/portal_SubtypeGroupLayer.SubtypeSubtypeGroupLayer.html +2 -2
  183. package/docs/html/interfaces/portal_SubtypeSublayer.SubtypeSublayer-1.html +3 -2
  184. package/docs/html/interfaces/portal_Symbol.Font.html +1 -1
  185. package/docs/html/interfaces/portal_Symbol3D.Material.html +2 -1
  186. package/docs/html/interfaces/portal_Symbol3D.Outline.html +2 -1
  187. package/docs/html/interfaces/portal_Symbol3D.ResourceIconSymbol.html +2 -1
  188. package/docs/html/interfaces/portal_Symbol3D.ResourceObjectSymbol.html +2 -1
  189. package/docs/html/interfaces/portal_Table.Table.html +1 -1
  190. package/docs/html/interfaces/portal_TableDataSource.TableDataSource.html +2 -2
  191. package/docs/html/interfaces/portal_Template.Template-1.html +2 -1
  192. package/docs/html/interfaces/portal_TemporalRenderer.TemporalRenderer.html +2 -1
  193. package/docs/html/interfaces/portal_TextSymbol.TextSymbol.html +2 -1
  194. package/docs/html/interfaces/portal_TextSymbol3DLayer.TextSymbol3DLayer.html +2 -1
  195. package/docs/html/interfaces/portal_TileInfo.TileInfo-1.html +3 -2
  196. package/docs/html/interfaces/portal_TiledImageServiceLayer.TiledImageServiceLayer-1.html +3 -2
  197. package/docs/html/interfaces/portal_TiledMapServiceLayer.TiledMapServiceLayer-1.html +4 -3
  198. package/docs/html/interfaces/portal_Type.Type-1.html +3 -8
  199. package/docs/html/interfaces/portal_UniqueValueFromStyle.UniqueValueFromStyle.html +2 -1
  200. package/docs/html/interfaces/portal_UniqueValueRenderer.UniqueValueInfo.html +2 -1
  201. package/docs/html/interfaces/portal_UniqueValueRenderer.UniqueValueRenderer.html +2 -1
  202. package/docs/html/interfaces/portal_UtilityNetwork.TraceConfiguration.html +1 -1
  203. package/docs/html/interfaces/portal_UtilityNetwork.UtilityNetwork-1.html +1 -1
  204. package/docs/html/interfaces/portal_Value.Value.html +1 -1
  205. package/docs/html/interfaces/portal_VectorTileLayer.VectorTileLayer-1.html +3 -2
  206. package/docs/html/interfaces/portal_VerticalOffset.VerticalOffset.html +1 -1
  207. package/docs/html/interfaces/portal_Viewpoint.Viewpoint-1.html +2 -1
  208. package/docs/html/interfaces/portal_VisualVariable.ColorInfo.html +3 -2
  209. package/docs/html/interfaces/portal_VisualVariable.RotationInfo.html +3 -2
  210. package/docs/html/interfaces/portal_VisualVariable.Size.html +2 -1
  211. package/docs/html/interfaces/portal_VisualVariable.SizeInfo.html +3 -2
  212. package/docs/html/interfaces/portal_VisualVariable.TransparencyInfo.html +2 -1
  213. package/docs/html/interfaces/portal_VisualVariable.VisualVariableBase.html +1 -1
  214. package/docs/html/interfaces/portal_WMSLayer.WMSLayer-1.html +3 -2
  215. package/docs/html/interfaces/portal_WMSSublayer.WMSSublayer-1.html +2 -1
  216. package/docs/html/interfaces/portal_WMTSInfo.WMTSInfo-1.html +1 -1
  217. package/docs/html/interfaces/portal_Weather.CloudyWeather.html +2 -1
  218. package/docs/html/interfaces/portal_Weather.FoggyWeather.html +2 -1
  219. package/docs/html/interfaces/portal_Weather.RainyWeather.html +2 -1
  220. package/docs/html/interfaces/portal_Weather.SnowyWeather.html +2 -1
  221. package/docs/html/interfaces/portal_Weather.SunnyWeather.html +2 -1
  222. package/docs/html/interfaces/portal_WebMap.WebMap-1.html +3 -3
  223. package/docs/html/interfaces/portal_WebScene.WebScene-1.html +5 -3
  224. package/docs/html/interfaces/portal_WebSceneBaseMap.WebSceneBaseMap-1.html +2 -1
  225. package/docs/html/interfaces/portal_WebTileLayer.WebTileLayer-1.html +3 -2
  226. package/docs/html/interfaces/portal_Widgets.FloorFilter.html +1 -1
  227. package/docs/html/interfaces/portal_Widgets.Range.html +1 -1
  228. package/docs/html/interfaces/portal_Widgets.TimeSlider.html +3 -2
  229. package/docs/html/interfaces/portal_Widgets.Widgets.html +2 -1
  230. package/docs/html/interfaces/support_Serializable.PropertyDef.html +2 -2
  231. package/docs/html/interfaces/tasks_identify_IdentifyOptions.IdentifyOptions-1.html +2 -2
  232. package/docs/html/interfaces/tasks_search_SearchOptions.SearchOptions-1.html +2 -2
  233. package/docs/html/interfaces/utilities_array.CompareOptions.html +8 -8
  234. package/docs/html/interfaces/utilities_geometry.GeographicTransformationJson.html +1 -1
  235. package/docs/html/types/portal_DataSource.DataSource.html +1 -0
  236. package/docs/html/types/portal_Domain.Domain-1.html +2 -1
  237. package/docs/html/types/portal_Geometry.Geometry.html +1 -1
  238. package/docs/html/types/portal_PointCloudFilter.PointCloudFilter.html +2 -1
  239. package/docs/html/types/portal_Symbol.Color.html +1 -1
  240. package/docs/html/types/portal_Symbol.Symbol.html +1 -1
  241. package/docs/html/types/portal_Symbol3D.Symbol3D.html +2 -1
  242. package/docs/html/types/portal_VisualVariable.VisualVariable.html +2 -1
  243. package/docs/html/variables/mapping_BasemapExtension.defaultBasemapExtensionFactory.html +2 -2
  244. package/docs/html/variables/version.version.html +1 -1
  245. package/forked-libs/dbf/src/fields.js +1 -1
  246. package/forked-libs/dbf/src/structure.js +1 -1
  247. package/forked-libs/shp-write/src/download.js +1 -1
  248. package/forked-libs/shp-write/src/fields.js +1 -1
  249. package/forked-libs/shp-write/src/geojson.js +1 -1
  250. package/forked-libs/shp-write/src/multipoint.js +1 -1
  251. package/forked-libs/shp-write/src/points.js +1 -1
  252. package/forked-libs/shp-write/src/poly.js +1 -1
  253. package/forked-libs/shp-write/src/write.js +1 -1
  254. package/forked-libs/shp-write/src/zip.js +1 -1
  255. package/layer-preset/LayerPreset.d.ts +1 -1
  256. package/layer-preset/LayerPreset.js +1 -1
  257. package/layer-preset/LayerPresetSettings.d.ts +1 -1
  258. package/layer-preset/LayerPresetSettings.js +1 -1
  259. package/locale/_registry.js +1 -1
  260. package/locale/af.js +1 -1
  261. package/locale/ar-MA.js +1 -1
  262. package/locale/ar-SA.js +1 -1
  263. package/locale/ar-TN.js +1 -1
  264. package/locale/ar.js +1 -1
  265. package/locale/az.js +1 -1
  266. package/locale/be.js +1 -1
  267. package/locale/bg.js +1 -1
  268. package/locale/bn.js +1 -1
  269. package/locale/bs.js +1 -1
  270. package/locale/ca.js +1 -1
  271. package/locale/cs.js +1 -1
  272. package/locale/cv.js +1 -1
  273. package/locale/cy.js +1 -1
  274. package/locale/da.js +1 -1
  275. package/locale/de-AT.js +1 -1
  276. package/locale/de.js +1 -1
  277. package/locale/el.js +1 -1
  278. package/locale/en-AU.js +1 -1
  279. package/locale/en-CA.js +1 -1
  280. package/locale/en-GB.js +1 -1
  281. package/locale/en.js +1 -1
  282. package/locale/es.js +1 -1
  283. package/locale/et.js +1 -1
  284. package/locale/eu.js +1 -1
  285. package/locale/fa.js +1 -1
  286. package/locale/fi.js +1 -1
  287. package/locale/fo.js +1 -1
  288. package/locale/fr-CA.js +1 -1
  289. package/locale/fr.js +1 -1
  290. package/locale/gl.js +1 -1
  291. package/locale/he.js +1 -1
  292. package/locale/hi.js +1 -1
  293. package/locale/hr.js +1 -1
  294. package/locale/hu.js +1 -1
  295. package/locale/hy.js +1 -1
  296. package/locale/id.js +1 -1
  297. package/locale/inv.js +1 -1
  298. package/locale/is.js +1 -1
  299. package/locale/it.js +1 -1
  300. package/locale/ja.js +1 -1
  301. package/locale/ka.js +1 -1
  302. package/locale/km.js +1 -1
  303. package/locale/ko.js +1 -1
  304. package/locale/language.js +1 -1
  305. package/locale/lt.js +1 -1
  306. package/locale/lv.js +1 -1
  307. package/locale/mk.js +1 -1
  308. package/locale/ml.js +1 -1
  309. package/locale/mr.js +1 -1
  310. package/locale/ms-MY.js +1 -1
  311. package/locale/ms.js +1 -1
  312. package/locale/my.js +1 -1
  313. package/locale/nb.js +1 -1
  314. package/locale/ne.js +1 -1
  315. package/locale/nl.js +1 -1
  316. package/locale/nn.js +1 -1
  317. package/locale/no.js +1 -1
  318. package/locale/pl.js +1 -1
  319. package/locale/pt-BR.js +1 -1
  320. package/locale/pt.js +1 -1
  321. package/locale/ro.js +1 -1
  322. package/locale/ru.js +1 -1
  323. package/locale/si.js +1 -1
  324. package/locale/sk.js +1 -1
  325. package/locale/sl.js +1 -1
  326. package/locale/sq.js +1 -1
  327. package/locale/sr-Cyrl.js +1 -1
  328. package/locale/sr-ME.js +1 -1
  329. package/locale/sr.js +1 -1
  330. package/locale/sv.js +1 -1
  331. package/locale/ta.js +1 -1
  332. package/locale/th.js +1 -1
  333. package/locale/tl.js +1 -1
  334. package/locale/tr.js +1 -1
  335. package/locale/tzm-Latn.js +1 -1
  336. package/locale/tzm.js +1 -1
  337. package/locale/uk.js +1 -1
  338. package/locale/uz.js +1 -1
  339. package/locale/vi.js +1 -1
  340. package/locale/zh-TW.js +1 -1
  341. package/locale/zh.js +1 -1
  342. package/locale.js +1 -1
  343. package/mapping/ArcGISSublayerExtension.js +1 -1
  344. package/mapping/BasemapExtension.js +1 -1
  345. package/mapping/Bookmark.d.ts +1 -1
  346. package/mapping/Bookmark.js +1 -1
  347. package/mapping/BuildingComponentSublayerExtension.js +1 -1
  348. package/mapping/BuildingGroupSublayerExtension.js +1 -1
  349. package/mapping/BuildingSceneLayerExtension.js +1 -1
  350. package/mapping/BuildingSublayerExtension.js +1 -1
  351. package/mapping/CSVLayerExtension.js +1 -1
  352. package/mapping/ElevationLayerExtension.js +1 -1
  353. package/mapping/FeatureCollectionLayerExtension.js +1 -1
  354. package/mapping/FeatureLayerExtension.js +1 -1
  355. package/mapping/FeatureLayerExtensionBase.js +1 -1
  356. package/mapping/GeoRSSLayerExtension.js +1 -1
  357. package/mapping/GraphicsLayerExtension.js +1 -1
  358. package/mapping/GroundExtension.d.ts +1 -1
  359. package/mapping/GroundExtension.js +1 -1
  360. package/mapping/GroupLayerExtension.js +1 -1
  361. package/mapping/ImageryLayerExtension.js +1 -1
  362. package/mapping/ImageryTileLayerExtension.js +1 -1
  363. package/mapping/IntegratedMeshLayerExtension.js +1 -1
  364. package/mapping/KMLLayerExtension.js +1 -1
  365. package/mapping/KMLSublayerExtension.js +1 -1
  366. package/mapping/LayerExtension.js +1 -1
  367. package/mapping/MapConstraints.js +1 -1
  368. package/mapping/MapExtension.d.ts +5 -5
  369. package/mapping/MapExtension.js +1 -1
  370. package/mapping/MapImageLayerExtension.d.ts +1 -1
  371. package/mapping/MapImageLayerExtension.js +1 -1
  372. package/mapping/MapImageSublayerExtension.js +1 -1
  373. package/mapping/OpenStreetMapLayerExtension.js +1 -1
  374. package/mapping/PointCloudLayerExtension.js +1 -1
  375. package/mapping/SceneLayerExtension.js +1 -1
  376. package/mapping/StreamLayerExtension.js +1 -1
  377. package/mapping/SublayerExtension.js +1 -1
  378. package/mapping/SubtypeGroupLayerExtension.js +1 -1
  379. package/mapping/SubtypeSublayerExtension.js +1 -1
  380. package/mapping/TileLayerExtension.js +1 -1
  381. package/mapping/TileSublayerExtension.js +1 -1
  382. package/mapping/UnsupportedLayerExtension.js +1 -1
  383. package/mapping/VectorTileLayerExtension.js +1 -1
  384. package/mapping/WMSLayerExtension.js +1 -1
  385. package/mapping/WMSSublayerExtension.js +1 -1
  386. package/mapping/WMTSLayerExtension.js +1 -1
  387. package/mapping/WMTSSublayerExtension.js +1 -1
  388. package/mapping/WebTileLayerExtension.js +1 -1
  389. package/mapping/_LayerExtension.d.ts +1 -1
  390. package/mapping/_LayerExtension.js +1 -1
  391. package/mapping/_SublayerExtension.d.ts +1 -1
  392. package/mapping/_SublayerExtension.js +1 -1
  393. package/mapping/convert.js +1 -1
  394. package/mapping/support/ArrayWrappedCollection.js +1 -1
  395. package/mapping/support/DefaultLayerExtensionFactory.js +1 -1
  396. package/mapping/support/DefaultSublayerExtensionFactory.js +1 -1
  397. package/mapping/support/LayerListSettings.js +1 -1
  398. package/mapping/support/PopupTemplateFeatureSettings.js +1 -1
  399. package/mapping/support/WfsCapabilities.js +1 -1
  400. package/mapping/support/WfsFeatureType.js +1 -1
  401. package/mapping/support/_LayerExtensionCollection.js +1 -1
  402. package/mapping/support/_SublayerExtensionCollection.js +1 -1
  403. package/mapping/support/_kml.js +1 -1
  404. package/mapping/support/ogc.js +1 -1
  405. package/menus/Menu.js +1 -1
  406. package/menus/MenuItem.js +1 -1
  407. package/package.json +36 -35
  408. package/portal/ApplicationProperties.d.ts +16 -13
  409. package/portal/Background.d.ts +3 -2
  410. package/portal/Background.js +1 -1
  411. package/portal/BaseMap.d.ts +1 -0
  412. package/portal/BaseMap.js +1 -1
  413. package/portal/BaseMapLayer.d.ts +3 -2
  414. package/portal/BingLayer.d.ts +1 -0
  415. package/portal/Bookmark.d.ts +1 -0
  416. package/portal/BuildingSceneLayer.d.ts +1 -1
  417. package/portal/BuildingSceneLayer.js +1 -1
  418. package/portal/BuildingSceneSublayer.js +1 -1
  419. package/portal/CIMSymbol.d.ts +1 -0
  420. package/portal/CSVLayer.d.ts +1 -0
  421. package/portal/CSVLayer.js +1 -1
  422. package/portal/Camera.d.ts +1 -0
  423. package/portal/Camera.js +1 -1
  424. package/portal/ClassBreaksRenderer.d.ts +4 -2
  425. package/portal/CodedValueDomain.d.ts +2 -2
  426. package/portal/CodedValueDomain.js +1 -1
  427. package/portal/ColorClassBreakInfo.d.ts +1 -0
  428. package/portal/ColorUniqueValueInfos.d.ts +1 -0
  429. package/portal/DataSource.d.ts +5 -4
  430. package/portal/DefinitionEditor.d.ts +3 -2
  431. package/portal/Domain.d.ts +3 -2
  432. package/portal/Domain.js +1 -1
  433. package/portal/DrawingInfo.d.ts +1 -0
  434. package/portal/DrawingInfo.js +1 -1
  435. package/portal/DynamicDataLayer.d.ts +2 -2
  436. package/portal/DynamicMapLayer.d.ts +1 -1
  437. package/portal/Edges.d.ts +1 -1
  438. package/portal/Edges.js +1 -1
  439. package/portal/Effect.d.ts +2 -2
  440. package/portal/ElevationInfo.d.ts +2 -2
  441. package/portal/ElevationInfo.js +1 -1
  442. package/portal/ElevationLayer.d.ts +1 -0
  443. package/portal/ElevationLayer.js +1 -1
  444. package/portal/Environment.d.ts +1 -0
  445. package/portal/Environment.js +1 -1
  446. package/portal/Extent.d.ts +1 -1
  447. package/portal/ExtrudeSymbol3DLayer.d.ts +1 -0
  448. package/portal/Feature.d.ts +1 -0
  449. package/portal/Feature.js +1 -1
  450. package/portal/FeatureCollection.d.ts +1 -0
  451. package/portal/FeatureLayer.d.ts +2 -1
  452. package/portal/FeatureLayer.js +1 -1
  453. package/portal/FeatureReduction.d.ts +1 -1
  454. package/portal/FeatureReduction.js +1 -1
  455. package/portal/FeatureSet.d.ts +1 -0
  456. package/portal/Field.d.ts +2 -2
  457. package/portal/Field.js +1 -1
  458. package/portal/FieldInfo.d.ts +2 -1
  459. package/portal/FillSymbol3DLayer.d.ts +1 -0
  460. package/portal/FormInfo.d.ts +13 -13
  461. package/portal/FormInfo.js +1 -1
  462. package/portal/Format.d.ts +2 -1
  463. package/portal/GeoRSSLayer.d.ts +1 -0
  464. package/portal/GeoRSSLayer.js +1 -1
  465. package/portal/Geometry.d.ts +3 -3
  466. package/portal/Geometry.js +1 -1
  467. package/portal/Ground.d.ts +1 -1
  468. package/portal/Ground.js +1 -1
  469. package/portal/GroupLayer.d.ts +2 -1
  470. package/portal/GroupLayer.js +1 -1
  471. package/portal/HeatmapRenderer.d.ts +2 -0
  472. package/portal/IconSymbol3DLayer.d.ts +1 -0
  473. package/portal/ImageServiceLayer.d.ts +1 -0
  474. package/portal/ImageServiceLayer.js +1 -1
  475. package/portal/ImageServiceVectorLayer.d.ts +1 -0
  476. package/portal/InheritedDomain.d.ts +1 -1
  477. package/portal/InheritedDomain.js +1 -1
  478. package/portal/InitialState.d.ts +1 -0
  479. package/portal/InitialState.js +1 -1
  480. package/portal/IntegratedMeshLayer.d.ts +1 -0
  481. package/portal/IntegratedMeshLayer.js +1 -1
  482. package/portal/Item.d.ts +2 -1
  483. package/portal/Item.js +1 -1
  484. package/portal/JoinTableDataSource.d.ts +2 -2
  485. package/portal/KMLLayer.d.ts +1 -0
  486. package/portal/KMLLayer.js +1 -1
  487. package/portal/LabelSymbol3D.d.ts +1 -0
  488. package/portal/LabelingInfo.d.ts +3 -2
  489. package/portal/LabelingInfo.js +1 -1
  490. package/portal/Layer.d.ts +1 -1
  491. package/portal/Layer.js +1 -1
  492. package/portal/LayerBase.js +1 -1
  493. package/portal/LayerDefinition.d.ts +8 -7
  494. package/portal/LayerDefinition.js +1 -1
  495. package/portal/Lighting.d.ts +3 -1
  496. package/portal/Lighting.js +1 -1
  497. package/portal/LineSymbol3D.d.ts +1 -0
  498. package/portal/LineSymbol3DLayer.d.ts +1 -0
  499. package/portal/LocationInfo.d.ts +1 -0
  500. package/portal/MapFloorInfo.d.ts +4 -4
  501. package/portal/MapFloorInfo.js +1 -1
  502. package/portal/MapRangeInfo.d.ts +1 -0
  503. package/portal/MapServiceLayer.d.ts +1 -0
  504. package/portal/MapServiceLayer.js +1 -1
  505. package/portal/MediaInfo.d.ts +1 -1
  506. package/portal/MediaInfo.js +1 -1
  507. package/portal/MeshSymbol3D.d.ts +1 -0
  508. package/portal/MosaicRule.d.ts +3 -2
  509. package/portal/MosaicRule.js +1 -1
  510. package/portal/Multipoint.d.ts +1 -1
  511. package/portal/ObjectSymbol3DLayer.d.ts +1 -0
  512. package/portal/OpenStreetMapLayer.d.ts +1 -0
  513. package/portal/OpenStreetMapLayer.js +1 -1
  514. package/portal/OperationalLayer.d.ts +3 -3
  515. package/portal/PathSymbol3DLayer.d.ts +1 -0
  516. package/portal/PictureFillSymbol.d.ts +1 -0
  517. package/portal/PictureMarkerSymbol.d.ts +1 -0
  518. package/portal/Point.d.ts +2 -1
  519. package/portal/PointCloudBitfieldFilter.d.ts +1 -0
  520. package/portal/PointCloudClassBreaksRenderer.d.ts +1 -0
  521. package/portal/PointCloudFilter.d.ts +2 -1
  522. package/portal/PointCloudFixedSizeAlgorithm.d.ts +1 -0
  523. package/portal/PointCloudLayer.d.ts +1 -0
  524. package/portal/PointCloudLayer.js +1 -1
  525. package/portal/PointCloudRGBRenderer.d.ts +1 -0
  526. package/portal/PointCloudRenderer.d.ts +3 -1
  527. package/portal/PointCloudRenderer.js +1 -1
  528. package/portal/PointCloudReturnFilter.d.ts +1 -0
  529. package/portal/PointCloudSplatAlgorithm.d.ts +1 -0
  530. package/portal/PointCloudStretchRenderer.d.ts +1 -0
  531. package/portal/PointCloudUniqueValueRenderer.d.ts +1 -0
  532. package/portal/PointCloudValueFilter.d.ts +1 -0
  533. package/portal/PointSymbol3D.d.ts +2 -1
  534. package/portal/Polygon.d.ts +1 -1
  535. package/portal/PolygonSymbol3D.d.ts +1 -0
  536. package/portal/Polyline.d.ts +1 -1
  537. package/portal/PopupExpressionInfo.d.ts +2 -1
  538. package/portal/PopupInfo.d.ts +3 -1
  539. package/portal/PopupInfo.js +1 -1
  540. package/portal/PredominanceRenderer.d.ts +1 -0
  541. package/portal/Presentation.d.ts +1 -0
  542. package/portal/Presentation.js +1 -1
  543. package/portal/QueryTableDataSource.d.ts +1 -1
  544. package/portal/RangeDomain.d.ts +1 -1
  545. package/portal/RangeDomain.js +1 -1
  546. package/portal/RangeInfo.d.ts +1 -0
  547. package/portal/RasterDataSource.d.ts +1 -1
  548. package/portal/Renderer.d.ts +8 -6
  549. package/portal/Renderer.js +1 -1
  550. package/portal/RenderingRule.d.ts +3 -2
  551. package/portal/RenderingRule.js +1 -1
  552. package/portal/SceneLayer.d.ts +1 -0
  553. package/portal/SceneLayer.js +1 -1
  554. package/portal/SimpleFillSymbol.d.ts +2 -1
  555. package/portal/SimpleLineSymbol.d.ts +2 -1
  556. package/portal/SimpleMarkerSymbol.d.ts +2 -1
  557. package/portal/SimpleRenderer.d.ts +1 -0
  558. package/portal/Slide.d.ts +4 -4
  559. package/portal/Slide.js +1 -1
  560. package/portal/SpatialReference.d.ts +1 -0
  561. package/portal/SpatialReference.js +1 -1
  562. package/portal/StreamLayer.d.ts +1 -1
  563. package/portal/StreamLayer.js +1 -1
  564. package/portal/StyleSymbolReference.d.ts +1 -0
  565. package/portal/SubtypeGroupLayer.d.ts +3 -2
  566. package/portal/SubtypeGroupLayer.js +1 -1
  567. package/portal/SubtypeSublayer.d.ts +1 -0
  568. package/portal/SubtypeSublayer.js +1 -1
  569. package/portal/Symbol.d.ts +11 -11
  570. package/portal/Symbol.js +1 -1
  571. package/portal/Symbol3D.d.ts +7 -2
  572. package/portal/Table.d.ts +3 -3
  573. package/portal/Table.js +1 -1
  574. package/portal/TableDataSource.d.ts +1 -1
  575. package/portal/Template.d.ts +2 -1
  576. package/portal/Template.js +1 -1
  577. package/portal/TemporalRenderer.d.ts +1 -0
  578. package/portal/TextSymbol.d.ts +1 -0
  579. package/portal/TextSymbol3DLayer.d.ts +1 -0
  580. package/portal/TileInfo.d.ts +2 -1
  581. package/portal/TileInfo.js +1 -1
  582. package/portal/TiledImageServiceLayer.d.ts +1 -0
  583. package/portal/TiledImageServiceLayer.js +1 -1
  584. package/portal/TiledMapServiceLayer.d.ts +2 -1
  585. package/portal/TiledMapServiceLayer.js +1 -1
  586. package/portal/Type.d.ts +2 -4
  587. package/portal/Type.js +1 -1
  588. package/portal/UniqueValueFromStyle.d.ts +1 -0
  589. package/portal/UniqueValueRenderer.d.ts +2 -0
  590. package/portal/UtilityNetwork.d.ts +2 -2
  591. package/portal/UtilityNetwork.js +1 -1
  592. package/portal/Value.d.ts +1 -1
  593. package/portal/VectorFieldRenderer.d.ts +1 -1
  594. package/portal/VectorTileLayer.d.ts +1 -0
  595. package/portal/VectorTileLayer.js +1 -1
  596. package/portal/VerticalOffset.d.ts +1 -1
  597. package/portal/Viewpoint.d.ts +1 -0
  598. package/portal/Viewpoint.js +1 -1
  599. package/portal/VisualVariable.d.ts +10 -4
  600. package/portal/WMSLayer.d.ts +1 -0
  601. package/portal/WMSLayer.js +1 -1
  602. package/portal/WMSSublayer.d.ts +1 -0
  603. package/portal/WMSSublayer.js +1 -1
  604. package/portal/WMTSInfo.d.ts +1 -1
  605. package/portal/WMTSInfo.js +1 -1
  606. package/portal/Weather.d.ts +6 -1
  607. package/portal/Weather.js +1 -1
  608. package/portal/WebMap.d.ts +3 -3
  609. package/portal/WebMap.js +1 -1
  610. package/portal/WebScene.d.ts +3 -1
  611. package/portal/WebScene.js +1 -1
  612. package/portal/WebSceneBaseMap.d.ts +1 -0
  613. package/portal/WebSceneBaseMap.js +1 -1
  614. package/portal/WebTileLayer.d.ts +1 -0
  615. package/portal/WebTileLayer.js +1 -1
  616. package/portal/Widgets.d.ts +6 -4
  617. package/portal/Widgets.js +1 -1
  618. package/portal/_LayerBase.d.ts +2 -2
  619. package/portal/_layerHelper.js +1 -1
  620. package/portal/_utils.js +1 -1
  621. package/support/Action.d.ts +4 -4
  622. package/support/ArcGISRequestHelper.js +1 -1
  623. package/support/Cancellable.d.ts +1 -1
  624. package/support/Cancellable.js +1 -1
  625. package/support/FormatSettings.js +1 -1
  626. package/support/InitializableBase.d.ts +1 -1
  627. package/support/InitializableBase.js +1 -1
  628. package/support/InitializableCollectionProxy.js +1 -1
  629. package/support/InitializeError.js +1 -1
  630. package/support/Observable.js +1 -1
  631. package/support/ReadOnlyInitializableCollection.js +1 -1
  632. package/support/Serializable.d.ts +4 -4
  633. package/support/Serializable.js +1 -1
  634. package/support/Settings.js +1 -1
  635. package/support/_ArcGISRelationshipCollection.js +1 -1
  636. package/support/_esriInternal.js +1 -1
  637. package/support/_graphicsQuery.js +1 -1
  638. package/support/_query.js +1 -1
  639. package/support/_requestCache.js +1 -1
  640. package/support/_restApiJson.d.ts +1 -1
  641. package/support/esri.d.ts +76 -76
  642. package/support/esri.js +1 -1
  643. package/tasks/geocoding/ArcGISGeocoder.js +1 -1
  644. package/tasks/geocoding/Geocoder.d.ts +1 -1
  645. package/tasks/geocoding/Geocoder.js +1 -1
  646. package/tasks/geocoding/utilities.js +1 -1
  647. package/tasks/identify/ArcGISSublayerQueryIdentifyProvider.js +1 -1
  648. package/tasks/identify/BuildingComponentSublayerClientSideIdentifyProvider.js +1 -1
  649. package/tasks/identify/BuildingComponentSublayerHitTestIdentifyProvider.js +1 -1
  650. package/tasks/identify/CSVLayer3DHitTestIdentifyProvider.js +1 -1
  651. package/tasks/identify/CSVLayerClientSideQueryIdentifyProvider.js +1 -1
  652. package/tasks/identify/ClientSideIdentifyProvider.d.ts +2 -2
  653. package/tasks/identify/ClientSideIdentifyProvider.js +1 -1
  654. package/tasks/identify/FeatureLayer3DHitTestIdentifyProvider.js +1 -1
  655. package/tasks/identify/FeatureLayerClientSideIdentifyProvider.js +1 -1
  656. package/tasks/identify/FeatureLayerQueryIdentifyProvider.js +1 -1
  657. package/tasks/identify/GeoRSSLayerIdentifyProvider.js +1 -1
  658. package/tasks/identify/GraphicsLayerQueryIdentifyProvider.js +1 -1
  659. package/tasks/identify/HitTestIdentifyProvider.d.ts +2 -2
  660. package/tasks/identify/HitTestIdentifyProvider.js +1 -1
  661. package/tasks/identify/IdentifyError.js +1 -1
  662. package/tasks/identify/IdentifyProviderBase.js +1 -1
  663. package/tasks/identify/IdentifyService.js +1 -1
  664. package/tasks/identify/ImageryLayerIdentifyProvider.js +1 -1
  665. package/tasks/identify/KMLLayerQueryIdentifyProvider.js +1 -1
  666. package/tasks/identify/PointCloudLayerHitTestIdentifyProvider.js +1 -1
  667. package/tasks/identify/SceneLayerClientSideIdentifyProvider.js +1 -1
  668. package/tasks/identify/SceneLayerHitTestIdentifyProvider.js +1 -1
  669. package/tasks/identify/SceneLayerQueryIdentifyProvider.js +1 -1
  670. package/tasks/identify/StreamLayerClientSideQueryIdentifyProvider.js +1 -1
  671. package/tasks/identify/StreamLayerQueryIdentifyProvider.js +1 -1
  672. package/tasks/identify/SubtypeSublayerClientSideIdentifyProvider.js +1 -1
  673. package/tasks/identify/SubtypeSublayerQueryIdentifyProvider.js +1 -1
  674. package/tasks/identify/WMSSublayerIdentifyProvider.js +1 -1
  675. package/tasks/query/ArcGISRelationship.js +1 -1
  676. package/tasks/query/ArcGISServiceTableQueryProvider.js +1 -1
  677. package/tasks/query/ArcGISSublayerQueryProvider.js +1 -1
  678. package/tasks/query/BuildingComponentSublayerClientSideQueryProvider.js +1 -1
  679. package/tasks/query/CSVLayerClientSideQueryProvider.js +1 -1
  680. package/tasks/query/CSVLayerQueryProvider.js +1 -1
  681. package/tasks/query/ClientSideQueryProvider.d.ts +2 -2
  682. package/tasks/query/ClientSideQueryProvider.js +1 -1
  683. package/tasks/query/FeatureLayerQueryProvider.js +1 -1
  684. package/tasks/query/GeoRSSLayerQueryProvider.js +1 -1
  685. package/tasks/query/GraphicsLayerQueryProvider.js +1 -1
  686. package/tasks/query/ImageryLayerQueryProvider.js +1 -1
  687. package/tasks/query/KMLLayerQueryProvider.js +1 -1
  688. package/tasks/query/QueryBasedRelationship.js +1 -1
  689. package/tasks/query/QueryError.js +1 -1
  690. package/tasks/query/QueryProviderBase.js +1 -1
  691. package/tasks/query/QueryService.js +1 -1
  692. package/tasks/query/SceneLayerClientSideQueryProvider.js +1 -1
  693. package/tasks/query/SceneLayerQueryProvider.js +1 -1
  694. package/tasks/query/StreamLayerClientSideQueryProvider.js +1 -1
  695. package/tasks/query/StreamLayerQueryProvider.js +1 -1
  696. package/tasks/query/SubtypeSublayerQueryProvider.js +1 -1
  697. package/tasks/search/ArcGISGeocoderSearchProvider.js +1 -1
  698. package/tasks/search/GeocoderSearchProvider.js +1 -1
  699. package/tasks/search/QuerySearchProvider.js +1 -1
  700. package/tasks/search/SearchError.js +1 -1
  701. package/tasks/search/SearchProviderBase.js +1 -1
  702. package/tasks/search/SearchService.js +1 -1
  703. package/tasks/search/_utilities.js +1 -1
  704. package/utilities/CollectionProxy.js +1 -1
  705. package/utilities/CopyOnWriteCollection.js +1 -1
  706. package/utilities/GeometryServiceError.js +1 -1
  707. package/utilities/MapTransformCollection.js +1 -1
  708. package/utilities/ObservableMap.js +1 -1
  709. package/utilities/ObservableSet.js +1 -1
  710. package/utilities/ObservableWeakSet.js +1 -1
  711. package/utilities/ReadOnlyCollection.js +1 -1
  712. package/utilities/ReadOnlyMap.js +1 -1
  713. package/utilities/_layers.js +1 -1
  714. package/utilities/_ogc.js +1 -1
  715. package/utilities/arcade.js +1 -1
  716. package/utilities/array.js +1 -1
  717. package/utilities/asyncIterable.d.ts +1 -1
  718. package/utilities/asyncIterable.js +1 -1
  719. package/utilities/basemaps.js +1 -1
  720. package/utilities/checkArg.js +1 -1
  721. package/utilities/collection.js +1 -1
  722. package/utilities/date.js +1 -1
  723. package/utilities/esri.js +1 -1
  724. package/utilities/extensions.js +1 -1
  725. package/utilities/geometry.d.ts +2 -2
  726. package/utilities/geometry.js +1 -1
  727. package/utilities/iterable.js +1 -1
  728. package/utilities/log.d.ts +1 -1
  729. package/utilities/log.js +1 -1
  730. package/utilities/mapping.js +1 -1
  731. package/utilities/math.js +1 -1
  732. package/utilities/number.js +1 -1
  733. package/utilities/object.js +1 -1
  734. package/utilities/portal.d.ts +3 -3
  735. package/utilities/portal.js +1 -1
  736. package/utilities/promise.d.ts +1 -1
  737. package/utilities/promise.js +1 -1
  738. package/utilities/query.js +1 -1
  739. package/utilities/relationships.js +1 -1
  740. package/utilities/scaleRanges.d.ts +1 -1
  741. package/utilities/set.js +1 -1
  742. package/utilities/string.d.ts +6 -21
  743. package/utilities/string.js +1 -1
  744. package/utilities/symbol.js +1 -1
  745. package/utilities/uri.js +1 -1
  746. package/utilities/watch.js +1 -1
  747. package/version.d.ts +1 -1
  748. package/version.js +1 -1
@@ -1 +1 @@
1
- import{__decorate}from"tslib";import{ArgumentError}from"../ArgumentError.js";import{InvalidOperationError}from"../InvalidOperationError.js";import{ItemType}from"../ItemType.js";import{FeatureSourceBase}from"../data/FeatureSourceBase.js";import{Schema}from"../data/Schema.js";import{LayerBase as PortalLayerBase}from"../portal/LayerBase.js";import{ERR_LAYER_TYPE_MISMATCH}from"../portal/_layerHelper.js";import{DefaultArcGISRequestHelper}from"../support/ArcGISRequestHelper.js";import{ReadOnlyInitializableCollection}from"../support/ReadOnlyInitializableCollection.js";import{serializable}from"../support/Serializable.js";import{isLayer}from"../utilities/_layers.js";import{checkArg}from"../utilities/checkArg.js";import{Collection,compare}from"../utilities/collection.js";import{load}from"../utilities/esri.js";import{isGroupLayerExtension}from"../utilities/extensions.js";import{hasMmapLayer}from"../utilities/layers.js";import{getLogger}from"../utilities/log.js";import{deepClone}from"../utilities/object.js";import{toPortalItem}from"../utilities/portal.js";import{onCollectionPropertyChange,watchEach}from"../utilities/watch.js";import{_assignSublayerExtensions}from"./_SublayerExtension.js";import{ExtensionBaseLayerListSettings,fromLayerListMode}from"./support/LayerListSettings.js";import{SublayerExtensionCollectionBase}from"./support/_SublayerExtensionCollection.js";const ERR_INVALID_LAYER_TYPE="Invalid type of layer for this type of layer extension.",ERR_FEATURES_NOT_SUPPORTED="This type of layer does not have features.",ERR_ADD_SUBLAYERX_NOT_SUPPORTED="This type of layer cannot have sublayers.",DEFAULT_CAPABILITIES=Object.freeze({supportsAdd:!1,supportsUpdate:!1,supportsDelete:!1,supportsEditing:!1,supportsQuery:!1,supportsAttachmentEditing:!1});export class LayerExtension extends FeatureSourceBase{constructor(e){super(e),this._itemType=ItemType.LAYER_EXTENSION,this._watchHandles=[],this._dynamicallyAddedLayer=!1,this._visibilityMode="independent",this._onSublayerAddedPostInitialize=async e=>{try{await e.initialize()}catch(t){getLayerXLogger().error({message:`Error occurred while initializing sublayer extension for sublayer '${e.title??e.sublayer.id??e.id}'.`,error:t})}},this._onVisibleChanged=e=>{if("inherited"===this.visibilityMode&&this.supportsSublayers&&this._sublayers)for(const t of this._sublayers.toArray())t.visible=e;this.notifyChange("isEffectivelyVisible")},this._onSublayersSublayerVisibleChanged=(e,t,i,r)=>{e&&"exclusive"===this.visibilityMode&&this._ensureAChildSublayerVisible(r)},this._onSublayersChange=e=>{e.added?.length&&"exclusive"===this.visibilityMode&&this._ensureAChildSublayerVisible(e.added[e.added.length-1])};const t={...this.getDefaults(),...e};checkArg("properties.layer",t.layer).isNotMissing();const{layer:i}=t;let r;if(i?.hasOwnProperty("listMode")&&(r=fromLayerListMode(i.listMode)),this.layerListSettings=this._createLayerListSettings({...r,...t.layerListSettings}),isLayer(i))checkArg("properties.layer",i).satisfies((e=>this._isSupportedLayer(e)),ERR_INVALID_LAYER_TYPE),this._setLayer(i);else if(i){if(i.$portalItem){const e=i.$portalItem;this._portalItem=toPortalItem(e)}this._deferredLayerProperties=i}this._sublayerExtensions=this._createSublayerExtensionCollection(),this.allSublayerExtensions=new AllSublayerExtensionCollectionImpl(this),this.watch("parentLayerExtension.isEffectivelyVisible",(()=>this.notifyChange("isEffectivelyVisible"))),this.watch("layer.sublayers",(()=>this.notifyChange("_sublayers")))}get layer(){return this._layer}get mapExtension(){return this._mapExtension}get basemapExtension(){return this._basemapExtension}get groundExtension(){return this._groundExtension}get parentLayerExtension(){return this._parentLayerExtension}get hasFeatures(){return!1}get capabilities(){return this._capabilities()}get renderer(){}get visibilityMode(){return this._visibilityMode}set visibilityMode(e){this._visibilityMode=e,"exclusive"===e&&this._ensureAtMostOneChildSublayerVisible()}get sublayerExtensions(){return this._sublayerExtensions}get requestHelper(){return this._requestHelper||(this._requestHelper=new DefaultArcGISRequestHelper),this._requestHelper}set requestHelper(e){this._requestHelper=e}get title(){return this.layer?.title??this._deferredLayerProperties?.title??("string"==typeof this._deferredLayerProperties?.$ref?this._deferredLayerProperties?.$ref:this._deferredLayerProperties?.$ref?.title??this._deferredLayerProperties?.$ref?.id)??"Layer"}get supportsSublayers(){return!1}get effectiveMinScale(){return this.layer&&this.layer.minScale||0}get effectiveMaxScale(){return this.layer&&this.layer.maxScale||0}get isEffectivelyVisible(){const e=!!this.layer&&this.layer.visible;return this.parentLayerExtension?this.parentLayerExtension.isEffectivelyVisible&&e:e}get effectiveFullExtent(){return this.layer?this.layer.fullExtent:void 0}get canChangeScale(){return!0}get canChangeOpacity(){return!0}get canChangeLabels(){return!1}get initialVisibility(){return this._initialVisibility??this.layer?.visible??!1}get _layerSupportsHideChildren(){return this.supportsSublayers}get _sublayers(){if(this.supportsSublayers)return this.layer?this.layer.sublayers:void 0}get dynamicallyAddedLayer(){return this._dynamicallyAddedLayer}set dynamicallyAddedLayer(e){this._dynamicallyAddedLayer=e}get sublayersAreReadOnly(){return!0}static create(e){if(!LayerExtension.factory)throw new InvalidOperationError("Cannot create layer extension: no layer extension factory has been registered.");return LayerExtension.factory.create(e)}static async fromPortalItem(e,t){checkArg("portalItemLike",e).isNotMissing();const i=t??{};checkArg("layerExtensionProperties.layer",i.layer).satisfies((e=>!isLayer(e)));const r={...i.layer};checkArg("layerExtensionProperties.layer.$ref",r.$ref).satisfies((e=>null==e));const s=new DefaultArcGISRequestHelper,a=toPortalItem(e);let n;await load(a);const o=a.typeKeywords??"";if("Map Service"===a.type)n=o.includes("Tiled")||o.includes("Hosted Service")?"ArcGISTiledMapServiceLayer":"ArcGISMapServiceLayer";else if("Feature Service"===a.type)n="ArcGISFeatureLayer";else if("Image Service"===a.type){const e=await LayerExtension._getLayerData(a.url,s);e.cacheType?"Map"===e.cacheType?n="ArcGISTiledImageServiceLayer":("Elevation"===e.cacheType||o.includes("Elevation 3D Layer"))&&(n="ArcGISTiledElevationServiceLayer"):n=e.singleFusedMapCache||e.tileInfo||o.includes("Hosted Service")?"ArcGISTiledImageServiceLayer":"ArcGISImageServiceLayer"}else if("CSV"===a.type)n="CSV";else if("KML"===a.type)n="KML";else if("Scene Service"===a.type)o.includes("3DObject")||o.includes("Point")?n="ArcGISSceneServiceLayer":o.includes("IntegratedMesh")?n="IntegratedMeshLayer":o.includes("PointCloud")?n="PointCloudLayer":o.includes("Building")&&(n="BuildingSceneLayer");else if("Stream Service"===a.type)n="ArcGISStreamLayer";else if("Vector Tile Service"===a.type)n="VectorTileLayer";else if("Feature Collection"===a.type){n="ArcGISFeatureLayer";const e=await a.fetchData();r.featureCollection=e}else if("WMTS"===a.type){n="WebTiledLayer";const e=await a.fetchData();Object.assign(r,e)}else if("WMS"===a.type){n="WMS";const e=await a.fetchData();Object.assign(r,e)}if(!n)throw new ArgumentError("portalItem","Could not determine correct type of LayerExtension to create from portal item");if(r.layerType&&r.layerType!==n)throw new ArgumentError("layerExtensionProperties.layer.layerType","Layer type defined in layer properties does not match layer type from portal item");return r.layerType=n,r.$portalItem=a,i.layer=r,LayerExtension.create(i)}static _matchesRef(e,t){if(!e||!t)return!1;const i=t.$ref;return"string"==typeof i?e.id===i||e.title===i:!!i&&(e.id===i.id||e.title===i.title&&!i.path)}static async _getLayerData(e,t){const i=await t.request(e,{query:{f:"json"}});if(!i||!i.data)throw new Error(`Response to request for url ${e} was invalid.`);return i.data}getFeatures(e,t){if(!this.hasFeatures)throw new InvalidOperationError(ERR_FEATURES_NOT_SUPPORTED);return super.getFeatures(e,t)}getFullExtent(){return this.effectiveFullExtent}async addFeatures(e,t){if(checkArg("features",e).isNotMissing(),!this.hasFeatures)throw new InvalidOperationError(ERR_FEATURES_NOT_SUPPORTED);await super.addFeatures(e,t)}async updateFeatures(e,t){if(checkArg("features",e).isNotMissing(),!this.hasFeatures)throw new InvalidOperationError(ERR_FEATURES_NOT_SUPPORTED);await super.updateFeatures(e,t)}async deleteFeatures(e,t){if(checkArg("features",e).isNotMissing(),!this.hasFeatures)throw new InvalidOperationError(ERR_FEATURES_NOT_SUPPORTED);await super.deleteFeatures(e,t)}async _createBackingLayer(){this._portalItem||this.layer||this._deferredLayerProperties&&this._deferredLayerProperties.$ref?!this.layer&&this._portalItem&&this._setLayer(await this._createLayer(this.getDefaults().layer)):(this._setLayer(await this._createLayer(this._deferredLayerProperties)),checkArg("properties.layer",this._layer).satisfies((e=>this._isSupportedLayer(e)),ERR_INVALID_LAYER_TYPE),this._deferredLayerProperties=void 0)}_setMapExtension(e){const t=this.mapExtension;this._mapExtension=e,t&&this.featureSettings.formatSettings.parent===t.formatSettings&&(this.featureSettings.formatSettings.parent=void 0),e&&(this.featureSettings.formatSettings.parent||(this.featureSettings.formatSettings.parent=e.formatSettings)),this._resolveLayer(),this.notifyChange("mapExtension")}_setBasemapExtension(e){this._basemapExtension=e,this._resolveLayer(),e&&(this.taskSettings.parent=e.taskSettings),this.notifyChange("basemapExtension")}_setGroundExtension(e){this._groundExtension=e,this._resolveLayer(),e&&(this.taskSettings.parent=e.taskSettings),this.notifyChange("groundExtension")}_setParentLayerExtension(e){const t=this._parentLayerExtension;this._parentLayerExtension=e,t&&(this.featureSettings.formatSettings.parent===t.featureSettings.formatSettings&&(this.featureSettings.formatSettings.parent=this.mapExtension?this.mapExtension.formatSettings:void 0),this.taskSettings.parent===t.taskSettings&&(this.taskSettings.parent=void 0)),e&&((!this.featureSettings.formatSettings.parent||this.mapExtension&&this.featureSettings.formatSettings.parent===this.mapExtension.formatSettings)&&(this.featureSettings.formatSettings.parent=e.featureSettings.formatSettings),this.taskSettings.parent||(this.taskSettings.parent=e.taskSettings)),this._resolveLayer(),this.notifyChange("parentLayerExtension")}_resolveLayer(e){if(this.layer||!this._deferredLayerProperties)return;const t=e=>LayerExtension._matchesRef(e,this._deferredLayerProperties);let i;e?i=e.find(t):this.basemapExtension?.basemap?(i=this.basemapExtension.basemap.baseLayers.find(t),i=i||this.basemapExtension.basemap.referenceLayers.find(t)):this.groundExtension?.ground?i=this.groundExtension.ground.layers.find(t):this.parentLayerExtension?.layer?i=this.parentLayerExtension.layer.layers.find(t):this.mapExtension&&(i=this.mapExtension.map.layers.find(t)),i&&this._isSupportedLayer(i)&&(this._setLayer(i),this._originalRef=this._deferredLayerProperties.$ref,this._deferredLayerProperties.$portalItem&&getLayerXLogger().warn("LayerExtension defined with both $ref and $portalItem. Ignoring $portalItem."))}async _switchLayer(e){if(e===this.layer)return;checkArg("newLayer",e).isNotMissing().satisfies((e=>this._isSupportedLayer(e)),ERR_INVALID_LAYER_TYPE),this.isInitialized&&await load(e);const t=new Map;if(this._sublayers)for(const e of this._sublayers.toArray())t.set(e.id,this.sublayerExtensions.forSublayer(e));e.visible=this.layer.visible,e.opacity=this.layer.opacity,e.listMode=this.layer.listMode,e.hasOwnProperty("labelsVisible")&&this.layer.hasOwnProperty("labelsVisible")&&(e.labelsVisible=this.layer.labelsVisible),this._setLayer(e);const i=[];if(this._sublayers){const e=this._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)}_getProjectWebmapJSON(){if(!this.layer)return;let e=PortalLayerBase.fromEsriApiLayer(this.layer);if(!this.dynamicallyAddedLayer){const{id:t,title:i,layerType:r,visibility:s,opacity:a}=e;e={id:t,title:i,layerType:r,visibility:s,opacity:a}}return e}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(),iconUrl:{serializeModes:["initial","project"],serialize:e=>"project"!==e||this.dynamicallyAddedLayer?this.iconUrl:this.getDefault("iconUrl")},visibilityMode:{serializeModes:["initial","project"],serialize:e=>"project"!==e||this.dynamicallyAddedLayer?this.visibilityMode:this.getDefault("visibilityMode"),default:"independent"},tpkSource:{serializeModes:["initial"]},layerListSettings:{serializeModes:["initial","project"],serialize:e=>"project"!==e||this.dynamicallyAddedLayer?this.layerListSettings:this.getDefault("layerListSettings")},sublayerExtensions:{serializeModes:["initial","project"],serialize:e=>this.sublayerExtensions.map((e=>e.toItemUri())).toArray(),deserialize:e=>{_assignSublayerExtensions(this.sublayerExtensions,e,(e=>this._createSublayerExtension(e)))}},layer:{serializeModes:["initial","project"],serialize:e=>{if(this.layer){if((this._mapExtension||this._parentLayerExtension||this._basemapExtension||this._groundExtension)&&(this._layer.id||this._layer.title)){const e=PortalLayerBase.getLayerType(this._layer),t=this._getSerializableRefLayerProperties();return{$ref:this._originalRef||{id:this._layer.id,title:this._layer.title,subtype:this._getSerializableLayerType()},layerType:e,...t}}return PortalLayerBase.fromEsriApiLayer(this.layer)}return this._deferredLayerProperties?deepClone(this._deferredLayerProperties):void 0},isDefault:()=>{throw new Error("Missing implementation for _getSerializableProperties() > layer > default. Subclasses of LayerExtension must implement this.")},deserialize:e=>{if(isLayer(e)){if(e!==this.layer)throw new Error("Property 'layer' is read-only.")}else e&&(this._layer?this._applyLayerProperties(e,this.layer):this._deferredLayerProperties&&(this._deferredLayerProperties={...this._deferredLayerProperties,...e}))}},dynamicallyAddedLayer:{serializeModes:["project"],default:!1},requestHelper:{serialize:!1}}}_getSerializableLayerType(){}_getSerializableRefLayerProperties(){return{}}_createSublayerExtension(e){if(!this.supportsSublayers)throw new InvalidOperationError(ERR_ADD_SUBLAYERX_NOT_SUPPORTED);throw new Error("Missing implementation for _createSublayerExtension(). Subclasses of LayerExtension that support sublayers must implement this.")}async _onInitialize(){if(await super._onInitialize(),await this._createBackingLayer(),this._portalItem&&(await load(this._portalItem),await this._applyPortalItemProperties(this._portalItem),this.layer.title=this._portalItem.title,this.layer.portalItem=this._portalItem,this.iconUrl||(this.iconUrl=this._portalItem.thumbnailUrl),await this._applyLayerProperties(this._deferredLayerProperties,this.layer),this._deferredLayerProperties=void 0),this._resolveLayer(),!this.layer){const e=this._deferredLayerProperties.$ref;throw this._mapExtension||this._parentLayerExtension||this._basemapExtension||this._groundExtension?new InvalidOperationError(`No layer found matching reference "${"string"==typeof e?e:JSON.stringify(e)}".`):new InvalidOperationError("Cannot resolve layer reference: missing parent.")}this._deferredLayerProperties&&(await this._applyLayerProperties(this._deferredLayerProperties,this.layer),this._deferredLayerProperties=void 0),await this._initializeLayer(),await load(this.layer),this.supportsSublayers&&!this.layer.sublayers&&this.layer._set("sublayers",new Collection),this._initialVisibility=this.layer.visible,this._sublayerExtensions.onParentInitialized()}async _postInitialize(){await super._postInitialize(),this.layerListSettings.onLayerExtensionInitialized(),this._watchHandles.push(onCollectionPropertyChange(this,"layer.sublayers",(async e=>{const t=(e.added??[]).map((e=>this.sublayerExtensions.forSublayer(e)));await Promise.all(t.map(this._onSublayerAddedPostInitialize))})))}_applyPortalItemProperties(e){throw new InvalidOperationError("Cannot use this type of layer extension with a PortalItem.")}async _initializeLayer(){}_createLayerListSettings(e){return new LayerExtensionLayerListSettings(e,this)}_createSublayerExtensionCollection(){return new SublayerExtensionCollectionImpl(this)}_capabilities(){return DEFAULT_CAPABILITIES}*_initializableChildCollections(){yield*super._initializableChildCollections(),yield this.sublayerExtensions}async _createLayer(e){return PortalLayerBase.toEsriApiLayer(e)}_applyLayerProperties(e,t){checkArg("layerJson",e).isNotMissing();const i=e.layerType||e.type;return checkArg("layerJson.layerType",i).satisfies((e=>!e||e===this.getDefault("layer")?.layerType),ERR_LAYER_TYPE_MISMATCH),checkArg("layer",t).isNotMissing().satisfies((e=>this._isSupportedLayer(e)),ERR_LAYER_TYPE_MISMATCH),PortalLayerBase.applyToEsriApiLayer(e,t)}_setLayer(e){if(this._layer=e,e.watch("visible",this._onVisibleChanged),this.layer.watch("minScale",(()=>this.notifyChange("effectiveMinScale"))),this.layer.watch("maxScale",(()=>this.notifyChange("effectiveMaxScale"))),this.layer.watch("title",(()=>this.notifyChange("title"))),this.supportsSublayers)if(this._sublayers)this._setupSublayersHandles();else{const t=e.watch("sublayers",(()=>{this._setupSublayersHandles(),t.remove()}),!0)}this.notifyChange("layer"),this.notifyChange("title"),this.notifyChange("effectiveMinScale"),this.notifyChange("effectiveMaxScale"),this.notifyChange("isEffectivelyVisible")}_setupSublayersHandles(){this._sublayers.on("change",this._onSublayersChange),watchEach(this._sublayers,"visible",this._onSublayersSublayerVisibleChanged)}_ensureAChildSublayerVisible(e){for(const t of this._sublayers.toArray())t!==e&&(t.visible=!1)}_ensureAtMostOneChildSublayerVisible(){this.layer&&this._sublayers&&this._ensureAChildSublayerVisible(this._sublayers.find((e=>e.visible)))}}class SublayerExtensionCollectionImpl extends SublayerExtensionCollectionBase{constructor(e){super(e,"_sublayers"),this._layerExtension=e}add(e,t){if(checkArg("sublayerX",e).isNotMissing(),!this._layerExtension.supportsSublayers)throw new InvalidOperationError(ERR_ADD_SUBLAYERX_NOT_SUPPORTED);const i=e.sublayer?e.sublayer.layer:void 0;return i&&i!==this._layerExtension.layer&&i.sublayers.remove(e.sublayer),super.add(e,t)}}class AllSublayerExtensionCollectionImpl extends ReadOnlyInitializableCollection{constructor(e){super(),this._layerExtension=e}get _collection(){return this._layerExtension.sublayerExtensions.flatten((e=>e.sublayerExtensions))}findById(e){return checkArg("id",e).isNotMissing(),this.find((t=>t.id===e))}findBySublayerId(e){return checkArg("id",e).isNotMissing(),this.find((t=>t.sublayer.id===e))}forSublayer(e){return checkArg("sublayer",e).isNotMissing(),this.findBySublayerId(e.id)}emit(e,t){if("change"===e){const i=new Collection;i.addMany(t.added);const r=i.flatten((e=>e.sublayerExtensions)).toArray(),s=new Collection;s.addMany(t.removed);const a=s.flatten((e=>e.sublayerExtensions)).toArray(),n=new Collection;n.addMany(t.moved);const o=n.flatten((e=>e.sublayerExtensions)).toArray();return super.emit(e,{added:r,removed:a,moved:o,target:this})}return super.emit(e,t)}_itemIsInitialized(e){return super._itemIsInitialized(e)&&!!e.sublayer}}let LayerExtensionLayerListSettings=class extends ExtensionBaseLayerListSettings{get _esriLayer(){return this._extension.layer}get _listModePath(){return"layer.listMode"}get _supportsChildren(){return this._extension.supportsSublayers}};LayerExtensionLayerListSettings=__decorate([serializable],LayerExtensionLayerListSettings);export{LayerExtensionLayerListSettings};let LayerExtensionSchema=class extends Schema{constructor(e){if(super(),this._layerBindings=new Map,this._layerExtension=e,this._bindSettingsToLayerProperties(),e.layer)this._onLayerResolved(e.layer);else{const t=e.watch("layer",(()=>{this._onLayerResolved(e.layer),t.remove()}),!0)}}_getPropertyBindings(){return{}}_getSetting(e,t){if(this._layerBindings.has(e)){let t=this._layerBindings.get(e);if("string"==typeof t&&(t={property:t}),t.hasOwnProperty("value"))return t.value;if(this._layerExtension.layer)return this._layerExtension.layer[t.property]}return super._getSetting(e,t)}_setSetting(e,t){if(this._layerBindings.has(e)){let i=this._layerBindings.get(e);if("string"==typeof i&&(i={property:i}),i.readonly||i.hasOwnProperty("value"))throw new InvalidOperationError(ERR_SCHEMA_READ_ONLY);if(this._layerExtension.layer)return void(this._layerExtension.layer[i.property]=t)}super._setSetting(e,t)}_bindSettingsToLayerProperties(){const e=this._getPropertyBindings();for(const t of Object.keys(e)){let i=e[t];"string"==typeof i&&(i={property:i}),this._layerBindings.set(t,i),i.hasOwnProperty("value")||this._layerExtension.watch(`layer.${i.property}`,(()=>this.notifyChange(t)),!i.hasOwnProperty("sync")||i.sync)}}_onLayerResolved(e){for(const t of this._layerBindings.keys())this.isModified(t)&&(e[t]=this[t],this.reset(t))}};LayerExtensionSchema=__decorate([serializable],LayerExtensionSchema);export{LayerExtensionSchema};export function _assignLayerExtensions(e,t){return compare(e,t,{onNew:(t,i)=>{e.add(t instanceof LayerExtension?t:LayerExtension.create(t),isLayerRef(t)?void 0:i)},onMatch:(t,i,r,s)=>{i instanceof LayerExtension||t.assignProperties(i),r===s||isLayerRef(i)||e.reorder(t,s)},onMissing:t=>{(hasMmapLayer([t])||isGroupLayerExtension(t)&&0===t.layerExtensions.toArray().length)&&e.remove(t)},equals:(e,t)=>t instanceof LayerExtension?t===e:!!LayerExtension._matchesRef(e.layer,t.layer)||e.id===t.id})}function getLayerXLogger(){return getLogger("geocortex.api.mapping.LayerExtension")}function isLayerRef(e){return e instanceof LayerExtension?!!e._deferredLayerProperties?.$ref:!isLayer(e.layer)&&!!e.layer?.$ref}let LayerExtensionReadOnlySchema=class extends LayerExtensionSchema{_setSetting(e,t){if(this._layerBindings.has(e))throw new InvalidOperationError(ERR_SCHEMA_READ_ONLY);super._setSetting(e,t)}};LayerExtensionReadOnlySchema=__decorate([serializable],LayerExtensionReadOnlySchema);export{LayerExtensionReadOnlySchema};export const ERR_SCHEMA_READ_ONLY="This schema property is read-only.";
1
+ import{__decorate as e}from"tslib";import{ArgumentError as t}from"../ArgumentError.js";import{InvalidOperationError as i}from"../InvalidOperationError.js";import{ItemType as s}from"../ItemType.js";import{FeatureSourceBase as r}from"../data/FeatureSourceBase.js";import{Schema as a}from"../data/Schema.js";import{LayerBase as n}from"../portal/LayerBase.js";import{ERR_LAYER_TYPE_MISMATCH as o}from"../portal/_layerHelper.js";import{DefaultArcGISRequestHelper as l}from"../support/ArcGISRequestHelper.js";import{ReadOnlyInitializableCollection as y}from"../support/ReadOnlyInitializableCollection.js";import{serializable as h}from"../support/Serializable.js";import{isLayer as p}from"../utilities/_layers.js";import{checkArg as d}from"../utilities/checkArg.js";import{Collection as u,compare as f}from"../utilities/collection.js";import{load as c}from"../utilities/esri.js";import{isGroupLayerExtension as _}from"../utilities/extensions.js";import{hasMmapLayer as g}from"../utilities/layers.js";import{getLogger as m}from"../utilities/log.js";import{deepClone as b}from"../utilities/object.js";import{toPortalItem as S}from"../utilities/portal.js";import{onCollectionPropertyChange as L,watchEach as E}from"../utilities/watch.js";import{_assignSublayerExtensions as x}from"./_SublayerExtension.js";import{ExtensionBaseLayerListSettings as w,fromLayerListMode as v}from"./support/LayerListSettings.js";import{SublayerExtensionCollectionBase as M}from"./support/_SublayerExtensionCollection.js";const P="Invalid type of layer for this type of layer extension.",I="This type of layer does not have features.",C="This type of layer cannot have sublayers.",A=Object.freeze({supportsAdd:!1,supportsUpdate:!1,supportsDelete:!1,supportsEditing:!1,supportsQuery:!1,supportsAttachmentEditing:!1});export class LayerExtension extends r{get layer(){return this._layer}get mapExtension(){return this._mapExtension}get basemapExtension(){return this._basemapExtension}get groundExtension(){return this._groundExtension}get parentLayerExtension(){return this._parentLayerExtension}get hasFeatures(){return!1}get capabilities(){return this._capabilities()}get renderer(){}get visibilityMode(){return this._visibilityMode}set visibilityMode(e){this._visibilityMode=e,"exclusive"===e&&this._ensureAtMostOneChildSublayerVisible()}get sublayerExtensions(){return this._sublayerExtensions}get requestHelper(){return this._requestHelper||(this._requestHelper=new l),this._requestHelper}set requestHelper(e){this._requestHelper=e}get title(){return this.layer?.title??this._deferredLayerProperties?.title??("string"==typeof this._deferredLayerProperties?.$ref?this._deferredLayerProperties?.$ref:this._deferredLayerProperties?.$ref?.title??this._deferredLayerProperties?.$ref?.id)??"Layer"}get supportsSublayers(){return!1}get effectiveMinScale(){return this.layer&&this.layer.minScale||0}get effectiveMaxScale(){return this.layer&&this.layer.maxScale||0}get isEffectivelyVisible(){const e=!!this.layer&&this.layer.visible;return this.parentLayerExtension?this.parentLayerExtension.isEffectivelyVisible&&e:e}get effectiveFullExtent(){return this.layer?this.layer.fullExtent:void 0}get canChangeScale(){return!0}get canChangeOpacity(){return!0}get canChangeLabels(){return!1}get initialVisibility(){return this._initialVisibility??this.layer?.visible??!1}get _layerSupportsHideChildren(){return this.supportsSublayers}get _sublayers(){if(this.supportsSublayers)return this.layer?this.layer.sublayers:void 0}get dynamicallyAddedLayer(){return this._dynamicallyAddedLayer}set dynamicallyAddedLayer(e){this._dynamicallyAddedLayer=e}get sublayersAreReadOnly(){return!0}constructor(e){super(e),this._itemType=s.LAYER_EXTENSION,this._watchHandles=[],this._dynamicallyAddedLayer=!1,this._visibilityMode="independent",this._onSublayerAddedPostInitialize=async e=>{try{await e.initialize()}catch(t){O().error({message:`Error occurred while initializing sublayer extension for sublayer '${e.title??e.sublayer.id??e.id}'.`,error:t})}},this._onVisibleChanged=e=>{if("inherited"===this.visibilityMode&&this.supportsSublayers&&this._sublayers)for(const t of this._sublayers.toArray())t.visible=e;this.notifyChange("isEffectivelyVisible")},this._onSublayersSublayerVisibleChanged=(e,t,i,s)=>{e&&"exclusive"===this.visibilityMode&&this._ensureAChildSublayerVisible(s)},this._onSublayersChange=e=>{e.added?.length&&"exclusive"===this.visibilityMode&&this._ensureAChildSublayerVisible(e.added[e.added.length-1])};const t={...this.getDefaults(),...e};d("properties.layer",t.layer).isNotMissing();const{layer:i}=t;let r;if(i?.hasOwnProperty("listMode")&&(r=v(i.listMode)),this.layerListSettings=this._createLayerListSettings({...r,...t.layerListSettings}),p(i))d("properties.layer",i).satisfies((e=>this._isSupportedLayer(e)),P),this._setLayer(i);else if(i){if(i.$portalItem){const e=i.$portalItem;this._portalItem=S(e)}this._deferredLayerProperties=i}this._sublayerExtensions=this._createSublayerExtensionCollection(),this.allSublayerExtensions=new j(this),this.watch("parentLayerExtension.isEffectivelyVisible",(()=>this.notifyChange("isEffectivelyVisible"))),this.watch("layer.sublayers",(()=>this.notifyChange("_sublayers")))}static create(e){if(!LayerExtension.factory)throw new i("Cannot create layer extension: no layer extension factory has been registered.");return LayerExtension.factory.create(e)}static async fromPortalItem(e,i){d("portalItemLike",e).isNotMissing();const s=i??{};d("layerExtensionProperties.layer",s.layer).satisfies((e=>!p(e)));const r={...s.layer};d("layerExtensionProperties.layer.$ref",r.$ref).satisfies((e=>null==e));const a=new l,n=S(e);let o;await c(n);const y=n.typeKeywords??"";if("Map Service"===n.type)o=y.includes("Tiled")||y.includes("Hosted Service")?"ArcGISTiledMapServiceLayer":"ArcGISMapServiceLayer";else if("Feature Service"===n.type)o="ArcGISFeatureLayer";else if("Image Service"===n.type){const e=await LayerExtension._getLayerData(n.url,a);e.cacheType?"Map"===e.cacheType?o="ArcGISTiledImageServiceLayer":("Elevation"===e.cacheType||y.includes("Elevation 3D Layer"))&&(o="ArcGISTiledElevationServiceLayer"):o=e.singleFusedMapCache||e.tileInfo||y.includes("Hosted Service")?"ArcGISTiledImageServiceLayer":"ArcGISImageServiceLayer"}else if("CSV"===n.type)o="CSV";else if("KML"===n.type)o="KML";else if("Scene Service"===n.type)y.includes("3DObject")||y.includes("Point")?o="ArcGISSceneServiceLayer":y.includes("IntegratedMesh")?o="IntegratedMeshLayer":y.includes("PointCloud")?o="PointCloudLayer":y.includes("Building")&&(o="BuildingSceneLayer");else if("Stream Service"===n.type)o="ArcGISStreamLayer";else if("Vector Tile Service"===n.type)o="VectorTileLayer";else if("Feature Collection"===n.type){o="ArcGISFeatureLayer";const e=await n.fetchData();r.featureCollection=e}else if("WMTS"===n.type){o="WebTiledLayer";const e=await n.fetchData();Object.assign(r,e)}else if("WMS"===n.type){o="WMS";const e=await n.fetchData();Object.assign(r,e)}if(!o)throw new t("portalItem","Could not determine correct type of LayerExtension to create from portal item");if(r.layerType&&r.layerType!==o)throw new t("layerExtensionProperties.layer.layerType","Layer type defined in layer properties does not match layer type from portal item");return r.layerType=o,r.$portalItem=n,s.layer=r,LayerExtension.create(s)}static _matchesRef(e,t){if(!e||!t)return!1;const i=t.$ref;return"string"==typeof i?e.id===i||e.title===i:!!i&&(e.id===i.id||e.title===i.title&&!i.path)}static async _getLayerData(e,t){const i=await t.request(e,{query:{f:"json"}});if(!i?.data)throw new Error(`Response to request for url ${e} was invalid.`);return i.data}getFeatures(e,t){if(!this.hasFeatures)throw new i(I);return super.getFeatures(e,t)}getFullExtent(){return this.effectiveFullExtent}async addFeatures(e,t){if(d("features",e).isNotMissing(),!this.hasFeatures)throw new i(I);await super.addFeatures(e,t)}async updateFeatures(e,t){if(d("features",e).isNotMissing(),!this.hasFeatures)throw new i(I);await super.updateFeatures(e,t)}async deleteFeatures(e,t){if(d("features",e).isNotMissing(),!this.hasFeatures)throw new i(I);await super.deleteFeatures(e,t)}async _createBackingLayer(){this._portalItem||this.layer||this._deferredLayerProperties?.$ref?!this.layer&&this._portalItem&&this._setLayer(await this._createLayer(this.getDefaults().layer)):(this._setLayer(await this._createLayer(this._deferredLayerProperties)),d("properties.layer",this._layer).satisfies((e=>this._isSupportedLayer(e)),P),this._deferredLayerProperties=void 0)}_setMapExtension(e){const t=this.mapExtension;this._mapExtension=e,t&&this.featureSettings.formatSettings.parent===t.formatSettings&&(this.featureSettings.formatSettings.parent=void 0),e&&(this.featureSettings.formatSettings.parent||(this.featureSettings.formatSettings.parent=e.formatSettings)),this._resolveLayer(),this.notifyChange("mapExtension")}_setBasemapExtension(e){this._basemapExtension=e,this._resolveLayer(),e&&(this.taskSettings.parent=e.taskSettings),this.notifyChange("basemapExtension")}_setGroundExtension(e){this._groundExtension=e,this._resolveLayer(),e&&(this.taskSettings.parent=e.taskSettings),this.notifyChange("groundExtension")}_setParentLayerExtension(e){const t=this._parentLayerExtension;this._parentLayerExtension=e,t&&(this.featureSettings.formatSettings.parent===t.featureSettings.formatSettings&&(this.featureSettings.formatSettings.parent=this.mapExtension?this.mapExtension.formatSettings:void 0),this.taskSettings.parent===t.taskSettings&&(this.taskSettings.parent=void 0)),e&&((!this.featureSettings.formatSettings.parent||this.mapExtension&&this.featureSettings.formatSettings.parent===this.mapExtension.formatSettings)&&(this.featureSettings.formatSettings.parent=e.featureSettings.formatSettings),this.taskSettings.parent||(this.taskSettings.parent=e.taskSettings)),this._resolveLayer(),this.notifyChange("parentLayerExtension")}_resolveLayer(e){if(this.layer||!this._deferredLayerProperties)return;const t=e=>LayerExtension._matchesRef(e,this._deferredLayerProperties);let i;e?i=e.find(t):this.basemapExtension?.basemap?(i=this.basemapExtension.basemap.baseLayers.find(t),i=i||this.basemapExtension.basemap.referenceLayers.find(t)):this.groundExtension?.ground?i=this.groundExtension.ground.layers.find(t):this.parentLayerExtension?.layer?i=this.parentLayerExtension.layer.layers.find(t):this.mapExtension&&(i=this.mapExtension.map.layers.find(t)),i&&this._isSupportedLayer(i)&&(this._setLayer(i),this._originalRef=this._deferredLayerProperties.$ref,this._deferredLayerProperties.$portalItem&&O().warn("LayerExtension defined with both $ref and $portalItem. Ignoring $portalItem."))}async _switchLayer(e){if(e===this.layer)return;d("newLayer",e).isNotMissing().satisfies((e=>this._isSupportedLayer(e)),P),this.isInitialized&&await c(e);const t=new Map;if(this._sublayers)for(const e of this._sublayers.toArray())t.set(e.id,this.sublayerExtensions.forSublayer(e));e.visible=this.layer.visible,e.opacity=this.layer.opacity,e.listMode=this.layer.listMode,e.hasOwnProperty("labelsVisible")&&this.layer.hasOwnProperty("labelsVisible")&&(e.labelsVisible=this.layer.labelsVisible),this._setLayer(e);const i=[];if(this._sublayers){const e=this._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)}_getProjectWebmapJSON(){if(!this.layer)return;let e=n.fromEsriApiLayer(this.layer);if(!this.dynamicallyAddedLayer){const{id:t,title:i,layerType:s,visibility:r,opacity:a}=e;e={id:t,title:i,layerType:s,visibility:r,opacity:a}}return e}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(),iconUrl:{serializeModes:["initial","project"],serialize:e=>"project"!==e||this.dynamicallyAddedLayer?this.iconUrl:this.getDefault("iconUrl")},visibilityMode:{serializeModes:["initial","project"],serialize:e=>"project"!==e||this.dynamicallyAddedLayer?this.visibilityMode:this.getDefault("visibilityMode"),default:"independent"},tpkSource:{serializeModes:["initial"]},layerListSettings:{serializeModes:["initial","project"],serialize:e=>"project"!==e||this.dynamicallyAddedLayer?this.layerListSettings:this.getDefault("layerListSettings")},sublayerExtensions:{serializeModes:["initial","project"],serialize:e=>this.sublayerExtensions.map((e=>e.toItemUri())).toArray(),deserialize:e=>{x(this.sublayerExtensions,e,(e=>this._createSublayerExtension(e)))}},layer:{serializeModes:["initial","project"],serialize:e=>{if(this.layer){if((this._mapExtension||this._parentLayerExtension||this._basemapExtension||this._groundExtension)&&(this._layer.id||this._layer.title)){const e=n.getLayerType(this._layer),t=this._getSerializableRefLayerProperties();return{$ref:this._originalRef||{id:this._layer.id,title:this._layer.title,subtype:this._getSerializableLayerType()},layerType:e,...t}}return n.fromEsriApiLayer(this.layer)}return this._deferredLayerProperties?b(this._deferredLayerProperties):void 0},isDefault:()=>{throw new Error("Missing implementation for _getSerializableProperties() > layer > default. Subclasses of LayerExtension must implement this.")},deserialize:e=>{if(p(e)){if(e!==this.layer)throw new Error("Property 'layer' is read-only.")}else e&&(this._layer?this._applyLayerProperties(e,this.layer):this._deferredLayerProperties&&(this._deferredLayerProperties={...this._deferredLayerProperties,...e}))}},dynamicallyAddedLayer:{serializeModes:["project"],default:!1},requestHelper:{serialize:!1}}}_getSerializableLayerType(){}_getSerializableRefLayerProperties(){return{}}_createSublayerExtension(e){if(!this.supportsSublayers)throw new i(C);throw new Error("Missing implementation for _createSublayerExtension(). Subclasses of LayerExtension that support sublayers must implement this.")}async _onInitialize(){if(await super._onInitialize(),await this._createBackingLayer(),this._portalItem&&(await c(this._portalItem),await this._applyPortalItemProperties(this._portalItem),this.layer.title=this._portalItem.title,this.layer.portalItem=this._portalItem,this.iconUrl||(this.iconUrl=this._portalItem.thumbnailUrl),await this._applyLayerProperties(this._deferredLayerProperties,this.layer),this._deferredLayerProperties=void 0),this._resolveLayer(),!this.layer){const e=this._deferredLayerProperties.$ref;throw this._mapExtension||this._parentLayerExtension||this._basemapExtension||this._groundExtension?new i(`No layer found matching reference "${"string"==typeof e?e:JSON.stringify(e)}".`):new i("Cannot resolve layer reference: missing parent.")}this._deferredLayerProperties&&(await this._applyLayerProperties(this._deferredLayerProperties,this.layer),this._deferredLayerProperties=void 0),await this._initializeLayer(),await c(this.layer),this.supportsSublayers&&!this.layer.sublayers&&this.layer._set("sublayers",new u),this._initialVisibility=this.layer.visible,this._sublayerExtensions.onParentInitialized()}async _postInitialize(){await super._postInitialize(),this.layerListSettings.onLayerExtensionInitialized(),this._watchHandles.push(L(this,"layer.sublayers",(async e=>{const t=(e.added??[]).map((e=>this.sublayerExtensions.forSublayer(e)));await Promise.all(t.map(this._onSublayerAddedPostInitialize))})))}_applyPortalItemProperties(e){throw new i("Cannot use this type of layer extension with a PortalItem.")}async _initializeLayer(){}_createLayerListSettings(e){return new T(e,this)}_createSublayerExtensionCollection(){return new z(this)}_capabilities(){return A}*_initializableChildCollections(){yield*super._initializableChildCollections(),yield this.sublayerExtensions}async _createLayer(e){return n.toEsriApiLayer(e)}_applyLayerProperties(e,t){d("layerJson",e).isNotMissing();const i=e.layerType||e.type;return d("layerJson.layerType",i).satisfies((e=>!e||e===this.getDefault("layer")?.layerType),o),d("layer",t).isNotMissing().satisfies((e=>this._isSupportedLayer(e)),o),n.applyToEsriApiLayer(e,t)}_setLayer(e){if(this._layer=e,e.watch("visible",this._onVisibleChanged),this.layer.watch("minScale",(()=>this.notifyChange("effectiveMinScale"))),this.layer.watch("maxScale",(()=>this.notifyChange("effectiveMaxScale"))),this.layer.watch("title",(()=>this.notifyChange("title"))),this.supportsSublayers)if(this._sublayers)this._setupSublayersHandles();else{const t=e.watch("sublayers",(()=>{this._setupSublayersHandles(),t.remove()}),!0)}this.notifyChange("layer"),this.notifyChange("title"),this.notifyChange("effectiveMinScale"),this.notifyChange("effectiveMaxScale"),this.notifyChange("isEffectivelyVisible")}_setupSublayersHandles(){this._sublayers.on("change",this._onSublayersChange),E(this._sublayers,"visible",this._onSublayersSublayerVisibleChanged)}_ensureAChildSublayerVisible(e){for(const t of this._sublayers.toArray())t!==e&&(t.visible=!1)}_ensureAtMostOneChildSublayerVisible(){this.layer&&this._sublayers&&this._ensureAChildSublayerVisible(this._sublayers.find((e=>e.visible)))}}class z extends M{constructor(e){super(e,"_sublayers"),this._layerExtension=e}add(e,t){if(d("sublayerX",e).isNotMissing(),!this._layerExtension.supportsSublayers)throw new i(C);const s=e.sublayer?e.sublayer.layer:void 0;return s&&s!==this._layerExtension.layer&&s.sublayers.remove(e.sublayer),super.add(e,t)}}class j extends y{get _collection(){return this._layerExtension.sublayerExtensions.flatten((e=>e.sublayerExtensions))}constructor(e){super(),this._layerExtension=e}findById(e){return d("id",e).isNotMissing(),this.find((t=>t.id===e))}findBySublayerId(e){return d("id",e).isNotMissing(),this.find((t=>t.sublayer.id===e))}forSublayer(e){return d("sublayer",e).isNotMissing(),this.findBySublayerId(e.id)}emit(e,t){if("change"===e){const i=new u;i.addMany(t.added);const s=i.flatten((e=>e.sublayerExtensions)).toArray(),r=new u;r.addMany(t.removed);const a=r.flatten((e=>e.sublayerExtensions)).toArray(),n=new u;n.addMany(t.moved);const o=n.flatten((e=>e.sublayerExtensions)).toArray();return super.emit(e,{added:s,removed:a,moved:o,target:this})}return super.emit(e,t)}_itemIsInitialized(e){return super._itemIsInitialized(e)&&!!e.sublayer}}let T=class extends w{get _esriLayer(){return this._extension.layer}get _listModePath(){return"layer.listMode"}get _supportsChildren(){return this._extension.supportsSublayers}};T=e([h],T);export{T as LayerExtensionLayerListSettings};let V=class extends a{constructor(e){if(super(),this._layerBindings=new Map,this._layerExtension=e,this._bindSettingsToLayerProperties(),e.layer)this._onLayerResolved(e.layer);else{const t=e.watch("layer",(()=>{this._onLayerResolved(e.layer),t.remove()}),!0)}}_getPropertyBindings(){return{}}_getSetting(e,t){if(this._layerBindings.has(e)){let t=this._layerBindings.get(e);if("string"==typeof t&&(t={property:t}),t.hasOwnProperty("value"))return t.value;if(this._layerExtension.layer)return this._layerExtension.layer[t.property]}return super._getSetting(e,t)}_setSetting(e,t){if(this._layerBindings.has(e)){let s=this._layerBindings.get(e);if("string"==typeof s&&(s={property:s}),s.readonly||s.hasOwnProperty("value"))throw new i(ERR_SCHEMA_READ_ONLY);if(this._layerExtension.layer)return void(this._layerExtension.layer[s.property]=t)}super._setSetting(e,t)}_bindSettingsToLayerProperties(){const e=this._getPropertyBindings();for(const t of Object.keys(e)){let i=e[t];"string"==typeof i&&(i={property:i}),this._layerBindings.set(t,i),i.hasOwnProperty("value")||this._layerExtension.watch(`layer.${i.property}`,(()=>this.notifyChange(t)),!i.hasOwnProperty("sync")||i.sync)}}_onLayerResolved(e){for(const t of this._layerBindings.keys())this.isModified(t)&&(e[t]=this[t],this.reset(t))}};V=e([h],V);export{V as LayerExtensionSchema};export function _assignLayerExtensions(e,t){return f(e,t,{onNew:(t,i)=>{e.add(t instanceof LayerExtension?t:LayerExtension.create(t),R(t)?void 0:i)},onMatch:(t,i,s,r)=>{i instanceof LayerExtension||t.assignProperties(i),s===r||R(i)||e.reorder(t,r)},onMissing:t=>{(g([t])||_(t)&&0===t.layerExtensions.toArray().length)&&e.remove(t)},equals:(e,t)=>t instanceof LayerExtension?t===e:!!LayerExtension._matchesRef(e.layer,t.layer)||e.id===t.id})}function O(){return m("geocortex.api.mapping.LayerExtension")}function R(e){return e instanceof LayerExtension?!!e._deferredLayerProperties?.$ref:!p(e.layer)&&!!e.layer?.$ref}let $=class extends V{_setSetting(e,t){if(this._layerBindings.has(e))throw new i(ERR_SCHEMA_READ_ONLY);super._setSetting(e,t)}};$=e([h],$);export{$ as LayerExtensionReadOnlySchema};export const ERR_SCHEMA_READ_ONLY="This schema property is read-only.";
@@ -25,7 +25,7 @@ export declare function getSublayerType(sublayer: SublayerLike): SublayerType;
25
25
  /**
26
26
  * Well-known sublayer types for use in sublayer JSON.
27
27
  */
28
- export declare type SublayerType =
28
+ export type SublayerType =
29
29
  /**
30
30
  * Sublayer for a MapImageLayer.
31
31
  */
@@ -1 +1 @@
1
- import{__decorate}from"tslib";import{InvalidOperationError}from"../InvalidOperationError.js";import{isSublayerExtension,ItemType}from"../ItemType.js";import{FeatureSourceBase}from"../data/FeatureSourceBase.js";import{Schema}from"../data/Schema.js";import{serializable}from"../support/Serializable.js";import{isBuildingComponentSublayer,isBuildingGroupSublayer,isKMLSublayer,isMapImageSublayer,isSubtypeSublayer,isTileLayer,isWMSSublayer,isWMTSSublayer}from"../utilities/_layers.js";import{checkArg}from"../utilities/checkArg.js";import{compare}from"../utilities/collection.js";import{load}from"../utilities/esri.js";import{getLogger}from"../utilities/log.js";import{parse}from"../utilities/number.js";import{deepClone}from"../utilities/object.js";import{onCollectionPropertyChange,watchCollectionPropertyEach}from"../utilities/watch.js";import{fromLayerListMode,LayerListSettings}from"./support/LayerListSettings.js";import{SublayerExtensionCollectionBase}from"./support/_SublayerExtensionCollection.js";const log=getLogger("SublayerExtension"),ERR_INVALID_SUBLAYER_TYPE="Invalid type of sublayer for this type of sublayer extension.",ERR_FEATURES_NOT_SUPPORTED="This type of layer does not have features.",ERR_SUBLAYERX_NOT_SUPPORTED="This type of sublayer extension cannot have child sublayer extensions.",DEFAULT_CAPABILITIES=Object.freeze({supportsAdd:!1,supportsUpdate:!1,supportsDelete:!1,supportsEditing:!1,supportsQuery:!1,supportsAttachmentEditing:!1});export function getSublayerType(e){if(isMapImageSublayer(e))return isTileLayer(e?.layer)?"ArcGISTiledSublayer":"ArcGISMapServiceSublayer";if(isKMLSublayer(e))return"KMLSublayer";if(isWMTSSublayer(e))return"WMTSSublayer";if(isWMSSublayer(e))return"WMSSublayer";if(isBuildingComponentSublayer(e))return"BuildingComponentSublayer";if(isBuildingGroupSublayer(e))return"BuildingGroupSublayer";if(isSubtypeSublayer(e))return"SubtypeSublayer";throw new Error(`Unknown sublayer type for ESRI sublayer: ${e}`)}export class SublayerExtension extends FeatureSourceBase{constructor(e){super(e),this._itemType=ItemType.SUBLAYER_EXTENSION,this._watchHandles=[],this._onSublayerAddedPostInitialize=async e=>{try{await e.initialize()}catch(t){log.error({message:`Error occurred while initializing sublayer extension for sublayer '${e.title??e.sublayer.id??e.id}'.`,error:t})}},this._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")},this._onSetSublayersSublayerVisible=(e,t,i,s)=>{e&&"exclusive"===this.visibilityMode&&this._ensureAChildSublayerVisible(s)},this._onSublayersChange=e=>{e.added?.length&&"exclusive"===this.visibilityMode&&this._ensureAChildSublayerVisible(e.added[e.added.length-1])};const t=e||{};this._visibilityMode=this.canToggleVisibility?"independent":"inherited",this._sublayerExtensions=this._createSublayerExtensionCollection();const i=t.sublayer;let s;i?.hasOwnProperty("listMode")&&(s=fromLayerListMode(i.listMode)),this.layerListSettings=this._createLayerListSettings({...s,...t.layerListSettings}),isSublayer(i)?(checkArg("properties.sublayer",i).satisfies((e=>this._isSupportedSublayer(e)),ERR_INVALID_SUBLAYER_TYPE),this._setSublayer(i)):i&&(this._deferredSublayerProperties=i),this.watch("parentSublayerExtension.isEffectivelyVisible",(()=>this.notifyChange("isEffectivelyVisible")))}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(){}get visibilityMode(){return this.canToggleVisibility?this._visibilityMode:"inherited"}set visibilityMode(e){checkArg("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 _layerSupportsHideChildren(){return!1}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 initialVisibility(){return this._initialVisibility??this.sublayer?.visible??!1}static create(e){if(!SublayerExtension.factory)throw new InvalidOperationError("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=parse(s);s={id:isNaN(e)?s:e,title:s}}else"number"==typeof s&&(s={id:s});const r=isSubtypeSublayer(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 InvalidOperationError(ERR_FEATURES_NOT_SUPPORTED);return super.getFeatures(e,t)}getFullExtent(){return this.effectiveFullExtent}async addFeatures(e,t){if(checkArg("features",e).isNotMissing(),!this.hasFeatures)throw new InvalidOperationError(ERR_FEATURES_NOT_SUPPORTED);await super.addFeatures(e,t)}async updateFeatures(e,t){if(checkArg("features",e).isNotMissing(),!this.hasFeatures)throw new InvalidOperationError(ERR_FEATURES_NOT_SUPPORTED);await super.updateFeatures(e,t)}async deleteFeatures(e,t){if(checkArg("features",e).isNotMissing(),!this.hasFeatures)throw new InvalidOperationError(ERR_FEATURES_NOT_SUPPORTED);await super.deleteFeatures(e,t)}_resolveSublayer(){if(this._sublayer||!this._deferredSublayerProperties||!this.layerExtension||!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: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._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;checkArg("newSublayer",e).isNotMissing().satisfies((e=>e.id===this.sublayer.id),"Sublayer ID must match existing sublayer.").satisfies((e=>this._isSupportedSublayer(e)),ERR_INVALID_SUBLAYER_TYPE),this.isInitialized&&await load(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.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._watchHandles.push(onCollectionPropertyChange(this,"sublayer.sublayers",(async e=>{const t=(e.added??[]).map((e=>this.sublayerExtensions.forSublayer(e)));await Promise.all(t.map(this._onSublayerAddedPostInitialize))})))}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(),iconUrl:"initial",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 deepClone(this._deferredSublayerProperties)},deserialize:e=>{if(isSublayer(e)){if(e!==this.sublayer)throw new Error("Property 'sublayer' is read-only.")}else this._sublayer?this._applySublayerProperties(e,this._sublayer):this._deferredSublayerProperties&&(this._deferredSublayerProperties={...this._deferredSublayerProperties,...e})}},requestHelper:{serialize:!1}}}_createSublayerExtension(e){throw new InvalidOperationError(ERR_SUBLAYERX_NOT_SUPPORTED)}_createSchema(){return new SublayerSchema(this)}_createLayerListSettings(e){return new LayerListSettings(e)}_capabilities(){return DEFAULT_CAPABILITIES}async _onInitialize(){if(await super._onInitialize(),this._sublayer||this._deferredSublayerProperties&&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 InvalidOperationError("Cannot resolve sublayer reference: missing parent layer extension.");throw new InvalidOperationError(`No sublayer found matching reference "${e}".`)}this._initialVisibility=this.sublayer.visible,this._sublayerExtensions.onParentInitialized()}*_initializableChildCollections(){yield*super._initializableChildCollections(),yield this.sublayerExtensions}_createSublayerRef(){return{$ref:{id:isSubtypeSublayer(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,!0)),this.supportsSublayers&&this._watchHandles.push(onCollectionPropertyChange(e,"sublayers",this._onSublayersChange,!0),watchCollectionPropertyEach(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")}_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 SublayerSchema=class extends Schema{constructor(e){super(),this._sublayerBindings=new Map,this._sublayerExtension=e,this._bindSettingsToSublayerProperties()}get spatialReference(){if(this._sublayerExtension.layerExtension)return this._sublayerExtension.layerExtension.schema.spatialReference}set spatialReference(e){throw new InvalidOperationError("Cannot set sublayer schema spatial reference.")}_getPropertyBindings(){return{}}_bindSettingsToSublayerProperties(){const e=this._getPropertyBindings();for(const t of Object.keys(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)}}};SublayerSchema=__decorate([serializable],SublayerSchema);export{SublayerSchema};export class SubSublayerExtensionCollection extends SublayerExtensionCollectionBase{constructor(e){super(e,"sublayer.sublayers")}get _layerExtension(){return this._parent.layerExtension}add(e,t){if(checkArg("sublayerX",e).isNotMissing(),!this._parent.supportsSublayers)throw new InvalidOperationError(ERR_SUBLAYERX_NOT_SUPPORTED);return e.sublayer&&this._parent.sublayer&&!this._parent.sublayer.sublayers&&(this._parent.sublayer.sublayers=[]),e.parentSublayerExtension&&e.parentSublayerExtension.sublayerExtensions.remove(e),super.add(e,t)}_onAdded(e){super._onAdded(e),e._setParentSublayerExtension(this._parent)}_onRemoved(e){super._onRemoved(e),e._setParentSublayerExtension(void 0)}}export function _assignSublayerExtensions(e,t,i){compare(e,t,{onNew:(t,s)=>{e.add(isSublayerExtension(t)?t:i(t),isSublayerRef(t)?void 0:s)},onMatch:(t,i,s,r)=>{isSublayerExtension(i)||t.assignProperties(i),s===r||isSublayerRef(i)||e.reorder(t,r)},equals:(e,t)=>isSublayerExtension(t)?t===e:!!SublayerExtension._matchesRef(e.sublayer,t.sublayer,"both")||e.id===t.id})}function isSublayer(e){return e&&"function"==typeof e.get}function isSublayerRef(e){return isSublayerExtension(e)?!!e._deferredSublayerProperties?.$ref:!isSublayer(e.sublayer)&&!!e.sublayer?.$ref}
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,isSubtypeSublayer as h,isTileLayer as b,isWMSSublayer as f,isWMTSSublayer as S}from"../utilities/_layers.js";import{checkArg as p}from"../utilities/checkArg.js";import{compare as c}from"../utilities/collection.js";import{load as d}from"../utilities/esri.js";import{getLogger as g}from"../utilities/log.js";import{parse as _}from"../utilities/number.js";import{deepClone as x}from"../utilities/object.js";import{onCollectionPropertyChange as E,watchCollectionPropertyEach as v}from"../utilities/watch.js";import{fromLayerListMode as m,LayerListSettings as w}from"./support/LayerListSettings.js";import{SublayerExtensionCollectionBase as M}from"./support/_SublayerExtensionCollection.js";const C=g("SublayerExtension"),P="Invalid type of sublayer for this type of sublayer extension.",V="This type of layer does not have features.",z="This type of sublayer extension cannot have child sublayer extensions.",A=Object.freeze({supportsAdd:!1,supportsUpdate:!1,supportsDelete:!1,supportsEditing:!1,supportsQuery:!1,supportsAttachmentEditing:!1});export function getSublayerType(e){if(y(e))return b(e?.layer)?"ArcGISTiledSublayer":"ArcGISMapServiceSublayer";if(u(e))return"KMLSublayer";if(S(e))return"WMTSSublayer";if(f(e))return"WMSSublayer";if(l(e))return"BuildingComponentSublayer";if(o(e))return"BuildingGroupSublayer";if(h(e))return"SubtypeSublayer";throw new Error(`Unknown sublayer type for ESRI sublayer: ${e}`)}export class SublayerExtension extends r{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(){}get visibilityMode(){return this.canToggleVisibility?this._visibilityMode:"inherited"}set visibilityMode(e){p("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 _layerSupportsHideChildren(){return!1}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 initialVisibility(){return this._initialVisibility??this.sublayer?.visible??!1}constructor(e){super(e),this._itemType=s.SUBLAYER_EXTENSION,this._watchHandles=[],this._onSublayerAddedPostInitialize=async e=>{try{await e.initialize()}catch(t){C.error({message:`Error occurred while initializing sublayer extension for sublayer '${e.title??e.sublayer.id??e.id}'.`,error:t})}},this._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")},this._onSetSublayersSublayerVisible=(e,t,i,s)=>{e&&"exclusive"===this.visibilityMode&&this._ensureAChildSublayerVisible(s)},this._onSublayersChange=e=>{e.added?.length&&"exclusive"===this.visibilityMode&&this._ensureAChildSublayerVisible(e.added[e.added.length-1])};const t=e||{};this._visibilityMode=this.canToggleVisibility?"independent":"inherited",this._sublayerExtensions=this._createSublayerExtensionCollection();const i=t.sublayer;let r;i?.hasOwnProperty("listMode")&&(r=m(i.listMode)),this.layerListSettings=this._createLayerListSettings({...r,...t.layerListSettings}),j(i)?(p("properties.sublayer",i).satisfies((e=>this._isSupportedSublayer(e)),P),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=_(s);s={id:isNaN(e)?s:e,title:s}}else"number"==typeof s&&(s={id:s});const r=h(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(V);return super.getFeatures(e,i)}getFullExtent(){return this.effectiveFullExtent}async addFeatures(e,i){if(p("features",e).isNotMissing(),!this.hasFeatures)throw new t(V);await super.addFeatures(e,i)}async updateFeatures(e,i){if(p("features",e).isNotMissing(),!this.hasFeatures)throw new t(V);await super.updateFeatures(e,i)}async deleteFeatures(e,i){if(p("features",e).isNotMissing(),!this.hasFeatures)throw new t(V);await super.deleteFeatures(e,i)}_resolveSublayer(){if(this._sublayer||!this._deferredSublayerProperties||!this.layerExtension||!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: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._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;p("newSublayer",e).isNotMissing().satisfies((e=>e.id===this.sublayer.id),"Sublayer ID must match existing sublayer.").satisfies((e=>this._isSupportedSublayer(e)),P),this.isInitialized&&await d(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.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._watchHandles.push(E(this,"sublayer.sublayers",(async e=>{const t=(e.added??[]).map((e=>this.sublayerExtensions.forSublayer(e)));await Promise.all(t.map(this._onSublayerAddedPostInitialize))})))}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(),iconUrl:"initial",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 x(this._deferredSublayerProperties)},deserialize:e=>{if(j(e)){if(e!==this.sublayer)throw new Error("Property 'sublayer' is read-only.")}else this._sublayer?this._applySublayerProperties(e,this._sublayer):this._deferredSublayerProperties&&(this._deferredSublayerProperties={...this._deferredSublayerProperties,...e})}},requestHelper:{serialize:!1}}}_createSublayerExtension(e){throw new t(z)}_createSchema(){return new F(this)}_createLayerListSettings(e){return new w(e)}_capabilities(){return A}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 "${e}".`)}this._initialVisibility=this.sublayer.visible,this._sublayerExtensions.onParentInitialized()}*_initializableChildCollections(){yield*super._initializableChildCollections(),yield this.sublayerExtensions}_createSublayerRef(){return{$ref:{id:h(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,!0)),this.supportsSublayers&&this._watchHandles.push(E(e,"sublayers",this._onSublayersChange,!0),v(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")}_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 F=class extends a{constructor(e){super(),this._sublayerBindings=new Map,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 Object.keys(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)}}};F=e([n],F);export{F as SublayerSchema};export class SubSublayerExtensionCollection extends M{get _layerExtension(){return this._parent.layerExtension}constructor(e){super(e,"sublayer.sublayers")}add(e,i){if(p("sublayerX",e).isNotMissing(),!this._parent.supportsSublayers)throw new t(z);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)=>{e.add(i(t)?t:s(t),T(t)?void 0:r)},onMatch:(t,s,r,a)=>{i(s)||t.assignProperties(s),r===a||T(s)||e.reorder(t,a)},equals:(e,t)=>i(t)?t===e:!!SublayerExtension._matchesRef(e.sublayer,t.sublayer,"both")||e.id===t.id})}function j(e){return e&&"function"==typeof e.get}function T(e){return i(e)?!!e._deferredSublayerProperties?.$ref:!j(e.sublayer)&&!!e.sublayer?.$ref}
@@ -1 +1 @@
1
- import FeatureLayer from"@arcgis/core/layers/FeatureLayer";import{toFeature,toGraphic}from"../data/Feature.js";import{FeatureSet}from"../data/FeatureSet.js";import{toCsv as convertUtils_toCsv,csvToFeatureSet,toXLSX as convertUtils_toXLSX,xlsxToFeatureSet,toShapefile as convertUtils_toShapefile,shapefileToFeatureSet}from"../data/convert.js";import{checkArg}from"../utilities/checkArg.js";import{Collection}from"../utilities/collection.js";import{FeatureCollectionLayerExtension}from"./FeatureCollectionLayerExtension.js";export{GeometryFormat}from"../data/convert.js";export async function toCsv(e,t){checkArg("featureCollection",e).isNotMissing(),checkArg("featureCollection.layer",e.layer).isNotMissing(),checkArg("featureCollection.layer.source",e.layer.source).satisfies((e=>Collection.isCollection(e)));const r=e.layer.source.map((e=>toFeature(e,void 0))).toArray(),o=new FeatureSet({features:r});return convertUtils_toCsv(o,t)}export async function csvToFeatureCollection(e,t){checkArg("csvData",e).isNotMissing();const r=await csvToFeatureSet(e,t),o=Array.from(r).map(toGraphic),a=new FeatureLayer({source:o});return new FeatureCollectionLayerExtension({layer:a})}export async function toXLSX(e,t){checkArg("featureCollection",e).isNotMissing(),checkArg("featureCollection.layer",e.layer).isNotMissing(),checkArg("featureCollection.layer.source",e.layer.source).satisfies((e=>Collection.isCollection(e)));const r=e.layer.source.map((e=>toFeature(e,void 0))).toArray(),o=new FeatureSet({features:r});return convertUtils_toXLSX(o,t)}export async function xlsxToFeatureCollection(e,t){checkArg("xlsxData",e).isNotMissing();const r=await xlsxToFeatureSet(e,t),o=Array.from(r).map(toGraphic),a=new FeatureLayer({source:o});return new FeatureCollectionLayerExtension({layer:a})}export async function toShapefile(e,t){checkArg("featureCollection",e).isNotMissing(),checkArg("featureCollection.layer",e.layer).isNotMissing(),checkArg("featureCollection.layer.source",e.layer.source).satisfies((e=>Collection.isCollection(e)));const r=e.layer.source.map((e=>toFeature(e,void 0))).toArray(),o=new FeatureSet({features:r});return convertUtils_toShapefile(o,t)}export async function shapefileToFeatureCollection(e,t){checkArg("shapefileData",e).isNotMissing();const r=await shapefileToFeatureSet(e,t),o=Array.from(r).map(toGraphic),a=new FeatureLayer({source:o});return new FeatureCollectionLayerExtension({layer:a})}
1
+ import e from"@arcgis/core/layers/FeatureLayer";import{toFeature as o,toGraphic as t}from"../data/Feature.js";import{FeatureSet as r}from"../data/FeatureSet.js";import{toCsv as a,csvToFeatureSet as s,toXLSX as i,xlsxToFeatureSet as n,toShapefile as l,shapefileToFeatureSet as c}from"../data/convert.js";import{checkArg as u}from"../utilities/checkArg.js";import{Collection as f}from"../utilities/collection.js";import{FeatureCollectionLayerExtension as y}from"./FeatureCollectionLayerExtension.js";export{GeometryFormat}from"../data/convert.js";export async function toCsv(e,t){u("featureCollection",e).isNotMissing(),u("featureCollection.layer",e.layer).isNotMissing(),u("featureCollection.layer.source",e.layer.source).satisfies((e=>f.isCollection(e)));const s=e.layer.source.map((e=>o(e,void 0))).toArray(),i=new r({features:s});return a(i,t)}export async function csvToFeatureCollection(o,r){u("csvData",o).isNotMissing();const a=await s(o,r),i=Array.from(a).map(t),n=new e({source:i});return new y({layer:n})}export async function toXLSX(e,t){u("featureCollection",e).isNotMissing(),u("featureCollection.layer",e.layer).isNotMissing(),u("featureCollection.layer.source",e.layer.source).satisfies((e=>f.isCollection(e)));const a=e.layer.source.map((e=>o(e,void 0))).toArray(),s=new r({features:a});return i(s,t)}export async function xlsxToFeatureCollection(o,r){u("xlsxData",o).isNotMissing();const a=await n(o,r),s=Array.from(a).map(t),i=new e({source:s});return new y({layer:i})}export async function toShapefile(e,t){u("featureCollection",e).isNotMissing(),u("featureCollection.layer",e.layer).isNotMissing(),u("featureCollection.layer.source",e.layer.source).satisfies((e=>f.isCollection(e)));const a=e.layer.source.map((e=>o(e,void 0))).toArray(),s=new r({features:a});return l(s,t)}export async function shapefileToFeatureCollection(o,r){u("shapefileData",o).isNotMissing();const a=await c(o,r),s=Array.from(a).map(t),i=new e({source:s});return new y({layer:i})}
@@ -1 +1 @@
1
- import Collection from"@arcgis/core/core/Collection";import{CollectionProxy}from"../../utilities/CollectionProxy.js";export class ArrayWrappedCollection extends CollectionProxy{constructor(t,r){if(super(),r)this._parent=t,this._targetProperty=t.hasOwnProperty("sublayer")?"sublayer":"layer",this._arrayProperty=r;else{const{parent:r,targetProperty:e,arrayProperty:o}=t;this._parent=r,this._targetProperty=e,this._arrayProperty=o}if(this._target)this._onTargetResolved(this._target);else{this._collection=new Collection;const t=this._parent.watch(this._targetProperty,(()=>{const r=this._target;r&&(this.length&&r.set({[this._arrayProperty]:this.toArray()}),this._onTargetResolved(r),t.remove())}),!0)}}get _target(){return this._targetProperty?this._parent.get(this._targetProperty):this._parent}add(t,r){const e=this._target;return e&&!e.get(this._arrayProperty)&&(e.set({[this._arrayProperty]:[]}),this._collection=wrapArrayWithCollection(e.get(this._arrayProperty))),super.add(t,r)}_onTargetResolved(t){this._collection=wrapArrayWithCollection(t.get(this._arrayProperty)??[]),this._parent.watch(this._targetProperty?`${this._targetProperty}.${this._arrayProperty}`:this._arrayProperty,(()=>{this._target&&(this._collection=wrapArrayWithCollection(this._target.get(this._arrayProperty)??[]))}),!0)}}function wrapArrayWithCollection(t){const r=Array.isArray(t)?t:[],e=new Collection;return Object.defineProperty(e,"_items",{get:()=>r}),Object.defineProperty(e,"length",{get:()=>r.length,set:t=>r.length=t}),e}
1
+ import t from"@arcgis/core/core/Collection";import{CollectionProxy as r}from"../../utilities/CollectionProxy.js";export class ArrayWrappedCollection extends r{get _target(){return this._targetProperty?this._parent.get(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: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=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,r){const s=this._target;return s&&!s.get(this._arrayProperty)&&(s.set({[this._arrayProperty]:[]}),this._collection=e(s.get(this._arrayProperty))),super.add(t,r)}_onTargetResolved(t){this._collection=e(t.get(this._arrayProperty)??[]),this._parent.watch(this._targetProperty?`${this._targetProperty}.${this._arrayProperty}`:this._arrayProperty,(()=>{this._target&&(this._collection=e(this._target.get(this._arrayProperty)??[]))}),!0)}}function e(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}
@@ -1 +1 @@
1
- import{ArgumentError}from"../../ArgumentError.js";import{FeatureLayer as PortalFeatureLayer}from"../../portal/FeatureLayer.js";import{WebTileLayer as PortalWebTileLayer}from"../../portal/WebTileLayer.js";import{isBuildingSceneLayer,isCSVLayer,isElevationLayer,isFeatureLayer,isGeoRssLayer,isGraphicsLayer,isGroupLayer,isImageryLayer,isImageryTileLayer,isIntegratedMeshLayer,isKMLLayer,isLayer,isMapImageLayer,isOpenStreetMapLayer,isPointCloudLayer,isSceneLayer,isStreamLayer,isSubtypeGroupLayer,isTileLayer,isVectorTileLayer,isWebTileLayer,isWMSLayer,isWMTSLayer}from"../../utilities/_layers.js";import{checkArg}from"../../utilities/checkArg.js";import{Collection}from"../../utilities/collection.js";import{BuildingSceneLayerExtension}from"../BuildingSceneLayerExtension.js";import{CSVLayerExtension}from"../CSVLayerExtension.js";import{ElevationLayerExtension}from"../ElevationLayerExtension.js";import{FeatureCollectionLayerExtension}from"../FeatureCollectionLayerExtension.js";import{FeatureLayerExtension}from"../FeatureLayerExtension.js";import{GeoRSSLayerExtension}from"../GeoRSSLayerExtension.js";import{GraphicsLayerExtension}from"../GraphicsLayerExtension.js";import{GroupLayerExtension}from"../GroupLayerExtension.js";import{ImageryLayerExtension}from"../ImageryLayerExtension.js";import{ImageryTileLayerExtension}from"../ImageryTileLayerExtension.js";import{IntegratedMeshLayerExtension}from"../IntegratedMeshLayerExtension.js";import{KMLLayerExtension}from"../KMLLayerExtension.js";import{MapImageLayerExtension}from"../MapImageLayerExtension.js";import{OpenStreetMapLayerExtension}from"../OpenStreetMapLayerExtension.js";import{PointCloudLayerExtension}from"../PointCloudLayerExtension.js";import{SceneLayerExtension}from"../SceneLayerExtension.js";import{StreamLayerExtension}from"../StreamLayerExtension.js";import{SubtypeGroupLayerExtension}from"../SubtypeGroupLayerExtension.js";import{TileLayerExtension}from"../TileLayerExtension.js";import{UnsupportedLayerExtension}from"../UnsupportedLayerExtension.js";import{VectorTileLayerExtension}from"../VectorTileLayerExtension.js";import{WMSLayerExtension}from"../WMSLayerExtension.js";import{WMTSLayerExtension}from"../WMTSLayerExtension.js";import{WebTileLayerExtension}from"../WebTileLayerExtension.js";export class DefaultLayerExtensionFactory{constructor(){}create(e){if(checkArg("properties",e).isNotMissing(),checkArg("properties.layer",e.layer).isNotMissing(),isLayer(e.layer)){if(isBuildingSceneLayer(e.layer))return new BuildingSceneLayerExtension(e);if(isCSVLayer(e.layer))return new CSVLayerExtension(e);if(isElevationLayer(e.layer))return new ElevationLayerExtension(e);if(isStreamLayer(e.layer))return new StreamLayerExtension(e);if(isFeatureLayer(e.layer)){const{layer:r}=e;return Collection.isCollection(r.source)?new FeatureCollectionLayerExtension(e):new FeatureLayerExtension(e)}return isGeoRssLayer(e.layer)?new GeoRSSLayerExtension(e):isGraphicsLayer(e.layer)?new GraphicsLayerExtension(e):isGroupLayer(e.layer)?new GroupLayerExtension(e):isImageryLayer(e.layer)?new ImageryLayerExtension(e):isIntegratedMeshLayer(e.layer)?new IntegratedMeshLayerExtension(e):isKMLLayer(e.layer)?new KMLLayerExtension(e):isMapImageLayer(e.layer)?new MapImageLayerExtension(e):isOpenStreetMapLayer(e.layer)?new OpenStreetMapLayerExtension(e):isPointCloudLayer(e.layer)?new PointCloudLayerExtension(e):isSceneLayer(e.layer)?new SceneLayerExtension(e):isSubtypeGroupLayer(e.layer)?new SubtypeGroupLayerExtension(e):isTileLayer(e.layer)?new TileLayerExtension(e):isImageryTileLayer(e.layer)?new ImageryTileLayerExtension(e):isVectorTileLayer(e.layer)?new VectorTileLayerExtension(e):isWebTileLayer(e.layer)?new WebTileLayerExtension(e):isWMSLayer(e.layer)?new WMSLayerExtension(e):isWMTSLayer(e.layer)?new WMTSLayerExtension(e):new UnsupportedLayerExtension(e)}if(e.layer.layerType)switch(e.layer.layerType){case"BuildingSceneLayer":return new BuildingSceneLayerExtension(e);case"CSV":return new CSVLayerExtension(e);case"ArcGISTiledElevationServiceLayer":return new ElevationLayerExtension(e);case"ArcGISFeatureLayer":return PortalFeatureLayer.isGraphicsLayerJson(e.layer)||PortalFeatureLayer.isMapNotesLayer(e.layer)?new GraphicsLayerExtension(e):PortalFeatureLayer.isFeatureCollection(e.layer)?new FeatureCollectionLayerExtension(e):new FeatureLayerExtension(e);case"ArcGISAnnotationLayer":return e.layer.layerType="ArcGISFeatureLayer",e.layer.$layerSubType="ArcGISAnnotationLayer",new FeatureLayerExtension(e);case"GeoRSS":return new GeoRSSLayerExtension(e);case"GroupLayer":return new GroupLayerExtension(e);case"ArcGISImageServiceLayer":case"ArcGISImageServiceVectorLayer":return new ImageryLayerExtension(e);case"IntegratedMeshLayer":return new IntegratedMeshLayerExtension(e);case"KML":return new KMLLayerExtension(e);case"ArcGISMapServiceLayer":return new MapImageLayerExtension(e);case"OpenStreetMap":return new OpenStreetMapLayerExtension(e);case"PointCloudLayer":return new PointCloudLayerExtension(e);case"ArcGISSceneServiceLayer":return new SceneLayerExtension(e);case"SubtypeGroupLayer":return new SubtypeGroupLayerExtension(e);case"ArcGISStreamLayer":return new StreamLayerExtension(e);case"ArcGISTiledImageServiceLayer":return new ImageryTileLayerExtension(e);case"ArcGISTiledMapServiceLayer":return new TileLayerExtension(e);case"VectorTileLayer":return new VectorTileLayerExtension(e);case"WebTiledLayer":return PortalWebTileLayer.isTileLayerWMTS(e.layer)?new WMTSLayerExtension(e):new WebTileLayerExtension(e);case"WMS":return new WMSLayerExtension(e)}else if(e.layer.type&&"OpenStreetMap"===e.layer.type)return new OpenStreetMapLayerExtension(e);throw new ArgumentError("properties.layer","Unable to determine correct type of layer extension to create.")}}DefaultLayerExtensionFactory.instance=new DefaultLayerExtensionFactory;
1
+ import{ArgumentError as e}from"../../ArgumentError.js";import{FeatureLayer as r}from"../../portal/FeatureLayer.js";import{WebTileLayer as n}from"../../portal/WebTileLayer.js";import{isBuildingSceneLayer as a,isCSVLayer as t,isElevationLayer as o,isFeatureLayer as i,isGeoRssLayer as s,isGraphicsLayer as y,isGroupLayer as l,isImageryLayer as c,isImageryTileLayer as m,isIntegratedMeshLayer as p,isKMLLayer as u,isLayer as L,isMapImageLayer as w,isOpenStreetMapLayer as f,isPointCloudLayer as S,isSceneLayer as j,isStreamLayer as E,isSubtypeGroupLayer as x,isTileLayer as G,isVectorTileLayer as I,isWebTileLayer as T,isWMSLayer as M,isWMTSLayer as A}from"../../utilities/_layers.js";import{checkArg as g}from"../../utilities/checkArg.js";import{Collection as d}from"../../utilities/collection.js";import{BuildingSceneLayerExtension as F}from"../BuildingSceneLayerExtension.js";import{CSVLayerExtension as v}from"../CSVLayerExtension.js";import{ElevationLayerExtension as b}from"../ElevationLayerExtension.js";import{FeatureCollectionLayerExtension as W}from"../FeatureCollectionLayerExtension.js";import{FeatureLayerExtension as h}from"../FeatureLayerExtension.js";import{GeoRSSLayerExtension as C}from"../GeoRSSLayerExtension.js";import{GraphicsLayerExtension as V}from"../GraphicsLayerExtension.js";import{GroupLayerExtension as D}from"../GroupLayerExtension.js";import{ImageryLayerExtension as N}from"../ImageryLayerExtension.js";import{ImageryTileLayerExtension as O}from"../ImageryTileLayerExtension.js";import{IntegratedMeshLayerExtension as B}from"../IntegratedMeshLayerExtension.js";import{KMLLayerExtension as K}from"../KMLLayerExtension.js";import{MapImageLayerExtension as P}from"../MapImageLayerExtension.js";import{OpenStreetMapLayerExtension as R}from"../OpenStreetMapLayerExtension.js";import{PointCloudLayerExtension as U}from"../PointCloudLayerExtension.js";import{SceneLayerExtension as k}from"../SceneLayerExtension.js";import{StreamLayerExtension as J}from"../StreamLayerExtension.js";import{SubtypeGroupLayerExtension as $}from"../SubtypeGroupLayerExtension.js";import{TileLayerExtension as _}from"../TileLayerExtension.js";import{UnsupportedLayerExtension as q}from"../UnsupportedLayerExtension.js";import{VectorTileLayerExtension as z}from"../VectorTileLayerExtension.js";import{WMSLayerExtension as H}from"../WMSLayerExtension.js";import{WMTSLayerExtension as Q}from"../WMTSLayerExtension.js";import{WebTileLayerExtension as X}from"../WebTileLayerExtension.js";export class DefaultLayerExtensionFactory{constructor(){}create(Y){if(g("properties",Y).isNotMissing(),g("properties.layer",Y.layer).isNotMissing(),L(Y.layer)){if(a(Y.layer))return new F(Y);if(t(Y.layer))return new v(Y);if(o(Y.layer))return new b(Y);if(E(Y.layer))return new J(Y);if(i(Y.layer)){const{layer:e}=Y;return d.isCollection(e.source)?new W(Y):new h(Y)}return s(Y.layer)?new C(Y):y(Y.layer)?new V(Y):l(Y.layer)?new D(Y):c(Y.layer)?new N(Y):p(Y.layer)?new B(Y):u(Y.layer)?new K(Y):w(Y.layer)?new P(Y):f(Y.layer)?new R(Y):S(Y.layer)?new U(Y):j(Y.layer)?new k(Y):x(Y.layer)?new $(Y):G(Y.layer)?new _(Y):m(Y.layer)?new O(Y):I(Y.layer)?new z(Y):T(Y.layer)?new X(Y):M(Y.layer)?new H(Y):A(Y.layer)?new Q(Y):new q(Y)}if(Y.layer.layerType)switch(Y.layer.layerType){case"BuildingSceneLayer":return new F(Y);case"CSV":return new v(Y);case"ArcGISTiledElevationServiceLayer":return new b(Y);case"ArcGISFeatureLayer":return r.isGraphicsLayerJson(Y.layer)||r.isMapNotesLayer(Y.layer)?new V(Y):r.isFeatureCollection(Y.layer)?new W(Y):new h(Y);case"ArcGISAnnotationLayer":return Y.layer.layerType="ArcGISFeatureLayer",Y.layer.$layerSubType="ArcGISAnnotationLayer",new h(Y);case"GeoRSS":return new C(Y);case"GroupLayer":return new D(Y);case"ArcGISImageServiceLayer":case"ArcGISImageServiceVectorLayer":return new N(Y);case"IntegratedMeshLayer":return new B(Y);case"KML":return new K(Y);case"ArcGISMapServiceLayer":return new P(Y);case"OpenStreetMap":return new R(Y);case"PointCloudLayer":return new U(Y);case"ArcGISSceneServiceLayer":return new k(Y);case"SubtypeGroupLayer":return new $(Y);case"ArcGISStreamLayer":return new J(Y);case"ArcGISTiledImageServiceLayer":return new O(Y);case"ArcGISTiledMapServiceLayer":return new _(Y);case"VectorTileLayer":return new z(Y);case"WebTiledLayer":return n.isTileLayerWMTS(Y.layer)?new Q(Y):new X(Y);case"WMS":return new H(Y)}else if(Y.layer.type&&"OpenStreetMap"===Y.layer.type)return new R(Y);throw new e("properties.layer","Unable to determine correct type of layer extension to create.")}}DefaultLayerExtensionFactory.instance=new DefaultLayerExtensionFactory;
@@ -1 +1 @@
1
- import{ArgumentError}from"../../ArgumentError.js";import{isBuildingComponentSublayer,isBuildingGroupSublayer,isKMLSublayer,isMapImageLayer,isMapImageSublayer,isSubtypeSublayer,isTileLayer,isWMSSublayer,isWMTSSublayer}from"../../utilities/_layers.js";import{checkArg}from"../../utilities/checkArg.js";import{BuildingComponentSublayerExtension}from"../BuildingComponentSublayerExtension.js";import{BuildingGroupSublayerExtension}from"../BuildingGroupSublayerExtension.js";import{KMLSublayerExtension}from"../KMLSublayerExtension.js";import{MapImageSublayerExtension}from"../MapImageSublayerExtension.js";import{SubtypeSublayerExtension}from"../SubtypeSublayerExtension.js";import{TileSublayerExtension}from"../TileSublayerExtension.js";import{WMSSublayerExtension}from"../WMSSublayerExtension.js";import{WMTSSublayerExtension}from"../WMTSSublayerExtension.js";export class DefaultSublayerExtensionFactory{constructor(){}create(e){checkArg("properties",e).isNotMissing(),checkArg("properties.sublayer",e.sublayer).isNotMissing();const r=e.sublayer;if(isMapImageSublayer(r)&&r.layer){if(isTileLayer(r.layer))return new TileSublayerExtension(e);if(isMapImageLayer(r.layer))return new MapImageSublayerExtension(e)}else{if(isKMLSublayer(r))return new KMLSublayerExtension(e);if(isWMTSSublayer(r))return new WMTSSublayerExtension(e);if(isWMSSublayer(r))return new WMSSublayerExtension(e);if(isBuildingComponentSublayer(r))return new BuildingComponentSublayerExtension(e);if(isBuildingGroupSublayer(r))return new BuildingGroupSublayerExtension(e);if(isSubtypeSublayer(r))return new SubtypeSublayerExtension(e);if(e.sublayer.$sublayerType)switch(e.sublayer.$sublayerType){case"ArcGISMapServiceSublayer":return new MapImageSublayerExtension(e);case"ArcGISTiledSublayer":return new TileSublayerExtension(e);case"WMSSublayer":return new WMSSublayerExtension(e);case"WMTSSublayer":return new WMTSSublayerExtension(e);case"KMLSublayer":return new KMLSublayerExtension(e);case"BuildingComponentSublayer":return new BuildingComponentSublayerExtension(e);case"BuildingGroupSublayer":return new BuildingGroupSublayerExtension(e);case"SubtypeSublayer":return new SubtypeSublayerExtension(e)}}throw new ArgumentError("properties.sublayer","Unable to determine correct type of sublayer extension to create.")}}DefaultSublayerExtensionFactory.instance=new DefaultSublayerExtensionFactory;
1
+ import{ArgumentError as e}from"../../ArgumentError.js";import{isBuildingComponentSublayer as r,isBuildingGroupSublayer as n,isKMLSublayer as t,isMapImageLayer as i,isMapImageSublayer as s,isSubtypeSublayer as u,isTileLayer as o,isWMSSublayer as a,isWMTSSublayer as l}from"../../utilities/_layers.js";import{checkArg as y}from"../../utilities/checkArg.js";import{BuildingComponentSublayerExtension as b}from"../BuildingComponentSublayerExtension.js";import{BuildingGroupSublayerExtension as p}from"../BuildingGroupSublayerExtension.js";import{KMLSublayerExtension as S}from"../KMLSublayerExtension.js";import{MapImageSublayerExtension as m}from"../MapImageSublayerExtension.js";import{SubtypeSublayerExtension as c}from"../SubtypeSublayerExtension.js";import{TileSublayerExtension as f}from"../TileSublayerExtension.js";import{WMSSublayerExtension as w}from"../WMSSublayerExtension.js";import{WMTSSublayerExtension as x}from"../WMTSSublayerExtension.js";export class DefaultSublayerExtensionFactory{constructor(){}create(E){y("properties",E).isNotMissing(),y("properties.sublayer",E.sublayer).isNotMissing();const j=E.sublayer;if(s(j)&&j.layer){if(o(j.layer))return new f(E);if(i(j.layer))return new m(E)}else{if(t(j))return new S(E);if(l(j))return new x(E);if(a(j))return new w(E);if(r(j))return new b(E);if(n(j))return new p(E);if(u(j))return new c(E);if(E.sublayer.$sublayerType)switch(E.sublayer.$sublayerType){case"ArcGISMapServiceSublayer":return new m(E);case"ArcGISTiledSublayer":return new f(E);case"WMSSublayer":return new w(E);case"WMTSSublayer":return new x(E);case"KMLSublayer":return new S(E);case"BuildingComponentSublayer":return new b(E);case"BuildingGroupSublayer":return new p(E);case"SubtypeSublayer":return new c(E)}}throw new e("properties.sublayer","Unable to determine correct type of sublayer extension to create.")}}DefaultSublayerExtensionFactory.instance=new DefaultSublayerExtensionFactory;
@@ -1 +1 @@
1
- import{__decorate}from"tslib";import{whenOnce}from"@arcgis/core/core/reactiveUtils";import{InvalidOperationError}from"../../InvalidOperationError.js";import{isLayerExtension}from"../../ItemType.js";import{serializable,SerializableBase}from"../../support/Serializable.js";import{checkArg}from"../../utilities/checkArg.js";export class LayerListSettingsProperties{}let LayerListSettings=class extends SerializableBase{get expanded(){return this._expanded}set expanded(e){this._expanded=e}get included(){return this._included}set included(e){this._included=e}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}_getSerializableProperties(){return{expanded:{serializeModes:["initial"],default:!1},included:{serializeModes:["initial"],default:!0},childrenIncluded:{serializeModes:["initial"],default:!0}}}};LayerListSettings=__decorate([serializable],LayerListSettings);export{LayerListSettings};export class ExtensionBaseLayerListSettings extends LayerListSettings{constructor(e,i,t){checkArg("extension",i).isNotMissing().isDefined(),super(e),this._extension=i,this._defaultChildrenIncluded=t;const d=()=>isLayerExtension(i)?i.layer:i.sublayer,n=d();"included"in e?(this._initialIncluded=e.included,this.notifyChange("initialIncluded")):(n?this._initialIncluded=this.included:(async()=>{await whenOnce(d),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")):(n?this._initialChildrenIncluded=this.childrenIncluded:(async()=>{await whenOnce(d),this._initialChildrenIncluded=this.childrenIncluded,this.notifyChange("initialChildrenIncluded")})(),void 0===this._initialChildrenIncluded&&(this._initialChildrenIncluded=!0,this.notifyChange("initialChildrenIncluded"))),n?this._initialEsriLayerListMode=n.listMode:(async()=>{await whenOnce(d),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){checkArg("value",e).satisfies((e=>"boolean"==typeof e),"LayerListSettings must be set to boolean values"),super.included=e,this._setListMode()}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(checkArg("value",e).satisfies((e=>"boolean"==typeof e),"LayerListSettings must be set to boolean values"),!this._supportsChildren&&e)throw new InvalidOperationError("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(checkArg("value",e).satisfies((e=>"boolean"==typeof e),"LayerListSettings must be set to boolean values"),!this._supportsChildren&&e)throw new InvalidOperationError("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 i}from"tslib";import{whenOnce as e}from"@arcgis/core/core/reactiveUtils";import{InvalidOperationError as t}from"../../InvalidOperationError.js";import{isLayerExtension as d}from"../../ItemType.js";import{serializable as n,SerializableBase as s}from"../../support/Serializable.js";import{checkArg as l}from"../../utilities/checkArg.js";export class LayerListSettingsProperties{}let r=class extends s{get expanded(){return this._expanded}set expanded(i){this._expanded=i}get included(){return this._included}set included(i){this._included=i}get initialExpanded(){return this._initialExpanded}get initialChildrenIncluded(){return this._initialChildrenIncluded}get initialIncluded(){return this._initialIncluded}get childrenIncluded(){return this._childrenIncluded}set childrenIncluded(i){this._childrenIncluded=i}_getSerializableProperties(){return{expanded:{serializeModes:["initial"],default:!1},included:{serializeModes:["initial"],default:!0},childrenIncluded:{serializeModes:["initial"],default:!0}}}};r=i([n],r);export{r as LayerListSettings};export class ExtensionBaseLayerListSettings extends r{constructor(i,t,n){l("extension",t).isNotMissing().isDefined(),super(i),this._extension=t,this._defaultChildrenIncluded=n;const s=()=>d(t)?t.layer:t.sublayer,r=s();"included"in i?(this._initialIncluded=i.included,this.notifyChange("initialIncluded")):(r?this._initialIncluded=this.included:(async()=>{await e(s),this._initialIncluded=this.included,this.notifyChange("initialIncluded")})(),void 0===this._initialIncluded&&(this._initialIncluded=!0,this.notifyChange("initialIncluded"))),"childrenIncluded"in i?(this._initialChildrenIncluded=i.childrenIncluded,this.notifyChange("initialChildrenIncluded")):(r?this._initialChildrenIncluded=this.childrenIncluded:(async()=>{await e(s),this._initialChildrenIncluded=this.childrenIncluded,this.notifyChange("initialChildrenIncluded")})(),void 0===this._initialChildrenIncluded&&(this._initialChildrenIncluded=!0,this.notifyChange("initialChildrenIncluded"))),r?this._initialEsriLayerListMode=r.listMode:(async()=>{await e(s),void 0===this._initialEsriLayerListMode&&(this._initialEsriLayerListMode=this._esriLayer.listMode)})(),this._initialExpanded=i.expanded??!1}get included(){return void 0!==super.included?super.included:!this._esriLayer||"hide"!==this._esriLayer.listMode}set included(i){l("value",i).satisfies((i=>"boolean"==typeof i),"LayerListSettings must be set to boolean values"),super.included=i,this._setListMode()}get childrenIncluded(){return void 0!==super.childrenIncluded?super.childrenIncluded:this._esriLayer?this._supportsChildren&&"show"===this._esriLayer.listMode:this._defaultChildrenIncluded??this._supportsChildren}set childrenIncluded(i){if(l("value",i).satisfies((i=>"boolean"==typeof i),"LayerListSettings must be set to boolean values"),!this._supportsChildren&&i)throw new t("Cannot set 'childrenIncluded' to true on a layer that does not support sublayers.");super.childrenIncluded=i,this._setListMode()}get expanded(){return super.expanded}set expanded(i){if(l("value",i).satisfies((i=>"boolean"==typeof i),"LayerListSettings must be set to boolean values"),!this._supportsChildren&&i)throw new t("Cannot set 'expanded' to true on a layer that does not support sublayers.");super.expanded=i}onLayerExtensionInitialized(){this._setListMode(),this._extension.watch(this._listModePath,((i,e)=>{i!==e&&(super.childrenIncluded=void 0,super.included=void 0)}),!0)}_getSerializableProperties(){return{...super._getSerializableProperties(),included:{serializeModes:["initial"],isDefault:i=>!!i},childrenIncluded:{serializeModes:["initial"],isDefault:i=>i===this._childrenIncludedSerializationDefault()}}}_childrenIncludedSerializationDefault(){return this._esriLayer?"show"===this._initialEsriLayerListMode:this._defaultChildrenIncluded??this._supportsChildren}_setListMode(){const i=this._esriLayer;i&&(void 0===this._initialEsriLayerListMode&&(this._initialEsriLayerListMode=i.listMode),!this.childrenIncluded&&this._extension._layerSupportsHideChildren&&this.included?i.listMode="hide-children":this.childrenIncluded||this.included?i.listMode="show":i.listMode="hide")}}export function fromLayerListMode(i){const e={};return"hide"===i?e.included=!1:"show"===i?e.included=!0:"hide-children"===i&&(e.childrenIncluded=!1),e}
@@ -1 +1 @@
1
- import{__decorate}from"tslib";import{FeatureSettings}from"../../data/FeatureSettings.js";import{TableExtension}from"../../data/_TableExtension.js";import{serializable}from"../../support/Serializable.js";import{LayerExtension}from"../_LayerExtension.js";import{SublayerExtension}from"../_SublayerExtension.js";let PopupTemplateFeatureSettings=class extends FeatureSettings{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)}}get _bindings(){return this._propertyBindings||(this._propertyBindings=new Map),this._propertyBindings}_getSerializableProperties(){return{...super._getSerializableProperties(),popupTemplate:{serialize:!1}}}_getSetting(e,t){const i=this._getLayerLike();return this._bindings.has(e)&&i?i.get(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 LayerExtension?this._layerExtension.layer:this._layerExtension instanceof TableExtension?this._layerExtension.table:this._layerExtension instanceof SublayerExtension?this._layerExtension.sublayer:void 0}_getLayerLikeType(){return this._layerExtension instanceof LayerExtension?"layer":this._layerExtension instanceof TableExtension?"table":this._layerExtension instanceof SublayerExtension?"sublayer":void 0}};PopupTemplateFeatureSettings=__decorate([serializable],PopupTemplateFeatureSettings);export{PopupTemplateFeatureSettings};
1
+ import{__decorate as e}from"tslib";import{FeatureSettings as t}from"../../data/FeatureSettings.js";import{TableExtension as i}from"../../data/_TableExtension.js";import{serializable as s}from"../../support/Serializable.js";import{LayerExtension as n}from"../_LayerExtension.js";import{SublayerExtension as r}from"../_SublayerExtension.js";let o=class extends t{get _bindings(){return this._propertyBindings||(this._propertyBindings=new Map),this._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?i.get(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 n?this._layerExtension.layer:this._layerExtension instanceof i?this._layerExtension.table:this._layerExtension instanceof r?this._layerExtension.sublayer:void 0}_getLayerLikeType(){return this._layerExtension instanceof n?"layer":this._layerExtension instanceof i?"table":this._layerExtension instanceof r?"sublayer":void 0}};o=e([s],o);export{o as PopupTemplateFeatureSettings};
@@ -1 +1 @@
1
- import{ArgumentError}from"../../ArgumentError.js";import{InvalidOperationError}from"../../InvalidOperationError.js";import{DefaultRequestHelper}from"../../utilities/RequestHelper.js";import{OgcNamespace}from"../../utilities/_ogc.js";import{checkArg}from"../../utilities/checkArg.js";import{Uri}from"../../utilities/uri.js";import{WfsFeatureType}from"./WfsFeatureType.js";export var WfsVersions;!function(e){e.WFS_1_0="1.0.0",e.WFS_1_1="1.1.0",e.WFS_2_0="2.0.0"}(WfsVersions||(WfsVersions={}));export class WfsCapabilities{constructor(e){this.requestHelper=new DefaultRequestHelper,this._allowsWfsQuery=!0,this._isInitialized=!1,this._isDestroyed=!1,this._implementsBasicWfs=!0,this._getFeatureOutputFormats=new Array,this._featureTypes=new Array,this.assignProperties(e)}get isInitialized(){return this._isInitialized}get isDestroyed(){return this._isDestroyed}get url(){return this._url}get wfsVersion(){return this._wfsVersion}get title(){return this._title}get describeFeatureTypeGetUrl(){return this._describeFeatureTypeGetUrl}get describeFeatureTypePostUrl(){return this._describeFeatureTypePostUrl}get getFeatureGetUrl(){return this._getFeatureGetUrl}get getFeaturePostUrl(){return this._getFeaturePostUrl}get getFeatureOutputFormats(){return this._getFeatureOutputFormats}get implementsBasicWfs(){return this._implementsBasicWfs}get allowsWfsQuery(){return this._allowsWfsQuery}get featureTypes(){return this._featureTypes}assignProperties(e){if(checkArg("properties",e).isNotMissing(),!e.hasOwnProperty("url"))throw new ArgumentError("WfsCapabilities requires a URL");this._url=e.url}async initialize(){if(this._isInitialized)return;const e=new Uri(this.url);e.queryValues.set("request","GetCapabilities"),e.queryValues.set("service","WFS");const t=await this.requestHelper.request(e.toString()),s=await t.text(),r=(new DOMParser).parseFromString(s,"text/xml");if(!t||!r||!r.childNodes||0===r.childNodes.length)throw new Error(`Response to request for url ${e.toString()} was invalid.`);this._parseCapabilities(r.childNodes[0]),await this._initializeFeatureTypeInfos(),this._isInitialized=!0}async destroy(){this._isDestroyed=!0}_parseCapabilities(e){if(checkArg("data",e).isNotMissing(),"WFS_Capabilities"!==e.localName)throw new ArgumentError("Unable to parse WFS capabilities: unexpected element encountered.");this._parseServiceIdentification(e),this._parseOperationsMetadata(e),this._parseFeatureTypeList(e)}_parseServiceIdentification(e){checkArg("element",e).isNotMissing();let t=e.getElementsByTagName("ows:ServiceIdentification");t.length||(t=e.getElementsByTagName("ServiceIdentification")),t.length>0&&(this._setWfsVersion(t[0]),this._setWfsTitle(t[0]))}_setWfsVersion(e){checkArg("element",e).isNotMissing();const t=e.getElementsByTagNameNS(e.namespaceURI,"ServiceTypeVersion");if(t.length>0){switch(this._getValue(t[0])){case WfsVersions.WFS_1_0:this._wfsVersion=WfsVersions.WFS_1_0;break;case WfsVersions.WFS_1_1:this._wfsVersion=WfsVersions.WFS_1_1;break;case WfsVersions.WFS_2_0:default:this._wfsVersion=WfsVersions.WFS_2_0}}}_setWfsTitle(e){checkArg("element",e).isNotMissing();const t=e.getElementsByTagNameNS(e.namespaceURI,"Title");let s;t.length>0&&(s=this._getValue(t[0])),null!=s&&(this._title=s)}_parseOperationsMetadata(e){checkArg("element",e).isNotMissing();let t=e.getElementsByTagName("ows:OperationsMetadata");if(t.length||(t=e.getElementsByTagName("OperationsMetadata")),t.length>0){const e=Array.from(t[0].getElementsByTagNameNS(t[0].namespaceURI,"Operation"));e.length>0&&(this._parseGetFeature(e),this._parseDescribeFeatureType(e));const s=Array.from(t[0].getElementsByTagNameNS(t[0].namespaceURI,"Constraint"));s.length>0&&this._parseConstraints(s)}}_parseConstraints(e){if(checkArg("elements",e).isNotMissing(),this.wfsVersion===WfsVersions.WFS_2_0){const t=this._getElementByAttribute(e,"name","ImplementsBasicWFS");if(t){const e=this._getChildElementByLocalName(t,"DefaultValue");if(e){const t=this._getValue(e);this._implementsBasicWfs="TRUE"===t.toUpperCase()}}const s=this._getElementByAttribute(e,"name","QueryExpressions");if(s){const e=this._getChildElementByLocalName(s,"AllowedValues");if(e){Array.from(e.getElementsByTagNameNS(e.namespaceURI,"Value")).some((e=>"wfs:Query"===this._getValue(e)))&&(this._allowsWfsQuery=!0)}}}}_parseGetFeature(e){checkArg("elements",e).isNotMissing();const t=this._getElementByAttribute(e,"name","GetFeature");t&&(this._getFeatureGetUrl=this._parseUrlFromOperationElement(t,"Get"),this._getFeaturePostUrl=this._parseUrlFromOperationElement(t,"Post"),this._setOutputFormat(t))}_parseDescribeFeatureType(e){checkArg("elements",e).isNotMissing();const t=this._getElementByAttribute(e,"name","DescribeFeatureType");t&&(this._describeFeatureTypeGetUrl=this._parseUrlFromOperationElement(t,"Get"),this._describeFeatureTypePostUrl=this._parseUrlFromOperationElement(t,"Post"))}_setOutputFormat(e){let t;checkArg("elements",e).isNotMissing();const s=Array.from(e.getElementsByTagNameNS(e.namespaceURI,"Parameter"));if(s.length>0){const e=this._getElementByAttribute(s,"name","outputFormat");if(e&&(t=this.wfsVersion===WfsVersions.WFS_1_0||this.wfsVersion===WfsVersions.WFS_1_1?e:this._getChildElementByLocalName(e,"AllowedValues"),t)){const e=Array.from(t.getElementsByTagNameNS(t.namespaceURI,"Value"));this._getFeatureOutputFormats.push(...e.map((e=>this._getValue(e))).filter((e=>e?.includes("xml"))))}}}_parseUrlFromOperationElement(e,t){checkArg("elements",e).isNotMissing(),checkArg("verb",t).isNotMissing();const s=this._getChildElementByLocalName(e,"DCP");if(s){const e=this._getChildElementByLocalName(s,"HTTP");if(e){const s=this._getChildElementByLocalName(e,t);if(s){const e=s.getAttributeNS(OgcNamespace.XLINK,"href");if(e)return e}}}}_parseFeatureTypeList(e){checkArg("element",e).isNotMissing();const t=this._getChildElementByLocalName(e,"FeatureTypeList");null!==t&&this._parseFeatureTypes(t)}_parseFeatureTypes(e){checkArg("element",e).isNotMissing();const t=Array.from(e.getElementsByTagNameNS(e.namespaceURI,"FeatureType"));for(const e of t){const t=this._parseFeatureType(e);null!==t&&this._featureTypes.push(t)}}_parseFeatureType(e){checkArg("element",e).isNotMissing();const t={},s=this._getChildElementByLocalName(e,"Name");if(null!==s){const e=this._getValue(s);null!==e&&(t.name=e)}const r=this._getChildElementByLocalName(e,"Title");if(null!==r){const e=this._getValue(r);null!==e&&(t.title=e)}let i="DefaultCRS";this.wfsVersion!==WfsVersions.WFS_1_0&&this.wfsVersion!==WfsVersions.WFS_1_1||(i="DefaultSRS");const a=this._getChildElementByLocalName(e,i);if(null!==a){const e=this._getValue(a);null!==e&&(t.defaultCrs=e)}let n="OtherCRS";this.wfsVersion!==WfsVersions.WFS_1_0&&this.wfsVersion!==WfsVersions.WFS_1_1||(n="OtherSRS");const o=Array.from(e.getElementsByTagNameNS(e.namespaceURI,n));if(null!==o){t.otherCrs=new Array;for(const e of o){const s=this._getValue(e);null!==s&&t.otherCrs.push(s)}}return new WfsFeatureType(t)}_getChildElementByLocalName(e,t){checkArg("element",e).isNotMissing(),checkArg("localName",t).isNotMissing();const s=e.getElementsByTagNameNS(e.namespaceURI,t);if(s.length>0)return s[0];const r=e.getElementsByTagName(t);return r.length>0?r[0]:void 0}_getElementByAttribute(e,t,s){checkArg("elements",e).isNotMissing(),checkArg("name",t).isNotMissing(),checkArg("value",s).isNotMissing();for(const r of e)if(r.hasAttribute(t)&&r.getAttribute(t)===s)return r}_getValue(e){if(checkArg("element",e).isNotMissing(),1!==e.childNodes.length||e.childNodes[0].nodeType!==Node.TEXT_NODE)throw new ArgumentError("Unable to parse element value.");return e.childNodes[0].data}async _initializeFeatureTypeInfos(){if(!this.describeFeatureTypeGetUrl)throw new InvalidOperationError("Cannot retrieve feature type info as no DescribeFeatureType url is available");if(0===this.featureTypes.length)return;const e=new Uri(this.url);e.queryValues.set("SERVICE","WFS"),e.queryValues.set("VERSION",this.wfsVersion),e.queryValues.set("REQUEST","DescribeFeatureType");const t=await this.requestHelper.request(e.toString()),s=await t.text(),r=(new DOMParser).parseFromString(s,"text/xml");if(!t||!r||r.childNodes.length<1)throw new Error("Response to WFS DescribeFeatureType request was invalid.");for(const e of this.featureTypes)this._parseFeatureTypeInfo(e,r.childNodes[0])}_parseFeatureTypeInfo(e,t){checkArg("featureType",e).isNotMissing(),checkArg("element",t).isNotMissing();const s=t.namespaceURI,r=new Array;for(const e of Array.from(t.childNodes))"element"===e.localName&&r.push(e);let i=this._getElementByAttribute(r,s,e.name);if(!i){const t=e.name.indexOf(":");if(t>=0){const s=e.name.slice(t+1,e.name.length);i=this._getElementByAttribute(r,"name",s)}}if(!i)throw new InvalidOperationError(`Unable to parse attribute information for feature type: ${e.name}`);const a=i.getAttribute("type"),n=Array.from(t.getElementsByTagNameNS(s,"complexType"));let o=this._getElementByAttribute(n,"name",a);if(!o){const e=a.indexOf(":");if(e>=0){const t=a.slice(e+1,a.length);o=this._getElementByAttribute(n,"name",t)}}if(!o)throw new InvalidOperationError(`Unable to parse attribute information for feature type: ${e.name}`);const l=o.getElementsByTagNameNS(s,"extension");if(l&&l.length>0){const t=l[0].getElementsByTagNameNS(s,"sequence");if(t&&t.length>0){const r=t[0].getElementsByTagNameNS(s,"element");r&&r.length>0&&this._parseAttributes(e,r)}}}_parseAttributes(e,t){const s=Array.from(t);for(const t of s)if(t.getAttribute("type").startsWith("gml")){const s=t.getAttribute("name");e.attributes.push(s),e.geometryField=s}else e.attributes.push(t.getAttribute("name"))}}
1
+ import{ArgumentError as e}from"../../ArgumentError.js";import{InvalidOperationError as t}from"../../InvalidOperationError.js";import{DefaultRequestHelper as s}from"../../utilities/RequestHelper.js";import{OgcNamespace as i}from"../../utilities/_ogc.js";import{checkArg as r}from"../../utilities/checkArg.js";import{Uri as n}from"../../utilities/uri.js";import{WfsFeatureType as a}from"./WfsFeatureType.js";export var WfsVersions;!function(e){e.WFS_1_0="1.0.0",e.WFS_1_1="1.1.0",e.WFS_2_0="2.0.0"}(WfsVersions||(WfsVersions={}));export class WfsCapabilities{get isInitialized(){return this._isInitialized}get isDestroyed(){return this._isDestroyed}get url(){return this._url}get wfsVersion(){return this._wfsVersion}get title(){return this._title}get describeFeatureTypeGetUrl(){return this._describeFeatureTypeGetUrl}get describeFeatureTypePostUrl(){return this._describeFeatureTypePostUrl}get getFeatureGetUrl(){return this._getFeatureGetUrl}get getFeaturePostUrl(){return this._getFeaturePostUrl}get getFeatureOutputFormats(){return this._getFeatureOutputFormats}get implementsBasicWfs(){return this._implementsBasicWfs}get allowsWfsQuery(){return this._allowsWfsQuery}get featureTypes(){return this._featureTypes}constructor(e){this.requestHelper=new s,this._allowsWfsQuery=!0,this._isInitialized=!1,this._isDestroyed=!1,this._implementsBasicWfs=!0,this._getFeatureOutputFormats=new Array,this._featureTypes=new Array,this.assignProperties(e)}assignProperties(t){if(r("properties",t).isNotMissing(),!t.hasOwnProperty("url"))throw new e("WfsCapabilities requires a URL");this._url=t.url}async initialize(){if(this._isInitialized)return;const e=new n(this.url);e.queryValues.set("request","GetCapabilities"),e.queryValues.set("service","WFS");const t=await this.requestHelper.request(e.toString()),s=await t.text(),i=(new DOMParser).parseFromString(s,"text/xml");if(!t||!i||!i.childNodes||0===i.childNodes.length)throw new Error(`Response to request for url ${e.toString()} was invalid.`);this._parseCapabilities(i.childNodes[0]),await this._initializeFeatureTypeInfos(),this._isInitialized=!0}async destroy(){this._isDestroyed=!0}_parseCapabilities(t){if(r("data",t).isNotMissing(),"WFS_Capabilities"!==t.localName)throw new e("Unable to parse WFS capabilities: unexpected element encountered.");this._parseServiceIdentification(t),this._parseOperationsMetadata(t),this._parseFeatureTypeList(t)}_parseServiceIdentification(e){r("element",e).isNotMissing();let t=e.getElementsByTagName("ows:ServiceIdentification");t.length||(t=e.getElementsByTagName("ServiceIdentification")),t.length>0&&(this._setWfsVersion(t[0]),this._setWfsTitle(t[0]))}_setWfsVersion(e){r("element",e).isNotMissing();const t=e.getElementsByTagNameNS(e.namespaceURI,"ServiceTypeVersion");if(t.length>0){switch(this._getValue(t[0])){case WfsVersions.WFS_1_0:this._wfsVersion=WfsVersions.WFS_1_0;break;case WfsVersions.WFS_1_1:this._wfsVersion=WfsVersions.WFS_1_1;break;case WfsVersions.WFS_2_0:default:this._wfsVersion=WfsVersions.WFS_2_0}}}_setWfsTitle(e){r("element",e).isNotMissing();const t=e.getElementsByTagNameNS(e.namespaceURI,"Title");let s;t.length>0&&(s=this._getValue(t[0])),null!=s&&(this._title=s)}_parseOperationsMetadata(e){r("element",e).isNotMissing();let t=e.getElementsByTagName("ows:OperationsMetadata");if(t.length||(t=e.getElementsByTagName("OperationsMetadata")),t.length>0){const e=Array.from(t[0].getElementsByTagNameNS(t[0].namespaceURI,"Operation"));e.length>0&&(this._parseGetFeature(e),this._parseDescribeFeatureType(e));const s=Array.from(t[0].getElementsByTagNameNS(t[0].namespaceURI,"Constraint"));s.length>0&&this._parseConstraints(s)}}_parseConstraints(e){if(r("elements",e).isNotMissing(),this.wfsVersion===WfsVersions.WFS_2_0){const t=this._getElementByAttribute(e,"name","ImplementsBasicWFS");if(t){const e=this._getChildElementByLocalName(t,"DefaultValue");if(e){const t=this._getValue(e);this._implementsBasicWfs="TRUE"===t.toUpperCase()}}const s=this._getElementByAttribute(e,"name","QueryExpressions");if(s){const e=this._getChildElementByLocalName(s,"AllowedValues");if(e){Array.from(e.getElementsByTagNameNS(e.namespaceURI,"Value")).some((e=>"wfs:Query"===this._getValue(e)))&&(this._allowsWfsQuery=!0)}}}}_parseGetFeature(e){r("elements",e).isNotMissing();const t=this._getElementByAttribute(e,"name","GetFeature");t&&(this._getFeatureGetUrl=this._parseUrlFromOperationElement(t,"Get"),this._getFeaturePostUrl=this._parseUrlFromOperationElement(t,"Post"),this._setOutputFormat(t))}_parseDescribeFeatureType(e){r("elements",e).isNotMissing();const t=this._getElementByAttribute(e,"name","DescribeFeatureType");t&&(this._describeFeatureTypeGetUrl=this._parseUrlFromOperationElement(t,"Get"),this._describeFeatureTypePostUrl=this._parseUrlFromOperationElement(t,"Post"))}_setOutputFormat(e){let t;r("elements",e).isNotMissing();const s=Array.from(e.getElementsByTagNameNS(e.namespaceURI,"Parameter"));if(s.length>0){const e=this._getElementByAttribute(s,"name","outputFormat");if(e&&(t=this.wfsVersion===WfsVersions.WFS_1_0||this.wfsVersion===WfsVersions.WFS_1_1?e:this._getChildElementByLocalName(e,"AllowedValues"),t)){const e=Array.from(t.getElementsByTagNameNS(t.namespaceURI,"Value"));this._getFeatureOutputFormats.push(...e.map((e=>this._getValue(e))).filter((e=>e?.includes("xml"))))}}}_parseUrlFromOperationElement(e,t){r("elements",e).isNotMissing(),r("verb",t).isNotMissing();const s=this._getChildElementByLocalName(e,"DCP");if(s){const e=this._getChildElementByLocalName(s,"HTTP");if(e){const s=this._getChildElementByLocalName(e,t);if(s){const e=s.getAttributeNS(i.XLINK,"href");if(e)return e}}}}_parseFeatureTypeList(e){r("element",e).isNotMissing();const t=this._getChildElementByLocalName(e,"FeatureTypeList");null!==t&&this._parseFeatureTypes(t)}_parseFeatureTypes(e){r("element",e).isNotMissing();const t=Array.from(e.getElementsByTagNameNS(e.namespaceURI,"FeatureType"));for(const e of t){const t=this._parseFeatureType(e);null!==t&&this._featureTypes.push(t)}}_parseFeatureType(e){r("element",e).isNotMissing();const t={},s=this._getChildElementByLocalName(e,"Name");if(null!==s){const e=this._getValue(s);null!==e&&(t.name=e)}const i=this._getChildElementByLocalName(e,"Title");if(null!==i){const e=this._getValue(i);null!==e&&(t.title=e)}let n="DefaultCRS";this.wfsVersion!==WfsVersions.WFS_1_0&&this.wfsVersion!==WfsVersions.WFS_1_1||(n="DefaultSRS");const o=this._getChildElementByLocalName(e,n);if(null!==o){const e=this._getValue(o);null!==e&&(t.defaultCrs=e)}let l="OtherCRS";this.wfsVersion!==WfsVersions.WFS_1_0&&this.wfsVersion!==WfsVersions.WFS_1_1||(l="OtherSRS");const u=Array.from(e.getElementsByTagNameNS(e.namespaceURI,l));if(null!==u){t.otherCrs=new Array;for(const e of u){const s=this._getValue(e);null!==s&&t.otherCrs.push(s)}}return new a(t)}_getChildElementByLocalName(e,t){r("element",e).isNotMissing(),r("localName",t).isNotMissing();const s=e.getElementsByTagNameNS(e.namespaceURI,t);if(s.length>0)return s[0];const i=e.getElementsByTagName(t);return i.length>0?i[0]:void 0}_getElementByAttribute(e,t,s){r("elements",e).isNotMissing(),r("name",t).isNotMissing(),r("value",s).isNotMissing();for(const i of e)if(i.hasAttribute(t)&&i.getAttribute(t)===s)return i}_getValue(t){if(r("element",t).isNotMissing(),1!==t.childNodes.length||t.childNodes[0].nodeType!==Node.TEXT_NODE)throw new e("Unable to parse element value.");return t.childNodes[0].data}async _initializeFeatureTypeInfos(){if(!this.describeFeatureTypeGetUrl)throw new t("Cannot retrieve feature type info as no DescribeFeatureType url is available");if(0===this.featureTypes.length)return;const e=new n(this.url);e.queryValues.set("SERVICE","WFS"),e.queryValues.set("VERSION",this.wfsVersion),e.queryValues.set("REQUEST","DescribeFeatureType");const s=await this.requestHelper.request(e.toString()),i=await s.text(),r=(new DOMParser).parseFromString(i,"text/xml");if(!s||!r||r.childNodes.length<1)throw new Error("Response to WFS DescribeFeatureType request was invalid.");for(const e of this.featureTypes)this._parseFeatureTypeInfo(e,r.childNodes[0])}_parseFeatureTypeInfo(e,s){r("featureType",e).isNotMissing(),r("element",s).isNotMissing();const i=s.namespaceURI,n=new Array;for(const e of Array.from(s.childNodes))"element"===e.localName&&n.push(e);let a=this._getElementByAttribute(n,i,e.name);if(!a){const t=e.name.indexOf(":");if(t>=0){const s=e.name.slice(t+1,e.name.length);a=this._getElementByAttribute(n,"name",s)}}if(!a)throw new t(`Unable to parse attribute information for feature type: ${e.name}`);const o=a.getAttribute("type"),l=Array.from(s.getElementsByTagNameNS(i,"complexType"));let u=this._getElementByAttribute(l,"name",o);if(!u){const e=o.indexOf(":");if(e>=0){const t=o.slice(e+1,o.length);u=this._getElementByAttribute(l,"name",t)}}if(!u)throw new t(`Unable to parse attribute information for feature type: ${e.name}`);const m=u.getElementsByTagNameNS(i,"extension");if(m&&m.length>0){const t=m[0].getElementsByTagNameNS(i,"sequence");if(t&&t.length>0){const s=t[0].getElementsByTagNameNS(i,"element");s&&s.length>0&&this._parseAttributes(e,s)}}}_parseAttributes(e,t){const s=Array.from(t);for(const t of s)if(t.getAttribute("type").startsWith("gml")){const s=t.getAttribute("name");e.attributes.push(s),e.geometryField=s}else e.attributes.push(t.getAttribute("name"))}}
@@ -1 +1 @@
1
- import{checkArg}from"../../utilities/checkArg.js";export class WfsFeatureType{constructor(t){if(this._otherCrs=new Array,this._attributes=new Array,checkArg("properties",t).isNotMissing(),t.hasOwnProperty("name")&&(this._name=t.name),t.hasOwnProperty("title")&&(this._title=t.title),t.hasOwnProperty("name")&&(this._defaultCrs=t.defaultCrs),t.hasOwnProperty("otherCrs"))for(const e of t.otherCrs)this._otherCrs.push(e);if(t.hasOwnProperty("attributes"))for(const e of t.attributes)this._attributes.push(e);t.hasOwnProperty("geometryField")&&(this._geometryField=t.geometryField)}get name(){return this._name}get title(){return this._title}get defaultCrs(){return this._defaultCrs}get otherCrs(){return this._otherCrs}get attributes(){return this._attributes}get geometryField(){return this._geometryField}set geometryField(t){this._geometryField=t}}
1
+ import{checkArg as t}from"../../utilities/checkArg.js";export class WfsFeatureType{get name(){return this._name}get title(){return this._title}get defaultCrs(){return this._defaultCrs}get otherCrs(){return this._otherCrs}get attributes(){return this._attributes}get geometryField(){return this._geometryField}set geometryField(t){this._geometryField=t}constructor(e){if(this._otherCrs=new Array,this._attributes=new Array,t("properties",e).isNotMissing(),e.hasOwnProperty("name")&&(this._name=e.name),e.hasOwnProperty("title")&&(this._title=e.title),e.hasOwnProperty("name")&&(this._defaultCrs=e.defaultCrs),e.hasOwnProperty("otherCrs"))for(const t of e.otherCrs)this._otherCrs.push(t);if(e.hasOwnProperty("attributes"))for(const t of e.attributes)this._attributes.push(t);e.hasOwnProperty("geometryField")&&(this._geometryField=e.geometryField)}}
@@ -1 +1 @@
1
- import{InvalidOperationError}from"../../InvalidOperationError.js";import{InitializableCollectionProxy}from"../../support/InitializableCollectionProxy.js";import{checkArg}from"../../utilities/checkArg.js";import{Collection}from"../../utilities/collection.js";import{layersAreEquivalent}from"../../utilities/layers.js";import{getLogger}from"../../utilities/log.js";import{onCollectionPropertyChange}from"../../utilities/watch.js";import{LayerExtension}from"../_LayerExtension.js";export class LayerExtensionCollectionBase extends InitializableCollectionProxy{constructor(e,i){super(),this._layerExtensionMap=new WeakMap,this._uninitializedLayerExtensions=new Collection,this._parent=e,this._layersProperty=i,onCollectionPropertyChange(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&&getCollectionLogger().error(e.message)}})),this._parent.watch(`${this._layersProperty}.length`,(()=>this.notifyChange("length")))}get _collection(){return this._layers.map((e=>this._forLayer(e))).concat(this._uninitializedLayerExtensions)}get _layers(){let e=this._parent.get(this._layersProperty);return e||(this._tempLayers||(this._tempLayers=new Collection),e=this._tempLayers),e}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 checkArg("id",e).isNotMissing(),this.find((i=>i.id===e))}findByLayerId(e){return checkArg("id",e).isNotMissing(),this.find((i=>i.layer.id===e))}forLayer(e){if(checkArg("layer",e).isNotMissing(),this._layers.includes(e))return this._forLayer(e)}add(e,i){if(checkArg("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,i){if(this._uninitializedLayerExtensions.includes(e)){if(this._uninitializedLayerExtensions.some((e=>e.isInitialized)))throw new InvalidOperationError("Unable to reorder a mix of initialized / uninitialized layers.");this._uninitializedLayerExtensions.reorder(e,i)}if(e&&e.layer&&this._layers.includes(e.layer))return this._layers.reorder(e.layer,i),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.toArray())e._resolveLayer(this._layers),e.layer&&(this._layerExtensionMap.set(e.layer,e),this._uninitializedLayerExtensions.remove(e),this.emit("change",{added:[],moved:[],removed:[e],target:this}));if(!this._layerExtensionMap.has(e)){const i=this._uninitializedLayerExtensions.find((i=>layersAreEquivalent(e,i)));if(i)return i;const t=LayerExtension.create({layer:e});this._register(t)}return this._layerExtensionMap.get(e)}_register(e){if(checkArg("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)}}function getCollectionLogger(){return getLogger("geocortex.api.support.LayerExtensionCollection")}
1
+ import{InvalidOperationError as e}from"../../InvalidOperationError.js";import{InitializableCollectionProxy as i}from"../../support/InitializableCollectionProxy.js";import{checkArg as t}from"../../utilities/checkArg.js";import{Collection as s}from"../../utilities/collection.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{LayerExtension as o}from"../_LayerExtension.js";export class LayerExtensionCollectionBase extends i{get _collection(){return this._layers.map((e=>this._forLayer(e))).concat(this._uninitializedLayerExtensions)}get _layers(){let e=this._parent.get(this._layersProperty);return e||(this._tempLayers||(this._tempLayers=new s),e=this._tempLayers),e}constructor(e,i){super(),this._layerExtensionMap=new WeakMap,this._uninitializedLayerExtensions=new s,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 t("id",e).isNotMissing(),this.find((i=>i.id===e))}findByLayerId(e){return t("id",e).isNotMissing(),this.find((i=>i.layer.id===e))}forLayer(e){if(t("layer",e).isNotMissing(),this._layers.includes(e))return this._forLayer(e)}add(e,i){if(t("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(i,t){if(this._uninitializedLayerExtensions.includes(i)){if(this._uninitializedLayerExtensions.some((e=>e.isInitialized)))throw new e("Unable to reorder a mix of initialized / uninitialized layers.");this._uninitializedLayerExtensions.reorder(i,t)}if(i?.layer&&this._layers.includes(i.layer))return this._layers.reorder(i.layer,t),i}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.toArray())e._resolveLayer(this._layers),e.layer&&(this._layerExtensionMap.set(e.layer,e),this._uninitializedLayerExtensions.remove(e),this.emit("change",{added:[],moved:[],removed:[e],target:this}));if(!this._layerExtensionMap.has(e)){const i=this._uninitializedLayerExtensions.find((i=>r(e,i)));if(i)return i;const t=o.create({layer:e});this._register(t)}return this._layerExtensionMap.get(e)}_register(e){if(t("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 +1 @@
1
- import{InitializableCollectionProxy}from"../../support/InitializableCollectionProxy.js";import{checkArg}from"../../utilities/checkArg.js";import{Collection}from"../../utilities/collection.js";import{onCollectionPropertyChange}from"../../utilities/watch.js";import{SublayerExtension}from"../_SublayerExtension.js";export class SublayerExtensionCollectionBase extends InitializableCollectionProxy{constructor(e,t){super(),this._sublayerExtensionMap=new WeakMap,this._uninitializedSublayerExtensions=new Set,this._parent=e,this._sublayersProperty=t,onCollectionPropertyChange(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)})),this._parent.watch(`${this._sublayersProperty}.length`,(()=>this.notifyChange("length")))}get _collection(){return this._sublayers.map((e=>this._forSublayer(e))).concat(Array.from(this._uninitializedSublayerExtensions))}get _sublayers(){let e=this._parent.get(this._sublayersProperty);return e||(this._tempSublayers||(this._tempSublayers=new Collection),e=this._tempSublayers),e}clone(){const e=super.clone();return e._sublayerExtensionMap=this._sublayerExtensionMap,e}findById(e){return checkArg("id",e).isNotMissing(),this.find((t=>t.id===e))}findBySublayerId(e){return checkArg("id",e).isNotMissing(),this.find((t=>t.sublayer.id===e))}forSublayer(e){if(checkArg("sublayer",e).isNotMissing(),!(this._sublayers.indexOf(e)<0))return this._forSublayer(e)}add(e,t){return checkArg("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("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}emit(e,t){const s=super.emit(e,t);return"change"===e&&this._layerExtension&&this._layerExtension.allSublayerExtensions.emit(e,t),s}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(checkArg("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("change",s)}}else{this._uninitializedSublayerExtensions.add(e);const t={added:[e],moved:[],removed:[],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=SublayerExtension.create({sublayer:e});this._register(t)}return this._sublayerExtensionMap.get(e)}}
1
+ import{InitializableCollectionProxy as e}from"../../support/InitializableCollectionProxy.js";import{checkArg as s}from"../../utilities/checkArg.js";import{Collection as t}from"../../utilities/collection.js";import{onCollectionPropertyChange as i}from"../../utilities/watch.js";import{SublayerExtension as r}from"../_SublayerExtension.js";export class SublayerExtensionCollectionBase extends e{get _collection(){return this._sublayers.map((e=>this._forSublayer(e))).concat(Array.from(this._uninitializedSublayerExtensions))}get _sublayers(){let e=this._parent.get(this._sublayersProperty);return e||(this._tempSublayers||(this._tempSublayers=new t),e=this._tempSublayers),e}constructor(e,s){super(),this._sublayerExtensionMap=new WeakMap,this._uninitializedSublayerExtensions=new Set,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 s("id",e).isNotMissing(),this.find((s=>s.id===e))}findBySublayerId(e){return s("id",e).isNotMissing(),this.find((s=>s.sublayer.id===e))}forSublayer(e){if(s("sublayer",e).isNotMissing(),!(this._sublayers.indexOf(e)<0))return this._forSublayer(e)}add(e,t){return s("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 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(s("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 +1 @@
1
- import EsriKMLLayer from"@arcgis/core/layers/KMLLayer";import EsriKMLSublayer from"@arcgis/core/layers/support/KMLSublayer";export{EsriKMLSublayer as KMLSublayer,EsriKMLLayer as KMLLayer};
1
+ import r from"@arcgis/core/layers/KMLLayer";import a from"@arcgis/core/layers/support/KMLSublayer";export{a as KMLSublayer,r as KMLLayer};
@@ -1 +1 @@
1
- import FieldInfo from"@arcgis/core/popup/FieldInfo";import{Feature}from"../../data/Feature.js";import{FieldExtension}from"../../data/FieldExtension.js";import{Field}from"../../portal/Field.js";import{isGmlNamespace,OgcNamespace}from"../../utilities/_ogc.js";import{checkArg}from"../../utilities/checkArg.js";import{gmlToEsri}from"../../utilities/geometry.js";export function wfsFeatureCollectionToFeatures(e,t){let i;checkArg("featureCollection",e).isNotMissing(),checkArg("featureCollection.localName",e.localName).satisfies((e=>"FeatureCollection"===e),"Unable to parse WFS FeatureCollection: unexpected element encountered");const o=e.namespaceURI;return o===OgcNamespace.WFS?i=Array.from(e.getElementsByTagNameNS(OgcNamespace.GML,"featureMember")):o===OgcNamespace.WFS_2_0&&(i=Array.from(e.getElementsByTagNameNS(e.namespaceURI,"member"))),i.map((e=>_memberToFeature(e,t)))}function _memberToFeature(e,t){let i,o;checkArg("member",e).isNotMissing();const s=new Map;if(e.childElementCount>0){const t=e.firstElementChild;if(i=_getMemberId(t),t.childElementCount>0){const e=Array.from(t.childNodes).filter((e=>e.nodeType===e.ELEMENT_NODE));for(const t of e)t.childElementCount>0&&isGmlNamespace(t.firstElementChild.namespaceURI)?o=gmlToEsri(t.firstElementChild):s.set(t.localName,_getAttributeValue(t))}}const n=new Feature({id:i,attributes:s,geometry:o,source:t}),r=[];for(const e of n.presentableAttributes.keys())r.push(e);const{popupTemplate:a}=n.settings;if(a&&(n.title||(a.title="{ID}",n.attributes.set("ID",n.id)),a.fieldInfos&&0!==a.fieldInfos.length||(a.fieldInfos=r.map((e=>new FieldInfo({fieldName:e}))))),0===t?.schema.fieldExtensions.initializedItems.length)for(const e of r){const i=new FieldExtension({field:Field.toEsriApiField({name:e,alias:e})});t.schema.fieldExtensions.add(i)}return n}function _getMemberId(e){checkArg("element",e).isNotMissing();const t=Array.from(e.attributes);for(const e of t){if(isGmlNamespace(e.namespaceURI)&&e.nodeType===Node.ATTRIBUTE_NODE)return e.nodeValue;if(!(void 0!==e.namespaceURI&&null!==e.namespaceURI||"fid"!==e.localName&&"gid"!==e.localName||e.nodeType!==Node.ATTRIBUTE_NODE))return e.nodeValue}}function _getAttributeValue(e){if(checkArg("element",e).isNotMissing(),1===e.childNodes.length&&e.childNodes[0].nodeType===Node.TEXT_NODE)return e.childNodes[0].data}
1
+ import e from"@arcgis/core/popup/FieldInfo";import{Feature as t}from"../../data/Feature.js";import{FieldExtension as o}from"../../data/FieldExtension.js";import{Field as i}from"../../portal/Field.js";import{isGmlNamespace as n,OgcNamespace as s}from"../../utilities/_ogc.js";import{checkArg as l}from"../../utilities/checkArg.js";import{gmlToEsri as r}from"../../utilities/geometry.js";export function wfsFeatureCollectionToFeatures(m,f){let c;l("featureCollection",m).isNotMissing(),l("featureCollection.localName",m.localName).satisfies((e=>"FeatureCollection"===e),"Unable to parse WFS FeatureCollection: unexpected element encountered");const d=m.namespaceURI;return d===s.WFS?c=Array.from(m.getElementsByTagNameNS(s.GML,"featureMember")):d===s.WFS_2_0&&(c=Array.from(m.getElementsByTagNameNS(m.namespaceURI,"member"))),c.map((s=>function(s,m){let f,c;l("member",s).isNotMissing();const d=new Map;if(s.childElementCount>0){const e=s.firstElementChild;if(f=function(e){l("element",e).isNotMissing();const t=Array.from(e.attributes);for(const e of t){if(n(e.namespaceURI)&&e.nodeType===Node.ATTRIBUTE_NODE)return e.nodeValue;if(!(void 0!==e.namespaceURI&&null!==e.namespaceURI||"fid"!==e.localName&&"gid"!==e.localName||e.nodeType!==Node.ATTRIBUTE_NODE))return e.nodeValue}return}(e),e.childElementCount>0){const t=Array.from(e.childNodes).filter((e=>e.nodeType===e.ELEMENT_NODE));for(const e of t)e.childElementCount>0&&n(e.firstElementChild.namespaceURI)?c=r(e.firstElementChild):d.set(e.localName,a(e))}}const u=new t({id:f,attributes:d,geometry:c,source:m}),p=[];for(const e of u.presentableAttributes.keys())p.push(e);const{popupTemplate:N}=u.settings;N&&(u.title||(N.title="{ID}",u.attributes.set("ID",u.id)),N.fieldInfos&&0!==N.fieldInfos.length||(N.fieldInfos=p.map((t=>new e({fieldName:t})))));if(0===m?.schema.fieldExtensions.initializedItems.length)for(const e of p){const t=new o({field:i.toEsriApiField({name:e,alias:e})});m.schema.fieldExtensions.add(t)}return u}(s,f)))}function a(e){if(l("element",e).isNotMissing(),1===e.childNodes.length&&e.childNodes[0].nodeType===Node.TEXT_NODE)return e.childNodes[0].data}
package/menus/Menu.js CHANGED
@@ -1 +1 @@
1
- var Menu_1;import{__decorate}from"tslib";import{EntityBase}from"../Entity.js";import{InvalidOperationError}from"../InvalidOperationError.js";import{isMenuItem,ItemType}from"../ItemType.js";import{serializable}from"../support/Serializable.js";import{CollectionProxy}from"../utilities/CollectionProxy.js";import{checkArg}from"../utilities/checkArg.js";import{Collection,compare}from"../utilities/collection.js";import{getLogger}from"../utilities/log.js";import{MenuItem}from"./MenuItem.js";const log=getLogger("geocortex.api.menus.Menu");let Menu=Menu_1=class extends EntityBase{constructor(e){super(e),this._itemType=ItemType.MENU,this._items=new MenuItemCollection(this)}get parentItem(){return this._parentItem}get title(){return this._title}set title(e){this._title=e}get items(){return this._items}static create(e){if(!Menu_1.factory)throw new InvalidOperationError("Cannot create menu: no menu factory has been registered.");return Menu_1.factory.create(e)}*_initializableChildCollections(){yield*super._initializableChildCollections(),yield this.items}_getSerializableProperties(){return{...super._getSerializableProperties(),items:{serializeModes:["initial"],default:[],deserialize:e=>{const t=new Map;for(const i of e)isMenuItem(i)?t.set(i.toJSON(),i):t.set(i,void 0);compare(this.items,t.keys(),{onNew:e=>{this.items.add(t.get(e)||MenuItem.create(e))},onMissing:e=>{this.items.remove(e)},onMatch:(e,i,r,n)=>{r!==n&&this.items.reorder(e,n),t.get(i)!==e&&e.assignProperties(i)},equals:(e,t)=>e.id===t.id})}},title:"initial"}}};Menu.factory={create:e=>new Menu_1(e)},Menu=Menu_1=__decorate([serializable],Menu);export{Menu};class MenuItemCollection extends CollectionProxy{constructor(e){super(new Collection),this._menu=e}add(e,t){if(checkArg("menuItem",e).isNotMissing(),this._createsCircularReference(this._allSubmenus(e)))throw new InvalidOperationError("Adding menu item would create circular menu dependency.");return e.menu&&(e.menu!==this._menu&&log.debug("A MenuItem can only have one parent. The MenuItem has been removed from its original Menu."),e.menu.items.remove(e)),e._menu=this._menu,super.add(e,t)}removeAt(e){const t=super.removeAt(e);return t&&delete t._menu,t}_createsCircularReference(e,t,i){const r=t??this._menu,n=i??(this._menu.parentItem?.root?this._menu.parentItem.root:this._menu);if(e.includes(r))return!0;if(r===n)return!1;const o=r.parentItem.menu;return this._createsCircularReference(e,o,n)}_allSubmenus(e){const t=new Collection;if(e.submenu){t.add(e.submenu);for(const i of e.submenu.items.toArray())t.addMany(this._allSubmenus(i))}return t}}
1
+ var e;import{__decorate as t}from"tslib";import{EntityBase as i}from"../Entity.js";import{InvalidOperationError as r}from"../InvalidOperationError.js";import{isMenuItem as s,ItemType as n}from"../ItemType.js";import{serializable as o}from"../support/Serializable.js";import{CollectionProxy as m}from"../utilities/CollectionProxy.js";import{checkArg as u}from"../utilities/checkArg.js";import{Collection as a,compare as l}from"../utilities/collection.js";import{getLogger as c}from"../utilities/log.js";import{MenuItem as d}from"./MenuItem.js";const p=c("geocortex.api.menus.Menu");let h=e=class extends i{get parentItem(){return this._parentItem}get title(){return this._title}set title(e){this._title=e}get items(){return this._items}constructor(e){super(e),this._itemType=n.MENU,this._items=new f(this)}static create(t){if(!e.factory)throw new r("Cannot create menu: no menu factory has been registered.");return e.factory.create(t)}*_initializableChildCollections(){yield*super._initializableChildCollections(),yield this.items}_getSerializableProperties(){return{...super._getSerializableProperties(),items:{serializeModes:["initial"],default:[],deserialize:e=>{const t=new Map;for(const i of e)s(i)?t.set(i.toJSON(),i):t.set(i,void 0);l(this.items,t.keys(),{onNew:e=>{this.items.add(t.get(e)||d.create(e))},onMissing:e=>{this.items.remove(e)},onMatch:(e,i,r,s)=>{r!==s&&this.items.reorder(e,s),t.get(i)!==e&&e.assignProperties(i)},equals:(e,t)=>e.id===t.id})}},title:"initial"}}};h.factory={create:t=>new e(t)},h=e=t([o],h);export{h as Menu};class f extends m{constructor(e){super(new a),this._menu=e}add(e,t){if(u("menuItem",e).isNotMissing(),this._createsCircularReference(this._allSubmenus(e)))throw new r("Adding menu item would create circular menu dependency.");return e.menu&&(e.menu!==this._menu&&p.debug("A MenuItem can only have one parent. The MenuItem has been removed from its original Menu."),e.menu.items.remove(e)),e._menu=this._menu,super.add(e,t)}removeAt(e){const t=super.removeAt(e);return t&&delete t._menu,t}_createsCircularReference(e,t,i){const r=t??this._menu,s=i??(this._menu.parentItem?.root?this._menu.parentItem.root:this._menu);if(e.includes(r))return!0;if(r===s)return!1;const n=r.parentItem.menu;return this._createsCircularReference(e,n,s)}_allSubmenus(e){const t=new a;if(e.submenu){t.add(e.submenu);for(const i of e.submenu.items.toArray())t.addMany(this._allSubmenus(i))}return t}}
package/menus/MenuItem.js CHANGED
@@ -1 +1 @@
1
- var MenuItem_1;import{__decorate}from"tslib";import{EntityBase}from"../Entity.js";import{InvalidOperationError}from"../InvalidOperationError.js";import{isMenu,ItemType}from"../ItemType.js";import{serializable}from"../support/Serializable.js";import{Collection}from"../utilities/collection.js";import{Menu}from"./Menu.js";let MenuItem=MenuItem_1=class extends EntityBase{constructor(e){super(e),this._itemType=ItemType.MENU_ITEM,this._isToggled=!1,this._isEnabled=!0,this._hideOnDisable=!1,this._isToggled=e?.isToggled??!1}get canBeToggled(){return!!this.alternate}get isToggled(){return this._isToggled}get submenu(){return this._submenu}set submenu(e){if(e&&this._createsCircularReference(this._allSubmenus(e)))throw new InvalidOperationError("Menu is already part of the menu hierarchy.");this._submenu&&delete this._submenu._parentItem,this._submenu=e,this._submenu&&(this._submenu._parentItem=this)}get menu(){return this._menu}get root(){return this.menu?.parentItem?.root?this.menu.parentItem.root:this.menu}get iconId(){return this._iconId}set iconId(e){this._iconId=e}get title(){return this._title}set title(e){this._title=e}get description(){return this._description}set description(e){this._description=e}get isEnabled(){return this._isEnabled}set isEnabled(e){this._isEnabled=e}get hideOnDisable(){return this._hideOnDisable}set hideOnDisable(e){this._hideOnDisable=e}get action(){return this._action}set action(e){this._action=e}get alternate(){return this._alternate}set alternate(e){this._alternate=e}static create(e){if(!MenuItem_1.factory)throw new InvalidOperationError("Cannot create menu item: no menu item factory has been registered.");return MenuItem_1.factory.create(e)}toggle(){if(!this.canBeToggled)throw new InvalidOperationError("This menu item cannot be toggled. Set `alternate` to enable toggling.");this._isToggled=!this._isToggled;for(const e of Object.keys(this.alternate)){const t=this.alternate[e];this.alternate[e]=this[e],this[e]=t}}async _onInitialize(){await super._onInitialize(),this.submenu&&await this.submenu.initialize()}_getSerializableProperties(){return{...super._getSerializableProperties(),iconId:"initial",title:"initial",description:"initial",isEnabled:{serializeModes:["initial"],default:!0},hideOnDisable:{serializeModes:["initial"],default:!1},isToggled:{serializeModes:["initial"],deserialize:!1,default:!1},action:"initial",alternate:{serializeModes:["initial"],deserialize:e=>{this.alternate=e?{...e}:void 0}},submenu:{serializeModes:["initial"],deserialize:e=>{e?isMenu(e)?this.submenu=e:this.submenu?this.submenu.assignProperties(e):this.submenu=Menu.create(e):this.submenu=void 0}}}}_createsCircularReference(e,t,i){if(!t&&!this.menu)return!1;const n=t??this.menu,s=i??(this.menu.parentItem&&this.menu.parentItem.root?this.menu.parentItem.root:this.menu);if(e.includes(n))return!0;if(n===s)return!1;const r=n.parentItem.menu;return this._createsCircularReference(e,r,s)}_allSubmenus(e){const t=new Collection;t.add(e);for(const i of e.items.toArray())i.submenu&&t.addMany(this._allSubmenus(i.submenu));return t}};MenuItem.factory={create:e=>new MenuItem_1(e)},MenuItem=MenuItem_1=__decorate([serializable],MenuItem);export{MenuItem};
1
+ var e;import{__decorate as t}from"tslib";import{EntityBase as i}from"../Entity.js";import{InvalidOperationError as s}from"../InvalidOperationError.js";import{isMenu as n,ItemType as r}from"../ItemType.js";import{serializable as a}from"../support/Serializable.js";import{Collection as o}from"../utilities/collection.js";import{Menu as u}from"./Menu.js";let l=e=class extends i{constructor(e){super(e),this._itemType=r.MENU_ITEM,this._isToggled=!1,this._isEnabled=!0,this._hideOnDisable=!1,this._isToggled=e?.isToggled??!1}get canBeToggled(){return!!this.alternate}get isToggled(){return this._isToggled}get submenu(){return this._submenu}set submenu(e){if(e&&this._createsCircularReference(this._allSubmenus(e)))throw new s("Menu is already part of the menu hierarchy.");this._submenu&&delete this._submenu._parentItem,this._submenu=e,this._submenu&&(this._submenu._parentItem=this)}get menu(){return this._menu}get root(){return this.menu?.parentItem?.root?this.menu.parentItem.root:this.menu}get iconId(){return this._iconId}set iconId(e){this._iconId=e}get title(){return this._title}set title(e){this._title=e}get description(){return this._description}set description(e){this._description=e}get isEnabled(){return this._isEnabled}set isEnabled(e){this._isEnabled=e}get hideOnDisable(){return this._hideOnDisable}set hideOnDisable(e){this._hideOnDisable=e}get action(){return this._action}set action(e){this._action=e}get alternate(){return this._alternate}set alternate(e){this._alternate=e}static create(t){if(!e.factory)throw new s("Cannot create menu item: no menu item factory has been registered.");return e.factory.create(t)}toggle(){if(!this.canBeToggled)throw new s("This menu item cannot be toggled. Set `alternate` to enable toggling.");this._isToggled=!this._isToggled;for(const e of Object.keys(this.alternate)){const t=this.alternate[e];this.alternate[e]=this[e],this[e]=t}}async _onInitialize(){await super._onInitialize(),this.submenu&&await this.submenu.initialize()}_getSerializableProperties(){return{...super._getSerializableProperties(),iconId:"initial",title:"initial",description:"initial",isEnabled:{serializeModes:["initial"],default:!0},hideOnDisable:{serializeModes:["initial"],default:!1},isToggled:{serializeModes:["initial"],deserialize:!1,default:!1},action:"initial",alternate:{serializeModes:["initial"],deserialize:e=>{this.alternate=e?{...e}:void 0}},submenu:{serializeModes:["initial"],deserialize:e=>{e?n(e)?this.submenu=e:this.submenu?this.submenu.assignProperties(e):this.submenu=u.create(e):this.submenu=void 0}}}}_createsCircularReference(e,t,i){if(!t&&!this.menu)return!1;const s=t??this.menu,n=i??(this.menu.parentItem?.root?this.menu.parentItem.root:this.menu);if(e.includes(s))return!0;if(s===n)return!1;const r=s.parentItem.menu;return this._createsCircularReference(e,r,n)}_allSubmenus(e){const t=new o;t.add(e);for(const i of e.items.toArray())i.submenu&&t.addMany(this._allSubmenus(i.submenu));return t}};l.factory={create:t=>new e(t)},l=e=t([a],l);export{l as MenuItem};