"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("../cache-utils/idle-callback.js"),r=require("./constants.js"),a=require("./validateEnvelope.js");exports.useHydrateFromStorage=function(s,o){e.useEffect((function(){var e=o.current,c=t.scheduleIdleWork((function(){e.delete(c);try{var t=sessionStorage.getItem(r.STORAGE_KEY);if(!t)return;var o=JSON.parse(t),i=a.validateEnvelope(o);i&&(s.current={wellIds:i,timestamp:o.timestamp})}catch(e){sessionStorage.removeItem(r.STORAGE_KEY)}}),{timeout:2e3});return e.add(c),function(){t.cancelIdleWork(c),e.delete(c)}}),[s,o])};
//# sourceMappingURL=useHydrateFromStorage.js.map
