import e from"@babel/runtime/helpers/defineProperty";import r from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/regenerator";import{get as n}from"lodash";import{ROWS_PER_PAGE as o}from"../../constants.js";import{dataFormatter as a}from"../shared/dataFormatter.js";import{getRigs as i}from"../../../../clients/jsonApi/index.js";function c(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function s(r){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(Object(n),!0).forEach((function(t){e(r,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(n,e))}))}return r}var p=function(){var e=r(t.mark((function e(r,c,p){var u,l,f,m;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return u=["rig.name","rig.active_well","rig.asset_id"],l={company:p&&p.length>0?p:void 0,search:r,per_page:o,page:c,fields:u,sort:"name"},e.prev=2,e.next=5,i(l);case 5:f=e.sent,e.next=12;break;case 8:e.prev=8,e.t0=e.catch(2),console.error(e.t0),f=[];case 12:return m=a.deserialize(f),e.abrupt("return",m.map((function(e){return s({redirectAssetId:n(e,["active_well","asset_id"])||null},e)})));case 14:case"end":return e.stop()}}),e,null,[[2,8]])})));return function(r,t,n){return e.apply(this,arguments)}}();export{p as fetchRigs};
//# sourceMappingURL=fetchRigs.js.map
