import e from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/toConsumableArray";import{useMemo as r}from"react";import{TableColumns as n,ColumnType as o}from"../../../constants.js";import{usePickerPropsStore as i}from"../../../stores/picker-props-store/usePickerPropsStore.js";function c(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function f(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?c(Object(n),!0).forEach((function(r){e(t,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var u=new Set([o.rig,o.distance,o.taScore]),p=new Set([o.interventionAsset,o.padName,o.formation]),s=function(e){var c=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],s=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],a=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],l=i((function(e){return e.segment}));return r((function(){if(!e)return null;var r=Math.min(e.length,3),i="intervention"===l,m=c?n:n.filter((function(e){return e.type!==o.company}));return s||(m=m.filter((function(e){return e.type!==o.wellSection}))),a||(m=m.filter((function(e){return e.type!==o.distance}))),(m=i?m.filter((function(e){return!u.has(e.type)})):m.filter((function(e){return!p.has(e.type)}))).reduce((function(n,i){return i.type===o.metrics?[].concat(t(n),t(e.map((function(e){return f(f({},i),{},{key:e,minWidth:i.minWidth[r],flex:i.flex})})))):[].concat(t(n),[f(f({},i),{},{minWidth:i.minWidth[r],flex:i.flex})])}),[])}),[e,c,s,a,l])};export{s as useTableColumns};
//# sourceMappingURL=useTableColumns.js.map
