"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/toConsumableArray"),t=require("react");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=l(e);exports.usePadTableHandlers=function(e){var l=e.pads,r=e.onOffsetWellIdsSelect,a=e.selectedOffsetWellIds,u=e.allWellIds;return{handleSelectPads:t.useCallback((function(e){return r(e?u:[])}),[u,r]),handleSelectPad:t.useCallback((function(e,t){var n=l.find((function(t){return t.id.toString()===e.toString()})).wells.map((function(e){return e.id}));if(t){var u=a.concat(n);r(u)}else{var c=a.filter((function(e){return!(null!=n&&n.includes(e))}));r(c)}}),[l,a,r]),handleSelectWellId:t.useCallback((function(e,t){if(t){var l=[].concat(n.default(a),[e]);r(l)}else{var u=a.filter((function(t){return t!==e}));r(u)}}),[a,r])}};
//# sourceMappingURL=usePadTableHandlers.js.map
