import{__spreadArray as e}from'./../../../ext-esm/tslib/tslib.es6.js';import{useMemo as t}from"react";import{AssetStatus as r}from"../types.js";import{DEFAULT_SUPPORTED_PAD_MODES as n}from"../../../constants/completion.js";import{flatten as o,partition as s}from"lodash";import{getMenuItemKey as a}from"../utils/selectMenuKey.js";import{PadMode as i}from"../../../types/shared/Completions.js";var c=function(t,n){void 0===n&&(n=!1);var c=t.reduce((function(t,r){return e(e([],t,!0),[{key:a(i.custom,r.id),label:"".concat(r.name),assetId:r.asset_id,wellId:r.id,status:r.status,isSubItem:n}],!1)}),[]);return o(s(c,{status:r.active}))};function l(e){var r=e.completionAppType,o=e.assets,s=e.fracFleetLines,l=e.enableSimulFracInPadSelect;return t((function(){if(l&&s.length){var e=s.reduce((function(e,t){var r=[{key:a(i.padLine,t.id),label:t.name}],n=c(t.frac_fleet_line_wells,!0);return n.length?e.concat(r.concat(n)):e}),[]);return e}var t=c(o);return n.concat(t)}),[r,o,s,l])}export{l as useMenuItems};
