import r from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/helpers/slicedToArray";import e from"@babel/runtime/regenerator";import{useState as n,useRef as i,useCallback as o,useEffect as s}from"react";import{fetchWellsByIds as a}from"../api/wells/fetchWellsByIds.js";import"lodash";import"@babel/runtime/helpers/toConsumableArray";import"@babel/runtime/helpers/defineProperty";import"uuid";import"lodash/set";import"lodash/get";import"lodash/unset";import"moment";import"../../../clients/jsonApi/index.js";import"../../../clients/subscriptions/constants.js";import"../../../clients/subscriptions.v1.js";import"../../../clients/subscriptions/subscriptions-client.factory.js";import"../../../clients/api/apiCore.js";import"../../../clients/constants.js";import"../../../clients/sso/auth0.js";import"../../../clients/sso/oauth2.js";import"../../../clients/api/rateLimiter.js";import"../constants.js";import"../api/shared/dataFormatter.js";import{usePickerPropsStore as c}from"../stores/picker-props-store/usePickerPropsStore.js";var u=function(u){var p=c((function(r){return r.addWellsUsabilityInfo})),l=n(null),m=t(l,2),f=m[0],b=m[1],h=n(!1),d=t(h,2),j=d[0],v=d[1],x=i(new Map),g=o(function(){var t=r(e.mark((function r(t){var n,i,o,s,c;return e.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(0!==t.length){r.next=3;break}return b([]),r.abrupt("return");case 3:if(0!==(n=t.filter((function(r){return!x.current.has(r)}))).length){r.next=8;break}return i=t.map((function(r){return x.current.get(r)})).filter((function(r){return void 0!==r})),b(i),r.abrupt("return");case 8:return v(!0),r.prev=9,r.next=12,a(n);case 12:if(o=r.sent,"function"!=typeof p){r.next=19;break}return r.next=16,p(o);case 16:r.t0=r.sent,r.next=20;break;case 19:r.t0=o;case 20:r.t0.forEach((function(r){x.current.set(r.id,r)})),s=t.map((function(r){return x.current.get(r)})).filter((function(r){return void 0!==r})),b(s),r.next=31;break;case 26:r.prev=26,r.t1=r.catch(9),console.error("Error fetching pinned wells:",r.t1),c=t.map((function(r){return x.current.get(r)})).filter((function(r){return void 0!==r})),b(c.length>0?c:null);case 31:return r.prev=31,v(!1),r.finish(31);case 34:case"end":return r.stop()}}),r,null,[[9,26,31,34]])})));return function(r){return t.apply(this,arguments)}}(),[p]);return s((function(){g(u||[])}),[u,g]),[f,j]};export{u as usePinnedWells};
//# sourceMappingURL=usePinnedWells.js.map
