import{set as t}from"lodash";import{COMPLETION_APP_TYPES as a,COMPLETION_APPTYPE_MODES_DICT as e}from"../constants/completion.js";import{STREAM_SOURCE_TYPES as n,STREAM_STATUS as r}from"../constants/streamSourceType.js";var c=function(t,a,e){return e?"pad--".concat(e):t?"pad--".concat(t.current_pad_id||e):a?"well--".concat(a.id):"common"},s=function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:a.fracMultiWellApp,c={};return t?c={mode:e[r][0],selectedLine:void 0}:n&&(c={mode:"custom",selectedAssets:[n.id]}),c},o=function(a){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return a.reduce((function(a,c){var s=(c.app_streams||[]).find((function(t){return t.source_type===n.FRAC&&(e||t.status===r.ACTIVE)}));return!s||!s.last_active_at||a&&a.last_frac_at>s.last_active_at?a:t(c,"last_frac_at",s.last_active_at)}),null)},i=function(a){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return a.reduce((function(a,c){var s=(c.app_streams||[]).find((function(t){return t.source_type===n.WIRELINE&&(e||t.status===r.ACTIVE)}));return!s||!s.last_active_at||a&&a.last_wireline_at>s.last_active_at?a:t(c,"last_wireline_at",s.last_active_at)}),null)},u=function(a){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return a.reduce((function(a,c){var s=(c.app_streams||[]).find((function(t){return t.source_type===n.PUMPDOWN&&(e||t.status===r.ACTIVE)}));return!s||a&&a.last_pumpdown_at>s.last_active_at?a:t(c,"last_pumpdown_at",s.last_active_at)}),null)};export{c as getAssetKey,s as getDefaultPadModeSetting,o as resolveActiveFracAsset,u as resolveActivePumpdownAsset,i as resolveActiveWirelineAsset};
//# sourceMappingURL=completion.js.map
