import t from"@babel/runtime/helpers/toConsumableArray";import"lodash";import{DEFAULT_ASSET_TYPE as n,ACTIVE_STATUS as e,ASSET_TYPE_SEARCH_PLACEHOLDERS as s,ASSET_TYPE_SEARCH_PLACEHOLDERS_NO_SECONDARY as a}from"../constants.js";import"../../../constants/goals.js";import"../../../constants/segment.js";import"../../../constants/alerts.js";import"../../../constants/apps.js";import"../../../constants/drillstring.js";import"../../../constants/completion.js";import"../../../constants/appPackages.js";import"../../../constants/notifications.js";import"../../../constants/feed.js";import"../../../constants/bha.js";import{ASSET_TYPES as i}from"../../../constants/assetTypes.js";import"../../../constants/corvaCompanyId.js";import"../../GradientManager/configuration/constants.js";var r=function(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return{sort:"name",order:"asc",fields:["".concat(n,".name"),"".concat(n,".status")].concat(t(e))}},o=function(t){var s=t.asset,a=t.group,r=void 0===a?null:a,o=t.activeWellId,l=void 0===o?null:o,c=t.isRequiredAssetId,p=t.isPrimaryAsset,u=t.isDrillingPlatformApp;if(!s)return null;var d,m,v,y={id:+s.assetId||+s.id,type:s.type,name:s.name};(c&&(y.id=+s.id,y.assetId=+s.assetId),r&&(y.group=r),s.type===i.rig.type)&&(y.activeWellId=Number(null===(d=s.activeWell)||void 0===d?void 0:d.id)||null,u&&(y.activeWellId=Number(null===(m=s.activeWell)||void 0===m?void 0:m.assetId)||null));"interventionUnit"===s.type&&(y.activeWellId=Number(null===(v=s.activeWell)||void 0===v?void 0:v.id)||null);return s.type!==i.well.type&&s.type!==n||(y.status=Number(s.id)===l?e:null),s.type===i.pad.type&&(y.parentFracFleetId=s.parentFracFleetId,y.status=s.active&&s.current?e:null,p&&!s.parentFracFleetId&&(y.status=null)),y},l=function(t){return t.status===e?-1:1},c=function(n,e,s){var a=t(e);return n!==i.rig.type&&n!==i.intervention_unit.type||a.push("".concat(n,".active_well")),s?[].concat(t(a),["rig.active_child"]):a},p=function(t){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],e=n?s:a;return e[t]||"Search..."};export{o as formatAsset,c as getPrimaryAssetFields,r as getRequestOptions,p as getSearchPlaceholder,l as sortAsset};
//# sourceMappingURL=index.js.map
