/*
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","../request","../geometry/support/normalizeUtils","./utils","./operations/identify","./support/IdentifyParameters","./support/IdentifyResult"],(function(e,t,r,n,s,o,u,i){"use strict";function a(e,t,r){return l.apply(this,arguments)}function l(){return(l=t._asyncToGenerator((function*(e,t,u){const i=(t=c(t)).geometry?[t.geometry]:[],a=s.parseUrl(e);return a.path+="/identify",n.normalizeCentralMeridian(i).then((e=>{const n=o.identifyToIdentifyRESTParameters(t,{geometry:e&&e[0]}),i=s.encode({...a.query,f:"json",...n}),l=s.asValidOptions(i,u);return r(a.path,l).then(f).then((e=>p(e,t.sublayers)))}))}))).apply(this,arguments)}function f(e){const t=e.data;t.results=t.results||[];const r={results:[]};return r.results=t.results.map((e=>i.fromJSON(e))),r}function c(e){return e=u.from(e)}function p(e,t){if(null==t||!t.length)return e;const r=new Map;function n(e){r.set(e.id,e),e.sublayers&&e.sublayers.forEach(n)}t.forEach(n);for(const s of e.results)s.feature.sourceLayer=r.get(s.layerId);return e}e.identify=a,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
