import{isLayerExtension as e,isSublayerExtension as r,isTableExtension as n}from"../ItemType.js";import{isBuildingComponentSublayer as t,isBuildingGroupSublayer as i,isMapImageSublayer as o,isSubtypeSublayer as u,isWMSSublayer as a}from"./layers.js";export function isArcGISServiceTableExtension(e){return n(e)}export function isGroupLayerExtension(r){return e(r)&&!!r.layerExtensions}export function isFeatureLayerExtension(e){return y(e,"ArcGISFeatureLayer")}export function isSubtypeSublayerExtension(e){return r(e)&&(u(e.sublayer)||"SubtypeSublayer"===e._deferredSublayerProperties?.$sublayerType)}export function isSubtypeGroupLayerExtension(e){return y(e,"SubtypeGroupLayer")}export function isFeatureCollectionLayerExtension(r){return e(r)&&"feature-collection-layer"===r._getSerializableLayerType?.()}export function isMediaLayerExtension(e){return y(e,"MediaLayer")}export function isCSVLayerExtension(e){return y(e,"CSV")}export function isGeoRssLayerExtension(e){return y(e,"GeoRSS")}export function isGeoJSONLayerExtension(e){return y(e,"GeoJSON")}export function isImageryLayerExtension(e){return y(e,"ArcGISImageServiceLayer")}export function isSceneLayerExtension(e){return y(e,"ArcGISSceneServiceLayer")}export function isStreamLayerExtension(e){return y(e,"ArcGISStreamLayer")}export function isMapImageLayerExtension(e){return y(e,"ArcGISMapServiceLayer")}export function isTileLayerExtension(e){return y(e,"ArcGISTiledMapServiceLayer")}export function isWFSLayerExtension(e){return y(e,"WFS")}export function isWMSLayerExtension(e){return y(e,"WMS")}export function isWMSSublayerExtension(e){return r(e)&&(a(e.sublayer)||"WMSSublayer"===e._deferredSublayerProperties?.$sublayerType)}export function isMapImageSublayerExtension(e){return r(e)&&(o(e.sublayer)||"ArcGISMapServiceSublayer"===e._deferredSublayerProperties?.$sublayerType)}export function isWMTSLayerExtension(r){if(!e(r))return!1;const n=r.getDefaults().layer;return n&&"WebTiledLayer"===n.layerType&&!!n.wmtsInfo}export function isKMLLayerExtension(e){return y(e,"KML")}export function isBuildingSceneLayerExtension(e){return y(e,"BuildingSceneLayer")}export function isBuildingGroupSublayerExtension(e){return r(e)&&(i(e.sublayer)||"BuildingGroupSublayer"===e._deferredSublayerProperties?.$sublayerType)}export function isPointCloudLayerExtension(e){return y(e,"PointCloudLayer")}export function isBuildingComponentSublayerExtension(e){return r(e)&&(t(e.sublayer)||"BuildingComponentSublayer"===e._deferredSublayerProperties?.$sublayerType)}function y(r,n){if(!e(r))return!1;const{layer:t}=r.getDefaults();if(!t||!("layerType"in t))return!1;return t.layerType===n}