!function(e){"object"==typeof module&&"object"==typeof module.exports?e(require,exports):"function"==typeof define&&define.amd&&define(["require","exports","tslib","../../Validation","./tools","./ArcGisApiVersion"],e)}(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var x=e("tslib"),g=e("../../Validation"),F=e("./tools"),a=e("./ArcGisApiVersion");function h(e,t){for(var i=e.attributes,r=0,s=t;r<s.length;r++)delete i[s[r]];a.isArcGisApiVersion3x?e.setAttributes(i):e.attributes=i}i.prototype.execute=function(e,t){for(var i=F.featuresToArray(g.validation.exists("features",e.features)),r=g.validation.array("fields",e.fields,[]),s=g.validation.boolean("removeEmptyFields",e.removeEmptyFields,!1),a={},l=0,n=i;l<n.length;l++){var o,f=(c=n[l]).attributes;if(null!=f&&(h(c,r),s))for(var u in f)u in a||(a[u]=!1),a[u]||null!=(o=f[u])&&""!==o&&(a[u]=!0)}var d=[];if(s&&0<(d=Object.keys(a).filter(function(e){return!a[e]&&-1===r.indexOf(e)})).length)for(var c,v=0,p=i;v<p.length;v++)null!=(f=(c=p[v]).attributes)&&h(c,d);if(F.isFeatureSet(e.features)){var b=e.features,A=x.__spreadArrays(r,d);if(b.fields&&(b.fields=b.fields.filter(function(e){return-1===A.indexOf(e.name)})),b.fieldAliases){for(var e=b.fieldAliases,y=0,m=A;y<m.length;y++){u=m[y];delete b.fieldAliases[u]}b.fieldAliases=e}}i=i.slice(0);return{feature:i[0],features:i}},i.action="gcx:wf:arcgis::RemoveFeatureSetFields",i.suite="gcx:wf:builtin",e=i;function i(){}t.RemoveFeatureSetFields=e});