/* COPYRIGHT Esri - https://js.arcgis.com/5.1.2/LICENSE.txt */
import t from"../../request.js";import{fromJSON as e}from"../../geometry/support/jsonUtils.js";import{srToRESTValue as o}from"../../geometry/support/spatialReferenceUtils.js";import{parseUrl as r,asValidOptions as s}from"../utils.js";function p(p,i,n){const a=i.map(t=>t.toJSON()),m=i[0].spatialReference,l=r(p),f={...l.query,f:"json",sr:o(m),polygons:JSON.stringify(a)},u=s(f,n);return t(l.path+"/labelPoints",u).then(({data:t})=>(t.labelPoints||[]).map(t=>e(t).set({spatialReference:m})))}export{p as labelPoints};
