/* COPYRIGHT Esri - https://js.arcgis.com/5.1.0/LICENSE.txt */
import{__decorate as e}from"tslib";import r from"../../../core/Error.js";import{property as i,subclass as t}from"../../../core/accessorSupport/decorators.js";import{canProjectWithoutEngine as a}from"../../../geometry/projectionUtils.js";import{isFeatureGraphicOrigin as o}from"../../../graphic/isFeatureGraphicOrigin.js";import{getEffectiveLayerCapabilities as s}from"../../../layers/support/layerUtils.js";import{FeatureLikeLayerView3D as p}from"./FeatureLikeLayerView3D.js";import n from"../../layers/FeatureLayerView.js";let l=class extends(p(n)){constructor(){super(...arguments),this.type="feature-3d"}initialize(){const{layer:e,view:i}=this;s(e)?.operations.supportsQuery||this.addResolvingPromise(Promise.reject(new r("featurelayerview:query-not-supported","layer view requires a layer with query capability",{layer:e}))),null!=e.infoFor3D&&this.addResolvingPromise(Promise.reject(new r("featurelayerview3d:unsupported-geometry-type",`Unsupported geometry type ${e.geometryType}`))),"mesh"!==e.geometryType||a(e.spatialReference,i.spatialReference)||this.addResolvingPromise(Promise.reject(new r("layerview:spatial-reference-incompatible","The spatial references of the feature layer is incompatible with the spatial reference of the view")))}get graphicOrigin(){const e=this.layer.graphicOrigin;if(!o(e))throw new r("featurelayerview3d:invalid-graphic-origin","Layer's graphic origin is not a FeatureGraphicOrigin");return e}get featureSpatialReference(){return this.view.featureTiles?.tilingScheme?.spatialReference}};e([i()],l.prototype,"graphicOrigin",null),l=e([t("esri.views.3d.layers.FeatureLayerView3D")],l);const c=l;export{c as default};
