import r from"@babel/runtime/helpers/asyncToGenerator";import e from"@babel/runtime/regenerator";import{fetchDataByChunks as t}from"../shared/fetchers/fetchDataByChunks.js";import{ID_CHUNK_SIZE as n,ASSET_FIELDS as a,CHUNK_SIZE as s}from"../shared/constants.js";import{transformAssetToOffsetWell as o}from"../shared/transformers/transformAssetToOffsetWell.js";import{assetsFetcher as u}from"../shared/fetchers/assetsFetcher.js";var p=function(){var p=r(e.mark((function r(p,c){var i,f,m,h;return e.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(p&&0!==p.length){r.next=2;break}return r.abrupt("return",[]);case 2:for(r.prev=2,i=[],f=0;f<p.length;f+=n)i.push(p.slice(f,f+n));return r.next=7,Promise.all(i.map((function(r){return t({path:"/v2/assets",queryParams:{parent_asset_id:r,types:["well"],company_id:c&&c.length>0?c:void 0,fields:a,sort:"name"},chunkSize:s,paginationStyle:"page",fetcher:u})})));case 7:return m=r.sent,h=m.flat(),r.abrupt("return",h.map((function(r){return o(r)})));case 12:return r.prev=12,r.t0=r.catch(2),console.error(r.t0),r.abrupt("return",[]);case 16:case"end":return r.stop()}}),r,null,[[2,12]])})));return function(r,e){return p.apply(this,arguments)}}();export{p as fetchWellsByRigIds};
//# sourceMappingURL=fetchWellsByRigIds.js.map
