import{useRef as r,useEffect as e}from"react";import{useStore as o}from"zustand";import"lodash";import"../../stores/picker-props-store/PickerPropsStoreContext.js";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/objectWithoutProperties";import"react/jsx-runtime";import"../../viewport/ViewportProvider.js";import"../../viewport/ViewportContext.js";import{usePickerPropsStore as t}from"../../stores/picker-props-store/usePickerPropsStore.js";import"../../stores/company-safeguard/CompanySafeguardContext.js";import{useCompanySafeguard as s}from"../../stores/company-safeguard/useCompanySafeguard.js";import{useLoadAllWellsCallback as l}from"./useLoadAllWellsCallback.js";import{useCompanyIdChangeEffect as a}from"./useCompanyIdChangeEffect.js";import{useDrillingFilterChangeEffect as i}from"./useDrillingFilterChangeEffect.js";var n=function(){var n=t((function(r){return r.open})),p=t((function(r){return r.setAllWellsLoadProgress})),u=t((function(r){return r.setShouldRecenter})),c=s().isSafeguardReady,m=r(null),f=r(!1),d=l(m,f),h=d.loadAllWells,C=d.store,j=d.clearCache,g=o(C,(function(r){return r.clearTiles}));e((function(){return g(),function(){var r;null===(r=m.current)||void 0===r||r.abort(),g(),p(null),u(!0)}}),[g,p,u]),e((function(){n?c&&!f.current&&h():f.current=!1}),[n,c,h]),a({clearCache:j,clearTiles:g,loadAllWells:h,hasLoadedRef:f}),i({clearCache:j,clearTiles:g,loadAllWells:h,hasLoadedRef:f})};export{n as useAllWells};
//# sourceMappingURL=useAllWells.js.map
