import t from"@babel/runtime/helpers/asyncToGenerator";import r from"@babel/runtime/helpers/slicedToArray";import e from"@babel/runtime/regenerator";import{useState as s,useEffect as i}from"react";import{fetchWellsByIds as o}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";var n=function(n){var p=s(null),a=r(p,2),l=a[0],c=a[1],m=s(!1),u=r(m,2),f=u[0],h=u[1];return i((function(){if(!n||n<=0)return c(null),void h(!1);var r=!1,s=n;function i(){return(i=t(e.mark((function t(){var i;return e.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return h(!0),t.prev=1,t.next=4,o([s]);case 4:i=t.sent,!r&&i&&i.length>0&&c(i[0]),t.next=12;break;case 8:t.prev=8,t.t0=t.catch(1),console.error("Error fetching subject well:",t.t0),r||c(null);case 12:return t.prev=12,r||h(!1),t.finish(12);case 15:case"end":return t.stop()}}),t,null,[[1,8,12,15]])})))).apply(this,arguments)}return function(){i.apply(this,arguments)}(),function(){r=!0}}),[n]),[l,f]};export{n as useFetchSubjectWell};
//# sourceMappingURL=useFetchSubjectWell.js.map
