"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/toConsumableArray"),l=require("@babel/runtime/helpers/slicedToArray"),t=require("react");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=a(e),u=a(l);exports.useModalHandlers=function(e){var l=e.pads,a=e.selectedOffsetWellIds,r=e.onOffsetWellsSelect,s=t.useState(a),c=u.default(s,2),d=c[0],o=c[1],f=t.useState([]),i=u.default(f,2),b=i[0],p=i[1],C=t.useState(!1),S=u.default(C,2),h=S[0],O=S[1],k=t.useCallback((function(){return O(!1)}),[]),v=t.useCallback((function(){p(n.default(d)),O(!0)}),[d]),M=t.useCallback((function(){O(!1);var e=l.flatMap((function(e){return e.wells})).filter((function(e){return d.includes(e.id)}));r(e)}),[d,r,l]),W=t.useCallback((function(){o(b),O(!1)}),[b]),y=t.useCallback((function(){o([])}),[]);return{isModalOpen:h,handleCloseModal:k,handleOpenModal:v,handleSaveSelectedWellIds:M,handleCancelButtonClick:W,localSelectedOffsetWellIds:d,setLocalSelectedOffsetWellIds:o,handleResetSelection:y}};
//# sourceMappingURL=useModalHandlers.js.map
