import r from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/regenerator";import{ASSET_FIELDS as e,CHUNK_SIZE as n}from"../constants.js";import{transformAssetToOffsetWell as a}from"../transformers/transformAssetToOffsetWell.js";import{fetchDataByChunks as o}from"./fetchDataByChunks.js";import{assetsFetcher as s}from"./assetsFetcher.js";var l=function(){var l=r(t.mark((function r(l,i,u){var c,p,m,f;return t.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return p=(c=null!=u?u:{}).signal,m=c.drillingWells,r.prev=1,r.next=4,o({path:"/v2/assets",queryParams:{types:["well"],company_id:i&&i.length>0?i:void 0,last_active_drilling_after:m?1:void 0,fields:e,sort:"name",lat_start:l.lat_start,lat_end:l.lat_end,long_start:l.long_start,long_end:l.long_end},chunkSize:n,paginationStyle:"page",fetcher:s,signal:p});case 4:return f=r.sent,r.abrupt("return",f.map((function(r){return a(r)})));case 8:if(r.prev=8,r.t0=r.catch(1),"AbortError"!==(null===r.t0||void 0===r.t0?void 0:r.t0.name)){r.next=12;break}throw r.t0;case 12:return console.error(r.t0),r.abrupt("return",[]);case 14:case"end":return r.stop()}}),r,null,[[1,8]])})));return function(r,t,e){return l.apply(this,arguments)}}();export{l as getAssetsByBounds};
//# sourceMappingURL=getAssetsByBounds.js.map
