/* COPYRIGHT Esri - https://js.arcgis.com/5.1.0/LICENSE.txt */
import e from"../core/Error.js";import{isSupportedGCSOnGlobe as i}from"../views/3d/support/supportedSpatialReference.js";import{getMissingTileInfoError as t,TilingScheme as l}from"../views/3d/terrain/TilingScheme.js";function n(n,r,c,o){if(null==n)return t();const s=n?.lods.length-1,a=n.spatialReference;if(a.isWebMercator){if(!l.makeWebMercatorAuxiliarySphere(s).compatibleWith(n,o))return new e("tilingscheme:incompatible-global-web-mercator","The tiling scheme is not compatible with the ArcGIS Online Web Mercator tiling scheme")}else{if(!i(a))return new e("tilingscheme:global-unsupported-spatial-reference","The tiling scheme spatial reference is not supported in global scenes");if(!l.makeGCSWithTileSize(n.spatialReference,n.size[0],s).compatibleWith(n,o))return n.spatialReference.isWGS84?new e("tilingscheme:incompatible-global-wgs84","The tiling scheme is not compatible with the ArcGIS Online WGS84 tiling scheme"):new e("tilingscheme:incompatible-global","The tiling scheme is not compatible with the ArcGIS Online tiling scheme")}return null==r||n.spatialReference.equals(r)?null:new e("tilingscheme:spatial-reference-mismatch","The tiling scheme does not match the spatial reference of the global scene")}const r=Object.freeze(Object.defineProperty({__proto__:null,checkIfTileInfoSupportedForViewSR:n},Symbol.toStringTag,{value:"Module"}));export{n as c,r as t};
