/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["exports","../../../../chunks/_rollupPluginBabelHelpers","../../../../chunks/tslib.es6","../../../../core/AsyncUpdate","../../../../core/HandleOwner","../../../../core/Logger","../../../../core/maybe","../../../../core/accessorSupport/decorators/property","../../../../core/arrayUtils","../../../../core/has","../../../../core/accessorSupport/ensureType","../../../../core/accessorSupport/decorators/subclass","../../../../layers/support/fieldUtils"],(function(e,r,i,t,s,l,o,n,d,a,c,u,p){"use strict";const y=l.getLogger("esri.views.3d.layers.support.SceneLayerViewRequiredFields");function F(e){return w.apply(this,arguments)}function w(){return(w=r._asyncToGenerator((function*(e){const r=new Set;try{return yield e(r),Array.from(r).sort()}catch(i){return y.error(i),null}}))).apply(this,arguments)}e.SceneLayerViewRequiredFields=function(e){function i(r){return e.call(this,r)||this}return r._inheritsLoose(i,e),i.prototype.initialize=function(){const e=this.layerView.layer;this.layer=e,this.handles.add([this.autoUpdateAsync("rendererFields",(()=>{const{fieldsIndex:e,renderer:r}=this.layer;return r?F((i=>r.collectRequiredFields(i,e))):null})),this.autoUpdateAsync("labelingFields",(()=>{const{layer:e}=this;return e.labelsVisible?F((r=>p.collectLabelingFields(r,e))):null})),this.autoUpdateAsync("viewFilterFields",(()=>{const{layer:e,filter:r}=this.layerView;return F((i=>p.collectFilterFields(i,e,r)))}))])},r._createClass(i,[{key:"requiredFields",get:function(){const{layerView:{layer:{fieldsIndex:e},definitionExpressionFields:r},rendererFields:i,labelingFields:t,viewFilterFields:s}=this;return p.fixFields(e,[...o.unwrapOr(r,[]),...o.unwrapOr(i,[]),...o.unwrapOr(t,[]),...o.unwrapOr(s,[])])}}]),i}(t.AsyncUpdateMixin(s.HandleOwner)),i.__decorate([n.property()],e.SceneLayerViewRequiredFields.prototype,"layerView",void 0),i.__decorate([n.property()],e.SceneLayerViewRequiredFields.prototype,"layer",void 0),i.__decorate([n.property()],e.SceneLayerViewRequiredFields.prototype,"requiredFields",null),i.__decorate([n.property()],e.SceneLayerViewRequiredFields.prototype,"rendererFields",void 0),i.__decorate([n.property()],e.SceneLayerViewRequiredFields.prototype,"labelingFields",void 0),i.__decorate([n.property()],e.SceneLayerViewRequiredFields.prototype,"viewFilterFields",void 0),e.SceneLayerViewRequiredFields=i.__decorate([u.subclass("esri.views.3d.layers.support.SceneLayerViewRequiredFields")],e.SceneLayerViewRequiredFields),Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
